/* Gradient Ascent: homepage.
   Colours, type and the code palette follow the game (src/styles.css and src/ui/Editor.tsx). */

@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("../fonts/plex-sans-latin-var.woff2") format("woff2");
  font-weight: 100 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/plex-mono-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/plex-mono-latin-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/plex-mono-latin-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

:root {
  color-scheme: dark;

  --ink: #04090b;
  --ink-1: #060e11;
  --ink-2: #081417;
  --surface: linear-gradient(166deg, rgb(16 36 44 / 0.62) 0%, rgb(7 17 22 / 0.86) 56%, rgb(4 10 14 / 0.94) 100%);
  --line: rgb(138 212 216 / 0.16);
  --line-strong: rgb(138 212 216 / 0.32);
  --rim: rgb(182 242 244 / 0.12);
  --text: #e2f0f0;
  --muted: #bdd4d6;
  --dim: #95b4b7;
  --cyan: #5fe3e0;
  --cyan-hi: #8cf2ef;
  --amber: #ffb454;
  --crt: #f7cf92;
  --crt-bg: rgb(22 13 5 / 0.86);
  --crt-line: rgb(255 180 84 / 0.34);
  --ok: #8de39e;
  --bad: #ff8f7a;
  --rival: #a77dff;

  --dawn-0: #f5e9d2;
  --dawn-1: #efdcb9;
  --dawn-2: #e4c08a;
  --dawn-ink: #1d1609;
  --dawn-muted: #4f4129;

  --display: "Inter", ui-sans-serif, system-ui, sans-serif;
  --sans: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --gutter: clamp(20px, 5vw, 56px);
  --wrap: 1240px;
  --radius: 18px;
  --topbar-h: 64px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

/* Base */

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

html {
  background: var(--ink);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--topbar-h) + 12px);
}

html:has(dialog[open]) {
  overflow: hidden;
}

body {
  margin: 0;
  min-height: 100svh;
  background: var(--ink);
  color: var(--text);
  font: 400 1.0625rem/1.6 var(--sans);
  font-size-adjust: from-font;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

h1,
h2,
h3,
p,
figure,
blockquote,
dl,
dd,
ol,
ul {
  margin: 0;
}

ol,
ul {
  padding: 0;
  list-style: none;
}

img,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

img,
video {
  height: auto;
}

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
}

code,
kbd,
pre {
  font-family: var(--mono);
}

cite {
  font-style: normal;
}

:focus-visible {
  outline: 2px solid var(--cyan-hi);
  outline-offset: 3px;
}

::selection {
  background: rgb(95 227 224 / 0.3);
  color: #fff;
}

.wrap {
  width: min(var(--wrap), 100% - 2 * var(--gutter));
  margin-inline: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.nowrap {
  white-space: nowrap;
}

[hidden] {
  display: none !important;
}

.skip {
  position: fixed;
  top: 12px;
  left: 16px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--cyan);
  color: #031012;
  font-weight: 600;
  text-decoration: none;
  translate: 0 -160%;
  transition: translate 0.2s var(--ease-out);
}

.skip:focus-visible {
  translate: 0 0;
}

/* Type */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.75em;
  color: var(--cyan);
  font: 500 0.75rem/1.2 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.6;
}

.display-xl {
  font: 720 clamp(3rem, 8.2vw, 7.75rem) / 0.94 var(--display);
  letter-spacing: -0.042em;
  text-wrap: balance;
}

.display-l {
  font: 680 clamp(2.2rem, 4.6vw, 4.1rem) / 1.02 var(--display);
  letter-spacing: -0.034em;
  text-wrap: balance;
}

.display-m {
  font: 650 clamp(1.7rem, 2.7vw, 2.5rem) / 1.1 var(--display);
  letter-spacing: -0.026em;
  text-wrap: balance;
}

.lede {
  max-width: 58ch;
  color: var(--muted);
  font-size: clamp(1.07rem, 1.3vw, 1.22rem);
  line-height: 1.62;
  text-wrap: pretty;
}

p {
  text-wrap: pretty;
}

.fine {
  color: var(--dim);
  font-size: 0.875rem;
  line-height: 1.55;
}

.fine a {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  color: var(--cyan-hi);
  text-underline-offset: 3px;
}

.fine a svg {
  width: 1em;
  height: 1em;
}

/* Buttons */

.btn {
  --h: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55em;
  min-height: var(--h);
  padding: 0 1.15em;
  border: 1px solid transparent;
  border-radius: 999px;
  background: none;
  font: 600 0.95rem/1 var(--sans);
  letter-spacing: 0.005em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color 0.2s,
    border-color 0.2s,
    color 0.2s,
    box-shadow 0.3s,
    scale 0.16s var(--ease-out);
}

.btn svg {
  flex: none;
  width: 1.1em;
  height: 1.1em;
}

.btn > svg:last-child {
  transition: translate 0.3s var(--ease-out);
}

.btn:active:not(:disabled) {
  scale: 0.97;
}

.btn:disabled {
  cursor: default;
  opacity: 0.42;
}

.btn--sm {
  --h: 36px;
  padding: 0 1em;
  font-size: 0.875rem;
}

.btn--lg {
  --h: 54px;
  padding: 0 1.5em;
  font-size: 1.02rem;
}

.btn--primary {
  background: var(--cyan);
  color: #031012;
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.35),
    0 10px 34px -10px rgb(95 227 224 / 0.6);
}

.btn--glass {
  border-color: rgb(182 242 244 / 0.22);
  background: rgb(8 20 24 / 0.42);
  color: var(--text);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
}

.btn__meta {
  margin-left: 0.15em;
  padding-left: 0.65em;
  border-left: 1px solid var(--line-strong);
  color: var(--dim);
  font: 500 0.78rem/1 var(--mono);
}

.btn--run {
  background: var(--ok);
  color: #05170b;
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.35),
    0 8px 26px -10px rgb(141 227 158 / 0.55);
}

.btn--run kbd {
  margin-left: 0.2em;
  padding: 3px 6px;
  border-radius: 5px;
  background: rgb(5 23 11 / 0.14);
  color: rgb(5 23 11 / 0.72);
  font: 500 0.68rem/1 var(--mono);
}

.btn--quiet {
  border-color: var(--line-strong);
  color: var(--muted);
}

