/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: var(--header-h); background: var(--ink-deep); }
body {
  margin: 0;
  background: var(--ink-deep);
  color: var(--on-dark);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.65;
  overflow-x: clip;
}
img, video { display: block; max-width: 100%; height: auto; }

/* Lenis smooth scrolling (lenis.css 1.3.26). */
html.lenis, html.lenis body { height: auto; }
.lenis:not(.lenis-autoToggle).lenis-stopped { overflow: clip; }
.lenis [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-smooth iframe { pointer-events: none; }
picture { display: block; }
a { color: inherit; }
h1, h2, h3 {
  margin: 0;
  font-family: var(--font-display);
  font-variation-settings: var(--soft);
  font-weight: 620;
  line-height: 1.04;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
p { margin: 0; text-wrap: pretty; }
ul { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--focus, var(--brass)); outline-offset: 3px; border-radius: 4px; }
/* Brass disappears on cream: the paper sections use a dark ring and darker gold text. */
.story, .faq, .press, .island { --focus: var(--ghost-deep); }

/* viewport-fit=cover: in landscape the content keeps clear of the notch. */
.wrap { width: min(100% - 2 * max(var(--gutter), env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px)), var(--max)); margin-inline: auto; }
.skip {
  position: absolute; left: 1rem; top: -5rem; z-index: 100;
  padding: 0.6rem 1rem; border-radius: var(--radius-s);
  background: var(--brass); color: var(--ink-deep); font-weight: 600; text-decoration: none;
}
.skip:focus { top: 1rem; }
.label {
  display: inline-flex; align-items: center; gap: 0.75rem;
  font-family: var(--font-body); font-weight: 600; font-size: 0.8125rem;
  letter-spacing: var(--tracking-label); text-transform: uppercase;
  color: var(--brass);
}
.label::before { content: ""; width: 2rem; height: 1px; background: currentColor; opacity: 0.7; }
.lead { font-size: var(--fs-lead); color: var(--on-dark-muted); }

/* Buttons: brass, with the brand's short hard shadow and a pressed state */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
  min-height: 3.25rem; padding: 0.85rem 1.6rem;
  border: 0; border-radius: var(--radius-s);
  background: var(--brass); color: var(--ink-deep);
  box-shadow: var(--shadow-hard);
  font-family: var(--font-body); font-weight: 600; font-size: 1rem; letter-spacing: 0.01em;
  text-decoration: none; cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), background-color var(--dur-fast);
}
.btn:hover { background: #f5d37f; transform: translateY(-1px); }
.btn:active { transform: translateY(2px); box-shadow: var(--shadow-hard-low); background: var(--brass-deep); }
.btn svg { width: 1.15em; height: 1.15em; flex: none; }
.btn--ghost { background: transparent; color: var(--on-dark); box-shadow: inset 0 0 0 1.5px rgb(246 238 220 / 0.55); }
.btn--ghost:hover { background: rgb(246 238 220 / 0.08); }
.btn--ghost:active { background: rgb(246 238 220 / 0.14); box-shadow: inset 0 0 0 1.5px rgb(246 238 220 / 0.55); }
.btn--small { min-height: 2.75rem; padding: 0.5rem 1.05rem; font-size: 0.9375rem; }

/* Header */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 60;
  transition: background-color var(--dur-med), box-shadow var(--dur-med);
}
.site-header.is-scrolled { background: rgb(33 30 39 / 0.94); box-shadow: 0 1px 0 rgb(246 238 220 / 0.08); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; flex: none; min-height: 2.75rem; }
.brand img { height: 2.75rem; width: auto; filter: drop-shadow(0 2px 6px rgb(20 15 26 / 0.6)); }
.nav { display: flex; align-items: center; gap: clamp(1rem, 0.5rem + 1.5vw, 2rem); }
.nav__links { display: flex; align-items: center; gap: clamp(1rem, 0.5rem + 1.5vw, 2rem); }
/* Touch targets stay at least 44 px: the links grow by padding that the negative margin takes back. */
.nav__links a {
  display: inline-flex; align-items: center; min-height: 2.75rem; padding-inline: 0.5rem; margin-inline: -0.5rem;
  font-weight: 500; font-size: 0.9375rem; text-decoration: none; color: var(--on-dark-muted);
  transition: color var(--dur-fast);
}
.nav__links a:hover { color: var(--on-dark); }
.nav__back { display: inline-flex; align-items: center; min-height: 2.75rem; padding-inline: 0.5rem; margin-inline: -0.5rem; white-space: nowrap; font-weight: 500; font-size: 0.9375rem; text-decoration: none; color: var(--on-dark-muted); }
.nav__back:hover { color: var(--on-dark); }
.nav-toggle {
  display: none; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; padding: 0;
  border: 0; border-radius: var(--radius-s); background: rgb(246 238 220 / 0.1); color: var(--on-dark); cursor: pointer;
}
.nav-toggle svg { width: 1.3rem; height: 1.3rem; }
.nav-toggle .i-close, .site-header.is-open .nav-toggle .i-menu { display: none; }
.site-header.is-open .nav-toggle .i-close { display: block; }
.btn__short { display: none; }

/* Nightfall: the opening scene. The stage is sticky, the four steps scroll past it,
   and --p (0..1, set from scroll) turns day into night in the same camera. */
.nightfall { --p: 0; --fc: 0; position: relative; background: var(--ink-deep); }
.nightfall__stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.layer { position: absolute; inset: 0; }
.layer--day picture { position: absolute; inset: 0; }
.layer img, .layer video {
  width: 100%; height: 100%; object-fit: cover;
  object-position: var(--ox, 50%) var(--oy, 50%);
  transform-origin: var(--ox, 50%) var(--oy, 50%);
  transform: scale(var(--s, 1));
  will-change: transform;
}
/* One push-in for the whole scene. The steps rest on a single picture (centred at p = 0, 1/3,
   2/3 and 1). The pictures come from different cameras, so each swap is a wipe: a bank of fog
   (the curtain) rolls across from left to right and the next picture is revealed behind it.
   --w1 and --w2 (0..1, set from scroll) run the two wipes, at p 0.42 to 0.6 and 0.76 to 0.92. */
