/* Labyrinth: The Lantern Secret — game page, privacy and terms.
   Version 3: a cinematic hero scene in layers with scroll depth, then a calm dark page.
   No web fonts, no external requests. Motion uses transform and opacity only and stops
   completely under prefers-reduced-motion. */

:root {
  --ink: #050a06;          /* the foot of the hero's ferns; the page starts from it */
  --night: #0a1916;
  --deep: #0c211d;
  --cream: #f4ecd8;
  --text: #d9dccd;
  --mist: #a3b2a6;
  --gold: #e9c46a;
  --gold-deep: #c9953a;
  --line: rgba(233, 196, 106, 0.2);
  --serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(16px, 5vw, 64px);
  color-scheme: dark;
}

/* ------------------------------------------------------------- languages
   The site is in 14 languages and loads no web fonts, so each script gets the system fonts made for it:
   Georgia and the serif stack have Latin and Cyrillic; Japanese, Korean and Chinese get their own serif
   (Mincho / Myeongjo / Song) and sans. CJK fonts have no italic, so nothing slants there; lines break the
   way each language does (no line starts with 。、」, Korean wraps at spaces). Long German and Slavic
   words in headings may hyphenate rather than overflow a phone. */
:lang(ja) {
  --serif: "Hiragino Mincho ProN", "Yu Mincho", YuMincho, "Noto Serif JP", "Noto Serif CJK JP", "Source Han Serif JP", serif;
  --sans: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", YuGothic, Meiryo, "Noto Sans JP", "Noto Sans CJK JP", system-ui, sans-serif;
}
:lang(ko) {
  /* a Myeongjo where a good one is installed; otherwise the system's Gothic, which reads better than an old Batang */
  --serif: "Nanum Myeongjo", "Noto Serif KR", "Noto Serif CJK KR", "Source Han Serif K", "Apple SD Gothic Neo", "Malgun Gothic", serif;
  --sans: "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", "Noto Sans CJK KR", system-ui, sans-serif;
}
:lang(zh) {
  --serif: "Songti SC", STSong, "Noto Serif SC", "Noto Serif CJK SC", "Source Han Serif SC", SimSun, serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Noto Sans CJK SC", system-ui, sans-serif;
}
:lang(ja), :lang(zh) { line-break: strict; word-break: normal; overflow-wrap: anywhere; }
:lang(ko) { line-break: strict; word-break: keep-all; overflow-wrap: anywhere; }
html:is(:lang(ja), :lang(ko), :lang(zh)) :is(em, i, .promise, .prose .lede, .t-sub) { font-style: normal; }
:is(:lang(ja), :lang(ko), :lang(zh)) :is(.cue, .toc p, .eyebrow) { letter-spacing: 0.08em; }
h1, h2, h3 { overflow-wrap: break-word; hyphens: auto; hyphenate-limit-chars: 10 4 4; text-wrap: balance; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font: 400 1.0625rem/1.65 var(--sans);
  overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--gold); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: #ffe3a1; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; color: var(--cream); margin: 0; }
p { margin: 0 0 1em; }

/* =========================================================================== hero */

.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 600px;
  overflow: clip;
  isolation: isolate;
  container: hero / size;
  view-timeline: --hero block;
  background: linear-gradient(#0b5cba, #1269c6 40%, #6f9fd6);
  color: var(--cream);
  /* The near layer is a 1536×864 picture (the "stage") that covers the hero, bottom-aligned, and
     is shifted so the cliff with the heroes stays in view: --ax is the stage fraction kept at the centre. */
  --W: max(100cqw, 177.78cqh);
  --ax: 0.56;
  --L: clamp(calc(100cqw - var(--W)), calc(50cqw - var(--ax) * var(--W)), 0px);
}

/* layers */
.l-sky, .l-warm, .l-ground, .l-ivy { position: absolute; }
.l-sky { inset: 0 0 auto; height: 112%; z-index: 0; }
.l-sky picture, .l-sky img { width: 100%; height: 100%; }
.l-sky img { object-fit: cover; object-position: 66% 0%; transform-origin: 60% 55%; }
.l-warm {
  inset: 0; z-index: 1; opacity: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 168, 82, 0.35), rgba(196, 110, 48, 0.4) 45%, rgba(12, 33, 29, 0.9) 85%);
}
.l-ground { inset: 0; z-index: 2; pointer-events: none; }
/* below the ground: the same near-black green, so nothing shows when the layer rises */
.l-ground::after {
  content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 70%; background: var(--ink);
}
.stage {
  position: absolute; bottom: 0; left: var(--L);
  width: var(--W); aspect-ratio: 16 / 9;
}
.stage > * { position: absolute; }
.ground { left: 0; top: 41.667%; width: 100%; height: 58.333%; max-width: none; }
/* a soft fade to the page colour along the very bottom */
.stage::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 9%;
  background: linear-gradient(rgba(5, 10, 6, 0), var(--ink));
}

/* Lina and Tim stand on the ledge, looking at the island (positions in stage %, from the 1536×864 key art) */
.back { height: auto; }
.back-lina { left: 71.9%; top: 32.6%; width: 9.6%; }
.back-tim { left: 81.9%; top: 32.3%; width: 9%; }
.feet {
  height: 2.2%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(8, 16, 4, 0.55), rgba(8, 16, 4, 0));
}
.feet-lina { left: 72.6%; top: 62.4%; width: 8.4%; }
.feet-tim { left: 82.4%; top: 62.2%; width: 7.9%; }

