/* 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);
  --bar-h: 65px;           /* the fixed bar at the top of every page (two rows on a phone: see "The bar") */
  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));
}
/* The bar: on every page, fixed to the top, before the header. Wide screens: the game, the page links, the two store
   badges (Apple's first, 40 px high, 12 px between: a quarter of the height is the clear space), the language
   switcher, in one row. Narrower: the page links leave for the page's own header (.anchors-sub) and the badges
   stay; on a phone the badges take a second row under the game and the language. The script (labyrinth.js)
   sets .stores-off while another store block is on screen: the pair fades out, on a phone its row folds away. */
.topnav {
  position: fixed; z-index: 50; top: 0; left: 0; right: 0;
  display: flex; align-items: center; gap: 16px;
  padding: max(8px, env(safe-area-inset-top)) var(--gutter) 8px;
  /* Glass (owner, 2026-11-22: the dark fog was too black, too tall and opaque over the bright picture): what
     scrolls under the bar is blurred and only lightly tinted with the page's night colour, and the bar's lower
     edge fades out instead of ending in a line. Clear while the page stands at its top (.at-top, set by
     labyrinth.js), so the picture there shows whole. */
  font: 500 0.9375rem/1 var(--sans); letter-spacing: 0.01em;
}
/* Two layers that reach well below the bar and fade out slowly, so the glass has no edge: a strong blur with the
   tint that is gone by the bar's lower edge plus a little, and a faint blur under it that carries on further.
   Both are masked with long gradients; the tint is a gradient too, never a flat band. */
.topnav::before, .topnav::after {
  content: ""; position: absolute; z-index: -1; left: 0; right: 0; top: 0; pointer-events: none;
  opacity: 1; transition: opacity 0.25s ease;
}
.topnav::before {
  bottom: -56px;
  background: linear-gradient(to bottom, rgba(10, 25, 22, 0.30) 0, rgba(10, 25, 22, 0.20) 45%, rgba(10, 25, 22, 0) 100%);
  -webkit-backdrop-filter: blur(9px) saturate(1.08); backdrop-filter: blur(9px) saturate(1.08);
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 26%, rgba(0, 0, 0, 0.6) 52%, rgba(0, 0, 0, 0.25) 76%, rgba(0, 0, 0, 0.08) 90%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0, #000 26%, rgba(0, 0, 0, 0.6) 52%, rgba(0, 0, 0, 0.25) 76%, rgba(0, 0, 0, 0.08) 90%, transparent 100%);
}
.topnav::after {
  bottom: -110px;
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 36%, rgba(0, 0, 0, 0.55) 62%, rgba(0, 0, 0, 0.2) 82%, rgba(0, 0, 0, 0.06) 93%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0, #000 36%, rgba(0, 0, 0, 0.55) 62%, rgba(0, 0, 0, 0.2) 82%, rgba(0, 0, 0, 0.06) 93%, transparent 100%);
}
.topnav.at-top::before, .topnav.at-top::after { opacity: 0; }
/* no blur available: a little more tint, so the links still read over text */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .topnav::before { background: rgba(10, 25, 22, 0.82); }
}
.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; }
.topnav a.badge { text-shadow: none; }
.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); }
.topnav .anchors { margin-inline: auto; }
.top-stores { flex: none; display: grid; grid-template-rows: 1fr; }
.topnav .stores-top { display: flex; flex-wrap: nowrap; align-items: center; justify-content: center; gap: 12px; margin: 0; min-height: 0; transition: opacity 0.25s ease; }
.topnav .stores-top .badge img { height: 40px; }
.topnav .stores-top .badge:focus-visible { outline-offset: 2px; }
.topnav.stores-off .stores-top { opacity: 0; visibility: hidden; transition: opacity 0.25s ease, visibility 0s 0.25s; }
.top > .anchors-sub { display: none; }
.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; }

/* 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;
}
/* the sign's shadow is a soft gradient under it, not a filter: Safari on iPad painted a drop-shadow
   filter on a size container as a dark square until the first scroll */