.btn--quiet span {
  color: var(--dim);
  font: 500 0.78rem/1 var(--mono);
}

.btn--ink {
  background: var(--dawn-ink);
  color: var(--dawn-0);
  box-shadow: 0 14px 36px -14px rgb(29 22 9 / 0.7);
}

.btn--line {
  border-color: rgb(29 22 9 / 0.3);
  color: var(--dawn-ink);
}

@media (hover: hover) {
  .btn--primary:hover {
    background: var(--cyan-hi);
    box-shadow:
      inset 0 1px 0 rgb(255 255 255 / 0.4),
      0 12px 44px -8px rgb(95 227 224 / 0.75);
  }
  .btn--glass:hover {
    border-color: rgb(182 242 244 / 0.42);
    background: rgb(12 30 36 / 0.62);
  }
  .btn--run:hover:not(:disabled) {
    background: #a6efb4;
  }
  .btn--quiet:hover:not(:disabled) {
    border-color: rgb(138 212 216 / 0.55);
    color: var(--text);
  }
  .btn--ink:hover {
    background: #2b2210;
  }
  .btn--line:hover {
    border-color: rgb(29 22 9 / 0.6);
    background: rgb(29 22 9 / 0.05);
  }
  .btn:hover > svg:last-child {
    translate: 2px -2px;
  }
}

@media (hover: none) {
  kbd {
    display: none;
  }
}

/* Top bar */

.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 20px;
  height: var(--topbar-h);
  padding-inline: var(--gutter);
  border-bottom: 1px solid transparent;
  transition:
    background-color 0.35s,
    border-color 0.35s;
}

.topbar::before {
  content: "";
  position: absolute;
  inset: 0 0 -28px;
  z-index: -1;
  background: linear-gradient(rgb(4 9 11 / 0.72), rgb(4 9 11 / 0));
  pointer-events: none;
  transition: opacity 0.35s;
}

.topbar.is-solid {
  border-bottom-color: var(--line);
  background: rgb(4 9 11 / 0.74);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
}

.topbar.is-solid::before {
  opacity: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  text-decoration: none;
}

.brand__mark {
  width: 26px;
  height: 26px;
  color: var(--cyan);
  filter: drop-shadow(0 0 8px rgb(95 227 224 / 0.6));
}

.brand__name {
  font: 650 1rem/1 var(--display);
  letter-spacing: -0.015em;
}

.brand__place {
  margin-left: 4px;
  padding-left: 12px;
  border-left: 1px solid var(--line-strong);
  color: var(--dim);
  font: 500 0.7rem/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hud-pill {
  position: absolute;
  left: 50%;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgb(6 16 20 / 0.55);
  color: var(--dim);
  font: 500 0.76rem/1 var(--mono);
  font-variant-numeric: tabular-nums;
  translate: -50% 0;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.hud-pill b {
  color: var(--text);
  font-weight: 500;
  transition: color 0.4s;
}

.hud-pill [data-hud-loss] {
  color: var(--cyan-hi);
}

.hud-pill.is-drop [data-hud-loss] {
  color: var(--ok);
}

.hud-pill .sep {
  opacity: 0.5;
}

.hud-pill__live {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
}

.topnav {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.topnav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.9rem;
  text-decoration: none;
  transition:
    color 0.2s,
    background-color 0.2s;
}

@media (hover: hover) {
  .topnav a:hover {
    background: rgb(138 212 216 / 0.08);
    color: var(--text);
  }
}

.topbar > .btn {
  margin-left: 8px;
}

@media (max-width: 1180px) {
  .brand__place {
    display: none;
  }
}

@media (max-width: 960px) {
  .topnav {
    display: none;
  }
  .topbar > .btn {
    margin-left: auto;
  }
}

@media (max-width: 640px) {
  .hud-pill {
    display: none;
  }
}

/* The climb rail: where the page is in the tower */

.rail {
  position: fixed;
  top: 50%;
  right: max(18px, (100vw - var(--wrap)) / 2 - 76px);
  z-index: 40;
  display: none;
  translate: 0 -50%;
  color: var(--dim);
  font: 500 0.66rem/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  pointer-events: none;
  transition: opacity 0.4s;
}

@media (min-width: 1560px) {
  .rail {
    display: block;
  }
}

.rail.is-hidden {
  opacity: 0;
}

.rail__track {
  position: relative;
  display: grid;
  gap: 38px;
  justify-items: end;
  padding-right: 18px;
}

.rail__track::after {
  content: "";
  position: absolute;
  top: 4px;
  right: 3px;
  bottom: 4px;
  width: 1px;
  background: linear-gradient(var(--line-strong), var(--line));
}

.rail__track li {
  transition: color 0.4s;
}

.rail__track li.is-on {
  color: var(--text);
}

.rail__dot {
  position: absolute;
  top: 0;
  right: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow:
    0 0 0 4px rgb(95 227 224 / 0.16),
    0 0 14px var(--cyan);
  translate: 0 calc(var(--rail, 0) * 1px);
  transition: translate 0.9s var(--ease-out);
}

.rail__read {
  display: grid;
  gap: 6px;
  margin-top: 30px;
  padding-right: 18px;
  text-align: right;
}

.rail__read b {
  color: var(--text);
  font-weight: 500;
}

.rail__read [data-rail-name] {
  display: none;
}

.rail__mods b {
  font-variant-numeric: tabular-nums;
}

/* Hero */

.hero {
  position: relative;
  display: grid;
  align-items: end;
  min-height: max(100svh, 620px);
  overflow: clip;
  isolation: isolate;
}

.hero__media {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: #020607;
}

.hero__poster img,
.hero__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__video {
  opacity: 0;
  transition: opacity 1s var(--ease-out);
}

.hero.is-live .hero__video {
  opacity: 1;
}

.hero__shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to top, var(--ink) 0%, rgb(4 9 11 / 0.86) 18%, rgb(4 9 11 / 0.3) 52%, rgb(4 9 11 / 0.15) 72%, rgb(4 9 11 / 0.55) 100%),
    radial-gradient(90% 70% at 0% 100%, rgb(4 9 11 / 0.75), transparent 62%);
}

.hero__inner {
  padding-block: calc(var(--topbar-h) + 40px) clamp(84px, 13vh, 136px);
}

