/* Viper Wave: the launch page.
 *
 * One theme, dark, because the game is dark-only (project.yml: UIUserInterfaceStyle Dark).
 * Colours are the Vice Sunset theme's (Resources/Themes/vice-sunset/theme.json); the
 * hero's sky, layers and reveal follow the approved splash (Martin's "Viper Wave
 * Approved" pack, 07 Source/Splash.tsx). One accent: the theme's "button" gradient,
 * pink to orange. Shapes: buttons are pills, media frames are 24px, nothing else rounds.
 */

@font-face {
  font-family: "Bungee";
  src: url("assets/bungee.woff2") format("woff2");
  font-display: swap;
}

:root {
  --ink: #0F0A1E;
  --night: #1A1030;
  --dusk: #2A1540;
  --surface: #221633;
  --text: #F7EEFF;
  --text-2: #C6B4DD;
  --text-on-accent: #1A0F2E;
  --pink: #FF4D9E;
  --orange: #FF8A5B;
  --gold: #FFC46B;
  --border: #FFE9F029;
  --accent: linear-gradient(90deg, var(--pink), var(--orange));
  --sky: linear-gradient(180deg, #3D2A5C 0%, #6B3F7A 12%, #A8558F 26%, #D46B93 40%, #F0847F 54%, #FCA179 68%, #FDB988 82%, #F6C79A 100%);
  --display: "Bungee", "Arial Black", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --radius-media: 24px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-pop: cubic-bezier(0.34, 1.56, 0.64, 1);
  /* the wordmark artwork's transparent margin round its letters, as fractions of the artwork's
     width (letter faces at x 157-1187, y 140-691 of 1340 x 832). The glow lives in that margin;
     these let layout line up the letters, not the image box */
  --wm-inset-x: 0.1172;
  --wm-inset-top: 0.1045;
  --wm-inset-bottom: 0.1052;
  /* hero rhythm: wordmark letters to lede, lede to actions */
  --hero-gap-lede: 1.5rem;
  --hero-gap-actions: 1.75rem;
  /* z-index scale: content 0, scanlines 1, header 10, dialog is top-layer */
  --z-scan: 1;
  --z-nav: 10;
}

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: dark; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--night);
  color: var(--text);
  font: 400 1.0625rem/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}
img, video { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; }
a { color: inherit; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 16px; top: -60px; z-index: 20;
  padding: 10px 16px; border-radius: 999px; background: var(--text); color: var(--ink); font-weight: 600;
}
.skip:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

.container { width: min(100% - 2 * clamp(20px, 5vw, 64px), 1200px); margin-inline: auto; }

.icon { width: 1.1em; height: 1.1em; fill: currentColor; flex: none; }

