/* Finepoint Interactive */

@font-face {
  font-family: "Montserrat";
  src: url("assets/fonts/montserrat-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("assets/fonts/jetbrains-mono-latin.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #fff;
  --ink-soft: rgba(255, 255, 255, .64);
  --ink-faint: rgba(255, 255, 255, .34);
  --rule: rgba(255, 255, 255, .3);
  --dirt: #fd7201; /* Real Dirt orange: the one colour on an otherwise black-and-white page */
  --sans: "Montserrat", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --edge: clamp(14px, 2.2vw, 28px);
  --inset: calc(var(--edge) + clamp(12px, 3vw, 28px)); /* edge text sits inside the corner marks, clear of the cursor's lock frame */
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: #000;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  overflow-x: hidden;
  background: #000;
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

::selection {
  background: var(--dirt);
  color: #000;
}

:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 5px;
}

/* ---------- background ---------- */

.field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  animation: fade-in 2.8s .15s ease-out backwards;
}

/* Registration marks in the four corners. */
.frame {
  --mark: linear-gradient(var(--ink-faint), var(--ink-faint));
  position: fixed;
  inset: var(--edge);
  z-index: 1;
  pointer-events: none;
  background:
    var(--mark) top left / 14px 1px,
    var(--mark) top left / 1px 14px,
    var(--mark) top right / 14px 1px,
    var(--mark) top right / 1px 14px,
    var(--mark) bottom left / 14px 1px,
    var(--mark) bottom left / 1px 14px,
    var(--mark) bottom right / 14px 1px,
    var(--mark) bottom right / 1px 14px;
  background-repeat: no-repeat;
  animation: fade-in 1.2s 2.3s ease-out backwards;
}

/* ---------- centre stage ---------- */

.stage {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: clamp(40px, 9vh, 84px) var(--edge);
  text-align: center;
}

/* Soft black scrim so the type stays crisp where it overlaps the terrain. */
.stage::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  z-index: -1;
  width: min(100%, 1040px);
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(0, 0, 0, .84) 34%, rgba(0, 0, 0, .46) 66%, transparent);
  pointer-events: none;
}

.logo {
  position: relative;
  /* Grows on big screens, and never takes more than about a quarter of a short screen's height. */
  width: min(84vw, max(720px, 38vw), 111vh);
  margin: 0;
  line-height: 0;
}

.logo img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 0 26px rgba(255, 255, 255, .16));
  user-select: none;
  -webkit-user-drag: none;
  animation: logo-in 1.5s .35s cubic-bezier(.7, 0, .2, 1) backwards;
}

/* The line of light that draws the logo in. It animates `left`, not a transform, so its
   resting place at the right edge adds nothing to the page's scroll width. */
.logo__beam {
  position: absolute;
  top: -22%;
  bottom: -22%;
  left: 0;
  width: 1px;
  background: linear-gradient(transparent, #fff 18%, #fff 82%, transparent);
  box-shadow: 0 0 16px 1px rgba(255, 255, 255, .7);
  opacity: 0;
  pointer-events: none;
  animation: beam 1.5s .35s cubic-bezier(.7, 0, .2, 1) both;
}

.motto {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5em;
  margin: clamp(14px, 4.2vh, 40px) 0 0;
  color: rgba(255, 255, 255, .88);
  font-size: clamp(.6875rem, .5rem + .45vw, 1.125rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: .62em;
  text-transform: uppercase;
  white-space: nowrap;
  animation: motto-in 1.5s 1.45s var(--ease) backwards;
}

/* Cancel the trailing letter-space so the words sit dead centre. */
.motto span {
  margin-right: -.62em;
}

.motto::before,
.motto::after {
  content: "";
  width: clamp(20px, 7vw, 84px);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--rule));
}

.motto::after {
  transform: scaleX(-1);
}

.game {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: clamp(22px, 8.5vh, 84px);
  animation: lift 1.1s 1.9s var(--ease) backwards;
}

.game__label {
  margin: 0 -.32em 0 0;
  color: var(--ink-soft);
  font: 400 .6875rem/1 var(--mono);
  letter-spacing: .32em;
  text-transform: uppercase;
}

.game__link {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 17px 20px 17px 22px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .36);
  background: rgba(0, 0, 0, .55);
  color: var(--ink);
  font-size: clamp(.8125rem, .7rem + .2vw, 1rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: .32em;
  text-decoration: none;
  text-transform: uppercase;
  transition: color .3s var(--ease), border-color .3s var(--ease);
}

.game__link::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--dirt);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform .5s var(--ease);
}