@media (max-width: 760px) {
  .hero__shade {
    background: linear-gradient(to top, var(--ink) 0%, rgb(4 9 11 / 0.9) 34%, rgb(4 9 11 / 0.62) 58%, rgb(4 9 11 / 0.2) 80%, rgb(4 9 11 / 0.5) 100%);
  }
  .hero__inner {
    padding-bottom: 92px;
  }
}

.hero__title {
  margin-block: 20px 22px;
  font: 760 clamp(3.4rem, 10.6vw, 9.6rem) / 0.86 var(--display);
  letter-spacing: -0.052em;
  text-shadow: 0 0 46px rgb(95 227 224 / 0.22);
}

.hero__word {
  display: inline-block;
  white-space: nowrap;
}

.hero__word > span {
  display: inline-block;
}

.hero__word:last-child > span {
  color: var(--cyan-hi);
}

.hero__lede {
  max-width: 44ch;
  color: var(--muted);
  font-size: clamp(1.08rem, 1.45vw, 1.32rem);
  line-height: 1.55;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.cta-row--center {
  justify-content: center;
}

.hero__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 28px;
  color: var(--dim);
  font: 500 0.74rem/1.2 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero__facts li {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.hero__facts li::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 1px;
  background: var(--cyan);
  opacity: 0.7;
}

.hero__pause {
  position: absolute;
  right: var(--gutter);
  bottom: 30px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgb(182 242 244 / 0.22);
  border-radius: 50%;
  background: rgb(4 9 11 / 0.45);
  color: var(--text);
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition:
    background-color 0.2s,
    border-color 0.2s;
}

.hero__pause svg {
  width: 16px;
  height: 16px;
}

@media (hover: hover) {
  .hero__pause:hover {
    border-color: rgb(182 242 244 / 0.45);
    background: rgb(12 30 36 / 0.7);
  }
}

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 26px;
  display: grid;
  justify-items: center;
  gap: 10px;
  color: var(--dim);
  font: 500 0.68rem/1 var(--mono);
  letter-spacing: 0.16em;
  text-decoration: none;
  text-transform: uppercase;
  translate: -50% 0;
}

.scroll-cue i {
  position: relative;
  width: 1px;
  height: 34px;
  overflow: hidden;
  background: var(--line-strong);
}

.scroll-cue i::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent, var(--cyan-hi));
  translate: 0 -100%;
}