/* lantern light: the stone lantern on the ledge and the heroes' two lanterns */
.glow {
  border-radius: 50%; mix-blend-mode: screen;
  background: radial-gradient(closest-side, rgba(255, 214, 140, 0.75), rgba(255, 170, 70, 0.28) 45%, rgba(255, 150, 60, 0));
  translate: -50% -50%;
}
.glow-stone { left: 95.55%; top: 49.6%; width: 7%; aspect-ratio: 1; }
.glow-lina { left: 80.6%; top: 44.9%; width: 4.2%; aspect-ratio: 1; }
.glow-tim { left: 90.05%; top: 55.8%; width: 4%; aspect-ratio: 1; }

/* the ivy in the two upper corners, sized with the stage */
.l-ivy { top: 0; z-index: 3; max-width: none; pointer-events: none; }
.ivy-l { left: 0; width: min(calc(var(--W) * 0.2754), 44cqw); transform-origin: 0 0; }
.ivy-r { right: 0; width: min(calc(var(--W) * 0.2565), 40cqw); transform-origin: 100% 0; }

/* the thin nav over the sky */
.hero::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 150px; z-index: 4; pointer-events: none;
  background: linear-gradient(rgba(4, 22, 48, 0.42), rgba(4, 22, 48, 0));
}
.topnav {
  position: absolute; z-index: 6; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: max(14px, env(safe-area-inset-top)) var(--gutter) 0;
  font: 500 0.9375rem/1 var(--sans); letter-spacing: 0.01em;
}
.topnav a { color: var(--cream); text-decoration: none; text-shadow: 0 1px 2px rgba(0, 18, 40, 0.55), 0 0 18px rgba(0, 18, 40, 0.35); }
.topnav a:hover { color: #fff; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; font: 600 1.25rem/1 var(--serif); }
.brand img { width: 32px; height: 32px; border-radius: 8px; box-shadow: 0 1px 6px rgba(0, 10, 30, 0.4); }
.anchors { display: flex; gap: clamp(14px, 2vw, 30px); margin: 0; padding: 0; list-style: none; }
.anchors a { display: inline-flex; align-items: center; min-height: 48px; opacity: 0.92; }
.home { display: inline-flex; align-items: center; min-height: 48px; opacity: 0.92; }

/* the title, the line, one button.
   The column is centred on the viewport. Its half-width --h is the room from the centre to the nearer
   obstacle: the left ivy (--a) or Lina's owlet (--b), both sized with the stage, and never closer than
   6 % of the width to either edge. A narrow column shrinks the sign (min(100%, …)); it never shifts.
   Everything in it is centred. */
.hero-copy {
  --a: max(6cqw, calc(min(var(--W) * 0.2754, 44cqw) * 0.8));   /* clear of the left ivy */
  --b: min(94cqw, calc(var(--L) + var(--W) * 0.7));             /* clear of Lina's owlet */
  --h: min(calc(50cqw - var(--a)), calc(var(--b) - 50cqw));
  position: absolute; z-index: 5; left: calc(50cqw - var(--h)); top: clamp(64px, 9.5cqh, 120px);
  width: calc(2 * var(--h));
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.hero-copy::before {
  /* a soft shade of sky behind the words, not a box */
  content: ""; position: absolute; z-index: -1; left: 50%; top: 52%; width: 150%; height: 120%; translate: -50% -50%;
  background: radial-gradient(closest-side, rgba(6, 40, 86, 0.34), rgba(6, 40, 86, 0));
  pointer-events: none;
}
.title-sign {
  position: relative; width: min(100%, clamp(260px, 26cqw, 540px)); margin: 0;
  container-type: inline-size; line-height: 1;
  filter: drop-shadow(0 14px 22px rgba(10, 30, 60, 0.32));
}
.title-sign img { width: 100%; }
/* the plate's stone face, measured on the 1120×546 art: x 92–1025, y 186–475 (the bottom gem rises to 449).
   The box ends at y 460, so the words sit a little above the face's middle, at its optical centre, clear of the gem. */
.title-face {
  position: absolute; left: 8.21%; right: 8.48%; top: 34.07%; bottom: 15.7%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: Georgia, var(--serif); font-weight: 700; text-align: center;
}
.t-name {
  font-size: 12cqw; letter-spacing: 0.01em;
  color: #ffe59b;
  background: linear-gradient(#fff6d2 10%, #ffd35f 55%, #d5932a 92%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0.35cqw 0 #3a2107) drop-shadow(0 0 0.25cqw #3a2107) drop-shadow(0 0.8cqw 1.2cqw rgba(0, 0, 0, 0.45));
}
/* a name of two CJK characters (迷宫, 미궁) would look lost on the plate at the Latin size */
html:is(:lang(ko), :lang(zh)) .t-name { font-size: 15cqw; letter-spacing: 0.1em; text-indent: 0.1em; }
.t-sub {
  margin-top: 1.4cqw; font-size: 4.5cqw; letter-spacing: 0.06em;
  color: #f8e6b9; text-shadow: 0 0.3cqw 0 #2c1a08, 0 0 0.8cqw rgba(0, 0, 0, 0.5);
}
.promise {
  margin: clamp(10px, 1.6cqh, 18px) 0 clamp(14px, 2.4cqh, 26px);
  max-width: 30em;
  font: italic 400 clamp(1.125rem, 1.6cqw, 1.5rem)/1.35 var(--serif);
  color: #fffaf0;
  /* plain text with a soft shadow only, no backing */
  text-shadow: 0 1px 2px rgba(3, 25, 55, 0.75), 0 0 14px rgba(3, 25, 55, 0.5);
  padding: 2px 0.9em;
}
.promise { text-wrap: balance; }
/* when the line has to wrap, it breaks between the two sentences */
.promise span { display: inline-block; }
/* the wooden plank: a real button that scrolls to "How it plays" */
.play {
  position: relative; display: block; width: clamp(260px, 19cqw, 310px); aspect-ratio: 640 / 228;
  container-type: inline-size;
  background: url(art/button-play.webp) center / 100% 100% no-repeat;
  color: #fff3d0; text-decoration: none;
  filter: drop-shadow(0 10px 16px rgba(10, 30, 60, 0.3));
  transition: translate 0.2s ease, filter 0.2s ease;
}
/* the plank's wooden face, measured on the 640×228 art: x 68–572, y 44–188 */
.play-face {
  position: absolute; left: 10.625%; right: 10.625%; top: 19.3%; bottom: 17.5%;
  display: flex; align-items: center; justify-content: center;
  font: 700 8cqw/1 Georgia, var(--serif); letter-spacing: 0.01em; white-space: nowrap;
  text-shadow: 0 0.55cqw 0 #4a2306, 0 0 0.6cqw #4a2306;
}
/* a label longer than the plank's one line (set by the template from its length) takes two smaller lines */
.play-long .play-face { white-space: normal; text-wrap: balance; font-size: 6.4cqw; line-height: 1.04; padding: 0 2cqw; }
.play:hover { translate: 0 -2px; color: #fff; filter: drop-shadow(0 12px 18px rgba(10, 30, 60, 0.34)) brightness(1.06); }
.play:active { translate: 0 1px; }
.play:focus-visible { outline: none; }
.play:focus-visible::after {
  /* the ring follows the plank's gold rim */
  content: ""; position: absolute; left: 3.5%; right: 3.5%; top: 9%; bottom: 6%; border-radius: 999px;
  box-shadow: 0 0 0 2px #fff6dc, 0 0 0 5px rgba(8, 40, 90, 0.75);
}

/* ready for the store badges under the button (see the comment in index.html) */
.stores { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: clamp(10px, 1.6cqh, 16px) 0 0; }
a.store { display: inline-block; vertical-align: middle; }
a.store img { height: 40px; width: auto; }

/* scroll cue */
.cue {
  position: absolute; z-index: 5; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); translate: -50% 0;
  display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 48px; padding-top: 6px;
  color: rgba(244, 236, 216, 0.8); text-decoration: none;
  font: 600 0.6875rem/1 var(--sans); letter-spacing: 0.22em; text-transform: uppercase;
}
.cue::after {
  content: ""; width: 1px; height: 38px; transform-origin: 50% 0;
  background: linear-gradient(var(--gold), rgba(233, 196, 106, 0));
  animation: cue 2.4s ease-in-out infinite;
}
@keyframes cue { 0% { transform: scaleY(0.2); opacity: 0; } 40% { opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }

/* idle life: lantern light breathes, the ivy sways, the far scene drifts very slowly */
.glow { animation: glow 4.2s ease-in-out infinite alternate; }
.glow-lina { animation-duration: 3.4s; }
.glow-tim { animation-duration: 3.8s; animation-delay: -1.2s; }
@keyframes glow { from { opacity: 0.62; } to { opacity: 1; } }
.ivy-l { animation: sway-l 9s ease-in-out infinite alternate; }
.ivy-r { animation: sway-r 11s ease-in-out infinite alternate; }
@keyframes sway-l { from { rotate: -0.5deg; } to { rotate: 0.7deg; } }
@keyframes sway-r { from { rotate: 0.6deg; } to { rotate: -0.5deg; } }
.l-sky img { animation: drift 46s ease-in-out infinite alternate; }
@keyframes drift { from { scale: 1; translate: 0 0; } to { scale: 1.035; translate: -0.6% 0; } }

/* --------------------------------------------------------------- scroll depth
   As the hero scrolls away: the far scene moves slowest (it sinks and nears a little), the cliff
   with the heroes and the ivy move fastest and grow, the title lifts and fades, the sky warms.
   The end values live in custom properties so the small fallback script (labyrinth.js, for browsers
   without scroll-driven animations) can use the same numbers through --p. */
.l-sky    { --ty: 32cqh; --sc: 1.06; --op: 1; }
.l-ground { --ty: -14cqh; --sc: 1.1; --op: 1; transform-origin: 72% 100%; }
.ivy-l    { --ty: -26cqh; --sc: 1.18; --op: 1; }
.ivy-r    { --ty: -26cqh; --sc: 1.18; --op: 1; }
.hero-copy { --ty: -16cqh; --sc: 0.94; --op: 0; }
.l-warm   { --ty: 0px; --sc: 1; --op: 1; }

@keyframes depth {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(0, var(--ty), 0) scale(var(--sc)); }
}
@keyframes fade-to { to { opacity: var(--op); } }
@keyframes fade-in { to { opacity: 1; } }

@supports (animation-timeline: view()) {
  .l-sky, .l-ground, .l-ivy, .hero-copy {
    animation: depth linear both;
    animation-timeline: --hero;
    animation-range: exit 0% exit 100%;
  }
  .hero-copy {
    animation: depth linear both, fade-to linear both;
    animation-timeline: --hero, --hero;
    animation-range: exit 0% exit 100%, exit 0% exit 55%;
  }
  .l-warm {
    animation: fade-in linear both;
    animation-timeline: --hero;
    animation-range: exit 5% exit 100%;
  }
  .cue {
    animation: fade-to linear both;
    animation-timeline: --hero;
    animation-range: exit 0% exit 15%;
    --op: 0;
  }
}
/* fallback: labyrinth.js sets --p (0…1) on .hero while it scrolls away */
@supports not (animation-timeline: view()) {
  .l-sky, .l-ground, .l-ivy, .hero-copy {
    transform: translate3d(0, calc(var(--ty) * var(--p, 0)), 0) scale(calc(1 + (var(--sc) - 1) * var(--p, 0)));
  }
  .hero-copy { opacity: calc(1 - var(--p, 0) * 1.8); }
  .l-warm { opacity: var(--p, 0); }
}

/* ------------------------------------------------- portrait: a composition of its own */
@media (max-aspect-ratio: 3/4) {
  .hero {
    min-height: 640px;
    background: linear-gradient(#0453b0, #0866c2 30%, #1068c6 50%);
    /* the cliff fills the right of the frame; its lip is just inside the left edge */
    --W: 200cqw;
    --L: calc(100cqw - var(--W));
  }
  /* the island sits left of centre, above the heroes; the sky above it continues as a gradient */
  .l-sky { inset: auto 0 0; height: auto; }
  .l-sky picture { display: block; }
  .l-sky img {
    width: 136cqw; max-width: none; height: auto; margin: 0 0 1cqh -27cqw; object-fit: fill;
    -webkit-mask-image: linear-gradient(transparent, #000 16%);
    mask-image: linear-gradient(transparent, #000 16%);
  }
  .stage { bottom: 0; }
  .back-lina { left: 75.2%; top: 34%; width: 9.5%; }
  .back-tim { left: 84.4%; top: 33.8%; width: 8.9%; }
  .feet-lina { left: 75.9%; top: 62.5%; width: 8.4%; }
  .feet-tim { left: 84.9%; top: 62.3%; width: 7.9%; }
  .glow-lina { left: 83.8%; top: 46.2%; width: 6%; }
  .glow-tim { left: 92.5%; top: 56.3%; width: 6%; }
  .ivy-l { width: 46cqw; }
  .ivy-r { width: 40cqw; }
  .hero-copy { top: clamp(64px, 8.5cqh, 110px); --a: 6cqw; --b: 94cqw; }
  .title-sign { width: min(74cqw, 470px); }
  .play { width: min(66cqw, 290px); }
  .promise { font-size: clamp(1.0625rem, 4.4cqw, 1.5rem); max-width: 19em; }
  .promise span { display: inline; }
  .l-ground { transform-origin: 70% 100%; }
}

/* ========================================================================= page */

main {
  position: relative;
  overflow-x: clip; /* glows may spill past the edges; sticky still works with clip */
  background:
    radial-gradient(60% 40% at 82% 22%, rgba(233, 196, 106, 0.06), transparent 70%),
    radial-gradient(50% 30% at 12% 48%, rgba(90, 190, 170, 0.05), transparent 70%),
    radial-gradient(60% 30% at 80% 74%, rgba(233, 196, 106, 0.05), transparent 70%),
    linear-gradient(var(--ink), var(--night) 520px, var(--deep) 40%, var(--night) 100%);
}
.sec {
  position: relative;
  width: min(100% - 2 * var(--gutter), 1180px);
  margin-inline: auto;
  padding-block: clamp(80px, 13vw, 168px) 0;
}
.how { padding-top: clamp(48px, 7vw, 104px); }
.eyebrow {
  margin: 0 0 18px; color: var(--gold);
  font: 600 0.8125rem/1 var(--sans); letter-spacing: 0.22em; text-transform: uppercase;
}
h2 { font-size: clamp(2.125rem, 4.6vw, 3.75rem); line-height: 1.06; letter-spacing: -0.01em; margin-bottom: 22px; }
h3 { font-size: 1.3125rem; line-height: 1.25; margin-bottom: 6px; }
.lede { font-size: clamp(1.0625rem, 1.5vw, 1.25rem); color: var(--text); max-width: 34em; }

/* 1. how it plays */
.how { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); gap: clamp(40px, 7vw, 110px); align-items: center; }
.steps { margin: 36px 0 30px; padding: 0; list-style: none; display: grid; gap: 26px; }
.steps li { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 20px; align-items: start; }
.steps img { width: 52px; height: auto; margin-top: 2px; }
.steps p { margin: 0; color: var(--mist); }
.quests { color: var(--mist); font-size: 0.9375rem; max-width: 36em; padding-top: 24px; border-top: 1px solid var(--line); margin: 0; }
.board { margin: 0; position: relative; }
.board::before {
  content: ""; position: absolute; inset: -12% -16%; z-index: 0;
  background: radial-gradient(closest-side, rgba(233, 196, 106, 0.16), rgba(233, 196, 106, 0));
}
.board img {
  position: relative; width: 100%; border-radius: 22px;
  border: 1px solid rgba(233, 196, 106, 0.35);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6);
}

/* 2. the four islands */
.islands { position: relative; padding-top: clamp(80px, 13vw, 168px); }
.islands-pin { overflow: hidden; container-type: inline-size; }
.islands-intro { width: min(100% - 2 * var(--gutter), 1180px); margin: 0 auto clamp(28px, 4vw, 48px); }
.islands-intro .lede { max-width: 30em; }
.islands-track {
  display: flex; align-items: flex-end; gap: clamp(28px, 4vw, 64px);
  padding-inline: max(var(--gutter), (100% - 1180px) / 2);
}
.isle { flex: 0 0 auto; margin: 0; width: clamp(240px, 26vw, 400px); text-align: center; }
.isle img { width: 100%; filter: drop-shadow(0 30px 40px rgba(0, 0, 0, 0.35)); }
.isle figcaption { margin-top: 18px; }
.isle b { display: block; font: 600 1.625rem/1.1 var(--serif); color: var(--cream); }
.isle span { display: block; margin-top: 6px; color: var(--gold); font: 600 0.75rem/1 var(--sans); letter-spacing: 0.2em; text-transform: uppercase; }

/* wide screens with scroll-driven animations: pin the row and let it drift sideways */
@supports (animation-timeline: view()) {
  @media (min-width: 900px) and (prefers-reduced-motion: no-preference) {
    .islands { height: 210vh; view-timeline: --isl block; padding-top: 0; }
    .islands-pin { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; justify-content: center; }
    .isle { width: min(30vw, 58vh * 0.68); }
    .islands-track {
      animation: slide linear both;
      animation-timeline: --isl;
      animation-range: contain 4% contain 96%;
      padding-right: calc(var(--gutter) + 4vw);
      width: max-content; min-width: 100%;
    }
    @keyframes slide { to { transform: translate3d(calc(100cqw - 100%), 0, 0); } }
  }
}
/* everywhere else: a row you swipe */
@media (max-width: 899px), (prefers-reduced-motion: reduce) {
  .islands-pin { overflow: visible; }
  .islands-track {
    flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
    padding-bottom: 8px; scroll-padding-inline: var(--gutter);
  }
  .islands-track::-webkit-scrollbar { display: none; }
  .isle { scroll-snap-align: start; }
  .isle { width: min(68vw, 340px); }
}
@supports not (animation-timeline: view()) {
  .islands-pin { overflow: visible; }
  .islands-track { overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter); }
  .isle { scroll-snap-align: start; }
}

/* 3. daily and endless */
.modes { text-align: center; }
.modes h2 { margin-inline: auto; max-width: 16em; }
.mode-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(32px, 6vw, 96px); margin-top: 56px; }
.mode img { width: clamp(150px, 17vw, 220px); margin: 0 auto 22px; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.4)); }
.mode p { color: var(--mist); max-width: 22em; margin-inline: auto; }

