:root {
  --cobalt: #1b2bb8;
  --night: #0a0f4a;
  --ice: #eaf0ff;
  --steel: #a3b3f0;
  --ink-soft: #3d4aa6;
  --glint: #ff6a2b;
  --bronze: #dc9f6f;
  --silver: #d4dcef;
  --gold: #f0c75e;
  --gutter: clamp(20px, 5vw, 80px);
  --v: 0; /* current speed as 0..1 of the meter, set by main.js */
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--cobalt);
  color: var(--ice);
  font: 400 18px/1.55 "Anybody", system-ui, sans-serif;
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
a { color: inherit; }
:focus-visible { outline: 3px solid var(--glint); outline-offset: 4px; }
ul, ol { list-style: none; }
h1, h2, h3 { font-weight: 900; font-style: italic; line-height: 0.95; }

.skip { position: absolute; left: 12px; top: -60px; z-index: 20; background: var(--ice); color: var(--cobalt); padding: 8px 14px; }
.skip:focus { top: 12px; }

/* Header and Steam call to action */
.top {
  position: absolute; inset: 0 0 auto; z-index: 3;
  display: flex; align-items: center; gap: 32px;
  padding: 24px var(--gutter);
}
.mark { font-weight: 900; font-style: italic; font-stretch: 150%; font-size: 20px; text-decoration: none; text-transform: uppercase; letter-spacing: -0.01em; }
.top nav { display: flex; gap: 28px; margin-left: auto; font-size: 15px; }
.top nav a { text-decoration: none; color: var(--steel); }
.top nav a:hover { color: var(--ice); }

.steam {
  display: inline-block; padding: 10px 20px;
  font-size: 15px; font-weight: 700; font-stretch: 112%; text-decoration: none;
  border: 1.5px solid currentColor;
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
  border-inline-width: 0;
  padding-inline: 26px;
}
span.steam { color: var(--steel); border: 0; clip-path: none; padding-inline: 0; }
span.steam::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 10px; background: var(--glint); transform: skewX(-18deg); }
a.steam { background: var(--ice); color: var(--cobalt); border-color: var(--ice); }
a.steam:hover { background: #fff; }
.steam-big { font-size: 18px; padding: 14px 34px; margin-top: 32px; }

/* Hero */
.hero {
  position: relative; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 120px var(--gutter) clamp(40px, 6vh, 72px);
  overflow: hidden;
}
.hero-video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  mix-blend-mode: luminosity; opacity: 0; transition: opacity 1.2s;
}
.hero-video.ready { opacity: 0.32; }
/* keeps the copy readable over bright footage */
.hero::after { content: ""; position: absolute; inset: auto 0 0; height: 55%; background: linear-gradient(to top, var(--cobalt) 35%, rgb(27 43 184 / 0)); pointer-events: none; }
.wordmark, .hero-copy { z-index: 1; }
.hero-copy {
  position: relative; color: var(--steel);
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 4fr) minmax(0, 3fr); gap: var(--gutter);
  margin-top: clamp(32px, 5vh, 56px);
}
.hero-copy > div { max-width: 27rem; }
.lede { color: var(--ice); font-size: clamp(24px, 2.5vw, 36px); line-height: 1.12; font-weight: 700; font-stretch: 112%; max-width: 15em; }

.wordmark {
  position: relative;
  font-size: min(14.3vw, 26svh); font-stretch: 150%; text-transform: uppercase;
  letter-spacing: -0.035em; line-height: 0.8; white-space: nowrap;
  margin-left: -0.06em;
}
.wordmark span { display: block; }
/* the second half steps forward, like a stride */
.wordmark span + span { padding-left: 0.62em; }
.js .wordmark span { opacity: 0; }
.js.fonts .wordmark span { opacity: 1; animation: stride 1.15s cubic-bezier(0.16, 0.8, 0.12, 1) 0.1s both; }
.js.fonts .wordmark span + span { animation-delay: 0.22s; }
@keyframes stride {
  from {
    font-stretch: 50%; transform: translateX(-4vw);
    text-shadow: -0.12em 0 0 rgb(234 240 255 / 0.4), -0.3em 0 0 rgb(234 240 255 / 0.18), -0.6em 0 0 rgb(234 240 255 / 0.07);
  }
  to {
    font-stretch: 150%; transform: none;
    text-shadow: 0 0 0 rgb(234 240 255 / 0), 0 0 0 rgb(234 240 255 / 0), 0 0 0 rgb(234 240 255 / 0);
  }
}

/* Gameplay: the trailer, then the rule it shows */
.gameplay { background: var(--night); padding: clamp(80px, 10vw, 160px) var(--gutter); }
.trailer {
  position: relative; aspect-ratio: 16 / 9;
  border: 1px solid rgb(163 179 240 / 0.25);
  /* a 16 by 9 grid of the game's wall tiles until the trailer is in */
  background: linear-gradient(rgb(163 179 240 / 0.09) 1px, transparent 1px) 0 0 / 100% 11.111%,
              linear-gradient(90deg, rgb(163 179 240 / 0.09) 1px, transparent 1px) 0 0 / 6.25% 100%;
}
.trailer video { position: absolute; inset: 0; width: 100%; height: 100%; display: none; background: #000; }
.trailer.ready { border: 0; background: none; }
.trailer.ready video { display: block; }
.trailer.ready .trailer-wait { display: none; }
.trailer-wait { position: absolute; left: clamp(20px, 3vw, 40px); bottom: clamp(20px, 3vw, 36px); color: var(--steel); font-size: clamp(16px, 1.5vw, 21px); font-weight: 700; font-stretch: 112%; }
.gameplay h2 { margin-top: clamp(32px, 4vw, 56px); font-size: clamp(30px, 3.6vw, 56px); font-stretch: 125%; line-height: 1.05; max-width: 22em; text-wrap: balance; }

/* Moves */
.moves { background: var(--ice); color: var(--cobalt); padding: clamp(96px, 13vw, 200px) var(--gutter); }
.moves-head { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--gutter); align-items: end; margin-bottom: clamp(48px, 7vw, 96px); }
.moves h2 { font-size: clamp(48px, 6.6vw, 108px); font-stretch: 125%; }
.moves-head p { color: var(--ink-soft); max-width: 28rem; }
.moves-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gutter); align-items: start; }
.moves.has-media .moves-body { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }

.move-list li {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 24px; align-items: baseline;
  padding: 22px 0; border-top: 1px solid rgb(27 43 184 / 0.22);
}
.move-list li:last-child { border-bottom: 1px solid rgb(27 43 184 / 0.22); }
.move-list h3 { font-size: clamp(30px, 3.3vw, 52px); font-stretch: 112%; transition: font-stretch 0.35s cubic-bezier(0.2, 0.8, 0.2, 1); }
.move-list p { color: var(--ink-soft); max-width: 30rem; }
.move-list .has-clip { cursor: pointer; }
.move-list .has-clip:is(:hover, :focus-visible, .on) h3 { font-stretch: 150%; }

.viewer { display: none; position: sticky; top: 10vh; background: var(--night); aspect-ratio: 16 / 9; }
.has-media .viewer { display: block; }
.viewer video { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Levels and medals */
.levels { padding: clamp(96px, 13vw, 200px) var(--gutter); }
.levels h2 { font-size: clamp(48px, 6.6vw, 108px); font-stretch: 125%; max-width: 11ch; }
.levels-intro { color: var(--steel); max-width: 34rem; margin: 32px 0 clamp(56px, 8vw, 112px); }
.medals li {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 18rem); gap: 24px; align-items: baseline;
  border-top: 1px solid rgb(234 240 255 / 0.18); padding: 14px 0 10px;
}
.medal-name { font-size: clamp(52px, 9vw, 150px); font-weight: 900; font-style: italic; line-height: 0.9; text-transform: uppercase; letter-spacing: -0.02em; }
.medal-ask { color: var(--steel); }
/* each tier is wider than the last: harder medal, faster run */
.bronze .medal-name { font-stretch: 66%; color: var(--bronze); }
.silver .medal-name { font-stretch: 94%; color: var(--silver); }
.gold .medal-name { font-stretch: 122%; color: var(--gold); }
.stride .medal-name { font-stretch: 150%; color: var(--ice); }
.stride .medal-ask { color: var(--ice); }

/* Press */
.press {
  background: var(--ice); color: var(--cobalt);
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--gutter);
  padding: clamp(96px, 11vw, 168px) var(--gutter);
}
.press h2 { font-size: clamp(40px, 4.6vw, 72px); font-stretch: 125%; margin-bottom: 24px; }
.press-head p { color: var(--ink-soft); max-width: 26rem; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; align-content: start; }
.facts div { border-top: 1px solid rgb(27 43 184 / 0.22); padding: 14px 0 22px; }
.facts dt { font-size: 14px; color: var(--ink-soft); }
.facts dd { font-size: 20px; font-weight: 700; font-stretch: 112%; line-height: 1.25; }

.foot {
  background: var(--night); color: var(--steel);
  display: flex; align-items: center; gap: 40px;
  padding: 40px var(--gutter) 120px; font-size: 15px;
}

/* HUD: the speed meter in the corner */
.hud {
  position: fixed; right: var(--gutter); bottom: 20px; z-index: 10;
  display: grid; grid-template-columns: auto auto; align-items: baseline; column-gap: 6px;
  padding: 10px 26px 12px;
  background: var(--night); color: var(--ice);
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
  pointer-events: none;
}
.hud-speed { font-size: 34px; font-weight: 900; font-style: italic; font-stretch: 125%; line-height: 1; font-variant-numeric: tabular-nums; min-width: 3.3ch; text-align: right; }
.hud-unit { font-size: 14px; color: var(--steel); }
.hud-bar {
  grid-column: 1 / -1; position: relative; display: block; width: 150px; height: 4px; margin: 8px 0 6px;
  background: rgb(163 179 240 / 0.25);
}
.hud-bar i { position: absolute; inset: 0 auto 0 0; width: calc(var(--v) * 100%); background: var(--glint); }
.armored .hud-bar i { background: var(--ice); }
/* the 14 m/s line on a 0..24 m/s meter */
.hud-bar::after { content: ""; position: absolute; left: 58.33%; top: -4px; bottom: -4px; width: 2px; background: var(--ice); }
.hud-state { grid-column: 1 / -1; font-size: 14px; font-weight: 700; font-stretch: 112%; color: var(--glint); }
.armored .hud-state { color: var(--ice); }

/* Narrow screens */
@media (max-width: 820px) {
  /* the hero wordmark already names the game; the header would repeat it */
  .top { display: none; }
  .hero { padding-top: 72px; }
  /* no room for the meter on phones without covering text */
  .hud { display: none; }
  .hero-copy { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .moves-head, .press { grid-template-columns: minmax(0, 1fr); }
  .moves.has-media .moves-body { grid-template-columns: minmax(0, 1fr); }
  .viewer { order: -1; top: 0; z-index: 1; }
  .move-list li { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .medals li { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .foot { flex-direction: column; align-items: flex-start; gap: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js.fonts .wordmark span { animation: none; }
  .move-list h3 { transition: none; }
}