@media (max-width: 760px) {
  .scroll-cue {
    display: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .hero__word > span {
    animation: letter-in 1.1s var(--ease-out) both;
    animation-delay: calc(var(--i) * 42ms + 120ms);
  }
  .hero__eyebrow,
  .hero__lede,
  .hero .cta-row,
  .hero__facts {
    animation: rise-in 1s var(--ease-out) both;
  }
  .hero__eyebrow {
    animation-delay: 0.05s;
  }
  .hero__lede {
    animation-delay: 0.62s;
  }
  .hero .cta-row {
    animation-delay: 0.74s;
  }
  .hero__facts {
    animation-delay: 0.86s;
  }
  .scroll-cue i::after {
    animation: cue 2.2s var(--ease-in-out) 1.6s 3;
  }
}

@keyframes letter-in {
  from {
    opacity: 0;
    translate: 0 0.32em;
    filter: blur(10px);
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    translate: 0 18px;
  }
}

@keyframes cue {
  from {
    translate: 0 -100%;
  }
  to {
    translate: 0 100%;
  }
}

/* Scroll scenes: a tall section with a pinned frame. --p runs 0 to 1 across it. */

.scene {
  --p: 0;
  position: relative;
  height: calc(var(--len, 2.5) * 100svh);
  background: var(--ink);
}

.scene__sticky {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
  isolation: isolate;
}

.scene__still,
.scene__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.scene__still {
  z-index: -2;
  object-fit: cover;
}

.scene__canvas {
  z-index: -1;
  opacity: 0;
  transition: opacity 0.5s;
}

.scene.is-ready .scene__canvas {
  opacity: 1;
}

.scene__shade,
.scene__fade {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.scene__shade--left {
  background: linear-gradient(90deg, rgb(4 9 11 / 0.82), rgb(4 9 11 / 0.35) 48%, rgb(4 9 11 / 0) 78%);
}

.scene__shade--bottom {
  background: linear-gradient(to top, rgb(4 9 11 / 0.92), rgb(4 9 11 / 0.4) 42%, rgb(4 9 11 / 0) 64%);
}

.scene__shade--top {
  background: linear-gradient(to bottom, rgb(4 9 11 / 0.72), rgb(4 9 11 / 0.32) 30%, rgb(4 9 11 / 0) 52%);
}

/* Only when script drives --p; without it the still frame shows as it is. */
.scene__fadein {
  position: absolute;
  inset: 0;
  display: none;
  background: var(--ink);
  opacity: calc(1 - clamp(0, var(--p) / 0.07, 1));
  pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
  .js .scene__fadein {
    display: block;
  }
}

.scene__fade {
  background: var(--ink);
  opacity: clamp(0, (var(--p) - 0.88) / 0.12, 1);
}

.beats {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 28px;
  height: 100%;
  padding-block: calc(var(--topbar-h) + 28px) 56px;
}

.js .beats {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-content: stretch;
  align-content: center;
}

.js .beats > .beat {
  grid-area: 1 / 1;
  align-self: center;
}

.beats--bottom {
  justify-content: end;
}

.js .beats--bottom {
  align-content: end;
  padding-bottom: clamp(56px, 11vh, 120px);
}

.beats--top {
  justify-content: start;
}

.js .beats--top {
  align-content: start;
  padding-top: calc(var(--topbar-h) + 9vh);
}

.js .beat {
  --a: clamp(0, (var(--p) - var(--in)) / 0.06, 1);
  --b: clamp(0, (var(--out) - var(--p)) / 0.06, 1);
  opacity: min(var(--a), var(--b));
  translate: 0 calc((1 - var(--a)) * 22px + (var(--b) - 1) * 22px);
}

.caption {
  max-width: 22ch;
  font: 620 clamp(1.55rem, 3.3vw, 2.9rem) / 1.14 var(--display);
  letter-spacing: -0.024em;
  text-shadow: 0 2px 30px rgb(0 0 0 / 0.55);
  text-wrap: balance;
}

.caption--big {
  color: var(--cyan-hi);
  font: 500 clamp(2.6rem, 7.4vw, 6.4rem) / 1 var(--mono);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 44px rgb(95 227 224 / 0.5);
}

.caption__more {
  display: block;
  margin-top: 0.35em;
  color: var(--muted);
  font-size: 0.62em;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.beat--hold .display-xl {
  max-width: 11ch;
}

.beat__sub {
  max-width: 40ch;
  margin-top: 22px;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.45vw, 1.32rem);
  text-shadow: 0 1px 16px rgb(4 9 11 / 0.9);
}

@media (max-width: 760px) {
  .scene__shade--left {
    background: linear-gradient(rgb(4 9 11 / 0.25), rgb(4 9 11 / 0.6) 35%, rgb(4 9 11 / 0.6) 72%, rgb(4 9 11 / 0.3));
  }
}

.beat--wide {
  max-width: 26ch;
  font: 560 clamp(1.4rem, 2.7vw, 2.4rem) / 1.25 var(--display);
  letter-spacing: -0.02em;
  text-shadow: 0 2px 26px rgb(0 0 0 / 0.5);
  text-wrap: balance;
}

/* The CLIMB knockout: the shaft shows through the letters, then the camera falls into the I. */

.knock,
.knock-line {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.knock {
  background: var(--ink);
  mix-blend-mode: multiply;
  opacity: calc(1 - clamp(0, (var(--p) - 0.42) / 0.08, 1));
}

.knock__word {
  color: #fff;
  font: 860 clamp(5.5rem, 27vw, 25rem) / 0.8 var(--display);
  letter-spacing: -0.065em;
  white-space: nowrap;
  transform-origin: var(--ox, 50%) var(--oy, 50%);
  scale: var(--k, 1);
}

.knock-line .knock__word {
  color: transparent;
  -webkit-text-stroke: 1.5px rgb(140 242 239 / 0.75);
  opacity: calc(1 - clamp(0, (var(--p) - 0.02) / 0.14, 1));
}

.scene--climb .beats {
  justify-items: center;
  text-align: center;
}

.scene--climb .caption {
  max-width: 26ch;
  padding: 36px 56px;
  background: radial-gradient(closest-side, rgb(4 9 11 / 0.72), rgb(4 9 11 / 0.45) 60%, rgb(4 9 11 / 0));
  text-shadow: 0 1px 18px rgb(4 9 11 / 0.8);
}

/* MOTH */

.moth {
  padding-block: clamp(100px, 13vw, 180px);
  background:
    radial-gradient(55% 45% at 78% 42%, rgb(255 180 84 / 0.075), transparent 72%),
    var(--ink);
}

.moth__grid {
  display: grid;
  gap: 56px;
  align-items: center;
}

@media (min-width: 980px) {
  .moth__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: clamp(48px, 6vw, 96px);
  }
}

.moth__copy > * + * {
  margin-top: 22px;
}

.moth__copy .eyebrow {
  color: var(--amber);
}

.moth__copy .display-l {
  font-size: clamp(2.1rem, 3.7vw, 3.45rem);
}

.hints {
  margin-top: 40px !important;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.hints__title {
  color: var(--crt);
  font: 620 1.08rem/1.3 var(--display);
  letter-spacing: -0.01em;
}

.hints__steps {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.hints__steps li {
  display: grid;
  grid-template-columns: 52px 1fr;
  column-gap: 16px;
  row-gap: 2px;
}

.hints__steps .pips {
  grid-row: span 2;
  margin-top: 6px;
}

.hints__steps b {
  color: var(--text);
  font: 500 0.76rem/1.5 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hints__steps li > span:last-child {
  color: var(--muted);
  font-size: 0.97rem;
}

.pips {
  display: inline-flex;
  gap: 6px;
}

.pips i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 10px rgb(255 180 84 / 0.75);
}

.pips--one i:nth-child(n + 2),
.pips--none i,
.signal--1 .pips i:nth-child(n + 2),
.signal--0 .pips i {
  background: transparent;
  box-shadow: inset 0 0 0 1px rgb(255 180 84 / 0.42);
}

.moth__terminal {
  position: relative;
}

.moth__shot {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius);
  background: #020607;
  box-shadow:
    0 0 0 1px var(--line),
    0 44px 90px -40px rgb(0 0 0 / 0.9),
    0 0 140px -50px rgb(255 180 84 / 0.4);
}

.moth__shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.moth__glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(16% 15% at 37.5% 36%, rgb(255 190 110 / 0.24), transparent 70%),
    repeating-linear-gradient(to bottom, rgb(0 0 0 / 0.12) 0 1px, transparent 1px 3px);
  mix-blend-mode: screen;
  pointer-events: none;
}

.moth-box {
  display: grid;
  gap: 8px;
  padding: 16px 18px 17px;
  border: 1px solid var(--crt-line);
  border-radius: 14px;
  background: var(--crt-bg);
  color: var(--crt);
  font: 400 0.92rem/1.6 var(--mono);
  box-shadow:
    inset 0 1px 0 rgb(255 220 170 / 0.08),
    0 0 44px -14px rgb(255 180 84 / 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.moth-box__who {
  color: var(--amber);
  font: 600 0.7rem/1 var(--mono);
  letter-spacing: 0.2em;
}

.moth-box__line {
  min-height: 1.6em;
}

.moth__terminal .moth-box {
  position: relative;
  max-width: 470px;
  margin: -72px 18px 0 auto;
}

@media (max-width: 560px) {
  .moth__terminal .moth-box {
    margin: -36px 10px 0;
  }
}

.typed {
  position: relative;
  display: block;
}

.typed__ghost,
.typed__out {
  white-space: pre-wrap;
}

.typed__ghost {
  visibility: hidden;
}

.typed__out {
  position: absolute;
  inset: 0;
}

.typed--inline {
  display: inline;
}

.typed--inline .typed__out {
  position: static;
}

.typed--inline.is-typing .typed__out::after {
  content: none;
}

.is-typing .typed__out::after {
  content: "\258D";
  margin-left: 1px;
  color: var(--amber);
}

/* The first task, playable */

.run {
  padding-block: clamp(100px, 12vw, 170px);
  background: linear-gradient(to bottom, var(--ink), var(--ink-1) 35%, var(--ink));
}

.section-head {
  display: grid;
  gap: 20px;
  max-width: 780px;
  margin-bottom: clamp(40px, 6vw, 72px);
}

.section-head--center {
  justify-items: center;
  margin-inline: auto;
  text-align: center;
}

.section-head--center .lede {
  margin-inline: auto;
}

.run__stage {
  display: grid;
  gap: 18px;
}

@media (min-width: 1060px) {
  .run__stage {
    grid-template-columns: minmax(0, 1.18fr) minmax(0, 1fr);
    align-items: start;
  }
}

.room {
  --b: 0.4;
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius);
  background: #020607;
  box-shadow:
    0 0 0 1px var(--line),
    0 34px 90px -44px rgb(0 0 0 / 0.95);
}

.room__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(var(--b)) saturate(calc(0.55 + var(--b) * 0.45));
  transition: filter 1.1s var(--ease-out);
}

.room::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgb(2 6 8 / 0.78), rgb(2 6 8 / 0.4) 22%, transparent 36%),
    linear-gradient(to top, rgb(2 6 8 / 0.82), transparent 36%);
  pointer-events: none;
}