.title-sign::before {
  content: ""; position: absolute; z-index: -1; left: 4%; right: 4%; top: 52%; bottom: -12%;
  background: radial-gradient(closest-side, rgba(10, 30, 60, 0.42), rgba(10, 30, 60, 0));
  pointer-events: none;
}
.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;
  color: #fff3d0; text-decoration: none;
  transition: translate 0.2s ease, filter 0.2s ease;
}
/* the plank and, under it, its soft shadow (a gradient, not a filter: see .title-sign) */
.play::before {
  content: ""; position: absolute; z-index: -1; inset: 0 -6% -22%;
  background:
    url(art/button-play.webp) 50% 0 / 89.286% 81.967% no-repeat,
    radial-gradient(closest-side, rgba(10, 30, 60, 0.4), rgba(10, 30, 60, 0)) 50% 100% / 94% 52% no-repeat;
  pointer-events: none;
}
/* 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: 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);
}

/* The store badges: the stores' own artwork, as provided (site/store.mjs), never restyled beyond their size.
   Apple's black badge first, then Google's, both in the page's language and at the same visible height (Google's
   padding is cropped off the files). Never under 40px; a quarter of their height clear around each: the gap
   between two badges and the room above the "Coming soon" line under the App Store's while it is not live. */
.stores { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 14px; margin: clamp(14px, 2cqh, 20px) 0 0; }
.badge { display: inline-flex; flex-direction: column; align-items: center; gap: 14px; text-decoration: none; line-height: 0; border-radius: 7px; flex: none; }
.badge img { display: block; height: 52px; width: auto; max-width: none; }
.badge-sm img { height: 40px; }
a.badge:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
/* Not live yet: dimmed (the art at 45% over solid black, so the scene behind never shows through), no hover,
   not a link (a span with aria-disabled); the "Coming soon" line stays legible on any background. */
.badge-off { cursor: default; user-select: none; }
.badge-off .badge-art { display: block; background: #000; border-radius: 7px; line-height: 0; }
.badge-off img { opacity: 0.45; }
.badge-off .soon { font: 600 0.8125rem/1.2 var(--sans); color: var(--cream); padding: 4px 10px; border-radius: 999px; background: rgba(8, 24, 48, 0.72); }
@media (max-width: 420px) { .badge img { height: 46px; } .badge-sm img { height: 40px; } .stores { gap: 12px; } }
.get-card { max-width: 40rem; margin: 0 auto; text-align: center; }
.get-card h2 { font-size: clamp(1.75rem, 3vw, 2.375rem); margin-bottom: 12px; }
.get-card p { color: var(--text); }
.note .stores { justify-content: flex-start; margin-top: 16px; }
.foot a.badge { display: inline-flex; padding: 0; }
.foot-stores { flex-basis: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.foot-stores .stores { margin: 8px 0 0; justify-content: flex-start; }
.trademark { margin: 0; color: var(--mist); font-size: 0.75rem; line-height: 1.4; }

/* 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: 5/6) {
  .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: max(clamp(64px, 8.5cqh, 110px), calc(var(--bar-h) + 6px)); --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%; }
}
/* a tablet held upright: the same composition, with a smaller stage so the heroes stand below the button */
@media (max-aspect-ratio: 5/6) and (min-width: 600px) {
  .hero { --W: 160cqw; }
  .title-sign { width: min(56cqw, 470px); }
}

/* ========================================================================= 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: 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; }
}

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

.top {
  position: relative; overflow: clip; isolation: isolate;
  padding-top: var(--bar-h);
  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 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"], .anchors-sub a[aria-current="page"] { color: var(--gold); }
.anchors a { white-space: nowrap; }
/* the page links, when the bar has no room for them: a row of the header, under the bar */
@media (max-width: 1260px) { .topnav-home .anchors { display: none; } }  /* the home page's five in-page links are the widest row */
@media (max-width: 1100px) {
  .topnav .anchors { display: none; }
  .top > .anchors-sub { display: flex; gap: 6px 22px; flex-wrap: wrap; margin: 0 var(--gutter); padding: 0; list-style: none; font: 500 0.9375rem/1 var(--sans); }
  .anchors-sub a { display: inline-flex; align-items: center; min-height: 44px; color: var(--cream); text-decoration: none; text-shadow: 0 1px 2px rgba(0, 18, 40, 0.55); }
  .anchors-sub a:hover { color: #fff; }
}
@media (max-width: 420px) { .anchors-sub li:first-child { display: none; } } /* the brand already leads back to the game */

/* ============================================================ 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; }
[id] { scroll-margin-top: calc(var(--bar-h) + 12px); }

/* 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; flex: none; 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; }
/* the badges and the language keep to the right edge at every width, also where the page links have left the bar
   (between the phone layout and the wide one nothing else pushed them there, and they stood beside the name) */
.top-stores { margin-left: auto; }
.topnav .anchors { margin-inline: auto 0; }
.topnav .anchors + .top-stores { margin-left: auto; }
/* a phone: the badges take a row of their own under the game and the language */
@media (max-width: 700px) {
  :root { --bar-h: 109px; }
  .topnav { flex-wrap: wrap; row-gap: 0; }
  .topnav .brand { margin-right: auto; }
  .top-stores { order: 3; flex-basis: 100%; transition: grid-template-rows 0.3s ease; }
  .topnav .stores-top { overflow: hidden; padding: 4px 4px 0; margin-inline: -4px; }
  .topnav.stores-off .top-stores { grid-template-rows: 0fr; }
  .topnav.stores-off .stores-top { padding-top: 0; }
  .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))); }
}