.layer--day { --ox: 50%; --oy: 50%; --s: calc(1 + var(--p) * 0.22); animation: breathe 16s var(--ease-in-out) infinite alternate; }
/* The village loop fades in over its own first frame once it plays. */
.layer__video { position: absolute; inset: 0; opacity: 0; transition: opacity 1.2s var(--ease-out); }
.layer__video.is-playing { opacity: 1; }
.layer--dusk {
  --ox: 50%; --oy: 58%; --s: calc(1.04 + var(--p) * 0.2);
  opacity: min(1, var(--w1, 0) * 50);
  -webkit-mask-image: linear-gradient(90deg, #000 calc(var(--w1, 0) * 150% - 50%), transparent calc(var(--w1, 0) * 150%));
  mask-image: linear-gradient(90deg, #000 calc(var(--w1, 0) * 150% - 50%), transparent calc(var(--w1, 0) * 150%));
}
.layer--hero {
  --ox: 50%; --oy: 62%; --s: calc(1 + max(0, var(--p) - 0.81) * 0.4);
  opacity: min(1, var(--w2, 0) * 50);
  -webkit-mask-image: linear-gradient(90deg, #000 calc(var(--w2, 0) * 150% - 50%), transparent calc(var(--w2, 0) * 150%));
  mask-image: linear-gradient(90deg, #000 calc(var(--w2, 0) * 150% - 50%), transparent calc(var(--w2, 0) * 150%));
}
/* The first screen breathes a little, so the village is alive before anyone scrolls. */
@keyframes breathe { to { scale: 1.03; } }
/* Evening: the day picture cools and darkens towards the dusk shot before the swap, and lets go after it. */
.nightfall__grade {
  position: absolute; inset: 0; pointer-events: none; background: rgb(18 24 52);
  opacity: calc((clamp(0, (var(--p) - 0.2) * 2, 0.62) - clamp(0, (var(--p) - 0.5) * 6, 0.5)) * 0.65);
}
.layer--dusk, .layer--hero { will-change: opacity; }
/* main.js lists the layers that can be seen in data-show; the rest are not drawn at all.
   Without JS there is no data-show and nothing is hidden. */
.nightfall[data-show]:not([data-show~="day"]) .layer--day,
.nightfall[data-show]:not([data-show~="dusk"]) .layer--dusk,
.nightfall[data-show]:not([data-show~="night"]) .layer--hero,
.nightfall[data-show]:not([data-show~="fog"]) .fog-bank:not(.fog-bank--back),
.nightfall[data-show]:not([data-show~="fog-back"]) .fog-bank--back,
.nightfall[data-show]:not([data-show~="curtain"]) .fog-curtain,
.nightfall[data-show]:not([data-show~="grade"]) .nightfall__grade { visibility: hidden; }
/* Once the village loop plays over it, the poster under it is not drawn either (after the fade). */
.layer--day:has(.layer__video.is-playing) picture { visibility: hidden; transition: visibility 0s linear 1.3s; }

/* The fog: the brand's one cool accent, rolling in as the light goes. The mask that keeps its top
   soft sits on a still, screen-wide bank and only the texture inside it moves. A mask on the moving
   strip made Chrome rebuild a mask texture four screens wide every frame, which broke up on 4K
   Windows screens. */
.fog-bank {
  position: absolute; left: 0; right: 0; bottom: -4%; height: 72%; overflow: hidden; pointer-events: none;
  -webkit-mask-image: linear-gradient(to top, #000 40%, transparent 100%);
  mask-image: linear-gradient(to top, #000 40%, transparent 100%);
  opacity: clamp(0, (var(--p) - 0.36) * 2.4, 0.72);
}
.fog-bank--back { height: 88%; bottom: 6%; opacity: clamp(0, (var(--p) - 0.42) * 1.6, 0.45); }
.fog {
  position: absolute; left: 0; top: 0; bottom: 0; width: 300vw;
  background: url("../assets/images/fog-a-v2.webp") repeat-x left bottom / 200vw 100%;
  animation: fog-drift 70s linear infinite;
}
.fog--back { background-image: url("../assets/images/fog-b-v2.webp"); animation-duration: 110s; animation-direction: reverse; }
/* The fog is invisible until p = 0.4: its pictures load with the night layers on the first scroll. */
.js-ready .nightfall:not(.is-loaded) .fog { background-image: none; }
@keyframes fog-drift { to { transform: translateX(-200vw); } }
/* The curtain: a bank of sea fog that sits on the edge of the wipe (--wb, the wipe in progress),
   so the seam between the two cameras is always inside the fog. Both pictures stay visible on
   either side of it. Dark blue-grey keeps the cream text readable where it passes. */
.fog-curtain {
  position: absolute; top: -15%; bottom: -15%; left: 0; width: 100vw; pointer-events: none;
  background:
    radial-gradient(26% 18% at 42% 20%, rgb(184 196 212 / 0.55), rgb(184 196 212 / 0) 72%),
    radial-gradient(30% 22% at 60% 44%, rgb(150 164 184 / 0.7), rgb(150 164 184 / 0) 72%),
    radial-gradient(34% 20% at 40% 66%, rgb(128 142 162 / 0.75), rgb(128 142 162 / 0) 72%),
    radial-gradient(28% 16% at 58% 86%, rgb(176 188 204 / 0.6), rgb(176 188 204 / 0) 72%),
    radial-gradient(44% 64% at 50% 50%, rgb(84 98 120 / 0.88), rgb(84 98 120 / 0) 80%);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 28%, #000 72%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 28%, #000 72%, transparent);
  opacity: var(--fc);
  transform: translateX(calc((var(--wb, 0) * 150 - 75) * 1vw));
}

.nightfall__shade {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgb(23 21 28 / 0.7) 0%, rgb(23 21 28 / 0) 22%),
    linear-gradient(0deg, rgb(33 30 39 / 0.7) 0%, rgb(33 30 39 / 0.45) 14%, rgb(23 21 28 / 0.2) 34%, rgb(23 21 28 / 0) 55%);
}
.nightfall__vignette {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 58% 52% at 50% 44%, rgb(23 21 28 / 0.74) 0%, rgb(23 21 28 / 0.38) 55%, rgb(23 21 28 / 0) 82%);
  opacity: clamp(0, 1 - var(--p) * 5, 1);
}
.nightfall__side {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgb(23 21 28 / 0.86) 0%, rgb(23 21 28 / 0.5) 34%, rgb(23 21 28 / 0) 62%);
  opacity: clamp(0, (var(--p) - 0.08) * 5, 1);
}

.nightfall__steps { position: relative; z-index: 2; margin-top: -100vh; margin-top: -100svh; }
.step { min-height: 100vh; min-height: 100svh; display: flex; align-items: center; padding: calc(var(--header-h) + 2rem) 0 4rem; }
.step__inner { max-width: 36rem; }
.step h2 { font-size: var(--fs-mega); font-weight: 640; }
.step p { margin-top: 1.25rem; font-size: var(--fs-lead); color: var(--on-dark-muted); max-width: 30rem; }
.step .label { margin-bottom: 1.25rem; }
.step--ghost .label { color: var(--ghost); }
/* Each step fades out before it slides under the header; --c is the p where it is centred. */
.step:not(.step--hero) > .wrap { opacity: clamp(0, 1 - (var(--p) - var(--c) - var(--fade-at, 0.02)) * var(--fade-k, 18), 1); }
.step--hero > .wrap { opacity: clamp(0, 1 - var(--p) * 5, 1); }
.step--1 { --c: 0.333; } .step--2 { --c: 0.667; } .step--3 { --c: 1; }
/* The last step leaves with the stage; it fades by --q before it reaches the header. */
.step.step--3:not(.step--hero) > .wrap { opacity: clamp(0, 1 - var(--q, 0) * var(--q-k, 4.5), 1); }
.step .btn { margin-top: 2rem; }

/* Content sits above the square so the CTAs never cover the hero standing by the well. */
.step--hero { align-items: flex-start; text-align: center; padding-top: calc(var(--header-h) + clamp(1.5rem, 7vh, 5rem)); }
.step--hero .step__inner { max-width: 54rem; margin-inline: auto; }
/* The soft drop shadow reaches about 60 px below the logo. The bottom padding (taken back by the
   negative margin, so the layout stays) keeps it inside the image box, where neither the entrance
   mask nor a GPU layer edge can cut it; on Windows the shadow ended in a hard line. */
.hero-logo { width: min(90vw, 52rem); margin: 0 auto -4.5rem; padding-bottom: 4.5rem; filter: drop-shadow(0 4px 0 rgb(20 15 26 / 0.45)) drop-shadow(0 18px 40px rgb(20 15 26 / 0.6)); }
.step .hero-tagline {
  margin: 1.5rem auto 0; max-width: none;
  font-family: var(--font-display); font-variation-settings: var(--soft); font-weight: 560;
  font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.5rem); line-height: 1.2; color: var(--on-dark);
  text-shadow: 0 2px 0 rgb(20 15 26 / 0.5), 0 8px 30px rgb(20 15 26 / 0.7);
}
.step .hero-meta { max-width: none; }
.hero-tagline span { display: inline-block; }
.step .hero-pitch { max-width: 34rem; margin: 1.1rem auto 0; font-size: var(--fs-lead); line-height: 1.45; color: var(--on-dark); text-shadow: 0 1px 10px rgb(20 15 26 / 0.9), 0 0 2px rgb(20 15 26 / 0.6); }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.9rem; margin-top: 2rem; }
.step .hero-meta { display: flex; flex-wrap: wrap; justify-content: center; row-gap: 0.25rem; margin: 1.4rem auto 0; font-size: var(--fs-small); color: var(--on-dark); letter-spacing: 0.04em; text-shadow: 0 1px 8px rgb(20 15 26 / 0.8); }
.hero-meta span { white-space: nowrap; }
.hero-meta span + span::before { content: "·"; margin: 0 0.6rem; color: var(--brass); }
.scroll-cue {
  display: inline-flex; flex-direction: column; align-items: center; gap: 0.5rem; margin-top: 2.25rem;
  font-size: 0.75rem; letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--on-dark-muted); text-decoration: none;
}
.scroll-cue i { display: block; width: 1px; height: 2.5rem; background: linear-gradient(var(--brass), transparent); transform-origin: top; animation: cue 2.4s var(--ease-in-out) infinite; }
@keyframes cue { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* Opening entrance: the logo rises out of a mask that stays in place (the h1 bottom edge), the
   tagline follows word by word. Once settled the mask goes, so the drop shadow is not cut. */
.js-ready .step--hero h1 { clip-path: inset(-40% -20% -4.5rem -20%); }
.js-ready.is-settled .step--hero h1 { clip-path: none; }
.js-ready .hero-logo { transform: translateY(105%); transition: transform 1.1s var(--ease-out) 0.15s; }
.js-ready .hero-tagline span { opacity: 0; transform: translateY(0.5em); transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out); transition-delay: calc(0.7s + var(--i) * 0.12s); }
.js-ready .hero-actions, .js-ready .hero-meta, .js-ready .scroll-cue { opacity: 0; transition: opacity 0.8s var(--ease-out) 1.25s; }
.js-ready .hero-pitch { opacity: 0; transition: opacity 0.8s var(--ease-out) 1.05s; }
.is-awake .hero-logo { transform: none; }
.is-awake .hero-tagline span { opacity: 1; transform: none; }
.is-awake .hero-actions, .is-awake .hero-meta, .is-awake .scroll-cue, .is-awake .hero-pitch { opacity: 1; }

/* Sections */
.section { padding-block: var(--section-y); position: relative; }
.section__head { max-width: 46rem; margin-bottom: clamp(2.75rem, 2rem + 3vw, 5rem); }
.section__head h2 { margin-top: 1rem; }
.section__head p { margin-top: 1.25rem; }

.wishlist__bg picture, .press-hero__bg picture { position: absolute; inset: 0; }

/* The village as a diorama, the morning after the night above. Static by default (no JS, reduced
   motion): daylight, copy on the left, every piece in place, the camp clip below. With motion the
   stage sticks and --v (-0.5 while the section scrolls in, then 0..1) runs the dawn (--dawn),
   raises the pieces in order (--at is where each starts), swaps the beats and opens the camp
   clip over the stage (--g). */
.village { --v: 1; --dawn: 1; --g: 0; position: relative; background: var(--ink-deep); }
.village__stage { position: relative; overflow: hidden; isolation: isolate; padding-block: var(--section-y); }
.village__sky { position: absolute; inset: 0; z-index: -1; }
.sky { position: absolute; inset: 0; }
.sky img { width: 100%; height: 100%; object-fit: cover; }
.sky--dusk { opacity: min(1, var(--dawn) * 2); }
.sky--day { opacity: clamp(0, var(--dawn) * 2 - 1, 1); }
.village__sky::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgb(33 30 39 / 0.7) 0%, rgb(33 30 39 / 0) 24%, rgb(33 30 39 / 0) 72%, var(--ink-deep) 100%),
    linear-gradient(90deg, rgb(23 21 28 / 0.9) 0%, rgb(23 21 28 / 0.55) 38%, rgb(23 21 28 / 0) 64%);
}
.village__layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); align-items: center; gap: clamp(2rem, 1rem + 3vw, 4rem); }
.village__copy { position: relative; z-index: 3; }
.village__head h2 { margin-top: 1rem; font-size: clamp(2.25rem, 1.5rem + 2.4vw, 3.75rem); }
.village__head .lead { margin-top: 1.25rem; max-width: 30rem; }
.village__beats { display: grid; gap: 1.75rem; margin: clamp(2rem, 1.5rem + 2vw, 3rem) 0 0; padding: 0; list-style: none; }
.beat { position: relative; padding-left: 3.25rem; }
.beat__n { position: absolute; left: 0; top: 0.35rem; font-family: var(--font-display); font-variation-settings: var(--soft); font-weight: 600; font-size: 1rem; letter-spacing: 0.12em; color: var(--brass); }
.beat__n::after { content: ""; position: absolute; left: 0; top: 1.9rem; width: 1px; height: 2.25rem; background: linear-gradient(var(--brass), transparent); opacity: 0.6; }
.beat h3 { font-size: var(--fs-h3); }
.beat p { margin-top: 0.55rem; color: var(--on-dark-muted); max-width: 30rem; }
.village__progress { display: none; }