.room__hud,
.room__foot {
  position: absolute;
  inset-inline: 0;
  z-index: 1;
  padding: 14px 16px;
  font: 500 0.74rem/1.3 var(--mono);
  letter-spacing: 0.06em;
}

.room__hud {
  top: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  color: var(--muted);
}

.room__label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.room__train {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

.room__train b {
  color: var(--text);
  font-weight: 500;
}

.room__train [data-train-loss] {
  color: var(--cyan-hi);
  transition: color 0.4s;
}

.room.is-pass .room__train [data-train-loss] {
  color: var(--ok);
}

.room__saved {
  margin-left: 0.6em;
  padding: 3px 7px;
  border: 1px solid rgb(141 227 158 / 0.4);
  border-radius: 999px;
  color: var(--ok);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.room__foot {
  bottom: 0;
  display: grid;
  gap: 9px;
  color: var(--muted);
}

.room__racks b {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.racks {
  display: grid;
  grid-template-columns: repeat(20, 1fr);
  gap: 4px;
}

.racks i {
  height: 7px;
  border-radius: 2px;
  background: rgb(138 212 216 / 0.16);
  transition:
    background-color 0.25s,
    box-shadow 0.25s;
  transition-delay: calc(var(--n, 0) * 28ms);
}

.racks i.is-on {
  background: var(--cyan);
  box-shadow: 0 0 10px rgb(95 227 224 / 0.75);
}

.room.is-pass .racks i.is-on {
  background: var(--cyan-hi);
}

.editor {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius);
  background: #061014;
  box-shadow:
    0 0 0 1px var(--line),
    0 34px 90px -44px rgb(0 0 0 / 0.95);
}

.editor__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: rgb(10 26 32 / 0.6);
  color: var(--muted);
  font: 500 0.8rem/1 var(--mono);
}

.editor__file > span {
  color: var(--cyan);
}

.editor__file i {
  margin-left: 8px;
  color: var(--dim);
  font-style: normal;
}

.editor__who {
  padding: 5px 9px;
  border: 1px solid var(--crt-line);
  border-radius: 999px;
  color: var(--amber);
  font: 600 0.66rem/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.editor__code {
  overflow-x: auto;
  background: #050c10;
}

.code {
  width: max-content;
  min-width: 100%;
  margin: 0;
  padding: 14px 16px 14px 0;
  color: #cbe5e7;
  font: 400 clamp(0.8rem, 1vw, 0.92rem) / 1.8 var(--mono);
  tab-size: 4;
}

.ln {
  position: sticky;
  left: 0;
  z-index: 1;
  display: inline-block;
  width: 3.3em;
  margin-right: 1em;
  padding-right: 1em;
  background: #040b10;
  color: #618389;
  text-align: right;
  user-select: none;
}

.ln.is-edit {
  color: var(--cyan-hi);
}

@media (max-width: 520px) {
  .code {
    font-size: 0.74rem;
  }
  .ln {
    width: 2.6em;
    margin-right: 0.75em;
    padding-right: 0.75em;
  }
  .editor__file i {
    display: none;
  }
}

.kw {
  color: #ffbe6b;
}

.fn {
  color: #6bf0ec;
}

.st {
  color: #a6e29c;
}

.nu {
  color: #f7a682;
}

.pu {
  color: #9fc0c4;
}

.code__input {
  width: min(24ch, 62%);
  height: 1.8em;
  margin: 0 0 0 -0.4em;
  padding: 0 0.4em;
  border: 0;
  border-bottom: 1px dashed rgb(95 227 224 / 0.6);
  border-radius: 4px 4px 0 0;
  background: rgb(95 227 224 / 0.085);
  color: #e9f7f7;
  font: inherit;
  line-height: inherit;
  vertical-align: top;
  caret-color: #6bf0ec;
  transition:
    background-color 0.2s,
    border-color 0.2s;
}

.code__input:focus {
  outline: none;
}

.code__input:focus-visible {
  border-bottom-style: solid;
  border-bottom-color: var(--cyan-hi);
  background: rgb(95 227 224 / 0.14);
  box-shadow: 0 0 0 2px rgb(140 242 239 / 0.5);
}

.code__input.is-flash {
  background: rgb(255 180 84 / 0.2);
}

.editor__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
}

.editor__bar > span:last-of-type {
  margin-left: auto;
}

.editor__reset {
  flex: none;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font: 500 0.72rem/1 var(--mono);
  cursor: pointer;
  transition:
    color 0.2s,
    border-color 0.2s;
}

.editor__reset svg {
  width: 13px;
  height: 13px;
}

@media (hover: hover) {
  .editor__reset:hover {
    border-color: rgb(138 212 216 / 0.55);
    color: var(--text);
  }
}

.moth-box--editor {
  margin: 0 16px 14px;
  border-radius: 12px;
  font-size: 0.86rem;
}

.dock {
  flex: 1;
  padding: 14px 16px 18px;
  border-top: 1px solid var(--line);
  background: rgb(3 10 13 / 0.55);
}

.dock__head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.dock__tag {
  padding: 4px 7px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--cyan);
  font: 600 0.66rem/1 var(--mono);
  letter-spacing: 0.16em;
}