.game__link:hover,
.game__link:focus-visible {
  border-color: var(--dirt);
  color: #000;
}

.game__link:hover::before,
.game__link:focus-visible::before {
  transform: scaleX(1);
}

.game__pip {
  width: 6px;
  height: 6px;
  background: var(--dirt);
  transition: background-color .3s var(--ease);
  animation: pip 2.4s ease-in-out infinite;
}

.game__link:hover .game__pip,
.game__link:focus-visible .game__pip {
  background: #000;
}

.game__name {
  margin-right: -.32em;
}

.game__arrow {
  transition: transform .4s var(--ease);
}

.game__link:hover .game__arrow,
.game__link:focus-visible .game__arrow {
  transform: translateX(5px);
}

/* ---------- edges ---------- */

.readout,
.foot {
  position: fixed;
  z-index: 2;
  margin: 0;
  color: var(--ink-soft);
  font: 400 .65625rem/1 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  animation: fade-in 1.2s 2.3s ease-out backwards;
}

.readout {
  top: var(--inset);
  right: var(--inset);
  display: flex;
  gap: 1.6em;
  color: var(--ink-faint);
  white-space: pre;
}

.readout b {
  color: var(--ink-soft);
  font-weight: 400;
}

.foot {
  right: var(--inset);
  bottom: var(--inset);
  left: var(--inset);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  white-space: nowrap;
}

.foot small {
  font-size: inherit;
}

.motion {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: -10px -12px;
  padding: 10px 12px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  transition: color .2s;
}

.motion:hover,
.motion:focus-visible {
  color: var(--ink);
}

.motion:focus-visible {
  outline-offset: -2px;
}

.motion__icon {
  width: 7px;
  height: 8px;
  border-inline: 2px solid currentColor;
}

.is-paused .motion__icon {
  width: 0;
  border-block: 4px solid transparent;
  border-inline: 7px solid currentColor;
  border-inline-end-width: 0;
}

.is-paused .game__pip,
.is-paused .cursor__ring::before {
  animation-play-state: paused;
}

/* ---------- cursor ---------- */

/* main.js adds .has-cursor on the first mouse movement; until then the system pointer stays. */
.has-cursor,
.has-cursor * {
  cursor: none !important;
}

.cursor {
  position: fixed;
  inset: 0;
  z-index: 10;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: difference;
  transition: opacity .25s;
}

.cursor.is-on {
  opacity: 1;
}

.cursor__ring,
.cursor__dot {
  position: absolute;
  top: 0;
  left: 0;
  will-change: transform;
}

.cursor__ring {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, .85);
  border-radius: 20px;
}

/* Four ticks orbiting the ring. */
.cursor__ring::before {
  --tick: linear-gradient(#fff, #fff);
  content: "";
  position: absolute;
  inset: -10px;
  background:
    var(--tick) 50% 0 / 1px 6px,
    var(--tick) 50% 100% / 1px 6px,
    var(--tick) 0 50% / 6px 1px,
    var(--tick) 100% 50% / 6px 1px;
  background-repeat: no-repeat;
  transition: opacity .2s;
  animation: orbit 14s linear infinite;
}

.cursor__dot::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 5px;
  margin: -2.5px;
  border-radius: 50%;
  background: #fff;
  transition: transform .25s var(--ease);
}

/* Locked onto a link or button: the ring becomes a frame around it. */
.cursor.is-locked .cursor__ring::before {
  opacity: 0;
}

.cursor.is-locked .cursor__dot::after {
  transform: scale(0);
}

/* ---------- motion ---------- */

@keyframes fade-in {
  from { opacity: 0; }
}

@keyframes logo-in {
  from { clip-path: inset(-25% 100% -25% -5%); }
  to { clip-path: inset(-25% 0% -25% -5%); }
}

@keyframes beam {
  0% { left: 0; opacity: 0; }
  8%, 88% { opacity: 1; }
  100% { left: calc(100% - 1px); opacity: 0; }
}

@keyframes motto-in {
  from { opacity: 0; letter-spacing: 1em; }
}

@keyframes lift {
  from { opacity: 0; transform: translateY(10px); }
}

@keyframes pip {
  50% { opacity: .3; }
}

@keyframes orbit {
  to { transform: rotate(360deg); }
}

@media (max-width: 380px) {
  .motto::before,
  .motto::after {
    display: none;
  }

  .foot {
    letter-spacing: .08em;
  }

  /* Icon-only toggle; the button keeps its aria-label. */
  .motion__label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: .01ms !important;
  }
}