/* Pieces stand on one ground: the back row is higher and smaller, the front row overlaps it.
   --x/--y place the foot, --h is the height share of the stage, --d the pointer depth. */
.diorama { --mx: 0; --my: 0; position: relative; z-index: 1; width: 100%; aspect-ratio: 5 / 4; }
.diorama__ground { position: absolute; left: -12%; right: -12%; bottom: -7%; }
.diorama__ground img { width: 100%; height: auto; }
.piece {
  --t: 1; --e: 1; --dur: 0.09; --from: -1;
  position: absolute; left: var(--x); bottom: var(--y); height: var(--h); display: block;
  translate: calc(var(--mx) * var(--d) * 16px) calc(var(--my) * var(--d) * 9px);
  transition: translate 0.6s var(--ease-out);
}
.piece picture, .piece img { display: block; height: 100%; width: auto; }
.piece img { transform-origin: 50% 100%; opacity: var(--t); filter: drop-shadow(0 14px 16px rgb(14 12 20 / 0.42)); }
/* Contact shadow, so the pieces stand instead of float. */
.piece::after {
  content: ""; position: absolute; z-index: -1; left: 12%; right: 12%; bottom: -4%; height: 10%; border-radius: 50%;
  background: radial-gradient(closest-side, rgb(14 12 20 / 0.6), rgb(14 12 20 / 0));
  opacity: var(--t); transform: scaleX(calc(0.5 + min(var(--e), 1) * 0.5));
}
/* The second villager is the first one's twin, so it faces the other way. */
.piece--villager-2 img { scale: -1 1; }
.piece--windmill   { --x: -3%; --y: 36%; --h: 50%; --d: 0.4;  --at: 0.3; }
.piece--tavern     { --x: 61%; --y: 35%; --h: 50%; --d: 0.45; --at: 0.38; }
.piece--house      { --x: 26%; --y: 22%; --h: 58%; --d: 0.6;  --at: -0.3; }
.piece--cow        { --x: 70%; --y: 11%; --h: 19%; --d: 0.8;  --at: 0.02; }
.piece--sheep      { --x: 51%; --y: 8%;  --h: 17%; --d: 0.9;  --at: -0.05; }
.piece--villager-1 { --x: 15%; --y: 6%;  --h: 25%; --d: 1;    --at: -0.15; --from: -1; }
.piece--villager-2 { --x: 37%; --y: 1%;  --h: 26%; --d: 1.1;  --at: 0.62;  --from: 1; }
.piece--villager-3 { --x: 79%; --y: 0%;  --h: 26%; --d: 1.15; --at: 0.58;  --from: 1; }
.piece--rabbit     { --x: 5%;  --y: 2%;  --h: 12%; --d: 1.2;  --at: 0.5; }
.piece--deer       { --x: 84%; --y: 30%; --h: 15%; --d: 0.5;  --at: 0.46; }
.piece--duck       { --x: 63%; --y: 0%;  --h: 10%; --d: 1.25; --at: 0.08; }

/* Night light over the whole stage until the dawn (the copy sits above it). */
.village__night { position: absolute; inset: 0; z-index: 2; pointer-events: none; background: rgb(10 14 34); opacity: calc((1 - var(--dawn)) * 0.6); }
.village[data-show]:not([data-show~="night"]) .sky--night,
.village[data-show]:not([data-show~="dusk"]) .sky--dusk,
.village[data-show]:not([data-show~="day"]) .sky--day,
.village[data-show]:not([data-show~="dark"]) .village__night,
.village[data-show]:not([data-show~="dark"]) .village__fog { visibility: hidden; }

/* Morning fog on the ground, lifting with the dawn. */
.village__fog {
  position: absolute; left: 0; right: 0; bottom: 0; height: 55%; z-index: 2; pointer-events: none;
  background: url("../assets/images/fog-a-v2.webp") repeat-x left bottom / 120vw 100%;
  -webkit-mask-image: linear-gradient(to top, #000 30%, transparent);
  mask-image: linear-gradient(to top, #000 30%, transparent);
  opacity: calc((1 - var(--dawn)) * 0.85); transform: translateY(calc(var(--dawn) * 18%));
}

/* The camp clip. Static: a wide frame under the diorama. With motion it covers the stage and
   opens from a window over the diorama (--g), the diorama dims behind it. */
.camp-stage {
  position: relative; z-index: 2; width: min(100% - 2 * var(--gutter), var(--max)); aspect-ratio: 16 / 7;
  margin: clamp(2rem, 1rem + 3vw, 4rem) auto 0; overflow: hidden; border-radius: var(--radius-m);
  background: var(--ink); box-shadow: var(--shadow-frame);
}
.camp-stage picture, .camp-stage video { position: absolute; inset: 0; }
.camp-stage img, .camp-stage video { width: 100%; height: 100%; object-fit: cover; }
.camp-stage video { opacity: 0; transition: opacity 0.8s var(--ease-out); }
.camp-stage video.is-playing { opacity: 1; }

@media (prefers-reduced-motion: no-preference) {
  .js-ready .village {
    --v: -0.5; --dawn: clamp(0, (var(--v) + 0.45) / 0.55, 1); --g: clamp(0, (var(--v) - 0.72) / 0.18, 1);
    height: 300vh; height: 300svh;
  }
  .js-ready .village__stage { position: sticky; top: 0; height: 100vh; height: 100svh; display: flex; align-items: center; padding-block: calc(var(--header-h) + 1rem) 1.5rem; }
  .js-ready .village__layout { width: min(100% - 2 * max(var(--gutter), env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px)), var(--max)); }
  .js-ready .piece { --t: clamp(0, (var(--v) - var(--at)) / var(--dur), 1); }
  /* Buildings rise with a small overshoot (ease-out-back). */
  .js-ready .piece--building { --e: calc(1 + 2.2 * pow(var(--t) - 1, 3) + 1.2 * pow(var(--t) - 1, 2)); }
  .js-ready .piece--building img { transform: translateY(calc((1 - var(--e)) * 30%)) scale(calc(0.92 + var(--e) * 0.08)); }
  /* Animals hop in. */
  .js-ready .piece--animal { --dur: 0.06; --e: calc(1 - pow(1 - var(--t), 3)); }
  .js-ready .piece--animal img { transform: translateY(calc(sin(var(--t) * 3.1416) * -30%)) scale(calc(0.8 + var(--e) * 0.2)); }
  /* People walk in from their side, with a step bob. */
  .js-ready .piece--person { --dur: 0.12; --e: calc(1 - pow(1 - var(--t), 3)); transform: translateX(calc((1 - var(--e)) * var(--from) * 70%)); }
  .js-ready .piece--person img { transform: translateY(calc(pow(sin(var(--t) * 3.1416 * 4), 2) * -4%)); }
  .js-ready .village__beats { grid-template-areas: "beat"; gap: 0; }
  /* All three beats stay in the accessibility tree; only the current one is shown. */
  .js-ready .beat { grid-area: beat; opacity: 0; transform: translateY(16px); pointer-events: none; transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out); }
  .js-ready .village[data-beat="1"] .beat--1,
  .js-ready .village[data-beat="2"] .beat--2,
  .js-ready .village[data-beat="3"] .beat--3 { opacity: 1; transform: none; pointer-events: auto; transition-delay: 0.12s; }
  .js-ready .village__progress { display: block; position: relative; width: min(100%, 22rem); height: 2px; margin-top: 2rem; background: rgb(246 238 220 / 0.14); }
  .js-ready .village__progress i { position: absolute; inset: 0; background: var(--brass); transform-origin: left; transform: scaleX(max(0, var(--v))); }
  .js-ready .diorama { opacity: calc(1 - var(--g) * 0.7); }
  .js-ready .camp-stage {
    position: absolute; inset: 0; width: auto; aspect-ratio: auto; margin: 0; border-radius: 0; box-shadow: none;
    --ct: 24%; --cr: 5%; --cb: 22%; --cl: 53%;
    clip-path: inset(calc((1 - var(--g)) * var(--ct)) calc((1 - var(--g)) * var(--cr)) calc((1 - var(--g)) * var(--cb)) calc((1 - var(--g)) * var(--cl)) round calc((1 - var(--g)) * 14px));
    opacity: min(1, var(--g) * 6);
  }
  /* The beat stays readable over the clip. */
  .js-ready .camp-stage::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgb(23 21 28 / 0.88) 0%, rgb(23 21 28 / 0.5) 36%, rgb(23 21 28 / 0) 60%); opacity: var(--g); }
}

/* Heroes: a hero select. The rows are tabs; the chosen one takes its element's colour (--el) and
   its render fades in on the stage. Nothing glows or floats. Without JS the rows stay a plain
   list and the stage shows the Knight. */