/* 4. heroes and wardrobe */
.heroes { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(40px, 7vw, 110px); align-items: center; }
.pair { display: flex; justify-content: center; align-items: flex-end; gap: clamp(8px, 2vw, 28px); position: relative; }
.pair figure { margin: 0; position: relative; }
.pair img { position: relative; height: clamp(300px, 34vw, 480px); width: auto; }
/* a small contact shadow right under the boots (the caption below is 12 px + 20 px tall) */
.pair figure::before {
  content: ""; position: absolute; left: 13%; right: 13%; bottom: 25px; height: 14px;
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));
}
.pair figcaption { text-align: center; margin-top: 12px; font: 600 1.25rem/1 var(--serif); color: var(--cream); }
.wardrobe { display: grid; gap: 14px; margin-top: 30px; }
.wardrobe ul { display: flex; gap: clamp(10px, 2vw, 22px); margin: 0; padding: 14px 0; list-style: none; border-top: 1px solid var(--line); align-items: flex-end; }
.wardrobe ul::before {
  content: attr(aria-label); flex: 0 0 5.5em; align-self: center;
  font: 600 0.75rem/1 var(--sans); letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold);
}
.wardrobe img { height: 72px; width: auto; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.4)); }
.wardrobe .ward-lanterns img { height: 80px; }
.wardrobe .ward-owlets img { height: 62px; }