@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; }
}

/* ============================================================ maze boards in the articles
   A worked example drawn as a table (the `board` block, site/templates.mjs): .wr / .wd are walls on a tile's right
   and lower side, .or / .od proven passages, .hot the tile the text is about, .way a walked route. */
.maze-fig { width: fit-content; max-width: 100%; margin-inline: auto; }
.prose table.maze { width: auto; margin: 0 auto; border-collapse: collapse; border: 3px solid var(--gold); background: rgba(255, 255, 255, 0.03); font-size: 1.125rem; }
.prose table.maze td { width: min(3rem, 11.5vw); height: min(3rem, 11.5vw); padding: 0; text-align: center; vertical-align: middle; color: var(--cream); font-weight: 600; border: 1px solid rgba(244, 236, 216, 0.14); }
.prose table.maze td.wr { border-right: 3px solid var(--gold); }
.prose table.maze td.wd { border-bottom: 3px solid var(--gold); }
.prose table.maze td.or { border-right: 2px dashed var(--mist); }
.prose table.maze td.od { border-bottom: 2px dashed var(--mist); }
.prose table.maze td.way { background: rgba(163, 178, 166, 0.2); }
.prose table.maze td.hot { background: rgba(233, 196, 106, 0.26); }
.maze-fig figcaption { max-width: 26rem; }

/* ============================================================ the maze generator
   /maze-generator/ (site/templates.mjs, public/maze-generator.js): the controls in the site's pill shape and gold, then
   the maze on a sheet of white paper, black on white as it prints. The answer sheet exists for printing only. The
   controls stay hidden without the script, which also makes new mazes; the first maze is in the page. */