.heroes { --el: #f3a057; --focus: var(--el); background: linear-gradient(180deg, var(--ink-deep) 0%, #1b1a22 100%); }
.heroes [data-element="fire"], .heroes[data-element="fire"]     { --el: #f3a057; }
.heroes [data-element="ice"], .heroes[data-element="ice"]       { --el: #9fd6f3; }
.heroes [data-element="arcane"], .heroes[data-element="arcane"] { --el: #b9a3ff; }
.heroes [data-element="nature"], .heroes[data-element="nature"] { --el: #a3d67c; }
.heroes [data-element="shadow"], .heroes[data-element="shadow"] { --el: #c4bad6; }
.heroes__grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: clamp(2rem, 1rem + 4vw, 5.5rem); align-items: center; }
.heroes__stage { position: relative; aspect-ratio: 4 / 5; max-height: calc(100svh - var(--header-h) - 3rem); border-radius: var(--radius-l); overflow: hidden; box-shadow: var(--shadow-frame); background: var(--ink); }
/* A thin line in the chosen element's colour along the foot of the stage. */
.heroes__stage::after { content: ""; position: absolute; inset: auto 0 0; z-index: 2; height: 3px; background: var(--el); transition: background-color 0.6s var(--ease-out); }
.hero-panel { position: absolute; inset: 0; margin: 0; opacity: 0; visibility: hidden; transition: opacity 0.6s var(--ease-out), visibility 0s linear 0.6s; }
.hero-panel.is-active { z-index: 1; opacity: 1; visibility: visible; transition: opacity 0.6s var(--ease-out); }
.hero-panel picture { position: absolute; inset: 0; }
.hero-panel img { width: 100%; height: 100%; object-fit: cover; scale: 1.04; transition: scale 1.4s var(--ease-out); }
.hero-panel.is-active img { scale: 1; }
.hero-panel figcaption {
  position: absolute; inset: auto 0 0; padding: 5rem 1.5rem 1.5rem; background: linear-gradient(0deg, rgb(23 21 28 / 0.88), rgb(23 21 28 / 0));
  font-family: var(--font-display); font-variation-settings: var(--soft); font-weight: 650; font-size: clamp(2rem, 1.4rem + 2vw, 3.25rem); line-height: 1; color: var(--on-dark);
}
.hero-panel__line { display: none; }
.hero-panel__el { display: block; margin-bottom: 0.6rem; font-family: var(--font-body); font-size: 0.75rem; font-weight: 600; letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--el); }
.heroes__copy h2 { margin-top: 1rem; }
.heroes__copy .lead { margin-top: 1.25rem; }
.roster { margin-top: 2.25rem; border-top: 1px solid rgb(246 238 220 / 0.12); }
.roster li { position: relative; display: grid; grid-template-columns: 3.5rem 1fr; gap: 1.1rem; align-items: center; padding: 0.7rem 0; border-bottom: 1px solid rgb(246 238 220 / 0.12); }
.roster__sigil { display: grid; place-items: center; width: 3.5rem; height: 3.5rem; border-radius: var(--radius-m); color: var(--el); background: rgb(from var(--el) r g b / 0.12); box-shadow: inset 0 0 0 1px rgb(from var(--el) r g b / 0.4); }
.roster__sigil svg { width: 2.1rem; height: 2.1rem; }
.roster__el { display: block; font-size: 0.6875rem; font-weight: 600; letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--el); }
.roster h3 { margin-top: 0.15rem; font-size: 1.5rem; }
.roster p { margin-top: 0.2rem; color: var(--on-dark-muted); font-size: 0.975rem; }
/* As tabs: the rows wait in muted ink; the chosen row gets its colour and a mark on the left. */
.roster li[role="tab"] { padding-inline: 1rem 0.5rem; cursor: pointer; border-radius: 0; transition: background-color var(--dur-fast); }
.roster li[role="tab"]::before { content: ""; position: absolute; inset: 0.9rem auto 0.9rem 0; width: 2px; background: var(--el); scale: 1 0; transition: scale 0.45s var(--ease-out); }
.roster li[role="tab"][aria-selected="false"] .roster__sigil { color: var(--on-dark-muted); background: transparent; box-shadow: inset 0 0 0 1px rgb(246 238 220 / 0.14); }
.roster li[role="tab"][aria-selected="false"] .roster__el { color: var(--on-dark-muted); }
.roster li[role="tab"][aria-selected="false"] h3 { color: rgb(246 238 220 / 0.72); }
@media (hover: hover) {
  .roster li[role="tab"]:hover { background: rgb(246 238 220 / 0.03); }
  .roster li[role="tab"][aria-selected="false"]:hover h3 { color: var(--on-dark); }
}
/* On a wide screen the chosen row already names the hero, so the stage shows only the picture. */
@media (min-width: 1001px) {
  .js-ready .hero-panel figcaption { display: none; }
}
.roster li[role="tab"][aria-selected="true"]::before { scale: 1; }
.roster li[role="tab"] .roster__sigil, .roster li[role="tab"] .roster__el, .roster li[role="tab"] h3 { transition: color var(--dur-fast), background-color var(--dur-fast), box-shadow var(--dur-fast); }

/* Clips: short muted loops that play only while on screen (main.js), the poster otherwise. Each
   gets a pause button from main.js (WCAG 2.2.2). */
.clip { position: relative; margin: 0; }
.clip__toggle {
  position: absolute; top: 0.75rem; right: 0.75rem; z-index: 3; display: grid; place-items: center; width: 2.75rem; height: 2.75rem;
  border: 0; border-radius: 50%; background: rgb(23 21 28 / 0.55); color: var(--on-dark); cursor: pointer; opacity: 0.8;
  transition: opacity var(--dur-fast), background-color var(--dur-fast);
}
.clip__toggle:hover, .clip__toggle:focus-visible { opacity: 1; background: rgb(23 21 28 / 0.85); }
.clip__toggle svg { width: 1.1rem; height: 1.1rem; }
.clip video { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-m); background: var(--ink); box-shadow: inset 0 0 0 1px rgb(246 238 220 / 0.1), var(--shadow-frame); }
.clip figcaption { margin-top: 0.8rem; font-size: var(--fs-small); font-weight: 500; color: var(--on-dark-muted); }
.heroes__night { margin-top: clamp(3.5rem, 2rem + 5vw, 7rem); }
.heroes__night video { border-radius: var(--radius-l); }
.heroes__night figcaption { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem 1.25rem; margin-top: 1.1rem; font-size: 1.0625rem; color: var(--on-dark); }
.clips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1.25rem, 0.75rem + 1.5vw, 2.25rem); margin-bottom: clamp(4rem, 3rem + 4vw, 7rem); }
.clip--wide { grid-column: 1 / -1; }
.media__sub { font-size: var(--fs-h3); }
.media > .section__head { max-width: none; }
.media > .section__head p { color: var(--on-dark-muted); }
/* Media runs straight into the wishlist band, which fades in from the same dark. */
.media:has(+ .wishlist) { padding-bottom: 0; }
.media + .wishlist { padding-top: clamp(4rem, 2rem + 5vw, 7rem); }

/* Skills: four marks, each a timing ring with its gold band like the game's (the ring closes as
   the row comes into view), then fishing up close with every fish the game names. */
.skills { background: radial-gradient(ellipse 60% 45% at 88% 0%, rgb(240 199 102 / 0.07), transparent 70%), var(--ink-deep); }
.skill-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(1.5rem, 1rem + 2vw, 3rem); }
.skill:nth-child(2) { --d: 1; }
.skill:nth-child(3) { --d: 2; }
.skill:nth-child(4) { --d: 3; }
.skill__mark { position: relative; display: grid; place-items: center; width: 5rem; height: 5rem; color: var(--on-dark); }
.skill__ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; rotate: -90deg; }
.skill__track { fill: rgb(246 238 220 / 0.04); stroke: rgb(246 238 220 / 0.24); stroke-width: 1.5; }
.skill__band { fill: none; stroke: var(--brass); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 13 87; stroke-dashoffset: -60; }
.skill__icon { position: relative; width: 2.6rem; height: 2.6rem; }
.skill h3 { margin-top: 1.4rem; font-size: 1.625rem; }
.skill p { margin-top: 0.5rem; color: var(--on-dark-muted); }
.js-ready .skill .skill__ring { scale: 1.45; opacity: 0; transition: scale 1.2s var(--ease-out), opacity 0.5s var(--ease-out); transition-delay: calc(var(--d, 0) * 110ms + 0.15s); }
.js-ready .skill.is-in .skill__ring { scale: 1; opacity: 1; }
.js-ready .skill.is-in .skill__band { animation: band-hit 0.7s var(--ease-out) both; animation-delay: calc(var(--d, 0) * 110ms + 1.2s); }
@keyframes band-hit { 40% { stroke-width: 8; stroke: #fff1c4; } }
.skills__note { margin-top: clamp(2rem, 1.5rem + 1.5vw, 3rem); padding-top: 1.25rem; border-top: 1px solid rgb(246 238 220 / 0.12); color: var(--on-dark-muted); }
.fishing { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(2rem, 1rem + 4vw, 5rem); align-items: center; margin-top: clamp(4rem, 3rem + 4vw, 7rem); }
.fishing__shot { margin: 0; border-radius: var(--radius-l); overflow: hidden; background: var(--ink); box-shadow: inset 0 0 0 1px rgb(246 238 220 / 0.1), var(--shadow-frame); }
.fishing__shot img { width: 100%; aspect-ratio: 16 / 11; object-fit: cover; object-position: 30% 50%; }
.fishing h3 { margin-top: 1rem; font-size: clamp(2rem, 1.4rem + 2vw, 3rem); }
.fishing__copy > p { margin-top: 1rem; color: var(--on-dark-muted); }
.fishing__copy > p + p { margin-top: 0.6rem; color: var(--on-dark); font-weight: 500; }
.fish { margin: 1.75rem 0 0; border-top: 1px solid rgb(246 238 220 / 0.12); }
.fish div { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); column-gap: 1rem; row-gap: 0.15rem; padding: 0.85rem 0; border-bottom: 1px solid rgb(246 238 220 / 0.12); }
.fish dt { grid-row: span 2; padding-top: 0.2rem; font-size: 0.75rem; font-weight: 600; letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--ghost); }
.fish dd { margin: 0; color: var(--on-dark); }
.fish__rare { display: flex; align-items: center; gap: 0.55rem; font-weight: 600; color: var(--brass) !important; }
.fish__rare::before { content: ""; flex: none; width: 0.5rem; height: 0.5rem; border-radius: 1px; background: var(--brass); rotate: 45deg; }
.fish__rare small { padding: 0.05rem 0.45rem; border-radius: 999px; font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brass); box-shadow: inset 0 0 0 1px rgb(240 199 102 / 0.45); }

/* The island: cream paper like the captain's notes. One large view of the whole island, two
   places beside it, then short field notes. */