/* 5. inside the game */
.inside { text-align: center; }
.phones { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 4vw, 56px); margin-top: 56px; align-items: start; }
.phone { margin: 0; }
.screen {
  display: block; padding: 7px; border-radius: 34px;
  background: linear-gradient(#1b2a26, #0c1513);
  border: 1px solid rgba(233, 196, 106, 0.32);
  box-shadow: 0 40px 70px -24px rgba(0, 0, 0, 0.7);
}
.screen img { border-radius: 27px; width: 100%; }
.phone figcaption { margin-top: 16px; color: var(--mist); font: 600 0.75rem/1 var(--sans); letter-spacing: 0.2em; text-transform: uppercase; }
.p2 { margin-top: 56px; }

/* 6. at a glance */
.glance { width: min(100% - 2 * var(--gutter), 920px); }
.facts { margin: 30px 0 0; }
.facts div { display: grid; grid-template-columns: minmax(0, 11em) minmax(0, 1fr); gap: 24px; padding: 20px 0; border-top: 1px solid var(--line); }
.facts div:last-child { border-bottom: 1px solid var(--line); }
.facts dt { color: var(--gold); font: 600 0.8125rem/1.9 var(--sans); letter-spacing: 0.18em; text-transform: uppercase; }
.facts dd { margin: 0; color: var(--cream); font-size: 1.0625rem; }

/* 7. parents and support */
.parents { width: min(100% - 2 * var(--gutter), 920px); padding-bottom: clamp(80px, 11vw, 140px); }
.parents-card {
  padding: clamp(28px, 5vw, 56px);
  border: 1px solid var(--line); border-radius: 24px;
  background: linear-gradient(rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
}
.parents-card h2 { font-size: clamp(1.75rem, 3vw, 2.375rem); margin-bottom: 16px; }
.parents-card p { color: var(--text); max-width: 40em; }
.support-h { margin-top: 36px; }
.sign-off { font: italic 1.125rem/1.4 var(--serif); color: var(--gold); margin: 0; }

/* footer */
.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  padding: 28px var(--gutter) max(32px, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(233, 196, 106, 0.12);
  background: var(--night); color: var(--mist); font-size: 0.875rem;
}
.foot a { color: var(--cream); text-decoration: none; display: inline-block; padding: 12px 0; }
.foot a:hover { color: var(--gold); }
.foot span { display: flex; flex-wrap: wrap; align-items: center; gap: 0 6px; }

/* ----------------------------------------------------------- scroll reveals
   Each block fades in and rises a little as it enters; neighbours in a row are staggered. */
@keyframes reveal {
  from { opacity: 0; translate: 0 48px; }
  to { opacity: 1; translate: 0 0; }
}
@supports (animation-timeline: view()) {
  .reveal {
    animation: reveal linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 80%;
  }
  .steps li:nth-child(2), .mode:nth-child(2), .phone.p2, .wardrobe ul:nth-child(2), .pair + .heroes-text .eyebrow { animation-range: entry 10% entry 90%; }
  .steps li:nth-child(3), .phone.p3, .wardrobe ul:nth-child(3) { animation-range: entry 20% entry 100%; }
  /* the three screenshots drift apart a little as they pass */
  @media (min-width: 700px) {
    .phone .screen { animation: lift linear both; animation-timeline: view(); animation-range: cover 0% cover 100%; }
    .phone.p1 .screen, .phone.p3 .screen { --lift: -70px; }
    .phone.p2 .screen { --lift: 30px; }
  }
  @keyframes lift { from { transform: translate3d(0, calc(var(--lift, 0px) * -1), 0); } to { transform: translate3d(0, var(--lift, 0px), 0); } }
}

/* ------------------------------------------------------------- narrow screens */
@media (max-width: 1080px) {
  .anchors { display: none; }
}
@media (max-width: 899px) {
  .how, .heroes { grid-template-columns: minmax(0, 1fr); }
  .board { max-width: 440px; margin-inline: auto; }
  .heroes .pair { order: 2; }
  .phones {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
    margin-inline: calc(-1 * var(--gutter)); padding: 0 var(--gutter) 8px; gap: 18px; scroll-padding-inline: var(--gutter);
  }
  .phones::-webkit-scrollbar { display: none; }
  .phone { flex: 0 0 min(64vw, 280px); scroll-snap-align: center; }
  .p2 { margin-top: 0; }
}
@media (max-width: 560px) {
  body { font-size: 1rem; }
  .mode-pair { grid-template-columns: minmax(0, 1fr); gap: 48px; }
  .facts div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .wardrobe ul { flex-wrap: wrap; justify-content: space-between; }
  .wardrobe ul::before { flex-basis: 100%; margin-bottom: 4px; }
  .wardrobe img { height: 60px; }
  .wardrobe .ward-lanterns img { height: 68px; }
  .wardrobe .ward-owlets img { height: 54px; }
  .brand span { font-size: 1.125rem; }
  .home { font-size: 0.875rem; }
}

/* ====================================================================== legal */

.top {
  position: relative; overflow: clip; isolation: isolate;
  min-height: clamp(220px, 30vw, 320px);
  display: flex; flex-direction: column;
  background: #1268c6;
}
.top-sky { position: absolute; inset: 0; z-index: -2; }
.top-sky img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.top::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(rgba(4, 22, 48, 0.5), rgba(4, 18, 36, 0.36) 40%, rgba(5, 12, 10, 0.58) 72%, var(--ink));
}
.top .topnav { position: relative; }
.top h1 {
  margin: auto var(--gutter) clamp(26px, 4vw, 44px);
  font-size: clamp(2.25rem, 5.4vw, 4rem); line-height: 1.04; letter-spacing: -0.01em;
  text-shadow: 0 2px 4px rgba(0, 10, 4, 0.45), 0 0 30px rgba(0, 10, 4, 0.35);
}
.legal {
  background: linear-gradient(var(--ink), var(--night) 360px, var(--night));
  padding: clamp(32px, 6vw, 72px) var(--gutter) clamp(72px, 10vw, 120px);
}
.prose { max-width: 42rem; margin: 0 auto; color: var(--text); font-size: 1.0625rem; line-height: 1.72; }
.prose h2 { font-size: clamp(1.375rem, 2.6vw, 1.75rem); line-height: 1.25; margin: 2.2em 0 0.6em; letter-spacing: 0; }
.prose h3 { font-size: 1.1875rem; margin: 1.6em 0 0.4em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin: 0.35em 0; }
.prose li::marker { color: var(--gold-deep); }
.prose strong { color: var(--cream); font-weight: 600; }
.prose .meta { color: var(--mist); font-size: 0.9375rem; padding-bottom: 1.4em; border-bottom: 1px solid var(--line); margin-bottom: 1.6em; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 1.2em; font-size: 0.9375rem; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); }
.prose th { color: var(--cream); }
.anchors a[aria-current="page"] { color: var(--gold); }
@media (max-width: 1080px) { .top .anchors { display: flex; } }
@media (max-width: 640px) {
  .top .home { display: none; }
  .top .anchors { gap: 18px; }
}
.anchors a, .home { white-space: nowrap; }
/* the brand already leads back to the game */
@media (max-width: 420px) { .top .anchors li:first-child { display: none; } }