.h2 {
  margin: 0;
  font: 400 clamp(2rem, 1.2rem + 3.2vw, 3.6rem)/1.05 var(--display);
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.lede { margin: 1rem 0 0; max-width: 58ch; color: var(--text-2); font-size: clamp(1.05rem, 1rem + 0.3vw, 1.2rem); text-wrap: pretty; }

/* Buttons: pills. The primary wears the theme's button gradient with its dark ink. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55em;
  min-height: 52px; padding: 0 1.6rem; border-radius: 999px; border: 0;
  font-weight: 700; font-size: 1.05rem; text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out), background-color 0.25s;
}
.btn:active { transform: translateY(1px) scale(0.98); }
.btn--primary {
  background: var(--accent); color: var(--text-on-accent);
  box-shadow: 0 10px 30px -10px #FF4D9E99, inset 0 1px 0 #FFFFFF59;
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 16px 36px -12px #FF4D9EB3, inset 0 1px 0 #FFFFFF59; }
.btn--ghost {
  background: #1A10304D; color: var(--text);
  box-shadow: inset 0 0 0 1px #FFFFFF47;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.btn--ghost:hover { background: #1A103080; }
.btn--small { min-height: 44px; padding: 0 1.1rem; font-size: 0.95rem; }

/* The App Store badge: Apple's artwork, unmodified, at the buttons' height (Apple's minimum
   on screen is 40px). While it is live it is the primary action: the trailer steps back to a
   secondary button and "See the gameplay" makes way, so the hero keeps one of each. */
.store-badge { display: inline-flex; border-radius: 13px; transition: transform 0.25s var(--ease-out), opacity 0.2s; }
.store-badge[hidden] { display: none; }
.store-badge img { height: 52px; width: auto; display: block; }
.store-badge:hover { transform: translateY(-2px); }
.store-badge:active { transform: translateY(1px) scale(0.98); }
:is(.hero__actions, .closer__actions):has(.store-badge:not([hidden])) .btn--trailer {
  background: #1A10304D; color: var(--text); box-shadow: inset 0 0 0 1px #FFFFFF47;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
:is(.hero__actions, .closer__actions):has(.store-badge:not([hidden])) .btn--trailer:hover { background: #1A103080; transform: none; }
.hero__actions:has(.store-badge:not([hidden])) .btn--gameplay { display: none; }
.closer__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 1.75rem; }
.closer__copy .closer__actions .btn { margin-top: 0; }

/* Pause motion: the one control for everything that moves on its own */
.motion-toggle .icon--play { display: none; }
.motion-toggle[data-paused="true"] .icon--play { display: block; }
.motion-toggle[data-paused="true"] .icon--pause { display: none; }
.no-js .motion-toggle { display: none; }

/* ---------- Header ---------- */
.nav {
  position: absolute; inset: 0 0 auto; z-index: var(--z-nav);
  display: flex; align-items: center; justify-content: space-between;
  height: 68px; padding: 0 clamp(16px, 4vw, 48px);
}
.nav__brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 400 1rem/1 var(--display); }
.nav__brand img { border-radius: 8px; box-shadow: 0 2px 10px #1A103066; }

/* ---------- Hero ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: max(640px, 100dvh);
  display: grid; align-items: center;
  padding: 84px 0 64px;
}
.hero__sky { position: absolute; inset: 0; z-index: -1; background: var(--sky); }
.hero__cloud { position: absolute; max-width: none; pointer-events: none; }
.hero__cloud--long { width: 130%; left: -23%; top: 6%; opacity: 0.22; }
.hero__cloud--wisps { width: 110%; left: 5%; top: 40%; opacity: 0.2; }
/* palms keep their own proportions (844 x 1300, 902 x 1500): height is set, width follows */
.hero__palm { position: absolute; bottom: 0; width: auto; max-width: none; pointer-events: none; }
.hero__palm--left { height: 62%; left: -4%; bottom: -8%; opacity: 0.45; transform-origin: 90% 98%; }
.hero__palm--right { height: 83%; right: -5%; bottom: -5%; opacity: 0.88; transform-origin: 14% 98%; }
.hero__shade {
  position: absolute; inset: 50% 0 0;
  background: linear-gradient(180deg, #2A154000 0%, #2A1540E6 70%, var(--night) 100%);
}
.scanlines {
  position: absolute; inset: 0; z-index: var(--z-scan); pointer-events: none;
  background: repeating-linear-gradient(180deg, #FFFFFF0B 0 2px, #FFFFFF00 2px 6px);
}
.hero__veil { position: absolute; inset: 0; background: var(--night); opacity: 0; pointer-events: none; }

.hero__inner {
  width: min(100% - 2 * clamp(20px, 5vw, 64px), 1240px); margin-inline: auto;
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); align-items: center; gap: clamp(24px, 4vw, 64px);
}
.hero__copy { grid-column: 1; grid-row: 1; position: relative; }
/* a soft dusk behind the words, so they hold their contrast over clouds and palms */
.hero__copy::before {
  content: ""; position: absolute; inset: -12% -18% -14% -22%; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, #2A1540A6, #2A154059 55%, #2A154000);
}
.hero__scene {
  grid-column: 2; grid-row: 1; justify-self: center;
  position: relative; width: min(100%, 470px, calc((100dvh - 200px) * 0.823)); aspect-ratio: 1072 / 1302;
}
/* The Viper: the still picture, and over it (while motion runs) the splash's rig on a canvas.
   Behind both, the splash's warm halo, baked as a picture (the snake plus 120 source px all
   round) so nothing has to blur the canvas every frame. */
.hero__viper { position: relative; width: 100%; transform-origin: 50% 100%; }
.hero__halo {
  position: absolute; left: calc(-120 / 1072 * 100%); top: calc(-120 / 1302 * 100%);
  width: calc(1312 / 1072 * 100%); max-width: none; opacity: 0.9; pointer-events: none;
}
/* the Viper is a large picture (2794 px wide): its own compositing layer, so the hero's loops
   repainting round it don't re-scale it every frame */
.hero__snake { position: relative; width: 100%; height: auto; will-change: transform; }
.hero__rig { position: absolute; display: none; pointer-events: none; }
.hero__viper.is-rigged .hero__rig { display: block; }
.hero__viper.is-rigged .hero__snake { visibility: hidden; }
.hero__lede { margin: var(--hero-gap-lede) 0 0; max-width: 34ch; text-wrap: balance; font-size: clamp(1.1rem, 1rem + 0.45vw, 1.35rem); line-height: 1.5; text-shadow: 0 1px 12px #3D2A5C80; }
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: var(--hero-gap-actions); }

/* The wordmark: neon glow behind, letter faces on top, a light sweep inside the letters.
   The artwork carries room round the letters for its glow; negative margins of exactly that
   room (the --wm-inset-* tokens) put the letters' edges on the box's edges, so the "V" lines
   up with the copy and the gaps below are measured from the letters. The glow spills over. */
.wordmark {
  --wm-w: min(108%, 600px);
  position: relative; width: var(--wm-w); aspect-ratio: 1340 / 832;
  margin: calc(var(--wm-w) * -1 * var(--wm-inset-top)) 0 calc(var(--wm-w) * -1 * var(--wm-inset-bottom)) calc(var(--wm-w) * -1 * var(--wm-inset-x));
}
.wordmark img { position: absolute; inset: 0; width: 100%; height: 100%; }
.wordmark__sweep {
  position: absolute; inset: 0; opacity: 0;
  background: linear-gradient(105deg, #FFFFFF00 38%, #FFFFFFF2 50%, #FFFFFF00 62%) no-repeat;
  background-size: 300% 100%; background-position: 120% 0;
  -webkit-mask: url("assets/wordmark-mask.webp") center / 100% 100% no-repeat;
  mask: url("assets/wordmark-mask.webp") center / 100% 100% no-repeat;
}

/* The game's coin: its 36-frame spin, stepped */
.coin {
  position: absolute; left: var(--x); top: var(--y); width: var(--s); aspect-ratio: 1;
  translate: -50% -50%; rotate: var(--t);
  background: url("assets/coin-spin.webp") 0 0 / 600% 600% no-repeat;
}

/* ---------- Gameplay ---------- */
.play { padding: clamp(72px, 10vw, 128px) 0 clamp(56px, 8vw, 96px); }
/* copy and chapters on the left, the phone large on the right, as tall as the screen allows */
.play__grid {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: clamp(32px, 6vw, 96px);
}
.play__phone { margin: 0; display: grid; justify-items: center; gap: 16px; }
.play__phone .iphone { width: clamp(300px, calc((100svh - 210px) * 393 / 852), 400px); }
.play__caption { display: flex; align-items: center; gap: 14px; color: var(--text-2); font-size: 0.95rem; }

/* The titanium iPhone frame: ported verbatim from getmiahq.com by way of vividvdesigns.com
   (css/styles.css, ".iphone"). Every part is in cqw of the phone's width, so it scales whole.
   The screen is the game's own dark rather than the site's pale blue; there is no status-bar
   band, since the game draws edge to edge and hides the status bar. */
.iphone { position: relative; container-type: inline-size; aspect-ratio: 393 / 852; }
.iphone__chassis { position: absolute; inset: 0; box-sizing: border-box; border-radius: 14.25cqw; padding: 1.527cqw; background: linear-gradient(155deg, #e7e4de 0%, #bdb9b1 12%, #9d998f 50%, #bdb9b1 88%, #e7e4de 100%); box-shadow: inset 0 0 0.254cqw 0.254cqw rgba(255, 255, 255, .5), 0 5.6cqw 11.45cqw rgba(0, 0, 0, .28); }
.iphone__btn { position: absolute; background: linear-gradient(to bottom, #c3bfb7, #948f87); z-index: -1; }
.iphone__btn--action { left: -0.763cqw; top: 43.26cqw; width: 1.272cqw; height: 7.634cqw; border-radius: 0.763cqw 0 0 0.763cqw; }
.iphone__btn--volup { left: -0.763cqw; top: 57.25cqw; width: 1.272cqw; height: 14.76cqw; border-radius: 0.763cqw 0 0 0.763cqw; }
.iphone__btn--voldn { left: -0.763cqw; top: 76.34cqw; width: 1.272cqw; height: 14.76cqw; border-radius: 0.763cqw 0 0 0.763cqw; }
.iphone__btn--power { right: -0.763cqw; top: 63.61cqw; width: 1.272cqw; height: 22.9cqw; border-radius: 0 0.763cqw 0.763cqw 0; }
.iphone__antenna { position: absolute; background: #87837b; width: 1.527cqw; height: 1.527cqw; z-index: 1; }
.iphone__antenna--tl { top: 0; left: 19.85cqw; }
.iphone__antenna--tr { top: 0; right: 19.85cqw; }
.iphone__antenna--bl { bottom: 0; left: 19.85cqw; }
.iphone__antenna--br { bottom: 0; right: 19.85cqw; }
.iphone__bezel { width: 100%; height: 100%; box-sizing: border-box; background: #0a0a0b; border-radius: 12.72cqw; padding: 1.781cqw; }
.iphone__screen { width: 100%; height: 100%; box-sizing: border-box; background: #140C20; border-radius: 11.2cqw; position: relative; overflow: hidden; }
.iphone__island { position: absolute; top: 3.562cqw; left: 50%; transform: translateX(-50%); width: 30.03cqw; height: 8.652cqw; background: #000; border-radius: 100px; z-index: 6; display: flex; align-items: center; justify-content: flex-end; padding-right: 2.8cqw; box-sizing: border-box; }
.iphone__island::after { content: ''; width: 2.545cqw; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #2b3f66 0%, #0a1022 55%, #04060d 100%); box-shadow: inset 0 0 0.5cqw rgba(120, 150, 255, .35); }
.iphone__home { position: absolute; bottom: 2.036cqw; left: 50%; transform: translateX(-50%); width: 27.99cqw; height: 1.272cqw; border-radius: 100px; background: #F7EEFFB3; z-index: 5; }

/* The footage fills the screen at its own proportions (1206 x 2622, a shade wider than the
   frame's screen), so a sliver comes off each side, centred; nothing is stretched. */
.stage__video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center;
  opacity: 0; transition: opacity 0.35s ease;
}
.stage__video.is-active { opacity: 1; }
.stage__toggle {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 999px; border: 0; cursor: pointer;
  background: #FFFFFF14; color: var(--text); box-shadow: inset 0 0 0 1px #FFFFFF40;
}
.stage__toggle:hover { background: #FFFFFF26; }
.stage__toggle .icon--play { display: none; }
[data-stage].is-paused .stage__toggle .icon--play { display: block; }
[data-stage].is-paused .stage__toggle .icon--pause { display: none; }

.chapters { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; margin-top: clamp(24px, 3vw, 40px); max-width: 52ch; }
.chapter {
  position: relative; display: grid; gap: 6px; align-content: start; text-align: left;
  padding: 14px 0 18px; border: 0; background: none; cursor: pointer;
  color: var(--text-2); transition: color 0.25s;
}
.chapter::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; border-radius: 3px; background: #FFFFFF1F; }
.chapter__name { font: 400 1.2rem/1.1 var(--display); color: var(--text); opacity: 0.6; transition: opacity 0.25s; }
.chapter__text { font-size: 0.98rem; line-height: 1.5; }
.chapter__bar {
  position: absolute; inset: 0 auto auto 0; height: 3px; width: 100%; border-radius: 3px;
  background: var(--accent); transform-origin: left; transform: scaleX(0);
}
.chapter[aria-selected="true"] { color: var(--text); }
.chapter[aria-selected="true"] .chapter__name { opacity: 1; }
.chapter[aria-selected="true"] .chapter__bar { transform: scaleX(var(--progress, 1)); }
.chapter:hover .chapter__name { opacity: 1; }

/* ---------- Marquee ---------- */
.board-strip {
  padding: 26px 0; overflow: hidden;
  background: linear-gradient(90deg, #8A5BD6, #FF4D9E 52%, #FF9A5B);
}
.marquee { display: flex; width: max-content; }
.marquee__track { display: flex; flex: none; margin: 0; padding: 0; list-style: none; }
.marquee__track li {
  display: flex; align-items: center; gap: 28px; padding-right: 28px;
  font: 400 clamp(1.4rem, 1rem + 1.6vw, 2.2rem)/1 var(--display); color: var(--text-on-accent); white-space: nowrap;
}
.marquee__track li::after {
  content: ""; width: 1.4em; aspect-ratio: 1; flex: none;
  background: url("assets/coin-spin.webp") 0 0 / 600% 600% no-repeat;
}

/* scanlines fade out at the hero's foot and in at the closer's head, so neither section ends on a line */
.hero .scanlines { -webkit-mask: linear-gradient(180deg, #000 calc(100% - 160px), transparent); mask: linear-gradient(180deg, #000 calc(100% - 160px), transparent); }
.closer .scanlines { -webkit-mask: linear-gradient(180deg, transparent, #000 360px); mask: linear-gradient(180deg, transparent, #000 360px); }

/* ---------- Mega coin ---------- */
.mega { padding: clamp(56px, 8vw, 104px) 0 clamp(24px, 3vw, 40px); overflow: hidden; }
.mega__grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); align-items: center; gap: clamp(24px, 5vw, 80px); }
.mega__coin { position: relative; display: grid; place-items: center; aspect-ratio: 1; }
.mega__coin::before {
  content: ""; position: absolute; inset: 8%; border-radius: 50%;
  background: radial-gradient(circle, #FFC46B73 0%, #FFC46B00 68%);
}
.coin--mega { position: relative; left: auto; top: auto; translate: none; rotate: none; width: 100%; }
/* the full-resolution frames, fetched as the section comes near (main.js); until then, and without
   JavaScript, the 288 px sheet stands in */
.coin--mega.is-near { background-image: url("assets/coin-spin-576.webp"); }
/* the game's native 1152 px render, as a transparent video (main.js), over the sheet it replaces */
.coin__video { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.coin--mega.has-video { background-image: none; animation: none !important; }
.mega__copy .lede { max-width: 40ch; }

/* ---------- Closer ---------- */
.closer { position: relative; isolation: isolate; overflow: hidden; padding: clamp(64px, 9vw, 120px) 0 0; }
.closer__sky {
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, var(--night) 0%, var(--night) 6%, #1F1437 14%, #28193F 22%, #32224C 32%, #3D2A5C 42%, #6B3F7A 70%, #934E8B 92%, #A8558F 100%);
}
.closer__palm { position: absolute; bottom: -4%; height: 88%; width: auto; max-width: none; opacity: 0.55; }
.closer__palm--left { left: -8%; }
/* the right palm sits lower, so its trunk runs off the foot of the section rather than ending in view */
.closer__palm--right { right: -10%; bottom: -24%; }
/* copy on the left, the Viper on the right, facing back into the words (the picture is mirrored) */
.closer__grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); align-items: end; gap: clamp(24px, 5vw, 72px); }
.closer__snake { will-change: transform; }
.closer__snake { grid-column: 2; grid-row: 1; width: min(100%, 320px); justify-self: start; transform: scaleX(-1); filter: drop-shadow(0 0 40px #FFD69666); margin-bottom: -2px; }
.closer__copy { grid-column: 1; grid-row: 1; padding-bottom: clamp(56px, 8vw, 112px); }
.closer__copy .lede { color: var(--text); text-shadow: 0 1px 12px #3D2A5C99; }
.closer__copy .btn { margin-top: 1.75rem; }

/* ---------- Footer ---------- */
.footer { background: var(--ink); padding: 28px 0 calc(28px + env(safe-area-inset-bottom)); color: var(--text-2); font-size: 0.95rem; }
.footer__row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer__row img { border-radius: 10px; }
.footer__row p { margin: 0; flex: 1; min-width: 220px; }
.footer__row a { color: var(--text); text-underline-offset: 3px; }

/* ---------- Trailer ---------- */
.trailer {
  width: fit-content; max-width: calc(100vw - 32px); max-height: none; padding: 0; border: 0;
  background: transparent; overflow: visible;
}
.trailer::backdrop { background: #0F0A1ED9; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.trailer__frame { position: relative; }
/* the video at its own proportions, as large as the screen allows: width and height attributes
   carry the ratio, and whichever limit bites first wins */
.trailer__video {
  --ar: 4 / 3;   /* set to the playing cut's own ratio by main.js */
  --room-x: 32px; --room-y: 120px;
  display: block; height: auto; aspect-ratio: var(--ar);
  width: min(calc(100vw - var(--room-x)), 1200px, calc((100dvh - var(--room-y)) * (var(--ar))));
  border-radius: var(--radius-media); background: var(--ink);
  box-shadow: 0 30px 100px -20px #FF4D9E66;
}
.trailer__close {
  position: absolute; top: -56px; right: 0;
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 999px; border: 0; cursor: pointer;
  background: #FFFFFF1F; color: var(--text); box-shadow: inset 0 0 0 1px #FFFFFF47;
}
.trailer__close:hover { background: #FFFFFF33; }
/* short screens (a phone on its side): the close button moves beside the video, so the video
   can have nearly the full height */
@media (max-height: 500px) {
  .trailer__video { --room-x: 132px; --room-y: 24px; }
  .trailer__close { top: 0; right: -56px; }
}

/* ---------- Mobile: each section recomposed for a portrait screen ---------- */
@media (max-width: 899px) {
  .hero { padding: 72px 0 40px; align-items: start; min-height: max(600px, 100svh); }
  .hero__inner { grid-template-columns: minmax(0, 1fr); gap: 0; text-align: center; }
  .hero__scene { grid-column: 1; grid-row: 1; width: min(62vw, calc((100svh - 400px) * 0.823), 340px); translate: 8% 0; margin-top: max(5vh, 28px); }
  /* a live badge adds a row of actions: the Viper gives up the height on short phones */
  .hero:has(.store-badge:not([hidden])) .hero__scene { width: min(68vw, calc((100svh - 470px) * 0.823), 340px); }
  @media (min-width: 600px) {
    .hero:has(.store-badge:not([hidden])) .hero__scene { width: min(68vw, calc((100svh - 470px) * 0.823), 420px); }
  }
  .hero__copy { grid-column: 1; grid-row: 2; display: grid; justify-items: center; }
  /* the letters still tuck under the Viper's tail, by --wm-tuck, as in the approved splash */
  .wordmark {
    order: 1; --wm-w: min(100%, 400px); --wm-tuck: 1.25rem;
    margin: calc(var(--wm-w) * -1 * var(--wm-inset-top) - var(--wm-tuck)) auto calc(var(--wm-w) * -1 * var(--wm-inset-bottom));
  }
  .hero__lede { order: 2; margin-inline: auto; font-size: 1.08rem; }
  .hero { --hero-gap-lede: 1rem; --hero-gap-actions: 1.25rem; }
  .hero__actions { order: 3; justify-content: center; }
  /* as in the approved iPhone splash: 47% and 63% of the height, run off both edges */
  .hero__palm--left { height: 47%; left: -27%; bottom: -6%; opacity: 0.75; }
  .hero__palm--right { height: 63%; right: -35%; bottom: -4%; }
  .hero__cloud--long { width: 220%; left: -60%; top: 10%; }
  .hero__cloud--wisps { width: 200%; left: -40%; top: 44%; }

  /* phones: words, then the phone, then the chapters to pick from */
  .play__grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .play__copy { display: contents; }
  .play__copy .h2 { order: 1; }
  .play__copy .lede { order: 2; }
  .play__phone { order: 3; margin-top: 28px; }
  .play__phone .iphone { width: min(74vw, 320px); }
  .chapters { order: 4; max-width: none; }
  .chapters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 16px; }
  .chapter { padding: 12px 0 10px; }
  .chapter__name { font-size: 1.05rem; }
  .chapter__text { font-size: 0.92rem; }

  .mega__grid { grid-template-columns: minmax(0, 1fr); text-align: center; justify-items: center; }
  .mega__coin { width: min(64vw, 300px); }

  .closer__grid { grid-template-columns: minmax(0, 1fr); text-align: center; justify-items: center; }
  .closer__copy { grid-column: 1; grid-row: 1; padding-bottom: 8px; }
  .closer__copy .lede { margin-inline: auto; }
  .closer__actions { justify-content: center; }
  .closer__snake { grid-column: 1; grid-row: 2; justify-self: center; width: min(60vw, 260px); }
}
@media (max-width: 429px) {
  /* badge and trailer side by side don't fit: stack them, badge first */
  :is(.hero__actions, .closer__actions):has(.store-badge:not([hidden])) { flex-direction: column; align-items: center; gap: 10px; }
}
@media (max-width: 379px) {
  .hero__actions .btn { width: 100%; }
  /* the wordmark says it a few lines down; the icon keeps the link and its label */
  .nav__brand span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* ---------- Motion: only for people who haven't asked for less ----------
 *
 * Two kinds. The reveal is one-shot (about a second and a half) and ends on the page's
 * resting state. The loops (palms, clouds, coins, neon, marquee) run on only with
 * JavaScript, because JavaScript is what gives the "Pause motion" control; without it
 * the page settles after the reveal and stays still.
 *
 * html.is-revealed: the reveal is over (or was cut short by pausing), so only loops remain.
 * html.motion-paused: the loops hold still; set by the control, remembered between visits.
 */
@media (prefers-reduced-motion: no-preference) {
  /* the reveal, after the splash: a veil lifts, the palms rise, the Viper pops up, the coins
     arc in one by one, then the wordmark lands and its neon stutters on */
  .hero__veil { animation: veil 0.6s ease-out both; }
  .hero__palm--left { animation: palm-rise 1.1s var(--ease-out) 0.15s both; }
  .hero__palm--right { animation: palm-rise 1.2s var(--ease-out) 0.2s both; }
  .hero__viper { animation: snake-pop 0.8s var(--ease-pop) 0.3s both; }
  .hero__scene .coin { animation: coin-pop 0.5s var(--ease-pop) calc(0.65s + var(--i) * 0.08s) both; }
  .wordmark { animation: word-land 0.6s var(--ease-pop) 0.5s both; }
  .wordmark__glow { animation: neon-on 0.5s steps(1) 0.95s both; }
  .hero__lede, .hero__actions { animation: rise 0.5s var(--ease-out) 0.35s both; }

  /* the reveal and the loops together, while the reveal is still running */
  .js .hero__palm--left { animation: palm-rise 1.1s var(--ease-out) 0.15s both, sway-left 8s ease-in-out 1.3s infinite; }
  .js .hero__palm--right { animation: palm-rise 1.2s var(--ease-out) 0.2s both, sway-right 9s ease-in-out 1.4s infinite; }
  .js .hero__scene .coin {
    animation: coin-pop 0.5s var(--ease-pop) calc(0.65s + var(--i) * 0.08s) both,
      coin-col 0.2s steps(6) calc(var(--i) * -0.23s) infinite, coin-row 1.2s steps(6) calc(var(--i) * -0.23s) infinite;
  }
  .js .wordmark__glow { animation: neon-on 0.5s steps(1) 0.95s both, neon-breathe 4s ease-in-out 1.5s infinite; }

  /* loops alone, once the reveal is over */
  .is-revealed .hero__veil, .is-revealed .hero__viper, .is-revealed .wordmark,
  .is-revealed .hero__lede, .is-revealed .hero__actions { animation: none; }
  .is-revealed .hero__palm--left { animation: sway-left 8s ease-in-out infinite; }
  .is-revealed .hero__palm--right { animation: sway-right 9s ease-in-out infinite; }
  .is-revealed .hero__scene .coin { animation: coin-col 0.2s steps(6) calc(var(--i) * -0.23s) infinite, coin-row 1.2s steps(6) calc(var(--i) * -0.23s) infinite; }
  .is-revealed .wordmark__glow { animation: neon-breathe 4s ease-in-out infinite; }

  /* loops that are never part of the reveal */
  .js .hero__cloud--long { animation: drift 16s ease-in-out infinite alternate; }
  .js .hero__cloud--wisps { animation: drift 20s ease-in-out -6s infinite alternate-reverse; }
  .js .wordmark__sweep { animation: sweep 7s ease-in-out 2.2s infinite; }
  .js .hero__halo { animation: halo-breathe 2s ease-in-out -1.77s infinite alternate; }
  .js .marquee { animation: marquee 38s linear infinite; }
  .js .board-strip:hover .marquee { animation-play-state: paused; }
  .js .marquee__track li::after { animation: coin-col 0.2s steps(6) infinite, coin-row 1.2s steps(6) infinite; }
  .js .coin--mega { animation: coin-col 0.4s steps(6) infinite, coin-row 2.4s steps(6) infinite; }

  .js .reveal { opacity: 0; translate: 0 24px; transition: opacity 0.7s var(--ease-out), translate 0.7s var(--ease-out); }
  .js .reveal.is-in, .motion-paused .reveal { opacity: 1; translate: 0 0; }
  .motion-paused .reveal { transition: none; }

  /* held still: off screen, or paused by the visitor */
  .is-offscreen, .is-offscreen *, .is-offscreen *::after,
  .motion-paused *, .motion-paused *::after { animation-play-state: paused !important; }
}

@keyframes veil { from { opacity: 1; } to { opacity: 0; } }
@keyframes palm-rise { from { transform: translateY(28%); } to { transform: translateY(0); } }
@keyframes sway-left { 0%, 100% { rotate: 0deg; } 50% { rotate: 1.2deg; } }
@keyframes sway-right { 0%, 100% { rotate: 0deg; } 50% { rotate: -1deg; } }
@keyframes drift { from { translate: -2% 0; } to { translate: 2% 0; } }
@keyframes snake-pop { from { transform: translateY(30%) scale(0.72); } to { transform: none; } }   /* no fade: it starts under the veil, and stays paintable from the first frame */
@keyframes coin-pop { from { opacity: 0; transform: translate(-40%, 50%) scale(0); } to { opacity: 1; transform: none; } }
/* the coin spin: 36 frames on a 6 x 6 sheet. The column steps six times as fast as the row,
   so frame n = row x 6 + column, one turn per row animation, same timing as the strip it replaces */
@keyframes coin-col { from { background-position-x: 0%; } to { background-position-x: 120%; } }
@keyframes coin-row { from { background-position-y: 0%; } to { background-position-y: 120%; } }
@keyframes word-land { from { opacity: 0; transform: translateY(12%) scale(0.85); } to { opacity: 1; transform: none; } }
@keyframes neon-on { 0% { opacity: 0; } 10% { opacity: 1; } 20% { opacity: 0; } 40% { opacity: 1; } 50% { opacity: 0; } 70% { opacity: 1; } 80% { opacity: 0.4; } 90%, 100% { opacity: 1; } }
@keyframes neon-breathe { 0%, 100% { opacity: 1; } 50% { opacity: 0.86; } }
@keyframes sweep { 0%, 70% { opacity: 0; background-position: 120% 0; } 72% { opacity: 0.8; } 92% { opacity: 0.8; background-position: -20% 0; } 94%, 100% { opacity: 0; background-position: -20% 0; } }
@keyframes halo-breathe { from { opacity: 0.78; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; translate: 0 14px; } to { opacity: 1; translate: 0 0; } }
@keyframes marquee { to { transform: translateX(-50%); } }

/* A marquee that doesn't move is a wrapped list: under reduced motion, and without JavaScript */
.no-js .marquee { width: auto; justify-content: center; }
.no-js .marquee__track { flex: 1 1 100%; min-width: 0; flex-wrap: wrap; justify-content: center; row-gap: 10px; column-gap: 4px; padding: 0 16px; }
.no-js .marquee__track[aria-hidden="true"] { display: none; }
.no-js .marquee__track li { font-size: clamp(1.05rem, 0.9rem + 0.9vw, 1.6rem); gap: 14px; padding-right: 14px; }

/* Reduced motion: everything in its final place, nothing to pause */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .marquee { width: auto; justify-content: center; }
  .marquee__track { flex: 1 1 100%; min-width: 0; flex-wrap: wrap; justify-content: center; row-gap: 10px; column-gap: 4px; padding: 0 16px; }
  .marquee__track[aria-hidden="true"] { display: none; }
  .marquee__track li { font-size: clamp(1.05rem, 0.9rem + 0.9vw, 1.6rem); gap: 14px; padding-right: 14px; }
  .stage__video { transition: none; }
  .motion-toggle { display: none; }
}
