/* ═══════════════════════════════════════════════════════════════════
   DESIGN v4 — "THE GUILD HALL, FORGED"
   ─────────────────────────────────────────────────────────────────────
   The studio layer. Loaded AFTER main.css + revamp.css (cascade-wins).
   One painted world by torchlight: warm near-black, one light source
   per section, film grain glue, gold on ~5% of any page, one motion
   voice, and every effect designed tier-off-first.

   Sections:
     0. Self-hosted fonts (Google Fonts retired)
     1. Tokens — Utopia fluid type/space, easing, duration, tracking
     2. The warm dark + film grain
     3. Zone lighting (old-masters section system)
     4. The Gold Rite (metallic type) + engraved + drop caps
     5. Ornament: dividers + blessed frames + plaques
     6. Motion grammar (five recipes only)
     7. MPA soul-transfer (view transitions)
     8. Global chrome: header, sigil, footer second-hero
     9. Homepage hero v4 + ember layer (CSS base tier)
    10. Page treatments (live / world / creators / media / events /
        join / schedule / hall / store)
    11. Quartermaster hooks (t-low / rm / u-calm kill-switches)
   ═══════════════════════════════════════════════════════════════════ */

/* ── 0. FONTS ──────────────────────────────────────────────────────── */
@font-face {
  font-family: 'Cinzel VF';
  src: url('fonts/cinzel-latin-wght-normal.woff2') format('woff2-variations');
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+2013-2014, U+2018-201A, U+201C-201E, U+2022, U+2026, U+2726;
}
@font-face {
  font-family: 'Crimson Pro VF';
  src: url('fonts/crimson-pro-latin-wght-normal.woff2') format('woff2-variations');
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Crimson Pro VF';
  src: url('fonts/crimson-pro-latin-wght-italic.woff2') format('woff2-variations');
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Inter VF';
  src: url('fonts/inter-latin-wght-normal.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
/* metric-matched fallbacks: zero-CLS while the real files arrive */
@font-face {
  font-family: 'Cinzel-fallback';
  src: local('Georgia');
  size-adjust: 88%;
  ascent-override: 82%;
  descent-override: 24%;
}
@font-face {
  font-family: 'Crimson-fallback';
  src: local('Georgia');
  size-adjust: 94%;
}

/* ── 1. TOKENS ─────────────────────────────────────────────────────── */
:root {
  /* Utopia fluid type — 380px..1440px, base 17→19, ratio 1.2→1.25 */
  --step--1: clamp(0.8856rem, 0.8624rem + 0.0972vw, 0.95rem);
  --step-0:  clamp(1.0625rem, 1.0177rem + 0.1887vw, 1.1875rem);
  --step-1:  clamp(1.275rem,  1.1999rem + 0.316vw,  1.4844rem);
  --step-2:  clamp(1.53rem,   1.4133rem + 0.4913vw, 1.8555rem);
  --step-3:  clamp(1.836rem,  1.6627rem + 0.7296vw, 2.3193rem);
  --step-4:  clamp(2.2032rem, 1.9537rem + 1.0505vw, 2.8992rem);
  --step-5:  clamp(2.6438rem, 2.2925rem + 1.4794vw, 3.624rem);
  --step-6:  clamp(3.1725rem, 2.686rem  + 2.049vw,  4.53rem);

  /* matching fluid space */
  --space-3xs: clamp(0.2656rem, 0.2544rem + 0.0472vw, 0.2969rem);
  --space-2xs: clamp(0.5313rem, 0.5089rem + 0.0943vw, 0.5938rem);
  --space-xs:  clamp(0.7969rem, 0.7633rem + 0.1415vw, 0.8906rem);
  --space-s:   clamp(1.0625rem, 1.0177rem + 0.1887vw, 1.1875rem);
  --space-m:   clamp(1.5938rem, 1.5266rem + 0.283vw,  1.7813rem);
  --space-l:   clamp(2.125rem,  2.0354rem + 0.3774vw, 2.375rem);
  --space-xl:  clamp(3.1875rem, 3.053rem  + 0.566vw,  3.5625rem);
  --space-2xl: clamp(4.25rem,   4.0708rem + 0.7547vw, 4.75rem);
  --space-3xl: clamp(6.375rem,  6.1063rem + 1.132vw,  7.125rem);

  /* one motion voice */
  --ease-out-expo:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-inout:     cubic-bezier(0.65, 0, 0.35, 1);
  --dur-1: 70ms; --dur-2: 120ms; --dur-3: 200ms;
  --dur-4: 300ms; --dur-5: 500ms; --dur-6: 800ms;

  /* tracking */
  --track-caps-label: 0.1em;
  --track-caps-bold: 0.06em;
  --track-display-xl: -0.015em;

  /* fonts — Cinzel Decorative retires (survives only inside the wordmark) */
  --font-display: 'Cinzel VF', 'Cinzel-fallback', Georgia, serif;
  --font-head:    'Cinzel VF', 'Cinzel-fallback', Georgia, serif;
  --font-body:    'Crimson Pro VF', 'Crimson-fallback', Georgia, serif;
  --font-ui:      'Inter VF', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* the warm dark (never void-black) */
  --bg:      #0d0a08;
  --bg-2:    #120e0a;
  --bg-3:    #181209;
  --bg-card: #14100b;

  /* gold rite stops */
  --au-hi: #ffecb3; --au-mid: #cfc09f; --au-lo: #3a2c0f;
  --au-solid: #e7c86a;

  /* embers */
  --ember-1: #ff4d00;
  --ember-2: #ffb347;

  /* zone light hues */
  --zone-hearth: 24 90% 48%;   /* ember orange */
  --zone-forge:  38 75% 52%;   /* gold */
  --zone-crypt:  258 45% 45%;  /* arcane violet */
  --zone-cool:   205 45% 45%;  /* moonlit steel */
}

/* ── 2. THE WARM DARK + GRAIN ─────────────────────────────────────── */
body {
  background:
    radial-gradient(120% 90% at 50% -10%, #1a120a 0%, transparent 55%),
    var(--bg);
  font-family: var(--font-body);
}
/* film grain: one fixed compositor layer, tier-independent (banding fix) */
body::after {
  content: '';
  position: fixed; inset: 0;
  background: url('/img/textures/noise-256.png') repeat;
  background-size: 256px 256px;
  opacity: 0.05;
  pointer-events: none;
  z-index: 2147483000;
  mix-blend-mode: overlay;
}
::selection { background: rgba(232, 123, 30, 0.32); color: #fff3e0; }

/* UI face: plain, legible, quiet — the beginner-friendly voice */
button, input, select, textarea, .mb-nav, .mb-drawer, .hp-pill, .hp-btn,
.btn, .badge, .chip, .hp-form, .flash, .hp-stats, .cal-ev, table {
  font-family: var(--font-ui);
}
.mb-nav a { letter-spacing: 0.02em; }

/* ── 3. ZONE LIGHTING ─────────────────────────────────────────────── */
/* One radial light source per section. Position/hue set by modifier. */
.zone { position: relative; isolation: isolate; }
.zone::before {
  content: '';
  position: absolute; inset: -8% -20%;
  background: radial-gradient(58% 52% at var(--zx, 50%) var(--zy, 12%),
              hsl(var(--zh, var(--zone-hearth)) / 0.13) 0%,
              hsl(var(--zh, var(--zone-hearth)) / 0.05) 42%,
              transparent 72%);
  pointer-events: none;
  z-index: -1;
}
.zone--hearth { --zh: var(--zone-hearth); }
.zone--forge  { --zh: var(--zone-forge); }
.zone--crypt  { --zh: var(--zone-crypt); }
.zone--cool   { --zh: var(--zone-cool); }
.zone--left   { --zx: 18%; }
.zone--right  { --zx: 82%; }
.zone--mid    { --zy: 45%; }

/* paintings dissolve into the dark like varnished canvas */
.canvas-fade {
  -webkit-mask-image: radial-gradient(120% 100% at 50% 40%, #000 55%, transparent 98%);
          mask-image: radial-gradient(120% 100% at 50% 40%, #000 55%, transparent 98%);
}
.canvas-fade-b {
  -webkit-mask-image: linear-gradient(to bottom, #000 62%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 62%, transparent 100%);
}

/* ── 4. THE GOLD RITE ─────────────────────────────────────────────── */
/* One sanctioned metallic treatment. Markup: goldTitle() emits
   <span class="gt"><span class="gt__shadow" aria-hidden>TEXT</span><span class="gt__fill">TEXT</span></span> */
.gt { position: relative; display: inline-block; }
.gt__shadow {
  position: absolute; inset: 0;
  color: transparent;
  text-shadow:
    0 3px 18px rgba(0, 0, 0, 0.9),
    0 1px 3px rgba(0, 0, 0, 0.95),
    0 0 46px rgba(0, 0, 0, 0.65);
  z-index: 0;
}
.gt__fill {
  position: relative; z-index: 1;
  background: linear-gradient(to bottom,
    #fff6d8 6%, #ffe9a8 32%, #f2cd76 55%, #d9a943 74%, #9a7526 90%, #c9a24d 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
@supports not (background-clip: text) {
  .gt__fill { background: none; color: var(--au-solid); }
}
/* hero-only glint: 60% hold so it reads as a glint, not a spinner */
.gt--sheen .gt__fill {
  background-image: linear-gradient(to bottom,
      #fff6d8 6%, #ffe9a8 32%, #f2cd76 55%, #d9a943 74%, #9a7526 90%, #c9a24d 100%),
    linear-gradient(105deg, transparent 38%, rgba(255, 250, 228, 0.9) 50%, transparent 62%);
  background-size: 100% 100%, 220% 100%;
  background-position: 0 0, 180% 0;
  -webkit-background-clip: text; background-clip: text;
  animation: gt-glint 7s var(--ease-inout) infinite;
}
@keyframes gt-glint {
  0%, 58%  { background-position: 0 0, 180% 0; }
  72%, 100% { background-position: 0 0, -80% 0; }
}

/* engraved: cut into the stone, for section labels/eyebrows */
.engraved {
  font-family: var(--font-head);
  text-transform: uppercase;
  letter-spacing: var(--track-caps-label);
  color: #8f8069;
  text-shadow: 0 -1px 1px rgba(0, 0, 0, 0.85), 0 1px 0 rgba(255, 235, 180, 0.14);
}

/* display type rules */
h1, .display-title, .hp-hero__title { letter-spacing: var(--track-display-xl); }
.eyebrow { letter-spacing: var(--track-caps-label); }

/* illuminated versal for lore/policy pages */
@supports (initial-letter: 3) {
  .drop-cap::first-letter {
    initial-letter: 3 3;
    font-family: var(--font-head);
    font-weight: 700;
    color: var(--au-solid);
    margin-right: 0.14em;
  }
}
@supports not (initial-letter: 3) {
  .drop-cap::first-letter {
    float: left;
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 3.1em;
    line-height: 0.82;
    color: var(--au-solid);
    margin: 0.04em 0.12em 0 0;
  }
}

/* ── 5. ORNAMENT ──────────────────────────────────────────────────── */
/* line—diamond—line divider (emitted by divider() helper as inline SVG) */
.orn-divider {
  display: flex; align-items: center; justify-content: center;
  gap: 0; margin: var(--space-s) 0 var(--space-m);
  color: rgba(201, 168, 76, 0.55);
}
.orn-divider svg { display: block; width: min(260px, 60%); height: 12px; }
.orn-divider--wide svg { width: min(420px, 80%); }

/* blessed frame — the painted hand-forged gold ornament (9-slice).
   Max 2-3 per page; the transparent border keeps structure if the
   sheet ever fails to load. */
.frame-gold {
  position: relative;
  border: 20px solid transparent;
  border-image: url('/img/ui/frame-gold.webp') 90 / 20px round;
  border-radius: 0;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}
@media (max-width: 640px) {
  .frame-gold { border-width: 14px; border-image-width: 14px; }
}

/* engraved plaque: dates, viewer counts, stat chips over art */
.plaque {
  display: inline-flex; align-items: center; gap: 0.45em;
  font-family: var(--font-ui);
  font-size: var(--step--1);
  letter-spacing: 0.04em;
  color: #d9c9a8;
  background: linear-gradient(to bottom, rgba(26, 20, 12, 0.92), rgba(14, 11, 7, 0.92));
  border: 1px solid rgba(201, 168, 76, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 235, 180, 0.09), 0 2px 10px rgba(0, 0, 0, 0.5);
  padding: 0.3em 0.75em;
  border-radius: 3px;
}

/* parchment + forged surfaces */
.tx-parchment {
  background: url('/img/textures/parchment-512.webp') repeat, #d3c39a;
  background-blend-mode: multiply;
  color: #241b0d;
}
.tx-forged {
  background: url('/img/textures/forged-512.webp') repeat, #171208;
}

/* ── 6. MOTION GRAMMAR — the five recipes ─────────────────────────── */
/* Initial-hidden states ONLY under html.js — no-JS never hides content.
   Every recipe reveals once; IO fallback adds .g-in. */
html.js .g-fade, html.js .g-media, html.js .g-rule, html.js .g-line {
  animation-duration: var(--dur-6);
  animation-timing-function: var(--ease-out-expo);
  animation-fill-mode: both;
}
/* (1) fade-up */
html.js .g-fade { animation-name: g-fade; animation-delay: calc(var(--i, 0) * 60ms); }
@keyframes g-fade {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: none; }
}
/* (2) media reveal: clip up + inner counter-zoom (pair .g-media > img.g-media__inner) */
html.js .g-media { animation-name: g-media; }
@keyframes g-media {
  from { clip-path: inset(100% 0 0 0); }
  to   { clip-path: inset(0 0 0 0); }
}
html.js .g-media .g-media__inner { animation: g-media-zoom var(--dur-6) var(--ease-out-expo) both; }
@keyframes g-media-zoom {
  from { transform: scale(1.18); }
  to   { transform: none; }
}
/* (3) rule-draw */
html.js .g-rule { animation-name: g-rule; transform-origin: left center; }
@keyframes g-rule {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
/* (4) line-mask title (block-level line reveal; char-level is GSAP, home only) */
html.js .g-line { overflow: clip; }
html.js .g-line > * { animation: g-line var(--dur-6) var(--ease-out-expo) both; }
@keyframes g-line {
  from { transform: translateY(108%); }
  to   { transform: none; }
}
/* scroll-driven when supported; IO fallback pauses until .g-in */
@supports (animation-timeline: view()) {
  html.js .g-fade, html.js .g-media, html.js .g-rule, html.js .g-line > *,
  html.js .g-media .g-media__inner {
    animation-duration: auto;
    animation-timeline: view();
    animation-range: entry 5% entry 55%;
  }
}
@supports not (animation-timeline: view()) {
  html.js .g-fade, html.js .g-media, html.js .g-rule, html.js .g-line > *,
  html.js .g-media .g-media__inner { animation-play-state: paused; }
  html.js .g-in.g-fade, html.js .g-in.g-media, html.js .g-in.g-rule,
  html.js .g-in.g-line > *, html.js .g-in.g-media .g-media__inner { animation-play-state: running; }
  /* rescue net: if the reveal driver never arrives (fx-core fails to
     load), content still surfaces on its own — mirrors fl-rescue */
  html.js .g-fade, html.js .g-media, html.js .g-rule, html.js .g-line > *,
  html.js .g-media .g-media__inner {
    animation-name: g-fade, g-rescue-any;
    animation-duration: var(--dur-6), 0.5s;
    animation-delay: calc(var(--i, 0) * 60ms), 3s;
    animation-play-state: paused, running;
    animation-fill-mode: both, forwards;
  }
  html.js .g-media { animation-name: g-media, g-rescue-any; }
  html.js .g-rule { animation-name: g-rule, g-rescue-any; }
  html.js .g-line > * { animation-name: g-line, g-rescue-any; }
  html.js .g-media .g-media__inner { animation-name: g-media-zoom, g-rescue-any; }
  @keyframes g-rescue-any {
    to { opacity: 1; transform: none; clip-path: inset(0 0 0 0); }
  }
}

/* decorative slow parallax on section art (scrub is for decoration only) */
@supports (animation-timeline: view()) {
  .g-drift { animation: g-drift auto linear both; animation-timeline: view(); animation-range: cover 0% cover 100%; }
  @keyframes g-drift {
    from { transform: translateY(4%) scale(1.06); }
    to   { transform: translateY(-4%) scale(1.06); }
  }
}

/* ── 7. MPA SOUL-TRANSFER ─────────────────────────────────────────── */
@view-transition { navigation: auto; }
.mb-header { view-transition-name: site-header; }
.vt-title { view-transition-name: page-title; }
.vt-hero  { view-transition-name: detail-hero; }
::view-transition-old(root) {
  animation: vt-out 200ms var(--ease-inout) both;
}
::view-transition-new(root) {
  animation: vt-in 350ms var(--ease-out-expo) both;
}
@keyframes vt-out { to { opacity: 0; transform: translateY(-14px); } }
@keyframes vt-in  { from { opacity: 0; transform: translateY(18px); } }
::view-transition-old(site-header), ::view-transition-new(site-header) { animation: none; }
::view-transition-group(page-title), ::view-transition-group(detail-hero) {
  animation-duration: 320ms;
  animation-timing-function: var(--ease-inout);
}

/* ── 8. GLOBAL CHROME ─────────────────────────────────────────────── */
/* brand sigil */
.brand-sigil { display: inline-block; width: 1.35em; height: 1.35em; vertical-align: -0.32em; }
.mb-brand .brand-sigil { filter: drop-shadow(0 0 6px rgba(240, 180, 69, 0.35)); }

/* header: quieter glass, condensed when stuck */
.mb-header { backdrop-filter: blur(10px); }
.mb-header.is-scrolled { box-shadow: 0 1px 0 rgba(201, 168, 76, 0.22), 0 12px 30px rgba(0, 0, 0, 0.45); }

/* ——— the Second Hero footer (sticky under-reveal) ——— */
.site-over {
  position: relative; z-index: 1;
  min-height: 100svh;   /* short pages never expose the footer early */
  background:
    radial-gradient(120% 90% at 50% -10%, #1a120a 0%, transparent 55%),
    var(--bg);
}
.site-over::after {
  /* soft shadow cast onto the footer beneath as content lifts away */
  content: '';
  position: absolute; left: 0; right: 0; bottom: -42px; height: 42px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), transparent);
  pointer-events: none;
}
.v4-footer {
  position: sticky; bottom: 0; z-index: 0;
  min-height: min(88vh, 760px);
  display: flex; flex-direction: column; justify-content: flex-end;
  background:
    radial-gradient(70% 55% at 50% 100%, rgba(232, 123, 30, 0.16) 0%, transparent 65%),
    radial-gradient(45% 35% at 50% 96%, rgba(255, 179, 71, 0.1) 0%, transparent 70%),
    #0a0705;
  overflow: clip;
}
.v4-footer__inner {
  width: min(1180px, 92%);
  margin: 0 auto;
  padding: var(--space-2xl) 0 var(--space-l);
}
.v4-footer__motto {
  font-family: var(--font-head);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: var(--track-display-xl);
  font-size: clamp(2.6rem, 9.5vw, 8.4rem);
  line-height: 0.98;
  text-align: center;
  margin: 0 0 var(--space-xl);
}
.v4-footer__sigil {
  display: block; width: clamp(44px, 6vw, 72px); height: auto;
  margin: 0 auto var(--space-m);
  filter: drop-shadow(0 0 18px rgba(240, 180, 69, 0.4));
}
.v4-footer__cta { text-align: center; margin-bottom: var(--space-2xl); }
.v4-footer__cols {
  display: grid; grid-template-columns: 1.2fr repeat(3, 1fr);
  gap: var(--space-l);
  padding-top: var(--space-l);
  border-top: 1px solid rgba(201, 168, 76, 0.22);
}
.v4-footer__brandcol p { color: #9b8d78; font-size: var(--step--1); max-width: 34ch; }
.v4-footer nav h3 {
  font-family: var(--font-head); font-size: 0.72rem;
  letter-spacing: var(--track-caps-label); text-transform: uppercase;
  color: #8f8069; margin: 0 0 0.7rem;
}
.v4-footer nav a {
  display: block; padding: 0.22rem 0;
  font-family: var(--font-ui); font-size: 0.92rem;
  color: #b7a88f; text-decoration: none;
  transition: color var(--dur-3) var(--ease-out-quart), transform var(--dur-3) var(--ease-out-quart);
}
.v4-footer nav a:hover { color: var(--au-solid); transform: translateX(3px); }
.v4-footer__legal {
  display: flex; flex-wrap: wrap; gap: var(--space-s);
  justify-content: space-between; align-items: center;
  margin-top: var(--space-l); padding-top: var(--space-s);
  border-top: 1px solid rgba(201, 168, 76, 0.12);
  color: #a89a87; font-family: var(--font-ui); font-size: 0.8rem;
}
.v4-footer__embers { position: absolute; inset: 0; pointer-events: none; }
@media (max-width: 860px) {
  .v4-footer { min-height: 0; position: static; }
  .v4-footer__cols { grid-template-columns: 1fr 1fr; }
}

/* ── 9. HOMEPAGE HERO v4 + CSS EMBER BASE ─────────────────────────── */
.v4hero {
  --zy: 40%;   /* the hall's light source sits behind the title */
  position: relative;
  /* full-bleed breakout: the hall fills the screen, not the column */
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-top: calc(-1 * (var(--pad-section, 3rem) + var(--header-h, 68px) + 1px));
  min-height: min(96vh, 980px);
  display: grid; place-items: center;
  text-align: center;
  isolation: isolate;
  overflow: clip;
  padding: calc(var(--header-h, 64px) + var(--space-xl)) 0 var(--space-2xl);
}
/* with no key art yet, give the hall floor a banked-coals glow */
.v4hero::after {
  content: '';
  position: absolute; inset: auto 0 0 0; height: 45%;
  background: radial-gradient(60% 90% at 50% 100%, rgba(232, 123, 30, 0.14), transparent 70%);
  pointer-events: none;
  z-index: -2;
}
.v4hero__art { position: absolute; inset: 0; z-index: -3; }
.v4hero__art img, .v4hero__art canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
}
.v4hero__art img { filter: saturate(0.92) brightness(0.8); z-index: 0; object-position: center 62%; }
.v4hero__art canvas { z-index: 1; }
.v4hero__art::after {
  /* text protection: hall recedes behind the words */
  content: '';
  position: absolute; inset: 0; z-index: 2;
  background:
    radial-gradient(85% 70% at 50% 46%, transparent 30%, rgba(10, 7, 5, 0.55) 78%, rgba(10, 7, 5, 0.92) 100%),
    linear-gradient(to bottom, rgba(10, 7, 5, 0.55), transparent 28%, transparent 62%, var(--bg) 98%);
}
.v4hero__fx { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.v4hero__inner { position: relative; z-index: 2; width: min(980px, 92%); }
.v4hero__eyebrow { margin-bottom: var(--space-s); }
.v4hero__title {
  font-family: var(--font-head);
  font-weight: 800;
  text-transform: uppercase;
  font-size: var(--step-6);
  line-height: 1.04;
  margin: 0 0 var(--space-s);
}
.v4hero__motto {
  font-family: var(--font-body);
  font-style: italic;
  font-size: var(--step-1);
  color: #cbbc9e;
  margin: 0 auto var(--space-m);
  max-width: 46ch;
}
.v4hero__cta { display: flex; gap: var(--space-s); justify-content: center; flex-wrap: wrap; }
.v4hero__canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; transition: opacity 1.2s var(--ease-out-expo);
}
.v4hero__canvas.is-lit { opacity: 1; }

/* CSS ember base tier: 24 spans, transform/opacity only (markup: emberField()) */
.embers-css { position: absolute; inset: 0; overflow: clip; pointer-events: none; z-index: -2; }
.embers-css i {
  position: absolute;
  bottom: -2%;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--ember-2);
  box-shadow: 0 0 6px 1px var(--ember-1);
  opacity: 0;
  animation: ember-rise var(--d, 16s) linear infinite;
  animation-delay: var(--ad, 0s);
  left: var(--x, 50%);
}
.embers-css i:nth-child(3n)  { width: 3px; height: 3px; }
.embers-css i:nth-child(4n)  { width: 5px; height: 5px; background: var(--ember-1); }
.embers-css i:nth-child(2n)  { --drift: 5vw; }
.embers-css i:nth-child(5n)  { --drift: -6vw; }
.embers-css i:nth-child(7n)  { --drift: 8vw; }
/* deterministic spread: golden-ratio columns, staggered pre-warmed loops */
.ef-0  { --x: 4%;  --d: 15s; --ad: -2s; }   .ef-1  { --x: 62%; --d: 19s; --ad: -7s; }
.ef-2  { --x: 24%; --d: 12s; --ad: -11s; }  .ef-3  { --x: 85%; --d: 22s; --ad: -4s; }
.ef-4  { --x: 47%; --d: 16s; --ad: -14s; }  .ef-5  { --x: 9%;  --d: 24s; --ad: -9s; }
.ef-6  { --x: 71%; --d: 13s; --ad: -17s; }  .ef-7  { --x: 33%; --d: 20s; --ad: -1s; }
.ef-8  { --x: 94%; --d: 17s; --ad: -12s; }  .ef-9  { --x: 56%; --d: 11s; --ad: -6s; }
.ef-10 { --x: 18%; --d: 23s; --ad: -19s; }  .ef-11 { --x: 80%; --d: 14s; --ad: -3s; }
.ef-12 { --x: 42%; --d: 21s; --ad: -15s; }  .ef-13 { --x: 6%;  --d: 12s; --ad: -8s; }
.ef-14 { --x: 66%; --d: 18s; --ad: -21s; }  .ef-15 { --x: 28%; --d: 15s; --ad: -5s; }
.ef-16 { --x: 90%; --d: 24s; --ad: -13s; }  .ef-17 { --x: 52%; --d: 13s; --ad: -18s; }
.ef-18 { --x: 14%; --d: 19s; --ad: -10s; }  .ef-19 { --x: 76%; --d: 16s; --ad: -22s; }
.ef-20 { --x: 38%; --d: 22s; --ad: -2s; }   .ef-21 { --x: 98%; --d: 14s; --ad: -16s; }
.ef-22 { --x: 60%; --d: 20s; --ad: -7s; }   .ef-23 { --x: 21%; --d: 17s; --ad: -20s; }
@keyframes ember-rise {
  0%   { transform: translate(0, 0) scale(1);   opacity: 0; }
  6%   { opacity: 0.9; }
  55%  { opacity: 0.55; }
  100% { transform: translate(var(--drift, 2vw), -108vh) scale(0.35); opacity: 0; }
}

/* ── 9b. FIRST LIGHT (home preloader) ─────────────────────────────── */
/* Only ever visible under html.fl-armed (boot.js decides, pre-paint). */
.firstlight { display: none; }
html.fl-armed .firstlight, .firstlight.is-lifting {
  display: grid; place-items: center;
  position: fixed; inset: 0; z-index: 2147483200;
  background:
    radial-gradient(60% 45% at 50% 62%, rgba(232, 123, 30, 0.09), transparent 70%),
    #0a0705;
}
html.fl-armed .v4hero__title,
html.fl-armed .v4hero__eyebrow,
html.fl-armed .v4hero__motto,
html.fl-armed .v4hero__cta {
  opacity: 0.001;
  /* rescue: if the cinema script dies, the hero surfaces on its own */
  animation: fl-rescue 0.5s var(--ease-out-expo) 3.2s forwards;
}
@keyframes fl-rescue { to { opacity: 1; } }
html.fl-armed .firstlight { animation: fl-rescue-hide 0.4s linear 3.4s forwards; }
@keyframes fl-rescue-hide { to { opacity: 0; visibility: hidden; } }
.firstlight__mark { text-align: center; }
.firstlight__mark svg { width: 64px; height: 64px; filter: drop-shadow(0 0 22px rgba(240, 180, 69, 0.5)); }
.firstlight__count {
  display: block;
  margin-top: 0.9rem;
  font-family: var(--font-head);
  font-size: 0.85rem;
  letter-spacing: 0.22em;
  color: #8f8069;
  font-variant-numeric: tabular-nums;
}
.fl-char { display: inline-block; will-change: transform; }
.fl-word { display: inline-block; white-space: nowrap; }
.v4hero__title { overflow: clip; }

/* ── 10. PAGE TREATMENTS ──────────────────────────────────────────── */
/* /live — the Hearth stage */
.hearth-stage {
  position: relative;
  padding: var(--space-m);
  background:
    radial-gradient(80% 100% at 50% 100%, rgba(232, 123, 30, 0.13), transparent 70%),
    var(--bg-card);
}
.hearth-stage .plaque { position: relative; }
.live-dot {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  background: #ff4b4b;
  box-shadow: 0 0 0 0 rgba(255, 75, 75, 0.55);
  animation: live-pulse 2.2s var(--ease-out-quart) infinite;
}
@keyframes live-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255, 75, 75, 0.55); }
  70%  { box-shadow: 0 0 0 9px rgba(255, 75, 75, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 75, 75, 0); }
}
.hearth-banked {
  filter: saturate(0.55) brightness(0.72);
  transition: filter var(--dur-5) var(--ease-out-quint);
}
.hearth-banked:hover { filter: saturate(0.85) brightness(0.9); }

/* roster focus-dimming (creators, crew, codex grids) */
@media (hover: hover) and (pointer: fine) {
  .focus-dim:has(> :hover) > :not(:hover) {
    opacity: 0.45;
    transition: opacity var(--dur-4) var(--ease-out-quart);
  }
  .focus-dim > * { transition: opacity var(--dur-4) var(--ease-out-quart); }
}

/* poster cards (events) */
.poster-card {
  position: relative; overflow: clip;
  border: 1px solid rgba(201, 168, 76, 0.25);
  background-size: cover; background-position: center;
}
.poster-card::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(10, 7, 5, 0.93) 18%, rgba(10, 7, 5, 0.35) 55%, rgba(10, 7, 5, 0.15) 100%);
}
.poster-card > * { position: relative; }

/* podium (legends, clip of the month) */
.podium { display: grid; grid-template-columns: 1fr 1.25fr 1fr; gap: var(--space-s); align-items: end; }
.podium__step { text-align: center; padding: var(--space-s); border-top: 2px solid; }
.podium__step--1 { border-color: var(--au-solid); background: linear-gradient(to bottom, rgba(201, 168, 76, 0.14), transparent); }
.podium__step--2 { border-color: #9fa8b5; background: linear-gradient(to bottom, rgba(159, 168, 181, 0.1), transparent); }
.podium__step--3 { border-color: #b8763d; background: linear-gradient(to bottom, rgba(184, 118, 61, 0.1), transparent); }
@media (max-width: 640px) { .podium { grid-template-columns: 1fr; } .podium__step { border-top-width: 1px; } }

/* skeleton shimmer — ember-tinted, translate not background-position */
.skel { position: relative; overflow: clip; background: rgba(255, 255, 255, 0.03); }
.skel::after {
  content: '';
  position: absolute; inset: 0 -60%;
  background: linear-gradient(100deg, transparent 38%, rgba(255, 150, 50, 0.06) 50%, transparent 62%);
  animation: skel-sweep 1.6s var(--ease-inout) infinite;
}
@keyframes skel-sweep { from { transform: translateX(-45%); } to { transform: translateX(45%); } }

/* press feedback everywhere interactive */
.btn:active, .hp-btn:active, button:active { transform: scale(0.97); }

/* ── 10b. KEYART WIRING ───────────────────────────────────────────── */
/* new painted banners join the v3 .pgart-- system */
.pgart--hearth    { background-image: url('/img/keyart/hearth-1600.webp'); background-position: center 60%; }
.pgart--guildhall { background-image: url('/img/keyart/guildhall-hero-1600.webp'); background-position: center 55%; }
.pgart--threshold { background-image: url('/img/keyart/threshold-1600.webp'); background-position: center 40%; }
/* location banners: same art, 40× lighter than the v3 PNGs */
.pgart--abyssal_depths     { background-image: url('/img/rpg/locations/banner/abyssal_depths-1920.webp'); }
.pgart--bandit_valley      { background-image: url('/img/rpg/locations/banner/bandit_valley-1920.webp'); }
.pgart--cragspire_gorge    { background-image: url('/img/rpg/locations/banner/cragspire_gorge-1920.webp'); }
.pgart--dampwood_marsh     { background-image: url('/img/rpg/locations/banner/dampwood_marsh-1920.webp'); }
.pgart--elydian_domain     { background-image: url('/img/rpg/locations/banner/elydian_domain-1920.webp'); }
.pgart--lush_forest        { background-image: url('/img/rpg/locations/banner/lush_forest-1920.webp'); }
.pgart--shadow_ridge       { background-image: url('/img/rpg/locations/banner/shadow_ridge-1920.webp'); }
.pgart--thunderstep_plains { background-image: url('/img/rpg/locations/banner/thunderstep_plains-1920.webp'); }

/* ── 10c. AMBIENT LIFE (the "always animating, never shouting" layer) ── */
/* zone light sources breathe like firelight */
.zone::before { animation: zone-breathe 9s var(--ease-inout) infinite; }
@keyframes zone-breathe {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.72; }
}
/* the hero painting never sits still: a 40s living drift */
.v4hero__art img { animation: hero-live 40s var(--ease-inout) infinite alternate; }
@keyframes hero-live {
  from { transform: scale(1.02) translateY(0); }
  to   { transform: scale(1.07) translateY(-1.2%); }
}
/* the sigil's molten core glows on a slow pulse */
.mb-brand .brand-sigil, .v4-footer__sigil {
  animation: sigil-pulse 5.5s var(--ease-inout) infinite;
}
@keyframes sigil-pulse {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(240, 180, 69, 0.3)); }
  50%      { filter: drop-shadow(0 0 14px rgba(240, 180, 69, 0.6)); }
}
/* gold hairline shimmer under section heads (rides the divider) */
.orn-divider svg { transition: color var(--dur-5) var(--ease-out-quint); }
.zone:hover .orn-divider svg { color: rgba(232, 178, 76, 0.85); }

/* /live: the Hearth painting glows behind the featured stage */
.hearth-stage {
  background:
    linear-gradient(to top, rgba(13, 10, 8, 0.94) 4%, rgba(13, 10, 8, 0.62) 45%, rgba(13, 10, 8, 0.4) 100%),
    url('/img/keyart/hearth-800.webp') center 65% / cover no-repeat,
    var(--bg-card);
}
/* /join: the threshold doors, light spilling toward the visitor */
.join-threshold {
  position: relative;
  isolation: isolate;
  overflow: clip;
}
.join-threshold { min-height: 480px; display: grid; align-items: center; }
.join-threshold::after {
  content: '';
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(90% 80% at 50% 55%, transparent 42%, rgba(13, 10, 8, 0.55) 80%, rgba(13, 10, 8, 0.94) 100%),
    linear-gradient(to bottom, rgba(13, 10, 8, 0.3), transparent 28%, transparent 66%, var(--bg) 98%),
    url('/img/keyart/threshold-1600.webp') center 45% / cover no-repeat;
}

/* ── 11. QUARTERMASTER KILL-SWITCHES ─────────────────────────────── */
/* t-low: cheap phones — no blur, no ember divs, no sheen, no drift */
html.t-low .mb-header { backdrop-filter: none; background: rgba(10, 8, 6, 0.96); }
html.t-low .embers-css, html.t-low .v4hero__canvas, html.t-low .v4-footer__embers { display: none; }
html.t-low .gt--sheen .gt__fill { animation: none; }
html.t-low .g-drift { animation: none; }

/* reduced-motion ∪ calm: everything decorative jumps to its end state.
   Static gold, grain, and layout stay — the designed tier-off page. */
@media (prefers-reduced-motion: reduce) {
  html.js .g-fade, html.js .g-media, html.js .g-rule, html.js .g-line > *,
  html.js .g-media .g-media__inner { animation: none; }
  .gt--sheen .gt__fill { animation: none; }
  .embers-css i { animation: none; opacity: 0; }
  .g-drift { animation: none; }
  .live-dot { animation: none; }
  .skel::after { animation: none; }
  .zone::before, .v4hero__art img,
  .mb-brand .brand-sigil, .v4-footer__sigil { animation: none; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
body.u-calm .zone::before, body.u-calm .v4hero__art img,
body.u-calm .mb-brand .brand-sigil, body.u-calm .v4-footer__sigil { animation: none; }
body.u-calm .g-fade, body.u-calm .g-media, body.u-calm .g-rule, body.u-calm .g-line > *,
body.u-calm .g-media .g-media__inner { animation: none; }
body.u-calm .gt--sheen .gt__fill { animation: none; }
body.u-calm .embers-css i { animation: none; opacity: 0; }
body.u-calm .g-drift, body.u-calm .live-dot, body.u-calm .skel::after { animation: none; }

/* calm at the root (server-rendered on <html>): the things body-scoped
   selectors can't reach — page morphs, the preloader, ambient layers */
html.u-calm ::view-transition-group(*),
html.u-calm ::view-transition-old(*),
html.u-calm ::view-transition-new(*) { animation: none !important; }
html.u-calm .firstlight { display: none; }
html.u-calm .zone::before, html.u-calm .v4hero__art img,
html.u-calm .brand-sigil, html.u-calm .v4-footer__sigil { animation: none; }


/* ═══════════ v4 PAGE-SPECIFIC (merged from page-treatment pass) ═══════════ */

/* ── /live (v4): the Hearth stage ─────────────────────────────────── */
/* plaque meta row (viewers · uptime · game) under each live stream */
.live-card__plaques { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.45rem; margin: 0 0 0.5rem; }
/* nothing animates near the embeds: kill the hover lift on live cards */
.live-card-live:hover { transform: none; }
/* the one blessed stage: square corners so the gilded frame + corner
   caps read; keep the gold border on hover (beats .live-card:hover) */
.live-card.hearth-stage { border-radius: 0; overflow: visible; }
.live-card.hearth-stage:hover { border-color: rgba(201, 168, 76, 0.5); }

/* ── page: /world codex (v4 pass) ─────────────────────────────────
   Monster portrait now sits in a .codex-mon__frame wrapper (g-media
   reveal recipe needs a clipping frame around the <picture>); the
   frame takes over the old portrait's bleed margins. Names go Cinzel. */
.codex-mon__frame {
  position: relative;
  margin: -0.75rem -0.85rem 0.35rem;
  border-bottom: 1px solid var(--border-strong);
  overflow: clip;
}
.codex-mon__frame .codex-mon__portrait { width: 100%; margin: 0; border-bottom: 0; }
.codex-mon__name { font-family: var(--font-head, 'Cinzel', serif); letter-spacing: 0.02em; }

/* ── page: /legends — podium dais spot layout (v4 skin) ──────────── */
.lgd-dais { margin: var(--space-m) 0 var(--space-l); }
.lgd-spot {
  display: flex; flex-direction: column; align-items: center;
  justify-content: flex-end; gap: 0.55rem;
}
.lgd-dais .lgd-spot--1 { min-height: 15rem; padding-bottom: var(--space-m); }
.lgd-dais .lgd-spot--2 { min-height: 12rem; }
.lgd-dais .lgd-spot--3 { min-height: 10.5rem; }
.lgd-spot__medal { font-size: 1.7rem; line-height: 1; filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.6)); }
.lgd-spot--1 .lgd-spot__medal { font-size: 2.4rem; }
.lgd-spot .lgd-name { font-family: var(--font-head); font-weight: 600; overflow-wrap: anywhere; }
.lgd-spot--1 .lgd-name { font-size: 1.15rem; }
.lgd-spot__chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.35rem; }
@media (max-width: 640px) {
  .lgd-dais .lgd-spot { min-height: 0; }
  .lgd-dais .lgd-spot--1 { order: -1; }
}

/* ── /c/:handle (creator profile) v4 — hero plaque row ─────────────── */
.hp-profile-hero__plaques { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0.7rem 0 0; }

/* ── /media + /clips v4 page treatment ─────────────────────────────
   Crown ribbon on the Clip-of-the-Month leader card (plaque + gold-rite
   tally), and compact plaque sizing for the creator byline in card meta. */
.hp-media__crown {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 0.5rem;
  padding: 0.75rem 0.9rem 0;
  font-family: var(--font-head);
  font-size: var(--step--1);
  letter-spacing: 0.04em;
}
.hp-media__meta .plaque { font-size: 0.72rem; padding: 0.12em 0.55em; }

/* ── EVENTS v4 — poster cards (/events) ──────────────────────────────
   Composition layer over .poster-card + .pgart-- backdrops. Location
   art carries baked-in title text at the TOP of the image, so posters
   crop to `center bottom`. */
.ev-poster {
  display: flex; flex-direction: column; justify-content: flex-end;
  gap: 0.4rem;
  min-height: 210px;
  padding: var(--space-s);
  background-position: center bottom;
  text-decoration: none;
  transition: transform var(--dur-3) var(--ease-out-quart),
              border-color var(--dur-3) var(--ease-out-quart),
              box-shadow var(--dur-3) var(--ease-out-quart);
}
.ev-poster:hover {
  transform: translateY(-3px);
  border-color: rgba(201, 168, 76, 0.6);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
}
.ev-poster.is-live { border-color: rgba(232, 123, 30, 0.55); }
.ev-poster__top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.5rem; margin-bottom: auto;
}
.ev-poster__title {
  font-family: var(--font-head);
  font-size: var(--step-1);
  line-height: 1.15;
  color: #f2ead9;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}
.ev-poster.is-ended .ev-poster__title { color: #cabfa9; }
.ev-poster__meta { font-family: var(--font-ui); font-size: var(--step--1); color: #b7a88f; }
.ev-poster__live {
  display: inline-flex; align-items: center; gap: 0.45em;
  font-family: var(--font-ui); font-size: var(--step--1);
  letter-spacing: 0.06em; text-transform: uppercase;
  color: #ffb347;
}
/* /events/:key — meta times sit on plaque chips inside the dl */
.event-meta-detail time.plaque { margin: 2px 0; }

/* ── PAGE: /join — illuminated waypoint steps ─────────────────────── */
/* Step number: strip the v3 gradient circle chip and render as a large
   gold-rite Cinzel numeral (goldTitle markup supplies the gradient). */
.hp-join-step__num.jn-num {
  width: auto; height: auto; min-width: 1.3em;
  border-radius: 0; background: none; box-shadow: none;
  display: grid; place-items: start center;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(2.3rem, 5vw, 3.2rem);
  line-height: 1;
  padding-top: 0.04em;
}
/* Left-aligned mini divider under /join section titles (orn-divider is
   centered by default; these heads are flex-start). */
.jn-head .orn-divider { justify-content: flex-start; margin: 0.5rem 0 0; }
.jn-head .orn-divider svg { width: 180px; }

/* ── page group: hall (/about + /community) ─────────────────────── */
/* about: readable lore measure under the cool zone light */
.hall-lore { padding: var(--space-s, 1rem) 0; }
.hall-lore p { max-width: 62ch; margin-left: auto; margin-right: auto; }

/* community: six painted doors into the hall */
.hall-doors { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-s, 1rem); }
@media (max-width: 900px) { .hall-doors { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .hall-doors { grid-template-columns: 1fr; } }
.door {
  position: relative; overflow: clip;
  display: flex; flex-direction: column; justify-content: flex-end;
  aspect-ratio: 3 / 4; min-height: 300px;
  padding: var(--space-s, 1rem);
  border: 1px solid rgba(201, 168, 76, 0.22); border-radius: 4px;
  text-decoration: none;
  transition: border-color var(--dur-4) var(--ease-out-quint);
}
.door__art {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center bottom; /* hides the title baked into the art's top edge */
  filter: saturate(0.8) brightness(0.72);
  transition: transform var(--dur-5) var(--ease-out-quint), filter var(--dur-5) var(--ease-out-quint);
}
.door::before { /* bottom scrim so the lintel reads over the painting */
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(10, 7, 5, 0.94) 16%, rgba(10, 7, 5, 0.4) 55%, rgba(10, 7, 5, 0.1) 100%);
}
.door::after { /* gold seam of light along the hinge, revealed on hover */
  content: '';
  position: absolute; inset: 6% auto 6% 0; width: 2px;
  background: linear-gradient(to bottom, transparent, rgba(255, 224, 138, 0.85) 45%, rgba(201, 168, 76, 0.55) 62%, transparent);
  opacity: 0; transform: scaleY(0.55);
  transition: opacity var(--dur-4) var(--ease-out-quint), transform var(--dur-4) var(--ease-out-quint);
}
.door__lintel, .door__desc, .door .pill { position: relative; }
.door__lintel { display: block; font-size: var(--step-0); color: #d9c9a8; }
.door__desc { display: block; margin-top: 0.3em; font-size: var(--step--1); line-height: 1.45; color: rgba(233, 226, 213, 0.78); }
.door .pill { margin-top: 0.5em; align-self: flex-start; }
.door:hover, .door:focus-visible { border-color: rgba(201, 168, 76, 0.5); }
.door:focus-visible { outline: 2px solid var(--au-solid, #c9a84c); outline-offset: 2px; }
.door:hover .door__art, .door:focus-visible .door__art { transform: scale(1.04); filter: saturate(1) brightness(0.92); }
.door:hover::after, .door:focus-visible::after { opacity: 1; transform: scaleY(1); }
@media (prefers-reduced-motion: reduce) {
  .door, .door__art, .door::after { transition: none; }
  .door:hover .door__art, .door:focus-visible .door__art { transform: none; }
}

/* ═══════════════════════════════════════════════════════════════════
   v4.5 — SCROLL CINEMA (homepage set-pieces)
   Resting CSS = the final designed state. scroll-cinema.js only ever
   animates FROM these values, so no-JS / reduced-motion / calm / t-low
   all see a finished page.
   ═══════════════════════════════════════════════════════════════════ */

/* Lenis companion */
html.lenis-on { scroll-behavior: auto; }
.lenis.lenis-smooth { scroll-behavior: auto; }

/* scroll-driven lighting rig: the whole room re-lights as you pass
   each zone (scroll-cinema toggles body[data-zone]) */
.site-over::before {
  content: '';
  position: fixed; inset: 0;
  background-color: hsl(var(--zh-live, 24 90% 48%) / 0.07);
  -webkit-mask-image: radial-gradient(90% 60% at 50% 0%, #000, transparent 65%);
          mask-image: radial-gradient(90% 60% at 50% 0%, #000, transparent 65%);
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.6s var(--ease-inout), background-color 0.6s var(--ease-inout);
  opacity: 0;
}
body[data-zone] .site-over::before { opacity: 1; }
body[data-zone="hearth"] { --zh-live: 24 90% 48%; }
body[data-zone="forge"]  { --zh-live: 38 75% 52%; }
body[data-zone="crypt"]  { --zh-live: 258 45% 45%; }
body[data-zone="cool"]   { --zh-live: 205 45% 45%; }

/* ── the Manifesto (the one pinned scene) ─────────────────────────── */
.manifesto {
  position: relative;
  min-height: 88svh;
  display: grid; place-content: center; justify-items: center;
  text-align: center;
  overflow: clip;
  padding: var(--space-2xl) var(--space-s);
}
.manifesto__num {
  position: absolute; top: 2%; left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(9rem, 18vw, 15rem);
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(201, 168, 76, 0.16);
  pointer-events: none;
  z-index: 0;
}
.manifesto__kicker { position: relative; z-index: 1; margin: 0 0 var(--space-2xs); font-size: 0.78rem; }
.manifesto__rule {
  position: relative; z-index: 1;
  display: block; width: 120px; height: 1px;
  background: rgba(201, 168, 76, 0.5);
  margin-bottom: var(--space-m);
  transform-origin: center;
}
.manifesto__lines {
  position: relative; z-index: 1;
  font-family: var(--font-head);
  font-weight: 700;
  text-transform: uppercase;
  font-size: clamp(1.6rem, 4.6vw, 3.4rem);
  line-height: 1.25;
  letter-spacing: var(--track-display-xl);
  max-width: 18ch;
  margin: 0;
  color: var(--au-solid);
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.7);
}
.man-word { display: inline-block; }

/* ── the deck: full-screen chapter slides that pile card over card ── */
/* The stack only reads if each card ≈ one viewport: cards are flex-
   centered chapter slides, and the sections inside drop their big
   page-level margins. */
.deck { position: relative; }
.deck__card {
  position: sticky;
  top: 4svh;
  min-height: min(88svh, 44rem);
  display: flex; flex-direction: column; justify-content: center;
  margin-bottom: 38svh;
  background:
    radial-gradient(120% 90% at 50% -10%, #1a120a 0%, transparent 55%),
    var(--bg-2);
  border: 1px solid rgba(201, 168, 76, 0.22);
  border-radius: 10px;
  box-shadow: 0 -18px 50px rgba(0, 0, 0, 0.55);
  padding: clamp(2.5rem, 7svh, 5rem) var(--space-m);
  overflow: clip;
  will-change: transform;
}
.deck__card:last-child { margin-bottom: var(--space-xl); }
/* triggers measure wrong while stuck — scroll-cinema unsticks the deck
   for the duration of each ScrollTrigger refresh pass */
.deck--measuring .deck__card { position: relative !important; top: 0 !important; }
/* one box per slide: inner glass chrome flattens inside a card */
.deck__card .hp-stats {
  background: none; border: 0; box-shadow: none; border-radius: 0;
  -webkit-backdrop-filter: none; backdrop-filter: none;
  padding: 0 0 var(--space-s);
}
.deck__card .hp-empty { background: none; border: 0; border-radius: 0; }
.deck__card:nth-child(1) { top: calc(4svh + 0vh); }
.deck__card:nth-child(2) { top: calc(4svh + 1.5vh); }
.deck__card:nth-child(3) { top: calc(4svh + 3vh); }
.deck__card:nth-child(4) { top: calc(4svh + 3.5vh); }
/* sections shed their page-scale spacing inside a slide */
.deck__card .hp-section { margin: var(--space-s) 0; }
.deck__card .hp-section:first-of-type { margin-top: 0; }
.deck__card .hp-section:last-of-type { margin-bottom: 0; }
.deck__card .hp-stats { margin: 0 0 var(--space-s); }
.deck__num {
  position: absolute; top: var(--space-s); right: var(--space-m);
  font-size: clamp(2.4rem, 6vw, 4.6rem);
  font-weight: 700;
  color: transparent;
  -webkit-text-stroke: 1px rgba(201, 168, 76, 0.22);
  text-shadow: none;
  pointer-events: none;
}
.card-shade {
  position: absolute; inset: 0;
  background: #060402;
  opacity: 0;
  pointer-events: none;
  z-index: 5;
  border-radius: inherit;
}

/* ── banner marquee (CSS loop is the base; JS upgrades + steers it) ── */
.banner-marquee {
  overflow: clip;
  padding: var(--space-m) 0;
  border-top: 1px solid rgba(201, 168, 76, 0.16);
  border-bottom: 1px solid rgba(201, 168, 76, 0.16);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}
.marquee-inner {
  display: inline-flex; align-items: baseline; gap: 2.2rem;
  white-space: nowrap;
  padding-right: 2.2rem;
  font-family: var(--font-head);
  font-weight: 800;
  text-transform: uppercase;
  font-size: clamp(1.8rem, 5vw, 3.6rem);
  letter-spacing: var(--track-display-xl);
  animation: mq-roll 18s linear infinite;
  will-change: transform;
}
.marquee-inner.is-js { animation: none; }
@keyframes mq-roll { to { transform: translateX(-50%); } }
.mq-fill { color: var(--au-solid); }
.mq-ghost { color: transparent; -webkit-text-stroke: 1px rgba(201, 168, 76, 0.4); }
.mq-dot { color: var(--ember-2); font-size: 0.5em; }

/* ── kinetic title lines get clipped at their mask ────────────────── */
.hp-section__title { overflow: clip; }
.sc-line { display: block; }

/* ── text-roll + origin-swap underline on section links ──────────── */
@media (hover: hover) and (pointer: fine) {
  .hp-seeall {
    text-decoration: none;
    background: linear-gradient(currentColor, currentColor) no-repeat 100% 100% / 0 1px;
    transition: background-size 0.4s cubic-bezier(0.76, 0, 0.24, 1),
                background-position 0s 0.4s,
                color var(--dur-3) var(--ease-out-quart);
  }
  .hp-seeall:hover {
    background-size: 100% 1px;
    background-position: 0 100%;
    transition: background-size 0.4s cubic-bezier(0.76, 0, 0.24, 1),
                color var(--dur-3) var(--ease-out-quart);
  }
}
[data-magnetic] { display: inline-block; will-change: transform; }

/* ── mobile deck: shallower dock so tall cards stay readable ──────── */
@media (max-width: 899px) {
  .deck__card {
    position: static; box-shadow: none;
    min-height: 0; margin-bottom: var(--space-l);
    border-radius: 8px; padding: var(--space-m) var(--space-s) var(--space-l);
  }
  .manifesto { min-height: 64svh; }
}
/* short screens can't fit viewport slides either */
@media (max-height: 700px) {
  .deck__card { position: static; box-shadow: none; min-height: 0; margin-bottom: var(--space-l); }
  .manifesto { min-height: 0; padding: var(--space-xl) var(--space-s); }
}

/* ── kill-switches: calm / reduced-motion get the composed page ───── */
@media (prefers-reduced-motion: reduce) {
  .marquee-inner { animation: none; }
  .deck__card { position: static; box-shadow: none; min-height: 0; margin-bottom: var(--space-l); }
  .manifesto { min-height: 0; padding: var(--space-xl) var(--space-s); }
}
body.u-calm .marquee-inner { animation: none; }
body.u-calm .deck__card { position: static; box-shadow: none; min-height: 0; margin-bottom: var(--space-l); }
body.u-calm .manifesto { min-height: 0; padding: var(--space-xl) var(--space-s); }
html.t-low .marquee-inner { animation-duration: 40s; }


/* v4.5 audit: the header must never push its login action off-screen */
@media (max-width: 1440px) {
  .mb-nav { gap: 0.15rem; }
  .mb-nav__link, .mb-nav__btn { padding-left: 0.55rem; padding-right: 0.55rem; }
  .mb-brand .brand-sigil { width: 1.15em; height: 1.15em; }
}

/* when a login/deletion flash renders above the hero, don't pull the
   hero up over it */
.v4hero--after-flash { margin-top: 0; }
