/* MathQuest landing — "The Game's Own World"
   One scroll climbs Green Meadows -> Treehouse Canopy -> Sky Islands in the
   game's real palettes. One shared motion clock (--clock) drives every drift
   at stepped rates; the reading plane never moves. One ember color is
   reserved for the hot object (the solved block and star moment) only. */

@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('/assets/fonts/nunito-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Green Meadows (game palette: sky #B8E0FF, ground #7EC850 / #5A9E30) */
  --sky-top:      #dcf0ff;
  --sky:          #b8e0ff;
  --grass:        #7ec850;
  --grass-dark:   #5a9e30;

  /* Treehouse Canopy */
  --canopy:       #2c5136;
  --canopy-deep:  #1e3b26;
  --wood:         #c89a66;
  --wood-dark:    #8a6238;

  /* Sky Islands sunset (the exported sunsetCelebration preset, exact) */
  --sunset-1:     #ffd0a0;
  --sunset-2:     #ffa098;
  --sunset-3:     #e890b8;
  --sunset-4:     #a880c0;
  --night:        #3a2a55;
  --night-deep:   #2a1e40;

  /* Ink & paper. --paper is the light TEXT color on dark grounds; the
     cream pair below are SURFACES, taken from the app's own menu face
     (default theme sky #FFF0C0 / answer bar #FFF5C8). */
  --ink:          #1f3320;
  --ink-soft:     #3c5240;
  --paper:        #f7f4e8;
  --paper-dim:    #d9d0ea;
  --cream:        #fff3cd;
  --cream-band:   #fff6da;

  /* Reserved hot color: the solved block and star moment only. */
  --ember:        #ff7e5f;
  --gold:         #ffc93c;

  /* Contrast-safe accents (display green passes 3:1 on the sky; label
     brown passes 4.5:1 on wood). */
  --quest:        #3d7820;
  --plaque-brown: #423012;

  --font: 'Nunito', 'Trebuchet MS', system-ui, sans-serif;

  /* The shared motion clock. Every drift is a stepped multiple of it. */
  --clock: 16s;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--sky);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
a:focus-visible,
.store-badge:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  border-radius: 6px;
}

::selection { background: rgba(255, 201, 60, 0.45); color: var(--ink); }

img { max-width: 100%; height: auto; }

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -48px; left: 16px;
  z-index: 50;
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 0 0 12px 12px;
  text-decoration: none;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 0; }

/* ── Nav (floats over the meadow sky) ─────────────────────────────── */

.site-head {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 10;
}

.site-nav {
  max-width: 1080px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-nav .brand {
  font-weight: 900;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}

.site-nav .nav-links {
  display: flex;
  gap: 8px;
}

.site-nav .nav-links a {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  padding: 12px 14px;
  border-radius: 999px;
}
.site-nav .nav-links a:hover { background: rgba(255, 255, 255, 0.55); }

/* ── Hero: inside Green Meadows ───────────────────────────────────── */

.hero {
  position: relative;
  overflow: hidden;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  /* Real meadow backdrop; the gradient beneath is the same palette and
     paints instantly (and if the image ever fails). */
  background-image:
    url('/assets/world/meadow-backdrop.webp'),
    linear-gradient(180deg, var(--sky-top) 0%, var(--sky) 55%, var(--grass) 74%, var(--grass-dark) 100%);
  background-size: cover, auto;
  background-position: center bottom;
}

.hero-sky {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.cloud {
  position: absolute;
  width: clamp(180px, 24vw, 420px);
  height: auto;
  opacity: 0.95;
  animation: cloudDrift calc(var(--clock) * 4) linear infinite;
}
.cloud-1 { top: 9%;  animation-duration: calc(var(--clock) * 5); animation-delay: calc(var(--clock) * -2); }
.cloud-2 { top: 22%; width: clamp(140px, 18vw, 340px); animation-duration: calc(var(--clock) * 7); animation-delay: calc(var(--clock) * -5); }
.cloud-3 { top: 4%;  width: clamp(120px, 14vw, 280px); animation-duration: calc(var(--clock) * 9); animation-delay: calc(var(--clock) * -7); }

@keyframes cloudDrift {
  from { transform: translateX(-30vw); }
  to   { transform: translateX(110vw); }
}

.hero-copy {
  position: relative;
  z-index: 3;
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
  padding: clamp(96px, 14vh, 160px) 24px 0;
}

.hero h1 {
  font-size: clamp(2.9rem, 7.2vw, 5.4rem);
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
  max-width: 12ch;
}

.hero h1 .quest { color: var(--quest); }

.hero .lede {
  font-size: 1.15rem;
  font-weight: 500;
  max-width: 52ch;
  margin: 0 0 6px;
}

.hero .lede-promise {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0 0 26px;
}

.free-note {
  margin: 14px 0 0;
  font-weight: 700;
  font-size: 0.95rem;
}
.free-note .free-star { vertical-align: -3px; }

/* ── Store badges (the page's only buttons) ───────────────────────── */

.store-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.store-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--canopy-deep);
  border: 2px solid rgba(247, 244, 232, 0.25);
  color: var(--paper);
  border-radius: 18px;
  padding: 12px 18px;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(31, 51, 32, 0.32), 0 2px 5px rgba(31, 51, 32, 0.22);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.store-badge:hover {
  background: var(--canopy);
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(31, 51, 32, 0.34), 0 3px 7px rgba(31, 51, 32, 0.22);
}

.store-badge:active {
  transform: translateY(1px);
  box-shadow: 0 4px 10px rgba(31, 51, 32, 0.3);
}

.badge-logo { flex: none; fill: currentColor; }

.badge-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  white-space: nowrap;
}