.dock__cases {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  font: 400 0.8rem/1.45 var(--mono);
}

.dock__cases:empty {
  display: none;
}

.dock__cases li {
  display: grid;
  grid-template-columns: 1.3em 1fr auto;
  align-items: baseline;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgb(255 255 255 / 0.025);
}

.dock__cases .mark {
  font-weight: 600;
}

.dock__cases .is-ok .mark {
  color: var(--ok);
}

.dock__cases .is-bad .mark {
  color: var(--bad);
}

.dock__cases .got {
  color: var(--dim);
  text-align: right;
}

.dock__cases .is-bad .got {
  color: var(--bad);
}

@media (prefers-reduced-motion: no-preference) {
  .dock__cases li {
    animation: rise-in 0.45s var(--ease-out) both;
    animation-delay: calc(var(--n, 0) * 70ms);
  }
}

.run .fine {
  max-width: 70ch;
  margin-top: 22px;
}

/* Floors */

.floors {
  padding-top: clamp(100px, 12vw, 170px);
}

.floor {
  --accent: var(--cyan);
  padding-block: clamp(56px, 8vw, 110px);
}

#floor-1 {
  --accent: var(--amber);
}

#floor-2 {
  --accent: var(--ok);
}

#floor-3 {
  --accent: var(--rival);
}

.floor__grid {
  display: grid;
  gap: 36px;
  align-items: center;
}

@media (min-width: 980px) {
  .floor__grid {
    grid-template-columns: minmax(0, 1.22fr) minmax(0, 1fr);
    gap: clamp(40px, 6vw, 88px);
  }
  .floor--flip .floor__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.22fr);
  }
  .floor--flip .floor__media {
    order: 2;
  }
}

.floor__media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius);
  background: #020607;
  box-shadow:
    0 0 0 1px var(--line),
    0 44px 90px -44px rgb(0 0 0 / 0.95),
    0 0 150px -60px color-mix(in oklab, var(--accent) 65%, transparent);
}

.floor__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.replay {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px 0 12px;
  border: 1px solid rgb(182 242 244 / 0.24);
  border-radius: 999px;
  background: rgb(4 9 11 / 0.55);
  color: var(--text);
  font: 500 0.78rem/1 var(--mono);
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition:
    opacity 0.3s,
    background-color 0.2s,
    border-color 0.2s;
}

.replay svg {
  width: 15px;
  height: 15px;
}

.replay.is-quiet {
  opacity: 0;
}

.floor__media:hover .replay.is-quiet,
.replay.is-quiet:focus-visible {
  opacity: 1;
}

@media (hover: hover) {
  .replay:hover {
    border-color: rgb(182 242 244 / 0.45);
    background: rgb(12 30 36 / 0.75);
  }
}

@media (hover: none) {
  .replay.is-quiet {
    opacity: 1;
  }
}

.floor__copy > * + * {
  margin-top: 18px;
}

.floor__copy > p:not([class*="floor__num"], .signal) {
  max-width: 50ch;
  color: var(--muted);
}

.floor__num {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font: 500 0.76rem/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.floor__num span {
  padding: 6px 9px;
  border: 1px solid color-mix(in oklab, var(--accent) 45%, transparent);
  border-radius: 6px;
  background: color-mix(in oklab, var(--accent) 9%, transparent);
  color: var(--accent);
}

.tasks {
  margin-top: 26px !important;
  border-top: 1px solid var(--line);
}

.tasks li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}

.tasks code {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 500;
}

.signal {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px !important;
  color: var(--dim);
  font: 500 0.72rem/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* MOTH's goodbye */

.moth-line,
.dock-line {
  display: grid;
  gap: 10px;
  max-width: 34ch;
  font: 520 clamp(1.3rem, 2.5vw, 2.2rem) / 1.3 var(--display);
  letter-spacing: -0.02em;
  text-shadow: 0 2px 26px rgb(0 0 0 / 0.6);
  text-wrap: balance;
}

.moth-line {
  color: var(--crt);
}

.moth-line .moth-box__who,
.dock-line__who {
  font: 600 0.72rem/1 var(--mono);
  letter-spacing: 0.22em;
  text-shadow: none;
}

.dock-line__who {
  color: var(--cyan);
}

.dock-line b {
  color: var(--cyan-hi);
  font-weight: 650;
}

/* Borrowed code */

.borrowed {
  padding-block: clamp(80px, 10vw, 140px) clamp(40px, 6vw, 80px);
}

.borrowed__grid {
  display: grid;
  gap: 40px;
  align-items: center;
}

@media (min-width: 980px) {
  .borrowed__grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: clamp(40px, 6vw, 88px);
  }
}

.terminal {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10;
  padding: 32px;
  overflow: hidden;
  border-radius: var(--radius);
  background: radial-gradient(ellipse at center, #1c1006 0%, #0b0703 72%);
  box-shadow:
    inset 0 0 90px rgb(0 0 0 / 0.85),
    0 0 0 1px var(--crt-line),
    0 0 140px -50px rgb(255 180 84 / 0.38);
}

.terminal::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(to bottom, rgb(0 0 0 / 0.28) 0 1px, transparent 1px 3px);
  pointer-events: none;
}

.terminal__line {
  max-width: 16ch;
  color: var(--amber);
  font: 600 clamp(1.3rem, 3vw, 2.4rem) / 1.25 var(--mono);
  letter-spacing: 0.04em;
  text-align: center;
  text-shadow: 0 0 18px rgb(255 180 84 / 0.6);
}

.terminal__caret {
  display: inline-block;
  width: 0.6em;
  height: 1em;
  margin-left: 0.15em;
  background: var(--amber);
  vertical-align: -0.12em;
  box-shadow: 0 0 14px rgb(255 180 84 / 0.7);
}