.island { background: var(--cream); color: var(--on-cream); }
.island .label { color: var(--brass-ink); }
.island .lead { color: var(--on-cream-muted); }
.places { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); gap: clamp(1rem, 0.5rem + 1.5vw, 1.75rem); }
.place { position: relative; margin: 0; border-radius: var(--radius-l); overflow: hidden; background: var(--ink); box-shadow: var(--shadow-frame); }
.place--map { grid-row: span 2; }
.place picture { height: 100%; }
.place img { width: 100%; height: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.place--map img { aspect-ratio: auto; min-height: 22rem; }
.place figcaption { position: absolute; inset: auto 0 0; padding: 4.5rem 1.25rem 1.1rem; background: linear-gradient(0deg, rgb(23 21 28 / 0.86), rgb(23 21 28 / 0)); color: var(--on-dark); }
.place h3 { font-size: 1.375rem; }
.place--map h3 { font-size: clamp(1.5rem, 1.2rem + 1vw, 2.125rem); }
.place figcaption p { max-width: 30rem; margin-top: 0.35rem; font-size: 0.9375rem; line-height: 1.5; color: var(--on-dark-muted); }
.place--map figcaption { padding: 6rem clamp(1.25rem, 1rem + 1vw, 2rem) clamp(1.1rem, 1rem + 0.5vw, 1.6rem); }
.notes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(1.25rem, 1rem + 1.5vw, 2.5rem); margin-top: clamp(2.5rem, 2rem + 2vw, 4rem); }
.notes li { padding-top: 1.1rem; border-top: 1px solid var(--cream-deep); }
.notes li:nth-child(2) { --d: 1; }
.notes li:nth-child(3) { --d: 2; }
.notes li:nth-child(4) { --d: 3; }
.notes h3 { display: flex; align-items: center; gap: 0.6rem; font-size: 1.3rem; }
.notes h3::before { content: ""; flex: none; width: 0.55rem; height: 0.55rem; border-radius: 1px; background: var(--brass-deep); rotate: 45deg; }
.notes p { margin-top: 0.5rem; color: var(--on-cream); }
kbd { padding: 0.05rem 0.45rem; border-radius: 0.3rem; font-family: var(--font-body); font-size: 0.8125em; font-weight: 600; background: #fbf4e6; box-shadow: inset 0 0 0 1px var(--cream-deep), 0 2px 0 var(--cream-deep); }

/* Gear: the smith beside the material ladder; the six marks drop in one by one. */
.gear { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 1rem + 4vw, 5rem); align-items: center; margin-top: clamp(4rem, 3rem + 4vw, 7rem); }
.gear__shot { margin: 0; border-radius: var(--radius-l); overflow: hidden; background: var(--ink); box-shadow: inset 0 0 0 1px rgb(246 238 220 / 0.1), var(--shadow-frame); }
.gear__shot img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: 58% 50%; }
.gear h3 { margin-top: 1rem; font-size: clamp(2rem, 1.4rem + 2vw, 3rem); }
.gear__copy > p { margin-top: 1rem; color: var(--on-dark-muted); }
.ladder { position: relative; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin: 2rem 0 0; padding: 0; list-style: none; }
.ladder::before { content: ""; position: absolute; left: calc(100% / 12); right: calc(100% / 12); top: 0.62rem; height: 2px; background: linear-gradient(90deg, #a8774a, #a7a49c, #7d8792, #d9dde3, var(--brass), #9ff0f2); opacity: 0.55; }
.ladder__step { position: relative; display: grid; justify-items: center; gap: 0.7rem; font-size: 0.8125rem; font-weight: 600; text-align: center; color: var(--on-dark-muted); }
.ladder__step i { width: 1.25rem; height: 1.25rem; border-radius: 3px; rotate: 45deg; background: var(--m); box-shadow: 0 2px 0 rgb(20 15 26 / 0.6), inset 0 0 0 1px rgb(255 255 255 / 0.25); }
.ladder__step--wood { --m: #a8774a; --n: 0; }
.ladder__step--stone { --m: #a7a49c; --n: 1; }
.ladder__step--iron { --m: #7d8792; --n: 2; }
.ladder__step--silver { --m: #d9dde3; --n: 3; }
.ladder__step--gold { --m: var(--brass); --n: 4; color: var(--brass); }
.ladder__step--diamond { --m: #9ff0f2; --n: 5; color: var(--on-dark); }
.js-ready .gear__copy .ladder__step i { scale: 0; transition: scale 0.55s var(--ease-out); transition-delay: calc(0.45s + var(--n) * 0.09s); }
.js-ready .gear__copy.is-in .ladder__step i { scale: 1; }
.gear__note { margin-top: 1.6rem; font-size: var(--fs-small); color: var(--on-dark-muted); }

/* Ways to play: "Start here" over the story, "Then choose" over the two endings, a line under
   each label tying its cards together. */
.modes { background: #1b1a22; }
.modes__grid { --gap: clamp(1rem, 0.5rem + 1.5vw, 1.75rem); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.modes__col--then { grid-column: span 2; }
.modes__col { display: grid; grid-template-rows: auto 1fr; gap: 1rem; }
.modes__pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.modes__step { display: flex; align-items: center; gap: 0.9rem; font-size: 0.75rem; font-weight: 600; letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--on-dark-muted); }
.modes__step::after { content: ""; flex: 1; height: 1px; background: rgb(246 238 220 / 0.16); }
.mode { display: flex; flex-direction: column; border-radius: var(--radius-l); overflow: hidden; background: rgb(246 238 220 / 0.035); box-shadow: inset 0 0 0 1px rgb(246 238 220 / 0.1), var(--shadow-frame); }
.mode img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.mode__body { padding: 1.35rem 1.5rem 1.6rem; }
.mode__tag { font-size: 0.75rem; font-weight: 600; letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--brass); }
.mode--night .mode__tag { color: var(--ghost); }
.mode h3 { margin-top: 0.45rem; font-size: 1.75rem; }
.mode p { margin-top: 0.6rem; color: var(--on-dark-muted); }
.mode--story { box-shadow: inset 0 0 0 1px rgb(240 199 102 / 0.4), var(--shadow-frame); }
.modes__pair .mode:nth-child(2) { --d: 1; }
/* The village builder sits apart, on its own row: its picture as wide as one card above. */
.modes__col--alt { grid-column: 1 / -1; margin-top: clamp(1rem, 0.5rem + 1.5vw, 2rem); }
.mode--builder { display: grid; grid-template-columns: calc((100% - 2 * var(--gap)) / 3) minmax(0, 1fr); }
.mode--builder picture { height: 100%; }
.mode--builder img { height: 100%; aspect-ratio: auto; min-height: 14rem; }
.mode--builder .mode__body { align-self: center; max-width: 42rem; padding: 1.6rem clamp(1.5rem, 1rem + 1.5vw, 2.5rem); }

/* Story: the cream paper section, like the game's notes, with the two story clips beside the text. */
.story { background: var(--cream); color: var(--on-cream); }
.story .label { color: var(--brass-ink); }
.story__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(2rem, 1rem + 4vw, 5rem); align-items: center; }
.story__mark { width: 4rem; margin-bottom: 1.5rem; filter: drop-shadow(0 3px 0 rgb(20 15 26 / 0.25)); }
.story h2 { margin-top: 1rem; }
.story__text { margin-top: 2rem; display: grid; gap: 1.25rem; font-size: 1.125rem; color: var(--on-cream); max-width: 36rem; }
.story__text p:first-child::first-letter {
  float: left; margin: 0.08em 0.12em 0 0; font-family: var(--font-display); font-variation-settings: var(--soft);
  font-weight: 700; font-size: 3.6em; line-height: 0.8; color: var(--brass-deep);
}
.story__shot { position: relative; margin: 0; aspect-ratio: 4 / 3; border-radius: var(--radius-l); overflow: hidden; background: var(--ink); box-shadow: var(--shadow-frame); }
/* The two story clips play in turn (main.js): the ghosts out of the fog, then the lighthouse lit. */
.story__shot video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 40% 50%; opacity: 0; transition: opacity 0.9s var(--ease-out); }
.story__shot video.is-on { opacity: 1; }
.story__facts { margin-top: clamp(2.5rem, 2rem + 2vw, 4rem); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--cream-deep); border: 1px solid var(--cream-deep); border-radius: var(--radius-m); overflow: hidden; }
.story__facts div { background: var(--cream); padding: 1.1rem 1.25rem; }
.story__facts dt { font-size: 0.75rem; font-weight: 600; letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--on-cream-muted); }
.story__facts dd { margin: 0.35rem 0 0; font-weight: 500; color: var(--on-cream); line-height: 1.4; }

/* Media: a film rail. Native horizontal scroll with snap, drag on desktop, arrows. */
.media { overflow: hidden; }
.media__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; margin-bottom: clamp(2rem, 1.5rem + 2vw, 3.5rem); }
.rail-nav { display: flex; gap: 0.5rem; }
.rail-nav[hidden] { display: none; }
.rail {
  --pad: max(var(--gutter), (100vw - var(--max)) / 2);
  display: flex; gap: clamp(0.75rem, 0.5rem + 1vw, 1.5rem); margin: 0; padding: 0.5rem var(--pad) 1.25rem; list-style: none;
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding-inline: var(--pad); scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.rail.is-dragging { scroll-snap-type: none; cursor: grabbing; }
.rail.is-dragging .thumb { cursor: grabbing; }
.rail__item { flex: none; width: clamp(17rem, 58vw, 56rem); scroll-snap-align: start; }
/* Frames far to the right are not rendered, so their shots load only as the rail nears them. */
.rail__item { content-visibility: auto; contain-intrinsic-size: auto clamp(9.5rem, 32.6vw, 31.5rem); }
.thumb {
  position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; padding: 0; border: 0; cursor: zoom-in;
  border-radius: var(--radius-m); overflow: hidden; background: var(--ink); box-shadow: inset 0 0 0 1px rgb(246 238 220 / 0.1), var(--shadow-frame);
}
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: scale 0.7s var(--ease-out); }
.thumb:hover img { scale: 1.035; }

/* Lightbox (native dialog, the screenshot morphs in from the grid) */
/* The dialog shrinks to the picture, so the caption lines up with the image edge. */
.lightbox { width: fit-content; max-width: min(100vw - 2rem, 96rem); max-height: calc(100vh - 2rem); padding: 0; border: 0; background: transparent; color: var(--on-dark); overflow: visible; }
.lightbox::backdrop { background: rgb(23 21 28 / 0.94); }
.lightbox__img { width: auto; max-width: 100%; max-height: calc(100vh - 7.5rem); object-fit: contain; border-radius: var(--radius-m); background: var(--ink-night); }
.lightbox__bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 0.9rem; }
.lightbox__caption { font-size: var(--fs-small); color: var(--on-dark-muted); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lightbox__controls { display: flex; gap: 0.5rem; }
.icon-btn { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border: 0; border-radius: 50%; background: rgb(246 238 220 / 0.1); color: var(--on-dark); cursor: pointer; transition: background-color var(--dur-fast); }
.icon-btn:hover { background: rgb(246 238 220 / 0.2); }
.icon-btn svg { width: 1.2rem; height: 1.2rem; }
/* Entry with @starting-style: it plays once on open and does not replay when the morph class
   is removed (a keyframe animation did, which made the picture blink after the morph). */
.lightbox { transition: opacity var(--dur-med) var(--ease-out), transform var(--dur-med) var(--ease-out); }
@starting-style { .lightbox[open] { opacity: 0; transform: scale(0.98); } }
.vt-shot .lightbox { transition: none; }
::view-transition-group(shot) { animation-duration: 520ms; animation-timing-function: var(--ease-out); }
::view-transition-old(shot), ::view-transition-new(shot) { height: 100%; object-fit: cover; }

/* Wishlist band */
.wishlist { position: relative; padding-block: clamp(7rem, 5rem + 10vw, 13rem); text-align: center; overflow: hidden; isolation: isolate; }
.wishlist__bg { position: absolute; inset: 0; z-index: -1; }
.wishlist__bg img { width: 100%; height: 100%; object-fit: cover; }
.wishlist__bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, var(--ink-deep), transparent 35%), linear-gradient(0deg, var(--ink-deep), transparent 30%), radial-gradient(ellipse at 50% 55%, rgb(23 21 28 / 0.4) 0%, rgb(23 21 28 / 0.8) 72%); }
.wishlist__logo { width: min(78vw, 30rem); margin: 0 auto; }
.wishlist h2 { margin-top: 1.75rem; font-size: clamp(1.75rem, 1.3rem + 2vw, 3rem); }
.wishlist p { margin: 1rem auto 0; max-width: 34rem; color: var(--on-dark-muted); }
.wishlist .btn { margin-top: 2rem; }
/* The fog comes back: two banks drift across the dusk shot. */
.wishlist__fog { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent); mask-image: linear-gradient(180deg, #000 70%, transparent); }
/* Same build as the opening fog: a still masked bank, only the texture inside moves. */
.wishlist__bank {
  position: absolute; left: 0; right: 0; bottom: -6%; height: 70%; overflow: hidden; opacity: 0.5;
  -webkit-mask-image: linear-gradient(to top, #000 35%, transparent 100%);
  mask-image: linear-gradient(to top, #000 35%, transparent 100%);
}
.wishlist__bank--b { bottom: 18%; height: 60%; opacity: 0.32; }
.wishlist__bank i {
  position: absolute; left: 0; top: 0; bottom: 0; width: 300vw;
  background: url("../assets/images/fog-a-v2.webp") repeat-x left bottom / 200vw 100%;
  animation: fog-drift 80s linear infinite;
}
.wishlist__bank--b i { background-image: url("../assets/images/fog-b-v2.webp"); animation-duration: 130s; animation-direction: reverse; }

/* Newsletter signup in the wishlist band. The honeypot field sits off screen. */
.signup { max-width: 32rem; margin: 3rem auto 0; padding-top: 2.5rem; border-top: 1px solid rgb(246 238 220 / 0.14); }
.signup > p:first-child { margin-top: 0; }
.signup .signup__row { display: flex; gap: 0.6rem; margin-top: 1.25rem; }
.signup input[type="email"] {
  flex: 1; min-width: 0; min-height: 3.25rem; padding: 0.75rem 1rem;
  border: 0; border-radius: var(--radius-s);
  background: rgb(23 21 28 / 0.55); box-shadow: inset 0 0 0 1.5px rgb(246 238 220 / 0.4);
  color: var(--on-dark); font: inherit;
}
.signup input[type="email"]::placeholder { color: var(--on-dark-muted); opacity: 1; }
.signup .btn { margin-top: 0; flex: none; }
.signup .signup__note { margin-top: 0.85rem; font-size: var(--fs-small); }
.signup .signup__note a { color: var(--on-dark); text-underline-offset: 0.15em; }
.signup .signup__status { margin-top: 0.85rem; font-weight: 500; color: var(--ghost); }
.signup .signup__status:empty { display: none; }
.signup.is-error .signup__status { color: #ffb4a2; }
.signup__trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* FAQ */
.faq { background: var(--cream); color: var(--on-cream); }
.faq .label { color: var(--brass-ink); }
.faq__grid { display: grid; grid-template-columns: 1fr 1.6fr; gap: clamp(2rem, 1rem + 4vw, 6rem); align-items: start; }
.faq__grid .section__head { margin-bottom: 0; position: sticky; top: calc(var(--header-h) + 2rem); }
.faq__grid .section__head p { color: var(--on-cream-muted); }
.faq__grid .section__head a { position: relative; color: var(--ghost-deep); font-weight: 500; }
.faq__grid .section__head a::after { content: ""; position: absolute; inset: -0.75rem -0.25rem; }
.qa { border-top: 1px solid var(--cream-deep); }
.qa details { border-bottom: 1px solid var(--cream-deep); }
.qa summary {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.25rem 0; cursor: pointer; list-style: none;
  font-family: var(--font-display); font-variation-settings: var(--soft); font-weight: 600; font-size: 1.25rem; line-height: 1.3;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: ""; flex: none; width: 0.7rem; height: 0.7rem; margin-right: 0.2rem; border-right: 2px solid var(--brass-deep); border-bottom: 2px solid var(--brass-deep); transform: translateY(-25%) rotate(45deg); transition: transform var(--dur-med) var(--ease-out); }
.qa details[open] summary::after { transform: translateY(15%) rotate(225deg); }
.qa details p { padding: 0 2.5rem 1.4rem 0; color: var(--on-cream-muted); }

/* Footer */
.site-footer { background: var(--ink); color: var(--on-dark-muted); padding-block: 3.5rem 2.5rem; font-size: var(--fs-small); }
.site-footer__top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem 3rem; padding-bottom: 2rem; border-bottom: 1px solid rgb(246 238 220 / 0.12); }
.site-footer__brand img { height: 2.75rem; width: auto; }
.site-footer__brand p { margin-top: 0.6rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0 1.75rem; }
.site-footer a { text-decoration: none; color: var(--on-dark); }
.site-footer nav a { display: inline-flex; align-items: center; min-height: 2.75rem; padding-inline: 0.625rem; margin-inline: -0.625rem; }
.site-footer a:hover { color: var(--brass); }
.site-footer__legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem 2rem; padding-top: 1.5rem; font-size: 0.8125rem; }

/* Press kit */
.press-hero { position: relative; padding: calc(var(--header-h) + clamp(4rem, 3rem + 6vw, 8rem)) 0 clamp(3.5rem, 2rem + 5vw, 6rem); overflow: hidden; isolation: isolate; }
.press-hero__bg { position: absolute; inset: 0; z-index: -1; }
.press-hero__bg img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 60%; }
.press-hero__bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgb(23 21 28 / 0.9), rgb(23 21 28 / 0.55) 60%, rgb(23 21 28 / 0.35)), linear-gradient(0deg, rgb(23 21 28 / 0.7), transparent 50%); }
.press-hero h1 { margin-top: 1rem; font-size: var(--fs-mega); }
.press-hero .lead { margin-top: 1rem; color: var(--on-dark); }
.press { background: var(--cream); color: var(--on-cream); }
.press__grid { display: grid; grid-template-columns: 22rem 1fr; gap: clamp(2rem, 1rem + 4vw, 5rem); align-items: start; }
.press__h { font-size: 1.625rem; margin-bottom: 1rem; }
.press__facts { position: sticky; top: calc(var(--header-h) + 1.5rem); padding: 1.75rem; border-radius: var(--radius-m); background: #fbf4e6; box-shadow: inset 0 0 0 1px var(--cream-deep), var(--shadow-hard-low); }
.press__facts dl { margin: 0; }
.press__facts div { padding: 0.7rem 0; border-top: 1px solid var(--cream-deep); }
.press__facts dt { font-size: 0.75rem; font-weight: 600; letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--on-cream-muted); }
.press__facts dd { margin: 0.2rem 0 0; font-weight: 500; line-height: 1.45; }
.press__body { display: grid; gap: clamp(2.5rem, 2rem + 2vw, 3.5rem); }
.press__body p + p { margin-top: 1rem; }
.press__body p { color: var(--on-cream); }
.press__list { display: grid; gap: 0.6rem; }
.press__list li { position: relative; padding-left: 1.5rem; }
.press__list li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 0.5rem; height: 0.5rem; border-radius: 2px; background: var(--brass-deep); transform: rotate(45deg); }
.press__heroes { margin: 0; display: grid; gap: 0.75rem; }
.press__heroes dt { font-family: var(--font-display); font-variation-settings: var(--soft); font-weight: 650; font-size: 1.125rem; }
.press__heroes dd { margin: 0.1rem 0 0; color: var(--on-cream-muted); }
.downloads { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
.download { display: grid; gap: 0.2rem; height: 100%; padding: 1.1rem 1.25rem; border-radius: var(--radius-s); background: #fbf4e6; box-shadow: inset 0 0 0 1px var(--cream-deep), var(--shadow-hard-low); text-decoration: none; transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast); }
.download:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px var(--brass-deep), var(--shadow-hard); }
.download__name { font-weight: 600; color: var(--on-cream); }
.download__meta { font-size: var(--fs-small); color: var(--on-cream-muted); }
.press__note { margin-top: 1.25rem; font-size: var(--fs-small); color: var(--on-cream-muted) !important; }
.press-page .site-footer { padding-block: 1.75rem; }
.press-page .site-footer__legal { padding-top: 0; }

/* Legal pages (terms, privacy, cookies): one hub with tabs, a sticky side with the key facts and
   the contents, and every section opening with a one-line "In short" in plain words. */
.legal-hero h1 { font-size: clamp(2.75rem, 1.6rem + 5vw, 5.5rem); }
.legal-tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 2rem; }
.legal-tabs a {
  display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0.5rem 1.1rem; border-radius: 999px;
  font-weight: 600; font-size: 0.9375rem; text-decoration: none; color: var(--on-dark);
  background: rgb(23 21 28 / 0.55); box-shadow: inset 0 0 0 1px rgb(246 238 220 / 0.3);
  transition: background-color var(--dur-fast), color var(--dur-fast);
}
.legal-tabs a:hover { background: rgb(246 238 220 / 0.14); }
.legal-tabs a[aria-current="page"] { background: var(--brass); color: var(--ink-deep); box-shadow: none; }
.legal__grid { display: grid; grid-template-columns: 20rem minmax(0, 1fr); gap: clamp(2rem, 1rem + 4vw, 5rem); align-items: start; }
.legal__side { position: sticky; top: calc(var(--header-h) + 1.5rem); display: grid; gap: 1.25rem; }
.legal__facts { position: static; }
.legal__toc { padding: 1.25rem 1.5rem; border-radius: var(--radius-m); box-shadow: inset 0 0 0 1px var(--cream-deep); }
.legal__toc-title { display: block; font-size: 0.75rem; font-weight: 600; letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--on-cream-muted); }
.legal__toc ol { margin: 0.75rem 0 0; padding: 0; list-style: none; counter-reset: toc; display: grid; gap: 0.15rem; }
.legal__toc li { counter-increment: toc; }
.legal__toc a { display: flex; gap: 0.6rem; padding: 0.3rem 0; font-size: 0.9375rem; font-weight: 500; text-decoration: none; color: var(--on-cream); }
.legal__toc a::before { content: counter(toc, decimal-leading-zero); font-family: var(--font-display); font-variation-settings: var(--soft); font-weight: 650; color: var(--brass-ink); }
.legal__toc a:hover { color: var(--ghost-deep); }
.legal__body { display: grid; gap: clamp(2.5rem, 2rem + 2vw, 3.5rem); max-width: 46rem; min-width: 0; }
.legal__sec { min-width: 0; scroll-margin-top: calc(var(--header-h) + 1.5rem); }
.legal__sec h2 { display: flex; align-items: baseline; gap: 0.8rem; font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.25rem); }
.legal__n { font-size: 0.55em; color: var(--brass-ink); }
.legal__sec > p, .legal__sec > ul, .legal__sec > .legal__table { margin-top: 1rem; }
.legal__sec p { color: var(--on-cream); }
.tldr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.75rem; margin-top: 1rem; padding: 0.9rem 1.1rem; border-radius: var(--radius-s); background: #fbf4e6; box-shadow: inset 3px 0 0 var(--brass-deep), inset 0 0 0 1px var(--cream-deep); font-weight: 600; }
.tldr span { font-size: 0.75rem; letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--brass-ink); }
.legal__list { display: grid; gap: 0.6rem; padding: 0; list-style: none; }
.legal__list li { position: relative; padding-left: 1.5rem; color: var(--on-cream); }
.legal__list li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 0.5rem; height: 0.5rem; border-radius: 2px; background: var(--brass-deep); transform: rotate(45deg); }
.legal__table { overflow-x: auto; border-radius: var(--radius-m); box-shadow: inset 0 0 0 1px var(--cream-deep); }
.legal__table table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.legal__table th, .legal__table td { padding: 0.8rem 1rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--cream-deep); }
.legal__table th { font-size: 0.75rem; font-weight: 600; letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--on-cream-muted); background: #fbf4e6; }
.legal__table tr:last-child td { border-bottom: 0; }
.legal__table td:first-child { font-weight: 600; }
.legal .footer-link, .legal__body a, .legal__facts a { color: var(--ghost-deep); font-weight: 500; text-decoration: underline; text-underline-offset: 0.15em; }
/* The cookie banner links to the cookie policy. */
#piskotki-gdpr .piskotki-gdpr-main-text a { color: inherit; text-decoration: underline; text-underline-offset: 0.15em; }