/* ============================================================ guides and FAQ
   The "How to play" pages share the legal pages' sky header and reading column; these rules add
   the breadcrumb, figures with numbered legends, tables, item lists, the FAQ and the guide cards. */

/* skip link: hidden until it gets keyboard focus */
.skip {
  position: absolute; z-index: 20; left: 12px; top: -60px;
  padding: 10px 16px; border-radius: 10px; background: var(--cream); color: var(--ink);
  font: 600 0.9375rem/1.2 var(--sans); text-decoration: none;
}
.skip:focus { top: 12px; }

.top-title { margin: auto var(--gutter) clamp(26px, 4vw, 44px); }
.top .top-title h1 { margin: 0; }
.crumbs ol {
  display: inline-flex; flex-wrap: wrap; gap: 0; margin: 0 0 12px; padding: 0 14px; list-style: none;
  border-radius: 999px; background: rgba(4, 22, 48, 0.5); font: 600 0.875rem/1.4 var(--sans);
}
.crumbs li { color: #fff8e6; text-shadow: 0 1px 2px rgba(0, 10, 30, 0.7); }
.crumbs li + li::before { content: "\203A"; margin: 0 8px; color: var(--gold); }
.crumbs li { display: flex; align-items: center; }
.crumbs a, .crumbs [aria-current] { display: inline-block; padding: 6px 0; }
.crumbs a { color: var(--cream); text-decoration: none; }
.crumbs a:hover { color: #fff; text-decoration: underline; }
.crumbs [aria-current] { color: #fff; }

.guide .prose { max-width: 44rem; }
.prose .lede { font: italic 400 clamp(1.1875rem, 2vw, 1.375rem)/1.5 var(--serif); color: var(--cream); margin-bottom: 1.4em; }
.toc { margin: 0 0 2em; padding: 18px 22px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255, 255, 255, 0.025); }
.toc p { margin: 0 0 8px; color: var(--gold); font: 600 0.75rem/1 var(--sans); letter-spacing: 0.18em; text-transform: uppercase; }
.toc ol { margin: 0; padding-left: 1.3em; columns: 2 16em; column-gap: 2em; }
.toc li { margin: 0.2em 0; break-inside: avoid; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }
.prose h2[id], .prose h3[id], .faq details[id] { scroll-margin-top: 24px; }

/* figures: a screenshot from the game, then the caption and the numbered legend that match its marks */
.fig { margin: 1.6em 0 2em; }
.fig img {
  width: 100%; border-radius: 18px; border: 1px solid rgba(233, 196, 106, 0.3);
  box-shadow: 0 24px 50px -22px rgba(0, 0, 0, 0.7); background: var(--deep);
}
.fig-wide { max-width: 36rem; margin-inline: auto; }
.fig-narrow { max-width: 26rem; margin-inline: auto; }
.fig-phone { max-width: 20rem; margin-inline: auto; }
.fig figcaption { margin-top: 12px; color: var(--mist); font-size: 0.9375rem; line-height: 1.55; }
.legend { margin: 8px 0 0; padding: 0; list-style: none; }
.legend li { position: relative; padding-left: 2.1em; margin: 0.45em 0; }
.legend li::before {
  content: attr(value); position: absolute; left: 0; top: 0.05em;
  width: 1.5em; height: 1.5em; border-radius: 50%; display: grid; place-items: center;
  background: var(--gold); color: #1b1206; font: 700 0.8125rem/1 Georgia, var(--serif);
}
.fig-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: 18px; margin: 1.6em 0 2em; align-items: start; }
.fig-row .fig { margin: 0; }

.note { margin: 1.4em 0; padding: 16px 20px; border-left: 3px solid var(--gold); border-radius: 0 12px 12px 0; background: rgba(233, 196, 106, 0.07); }
.note p { margin: 0; color: var(--cream); }

.table-wrap { overflow-x: auto; margin: 1.4em 0 1.8em; }
.prose table caption { caption-side: bottom; text-align: left; padding-top: 10px; color: var(--mist); font-size: 0.875rem; }
.prose td, .prose th[scope="row"] { font-weight: 400; }
.prose th[scope="row"] { color: var(--cream); font-weight: 600; }

/* the shop's items: the game's own art, a name and the bonus */
.items, .prose .items { list-style: none; margin: 0.6em 0 1.6em; padding: 0; display: grid; gap: 12px; }
.items li { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 16px; align-items: center; margin: 0; padding: 10px 0; border-bottom: 1px solid var(--line); }
.items img { width: 56px; height: 72px; object-fit: contain; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.4)); }
.items b { display: block; color: var(--cream); font: 600 1.0625rem/1.3 var(--serif); }
.items span { color: var(--text); font-size: 0.9688rem; }