@media (prefers-reduced-motion: no-preference) {
  .terminal__caret {
    animation: blink 1s steps(1) 6;
  }
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.borrowed__copy > * + * {
  margin-top: 18px;
}

.borrowed__copy .eyebrow {
  color: var(--amber);
}

.borrowed__copy > p:not(.eyebrow, .quote-dock) {
  max-width: 50ch;
  color: var(--muted);
}

.quote-dock {
  display: grid;
  gap: 10px;
  max-width: 52ch;
  margin-top: 26px !important;
  padding: 16px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgb(6 18 22 / 0.7);
  color: var(--text);
  font: 400 0.88rem/1.6 var(--mono);
}

.quote-dock span {
  color: var(--cyan);
  font: 600 0.68rem/1 var(--mono);
  letter-spacing: 0.2em;
}

/* Modes */

.modes {
  padding-block: clamp(110px, 13vw, 180px) clamp(60px, 8vw, 110px);
}

.bento {
  display: grid;
  gap: 16px;
}

@media (min-width: 760px) {
  .bento {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1120px) {
  .bento {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }
  .card--rivals,
  .card--lab {
    grid-column: span 7;
  }
  .card--duel,
  .card--speed {
    grid-column: span 5;
  }
}

.card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow:
    0 0 0 1px var(--line),
    inset 0 1px 0 var(--rim);
  transition:
    box-shadow 0.35s,
    translate 0.35s var(--ease-out);
}

@media (hover: hover) {
  .card:hover {
    box-shadow:
      0 0 0 1px var(--line-strong),
      inset 0 1px 0 var(--rim),
      0 30px 70px -40px rgb(95 227 224 / 0.35);
    translate: 0 -3px;
  }
}

.card__media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #020607;
}

.card__media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card__body {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 22px 24px 26px;
}

.card h3 {
  font: 650 1.45rem/1.15 var(--display);
  letter-spacing: -0.02em;
}

.card p {
  color: var(--muted);
  font-size: 0.98rem;
}

.rivals {
  margin-top: 8px;
}

.rivals li {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 12px;
  align-items: baseline;
  padding: 9px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}

.rivals b {
  color: var(--rival);
  font: 600 0.74rem/1 var(--mono);
  letter-spacing: 0.14em;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 12px;
  background: var(--line);
}

.stats div {
  padding: 14px 16px;
  background: #071318;
}