/* 404 */
.lost { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(ellipse at 50% 40%, var(--ink) 0%, var(--ink-deep) 70%); text-align: center; padding: var(--gutter); }
.lost__inner img { width: 5rem; margin: 0 auto 1.5rem; }
.lost__inner h1 { font-size: var(--fs-h2); }
.lost__inner p { margin: 1rem 0 2rem; color: var(--on-dark-muted); }

/* Reveal on scroll, armed only when JS runs */
.js-ready [data-reveal] { opacity: 0; transform: translateY(22px); transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out); transition-delay: calc(var(--d, 0) * 110ms); }
.js-ready [data-reveal].is-in { opacity: 1; transform: none; }

/* Tablet */
@media (max-width: 1000px) {
  .nav-toggle { display: inline-flex; }
  .nav__links {
    position: absolute; inset: 100% 0 auto; display: none; flex-direction: column; align-items: stretch; gap: 0;
    padding: 0.5rem max(var(--gutter), env(safe-area-inset-right, 0px)) 1.25rem max(var(--gutter), env(safe-area-inset-left, 0px)); background: rgb(33 30 39 / 0.98); box-shadow: 0 1px 0 rgb(246 238 220 / 0.08), var(--shadow-hard);
  }
  .nav__links a { margin-inline: 0; padding: 0.9rem 0; font-size: 1.0625rem; color: var(--on-dark); border-bottom: 1px solid rgb(246 238 220 / 0.08); }
  .site-header.is-open { background: rgb(33 30 39 / 0.98); }
  .site-header.is-open .nav__links { display: flex; }
  /* A phone on its side is shorter than the menu: the panel scrolls instead of running off the screen. */
  .nav__links { max-height: calc(100vh - var(--header-h)); max-height: calc(100svh - var(--header-h)); overflow-y: auto; overscroll-behavior: contain; }
  .village__layout { grid-template-columns: 1fr; }
  .diorama { max-width: 40rem; margin-inline: auto; }
  /* The tabs sit right under the stage as a strip of five sigils; the chosen hero's line moves
     into the stage caption, so a tap never sends the picture off the screen. */
  .heroes__grid { grid-template-columns: 1fr; gap: 0; }
  .heroes__copy { display: contents; }
  .heroes__copy header { order: 1; margin-bottom: 2.25rem; }
  .heroes__stage { order: 2; aspect-ratio: 4 / 3; }
  .hero-panel img { object-position: 50% 38%; }
  .heroes .roster { order: 3; }
  .roster[role="tablist"] { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.4rem; margin-top: 0.9rem; border: 0; }
  .roster[role="tablist"] li { grid-template-columns: 1fr; justify-items: center; gap: 0.45rem; padding: 0.6rem 0 0.75rem; border: 0; border-radius: var(--radius-m); text-align: center; }
  .roster[role="tablist"] li::before { inset: auto 28% 0; width: auto; height: 2px; scale: 0 1; }
  .roster[role="tablist"] li[aria-selected="true"]::before { scale: 1; }
  .roster[role="tablist"] .roster__el, .roster[role="tablist"] p { display: none; }
  .roster[role="tablist"] h3 { margin: 0; font-family: var(--font-body); font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.02em; }
  .js-ready .hero-panel figcaption { font-size: clamp(1.75rem, 1.3rem + 2vw, 2.5rem); }
  .js-ready .hero-panel__line { display: block; max-width: 34rem; margin-top: 0.6rem; font-family: var(--font-body); font-size: 0.9375rem; font-weight: 400; line-height: 1.5; color: var(--on-dark-muted); }
  .story__grid { grid-template-columns: 1fr; }
  .story__shot { aspect-ratio: 16 / 10; }
  .faq__grid { grid-template-columns: 1fr; }
  .faq__grid .section__head { position: static; }
  .press__grid { grid-template-columns: 1fr; }
  .legal__grid { grid-template-columns: minmax(0, 1fr); }
  .legal__side { position: static; }
  .press__facts { position: static; }
}