/* the worked example: numbered steps with a board each */
.walk, .prose .walk { list-style: none; padding: 0; counter-reset: step; }
.walk > li { counter-increment: step; margin: 0 0 1.4em; }
.walk h3 { display: flex; align-items: baseline; gap: 12px; }
.walk h3::before { content: counter(step); flex: 0 0 auto; width: 1.6em; height: 1.6em; border-radius: 50%; display: grid; place-items: center; background: rgba(233, 196, 106, 0.16); color: var(--gold); font-size: 0.9em; }

/* the FAQ: every answer open, so it reads as a page and matches its structured data */
.faq details { border-bottom: 1px solid var(--line); padding: 4px 0 6px; }
.faq summary { list-style: none; cursor: default; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary h3 { margin: 1em 0 0.4em; font-size: 1.1875rem; }
.faq-a p { margin: 0 0 0.8em; }

/* guide cards, on the hub, under each guide and on the home page */
.cards, .prose .cards { list-style: none; margin: 1.2em 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: 14px; }
.cards li { margin: 0; }
.cards a {
  display: block; height: 100%; padding: 18px 20px; border-radius: 16px; text-decoration: none;
  border: 1px solid var(--line); background: linear-gradient(rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012));
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.cards a:hover { border-color: rgba(233, 196, 106, 0.55); background-color: rgba(233, 196, 106, 0.05); }
.cards b { display: block; color: var(--cream); font: 600 1.1875rem/1.25 var(--serif); margin-bottom: 6px; }
.cards span { display: block; color: var(--mist); font-size: 0.9375rem; line-height: 1.5; }
.related { margin-top: 3em; padding-top: 1.4em; border-top: 1px solid var(--line); }
.related h2 { margin-top: 0; }

/* home: the link under "How it plays" and the guides section */
.how .more { margin: 18px 0 0; font-weight: 600; }
.how .more a::after { content: " \2192"; }
.learn .lede { margin-bottom: 8px; }
.learn .cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); }

