/* P-51 Math Run — landing page. Same tokens as the game: cream faces, navy ink, red-tail accent, stencil numerals. */
:root {
  --navy: #17294d; --navy-2: #223a6b; --cream: #fff3d6; --red: #e63b2e; --gold: #ffc857;
  --sky: #62bcff; --sky-deep: #2f8fe6; --sea: #1fb4c9; --green: #37d67a;
  --ink-soft: rgba(23,41,77,.62); --line: rgba(23,41,77,.16); --line-strong: rgba(23,41,77,.3);
  --face: rgba(255,247,228,.92);
  --shadow: 0 8px 24px rgba(10,30,70,.14);
  --stencil: "Black Ops One", "Arial Black", sans-serif;
  --body: "Fredoka", "Nunito", "Segoe UI", system-ui, sans-serif;
  --r-lg: 26px; --r-md: 18px; --r-pill: 999px;
  --gutter: clamp(16px, 5vw, 72px);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto; }
body { font-family: var(--body); color: var(--navy); background: linear-gradient(180deg, var(--sky) 0, #a9dcff 70%, #7fd9e6 100%); min-height: 100vh; overflow-x: hidden; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
iconify-icon { display: inline-block; vertical-align: -0.15em; }
.stencil { font-family: var(--stencil); font-weight: 400; letter-spacing: .5px; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 50; background: var(--navy); color: #fff; padding: 10px 14px; border-radius: 8px; text-decoration: none; }
.skip:focus { top: 8px; }

/* ---------- header ---------- */
.top { position: fixed; inset: 0 0 auto 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; padding: 14px var(--gutter); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--stencil); font-size: 16px; letter-spacing: 2px; text-decoration: none; color: var(--navy); padding: 9px 16px 9px 10px; border-radius: var(--r-pill); background: var(--face); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1.5px solid rgba(255,255,255,.7); box-shadow: var(--shadow); }
.roundel { width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle, #fff 0 22%, var(--red) 23% 48%, #fff 49% 62%, var(--navy) 63%); box-shadow: 0 2px 6px rgba(0,0,0,.25); }
nav { display: flex; gap: 6px; align-items: center; padding: 6px; border-radius: var(--r-pill); background: var(--face); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1.5px solid rgba(255,255,255,.7); box-shadow: var(--shadow); }
nav a { text-decoration: none; font-weight: 600; font-size: 15px; padding: 8px 14px; border-radius: var(--r-pill); }
nav a:hover { background: rgba(23,41,77,.07); }
nav .nav-play { background: var(--red); color: #fff; }

/* ---------- hero ---------- */
.hero { position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: center; padding: 100px var(--gutter) 60px; overflow: hidden; }
#hero { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: pan-y; }
#hero:active { cursor: grabbing; }
#hero.pixelated { image-rendering: pixelated; }
.filter-overlay { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.filter-overlay::before, .filter-overlay::after { content: ""; position: absolute; inset: -20%; pointer-events: none; opacity: 0; }
.fx-grain::before { opacity: .16; background-image: var(--noise); background-size: 160px; mix-blend-mode: overlay; animation: grain .35s steps(3) infinite; }
.fx-paper::before { opacity: .28; background-image: var(--noise); background-size: 320px; mix-blend-mode: multiply; filter: blur(.4px) contrast(.6) brightness(1.5); }
.fx-vignette::after { opacity: 1; inset: 0; background: radial-gradient(ellipse at center, transparent 55%, rgba(10,20,40,.55) 100%); }
.fx-scanlines::after { opacity: .28; inset: 0; background: repeating-linear-gradient(0deg, rgba(0,0,0,.35) 0 2px, transparent 2px 4px); }
.fx-halftone::before { opacity: .22; inset: 0; background-image: radial-gradient(circle, rgba(20,20,40,.9) 1.1px, transparent 1.6px); background-size: 6px 6px; mix-blend-mode: multiply; }
.fx-glow { backdrop-filter: blur(1.2px) brightness(1.03); -webkit-backdrop-filter: blur(1.2px) brightness(1.03); }
.fx-glow::after { opacity: 1; inset: 0; background: radial-gradient(ellipse at 50% 30%, rgba(255,255,255,.18), transparent 60%); mix-blend-mode: screen; }
@keyframes grain { 0% { transform: translate(0,0); } 33% { transform: translate(-6%, 4%); } 66% { transform: translate(5%, -5%); } 100% { transform: translate(0,0); } }
@media (prefers-reduced-motion: reduce) { .fx-grain::before { animation: none; } }
.hero-poster { position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(90deg, rgba(23,41,77,.28) 0, rgba(23,41,77,.1) 45%, transparent 70%); }
.hero-copy { position: relative; z-index: 2; max-width: 700px; pointer-events: none; }
.hero-copy > * { pointer-events: auto; }
.eyebrow { display: inline-block; font-size: 12px; letter-spacing: 4px; text-transform: uppercase; font-weight: 600; color: var(--cream); background: rgba(23,41,77,.7); padding: 6px 12px; border-radius: var(--r-pill); margin-bottom: 14px; }
h1 { font-family: var(--stencil); font-weight: 400; font-size: clamp(44px, 6.6vw, 92px); line-height: .95; color: var(--cream); text-shadow: 0 6px 0 var(--navy), 0 16px 40px rgba(10,30,70,.35); margin-bottom: 22px; }
h1 .w { display: inline-block; margin-right: .22em; }
h1 .accent { color: var(--gold); }
.lead { display: inline-block; font-size: clamp(16px, 1.3vw, 19px); line-height: 1.55; color: var(--navy); background: var(--face); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1.5px solid rgba(255,255,255,.7); border-radius: var(--r-md); padding: 14px 18px; box-shadow: var(--shadow); margin-bottom: 20px; max-width: 560px; }
.lead b { font-family: var(--stencil); font-weight: 400; color: var(--red); }
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.btn { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 700; font-size: 20px; color: var(--navy); padding: 15px 30px; border-radius: var(--r-pill); background: #fff; border: 1.5px solid var(--line-strong); box-shadow: 0 8px 22px rgba(10,30,70,.15); transition: transform .12s, box-shadow .12s; }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; box-shadow: 0 10px 26px rgba(230,59,46,.4); }
.btn.big { font-size: 24px; padding: 18px 38px; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(1px); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-weight: 600; font-size: 15px; padding: 9px 14px; border-radius: var(--r-pill); background: var(--face); border: 1.5px solid rgba(255,255,255,.7); backdrop-filter: blur(8px); box-shadow: var(--shadow); transition: transform .12s, background .12s; }
.chip:hover { background: #fff; transform: translateY(-1px); }
.hero-hint { position: absolute; right: var(--gutter); bottom: 22px; z-index: 2; font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--cream); text-shadow: 0 1px 0 rgba(23,41,77,.5); opacity: .85; }

/* ---------- how-to pop-ups ---------- */
.cta-note { width: 100%; font-size: 13px; color: var(--cream); text-shadow: 0 1px 0 rgba(23,41,77,.6); opacity: .9; }
.hero-credits { position: absolute; left: var(--gutter); bottom: 22px; z-index: 2; font-size: 12px; color: var(--cream); opacity: .75; text-shadow: 0 1px 0 rgba(23,41,77,.5); }
.tag { display: inline-block; padding: 5px 12px; border-radius: var(--r-pill); background: rgba(23,41,77,.08); color: var(--navy); font-size: 11px; letter-spacing: 2px; text-transform: uppercase; font-weight: 600; }
.howto { width: min(720px, 94vw); max-height: 92vh; overflow: auto; margin: auto; padding: 28px 32px 30px; border: 1.5px solid rgba(255,255,255,.7); border-radius: var(--r-lg); background: var(--face); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); color: var(--navy); box-shadow: 0 24px 60px rgba(10,30,70,.28); text-align: center; }
.howto::backdrop { background: rgba(10,25,60,.45); backdrop-filter: blur(4px); }
.howto[open] { animation: howto-in .28s cubic-bezier(.2,.9,.3,1.2); }
@keyframes howto-in { from { transform: translateY(24px) scale(.96); opacity: 0; } }
.howto .close { position: absolute; top: 14px; right: 14px; font: inherit; font-size: 28px; line-height: 1; color: var(--navy); background: transparent; border: 0; cursor: pointer; border-radius: 50%; width: 40px; height: 40px; display: grid; place-items: center; }
.howto .close:hover { background: rgba(23,41,77,.08); }
.howto h2 { font-size: clamp(28px, 4vw, 40px); line-height: 1.05; margin: 10px 0 8px; }
.howto-lead { font-size: 16px; line-height: 1.5; color: var(--ink-soft); max-width: 560px; margin: 0 auto 16px; }
.gestures { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.g { background: rgba(255,255,255,.6); border: 1.5px solid var(--line); border-radius: var(--r-md); padding: 12px 8px; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.g svg { width: 64px; height: 64px; fill: none; stroke: var(--navy-2); stroke-width: 3.5; stroke-linecap: round; }
.g svg circle { fill: var(--navy-2); stroke: none; }
.g svg .arrow { stroke: var(--red); }
.g .big-icon { font-size: 50px; height: 64px; display: flex; align-items: center; color: var(--navy-2); }
.g .keys { display: flex; gap: 6px; align-items: center; height: 64px; }
.g b { font-size: 15px; } .g span { font-size: 12px; color: var(--ink-soft); line-height: 1.3; }
kbd { font: inherit; font-size: 14px; font-weight: 700; color: #fff; padding: 6px 10px; border-radius: 9px; background: var(--navy-2); box-shadow: 0 3px 0 rgba(13,26,54,.5); min-width: 34px; text-align: center; display: inline-flex; align-items: center; justify-content: center; }
kbd iconify-icon { font-size: 18px; }
kbd.wide { padding: 6px 16px; }
.tips { list-style: none; text-align: left; max-width: 560px; margin: 0 auto 18px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 1.5; color: var(--ink-soft); }
.tips li { padding-left: 18px; position: relative; }
.tips li::before { content: ""; position: absolute; left: 0; top: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.tips kbd { font-size: 12px; padding: 2px 7px; min-width: 0; box-shadow: none; }
.howto-actions { display: flex; justify-content: center; }

@media (max-width: 900px) {
  nav a:not(.nav-play) { display: none; }
  .hero { padding-top: 92px; align-items: flex-end; }
  .hero-poster { background: linear-gradient(180deg, transparent 30%, rgba(23,41,77,.35) 100%); }
  .hero-hint { display: none; }
  .gestures { grid-template-columns: repeat(2, 1fr); }
  .howto { padding: 22px 18px; }
  .hero-credits { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .chip { transition: none; }
}

/* ---------- phones ---------- */
.mobile-only { display: none !important; }
body.mobile .mobile-only { display: inline-flex !important; }
body.mobile .desktop-only { display: none !important; }
body.mobile .top { padding: 12px 16px; }
body.mobile .hero { padding: 84px 16px 40px; }
body.mobile .gestures { grid-template-columns: repeat(2, 1fr); }
