/* Walking Heroes · closed beta site
   Tokens mirror the Walking heroes DS (Figma). Day = Parchment, Night = intro/* tokens. */

@font-face { font-family: "Grenze Gotisch"; font-weight: 700; font-display: swap;
  src: url(fonts/grenze-gotisch-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Grenze Gotisch"; font-weight: 700; font-display: swap;
  src: url(fonts/grenze-gotisch-latin-ext-700-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Grenze Gotisch"; font-weight: 800; font-display: swap;
  src: url(fonts/grenze-gotisch-latin-800-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Grenze Gotisch"; font-weight: 800; font-display: swap;
  src: url(fonts/grenze-gotisch-latin-ext-800-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Grenze"; font-weight: 400; font-display: swap;
  src: url(fonts/grenze-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Grenze"; font-weight: 400; font-display: swap;
  src: url(fonts/grenze-latin-ext-400-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Grenze"; font-weight: 700; font-display: swap;
  src: url(fonts/grenze-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Grenze"; font-weight: 700; font-display: swap;
  src: url(fonts/grenze-latin-ext-700-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  /* Walking heroes DS · Parchment (Day) */
  --surface-onboarding: #f2ebd6;
  --surface-card: #fbf3e1;
  --text-primary: #2b1d10;
  --text-secondary: #5d3915;
  --text-tertiary: #734e28;
  --text-accent: #7a5520;
  --link: #24508a;          /* faction/accent-text (Wayfinders) */
  --accent: #2b5a9b;        /* faction/accent */
  --edge-control: rgba(62, 42, 22, .85);
  --ink-shadow: 43, 28, 15;
  /* Night (intro/*) */
  --intro-bg: #0b0d1a;
  --intro-text: #f3e6c8;
  --intro-text-muted: #d9cba8;
  --intro-link: #e9c46a;

  --font-display: "Grenze Gotisch", Georgia, serif;
  --font-text: "Grenze", Georgia, serif;

  /* set by sky.js: 0 = full day, 1 = full night */
  --night: 0;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font-text);
  font-size: 18px; line-height: 1.5;
  color: var(--text-primary);
  background: var(--surface-onboarding);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Night theme for text and controls (sky.js toggles .is-night on <html>) */
.is-night body { color: var(--intro-text); background: var(--intro-bg); }

/* ───────────── Living sky scene ───────────── */
.scene { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; background: #f2ebd6; }
.scene > * { position: absolute; }
.sky { inset: 0; background: linear-gradient(180deg, var(--sky-top, #7aa8e0) 0%, var(--sky-mid, #d1e3f0) 45%, var(--sky-low, #f7edd6) 70%); }
.stars { inset: 0 0 45% 0; opacity: var(--stars, 0); }
.stars i { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: #fff7e0; }
.stars i.b { width: 3.5px; height: 3.5px; }
@media (prefers-reduced-motion: no-preference) {
  .stars i.tw { animation: twinkle 5s ease-in-out infinite alternate; }
}
@keyframes twinkle { from { opacity: 1; } to { opacity: .35; } }

.body { width: 0; height: 0; left: 0; top: 0; will-change: transform, opacity; }
.body > span { position: absolute; border-radius: 50%; transform: translate(-50%, -50%); left: 0; top: 0; }
.sun .glow { width: 360px; height: 360px; background: radial-gradient(circle closest-side, rgba(255,237,178,.75) 0%, rgba(255,216,140,.35) 25%, rgba(255,204,128,.08) 60%, rgba(255,204,128,0) 100%); }
.sun .disc { width: 76px; height: 76px; background: radial-gradient(circle, #fffdeb 0%, #ffedb8 70%, #ffdb94 100%); }
.moon .glow { width: 300px; height: 300px; background: radial-gradient(circle closest-side, rgba(191,217,255,.38) 0%, rgba(178,209,255,.14) 35%, rgba(178,209,255,.04) 65%, rgba(178,209,255,0) 100%); }
.moon .disc { width: 58px; height: 58px; background: radial-gradient(circle, #faf7eb 0%, #e0e0db 80%, #c7ccd6 100%); box-shadow: inset -6px -4px 10px rgba(77,87,115,.35); }

/* Clouds: one painted cumulus strip (Figma AI, "Website cloud art" file), seamless in x, with perspective:
   big clouds overhead, small ones near the horizon. Three masks made from the painting's own shading:
   body (shadow side), top (lit), under (undersides, lit at dawn/dusk). sky.js colours them by sun
   elevation. Drifts slowly; still with reduced motion. Rebuild: scripts/site-clouds.py. */
.clouds { left: 0; right: 0; top: 0; height: var(--clouds-h, 70%); opacity: var(--cloud-a, .9);
  -webkit-mask-image: linear-gradient(180deg, #000 58%, transparent 100%); mask-image: linear-gradient(180deg, #000 58%, transparent 100%); }
.cl { position: absolute; left: 0; top: var(--cl-top, -40px); width: calc(100% + var(--tile)); height: calc(var(--tile) * .5219); }
.cl.near { --tile: 1600px; }
.cl i { position: absolute; inset: 0;
  -webkit-mask: var(--m) repeat-x 0 0 / var(--tile) 100%; mask: var(--m) repeat-x 0 0 / var(--tile) 100%; }
.cl .b { --m: url(img/cloud-body.f2907b51.webp); background: var(--cloud-base, #a9b6c9); }
.cl .t { --m: url(img/cloud-top.65fb63d0.webp); background: var(--cloud-lit, #fff); }
.cl .u { --m: url(img/cloud-under.907dfc73.webp); background: var(--cloud-under, #ffb27a); opacity: var(--cloud-under-a, 0); }
@media (prefers-reduced-motion: no-preference) {
  .cl { will-change: transform; animation: cloud-drift 480s linear infinite; }
}
@keyframes cloud-drift { to { transform: translateX(calc(-1 * var(--tile))); } }
@media (max-width: 1100px) { .cl.near { --tile: 1350px; } }
@media (max-width: 600px)  { .clouds { --clouds-h: 58%; } .cl { --cl-top: -20px; } .cl.near { --tile: 980px; } }

/* Landscape: two paintings, sky cut at the horizon, crossfaded by --night */
.land { left: 0; right: 0; bottom: 0; top: var(--land-top, 16%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, transparent 16%, #000 36%, #000 100%);
          mask-image: linear-gradient(180deg, transparent 0%, transparent 16%, #000 36%, #000 100%); }
.land img { position: absolute; left: 50%; top: 0; width: var(--land-size, max(100vw, 1440px)); height: auto; max-width: none;
  transform: translateX(calc(-50% + var(--land-shift, 0px))); }
.land .night { opacity: var(--night); }
.land .tint { position: absolute; inset: 0; mix-blend-mode: soft-light; background: var(--tint, #ff8c4d); opacity: var(--tint-a, 0); }
.mist { left: 0; right: 0; top: 62%; height: 260px; opacity: var(--mist, 1);
  background: linear-gradient(180deg, rgba(255,255,255,0), rgba(255,250,240,.35), rgba(255,255,255,0)); }
.fade { left: 0; right: 0; bottom: 0; height: 240px;
  background: linear-gradient(180deg, rgba(var(--fade-rgb, 242,235,214), 0) 0%, rgba(var(--fade-rgb, 242,235,214), .85) 60%, rgba(var(--fade-rgb, 242,235,214), .97) 100%); }

/* ───────────── Landing layout ───────────── */
.page { position: relative; z-index: 1; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; align-items: center; padding: 0 24px; }
.hero { display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 80px; }
.logo { width: 440px; height: auto;
  /* DS "HF2/App logo" art. At night it loses a little colour so it sits in the moonlit scene (--night: 0 day → 1 night). */
  filter: saturate(calc(1 - .28 * var(--night))) brightness(calc(1 - .06 * var(--night)))
    drop-shadow(0 2px 2px rgba(var(--ink-shadow), .30)) drop-shadow(0 8px 10px rgba(var(--ink-shadow), .30)) drop-shadow(0 18px 20px rgba(var(--ink-shadow), .16)); }
.logo-link { display: inline-block; border-radius: 12px; }
h1, .display { font-family: var(--font-display); font-weight: 800; color: var(--text-primary); margin: 0; }
.headline { font-size: 56px; line-height: 60px; margin-top: 32px; }
.is-night .headline, .is-night h1, .is-night .display { color: var(--intro-text); }
.btn { /* DS "HF2/Button" Primary L: flat faction fill + grain, 1 pt ink border, 3 pt inner bottom edge */
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; position: relative; isolation: isolate;
  height: 48px; padding: 0 24px; min-width: 340px; border-radius: 12px; border: 1px solid rgba(30, 20, 11, .5);
  font: 700 17px/20px var(--font-text); letter-spacing: .17px; color: #f3e3c2; text-shadow: 0 1px 1px rgba(0,0,0,.25);
  text-decoration: none; cursor: pointer;
  background: #2e5f9e;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.2), 0 4px 4px rgba(43,29,16,.14), 0 1px .5px rgba(43,29,16,.22);
}
.btn::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: url(img/btn-grain.a1d7cac3.webp) 0 0 / 50px 50px; mix-blend-mode: overlay; opacity: .7; }
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px); box-shadow: inset 0 -1px 0 rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.16), 0 1px 2px rgba(43,29,16,.2); }
.btn[disabled] { opacity: .6; cursor: progress; }
.hero .btn { margin-top: 40px; }
.caption { margin: 16px 0 0; font-size: 15px; line-height: 22px; letter-spacing: .01em; color: var(--text-tertiary); }
.is-night .caption { color: var(--intro-text-muted); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[tabindex="-1"]:focus { outline: none; }
.is-night :focus-visible { outline-color: var(--intro-link); }

/* Game stats card: DS "HF2/Panel · Light inked" (Walking heroes DS), same surface as the app's cards.
   Light paper + tiled paper texture, aged parchment edge (9-slice, multiply 60%), worn old-gilt rim
   (9-slice 18.7, 60%; Compact 12 on mobile), radius 8, ink shadow. Stays parchment at night. */
.stats {
  margin: auto 0 28px; width: 560px; max-width: 100%; min-height: 72px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 24px; position: relative; isolation: isolate; overflow: hidden; /* clips the 9-slice layers to the radius */
  background: #f6e4c9 url(img/panel-paper.webp) 0 0 / 25px 25px;
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(var(--ink-shadow), .22), 0 1px 3px rgba(var(--ink-shadow), .18);
  color: var(--text-primary);
}
.stats::before, .stats::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  border: 0 solid transparent; border-radius: inherit; }
.stats::before { border-image: url(img/panel-aged.webp) 96 / 44px stretch; mix-blend-mode: multiply; opacity: .6; }
.stats::after { border-image: url(img/panel-rim.webp) 36 / var(--rim, 18.7px) stretch; opacity: .6; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat:nth-child(3) { align-items: center; }
.stat:last-child { align-items: flex-end; }
.stat dt { font: 700 12px/16px var(--font-text); letter-spacing: .08em; text-transform: uppercase; color: var(--text-accent); }
.stat dd { margin: 0; display: flex; align-items: baseline; gap: 8px; }
.stat b { font: 800 20px/24px var(--font-display); color: var(--text-primary); }
.stat small { font-size: 13px; line-height: 18px; color: var(--text-tertiary); }
/* DS divider: plain 1px rule in text/accent, no ornament */
.stats .div { width: 1px; height: 40px; background: var(--text-accent); opacity: .75; }
.stats.is-loading { visibility: hidden; opacity: 0; }
.stats { transition: opacity .6s ease; }
.stats[hidden] { display: none; }

/* Footer */
/* Music toggle (music.js): DS "HF2/Map button": 44 pt parchment disc in a 48 pt hit area, ink border,
   parchment secondary face (texture, top highlight, bottom depth), floating shadow, ink glyph.
   Night: the DS night dim (22 % warm dark) over the face. */
.music-toggle { --music-btn-face: #ecdcb8;
  position: fixed; top: 14px; right: 14px; z-index: 40; width: 48px; height: 48px; padding: 0; border: 0;
  background: none; display: grid; place-items: center; cursor: pointer; color: #2b1d10;
  -webkit-tap-highlight-color: transparent; }
.music-toggle .face { position: absolute; inset: 2px; border-radius: 50%;
  background: var(--music-btn-face) url(img/panel-paper.webp) 0 0 / 25px 25px;
  border: 1px solid rgba(30, 20, 11, .55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), inset 0 -2px 0 rgba(43, 29, 16, .22),
    0 4px 8px rgba(43, 29, 16, .22), 0 1px 2px rgba(43, 29, 16, .28);
  transition: transform .12s, box-shadow .12s; }
.music-toggle .face::after { content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: url(img/btn-grain.a1d7cac3.webp) 0 0 / 50px 50px; mix-blend-mode: multiply; opacity: .18; }
.music-toggle svg { position: relative; filter: drop-shadow(0 1px 0 rgba(255, 248, 230, .7)); transition: opacity .2s; }
.music-toggle .slash { display: none; }
.music-toggle:not(.is-on) .slash { display: inline; }
.music-toggle:not(.is-on) svg { opacity: .75; }
.music-toggle:hover .face { transform: translateY(-1px); }
.music-toggle:active .face { transform: translateY(1px);
  box-shadow: inset 0 1px 2px rgba(43, 29, 16, .25), 0 1px 2px rgba(43, 29, 16, .25); }
.music-toggle:active svg { transform: translateY(1px); }
.music-toggle:focus-visible { outline: none; }
.music-toggle:focus-visible .face { outline: 2px solid var(--text-accent); outline-offset: 2px; }
.is-night .music-toggle .face { box-shadow: inset 0 0 0 100px rgba(42, 28, 14, .22), inset 0 1px 0 rgba(255, 255, 255, .35),
  inset 0 -2px 0 rgba(43, 29, 16, .25), 0 4px 10px rgba(0, 0, 0, .4); }
@media (max-width: 600px) { .music-toggle { top: 10px; right: 10px; } }

.foot { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 0 0 44px; text-align: center; }
/* The stats card normally pushes the footer down; without it (not loaded / failed), the footer does it itself. */
.stats[hidden] + .foot { margin-top: auto; padding-top: 56px; }
.foot nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 32px; }
.foot a { font: 700 15px/22px var(--font-text); color: var(--text-secondary); text-underline-offset: 3px; }
.foot p { margin: 0; font-size: 15px; line-height: 22px; color: var(--text-tertiary); }
.is-night .foot a { color: var(--intro-text-muted); }
.is-night .foot p { color: var(--intro-text-muted); }

/* ───────────── Views: invite + confirmation (in the landing page) ───────────── */
[data-view]:not(.is-active) { display: none !important; }
.app-icon { width: 80px; height: 80px; border-radius: 17.9px; overflow: hidden;
  box-shadow: 0 2px 2px rgba(var(--ink-shadow), .3), 0 8px 10px rgba(var(--ink-shadow), .3), 0 18px 20px rgba(var(--ink-shadow), .16); }
.is-night .app-icon { box-shadow: 0 0 0 1px rgba(255,255,255,.06), 0 6px 14px rgba(0,0,0,.45), 0 0 90px 30px rgba(168,204,255,.22); }

.invite { width: 440px; max-width: 100%; margin: 0 auto; padding-top: 56px; display: flex; flex-direction: column; }
.invite .app-icon { align-self: center; margin-bottom: 32px; }
.invite h1 { font-size: 36px; line-height: 40px; text-align: center; }
.invite .intro { margin: 12px 0 0; text-align: center; color: var(--text-secondary); font-size: 18px; line-height: 27px; }
.is-night .invite .intro { color: var(--intro-text-muted); }
.invite form { margin-top: 36px; display: flex; flex-direction: column; gap: 24px; }
.field { display: flex; flex-direction: column; gap: 8px; border: 0; padding: 0; margin: 0; min-width: 0; }
.label, legend.label { font: 700 13px/18px var(--font-text); letter-spacing: .08em; text-transform: uppercase; color: var(--text-accent); padding: 0; }
.is-night .label { color: var(--intro-text-muted); }
.input {
  height: 56px; width: 100%; padding: 0 16px; border-radius: 10px;
  font: 400 18px var(--font-text); color: var(--text-primary);
  background: var(--surface-card); border: 1.5px solid var(--edge-control);
  box-shadow: 0 1px 0 rgba(255,255,255,.6), 0 2px 4px rgba(var(--ink-shadow), .18);
}
.input::placeholder { color: var(--text-tertiary); opacity: .8; }
.input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.input[aria-invalid="true"] { border-color: #b23a2b; }
.error { margin: 0; font-size: 15px; line-height: 20px; color: #a6352a; }
.is-night .error { color: #ffb4a2; }

.choices { display: flex; gap: 12px; }
.choice { flex: 1; position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice span {
  display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 16px; border-radius: 10px;
  font: 700 18px var(--font-display); color: var(--text-secondary);
  border: 1.5px solid var(--edge-control); background: transparent;
}
.choice span::before { content: ""; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--edge-control); box-sizing: border-box; flex: none; }
.choice input:checked + span { color: var(--text-primary); border: 2px solid var(--accent); background: rgba(43, 90, 155, .08); }
.choice input:checked + span::before { border: 7px solid var(--accent); background: #fff; }
.choice input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.is-night .choice span { color: var(--intro-text-muted); border-color: rgba(217,203,168,.7); }
.is-night .choice span::before { border-color: rgba(217,203,168,.8); }
.is-night .choice input:checked + span { color: var(--intro-text); }

.check { display: flex; align-items: center; gap: 12px; cursor: pointer; font-size: 18px; color: var(--text-secondary); }
.check input { width: 24px; height: 24px; margin: 0; accent-color: var(--accent); flex: none; }
.is-night .check { color: var(--intro-text-muted); }
.invite .btn { width: 100%; min-width: 0; margin-top: 8px; }
.fine { margin: -8px 0 0; font-size: 15px; line-height: 22px; color: var(--text-tertiary); }
.fine a { color: var(--link); font-weight: 700; }
.is-night .fine { color: var(--intro-text-muted); }
.is-night .fine a { color: var(--intro-link); }
.textlink { background: none; border: 0; padding: 0; cursor: pointer; font: 700 17px var(--font-text); color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
.is-night .textlink { color: var(--intro-link); }
.done { display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 80px; }
.done h1 { font-size: 56px; line-height: 60px; margin-top: 32px; }
.done .textlink { margin-top: 20px; }

/* Readability scrim behind the invite form (the scene stays visible around it) */
.view-invite .scene .fade { height: 100%; background: linear-gradient(180deg, rgba(var(--fade-rgb), .95) 0%, rgba(var(--fade-rgb), .88) 62%, rgba(var(--fade-rgb), .35) 80%, rgba(var(--fade-rgb), .85) 92%, rgba(var(--fade-rgb), .97) 100%); }
.view-invite .stats, .view-done .stats { display: none; }
.view-invite .foot, .view-done .foot { margin-top: auto; padding-top: 56px; }

/* ───────────── 404 ───────────── */
.lost { display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 80px; }
.lost h1 { font-size: 56px; line-height: 60px; margin-top: 28px; }
.lost p { margin: 12px 0 24px; font-size: 18px; line-height: 27px; color: var(--text-secondary); }
.is-night .lost p { color: var(--intro-text-muted); }
.fogbank { left: 0; right: 0; top: 30%; bottom: 0; background: url(img/fog-day.webp) repeat 0 0 / 512px, url(img/fog-day.webp) repeat 256px 200px / 512px; opacity: .9; filter: blur(8px);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent);
          mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent); }
.is-night .fogbank { background-image: url(img/fog-night.webp), url(img/fog-night.webp); opacity: .85; filter: blur(10px); }
@media (prefers-reduced-motion: no-preference) {
  .fogbank { animation: fogdrift 120s linear infinite; }
}
@keyframes fogdrift { to { background-position: -512px 0, -256px 200px; } }

/* ───────────── Legal pages (plain, no scene) ───────────── */
.legal-page { background: var(--surface-onboarding); }
.is-night .legal-page { background: var(--intro-bg); }
.lhead { display: flex; align-items: center; justify-content: space-between; padding: 20px 120px; border-bottom: 1px solid rgba(43,29,16,.07); }
.is-night .lhead { border-bottom-color: rgba(243,230,200,.08); }
.home { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.home img { width: 40px; height: 40px; border-radius: 8.9px; box-shadow: 0 1px 2px rgba(var(--ink-shadow), .3), 0 4px 10px rgba(var(--ink-shadow), .28); }
.is-night .home img { box-shadow: 0 0 14px rgba(168,204,255,.35), 0 3px 8px rgba(0,0,0,.4); }
.home span { font: 800 20px/24px var(--font-display); color: var(--text-primary); }
.is-night .home span { color: var(--intro-text); }
.lhead nav { display: flex; gap: 28px; }
.lhead nav a { font: 700 16px var(--font-text); color: var(--text-secondary); text-decoration: none; }
.lhead nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 4px; }
.is-night .lhead nav a { color: var(--intro-text-muted); }
.doc { width: 680px; max-width: 100%; margin: 0 auto; padding: 72px 24px 24px; }
.back { font: 700 15px var(--font-text); color: var(--link); text-decoration: none; }
.is-night .back, .is-night .doc a { color: var(--intro-link); }
.doc h1 { font-size: 56px; line-height: 60px; margin: 20px 0 12px; }
.doc .meta { margin: 0 0 40px; font-size: 15px; color: var(--text-tertiary); }
.doc h2 { font: 700 28px/34px var(--font-display); margin: 36px 0 12px; color: var(--text-primary); }
.doc p, .doc li { font-size: 18px; line-height: 28px; color: var(--text-secondary); margin: 0; }
.doc ul, .doc ol { margin: 0; padding-left: 22px; display: grid; gap: 10px; }
.doc ul li::marker { color: var(--text-accent); }
.doc a { color: var(--link); font-weight: 700; }
.is-night .doc h2 { color: var(--intro-text); }
.is-night .doc p, .is-night .doc li, .is-night .doc .meta { color: var(--intro-text-muted); }
.doc .lead { margin-bottom: 8px; }
.btn-paper { display: inline-flex; align-items: center; height: 48px; padding: 0 24px; margin-top: 16px; border-radius: 12px; text-decoration: none;
  font: 700 17px var(--font-text); color: var(--text-primary) !important;
  background: linear-gradient(180deg, #f3e3bd, #dfc58f); border: 1.25px solid rgba(62,42,22,.85);
  box-shadow: inset 0 1px 0 rgba(255,244,220,.55), inset 0 -3px 0 rgba(122,85,32,.35), 0 4px 10px rgba(var(--ink-shadow), .2); }
/* Legal pages: paragraphs and blocks from the shared legal markup (privacy-v1, terms-v1, delete-v1) */
.doc > * + p, .doc > * + section, .doc > * + ol, .doc > * + ul, .doc > * + aside, .doc section > * + p { margin-top: 16px; }
.doc h1 + p { margin-top: 0; }
.doc h2 + p, .doc h2 + .who-we-are { margin-top: 0; }
.doc .who-we-are { margin: 0; }
.doc .who-we-are p { margin: 0; }
.doc ol.steps { margin-top: 12px; }
/* Opened from the app (?app=1): just the document */
html.app-embed .lhead, html.app-embed .foot, html.app-embed .back { display: none; }
html.app-embed .doc { padding-top: 24px; }

/* sections legal still has to confirm: visible, flagged only in review mode (?review) */
.review [data-draft] { outline: 1px dashed #e0a040; outline-offset: 12px; border-radius: 4px; position: relative; }
.review [data-draft]::before { content: "DRAFT · LEGAL TO CONFIRM"; position: absolute; top: -26px; left: 0; font: 700 11px/1 system-ui, sans-serif; color: #b77b1c; letter-spacing: .04em; }
.legal-page .foot { padding-top: 72px; border-top: 1px solid rgba(43,29,16,.07); margin-top: 72px; padding-bottom: 32px; }
.is-night .legal-page .foot { border-top-color: rgba(243,230,200,.08); }

/* ───────────── Tablet ───────────── */
@media (max-width: 1100px) {
  .hero, .done, .lost { padding-top: 120px; }
  .logo { width: 400px; }
  .lhead { padding: 18px 40px; }
}
/* ───────────── Mobile ───────────── */
@media (max-width: 600px) {
  body { font-size: 16px; }
  .page { padding: 0 24px; }
  .hero, .done, .lost { padding-top: 64px; }
  .logo { width: 320px; }
  .headline, .done h1, .lost h1 { font-size: 34px; line-height: 36px; margin-top: 20px; }
  .hero .btn { margin-top: 28px; min-width: 0; width: 100%; }
  .caption { font-size: 13px; line-height: 18px; margin-top: 12px; }
  .stats { width: 100%; padding: 12px 16px; gap: 8px; margin-bottom: 20px; --rim: 12px; }
  .stat small { display: none; }
  .stat dt { font-size: 11px; letter-spacing: .06em; }
  .stat b { font-size: 18px; line-height: 22px; }
  .foot { padding-bottom: 28px; gap: 8px; }
  .foot nav { gap: 4px 18px; }
  .foot a { font-size: 13px; line-height: 18px; }
  .foot p { font-size: 13px; line-height: 18px; }
  .land { --land-shift: -260px; --land-top: 12%;
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, transparent 42%, #000 56%, #000 100%);
            mask-image: linear-gradient(180deg, transparent 0%, transparent 42%, #000 56%, #000 100%); }
  .mist { top: 70%; height: 150px; opacity: calc(var(--mist, 1) * .6); }
  .fade { height: 170px; }
  .sun .glow { width: 240px; height: 240px; } .sun .disc { width: 56px; height: 56px; }
  .moon .glow { width: 200px; height: 200px; } .moon .disc { width: 44px; height: 44px; }
  .invite { padding-top: 28px; }
  .invite .app-icon { align-self: flex-start; margin-bottom: 28px; }
  .invite h1 { font-size: 26px; line-height: 30px; text-align: left; }
  .invite .intro { text-align: left; font-size: 14px; line-height: 20px; margin-top: 16px; }
  .invite form { margin-top: 28px; gap: 20px; }
  .label, legend.label { font-size: 12px; }
  .input, .choice span { height: 52px; font-size: 16px; }
  .choices { gap: 10px; }
  .check { font-size: 14px; }
  .fine { font-size: 13px; line-height: 18px; }
  .lhead { padding: 14px 24px; }
  .lhead nav { display: none; }
  .doc { padding-top: 40px; }
  .doc h1 { font-size: 34px; line-height: 36px; }
  .doc h2 { font: 700 24px/30px var(--font-display); margin-top: 28px; }
  .doc p, .doc li { font-size: 16px; line-height: 24px; }
  .legal-page .foot nav { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