.badge-text small {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0.85;
}

.badge-text strong { font-size: 1.15rem; font-weight: 800; }

.badge-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  flex: none;
  margin-left: 4px;
}

.badge-qr small {
  font-size: 0.6rem;
  font-weight: 700;
  line-height: 1.2;
  max-width: 56px;
  text-align: center;
  opacity: 0.85;
}

.badge-qr .qr-box {
  display: block;
  background: #ffffff;
  border-radius: 6px;
  padding: 4px;
}
.badge-qr .qr-box img { display: block; width: 44px; height: 44px; }

/* ── Hero scene: the gate being solved ────────────────────────────── */

.hero-scene {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 320px;
  z-index: 1;
  pointer-events: none;
}

/* Scene geometry: the cat's hop occupies 52-65% of its viewport crossing,
   so the blocks and gate are anchored in vw off the same 56vw origin --
   shared geometry keeps the hop landing on block 13 at every width. */
.gate {
  position: absolute;
  left: calc(56vw + 324px);
  bottom: 58px;
  width: clamp(96px, 9.5vw, 132px);
  height: auto;
}

.gate-bubble {
  position: absolute;
  left: calc(56vw + 296px);
  bottom: 340px;
  white-space: nowrap;
  background: #ffffff;
  border: 3px solid #45b7d1; /* answer-tile teal, from the game */
  border-radius: 16px;
  padding: 8px 18px;
  font-size: 1.4rem;
  font-weight: 900;
  color: #1a6fa8; /* the game's HUD text blue */
  box-shadow: 0 4px 14px rgba(26, 111, 168, 0.2);
}
.gate-bubble::after {
  content: "";
  position: absolute;
  bottom: -12px; left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #45b7d1;
}

/* The bubble poses the question, then resolves it once the block is hit.
   Grid-stacking sizes the bubble to the wider of the two states. */
.gate-bubble { display: grid; }
.gate-bubble .q,
.gate-bubble .a { grid-area: 1 / 1; text-align: center; white-space: nowrap; }
.gate-bubble .q { animation: qShow var(--clock) steps(1) infinite; }
.gate-bubble .a { opacity: 0; animation: aShow var(--clock) steps(1) infinite; }

@keyframes qShow {
  0%, 65%  { opacity: 1; }
  66%, 96% { opacity: 0; }
  97%, 100%{ opacity: 1; }
}

@keyframes aShow {
  0%, 65%  { opacity: 0; }
  66%, 96% { opacity: 1; }
  97%, 100%{ opacity: 0; }
}