/* Phone */
@media (max-width: 640px) {
  /* Phones in portrait see a narrow slice: aim each picture at the hero and the ghosts.
     Story text sits at the top here, so steps fade as soon as they start to move up. */
  .nightfall { --fade-at: 0.004; --fade-k: 30; --q-k: 14; }
  .hero-meta span + span::before { content: none; }
  .step .hero-meta { column-gap: 1.1rem; }
  :root { --header-h: 4rem; }
  .brand img { height: 2rem; }
  .btn__long { display: none; }
  .btn__short { display: inline; }
  /* Story steps sit at the top on a phone so the square, the hero and the ghosts stay visible below. */
  .step:not(.step--hero) { align-items: flex-start; padding-top: calc(var(--header-h) + 1.5rem); }
  .step h2 { font-size: clamp(2.6rem, 2rem + 6vw, 3.5rem); }
  .nightfall__side { background: linear-gradient(180deg, rgb(23 21 28 / 0.94) 0%, rgb(23 21 28 / 0.62) 40%, rgb(23 21 28 / 0) 66%); }
  .hero-actions .btn { flex: 1 1 100%; }
  .story__facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rail__item { width: 84vw; }
  .media__head { display: block; }
  .rail-nav { display: none; }

  .downloads { grid-template-columns: 1fr; }
  .signup .signup__row { flex-direction: column; }
  .lightbox { max-width: 100vw; max-height: 100vh; }
  .lightbox__bar { padding-inline: 1rem; }
}

/* Phones on their side: the logo sizes by the height so the buttons stay on the first screen. */
@media (orientation: landscape) and (max-height: 540px) {
  .step--hero { padding-top: calc(var(--header-h) + 0.75rem); }
  .hero-logo { width: min(90vw, 52rem, 80svh); }
  .step .hero-tagline { margin-top: 0.9rem; }
  .step .hero-pitch { display: none; }
  .hero-actions { margin-top: 1.25rem; }
  .step .hero-meta { margin-top: 0.9rem; }
  .step h2 { font-size: clamp(2.5rem, 12svh, 3.5rem); }
  .nav__links a { padding-block: 0.5rem; }
}

/* Pinned village below 1000 px: the diorama sits at the top of the stage and the copy at the
   bottom; the camp clip opens from the diorama and the copy stays readable over its foot. */
