/* games.pearlhx.com's home as a world (Nov 26, 2026, Ahsan: "a different world"): a night lagoon you can touch, where
   the pearl rises; each game a full-screen scene its pieces fly out of as you scroll; the games to come on the horizon;
   a dock keeping the download or Play now one tap away. world-v3.js drives it: --h (the arrival's scroll, 0..1) and
   --p (each scene's, 0..1). Transforms and opacity only; still under reduced motion and when paused. */

body[data-page="home"] { background: #041512; }
body[data-page="home"] main { max-width: none; padding: 0; }
body[data-page="home"] .site-head { position: absolute; inset: 0 0 auto; background: linear-gradient(rgba(4, 21, 18, 0.7), rgba(4, 21, 18, 0)); border: 0; }
@supports (backdrop-filter: blur(1px)) { body[data-page="home"] .site-head { backdrop-filter: none; } }
@media (min-width: 960px) { body[data-page="home"] .site-head { position: fixed; } }
body[data-page="home"] footer { max-width: 1264px; }

/* --- the arrival: the lagoon, the title assembling, two portals ------------------------------------------------- */
.arrival { position: relative; height: 100svh; min-height: 560px; overflow: hidden; display: grid; place-items: center; isolation: isolate;
  background: radial-gradient(120% 70% at 50% 100%, #0b3a33 0%, #062723 38%, #041512 70%), #041512; }
.lagoon { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; opacity: 0; transition: opacity 900ms var(--arrive); }
.lagoon.on { opacity: 1; }
.arrival-copy { position: relative; text-align: center; padding: 0 var(--gutter); max-width: 900px;
  transform: translateY(calc(var(--h, 0) * -60px)) scale(calc(1 - var(--h, 0) * 0.08)); opacity: calc(1 - var(--h, 0) * 1.4); }
@media (max-width: 959px) { .arrival-copy { padding-top: 9svh; } }
.kicker { margin: 0 0 14px; color: var(--muted); font: 650 15px/1 var(--sans); letter-spacing: 0.02em; }
.kicker em { font-family: var(--serif); font-weight: 400; font-size: 1.25em; color: var(--gold); }
:lang(bn) .kicker em { font-family: var(--sans); font-style: normal; font-size: 1em; }
.arrival h1 { margin: 0; font: 700 clamp(44px, 9vw, 112px)/0.98 var(--sans); letter-spacing: -0.04em;
  color: #fbf3dc; filter: drop-shadow(0 10px 40px rgba(244, 217, 149, 0.18)); }
.arrival h1:not(.split), .arrival h1 .ch { background: linear-gradient(180deg, #fffdf6 25%, #f4d995 115%); -webkit-background-clip: text; background-clip: text; color: transparent; }
:lang(bn) .arrival h1 { letter-spacing: 0; line-height: 1.15; }
.lede { margin: 18px auto 0; max-width: 520px; color: var(--muted); font-size: clamp(16px, 2vw, 19px); line-height: 1.5; }
.portals { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 32px; }
.portal-link { display: inline-flex; align-items: center; gap: 12px; min-height: 64px; padding: 8px 18px 8px 8px; border-radius: 999px; text-decoration: none;
  background: rgba(13, 43, 40, 0.55); border: 1px solid rgba(244, 217, 149, 0.28); color: var(--paper);
  transition: transform 220ms var(--ui), border-color 220ms var(--ui), background-color 220ms var(--ui); }
@supports (backdrop-filter: blur(1px)) { .portal-link { backdrop-filter: blur(10px); } }
.portal-link img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px rgba(244, 217, 149, 0.5); }
.portal-link span { display: grid; text-align: start; }
.portal-link small { color: var(--gold); font: 600 11px/1.3 var(--sans); letter-spacing: 0.04em; }
.portal-link b { font: 700 17px/1.2 var(--sans); }
.portal-link:hover { border-color: var(--gold); background: rgba(18, 54, 48, 0.75); }
.scroll-cue { position: absolute; bottom: calc(24px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); display: grid; justify-items: center; gap: 10px;
  color: var(--muted); font: 600 12px/1 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; opacity: calc(1 - var(--h, 0) * 3); }
:lang(bn) .scroll-cue { text-transform: none; letter-spacing: 0; font-size: 13px; }
.scroll-cue i { width: 22px; height: 36px; border: 2px solid rgba(248, 247, 242, 0.45); border-radius: 12px; position: relative; }
.scroll-cue i::after { content: ""; position: absolute; left: 50%; top: 7px; width: 4px; height: 7px; margin-left: -2px; border-radius: 2px; background: var(--gold); }
/* fireflies over the water (the lagoon draws its own; these are the fallback's). Out of the grid's flow (Codex, Nov 26) */
.fireflies { position: absolute; inset: 0; pointer-events: none; }
.fireflies i { position: absolute; width: 4px; height: 4px; border-radius: 50%; background: #ffe9ad; box-shadow: 0 0 10px 3px rgba(244, 217, 149, 0.55); opacity: 0.0; }
.fireflies i:nth-child(1) { left: 12%; top: 62%; } .fireflies i:nth-child(2) { left: 26%; top: 38%; } .fireflies i:nth-child(3) { left: 41%; top: 70%; }
.fireflies i:nth-child(4) { left: 58%; top: 30%; } .fireflies i:nth-child(5) { left: 71%; top: 64%; } .fireflies i:nth-child(6) { left: 84%; top: 42%; }
.fireflies i:nth-child(7) { left: 92%; top: 76%; } .fireflies i:nth-child(8) { left: 6%; top: 24%; }
.lagoon:not(.on) ~ .fireflies i { opacity: 0.8; }

/* --- the kinetic words: each letter (or, in Bangla, each word) rises into place -------------------------------------- */
.kinetic .w { display: inline-block; white-space: nowrap; }
.kinetic .ch { display: inline-block; white-space: pre; }

/* --- a game's scene: the painting filling the screen, its pieces in the air, its words and buttons ------------------
   Without the script, paused, reduced or on a short screen, each scene is simply open (--p 0.5) and flows as a page.
   With it (html.world) on a tall enough screen, the scene pins while you scroll through it, and world-v3.js sets --p on
   the stage from 0 (a framed painting, far away) to 1 (gone up into the next). Codex's review, Nov 26: the words are
   readable early (full at p 0.17) and held until p 0.86; the pieces arrive one after another (--d). */
.scene { position: relative; }
.stage { position: relative; min-height: 100svh; overflow: hidden; perspective: 1200px; isolation: isolate; display: flex; align-items: center; --p: 0.5;
  --e: min(1, calc(var(--p) * 5)); --c: max(0, min(1, calc((var(--p) - 0.045) * 8))); --out: max(0, calc((var(--p) - 0.86) * 7)); }
.frame { position: absolute; inset: 0; z-index: -2; overflow: hidden; border-radius: calc((1 - var(--e)) * 40px);
  transform: scale(calc(0.72 + 0.28 * var(--e))) translateY(calc(var(--out) * -6%)); opacity: calc(1 - var(--out) * 0.8);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.5); }
.frame .tilt { position: absolute; inset: 0; display: block; }
.frame img { width: 100%; height: 100%; object-fit: cover; transform: scale(calc(1.18 - var(--e) * 0.08)) translateY(calc((var(--p) - 0.5) * -5%)); }
.scene[data-game="carrom"] .frame img { object-position: 62% 40%; }
.scene[data-game="ludo"] .frame img { object-position: 50% 45%; }
@media (max-aspect-ratio: 3/4) { .scene[data-game="carrom"] .frame img { object-position: 72% 40%; } .scene[data-game="ludo"] .frame img { object-position: 68% 45%; } }   /* (a phone keeps the lamp in the picture) */
.frame .light { position: absolute; width: 40vw; height: 24vw; left: 48%; top: 18%; border-radius: 50%; opacity: 0.09; pointer-events: none;
  background: radial-gradient(closest-side, #fff, rgba(255, 255, 255, 0)); --dx: 14px; --dy: 8px; --dur: 14s; }
.veil { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(4, 21, 18, 0.92) 0%, rgba(4, 21, 18, 0.72) 34%, rgba(4, 21, 18, 0.1) 62%), linear-gradient(0deg, rgba(4, 21, 18, 0.85), rgba(4, 21, 18, 0) 40%);
  opacity: calc(0.25 + var(--c) * 0.75); }
.lore { position: relative; z-index: 2; flex: none; margin: 112px 0 64px max(var(--gutter), calc(50% - 600px)); width: min(460px, calc(100% - 2 * var(--gutter)));
  padding: 0; background: none; border: 0; transform: translateY(calc((1 - var(--c)) * 48px)); opacity: var(--c); }
.lore h2:focus { outline: none; }
.lore .genre { font-size: 13px; }
.lore h2 { margin: 6px 0 0; font: 700 clamp(42px, 4.9vw, 68px)/1 var(--sans); letter-spacing: -0.035em; }
.lore h2 small { display: inline-block; vertical-align: 1.2em; margin-inline-start: 6px; padding: 0 6px; border: 1px solid rgba(248, 247, 242, 0.35); border-radius: 6px;
  color: #d2ddd8; font: 700 13px/20px var(--sans); letter-spacing: 0.04em; }
.lore .desc { font-size: 17px; line-height: 1.5; color: #d2ddd8; }
.lore .actions { grid-template-columns: 1fr 1fr; margin-top: 24px; padding-top: 0; }
.lore .helper { color: #c3d0ca; }
.lore .phone .qr-box { background: rgba(4, 21, 18, 0.85); }
@media (max-width: 959px) {
  .stage { align-items: flex-end; }
  .veil { background: linear-gradient(0deg, rgba(4, 21, 18, 0.97) 0%, rgba(4, 21, 18, 0.86) 42%, rgba(4, 21, 18, 0.1) 72%); }
  .lore { margin: 46svh var(--gutter) calc(88px + env(safe-area-inset-bottom)); }
  .lore .actions { grid-template-columns: 1fr; }
  .lore .desc { font-size: 15px; }
}
@media (prefers-reduced-motion: no-preference) and (min-height: 560px) {
  html.world:not(.still) .scene { height: 200vh; }
  html.world:not(.still) .stage { position: sticky; top: 0; height: 100svh; min-height: 0; }
  /* the first painting rises out of the lagoon's lower edge: no dark gap between the water and the game room */
  html.world:not(.still) .arrival + .scene { margin-top: -20svh; }
  /* (the lagoon's portals and scroll cue stay tappable above it: only its words and buttons take a touch) */
  html.world:not(.still) .arrival + .scene, html.world:not(.still) .arrival + .scene :is(.stage, .frame) { pointer-events: none; }
  html.world:not(.still) .arrival + .scene .lore { pointer-events: auto; }
  html.world:not(.still) .arrival + .scene .frame { box-shadow: 0 -30px 90px rgba(4, 21, 18, 0.6), 0 40px 120px rgba(0, 0, 0, 0.5); }
}
@media (prefers-reduced-motion: no-preference) and (min-height: 560px) and (max-width: 959px) {
  html.world:not(.still) .scene { height: 170vh; }
  html.world:not(.still) .lore { margin-top: 0; }
}
html.world .scene[data-flow] { height: auto; }
html.world .scene[data-flow] .stage { position: relative; height: auto; min-height: 100svh; }
@media (max-width: 959px) { html.world .scene[data-flow] .lore { margin-top: 46svh; } }

/* the pieces in the air (Nov 26, Ahsan: "some don't match the vibe"): the board's own set, lit by the same lamp. They
   rise out of the painting: from behind it and nearer its middle (--f, z far back), each in its moment (--d), to a
   resting place at the edges (--x, --y from the centre, --z depth, --r turn), clear of the words and the lamp; as the
   scene ends they drift up and fade. Nothing sweeps past the camera. */
.float { position: absolute; inset: 0; pointer-events: none; transform-style: preserve-3d; }
.pc, .die { --ei: max(0, min(1, calc((var(--p) - var(--d, 0)) * 6))); --f: calc(0.35 + 0.65 * var(--ei)); }
.pc { position: absolute; left: 50%; top: 50%; display: block; will-change: transform;
  transform: translate3d(calc(var(--x) * var(--f) - 50% + var(--mx, 0) * var(--z) * 0.08), calc(var(--y) * var(--f) - 50% - var(--out) * 16vh + var(--my, 0) * var(--z) * 0.08), calc(var(--z) - (1 - var(--ei)) * 560px))
    rotateX(var(--rx, 50deg)) rotateZ(calc(var(--r) + (1 - var(--ei)) * 70deg)); opacity: calc(min(1, var(--ei) * 1.4) * (1 - var(--out))); }
/* lamp from the upper right: the shadow falls to the lower left */
.pc.coin, .pc.striker { border-radius: 50%; box-shadow: -2px 5px 0 -1px rgba(20, 10, 4, 0.7), -10px 22px 30px rgba(0, 0, 0, 0.5); }
.pc.coin { width: clamp(42px, 4.6vw, 62px); height: auto; }
.pc.striker { width: clamp(60px, 6.6vw, 88px); height: auto; --rx: 34deg; }
.striker { --x: 22vw; --y: 27vh; --z: 140px; --r: 0deg; --d: 0; }
.c1 { --x: 30vw; --y: 16vh; --z: 70px; --r: 0deg; --d: 0.03; }   .c2 { --x: 40vw; --y: -12vh; --z: 30px; --r: 0deg; --d: 0.05; }
.c3 { --x: 8vw; --y: 26vh; --z: 110px; --r: 0deg; --d: 0.07; }   .c4 { --x: 41vw; --y: 30vh; --z: -30px; --r: 0deg; --d: 0.09; }
.c5 { --x: 25vw; --y: -18vh; --z: 80px; --r: 0deg; --d: 0.11; }
.pc.pawn { width: clamp(46px, 5.6vw, 74px); height: auto; --rx: 0deg; filter: drop-shadow(-8px 16px 14px rgba(0, 0, 0, 0.5)); }
.p1 { --x: 18vw; --y: 14vh; --z: 80px; --r: -6deg; --d: 0.02; }  .p2 { --x: 32vw; --y: -14vh; --z: 40px; --r: 8deg; --d: 0.05; }
.p3 { --x: 40vw; --y: 20vh; --z: 120px; --r: -10deg; --d: 0.08; } .p4 { --x: 44vw; --y: -2vh; --z: 10px; --r: 6deg; --d: 0.11; }
.die { --d: 0; }
@media (max-width: 959px) {   /* (a phone: a few pieces in the band above the words, the lamp left clear) */
  .striker { --x: -22vw; --y: -30vh; } .c1 { --x: 26vw; --y: -14vh; } .c2 { --x: -34vw; --y: -12vh; } .c3 { --x: 2vw; --y: -20vh; }
  .p1 { --x: -30vw; --y: -30vh; } .p2 { --x: 30vw; --y: -14vh; } .p3 { --x: -28vw; --y: -12vh; }
  .c4, .c5, .p4 { display: none; }
}

/* the die: a real cube of the game's ivory, its pips drawn */
.die { position: absolute; left: 50%; top: 50%; width: clamp(54px, 7vw, 86px); aspect-ratio: 1; transform-style: preserve-3d; --x: 22vw; --y: -2vh; --z: 160px;
  transform: translate3d(calc(var(--x) * var(--f) - 50%), calc(var(--y) * var(--f) - 50% - var(--out) * 16vh), calc(var(--z) - (1 - var(--ei)) * 560px)); opacity: calc(min(1, var(--ei) * 1.4) * (1 - var(--out))); }
@media (max-width: 959px) { .die { --x: -4vw; --y: -22vh; } }
.die .spin { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateX(calc(-30deg + var(--p) * 240deg)) rotateY(calc(40deg + var(--p) * 180deg)); }
.die .f { position: absolute; inset: 0; display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 14%; border-radius: 16%;
  background: url(/art/world/die-ivory.webp) center / cover, #efe1c0; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08); backface-visibility: hidden; }
.die .f b { width: 62%; aspect-ratio: 1; margin: auto; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #6a2b20, #2c0f0a 70%); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.6); }
.die .f { --half: calc(clamp(54px, 7vw, 86px) / 2); }
.f1 { transform: translateZ(var(--half)); } .f6 { transform: rotateY(180deg) translateZ(var(--half)); }
.f2 { transform: rotateY(90deg) translateZ(var(--half)); } .f5 { transform: rotateY(-90deg) translateZ(var(--half)); }
.f3 { transform: rotateX(90deg) translateZ(var(--half)); } .f4 { transform: rotateX(-90deg) translateZ(var(--half)); }
.f1 b { grid-area: 2 / 2; }
.f2 b:nth-child(1) { grid-area: 1 / 1; } .f2 b:nth-child(2) { grid-area: 3 / 3; }
.f3 b:nth-child(1) { grid-area: 1 / 1; } .f3 b:nth-child(2) { grid-area: 2 / 2; } .f3 b:nth-child(3) { grid-area: 3 / 3; }
.f4 b:nth-child(1) { grid-area: 1 / 1; } .f4 b:nth-child(2) { grid-area: 1 / 3; } .f4 b:nth-child(3) { grid-area: 3 / 1; } .f4 b:nth-child(4) { grid-area: 3 / 3; }
.f5 b:nth-child(1) { grid-area: 1 / 1; } .f5 b:nth-child(2) { grid-area: 1 / 3; } .f5 b:nth-child(3) { grid-area: 2 / 2; } .f5 b:nth-child(4) { grid-area: 3 / 1; } .f5 b:nth-child(5) { grid-area: 3 / 3; }
.f6 b:nth-child(1) { grid-area: 1 / 1; } .f6 b:nth-child(2) { grid-area: 2 / 1; } .f6 b:nth-child(3) { grid-area: 3 / 1; } .f6 b:nth-child(4) { grid-area: 1 / 3; } .f6 b:nth-child(5) { grid-area: 2 / 3; } .f6 b:nth-child(6) { grid-area: 3 / 3; }
.f1 b { background: radial-gradient(circle at 35% 30%, #c0392b, #5a0f0a 70%); width: 78%; }

/* --- the horizon: the games to come as two arched windows on the water, the light resting between them ------------ */
.horizon { position: relative; max-width: 1264px; margin: 0 auto; padding: 140px var(--gutter) 56px; isolation: isolate; overflow-x: clip; }
.horizon::before { content: ""; position: absolute; z-index: -1; left: 50%; top: 40px; width: min(1400px, 100vw); height: 760px; transform: translateX(-50%); pointer-events: none;
  background: radial-gradient(46% 30% at 50% 62%, rgba(244, 217, 149, 0.13), rgba(244, 217, 149, 0) 72%), radial-gradient(70% 46% at 50% 56%, rgba(20, 90, 78, 0.34), rgba(4, 21, 18, 0) 74%); }
@media (max-width: 959px) { .horizon { padding-top: 104px; } }
.horizon > h2 { margin: 0 0 48px; text-align: center; font: 700 clamp(34px, 5vw, 56px)/1 var(--sans); letter-spacing: -0.03em; }
.windows { --ww: min(clamp(150px, 28vw, 340px), calc((100vw - 2 * var(--gutter) - 20px) / 2)); --wh: calc(var(--ww) * 1.3); position: relative; display: flex; justify-content: center; align-items: flex-start; gap: clamp(20px, 9vw, 150px); }
/* the horizon line, at the windows' sills, gold toward the middle where the light rests */
.windows::before { content: ""; position: absolute; left: 50%; top: var(--wh); width: min(1200px, 100%); height: 1px; transform: translateX(-50%);
  background: linear-gradient(90deg, rgba(244, 217, 149, 0), rgba(244, 217, 149, 0.28) 20%, rgba(255, 233, 173, 0.75) 50%, rgba(244, 217, 149, 0.28) 80%, rgba(244, 217, 149, 0)); }
.windows > .lamp { left: 50%; top: var(--wh); }
.window { position: relative; width: var(--ww); flex: none; display: grid; justify-items: center; text-align: center; }
.pane { position: relative; width: 100%; height: var(--wh); overflow: hidden; border-radius: 999px 999px 10px 10px; isolation: isolate;
  box-shadow: 0 0 0 1px rgba(244, 217, 149, 0.55), 0 0 0 7px rgba(6, 32, 29, 0.9), 0 0 0 8px rgba(244, 217, 149, 0.28), 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 90px rgba(244, 217, 149, 0.08);
  transition: box-shadow 400ms var(--ui); }
.pane img, .reflection img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.window[data-game="windwright"] img { object-position: 44% 50%; }
.window[data-game="kitelight"] img { object-position: 50% 40%; }
.pane img { transform: scale(1.12); }
.reflection img { transform: scale(1.12, -1.12); }
/* the window's frame: a thin gold arch inside, a mullion down the middle, the glass's own sheen */
.pane::after { content: ""; position: absolute; inset: 9px; border-radius: 999px 999px 4px 4px; border: 1px solid rgba(255, 233, 173, 0.45); pointer-events: none;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0) 32%, rgba(255, 255, 255, 0) 70%, rgba(255, 255, 255, 0.06)); }
.mullion { position: absolute; left: 50%; top: 9px; bottom: 9px; width: 1px; background: rgba(255, 233, 173, 0.35); pointer-events: none; }
.mullion::after { content: ""; position: absolute; left: -50vw; right: -50vw; top: 58%; height: 1px; background: rgba(255, 233, 173, 0.3); }
.sparks i { position: absolute; bottom: 12%; width: 3px; height: 3px; border-radius: 50%; background: #ffe9ad; box-shadow: 0 0 8px 2px rgba(244, 217, 149, 0.6); opacity: 0; }
.sparks i:nth-child(1) { left: 28%; } .sparks i:nth-child(2) { left: 56%; } .sparks i:nth-child(3) { left: 74%; }
/* its light on the water: the painting again, upside down, rippled and fading */
.reflection { position: relative; width: 100%; height: calc(var(--wh) * 0.42); overflow: hidden; border-radius: 10px 10px 0 0; opacity: 0.32; pointer-events: none;
  -webkit-mask-image: linear-gradient(rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0)); mask-image: linear-gradient(rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0)); }
.reflection img { inset: 0 0 auto; height: var(--wh); filter: blur(1.5px) saturate(1.2); }
.sill { position: relative; margin-top: calc(var(--wh) * -0.3); padding: 0 4px; }
.sill .genre { display: block; }
.sill h3 { margin: 4px 0 0; font: 700 clamp(20px, 2.2vw, 28px)/1.15 var(--sans); letter-spacing: -0.02em; }
.sill p { margin: 8px auto 0; max-width: 30ch; color: var(--muted); font-size: clamp(13px, 1.3vw, 15px); line-height: 1.45; }
.sill .badge { margin-top: 12px; }
@media (max-width: 959px) { .sill p { font-size: 13px; } .sill h3 small { display: none; } }
@media (hover: hover) and (pointer: fine) {
  .window:hover .pane { box-shadow: 0 0 0 1px rgba(255, 233, 173, 0.85), 0 0 0 7px rgba(6, 32, 29, 0.9), 0 0 0 8px rgba(244, 217, 149, 0.5), 0 36px 90px rgba(0, 0, 0, 0.55), 0 0 120px rgba(244, 217, 149, 0.22); }
}
body[data-page="home"] .play-band { max-width: 1200px; margin: 36px auto 0; margin-inline: max(var(--gutter), calc(50% - 600px)); }

/* --- the chapter rail (a wide screen): where you are on the journey, and a way to any stop ------------------------- */
.rail { display: none; }
@media (min-width: 960px) {
  html.world .rail { position: fixed; z-index: 15; right: 22px; top: 50%; display: grid; gap: 6px; transform: translateY(-50%); }
  .rail::before { content: ""; position: absolute; right: 21px; top: 22px; bottom: 22px; width: 1px; background: rgba(244, 217, 149, 0.18); }
  .rail::after { content: ""; position: absolute; right: 21px; top: 22px; width: 1px; height: calc((100% - 44px) * var(--rp, 0)); background: linear-gradient(rgba(255, 233, 173, 0.9), rgba(244, 217, 149, 0.4)); }
  .rail a { position: relative; display: flex; align-items: center; justify-content: flex-end; gap: 12px; height: 44px; padding-right: 15px; color: var(--paper); text-decoration: none; }
  .rail a::after { content: ""; width: 11px; height: 11px; border-radius: 50%; border: 1px solid rgba(244, 217, 149, 0.6); background: #041512; transition: transform 300ms var(--arrive), background-color 300ms var(--ui), box-shadow 300ms var(--ui); }
  .rail a.on::after { background: var(--gold); transform: scale(1.25); box-shadow: 0 0 14px rgba(244, 217, 149, 0.7); }
  .rail span { padding: 5px 10px; border-radius: 999px; background: rgba(6, 32, 29, 0.85); border: 1px solid rgba(244, 217, 149, 0.25); font: 600 13px/1 var(--sans); white-space: nowrap;
    opacity: 0; transform: translateX(8px); transition: opacity 200ms var(--ui), transform 260ms var(--arrive); pointer-events: none; }
  .rail a:hover span, .rail a:focus-visible span { opacity: 1; transform: none; }
  .rail a:focus-visible { outline: none; }
  .rail a:focus-visible::after { box-shadow: 0 0 0 3px var(--gold); }
}

/* --- the light that travels the page (world-v3.js): from the pearl, to each painting's lamp, to the horizon ------------ */
.lamp { position: absolute; width: 0; height: 0; display: none; pointer-events: none; }
html.world .lamp { display: block; }
.lampwrap { position: absolute; inset: 0; pointer-events: none; transform: scale(calc(1.18 - var(--e) * 0.08)) translateY(calc((var(--p) - 0.5) * -5%)); }
/* where the light is, the lamp burns brighter (--lit, 0..1, from the script; half lit when still) */
.lamp::before { content: ""; position: absolute; left: 0; top: 0; width: 46vmin; height: 46vmin; margin: -23vmin 0 0 -23vmin; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 236, 180, 0.5), rgba(255, 214, 130, 0.16) 45%, rgba(255, 214, 130, 0)); mix-blend-mode: screen; opacity: var(--lit, 0.5); }
.lampwrap .lamp::after { content: ""; position: absolute; left: 0; top: 0; width: 22vmin; height: 40vmin; margin: 0 0 0 -11vmin; transform-origin: 50% 0; pointer-events: none;
  background: radial-gradient(50% 100% at 50% 0, rgba(255, 228, 160, 0.22), rgba(255, 228, 160, 0)); mix-blend-mode: screen; opacity: var(--lit, 0.5); }
.arrival > .lamp::before { display: none; }
.windows > .lamp::before { width: min(720px, 90vw); height: 90px; margin: -45px 0 0 max(-360px, -45vw); background: radial-gradient(closest-side, rgba(255, 236, 180, 0.55), rgba(255, 214, 130, 0)); }
.lumen { position: fixed; z-index: 6; left: 0; top: 0; width: 0; height: 0; pointer-events: none; display: none; }
html.world.journey:not(.still) .lumen { display: block; }
.lumen i { position: absolute; left: 0; top: 0; border-radius: 50%; will-change: transform, opacity; }
.lumen .core { width: 15vmin; height: 15vmin; margin: -7.5vmin 0 0 -7.5vmin; mix-blend-mode: screen;
  background: radial-gradient(closest-side, #fffdf6, rgba(255, 240, 200, 0.85) 12%, rgba(255, 228, 160, 0.3) 34%, rgba(244, 217, 149, 0.08) 62%, rgba(244, 217, 149, 0));
  transform: translate3d(var(--x0, -999px), var(--y0, -999px), 0) rotate(var(--a, 0deg)) scale(var(--sx, 1), var(--sy, 1)); opacity: var(--o, 0); }
.lumen .spark { width: 8px; height: 8px; margin: -4px 0 0 -4px; background: #fff4d7; box-shadow: 0 0 14px 5px rgba(244, 217, 149, 0.6); mix-blend-mode: screen; opacity: var(--t, 0); }
.lumen .spark:nth-of-type(2) { transform: translate3d(var(--x1, -999px), var(--y1, -999px), 0); }
.lumen .spark:nth-of-type(3) { transform: translate3d(var(--x2, -999px), var(--y2, -999px), 0) scale(0.75); }
.lumen .spark:nth-of-type(4) { transform: translate3d(var(--x3, -999px), var(--y3, -999px), 0) scale(0.5); }

/* --- the dock: the games one tap away, all the way down ---------------------------------------------------------------- */
.dock { display: none; }
html.world .dock { display: flex; }
body[data-page="home"] footer { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.dock { position: fixed; z-index: 20; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); gap: 6px; padding: 6px;
  border-radius: 999px; background: rgba(6, 32, 29, 0.82); border: 1px solid rgba(244, 217, 149, 0.3); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  transform: translate(-50%, calc(140% * (1 - var(--dock, 0)))); opacity: var(--dock, 0); transition: transform 420ms var(--arrive), opacity 300ms var(--ui); }
@supports (backdrop-filter: blur(1px)) { .dock { backdrop-filter: blur(14px) saturate(1.3); } }
.dock-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 999px; text-decoration: none;
  background: var(--gold); color: var(--gold-ink); font: 700 15px/1 var(--sans); box-shadow: inset 0 1px #fff4d7; transition: background-color 140ms var(--ui), transform 160ms var(--ui); }
.dock-btn .i { width: 18px; height: 18px; flex: none; }
.dock-btn .i.play { fill: currentColor; stroke: none; }
.dock-btn .i.get { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.dock-btn:hover { background: var(--gold-up); }
.dock-btn:active { transform: scale(0.97); }

/* --- the pointer's pearl light (a fine pointer only) --------------------------------------------------------------------- */
.cursor { position: fixed; z-index: 50; left: 0; top: 0; width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 35% 30%, rgba(255, 253, 246, 0.95), rgba(244, 217, 149, 0.45) 45%, rgba(244, 217, 149, 0) 70%);
  mix-blend-mode: screen; transform: translate3d(var(--cx, -100px), var(--cy, -100px), 0) scale(var(--cs, 1)); transition: transform 90ms linear, opacity 200ms; opacity: 0; }
.cursor.on { opacity: 1; }

/* --- motion: arrival, the kinetic words, the drifting things ------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  html:not(.still):not(.settled) .arrival .kinetic .ch { animation: ch-in 900ms var(--arrive) both; animation-delay: calc(var(--i) * 22ms + 120ms); }
  html:not(.still):not(.settled) .kicker, html:not(.still):not(.settled) .lede { animation: lift 700ms var(--arrive) 240ms both; }
  html:not(.still):not(.settled) .portals { animation: rise 800ms var(--arrive) 520ms both; }
  html.moving:not(.still) .scroll-cue i::after { animation: cue 1.8s var(--drift) infinite; }
  html.moving:not(.still) .lagoon:not(.on) ~ .fireflies i { animation: firefly 7s var(--drift) infinite alternate; }
  html.moving:not(.still) .lagoon:not(.on) ~ .fireflies i:nth-child(2n) { animation-duration: 9s; animation-delay: -3s; }
  html.moving:not(.still) .scene.live .pc { animation: bob 6s var(--drift) infinite alternate; }
  html.moving:not(.still) .scene.live .pc:nth-child(2n) { animation-duration: 7.5s; animation-delay: -2s; }
  html.moving:not(.still) .scene.live .pc:nth-child(3n) { animation-duration: 9s; animation-delay: -4s; }
  html.moving:not(.still) .scene.live .frame .light { animation: drift var(--dur) var(--drift) infinite alternate; }
  html.moving:not(.still) .horizon.live .pane img { animation: pane-pan 18s var(--drift) infinite alternate; }
  html.moving:not(.still) .horizon.live .reflection img { animation: pane-mirror 18s var(--drift) infinite alternate; }
  html.moving:not(.still) .horizon.live .window + .window :is(.pane, .reflection) img { animation-duration: 22s; animation-delay: -7s; }
  html.moving:not(.still) .horizon.live .reflection { animation: ripple 5s var(--drift) infinite alternate; }
  html.moving:not(.still) .horizon.live .sparks i { animation: spark-up 5.5s var(--drift) infinite; }
  html.moving:not(.still) .horizon.live .sparks i:nth-child(2) { animation-delay: -2s; animation-duration: 6.5s; }
  html.moving:not(.still) .horizon.live .sparks i:nth-child(3) { animation-delay: -4s; animation-duration: 7.5s; }
  /* the scene's own words assemble as it opens */
  html.moving:not(.still) .horizon .kinetic .ch { transition: transform 700ms var(--arrive), opacity 500ms; transition-delay: calc(var(--i) * 30ms); }
  html.moving:not(.still) .horizon:not(.live) .kinetic .ch { transform: translateY(0.5em) rotateX(-70deg); opacity: 0; }
  html:not(.still) .scene .kinetic .ch { transform: translateY(calc((1 - var(--c)) * 0.6em)) rotateX(calc((1 - var(--c)) * -70deg)); opacity: var(--c); transition: transform 500ms var(--arrive), opacity 400ms; transition-delay: calc(var(--i) * 18ms); }
}
@keyframes ch-in { from { opacity: 0; transform: translateY(0.55em) rotateX(-80deg); filter: blur(6px); } to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes cue { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(12px); opacity: 0; } 100% { opacity: 0; } }
@keyframes firefly { from { transform: translate(0, 0); opacity: 0.2; } 50% { opacity: 1; } to { transform: translate(30px, -40px); opacity: 0.4; } }
@keyframes bob { from { translate: 0 0; } to { translate: 0 -14px; } }
@keyframes pane-pan { from { transform: scale(1.12) translate(-2%, 1%); } to { transform: scale(1.18) translate(2%, -1.5%); } }
@keyframes pane-mirror { from { transform: scale(1.12, -1.12) translate(-2%, 1%); } to { transform: scale(1.18, -1.18) translate(2%, -1.5%); } }
@keyframes ripple { from { transform: skewX(-1.2deg) scaleX(1.015); } to { transform: skewX(1.2deg) scaleY(1.03); } }
@keyframes spark-up { 0% { opacity: 0; translate: 0 0; } 20% { opacity: 1; } 100% { opacity: 0; translate: 6px -180px; } }


/* paused or reduced: the world stands still and reads as a page; each scene open, nothing tied to the scroll */
html.still .arrival-copy, html.still .scroll-cue { --h: 0; }
html.still .cursor { display: none; }
@media (prefers-reduced-motion: reduce) {
  .arrival-copy, .scroll-cue { --h: 0; } .cursor { display: none; }
}