/* footer links and the language switcher (plain links; it appears once a page exists in two languages) */
.foot-links { display: flex; }
.langs ul { display: flex; flex-wrap: wrap; gap: 0 14px; margin: 0; padding: 0; list-style: none; }
.langs a[aria-current] { color: var(--gold); }
.langs-foot { flex-basis: 100%; }
.langs-top { position: relative; margin-left: auto; font: 500 0.9375rem/1 var(--sans); }
.langs-top summary { display: inline-flex; align-items: center; min-height: 48px; cursor: pointer; color: var(--cream); text-shadow: 0 1px 2px rgba(0, 18, 40, 0.55); }
.langs-top ul {
  position: absolute; right: 0; top: 100%; z-index: 10; flex-direction: column; gap: 0; min-width: 12em;
  padding: 8px; border-radius: 12px; background: var(--night); border: 1px solid var(--line); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
}
.langs-top a { display: block; padding: 10px 12px; color: var(--cream); text-decoration: none; }
.langs-top summary { gap: 6px; white-space: nowrap; list-style: none; }
.langs-top summary::-webkit-details-marker { display: none; }
.langs-top summary::after {
  /* a small chevron: this opens a list */
  content: ""; width: 0.42em; height: 0.42em; margin-top: -0.2em; border: solid currentColor; border-width: 0 1.5px 1.5px 0; rotate: 45deg; opacity: 0.8;
}
.langs-top[open] summary::after { rotate: 225deg; margin-top: 0.2em; }
.langs-code { display: none; letter-spacing: 0.06em; }
.langs-top ul { max-height: calc(100svh - 90px); overflow-y: auto; overscroll-behavior: contain; }
.langs-top a:hover { background: rgba(233, 196, 106, 0.08); border-radius: 8px; }
.topnav .brand { flex: 0 0 auto; }
@media (max-width: 560px) {
  /* on a phone the nav shows the short code, and the list opens as two columns that fit the screen */
  .langs-name { display: none; }
  .langs-code { display: inline; }
  .langs-top ul { display: grid; grid-template-columns: 1fr 1fr; min-width: 0; width: min(22rem, calc(100vw - 2 * var(--gutter))); }
}
/* the portfolio link leaves the crowded phone nav (it is in the footer) */
@media (max-width: 480px) { .topnav .home { display: none; } }
/* on the inner pages a narrow nav puts its links on a second row instead of pushing past the edge */
@media (max-width: 640px) {
  .top .topnav { flex-wrap: wrap; row-gap: 0; }
  .top .anchors { order: 3; flex-basis: 100%; }
}

@media (max-width: 560px) {
  .toc ol { columns: 1; }
  .items li { grid-template-columns: 44px minmax(0, 1fr); gap: 12px; }
  .items img { width: 44px; height: 58px; }
}

/* ============================================================== reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