@media (max-width: 1000px) and (min-height: 541px) and (prefers-reduced-motion: no-preference) {
  .js-ready .village__stage { align-items: stretch; padding: 0; }
  .js-ready .village__layout { display: flex; flex-direction: column; padding-block: calc(var(--header-h) + 0.5rem) 1.25rem; }
  .js-ready .diorama { order: -1; flex: none; align-self: center; width: min(100%, (100svh - 24rem) * 1.25, 46rem); }
  .js-ready .piece--windmill { --x: 0%; }
  .js-ready .piece--villager-3 { --x: 76%; }
  .js-ready .village__copy { margin-top: auto; }
  .js-ready .village__head .lead { display: none; }
  .js-ready .village__head h2 { font-size: clamp(1.9rem, 1.2rem + 3vw, 2.75rem); }
  .js-ready .village__beats { margin-top: 1rem; }
  .js-ready .village__progress { margin-top: 1rem; }
  .js-ready .camp-stage { --ct: 11%; --cr: 6%; --cb: 50%; --cl: 6%; }
  .js-ready .camp-stage::after { background: linear-gradient(0deg, rgb(23 21 28 / 0.92) 0%, rgb(23 21 28 / 0.6) 34%, rgb(23 21 28 / 0) 58%); }
}
/* Phones on their side: copy and diorama side by side again, the diorama sized by the height. */
@media (orientation: landscape) and (max-height: 540px) and (prefers-reduced-motion: no-preference) {
  .js-ready .village__stage { padding-block: calc(var(--header-h) + 0.5rem) 0.75rem; }
  .js-ready .village__layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 1.5rem; }
  .js-ready .village__head .lead { display: none; }
  .js-ready .village__head h2 { font-size: clamp(1.5rem, 1rem + 4svh, 2.25rem); }
  .js-ready .village__beats { margin-top: 0.75rem; }
  .js-ready .beat p { font-size: 0.9375rem; }
  .js-ready .village__progress { margin-top: 0.75rem; }
  .js-ready .diorama { width: min(100%, (100svh - var(--header-h) - 1.5rem) * 1.25); justify-self: center; }
  .js-ready .camp-stage { --ct: 14%; --cr: 3%; --cb: 6%; --cl: 52%; }
}
/* Phones: six larger pieces instead of eleven small ones. */
@media (max-width: 640px) and (prefers-reduced-motion: no-preference) {
  .js-ready .piece--rabbit, .js-ready .piece--duck, .js-ready .piece--deer, .js-ready .piece--cow, .js-ready .piece--villager-2 { display: none; }
  .js-ready .beat { padding-left: 0; }
  .js-ready .beat__n { position: static; display: block; margin-bottom: 0.35rem; }
  .js-ready .beat__n::after { content: none; }
}

@media (prefers-reduced-motion: reduce) {
  .layer img, .layer video { transform: none; }
  .fog, .wishlist__bank i { animation: none; }
  .scroll-cue i { animation: none; }
  .js-ready [data-reveal], .js-ready .hero-logo, .js-ready .hero-tagline span, .js-ready .hero-actions, .js-ready .hero-meta, .js-ready .hero-pitch, .js-ready .scroll-cue { opacity: 1; transform: none; clip-path: none; transition: none; }
  .js-ready .skill .skill__ring, .js-ready .gear__copy .ladder__step i { scale: 1; opacity: 1; transition: none; }
  .js-ready .skill.is-in .skill__band { animation: none; }
  .thumb img { transition: none; }
  .hero-panel, .hero-panel img, .story__shot video { transition: none; }
  .lightbox { transition: none; }
  .layer--day { animation: none; }
  .fog-curtain { transform: none; }
}

@media (forced-colors: active) {
  .fog, .fog-curtain, .nightfall__grade, .nightfall__shade, .nightfall__vignette, .nightfall__side, .scroll-cue i, .label::before, .piece::after, .village__night, .village__fog, .wishlist__fog { display: none; }
  .btn, .clip__toggle { border: 1px solid ButtonText; }
  .skill__track, .skill__band { stroke: CanvasText; }
  .ladder__step i, .fish__rare::before, .notes h3::before { forced-color-adjust: none; }
  .mode { border: 1px solid CanvasText; }
  .roster li[aria-selected="true"] { outline: 2px solid Highlight; outline-offset: -2px; }
  .roster li[role="tab"]::before { display: none; }
}

@media (orientation: portrait) {
  .layer--dusk { --ox: 72%; }
  .layer--hero { --ox: 60%; }
}

/* Footer "Cookie settings": a button that looks like the footer links. */
.footer-link { padding: 0; border: 0; background: none; font: inherit; color: var(--on-dark); cursor: pointer; text-decoration: none; }
.footer-link:hover { color: var(--brass); }

/* Mail links on the cream sections: the brand's dark teal, underlined. */
.qa details a, .press__body a, .press__facts a { color: var(--ghost-deep); font-weight: 500; text-underline-offset: 0.15em; }
.press__body .footer-link { color: var(--ghost-deep); font-weight: 500; text-decoration: underline; text-underline-offset: 0.15em; }

/* Social links: icon buttons with 44 px targets; in the footer of every page. */
.social { display: flex; flex-wrap: wrap; gap: 0.15rem; margin: 0.75rem 0 0 -0.7rem; }
.site-footer .social a { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: var(--radius-s); color: var(--on-dark-muted); transition: color var(--dur-fast), background-color var(--dur-fast); }
.site-footer .social a:hover { color: var(--on-dark); background: rgb(246 238 220 / 0.08); }
.social svg { width: 1.2rem; height: 1.2rem; }
.site-footer__legal .social { margin: -0.6rem auto -0.6rem -0.7rem; }

/* Wishlist band: until the Steam page exists the news signup is the main action, Discord below it. */
.wishlist .signup { margin-top: 1.75rem; padding-top: 0; border-top: 0; }
.wishlist__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.9rem; margin-top: 2rem; }
.wishlist .wishlist__actions .btn { margin-top: 0; }
/* Wide screens: the copy on the left, the lit lighthouse of the key art clear of it on the right. */
@media (min-width: 1001px) {
  .wishlist { text-align: left; }
  .wishlist__logo { width: min(78vw, 26rem); margin: 0; }
  .wishlist p { margin-left: 0; }
  .wishlist__actions { justify-content: flex-start; }
  .wishlist .signup { margin-left: 0; }
  .wishlist__bg img { object-position: 8% 50%; }
  .wishlist__bg::after { background: linear-gradient(180deg, var(--ink-deep), transparent 35%), linear-gradient(0deg, var(--ink-deep), transparent 30%), linear-gradient(90deg, rgb(23 21 28 / 0.88) 0%, rgb(23 21 28 / 0.7) 38%, rgb(23 21 28 / 0.15) 72%); }
}
/* Narrower screens: the copy stays centred and the lighthouse gets its own room under the form,
   so it never sits behind the buttons. */
@media (max-width: 1000px) {
  .wishlist { padding-bottom: calc(min(110vw, 40rem) * 0.8); }
  .wishlist__bg picture { inset: auto 0 0; height: min(110vw, 40rem); -webkit-mask-image: linear-gradient(180deg, transparent, #000 35%); mask-image: linear-gradient(180deg, transparent, #000 35%); }
  .wishlist__bg img { object-position: 50% 85%; }
  .wishlist__bg::after { background: linear-gradient(180deg, var(--ink-deep), transparent 35%), linear-gradient(0deg, var(--ink-deep), transparent 12%); }
}
@media (min-width: 641px) and (max-width: 1000px) {
  .wishlist { padding-bottom: calc(min(110vw, 40rem) * 0.92); }
}
@media (max-width: 640px) {
  .wishlist__actions { flex-direction: column; align-items: stretch; max-width: 20rem; margin-inline: auto; }
  .heroes__night video { aspect-ratio: 1 / 1; }
}

/* Skills, island, gear and ways to play on narrower screens. */
@media (max-width: 1000px) {
  .skill-list { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 2.5rem; }
  .fishing, .gear { grid-template-columns: 1fr; }
  .places { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .place--map { grid-row: auto; grid-column: 1 / -1; }
  .place--map img { aspect-ratio: 16 / 9; min-height: 0; }
  .notes { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 2rem; }
  .modes__grid { grid-template-columns: 1fr; row-gap: 2.5rem; }
  .modes__col--then, .modes__col--alt { grid-column: auto; }
  .modes__col--alt { margin-top: 0; }
}
@media (min-width: 641px) and (max-width: 1000px) {
  .mode--story, .mode--builder { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
  .mode--story picture { height: 100%; }
  .mode--story img { height: 100%; aspect-ratio: auto; min-height: 15rem; }
  .mode--story .mode__body, .mode--builder .mode__body { align-self: center; padding: 1.35rem 1.5rem 1.6rem; }
}
@media (max-width: 640px) {
  .skill-list { grid-template-columns: 1fr; row-gap: 1.75rem; }
  .skill { display: grid; grid-template-columns: 4.25rem minmax(0, 1fr); column-gap: 1.1rem; align-items: start; }
  .skill__mark { grid-row: span 2; width: 4.25rem; height: 4.25rem; }
  .skill__icon { width: 2.25rem; height: 2.25rem; }
  .skill h3 { margin-top: 0.35rem; font-size: 1.5rem; }
  .skill p { margin-top: 0.3rem; }
  .places, .notes, .modes__pair { grid-template-columns: 1fr; }
  .mode--builder { display: flex; }
  .mode--builder img { height: auto; aspect-ratio: 16 / 10; min-height: 0; }
  .mode--builder .mode__body { padding: 1.35rem 1.5rem 1.6rem; }
  .place--map img { aspect-ratio: 4 / 3; }
  .ladder__step { font-size: 0.75rem; }
}

/* Wallpapers: one wide desktop card and one phone card, each a download link. */
.wallpapers { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); gap: clamp(1rem, 0.5rem + 2vw, 2rem); align-items: start; }
.wallpaper { display: grid; gap: 0.9rem; text-decoration: none; color: var(--on-cream); }
.wallpaper img { width: 100%; border-radius: var(--radius-m); box-shadow: var(--shadow-frame); transition: transform var(--dur-med) var(--ease-out); }
.wallpaper:hover img { transform: translateY(-3px); }
.wallpaper__meta { display: grid; gap: 0.15rem; }
@media (max-width: 640px) {
  .clips { grid-template-columns: 1fr; }
  .heroes__stage { aspect-ratio: 4 / 5; }
  .roster[role="tablist"] .roster__sigil { width: 3rem; height: 3rem; }
  .roster[role="tablist"] .roster__sigil svg { width: 1.8rem; height: 1.8rem; }
  .wallpapers { grid-template-columns: 1fr; }
  .wallpaper--phone { max-width: 16rem; }
}