.stats dt {
  color: var(--dim);
  font: 500 0.68rem/1.2 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.stats dd {
  margin-top: 8px;
  font: 650 clamp(1.4rem, 2.2vw, 1.8rem) / 1 var(--display);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.media-toggle {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgb(182 242 244 / 0.22);
  border-radius: 50%;
  background: rgb(4 9 11 / 0.55);
  color: var(--text);
  cursor: pointer;
  opacity: 0.75;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition:
    opacity 0.2s,
    background-color 0.2s;
}

.media-toggle::before {
  content: "";
  position: absolute;
  inset: -6px;
}

.media-toggle svg {
  width: 13px;
  height: 13px;
}

.media-toggle:focus-visible,
.card:hover .media-toggle {
  opacity: 1;
}

/* Trailer */

.trailer {
  padding-block: clamp(100px, 12vw, 170px) clamp(90px, 11vw, 150px);
  background: radial-gradient(70% 46% at 50% 52%, rgb(95 227 224 / 0.075), transparent 72%);
}

.trailer__frame {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: calc(var(--radius) + 4px);
  background: #000;
  cursor: pointer;
  box-shadow:
    0 0 0 1px var(--line-strong),
    0 50px 120px -50px rgb(0 0 0 / 0.95),
    0 0 170px -50px rgb(95 227 224 / 0.45);
}

.trailer__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition:
    scale 0.9s var(--ease-out),
    filter 0.5s;
}

.trailer__play {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: clamp(70px, 8vw, 104px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgb(95 227 224 / 0.94);
  color: #031012;
  translate: -50% -50%;
  box-shadow:
    0 0 0 10px rgb(95 227 224 / 0.16),
    0 24px 60px -12px rgb(95 227 224 / 0.6);
  transition:
    scale 0.4s var(--ease-out),
    box-shadow 0.4s;
}

.trailer__play svg {
  width: 36%;
  height: 36%;
  margin-left: 7%;
}

.trailer__meta {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 8px 12px;
  border: 1px solid rgb(182 242 244 / 0.22);
  border-radius: 999px;
  background: rgb(4 9 11 / 0.6);
  color: var(--text);
  font: 500 0.74rem/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

@media (max-width: 520px) {
  .trailer__meta {
    top: 10px;
    right: 10px;
    padding: 6px 9px;
    font-size: 0.66rem;
  }
}

@media (hover: hover) {
  .trailer__frame:hover img {
    filter: brightness(1.08);
    scale: 1.025;
  }
  .trailer__frame:hover .trailer__play {
    scale: 1.07;
    box-shadow:
      0 0 0 16px rgb(95 227 224 / 0.13),
      0 28px 70px -12px rgb(95 227 224 / 0.7);
  }
}

.trailer__song {
  display: grid;
  justify-items: center;
  gap: 16px;
  margin-top: 56px;
  text-align: center;
}

.trailer__lyric {
  max-width: 30ch;
  color: var(--crt);
  font: 560 clamp(1.4rem, 2.6vw, 2.2rem) / 1.3 var(--display);
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.lyrics {
  width: min(760px, 100%);
  margin-top: 8px;
}

.lyrics summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  font: 500 0.8rem/1 var(--mono);
  letter-spacing: 0.06em;
  cursor: pointer;
  list-style: none;
}

.lyrics summary::-webkit-details-marker {
  display: none;
}

.lyrics summary::after {
  content: "+";
  color: var(--cyan);
  font-size: 1rem;
}

.lyrics[open] summary::after {
  content: "\2212";
}

.lyrics__body {
  margin-top: 26px;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.7;
  text-align: left;
  columns: 2 280px;
  column-gap: 48px;
}

.lyrics__body p {
  margin-bottom: 1.1em;
  break-inside: avoid;
}

/* Dawn */

.scene--dawn .caption,
.scene--dawn .beat--serif {
  color: #fffaf0;
  text-shadow:
    0 1px 2px rgb(20 12 2 / 0.35),
    0 2px 34px rgb(20 12 2 / 0.6);
}

.beat--serif {
  max-width: 24ch;
  color: #fffaf0;
  font: 540 clamp(1.5rem, 3vw, 2.7rem) / 1.22 var(--display);
  letter-spacing: -0.024em;
  text-shadow: 0 2px 30px rgb(40 24 6 / 0.55);
  text-wrap: balance;
}

/* Finale: the colour the dawn run ends on */

.finale {
  position: relative;
  padding-block: clamp(110px, 15vw, 210px);
  overflow: hidden;
  background:
    radial-gradient(90% 70% at 50% 0%, #f8efdd 0%, var(--dawn-0) 40%, transparent 80%),
    linear-gradient(to bottom, var(--dawn-0), var(--dawn-1) 60%, var(--dawn-2));
  color: var(--dawn-ink);
  text-align: center;
}

.finale__inner {
  display: grid;
  justify-items: center;
  gap: 24px;
}

.eyebrow--ink {
  color: var(--dawn-muted);
  text-wrap: balance;
}

.finale .lede {
  color: var(--dawn-muted);
}

.finale .display-xl {
  max-width: 12ch;
}

.finale__soon,
.finale__device {
  max-width: 52ch;
  color: var(--dawn-muted);
  font-size: 0.9rem;
}

.finale__device {
  display: none;
}

@media (hover: none) and (pointer: coarse) {
  .finale__device {
    display: block;
    padding: 10px 16px;
    border: 1px solid rgb(29 22 9 / 0.2);
    border-radius: 12px;
    background: rgb(255 250 240 / 0.45);
  }
}

/* Footer */

.footer {
  padding-block: 72px 36px;
  border-top: 1px solid var(--line);
  background: var(--ink);
  color: var(--muted);
  font-size: 0.92rem;
}

.footer__grid {
  display: grid;
  gap: 40px;
}

@media (min-width: 900px) {
  .footer__grid {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: 80px;
  }
}

.brand--footer {
  min-height: 0;
  color: var(--text);
}

.footer__note {
  max-width: 40ch;
  margin-top: 16px;
  color: var(--dim);
}

.credits {
  display: grid;
  gap: 18px;
}

.credits div {
  display: grid;
  gap: 4px;
}

@media (min-width: 640px) {
  .credits div {
    grid-template-columns: 130px 1fr;
    gap: 24px;
  }
}

.credits dt {
  color: var(--text);
  font: 500 0.72rem/1.9 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.credits dd {
  color: var(--dim);
}

.footer__end {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 56px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font: 500 0.74rem/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.footer__end a {
  text-decoration: none;
}

@media (hover: hover) {
  .footer__end a:hover {
    color: var(--text);
  }
}

/* Trailer player */

.player {
  width: min(1280px, 100vw - 32px, (100svh - 120px) * 16 / 9);
  max-width: none;
  max-height: none;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 16px;
  background: #000;
  color: var(--text);
  box-shadow:
    0 0 0 1px var(--line-strong),
    0 40px 140px rgb(0 0 0 / 0.75);
  opacity: 0;
  transition-property: opacity, scale, display, overlay;
  transition-duration: 0.35s;
  transition-timing-function: var(--ease-out);
  transition-behavior: allow-discrete;
}

.player::backdrop {
  background-color: rgb(2 6 8 / 0);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition-property: background-color, display, overlay;
  transition-duration: 0.35s;
  transition-timing-function: var(--ease-out);
  transition-behavior: allow-discrete;
}

@media (prefers-reduced-motion: no-preference) {
  .player {
    scale: 0.96;
  }
}

:is(.player[open]):where(:not([data-closing])) {
  opacity: 1;

  @starting-style {
    opacity: 0;
  }

  @media (prefers-reduced-motion: no-preference) {
    scale: 1;

    @starting-style {
      scale: 0.96;
    }
  }

  &::backdrop {
    background-color: rgb(2 6 8 / 0.9);

    @starting-style {
      background-color: rgb(2 6 8 / 0);
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .player,
  .player::backdrop {
    transition-duration: 0.1s;
  }
}

.player__frame {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: inherit;
}

.player__frame video,
.player__frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.player__close {
  position: absolute;
  top: -54px;
  right: 0;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgb(182 242 244 / 0.25);
  border-radius: 50%;
  background: rgb(8 20 24 / 0.7);
  color: var(--text);
  cursor: pointer;
  transition:
    background-color 0.2s,
    border-color 0.2s;
}

.player__close svg {
  width: 18px;
  height: 18px;
}

@media (hover: hover) {
  .player__close:hover {
    border-color: rgb(182 242 244 / 0.5);
    background: rgb(14 34 40 / 0.9);
  }
}

@media (max-height: 520px) {
  .player__close {
    top: 8px;
    right: 8px;
    z-index: 1;
  }
}

/* Reveals as sections scroll in. Decorative, so browsers without scroll timelines just show the content. */

@media (prefers-reduced-motion: no-preference) {
  @supports ((animation-timeline: view()) and (animation-range: entry)) {
    .reveal {
      animation: reveal-in auto linear backwards;
      animation-timeline: view();
      animation-range: entry 4% entry 72%;
    }

    .moth__shot img {
      animation: settle auto linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 60%;
    }
  }
}

@keyframes reveal-in {
  from {
    opacity: 0;
    translate: 0 30px;
  }
}

@keyframes settle {
  from {
    scale: 1.14;
  }
}

/* Reduced motion: scenes become ordinary sections with a still frame and all their words. */

@media (prefers-reduced-motion: reduce) {
  .scene {
    height: auto;
  }
  .scene__sticky {
    position: relative;
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 100svh;
  }
  .scene__canvas,
  .scene__fade,
  .scene__fadein,
  .knock-line {
    display: none;
  }
  /* Every beat shows at once, in reading order, placed where the scene puts it. */
  .js .beats {
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: center;
    gap: clamp(22px, 3.4vh, 40px);
    height: auto;
  }
  .js .beats--top {
    justify-content: flex-start;
  }
  .js .beats--bottom {
    justify-content: flex-end;
  }
  .js .beats > .beat {
    align-self: auto;
  }
  .scene--climb .beats {
    align-items: center;
  }
  .js .beat {
    opacity: 1;
    translate: none;
  }
  .knock {
    opacity: 1;
    position: relative;
    inset: auto;
    padding-top: calc(var(--topbar-h) + 40px);
    background: none;
    mix-blend-mode: normal;
  }
  .knock .knock__word {
    color: var(--cyan-hi);
    scale: 1;
    font-size: clamp(4rem, 16vw, 12rem);
  }
}