.blocks {
  position: absolute;
  left: 56vw;
  bottom: 64px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

/* Blocks pose with the question at loop start and, as in the game,
   burst away once the right one is hit (the cat lands through 62-65%). */
.block {
  width: clamp(62px, 6.4vw, 88px);
  height: auto;
  animation: blockCycle var(--clock) linear infinite;
}

.block-correct {
  border-radius: 14px;
  animation:
    blockCycle var(--clock) linear infinite,
    blockGlow var(--clock) linear infinite;
}

@keyframes blockCycle {
  0%, 2%   { opacity: 0; transform: scale(0.6); }
  6%       { opacity: 1; transform: scale(1); }
  62%      { opacity: 1; transform: scale(1); }
  66%      { opacity: 0; transform: scale(1.3); }
  100%     { opacity: 0; transform: scale(1.3); }
}

@keyframes blockGlow {
  0%, 52%  { box-shadow: 0 0 0 0 rgba(255, 126, 95, 0); }
  56%, 62% { box-shadow: 0 0 0 5px var(--ember), 0 0 26px 6px rgba(255, 126, 95, 0.55); }
  66%, 100%{ box-shadow: 0 0 0 0 rgba(255, 126, 95, 0); }
}

.star-pop {
  position: absolute;
  left: calc(56vw + 100px);
  bottom: 180px;
  width: 52px;
  height: auto;
  opacity: 0;
  animation: starPop var(--clock) ease-out infinite;
}

@keyframes starPop {
  0%, 55%   { opacity: 0; transform: translateY(0) scale(0.4) rotate(-12deg); }
  60%       { opacity: 1; transform: translateY(-26px) scale(1.15) rotate(4deg); }
  68%       { opacity: 1; transform: translateY(-40px) scale(1) rotate(0deg); }
  80%, 100% { opacity: 0; transform: translateY(-58px) scale(0.85); }
}

/* Celebration burst: sparkle dots plus a coin and a gem, fired from the
   solved block as it vanishes. Game palette colors -- never ember. */
.burst {
  position: absolute;
  left: calc(56vw + 118px);
  bottom: 130px;
  pointer-events: none;
}

.burst .p {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  opacity: 0;
}

.burst .p1 { background: #45b7d1; --dx: -48px; --dy: -66px; }
.burst .p2 { background: #ffc93c; --dx: 48px;  --dy: -72px; }
.burst .p3 { background: #ff8fab; --dx: -74px; --dy: -14px; }
.burst .p4 { background: #7ec850; --dx: 74px;  --dy: -20px; }
.burst .p5 { background: #ffc93c; --dx: -26px; --dy: -104px; }
.burst .p6 { background: #4ecdc4; --dx: 26px;  --dy: -110px; }

.burst .p-coin { --dx: -68px; --dy: -102px; }
.burst .p-gem  { --dx: 70px;  --dy: -106px; }

/* The coin and gem are recognizable rewards, not dots: larger, and held
   at full opacity through most of the flight. */
.burst .p-coin,
.burst .p-gem {
  position: absolute;
  width: 38px;
  height: 38px;
  max-width: none; /* the global img max-width:100% would clamp to .burst's zero width */
  opacity: 0;
  animation: spriteFly var(--clock) ease-out infinite;
}

.burst .p {
  animation: burstFly var(--clock) ease-out infinite;
}

@keyframes burstFly {
  0%, 62%  { opacity: 0; transform: translate(0, 0) scale(0.3); }
  64%      { opacity: 1; }
  74%      { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1); }
  100%     { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1); }
}

@keyframes spriteFly {
  0%, 62%  { opacity: 0; transform: translate(0, 0) scale(0.4); }
  64%      { opacity: 1; }
  71%      { opacity: 1; transform: translate(calc(var(--dx) * 0.8), calc(var(--dy) * 0.8)) scale(1); }
  77%      { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1); }
  100%     { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1); }
}

.cat-track {
  position: absolute;
  left: 0;
  bottom: 56px;
  animation: catAcross var(--clock) linear infinite;
  will-change: transform;
}

@keyframes catAcross {
  from { transform: translateX(-140px); }
  to   { transform: translateX(calc(100vw + 140px)); }
}

.cat {
  position: relative;
  width: 112px;
  height: 112px;
  animation: catHop var(--clock) linear infinite;
}

.cat .run,
.cat .leap {
  position: absolute;
  inset: 0;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: bottom center;
}

.cat .run {
  background-image: url('/assets/world/cat-run-1.webp');
  animation:
    catFrames calc(var(--clock) / 24) steps(1) infinite,
    runHide var(--clock) steps(1) infinite;
}

.cat .leap {
  background-image: url('/assets/world/cat-jump.webp');
  opacity: 0;
  animation: leapShow var(--clock) steps(1) infinite;
}

@keyframes catFrames {
  0%   { background-image: url('/assets/world/cat-run-1.webp'); }
  25%  { background-image: url('/assets/world/cat-run-2.webp'); }
  50%  { background-image: url('/assets/world/cat-run-3.webp'); }
  75%  { background-image: url('/assets/world/cat-run-4.webp'); }
}

@keyframes runHide {
  0%, 51%  { opacity: 1; }
  52%, 63% { opacity: 0; }
  64%, 100%{ opacity: 1; }
}

@keyframes leapShow {
  0%, 51%  { opacity: 0; }
  52%, 63% { opacity: 1; }
  64%, 100%{ opacity: 0; }
}

@keyframes catHop {
  0%, 50%  { transform: translateY(0); }
  54%      { transform: translateY(-86px); }
  58%      { transform: translateY(-96px); }
  62%      { transform: translateY(-40px); }
  65%, 100%{ transform: translateY(0); }
}

.hero-grass {
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 72px;
  z-index: 2;
  pointer-events: none;
  background-image: url('/assets/world/meadow-grass-strip.webp');
  background-repeat: repeat-x;
  background-size: auto 100%;
  background-position: bottom left;
}

/* ── Mechanism: the working drawing beside the living proof ───────── */

.mechanism {
  background: var(--cream-band);
  padding: 88px 0 96px;
}

h2 {
  font-size: clamp(1.9rem, 4.2vw, 2.9rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin: 0 0 12px;
}

.section-lede {
  font-size: 1.12rem;
  font-weight: 500;
  max-width: 58ch;
  margin: 0 0 44px;
}

.mechanism-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 56px;
  align-items: start;
}

.level-drawing { margin: 0; color: var(--ink); }

.level-drawing svg {
  width: 100%;
  height: auto;
  display: block;
  margin-bottom: 24px;
}

.drawing-steps circle { fill: var(--ink); }
.drawing-steps text { fill: var(--cream-band); }

.steps {
  margin: 0;
  padding: 0 0 0 20px;
  display: grid;
  gap: 10px;
  font-size: 1.02rem;
}

.proof-shots {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.proof-shots img {
  width: 100%;
  height: auto;
  border-radius: 18px;
  border: 4px solid #ffffff;
  box-shadow: 0 14px 30px rgba(31, 51, 32, 0.18);
}

.proof-shots img:last-of-type { transform: rotate(1.2deg); }
.proof-shots img:first-of-type { transform: rotate(-1.2deg); }

.shots-caption {
  grid-column: 1 / -1;
  text-align: center;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--ink-soft);
  margin: 4px 0 0;
}

/* ── Worlds: the climb into the canopy ────────────────────────────── */

.worlds {
  position: relative;
  color: var(--paper);
  background-image:
    url('/assets/world/canopy-backdrop.webp'),
    linear-gradient(180deg, var(--canopy) 0%, var(--canopy-deep) 100%);
  background-size: cover, auto;
  background-position: center;
  padding: 120px 0 88px;
}

/* Dusk scrim: the backdrop's bright mid-band would sink cream text below
   AA without it. Plaques are opaque paper and sit above unaffected. */
.worlds::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(10, 32, 6, 0.45);
}

/* Canopy walkway planks hang from the section's top edge. */
.worlds::after {
  content: "";
  position: absolute;
  top: -2px; left: 0; right: 0;
  height: 58px;
  background-image: url('/assets/world/canopy-platform-strip.webp');
  background-repeat: repeat-x;
  background-size: auto 100%;
  transform: scaleY(-1);
}

.worlds .container { position: relative; z-index: 1; }

.worlds h2 { color: var(--paper); }
.worlds .section-lede { color: var(--paper); opacity: 0.92; }

.world-plaques {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}

.plaque {
  background: var(--cream);
  border: 3px solid var(--wood-dark);
  border-radius: 20px;
  overflow: hidden;
  color: var(--ink);
  box-shadow: 0 14px 28px rgba(10, 26, 12, 0.45), 0 3px 8px rgba(10, 26, 12, 0.3);
}
.plaque-meadows { transform: rotate(-0.8deg); }
.plaque-sky     { transform: rotate(0.8deg); }

/* Plaque headers are the worlds' own exported art (gradient = load fallback). */
.plaque-visual {
  height: 92px;
  border-bottom: 3px solid var(--wood-dark);
  background-size: cover;
  background-repeat: no-repeat;
}
.plaque-visual-meadows {
  background-image: url('/assets/world/meadow-backdrop.webp'),
    linear-gradient(180deg, var(--sky-top), var(--sky) 55%, var(--grass) 58%, var(--grass-dark));
  background-position: center 78%;
}
.plaque-visual-canopy {
  background-image: url('/assets/world/canopy-backdrop.webp'),
    linear-gradient(180deg, #7fb870, #3c6b44 60%, var(--canopy));
  background-position: center 42%;
}
.plaque-visual-sky {
  background-image: url('/assets/world/sky-backdrop.webp'),
    linear-gradient(180deg, var(--sunset-1), var(--sunset-3) 60%, var(--sunset-4));
  background-position: center 30%;
}

.plaque-body { padding: 18px 22px 24px; }

.plaque h3 {
  font-size: 1.45rem;
  font-weight: 900;
  margin: 0 0 2px;
}

.plaque-grade {
  font-size: 0.95rem;
  font-weight: 800;
  margin: 0 0 10px;
  color: var(--plaque-brown);
}

.plaque p { margin: 0 0 14px; font-size: 0.98rem; font-weight: 600; color: var(--ink-soft); }

.stencils { display: flex; gap: 8px; flex-wrap: wrap; margin: 0; }

.stencil {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border: 2px dashed var(--plaque-brown);
  border-radius: 6px;
  color: var(--plaque-brown);
  background: rgba(200, 154, 102, 0.2);
}

.worlds-footnote {
  margin: 40px auto 0;
  max-width: 64ch;
  text-align: center;
  font-weight: 600;
  opacity: 0.95;
}

/* ── Parents: trust at sunset altitude ────────────────────────────── */

.parents {
  position: relative;
  overflow: hidden;
  background-image:
    url('/assets/world/sky-backdrop.webp'),
    linear-gradient(180deg, var(--sunset-1) 0%, var(--sunset-2) 34%, var(--sunset-3) 68%, var(--sunset-4) 100%);
  background-size: cover, auto;
  background-position: center top;
  padding: 96px 0 80px;
  color: var(--ink);
}

.balloon {
  position: absolute;
  top: 40px;
  right: 6%;
  width: clamp(80px, 9vw, 150px);
  height: auto;
  animation: balloonDrift calc(var(--clock) * 3) ease-in-out infinite alternate;
}

@keyframes balloonDrift {
  from { transform: translate(0, 0) rotate(-2deg); }
  to   { transform: translate(-46px, 26px) rotate(2deg); }
}

.parents .container { position: relative; z-index: 1; }

.trust-marks {
  list-style: none;
  margin: 0 0 26px;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 40px;
  max-width: 900px;
  font-size: 1.04rem;
  font-weight: 600;
}

.trust-marks li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.trust-marks .mark-text { flex: 1; min-width: 0; }

.trust-marks .mark {
  flex: none;
  width: 30px; height: 30px;
  margin-top: 2px;
  border: 2.5px solid var(--ink);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotate(-4deg);
}
.trust-marks .mark svg { width: 16px; height: 16px; }

/* The sunset's deepest violet is only 4.2:1 under ink, so the low-lying
   text rides on paper chips instead of the raw sky. */
/* Shares the 900px rail with the trust-marks grid above it. */
.parents-links {
  max-width: 900px;
  font-weight: 600;
  margin: 0 0 48px;
  background: rgba(255, 243, 205, 0.88);
  border-radius: 14px;
  padding: 14px 20px;
}
.parents-links a { color: var(--ink); font-weight: 800; text-underline-offset: 3px; }

.species-figure { position: relative; margin: 0; text-align: center; padding-bottom: 110px; }

/* The heroes stand ON a Sky Islands platform (the game's own geometry):
   the island slab sits under their feet, trunks fade out below, and the
   whole stage bobs gently on the shared clock. Island is eager-loaded
   (no lazy attribute) so it always paints. */
.sky-stage {
  position: relative;
  display: inline-block;
  max-width: 720px;
  width: 100%;
  animation: islandBob calc(var(--clock) * 4) ease-in-out infinite alternate;
}

.sky-stage .heroes {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
}

.sky-stage .island {
  position: absolute;
  z-index: 0;
  left: 50%;
  top: calc(100% - 18px);
  transform: translateX(-50%);
  width: 104%;
  height: auto;
  -webkit-mask-image: linear-gradient(180deg, #000 11%, transparent 38%);
  mask-image: linear-gradient(180deg, #000 11%, transparent 38%);
}

@keyframes islandBob {
  from { transform: translateY(0); }
  to   { transform: translateY(-14px); }
}

.species-figure figcaption {
  position: relative;
  z-index: 1;
  display: inline-block;
  font-weight: 700;
  margin-top: 10px;
  background: rgba(255, 243, 205, 0.88);
  border-radius: 999px;
  padding: 6px 18px;
}

/* ── Launch: dusk CTA ─────────────────────────────────────────────── */

.launch {
  background: linear-gradient(180deg, var(--sunset-4) 0%, var(--night) 55%, var(--night-deep) 100%);
  color: var(--paper);
  text-align: center;
  padding: 88px 0 96px;
}

.launch h2 { color: var(--paper); }
.launch .section-lede { margin-left: auto; margin-right: auto; color: var(--paper-dim); margin-bottom: 30px; }

.store-buttons-launch { justify-content: center; }
.launch .store-badge {
  background: rgba(247, 244, 232, 0.1);
  border-color: rgba(247, 244, 232, 0.4);
  box-shadow: 0 8px 18px rgba(12, 8, 22, 0.5), 0 2px 5px rgba(12, 8, 22, 0.35);
}
.launch .store-badge:hover { background: rgba(247, 244, 232, 0.2); }

/* ── Footer ───────────────────────────────────────────────────────── */

.site-footer {
  background: var(--night-deep);
  color: var(--paper-dim);
  font-size: 0.88rem;
  padding: 30px 0 34px;
}

.site-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.site-footer a {
  color: var(--paper-dim);
  font-weight: 700;
  display: inline-block;
  padding: 8px 2px;
  margin: -8px -2px;
}
.site-footer a:hover { color: var(--paper); }

.site-footer .trademark-note {
  width: 100%;
  font-size: 0.74rem;
}

/* ── Responsive ───────────────────────────────────────────────────── */

@media (max-width: 1040px) {
  .badge-qr { display: none; }
}

/* Narrow-desktop tier: pull the scene anchor left so the gate stays
   fully on-canvas; the hop window (52-65% of the crossing) still
   overlaps the block group. */
@media (min-width: 761px) and (max-width: 1100px) {
  .blocks { left: 46vw; }
  .gate { left: calc(46vw + 270px); }
  .gate-bubble { left: calc(46vw + 246px); }
  .star-pop { left: calc(46vw + 92px); }
  .burst { left: calc(46vw + 108px); }
}

@media (max-width: 900px) {
  .mechanism-grid { grid-template-columns: 1fr; gap: 44px; }
  .world-plaques { grid-template-columns: 1fr; max-width: 480px; margin: 0 auto; }
  .trust-marks { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .hero { min-height: 100svh; }
  /* Reserve a clear stage under the copy so the badges can never sit on
     top of the gate scene, whatever the phone's height. */
  .hero-copy { padding-top: 92px; padding-bottom: 320px; }
  .hero .lede { font-size: 1.05rem; }
  .store-badge { width: 100%; max-width: 340px; justify-content: center; }
  .hero-scene { height: 250px; }
  .gate { bottom: 46px; width: 86px; left: calc(45vw + 124px); }
  .gate-bubble { bottom: 226px; left: auto; right: 10px; font-size: 1.05rem; padding: 6px 12px; }
  .blocks { left: 45vw; bottom: 50px; gap: 8px; }
  .block { width: 54px; }
  .star-pop { left: calc(45vw + 54px); bottom: 128px; width: 36px; }
  .burst { left: calc(45vw + 68px); bottom: 96px; }
  .cat { width: 84px; height: 84px; }
  .cat-track { bottom: 42px; }
  @keyframes catHop {
    0%, 50%  { transform: translateY(0); }
    54%      { transform: translateY(-64px); }
    58%      { transform: translateY(-72px); }
    62%      { transform: translateY(-30px); }
    65%, 100%{ transform: translateY(0); }
  }
  .hero-grass { height: 56px; }
  .proof-shots { grid-template-columns: 1fr 1fr; gap: 12px; }
  .site-footer .container { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ── Reduced motion: the world stands still, fully composed ───────── */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cloud, .balloon, .sky-stage, .block, .block-correct, .star-pop,
  .cat-track, .cat, .cat .run, .cat .leap,
  .burst .p, .burst .p-coin, .burst .p-gem,
  .gate-bubble .q, .gate-bubble .a {
    animation: none;
  }
  .block, .block-correct { opacity: 1; transform: none; }
  .cloud-1 { left: 8%; }
  .cloud-2 { left: 48%; }
  .cloud-3 { left: 74%; }
  .cat-track {
    left: calc(56vw - 128px);
    transform: none;
  }
  .cat .run { background-image: url('/assets/world/cat-idle.webp'); opacity: 1; }
  .cat .leap { display: none; }
  .star-pop { opacity: 1; transform: translateY(-40px) scale(1); }
  .block-correct { box-shadow: 0 0 0 5px var(--ember); }
}
