/* LifePath website. Colours, fonts and pixel art come from the app
   (lib/theme.dart, assets/fonts, the in-game pixel scenes). */

@font-face { font-family: "Press Start 2P"; src: url("fonts/PressStart2P-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Outfit"; src: url("fonts/Outfit-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Outfit"; src: url("fonts/Outfit-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Outfit"; src: url("fonts/Outfit-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("fonts/Fraunces-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --paper: #faf6f0;
  --surface: #fffcf7;
  --card: #f3ebe1;
  --line: #e2d6c4;
  --forest: #12584f;
  --ink: #103d37;
  --ink-deep: #0b2e29;
  --text: #25332a;
  --text-2: #4f6356;
  --on-ink: #d9e9df;
  --on-ink-2: #b6ccbf;
  --amber: #f2b653;
  --amber-dark: #c98a24;
  --sky: #4fb3e8;
  --pixel: "Press Start 2P", ui-monospace, monospace;
  --sans: "Outfit", system-ui, sans-serif;
  --serif: "Fraunces", Georgia, serif;
  --wrap: 1140px;
  --p: 4px; /* one "pixel" */
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-color: #b9a98f var(--paper); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font: 400 1.0625rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--amber); color: var(--ink); }
img, video { display: block; max-width: 100%; height: auto; }
.pixelated { image-rendering: pixelated; }
a { color: var(--forest); text-underline-offset: 0.22em; text-decoration-thickness: 2px; }
a:hover { color: var(--ink); }
:focus-visible { outline: var(--p) solid var(--amber); outline-offset: var(--p); }

.skip-link { position: absolute; left: 1rem; top: -4rem; background: var(--ink); color: var(--surface); padding: 0.6rem 0.9rem; z-index: 10; font: 0.7rem/1 var(--pixel); }
.skip-link:focus, .skip-link:hover { top: 1rem; color: var(--surface); }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Pixel box: notched corners drawn with four flat shadows, plus a hard drop shadow. */
.px {
  box-shadow:
    0 calc(var(--p) * -1) 0 0 var(--ink),
    0 var(--p) 0 0 var(--ink),
    calc(var(--p) * -1) 0 0 0 var(--ink),
    var(--p) 0 0 0 var(--ink),
    0 calc(var(--p) * 3) 0 0 rgba(16, 61, 55, 0.22);
}

/* Type */
h1, h2, h3 { color: var(--ink); text-wrap: balance; margin: 0; }
h1, h2 { font-family: var(--pixel); font-weight: 400; letter-spacing: 0; }
h1 { font-size: clamp(1.55rem, 3.6vw, 2.65rem); line-height: 1.45; margin-bottom: 1.75rem; }
h2 { font-size: clamp(1.2rem, 2.6vw, 1.85rem); line-height: 1.5; margin-bottom: 1.25rem; }
h3 { font: 600 1.25rem/1.3 var(--serif); margin-bottom: 0.35rem; }
p { margin: 0 0 1rem; }
.lede { font-size: 1.2rem; color: var(--text-2); max-width: 36ch; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 0.7rem;
  font: 0.72rem/1.2 var(--pixel); text-transform: uppercase; text-decoration: none;
  color: var(--ink); background: var(--amber);
  padding: 0.95rem 1.2rem; border: 0; cursor: pointer;
  box-shadow:
    0 calc(var(--p) * -1) 0 0 var(--ink), 0 var(--p) 0 0 var(--ink),
    calc(var(--p) * -1) 0 0 0 var(--ink), var(--p) 0 0 0 var(--ink),
    inset 0 calc(var(--p) * -1) 0 0 var(--amber-dark),
    0 calc(var(--p) * 2) 0 0 var(--ink);
  transition: translate 80ms steps(2), box-shadow 80ms steps(2);
}
.btn:hover { color: var(--ink); background: #f6c56f; }
.btn:active {
  translate: 0 var(--p);
  box-shadow:
    0 calc(var(--p) * -1) 0 0 var(--ink), 0 var(--p) 0 0 var(--ink),
    calc(var(--p) * -1) 0 0 0 var(--ink), var(--p) 0 0 0 var(--ink),
    inset 0 var(--p) 0 0 var(--amber-dark);
}
.btn svg { width: 16px; height: 16px; fill: currentColor; flex: none; shape-rendering: crispEdges; }
.btn.ghost { background: var(--surface); }
.btn.ghost:hover { background: var(--card); }
.btn.ghost { box-shadow:
    0 calc(var(--p) * -1) 0 0 var(--ink), 0 var(--p) 0 0 var(--ink),
    calc(var(--p) * -1) 0 0 0 var(--ink), var(--p) 0 0 0 var(--ink),
    inset 0 calc(var(--p) * -1) 0 0 var(--line),
    0 calc(var(--p) * 2) 0 0 var(--ink); }
.btn.ghost[aria-pressed="true"] { background: var(--amber); }
/* Fixed label width, so "Music on" / "Music off" never resizes the header. */
#music-label { display: inline-block; min-width: 9ch; text-align: left; }
/* Icon and label share one centre line; the label box is exactly one line tall. */
.btn > svg { display: block; }
.btn-label { display: inline-flex; align-items: center; line-height: 1; }
.btn-label .caret { height: 0.9em; vertical-align: 0; margin-left: 0.3em; }
.btn.small { font-size: 0.7rem; padding: 0.7rem 0.85rem; }

/* Header */
.site-header { background: var(--paper); border-bottom: var(--p) solid var(--ink); position: relative; z-index: 2; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 5rem; }
.brand { display: inline-flex; align-items: center; gap: 0.7rem; color: var(--ink); text-decoration: none; font: 0.95rem/1 var(--pixel); }
.brand:hover { color: var(--ink); }
.brand img { width: 36px; height: 36px; }
.header-right { display: flex; align-items: center; gap: 1.6rem; }
.site-nav { display: flex; gap: 1.5rem; }
.site-nav a { color: var(--text-2); text-decoration: none; font: 0.7rem/1 var(--pixel); text-transform: uppercase; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-thickness: var(--p); text-underline-offset: 0.6em; }

/* Hero: the game's start-menu scene fills the background (js/scene.js). */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  background: #12332f; color: var(--on-ink);
  min-height: max(640px, calc(100svh - 5rem));
  padding: clamp(2.5rem, 5vw, 4rem) 0 calc(var(--town, 180px) * 0.45);
}
.scene-bg { position: absolute; left: 0; bottom: 0; z-index: -1; image-rendering: pixelated; }
.hero h1 { color: var(--surface); text-shadow: 0 4px 0 #0b2e29; }
.hero .lede { color: #c9ddd1; }
.hero .cta-row small { color: #b6ccbf; }
.hero .reel-caption { color: var(--surface); }
.hero .reel-caption .cap-box { display: inline-block; background: var(--ink-deep); padding: 0.45rem 0.6rem; box-shadow: 0 0 0 2px #2e6a60; }
.hero .reel-caption .caret { color: var(--amber); }
.hero .wrap { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.hero .wrap > div:first-child { padding-top: clamp(1rem, 4vh, 3rem); }
.hero .iphone { max-width: 270px; }
/* The reel is a little taller than the screen: crop the bottom (under the home
   indicator), not the app's header under the status bar. */
.hero .iphone .screen > video { object-position: center top; }
/* On the dark hero, a light outer ring keeps the black body readable. */
.hero .iphone { box-shadow: 0 0 0 1px #2b2c2f, 0 0 0 3px #b4b6bb, 0 0 0 4px #7d8085, 0 30px 60px -16px rgba(0, 0, 0, 0.7); }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem 1.5rem; margin-top: 2.25rem; }
.cta-row small { color: var(--text-2); font-size: 0.98rem; }
.caret { display: inline-block; width: 0.6em; height: 1em; background: currentColor; vertical-align: -0.12em; margin-left: 0.15em; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* iPhone mockup (iPhone 16 Pro proportions: 71.5 x 149.6 mm body, 402 x 874 pt screen).
   Sized in cqw (1% of the phone's width), so one rule set serves every size.
   Body radius 14% of width, uniform black bezel 3.5% of width, titanium rim as rings. */
.iphone {
  position: relative; container-type: inline-size;
  width: 100%; max-width: 320px; margin-inline: auto;
  aspect-ratio: 0.478;
  border-radius: 14% / 6.69%;
  background: #050506;
  box-shadow:
    0 0 0 1px #2b2c2f,
    0 0 0 3px #a7a9ae,
    0 0 0 4px #6c6e73,
    0 28px 50px -18px rgba(0, 0, 0, 0.55);
}
/* Side buttons: action and two volume buttons on the left, side button on the right. */
.iphone::before, .iphone::after {
  content: ""; position: absolute; width: 1.1cqw; background: #8f9196; border-radius: 0.6cqw;
}
.iphone::before {
  left: -2.1cqw; top: 19cqw; height: 7cqw;
  box-shadow: 0 13cqw 0 0 #8f9196, 0 24cqw 0 0 #8f9196;
}
.iphone::after { right: -2.1cqw; top: 36cqw; height: 22cqw; }
.iphone .screen {
  position: absolute; inset: 1.67% 3.5%;
  border-radius: 10.5cqw; overflow: hidden;
  background: var(--surface);
  padding-top: 12cqw; /* status bar */
}
.iphone .screen > img, .iphone .screen > video, .iphone .screen > iframe {
  display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; border: 0;
}
/* Dynamic Island */
.iphone .screen::before {
  content: ""; position: absolute; z-index: 3; top: 2.8cqw; left: 50%; translate: -50% 0;
  width: 31cqw; height: 9.2cqw; border-radius: 5cqw; background: #000;
}
/* Status bar (9:41, signal, Wi-Fi, battery) and home indicator, drawn over the app. */
.iphone .screen::after {
  content: "9:41"; position: absolute; z-index: 2; inset: 0; pointer-events: none;
  padding: 5.4cqw 0 0 11.5cqw;
  font: 600 4.3cqw/1 -apple-system, "SF Pro Text", "Outfit", system-ui, sans-serif; color: #111;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 68 12'%3E%3Cg fill='%23111'%3E%3Crect x='0' y='8' width='3' height='4' rx='.8'/%3E%3Crect x='4.5' y='6' width='3' height='6' rx='.8'/%3E%3Crect x='9' y='3.5' width='3' height='8.5' rx='.8'/%3E%3Crect x='13.5' y='1' width='3' height='11' rx='.8'/%3E%3Cpath d='M29 3.2a10 10 0 0 1 13 0l-1.3 1.4a8 8 0 0 0-10.4 0zM31.2 5.6a6.8 6.8 0 0 1 8.6 0l-1.3 1.4a4.8 4.8 0 0 0-6 0zM33.4 8a3.4 3.4 0 0 1 4.2 0L35.5 10.3z'/%3E%3Crect x='47' y='1' width='19' height='10' rx='3' fill='none' stroke='%23111' stroke-opacity='.4'/%3E%3Crect x='48.6' y='2.6' width='15.8' height='6.8' rx='1.8'/%3E%3Crect x='66.6' y='4' width='1.4' height='4' rx='.7' fill-opacity='.4'/%3E%3C/g%3E%3C/svg%3E")
      right 7cqw top 5.4cqw / 17cqw 3cqw no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 134 5'%3E%3Crect width='134' height='5' rx='2.5' fill='%23111'/%3E%3C/svg%3E")
      center bottom 2cqw / 34cqw 1.3cqw no-repeat,
    linear-gradient(var(--surface), var(--surface)) top / 100% 12cqw no-repeat;
}

.video-note { text-align: center; margin-top: 1.6rem; font: 0.7rem/1.6 var(--pixel); color: var(--text-2); text-transform: uppercase; }

/* Stepped edges for the dark band */
.band { position: relative; background: var(--ink); color: var(--on-ink); }
.band::before, .band::after {
  content: ""; position: absolute; left: 0; right: 0; height: 16px;
  background: linear-gradient(90deg, var(--ink) 50%, transparent 0) 0 0 / 32px 8px repeat-x,
              linear-gradient(var(--ink), var(--ink)) 0 8px / 100% 8px no-repeat;
}
.band::before { top: -16px; }
.band::after { bottom: -16px; transform: scaleY(-1); }
.band h2 { color: var(--surface); }
.band .intro { max-width: 48ch; color: var(--on-ink-2); }

/* Scenes */
.scenes { padding: clamp(4rem, 8vw, 6rem) 0; }
.scenes .wrap > p { max-width: 50ch; color: var(--text-2); }
.scene-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; margin-top: 2.75rem; }
.scene-grid figure { margin: 0; }
.scene-grid img { width: 100%; aspect-ratio: 5 / 3; object-fit: cover; }
.scene-grid figcaption { margin-top: 1.4rem; font: 0.7rem/1.6 var(--pixel); text-transform: uppercase; color: var(--ink); }

/* Life in order */
.life { padding: clamp(4rem, 8vw, 6rem) 0; margin: 16px 0; }
.reel {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(210px, 236px); gap: 2.25rem;
  overflow-x: auto; padding: 0.75rem 1.25rem 2rem; margin: 2.5rem -1.25rem 0;
  scroll-snap-type: x mandatory; scroll-padding-inline: 1.25rem; scrollbar-color: #2e6a60 transparent;
}
.reel figure { margin: 0; scroll-snap-align: start; }
.reel .iphone { max-width: none; width: calc(100% - 8px); }
.reel figcaption { margin-top: 1.25rem; }
.reel figcaption strong { display: block; font: 0.7rem/1.6 var(--pixel); text-transform: uppercase; color: var(--ink); }
.reel figcaption span { display: block; color: var(--text-2); font-size: 0.98rem; margin-top: 0.45rem; }
.life .intro { max-width: 48ch; color: var(--text-2); }

/* Facts */
.facts { padding: clamp(4rem, 8vw, 6rem) 0; }
.facts .wrap { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: clamp(2rem, 6vw, 5rem); }
.facts dl { margin: 0; background: var(--surface); padding: 0.5rem 1.75rem; }
.facts dl div { display: grid; grid-template-columns: 10.5rem 1fr; gap: 1rem; padding: 1.05rem 0; border-bottom: var(--p) dotted var(--line); }
.facts dl div:last-child { border-bottom: 0; }
.facts dt { font: 0.7rem/1.7 var(--pixel); text-transform: uppercase; color: var(--ink); }
.facts dd { margin: 0; color: var(--text-2); }

/* Prose pages (support, privacy, terms) */
.prose { padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(3.5rem, 8vw, 6rem); }
.prose .wrap { max-width: 740px; }
.prose h1 { font-size: clamp(1.4rem, 4vw, 2.1rem); margin-bottom: 1rem; }
.prose .updated { color: var(--text-2); margin-bottom: 2.5rem; }
.prose h2 { font-size: 0.95rem; line-height: 1.7; margin: 2.75rem 0 0.9rem; }
.prose h3 { margin-top: 1.9rem; }
.prose ul { padding-left: 1.2rem; margin: 0 0 1rem; }
.prose li { margin-bottom: 0.5rem; }
.prose li::marker { color: var(--amber-dark); }
.prose code { font-size: 0.9em; background: var(--card); padding: 0.1em 0.35em; }
.contact { margin: 2rem 0; padding: 1.4rem 1.6rem; background: var(--surface); }
.contact p:last-child { margin-bottom: 0; }
.contact a { font-weight: 600; font-size: 1.15rem; }

/* Video caption under the hero phone */
.screen { position: relative; }
.attract {
  position: absolute; inset: auto 0 0 0; display: grid; justify-items: center; gap: 0.7rem;
  padding: 2.5rem 0.75rem 1.1rem;
  background: linear-gradient(to top, rgba(11, 46, 41, 0.92) 55%, rgba(11, 46, 41, 0));
}
.attract .btn { font-size: 0.75rem; }
.attract-note { font: 0.7rem/1.5 var(--pixel); text-transform: uppercase; color: var(--surface); text-align: center; }

/* The game stays inside the hero phone; the page remains scrollable. */
[hidden] { display: none !important; }
.hero .iphone.playing { max-width: 360px; scroll-margin-top: 1rem; }
#demo-frame { position: absolute; inset: 12cqw 0 0; }
#demo-frame iframe { width: 100%; height: 100%; display: block; border: 0; }
.demo-loading { position: absolute; inset: 0; z-index: 1; display: grid; place-content: center; gap: 1.5rem; padding: 1.5rem; background: var(--ink-deep); color: var(--surface); text-align: center; font-size: 1rem; }
.demo-loading p { margin: 0; }
.inline-demo-controls { display: grid; justify-items: center; gap: 1rem; margin-top: 1.5rem; }
.demo-note { max-width: 34ch; margin: 0; font-size: 0.9rem; color: var(--on-ink-2); text-align: center; }
.reel-caption { min-height: 2.6em; text-align: center; margin-top: 1.5rem; font: 0.75rem/1.7 var(--pixel); text-transform: uppercase; color: var(--ink); }
.reel-caption .caret { color: var(--amber-dark); }

/* Roll a life */
.roll { padding: clamp(3.5rem, 7vw, 5.5rem) 0; }
.roll .wrap { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.roll .wrap > div:first-child p { color: var(--text-2); max-width: 36ch; }
.roll .wrap > div:first-child .btn { margin-top: 1rem; }
.roll .wrap > div:first-child .roll-hint { margin-top: 1.4rem; font-size: 0.92rem; }
.record { background: var(--surface); padding: 1.75rem 2rem 2rem; }
.record-head { display: flex; justify-content: space-between; gap: 1rem; font: 0.7rem/1.6 var(--pixel); text-transform: uppercase; color: var(--text-2); border-bottom: var(--p) dotted var(--line); padding-bottom: 1rem; margin-bottom: 1.25rem; }
.record-name { font: 600 clamp(1.7rem, 3.4vw, 2.3rem)/1.15 var(--serif); color: var(--ink); margin: 0 0 0.35rem; }
.record-place { color: var(--text-2); margin-bottom: 1.25rem; }
.record-family { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.9rem 1.5rem; margin: 0 0 1.5rem; }
.record-family dt { font: 0.7rem/1.6 var(--pixel); text-transform: uppercase; color: var(--text-2); }
.record-family dd { margin: 0.2rem 0 0; color: var(--text); font-weight: 500; }
.stats { display: grid; gap: 0.7rem; margin: 0; padding: 0; list-style: none; }
.stats li { display: grid; grid-template-columns: 7.5rem 1fr 2.6rem; align-items: center; gap: 0.9rem; font-weight: 500; }
.stats .num { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-2); }
.bar { height: 14px; background: var(--card); box-shadow: 0 0 0 2px var(--ink); position: relative; overflow: hidden; }
.bar i { position: absolute; inset: 0; background: var(--forest); transform: scaleX(0); transform-origin: left; transition: transform 600ms steps(12); }
.bar.happy i { background: #7a5fd6; }
.bar.looks i, .bar.athletic i { background: #c67b43; }
.record-note { margin: 1.25rem 0 0; font-size: 0.92rem; color: var(--text-2); }

/* Event log */
.log { padding: clamp(4rem, 8vw, 6rem) 0; margin: 16px 0; }
.log-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 1rem 2rem; }
.log-list { list-style: none; margin: 2.5rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 3rem; }
.log-list li { position: relative; padding: 1rem 0 1rem 1.6rem; border-bottom: 2px dashed #2e6a60; color: var(--on-ink); font-size: 1.05rem; }
.log-list li::before { content: ""; position: absolute; left: 0; top: 1.45rem; width: 8px; height: 8px; background: var(--amber); }
.log .btn.ghost { background: var(--ink-deep); color: var(--on-ink); box-shadow: 0 -4px 0 0 var(--amber), 0 4px 0 0 var(--amber), -4px 0 0 0 var(--amber), 4px 0 0 0 var(--amber), 0 8px 0 0 var(--amber-dark); }
.log .btn.ghost:hover { background: #154a43; color: var(--surface); }
.log-source { margin-top: 1.75rem; color: var(--on-ink-2); font-size: 0.92rem; }

.release { margin-top: 1rem; }
.release h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem; margin-top: 1rem; }
.release-tag { font-size: 0.7rem; background: var(--amber); color: var(--ink); padding: 0.45rem 0.6rem; }

/* Footer */
.site-footer { border-top: var(--p) solid var(--ink); padding: 2.5rem 0 3rem; color: var(--text-2); font-size: 0.95rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.25rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 1.5rem; }
.site-footer a { color: var(--text-2); }
.site-footer a:hover { color: var(--ink); }
.site-footer .credit { font: 0.7rem/1.6 var(--pixel); text-transform: uppercase; }

@media (max-width: 900px) {
  .scene-grid { grid-template-columns: repeat(2, 1fr); }
  .log-list { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .hero .wrap, .facts .wrap, .roll .wrap { grid-template-columns: 1fr; }
  .hero .wrap > div:last-child { order: 0; }
  .hero { min-height: 0; padding-bottom: calc(var(--town, 180px) + 1.5rem); }
  .hero .wrap > div:first-child { padding-top: 0; }
  .hero .iphone { max-width: 210px; }
  .facts dl div { grid-template-columns: 1fr; gap: 0.3rem; }
}
@media (max-width: 560px) {
  /* Phones: the menu drops to its own row under the logo instead of hiding. */
  .site-header .wrap { flex-wrap: wrap; height: auto; padding-block: 0.9rem; row-gap: 0.85rem; }
  .header-right { display: contents; }
  .site-header #music { margin-left: auto; }
  .site-nav { order: 3; flex-basis: 100%; gap: 1.4rem; }
  .site-nav a { font-size: 0.7rem; padding-block: 0.35rem; }
  .hero .iphone { max-width: 180px; }
  .hero .reel-caption { margin-top: 1.1rem; font-size: 0.7rem; }
  .hero .reel-caption .cap-box { white-space: nowrap; } /* keeps the caret beside the words */
  .scene-grid { gap: 1.5rem; }
  .facts dl { padding: 0.25rem 1.1rem; }
  .record { padding: 1.4rem 1.25rem 1.6rem; }
  .stats li { grid-template-columns: 6.3rem 1fr 2.3rem; gap: 0.6rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .caret { animation: none; }
  .bar i { transition: none; }
}

/* One shared header, with a compact sliding drawer on smaller screens. */
.menu-toggle, .menu-close { width: 44px; height: 44px; display: none; align-items: center; justify-content: center; padding: 8px; border: 0; background: transparent; color: var(--ink); cursor: pointer; }
.menu-toggle svg, .menu-close svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: square; }
.menu-close { display: flex; }
.mobile-menu { position: fixed; inset: 0 0 0 auto; width: min(340px, 90vw); height: 100dvh; max-height: none; max-width: none; margin: 0; padding: 1.25rem; border: 0; background: var(--paper); color: var(--ink); overflow-y: auto; }
.mobile-menu[open] { display: flex; flex-direction: column; gap: 2rem; animation: menu-enter 220ms ease-out; }
.mobile-menu::backdrop { background: rgba(8, 30, 27, 0.7); }
.menu-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; font: 0.7rem/1.8 var(--pixel); }
.mobile-menu nav { display: grid; gap: 0.5rem; }
.mobile-menu nav a { min-height: 48px; padding: 0.75rem; color: var(--ink); text-decoration: none; font: 0.75rem/1.8 var(--pixel); }
.mobile-menu nav a[aria-current=page] { background: var(--card); }
.mobile-menu .music-toggle { align-self: flex-start; margin-top: auto; }
.music-toggle [data-music-label] { display: inline-block; min-width: 9ch; }
html.menu-open, html.menu-open body { overflow: hidden; }
@keyframes menu-enter { from { transform: translateX(100%); } to { transform: translateX(0); } }
@media (max-width: 1000px) {
  .site-header .wrap { height: 4.5rem; flex-wrap: nowrap; padding-block: 0; gap: 0.75rem; }
  .site-header .header-right { display: none; }
  .menu-toggle { display: flex; flex: none; margin-left: auto; }
  .brand { font-size: clamp(0.7rem, 2.6vw, 0.85rem); gap: 0.5rem; white-space: nowrap; }
  .brand img { width: 30px; height: 30px; }
}
@media (max-width: 820px) {
  .hero .iphone, .hero .iphone.playing { width: min(100%, 340px); max-width: 340px; }
  .hero .wrap { gap: 2.5rem; }
  .hero .wrap > div:first-child { padding-top: 0; }
  .hero h1 { font-size: clamp(1.5rem, 5.4vw, 2.5rem); }
  .hero .lede { max-width: 48ch; }
  .hero .reel-caption { font-size: 0.7rem; }
  .hero .reel-caption .cap-box { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) { .mobile-menu[open] { animation: none; } }

.hero-phone.playing ~ .reel-caption { display: none; }


/* Clear hero action and explicit preview motion controls. */
.store-status { color: var(--on-ink-2); font-size: 1rem; }
.preview-controls { display: flex; justify-content: center; margin-top: 1.4rem; }
.hero .preview-controls .btn { background: var(--surface); color: var(--ink); }
.demo-playing #demo-close { position: fixed; z-index: 8; right: max(1rem, env(safe-area-inset-right)); bottom: max(1rem, env(safe-area-inset-bottom)); background: var(--surface); color: var(--ink); min-height: 44px; }
.demo-playing { padding-bottom: 5rem; }
@media (max-width: 560px) { .cta-row { gap: 1.25rem; margin-top: 1.5rem; } .store-status { flex-basis: 100%; } }

/* Preview captions sit at the top of the phone, above the gameplay. */
.hero .screen .reel-caption { position: absolute; top: 14cqw; left: 5%; right: 5%; z-index: 4; margin: 0; min-height: 0; pointer-events: none; font-size: clamp(0.7rem, 3.6cqw, 0.8rem); line-height: 1.6; }
.hero .screen .reel-caption .cap-box { white-space: normal; text-wrap: balance; }
.hero-phone.playing .reel-caption { display: none; }