.mg { margin: 0.4em 0 2.6em; }
.mg-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 18px; }
.mg-bar[hidden] { display: none; }
.mg-field { display: flex; align-items: center; gap: 10px; margin-right: 4px; }
.mg-field label { color: var(--cream); font: 600 0.9375rem/1.2 var(--sans); }
.mg-field select, .mg-btn {
  min-height: 44px; padding: 0 16px; border-radius: 999px;
  border: 1px solid rgba(233, 196, 106, 0.4); background-color: rgba(255, 255, 255, 0.035);
  color: var(--cream); font: 600 0.9375rem/1.2 var(--sans); cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.mg-field select { padding-inline: 14px; background-color: var(--night); max-width: 100%; }
.mg-btn:hover, .mg-field select:hover { border-color: rgba(233, 196, 106, 0.75); background-color: rgba(233, 196, 106, 0.08); }
.mg-btn-main { background-color: var(--gold); border-color: var(--gold); color: #1b1206; }
.mg-btn-main:hover { background-color: #f2d58a; border-color: #f2d58a; }
.mg-btn[aria-pressed="true"] { border-color: var(--gold); color: var(--gold); background-color: rgba(233, 196, 106, 0.12); }
.mg-check { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--text); font-size: 0.9375rem; line-height: 1.3; cursor: pointer; }
.mg-check input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--gold); }
.mg-sheet {
  margin: 0; padding: clamp(12px, 3vw, 26px); border-radius: 14px; background: #fff; color: #222;
  box-shadow: 0 24px 50px -22px rgba(0, 0, 0, 0.7);
}
.mg-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; margin: 0 0 10px; color: #333; font: 600 0.875rem/1.3 var(--sans); }
.mg-head span:last-child { color: #666; font-weight: 400; }
.mg-svg { display: block; width: 100%; height: auto; }
.mg-answer { display: none; }
.mg-status { min-height: 1.5em; margin: 10px 0 0; color: var(--mist); font-size: 0.9375rem; }
.mg-noscript { margin: 10px 0 0; color: var(--mist); font-size: 0.9375rem; }
@media (max-width: 560px) {
  .mg-bar { gap: 8px; }
  .mg-field { flex-basis: 100%; margin-right: 0; }
  .mg-field select { flex: 1; }
  .mg-btn { padding: 0 14px; }
}

/* a printed article or maze: the text and the boards, in black on white, without the site around them */
@media print {
  @page { margin: 16mm 14mm; }
  :root { color-scheme: light !important; }
  .prose h2, .prose h3 { break-after: avoid; page-break-after: avoid; }
  .prose p, .prose li, .fig, .prose table { orphans: 3; widows: 3; }
  *, *::before, *::after { background: transparent !important; box-shadow: none !important; text-shadow: none !important; color: #000 !important; }
  html::before, html::after, body::before, body::after, .top::before, .top::after, main::before, main::after { display: none !important; }
  html, body { background: #fff !important; color: #000 !important; }
  .top-sky, .topnav, .skip, .toc, .foot, .related, .langs, .crumbs, .crumb, nav { display: none !important; }
  .top, .top-title { background: none !important; padding: 0 !important; min-height: 0 !important; }
  .top-title h1, .prose, .prose h2, .prose h3, .prose strong, .prose p, .prose li, .fig figcaption, .prose .meta { color: #000 !important; }
  .prose table.maze { border-color: #000; background: none; break-inside: avoid; }
  .prose table.maze td { color: #000; border-color: #bbb; width: 2.6rem; height: 2.6rem; }
  .prose table.maze td.wr { border-right-color: #000; }
  .prose table.maze td.wd { border-bottom-color: #000; }
  .prose table.maze td.way, .prose table.maze td.hot { background: #e8e8e8 !important; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .maze-fig { break-inside: avoid; }
  /* the maze generator: the maze sheet alone (and the answer sheet, when asked for, on a page of its own), each sized
     to fit one portrait page of A4 or Letter inside the margins above */
  body:has(.mg-page) .top, .mg-page .prose > :not(.mg), .mg-bar, .mg-status, .mg-noscript { display: none !important; }
  .mg-page { padding: 0 !important; }
  .mg-page .prose { max-width: none; }
  .mg { margin: 0; }
  .mg-sheet { padding: 0; border-radius: 0; break-inside: avoid; }
  .mg-head { margin: 0 0 4mm; font: 600 10pt/1.3 var(--sans); }
  .mg-head span:last-child { font-weight: 400; }
  .mg-svg { width: auto; height: 222mm; max-width: 100%; margin: 0 auto; }
  .mg-answer.mg-answer-on { display: block; break-before: page; page-break-before: always; }
}

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