/* ==========================================================================
   Agentic Debt Clock — Gilded Obsidian master stylesheet.
   1776 Banking × Fort Knox Brutalism × Vegas Slot Machine.
   Uses CSS @property, Subgrid, Container Queries, View Transitions.
   ========================================================================== */

/* ---------- STEP 2: @property registrations for animatable gradients ---------- */

@property --shimmer-angle     { syntax: '<angle>';      inherits: false; initial-value: 0deg; }
@property --shimmer-offset    { syntax: '<percentage>'; inherits: false; initial-value: 0%; }
@property --bullion-sweep     { syntax: '<percentage>'; inherits: false; initial-value: -50%; }
@property --vault-light       { syntax: '<number>';     inherits: false; initial-value: 0; }
@property --reel-depth        { syntax: '<length>';     inherits: false; initial-value: 0px; }

/* ---------- Root tokens ---------- */

:root {
  /* Gilded Obsidian palette */
  --obsidian-0:        #0B0C10;  /* absolute black */
  --obsidian-1:        #101216;  /* deep vault */
  --obsidian-2:        #15171C;  /* chamber */
  --gunmetal:          #1A1C1E;  /* brushed base */
  --gunmetal-hi:       #222528;  /* lit edge */
  --steel:             #2E3236;  /* plate */
  --steel-hi:          #3A3F45;  /* edge */

  --bullion:           #FFD700;  /* primary gold */
  --bullion-deep:      #D4AF37;  /* struck gold */
  --bullion-bright:    #FFE27A;  /* lit */
  --brass:             #B5A642;  /* aged brass */
  --brass-deep:        #8A7F32;  /* patina */

  --crimson:           #FF073A;  /* casino crimson — debt/tick */
  --crimson-glow:      #FF3B5E;
  --emerald:           #00FF41;  /* jackpot emerald — stimulus/asset */
  --emerald-glow:      #4EFF7A;

  --bone:              #F4ECD8;  /* aged paper */
  --bone-dim:          #C9C2B1;
  --ledger-ink:        #0A0A0A;  /* engraved text */

  /* Typography */
  --f-serif:     'Playfair Display', 'Cormorant Garamond', Georgia, serif;
  --f-engraved:  'Cormorant Garamond', 'Playfair Display', Georgia, serif;
  --f-mono:      'JetBrains Mono', 'IBM Plex Mono', 'SF Mono', monospace;
  --f-ui:        'Inter', system-ui, -apple-system, sans-serif;

  /* Rhythm */
  --r-1: 0.25rem;  --r-2: 0.5rem;  --r-3: 0.75rem;
  --r-4: 1rem;     --r-5: 1.5rem;  --r-6: 2rem;    --r-7: 3rem;

  /* Vault geometry */
  --vault-radius: 14px;
  --reel-radius: 6px;
  --plate-border: 1px solid color-mix(in oklab, var(--bullion) 22%, black);

  /* Motion */
  --ease-vault-close: cubic-bezier(.86,.02,.22,1);
  --ease-reel-snap:   cubic-bezier(.34,1.56,.48,1);    /* overshoot spring */
  --ease-reel-glide:  cubic-bezier(.22,.61,.36,1);
}

/* ---------- Reset and document ---------- */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body.vault {
  background:
    radial-gradient(1200px 700px at 50% -200px, #1a1d22 0%, var(--obsidian-0) 55%, #050506 100%),
    var(--obsidian-0);
  color: var(--bone);
  font-family: var(--f-ui);
  font-size: 15px;
  line-height: 1.45;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
  overflow-x: hidden;
}

::selection { background: var(--bullion); color: var(--ledger-ink); }

/* ---------- Shimmer border utility ---------- */

@keyframes bullion-shimmer {
  0%   { --shimmer-angle: 0deg;   --bullion-sweep: -50%; }
  100% { --shimmer-angle: 360deg; --bullion-sweep: 150%; }
}

.gilt {
  position: relative;
  isolation: isolate;
}
.gilt::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: conic-gradient(
    from var(--shimmer-angle),
    transparent 0deg,
    var(--bullion-deep) 30deg,
    var(--bullion-bright) 60deg,
    var(--bullion) 90deg,
    var(--brass-deep) 150deg,
    transparent 220deg,
    var(--bullion-deep) 290deg,
    transparent 360deg);
  -webkit-mask: linear-gradient(#000,#000) content-box, linear-gradient(#000,#000);
          mask: linear-gradient(#000,#000) content-box, linear-gradient(#000,#000);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  animation: bullion-shimmer 12s linear infinite;
  pointer-events: none;
  z-index: 1;
}

/* ---------- Top bar / brand ---------- */

.vault-bar {
  position: sticky; top: 0; z-index: 40;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--r-4);
  padding: 0.75rem 1.25rem;
  background: linear-gradient(180deg, rgba(10,10,12,.92) 0%, rgba(10,10,12,.78) 100%);
  backdrop-filter: blur(10px) saturate(130%);
  border-bottom: 1px solid color-mix(in oklab, var(--bullion) 18%, black);
  box-shadow: 0 1px 0 rgba(255,215,0,.08), 0 8px 20px rgba(0,0,0,.55);
}
.vault-brand {
  display: flex; align-items: baseline; gap: 0.6rem;
  font-family: var(--f-serif); font-weight: 900;
  font-size: 1.15rem; letter-spacing: 0.01em;
  color: var(--bullion-bright);
  text-shadow: 0 1px 0 #000, 0 0 14px rgba(255,215,0,.18);
}
.vault-brand .amp { color: var(--brass); font-style: italic; font-weight: 700; }
.vault-brand .sub {
  font-family: var(--f-ui); font-weight: 500; font-size: 0.72rem;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--bone-dim);
}
.vault-nav {
  display: flex; gap: 0.3rem; flex-wrap: wrap; justify-content: center;
}
.vault-nav a {
  font-family: var(--f-ui); font-size: 0.74rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--bone-dim);
  padding: 0.45rem 0.7rem;
  border: 1px solid transparent;
  border-radius: 4px;
  text-decoration: none;
  transition: color .2s, border-color .2s, background .2s;
}
.vault-nav a:hover { color: var(--bullion-bright); border-color: color-mix(in oklab, var(--bullion) 35%, black); }
.vault-nav a.primary {
  color: var(--bullion-bright);
  border-color: color-mix(in oklab, var(--bullion) 50%, black);
  background: linear-gradient(180deg, rgba(255,215,0,.08), rgba(255,215,0,.02));
}
.vault-clocks { display: flex; gap: 0.9rem; align-items: center; font-family: var(--f-mono); font-size: 0.72rem; }

/* ---------- World clocks ---------- */

.clock {
  display: inline-flex; flex-direction: column; line-height: 1;
  padding: 0.35rem 0.5rem; border-radius: 4px;
  background: linear-gradient(180deg, #0a0a0c, #060608);
  border: 1px solid rgba(212,175,55,.18);
  min-width: 82px;
}
.clock .city {
  font-family: var(--f-ui); font-weight: 700; font-size: 0.58rem;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--brass); margin-bottom: 3px;
}
.clock .time {
  font-family: var(--f-mono); font-weight: 700; font-size: 0.85rem;
  color: var(--bullion-bright);
  font-variant-numeric: tabular-nums;
}
.clock.treasury { border-color: color-mix(in oklab, var(--bullion) 45%, black); }
.clock.treasury .city { color: var(--bullion); }
.clock.treasury .time { color: var(--bullion-bright); text-shadow: 0 0 8px rgba(255,215,0,.5); }
.clock.market-open .time::after   { content: ' ●'; color: var(--emerald); }
.clock.market-closed .time::after { content: ' ●'; color: var(--crimson); }

/* ---------- Ticker tape ---------- */

.tape {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  background: linear-gradient(180deg, #040406 0%, #0a0a0d 100%);
  border-bottom: 1px solid color-mix(in oklab, var(--bullion) 12%, black);
  font-family: var(--f-mono); font-size: 0.78rem;
  padding: 0.45rem 0;
}
.tape-track { display: inline-flex; gap: 2rem; animation: tape-scroll 90s linear infinite; }
.tape:hover .tape-track { animation-play-state: paused; }
@keyframes tape-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.tick { display: inline-flex; gap: 0.5rem; align-items: baseline; padding: 0 0.5rem; }
.tick .sym  { color: var(--bullion-bright); font-weight: 700; letter-spacing: 0.06em; }
.tick .px   { color: var(--bone); font-variant-numeric: tabular-nums; }
.tick .chg  { font-weight: 700; font-variant-numeric: tabular-nums; }
.tick .chg.up   { color: var(--emerald); }
.tick .chg.down { color: var(--crimson); }
.tick .chg.up::before   { content: '▲ '; }
.tick .chg.down::before { content: '▼ '; }

/* ---------- Master Subgrid: The Vault Floor ---------- */

.floor {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--r-4);
  padding: var(--r-5) var(--r-5) var(--r-7);
  max-width: 1680px; margin: 0 auto;
}

/* Central Vault spans the full width. Engine rails flank it on wide screens. */
.vault-hero { grid-column: 1 / -1; }
.group { grid-column: span 12; display: grid; grid-template-columns: subgrid; gap: var(--r-4); }

/* Panel sizing helpers */
.span-3  { grid-column: span 12; }
.span-4  { grid-column: span 12; }
.span-6  { grid-column: span 12; }
.span-8  { grid-column: span 12; }
.span-12 { grid-column: span 12; }
@container (min-width: 720px), (min-width: 720px) {}
@media (min-width: 720px) {
  .span-6  { grid-column: span 6; }
}
@media (min-width: 1080px) {
  .span-3  { grid-column: span 3; }
  .span-4  { grid-column: span 4; }
  .span-8  { grid-column: span 8; }
}

/* ---------- The Central Vault ---------- */

.central-vault {
  position: relative;
  border-radius: var(--vault-radius);
  padding: clamp(1.2rem, 2.2vw, 2.25rem);
  background:
    radial-gradient(120% 160% at 50% -20%, #1c1f24 0%, #0c0d10 55%, #050507 100%),
    var(--obsidian-1);
  border: 1px solid color-mix(in oklab, var(--bullion) 28%, black);
  box-shadow:
    inset 0 0 0 3px var(--gunmetal),
    inset 0 0 0 4px color-mix(in oklab, var(--bullion) 35%, black),
    inset 0 0 0 8px var(--gunmetal-hi),
    inset 0 0 0 9px color-mix(in oklab, var(--bullion) 15%, black),
    inset 0 4px 20px rgba(0,0,0,.8),
    0 30px 80px rgba(0,0,0,.7),
    0 0 0 1px color-mix(in oklab, var(--bullion) 10%, black);
  isolation: isolate;
}
/* Eight "bolts" around the vault door */
.central-vault::before, .central-vault::after,
.central-vault > .bolt-n, .central-vault > .bolt-s,
.central-vault > .bolt-e, .central-vault > .bolt-w,
.central-vault > .bolt-ne, .central-vault > .bolt-sw {
  content: '';
  position: absolute;
  width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--bullion-bright), var(--bullion-deep) 45%, #6b5420 80%);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.6), 0 0 0 1px rgba(0,0,0,.7), 0 0 10px rgba(255,215,0,.15);
  pointer-events: none;
}
.central-vault::before { top: 10px; left: 10px; }
.central-vault::after  { top: 10px; right: 10px; }
.central-vault .bolt-n  { top: 10px; left: 50%; transform: translateX(-50%); }
.central-vault .bolt-s  { bottom: 10px; left: 50%; transform: translateX(-50%); }
.central-vault .bolt-e  { bottom: 10px; right: 10px; }
.central-vault .bolt-w  { bottom: 10px; left: 10px; }
.central-vault .bolt-ne { top: 50%; right: 10px; transform: translateY(-50%); }
.central-vault .bolt-sw { top: 50%; left: 10px; transform: translateY(-50%); }

.vault-eyebrow {
  font-family: var(--f-ui); font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--brass);
  padding-left: 28px;
}
.vault-title {
  font-family: var(--f-serif); font-weight: 900;
  font-size: clamp(1.6rem, 3.2vw, 2.5rem);
  margin: 0.2rem 0 0.4rem; padding-left: 28px;
  color: var(--bone);
  letter-spacing: 0.01em;
  background: linear-gradient(180deg, var(--bone) 0%, #a89e84 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.vault-subline {
  padding-left: 28px;
  font-family: var(--f-mono); font-size: 0.78rem; color: var(--bone-dim);
  display: flex; gap: 0.8rem; flex-wrap: wrap;
}
.vault-subline strong { color: var(--bullion-bright); font-weight: 700; }
.vault-subline .sep { color: color-mix(in oklab, var(--bullion) 35%, black); }

/* The headline reel row */
.headline-reel { padding: 1.2rem 28px 0.4rem; }

/* Vault LOCKDOWN state: frosted glass + countdown */
.central-vault.locked .headline-reel { filter: blur(1.2px) opacity(.55); }
.central-vault.locked::before,
.central-vault.locked::after { box-shadow: inset 0 1px 2px rgba(0,0,0,.6), 0 0 0 1px rgba(0,0,0,.7), 0 0 16px var(--crimson-glow); }
.central-vault .lockdown {
  display: none;
}
.central-vault.locked .lockdown {
  display: grid; place-items: center;
  position: absolute; inset: 14px;
  border-radius: calc(var(--vault-radius) - 6px);
  background: linear-gradient(180deg, rgba(10,10,12,.58), rgba(10,10,12,.72));
  backdrop-filter: blur(14px) saturate(120%);
  border: 1px solid color-mix(in oklab, var(--bullion) 25%, black);
  z-index: 3;
}
.lockdown-panel { text-align: center; padding: 1.5rem 2rem; }
.lockdown-eyebrow {
  font-family: var(--f-ui); font-size: 0.68rem; font-weight: 800;
  letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--crimson-glow);
  text-shadow: 0 0 10px rgba(255,7,58,.55);
}
.lockdown-title {
  font-family: var(--f-serif); font-weight: 900;
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  color: var(--bullion-bright);
  margin: 0.3rem 0 0.7rem;
}
.lockdown-count {
  font-family: var(--f-mono); font-weight: 700;
  font-size: clamp(2rem, 5vw, 3.2rem);
  color: var(--bullion);
  text-shadow: 0 0 18px rgba(255,215,0,.35);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
}
.lockdown-note {
  font-family: var(--f-ui); font-size: 0.75rem; color: var(--bone-dim);
  letter-spacing: 0.08em; margin-top: 0.5rem;
}

/* ---------- The Engine: slot-window panels ---------- */

.engine-panel {
  position: relative;
  border-radius: var(--vault-radius);
  padding: var(--r-4) var(--r-4) var(--r-3);
  background:
    linear-gradient(180deg, #15181d 0%, #0c0d10 80%),
    var(--gunmetal);
  border: 1px solid color-mix(in oklab, var(--bullion) 18%, black);
  box-shadow:
    inset 0 1px 0 rgba(255,215,0,.08),
    inset 0 -1px 0 rgba(0,0,0,.6),
    inset 0 0 0 4px var(--gunmetal),
    0 12px 30px rgba(0,0,0,.55);
  isolation: isolate;
}
.engine-panel::before {
  content: '';
  position: absolute; inset: 6px;
  border-radius: calc(var(--vault-radius) - 4px);
  border: 1px solid color-mix(in oklab, var(--bullion) 22%, black);
  pointer-events: none;
}
.panel-head {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-bottom: 0.55rem; margin-bottom: 0.75rem;
  border-bottom: 1px solid color-mix(in oklab, var(--bullion) 18%, black);
}
.panel-head h3 {
  margin: 0;
  font-family: var(--f-serif); font-weight: 900;
  font-size: 0.95rem; letter-spacing: 0.04em;
  color: var(--bullion-bright);
  text-transform: uppercase;
  text-shadow: 0 1px 0 #000;
}
.panel-head h3 .mk { color: var(--crimson-glow); }
.panel-head .cite {
  font-family: var(--f-mono); font-size: 0.66rem; color: var(--bone-dim);
  letter-spacing: 0.1em; text-transform: uppercase;
}

/* Rows inside a panel */
.rows { display: grid; gap: 0.45rem; }
.row {
  display: grid; grid-template-columns: 1fr auto; align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.65rem;
  border-radius: 5px;
  background: linear-gradient(180deg, rgba(0,0,0,.35), rgba(0,0,0,.15));
  border: 1px solid rgba(212,175,55,.10);
}
.row:hover { border-color: rgba(212,175,55,.28); }
.row .lbl {
  font-family: var(--f-ui); font-size: 0.74rem; font-weight: 500;
  color: var(--bone-dim); letter-spacing: 0.02em;
}
.row .lbl .era {
  display: inline-block;
  font-family: var(--f-mono); font-size: 0.58rem; font-weight: 700;
  color: var(--bullion); padding: 1px 5px; margin-right: 6px;
  border: 1px solid color-mix(in oklab, var(--bullion) 40%, black);
  border-radius: 3px; letter-spacing: 0.12em;
}
.row .lbl .asof {
  font-family: var(--f-mono); font-size: 0.58rem; color: var(--brass);
  letter-spacing: 0.08em; margin-left: 5px;
}

/* ---------- STEP 4: The Mechanical Reel ---------- */

.reel {
  display: inline-flex; gap: 1px; align-items: center;
  font-family: var(--f-mono); font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 0.25rem 0.55rem;
  border-radius: var(--reel-radius);
  background:
    linear-gradient(180deg, #020203 0%, #08080b 50%, #020203 100%);
  border: 1px solid rgba(212,175,55,.32);
  box-shadow:
    inset 0 2px 4px rgba(0,0,0,.95),
    inset 0 0 8px rgba(255,215,0,.04),
    inset 0 0 0 1px rgba(0,0,0,.8),
    0 1px 0 rgba(255,215,0,.12);
  perspective: 260px;
  perspective-origin: 50% 50%;
}
.reel.big  { padding: 0.45rem 0.85rem; font-size: 1.15rem; }
.reel.huge { padding: 0.9rem 1.4rem; font-size: clamp(1.8rem, 4.5vw, 3.4rem); gap: 2px; }

.reel .glyph,
.reel .drum {
  height: 1.25em; line-height: 1.25em;
  color: var(--bullion-bright);
  text-shadow:
    0 0 6px rgba(255,215,0,.55),
    0 0 14px rgba(255,215,0,.22),
    0 1px 0 rgba(0,0,0,.9);
}
.reel .glyph { padding: 0 2px; color: var(--bullion); opacity: .92; }
.reel.crimson .drum,
.reel.crimson .glyph { color: var(--crimson-glow); text-shadow: 0 0 6px rgba(255,7,58,.5), 0 0 14px rgba(255,7,58,.2), 0 1px 0 #000; }
.reel.emerald .drum,
.reel.emerald .glyph { color: var(--emerald-glow); text-shadow: 0 0 6px rgba(0,255,65,.5), 0 0 14px rgba(0,255,65,.2), 0 1px 0 #000; }
.reel.dim .drum { color: var(--bone-dim); text-shadow: none; }

/* The drum itself: fixed window, scrolling strip, curved via 3D */
.reel .drum {
  position: relative;
  display: inline-block;
  width: 0.66em;
  height: 1.25em;
  overflow: hidden;
  transform-style: preserve-3d;
  /* incandescent backlight glow + top/bottom mask */
  -webkit-mask: linear-gradient(180deg, transparent 0%, #000 22%, #000 78%, transparent 100%);
          mask: linear-gradient(180deg, transparent 0%, #000 22%, #000 78%, transparent 100%);
}
.reel .drum::before {
  /* bevel highlight stripe */
  content: '';
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(255,215,0,.05), transparent 20%, transparent 80%, rgba(255,215,0,.05)),
    linear-gradient(90deg, rgba(0,0,0,.35) 0%, transparent 12%, transparent 88%, rgba(0,0,0,.35) 100%);
  pointer-events: none;
  z-index: 2;
}
.reel .strip {
  position: absolute; left: 0; right: 0; top: 0;
  display: flex; flex-direction: column;
  will-change: transform;
  transform: translateY(0);
  transition: transform 620ms var(--ease-reel-snap);
}
.reel .strip .face {
  height: 1.25em; line-height: 1.25em;
  text-align: center;
  /* subtle curvature on each face — gives the rolling drum look */
  transform: translateZ(10px);
}
/* Continuous-propagation reels (live tick): remove the snap transition */
.reel.live .strip { transition: none; }
/* Snap flash — brief crimson/gold pulse when a digit locks */
@keyframes digit-lock {
  0%   { filter: drop-shadow(0 0 0 rgba(255,215,0,0)); }
  40%  { filter: drop-shadow(0 0 10px rgba(255,215,0,.75)); }
  100% { filter: drop-shadow(0 0 0 rgba(255,215,0,0)); }
}
.reel .drum.just-locked { animation: digit-lock 420ms ease-out; }

/* Currency / suffix glyphs rendered as mechanical markers */
.reel .glyph.dollar { color: var(--emerald-glow); text-shadow: 0 0 8px rgba(0,255,65,.45); }
.reel .glyph.neg    { color: var(--crimson-glow); text-shadow: 0 0 8px rgba(255,7,58,.45); }

/* ---------- Legacy value boxes (inline small numbers) ---------- */

.v {
  font-family: var(--f-mono); font-weight: 700;
  color: var(--bullion-bright);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 6px rgba(255,215,0,.28);
}
.v.crimson { color: var(--crimson-glow); text-shadow: 0 0 6px rgba(255,7,58,.3); }
.v.emerald { color: var(--emerald-glow); text-shadow: 0 0 6px rgba(0,255,65,.3); }
.v.dim     { color: var(--bone-dim);     text-shadow: none; }
.v.brass   { color: var(--brass);        text-shadow: none; }

/* ---------- Pillars (reparations) ---------- */

.pillar {
  position: relative;
  border-radius: var(--vault-radius);
  padding: var(--r-5) var(--r-4);
  background:
    linear-gradient(180deg, #18191d 0%, #0b0c10 100%);
  border: 1px solid color-mix(in oklab, var(--bullion) 22%, black);
  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,.6),
    inset 0 2px 0 rgba(255,215,0,.12),
    inset 0 -2px 0 rgba(0,0,0,.7),
    0 18px 36px rgba(0,0,0,.55);
}
.pillar .roman {
  font-family: var(--f-serif); font-weight: 900;
  font-size: 2.2rem; color: var(--bullion);
  letter-spacing: 0.08em;
  -webkit-text-stroke: 1px rgba(0,0,0,.6);
  text-shadow: 0 0 16px rgba(255,215,0,.25);
}
.pillar h2 {
  font-family: var(--f-serif); font-weight: 900;
  font-size: clamp(1.3rem, 2.4vw, 1.75rem);
  margin: 0.3rem 0 0.25rem; color: var(--bone);
  letter-spacing: 0.01em;
}
.pillar .era-range {
  font-family: var(--f-mono); font-size: 0.72rem; color: var(--bullion-deep);
  letter-spacing: 0.16em; text-transform: uppercase;
}
.pillar .summary {
  font-family: var(--f-engraved); font-style: italic;
  font-size: 1.05rem; color: var(--bone-dim); line-height: 1.5;
  max-width: 62ch; margin: 0.8rem 0 1.1rem;
}

/* ---------- Ledger footer ---------- */

.ledger-foot {
  grid-column: 1 / -1;
  padding: var(--r-5);
  border-top: 1px solid color-mix(in oklab, var(--bullion) 18%, black);
  font-family: var(--f-engraved); font-style: italic;
  color: var(--bone-dim); font-size: 0.85rem;
  text-align: center;
  line-height: 1.7;
}
.ledger-foot strong { color: var(--bullion-bright); font-style: normal; }
.ledger-foot a { color: var(--brass); text-decoration: none; margin: 0 0.5rem; }
.ledger-foot a:hover { color: var(--bullion-bright); }

/* ---------- Reduced-motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .gilt::before { animation: none; }
  .tape-track { animation: none; }
  .reel .strip { transition: none !important; }
  .drawer, .drawer-overlay { transition: none !important; }
}

/* ==========================================================================
   NAV ENGINE — Mega-menu (desktop) + Drawer + Tab-bar (mobile)
   ========================================================================== */

/* Hide the old flat vault-nav styling that we're replacing */
.vault-nav { all: unset; display: block; }

/* ---------- Primary (desktop) ---------- */
.nav-primary {
  list-style: none; margin: 0; padding: 0;
  display: none;
  gap: 0.25rem;
  align-items: center; justify-content: center;
  font-family: var(--f-ui);
}
@media (min-width: 1080px) {
  .nav-primary { display: flex; }
}

.nav-item { position: relative; }
.nav-trigger {
  appearance: none; background: transparent; border: 1px solid transparent;
  color: var(--bone-dim);
  font: 600 0.74rem/1 var(--f-ui);
  letter-spacing: 0.14em; text-transform: uppercase;
  padding: 0.55rem 0.85rem; border-radius: 4px;
  cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: 0.4rem;
  transition: color .18s, border-color .18s, background .18s;
}
.nav-trigger:hover,
.nav-item.open > .nav-trigger,
.nav-trigger[aria-current="page"] {
  color: var(--bullion-bright);
  border-color: color-mix(in oklab, var(--bullion) 35%, black);
}
.nav-trigger:focus-visible {
  outline: 2px solid var(--bullion);
  outline-offset: 2px;
}
.nav-cta {
  color: var(--bullion-bright);
  border-color: color-mix(in oklab, var(--bullion) 50%, black);
  background: linear-gradient(180deg, rgba(255,215,0,.10), rgba(255,215,0,.02));
}
.nav-badge {
  font: 700 0.58rem/1 var(--f-mono);
  letter-spacing: 0.08em;
  color: var(--bullion);
  border: 1px solid color-mix(in oklab, var(--bullion) 30%, black);
  padding: 2px 5px; border-radius: 3px;
}
.nav-icon { display: inline-block; margin-right: 0.3rem; }

/* ---------- Dropdown / Mega-menu ---------- */
.nav-menu {
  position: absolute; top: calc(100% + 8px); left: 50%;
  transform: translateX(-50%) translateY(-6px);
  min-width: 220px;
  background: linear-gradient(180deg, #0d0f13 0%, #070709 100%);
  border: 1px solid color-mix(in oklab, var(--bullion) 22%, black);
  border-radius: 8px;
  box-shadow: 0 18px 40px rgba(0,0,0,.7), 0 0 0 1px rgba(255,215,0,.05) inset;
  padding: 0.75rem;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .18s, transform .18s, visibility .18s;
  z-index: 60;
}
.nav-item.open > .nav-menu {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.nav-menu-narrow { min-width: 240px; }
.nav-menu-wide   { min-width: min(820px, 92vw); }

.nav-mega {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.5rem 1.25rem;
}
.nav-col-head {
  font: 700 0.62rem/1 var(--f-ui);
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--bullion);
  padding: 0.35rem 0.35rem 0.5rem;
  border-bottom: 1px solid color-mix(in oklab, var(--bullion) 18%, black);
  margin-bottom: 0.3rem;
}
.nav-list { list-style: none; margin: 0; padding: 0; }
.nav-list li { margin: 0; }
.nav-list a {
  display: block;
  font: 500 0.82rem/1.25 var(--f-ui);
  color: var(--bone);
  padding: 0.45rem 0.5rem;
  border-radius: 4px;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.nav-list a:hover,
.nav-list a[aria-current="page"],
.nav-list a[aria-current="section"] {
  background: color-mix(in oklab, var(--bullion) 10%, transparent);
  color: var(--bullion-bright);
}

/* ---------- Hamburger ---------- */
.hamburger {
  appearance: none;
  background: transparent;
  border: 1px solid color-mix(in oklab, var(--bullion) 22%, black);
  border-radius: 6px;
  width: 44px; height: 44px; min-width: 44px;
  display: inline-flex; flex-direction: column; justify-content: center; align-items: center;
  gap: 4px; cursor: pointer;
  padding: 0;
}
.hamburger span {
  display: block; width: 20px; height: 2px;
  background: var(--bullion-bright);
  border-radius: 2px;
  transition: transform .2s, opacity .2s;
}
.hamburger:focus-visible { outline: 2px solid var(--bullion); outline-offset: 2px; }
@media (min-width: 1080px) {
  .hamburger { display: none; }
}

/* ---------- Bar layout overrides (mobile-first) ---------- */
@media (max-width: 1079px) {
  .vault-bar {
    grid-template-columns: auto 1fr auto;
    padding: 0.5rem 0.75rem;
  }
  .vault-brand { font-size: 1rem; }
  .vault-brand .sub { display: none; }
  .vault-clocks { gap: 0.4rem; }
  .vault-clocks > *:not(.treasury) { display: none; }
  .tape { font-size: 0.7rem; }
}
@media (max-width: 480px) {
  .tape { display: none; }
}

/* ---------- Drawer ---------- */
.drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(6px);
  z-index: 90;
  opacity: 0; transition: opacity .22s;
}
.drawer-overlay.open { opacity: 1; }

.drawer {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: min(92vw, 420px);
  background: linear-gradient(180deg, #0d0f13 0%, #06070a 100%);
  border-right: 1px solid color-mix(in oklab, var(--bullion) 22%, black);
  box-shadow: 18px 0 60px rgba(0,0,0,.8);
  z-index: 100;
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform .26s cubic-bezier(.2,.8,.2,1);
  padding: max(env(safe-area-inset-top), 0.5rem) 0 1.25rem;
}
.drawer.open { transform: translateX(0); }

.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid color-mix(in oklab, var(--bullion) 18%, black);
}
.drawer-brand {
  font-family: var(--f-serif); font-weight: 900; font-size: 1rem;
  color: var(--bullion-bright); letter-spacing: 0.01em;
}
.drawer-close {
  appearance: none; background: transparent; border: none;
  color: var(--bone); font-size: 1.8rem; line-height: 1;
  width: 44px; height: 44px; cursor: pointer; border-radius: 6px;
}
.drawer-close:hover { color: var(--bullion-bright); background: rgba(255,215,0,.08); }

.drawer-body { padding: 0.5rem 0.75rem; }

.drawer-section { border-bottom: 1px solid rgba(255,215,0,.08); }
.drawer-section-head {
  appearance: none; background: transparent; border: none;
  width: 100%; padding: 0.85rem 0.5rem;
  display: flex; justify-content: space-between; align-items: center;
  color: var(--bullion);
  font: 700 0.72rem/1 var(--f-ui);
  letter-spacing: 0.2em; text-transform: uppercase;
  cursor: pointer;
}
.drawer-section-head .chev {
  transition: transform .2s;
  color: var(--brass);
}
.drawer-section.open > .drawer-section-head .chev { transform: rotate(180deg); }
.drawer-section-body {
  max-height: 0; overflow: hidden;
  transition: max-height .28s ease;
  padding: 0 0.5rem;
}
.drawer-section.open > .drawer-section-body {
  max-height: 2000px;
  padding: 0 0.5rem 0.8rem;
}

.drawer-list, .drawer-section-body .nav-list { list-style: none; margin: 0; padding: 0; }
.drawer-list li, .drawer-section-body .nav-list li { margin: 0; }
.drawer-list a, .drawer-section-body .nav-list a {
  display: flex; align-items: center; gap: 0.5rem;
  min-height: 48px;
  padding: 0.65rem 0.55rem;
  color: var(--bone); text-decoration: none;
  font: 500 0.92rem/1.25 var(--f-ui);
  border-radius: 6px;
}
.drawer a:hover,
.drawer a[aria-current="page"],
.drawer a[aria-current="section"] {
  background: color-mix(in oklab, var(--bullion) 10%, transparent);
  color: var(--bullion-bright);
}
.drawer-group-title {
  font: 700 0.6rem/1 var(--f-ui);
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--brass);
  padding: 0.8rem 0.55rem 0.3rem;
}
.drawer-groups .drawer-group-title:first-child { padding-top: 0.25rem; }

.drawer-clocks {
  margin: 1rem 0.75rem 0;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255,215,0,.08);
}

/* ---------- Bottom tab-bar (mobile) ---------- */
.tab-bar {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0;
  z-index: 70;
  background: rgba(10,10,12,.94);
  backdrop-filter: blur(10px) saturate(130%);
  border-top: 1px solid color-mix(in oklab, var(--bullion) 22%, black);
  padding-bottom: env(safe-area-inset-bottom);
}
@media (max-width: 1079px) {
  .tab-bar { display: flex; }
  body.vault { padding-bottom: 72px; }
}
.tab-bar .tab {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 64px; gap: 2px;
  color: var(--bone-dim); text-decoration: none;
  font: 600 0.6rem/1 var(--f-ui); letter-spacing: 0.12em; text-transform: uppercase;
  border-top: 2px solid transparent;
  transition: color .15s, border-color .15s, background .15s;
}
.tab-bar .tab:hover { color: var(--bullion-bright); }
.tab-bar .tab.active {
  color: var(--bullion-bright);
  border-top-color: var(--bullion);
  background: linear-gradient(180deg, rgba(255,215,0,.08), transparent);
}
.tab-icon { font-size: 1.1rem; line-height: 1; }
.tab-label { font-size: 0.62rem; }

/* Small phones — condense tab bar */
@media (max-width: 360px) {
  .tab-label { display: none; }
  .tab-bar .tab { min-height: 56px; }
  body.vault { padding-bottom: 64px; }
}

/* ==========================================================================
   MASTERING PASS v1.0 — Tooltip · Blink tiers · Text-FX · 7-band EQ · Focus · Prose
   ========================================================================== */

/* Tooltip primitive */
.adc-tip {
  position: absolute; z-index: 200;
  max-width: min(340px, 92vw);
  padding: 10px 12px;
  background: linear-gradient(180deg, #111318 0%, #07080a 100%);
  border: 1px solid color-mix(in oklab, var(--bullion) 38%, black);
  border-radius: 8px;
  box-shadow: 0 14px 36px rgba(0,0,0,.75), 0 0 0 1px rgba(255,215,0,.08) inset;
  color: var(--bone);
  font: 500 12px/1.4 var(--f-ui);
  opacity: 0; transform: translateY(4px); transition: opacity .18s, transform .18s;
  pointer-events: none;
}
.adc-tip.open { opacity: 1; transform: translateY(0); }
.adc-tip .tip-title {
  font: 700 11px/1 var(--f-ui); letter-spacing: .16em; text-transform: uppercase;
  color: var(--bullion-bright); margin-bottom: 6px;
  padding-bottom: 5px; border-bottom: 1px solid color-mix(in oklab, var(--bullion) 22%, black);
}
.adc-tip .tip-row { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; }
.adc-tip .tip-k { color: var(--brass); font-weight: 600; }
.adc-tip .tip-v { color: var(--bone); text-align: right; font-variant-numeric: tabular-nums; }
[data-tip] { cursor: help; }
[data-tip]:focus-visible { outline: 2px solid var(--bullion); outline-offset: 2px; border-radius: 3px; }

/* 4-Tier Blink Cadence */
@keyframes adc-breathe { 0%,100% { opacity: 1; } 50% { opacity: .72; } }
@keyframes adc-tick    { 0%,92% { opacity: 1; } 96% { opacity: .55; } 100% { opacity: 1; } }
@keyframes adc-pulse   { 0%,100% { text-shadow: 0 0 8px rgba(255,215,0,.25); } 50% { text-shadow: 0 0 18px rgba(255,215,0,.65); } }
@keyframes adc-critical{ 0%,100% { color: var(--crimson); text-shadow: 0 0 6px rgba(255,7,58,.4); } 50% { color: var(--crimson-glow); text-shadow: 0 0 16px rgba(255,59,94,.85); } }
.tier-ambient  { animation: adc-breathe 4s ease-in-out infinite; }
.tier-steady   { animation: adc-tick 1s steps(8) infinite; }
.tier-pulse    { animation: adc-pulse 2s ease-in-out infinite; }
.tier-critical { animation: adc-critical 0.9s ease-in-out infinite; }

/* Text-FX utilities */
.kinetic-rotate { display: inline-block; transition: opacity .26s ease, transform .26s ease; }
.kinetic-rotate.out { opacity: 0; transform: translateY(-4px); }
.kinetic-split { display: inline-block; }
.kinetic-split .ch {
  display: inline-block; opacity: 0; transform: translateY(10px);
  animation: ch-in .55s cubic-bezier(.2,.8,.2,1) forwards;
}
@keyframes ch-in { to { opacity: 1; transform: translateY(0); } }
.weight-pulse { animation: weight-pulse 3.2s ease-in-out infinite; font-variation-settings: 'wght' 600; }
@keyframes weight-pulse {
  0%,100% { font-variation-settings: 'wght' 600; letter-spacing: 0.01em; }
  50%     { font-variation-settings: 'wght' 800; letter-spacing: 0.03em; }
}
.shimmer-text {
  background: linear-gradient(90deg, var(--bullion-deep), var(--bullion-bright), var(--bullion), var(--brass), var(--bullion-deep));
  background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  animation: shimmer-sweep 6s linear infinite;
}
@keyframes shimmer-sweep { to { background-position: 300% 0; } }

/* Headline fluid typography (dynamic-range compressor) */
.vault-title { font-size: clamp(1.6rem, 3.2vw + 1rem, 3.25rem) !important; line-height: 1.05; }
.headline-reel [data-size="huge"] {
  font-size: clamp(2rem, 6vw + .75rem, 5.25rem) !important;
  white-space: nowrap; max-width: 100%; overflow: hidden;
}
.reel, [data-reel], .v, .vault-subline strong { font-variant-numeric: tabular-nums; }

/* Row tooltip affordance */
.row[data-tip] .lbl::after {
  content: ' ⓘ'; color: var(--brass); font-size: 0.78em;
  opacity: 0.6; margin-left: 4px; transition: opacity .15s, color .15s;
}
.row[data-tip]:hover .lbl::after,
.row[data-tip]:focus-within .lbl::after { opacity: 1; color: var(--bullion-bright); }

/* 7-band Responsive EQ */
body.vault, main.floor, .engine-panel, .central-vault { overflow-wrap: anywhere; }
.reel, [data-reel], .v { min-inline-size: 0; }
@media (max-width: 480px) {
  .floor { padding: 0.75rem 0.5rem 2rem; gap: 0.65rem; }
  .engine-panel { padding: 0.75rem 0.6rem; }
  .central-vault { padding: 1rem 0.75rem; }
  .row { flex-wrap: wrap; row-gap: 2px; }
  .row .lbl { font-size: 0.78rem; }
  .vault-subline { font-size: 0.72rem; flex-wrap: wrap; justify-content: center; gap: 0.25rem; }
  .vault-subline .sep { display: none; }
}
@media (max-width: 414px) { .panel-head h3 { font-size: 0.82rem; } .panel-head .cite { font-size: 0.62rem; } }
@media (max-width: 375px) { .row { font-size: 0.85rem; } }
@media (max-width: 320px) { .vault-brand { font-size: 0.9rem; } .tab-label { font-size: 0.55rem; } }
@media (min-width: 1440px) { .floor { max-width: 1720px; } }

/* Tab-bar animated bloom */
.tab-bar { box-shadow: 0 -6px 24px rgba(0,0,0,0.55); }
.tab-bar .tab { position: relative; overflow: hidden; }
.tab-bar .tab .tab-icon { transition: transform .2s; }
.tab-bar .tab:active .tab-icon { transform: translateY(-2px) scale(1.08); }
.tab-bar .tab.active::after {
  content: ''; position: absolute; left: 50%; top: 0;
  width: 34px; height: 2px; transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, var(--bullion), transparent);
  animation: bloom-glow 2.2s ease-in-out infinite;
}
@keyframes bloom-glow {
  0%,100% { opacity: 0.7; filter: blur(0.5px); }
  50%     { opacity: 1; filter: blur(0); box-shadow: 0 0 12px var(--bullion); }
}
.tab-bar .tab.active .tab-icon { filter: drop-shadow(0 0 5px rgba(255,215,0,.55)); }

/* Focus ring discipline */
a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--bullion); outline-offset: 2px; border-radius: 3px;
}

/* Prose / legal pages */
.prose-shell { max-width: 820px; margin: 0 auto; padding: 1.25rem 1.25rem 5rem; }
.prose-shell h1 {
  font-family: var(--f-serif); font-weight: 900; color: var(--bullion-bright);
  font-size: clamp(1.75rem, 3vw + 1rem, 2.75rem); margin: 1rem 0 0.5rem;
}
.prose-shell .prose-eyebrow {
  font: 700 0.68rem/1 var(--f-ui); letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--brass); margin-bottom: 0.5rem;
}
.prose-shell h2 {
  font-family: var(--f-serif); color: var(--bullion);
  font-size: 1.2rem; margin-top: 2rem; margin-bottom: 0.5rem;
  border-bottom: 1px solid color-mix(in oklab, var(--bullion) 18%, black);
  padding-bottom: 0.3rem;
}
.prose-shell p, .prose-shell li { color: var(--bone); font-size: 0.95rem; line-height: 1.65; }
.prose-shell a { color: var(--bullion-bright); text-decoration: underline; text-decoration-color: var(--brass-deep); text-underline-offset: 2px; }
.prose-shell strong { color: var(--bullion-bright); }
.prose-shell code {
  background: #0a0a0c; color: var(--emerald);
  padding: 1px 6px; border-radius: 3px; font-family: var(--f-mono); font-size: 0.82em;
}

/* Cookie banner */
.cookie-banner {
  position: fixed; left: 10px; right: 10px;
  bottom: calc(76px + env(safe-area-inset-bottom));
  z-index: 85;
  background: linear-gradient(180deg, #0e1116 0%, #06080b 100%);
  border: 1px solid color-mix(in oklab, var(--bullion) 35%, black);
  border-radius: 10px; padding: 12px 14px;
  box-shadow: 0 18px 42px rgba(0,0,0,0.7);
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  font-family: var(--f-ui); font-size: 0.82rem; color: var(--bone);
}
.cookie-banner .cb-msg { flex: 1 1 260px; }
.cookie-banner .cb-msg strong { color: var(--bullion-bright); }
.cookie-banner a { color: var(--bullion-bright); text-decoration: underline; }
.cookie-banner button {
  appearance: none;
  background: linear-gradient(180deg, rgba(255,215,0,.12), rgba(255,215,0,.02));
  color: var(--bullion-bright);
  border: 1px solid color-mix(in oklab, var(--bullion) 48%, black);
  border-radius: 6px; padding: 8px 14px; cursor: pointer;
  font: 700 0.72rem/1 var(--f-ui); letter-spacing: 0.14em; text-transform: uppercase;
}
@media (min-width: 1080px) { .cookie-banner { bottom: 14px; } }

/* Footer legal bar */
.legal-bar {
  max-width: 1680px; margin: 0 auto;
  padding: 0.75rem 1.25rem 1.5rem;
  font-family: var(--f-ui); font-size: 0.72rem;
  color: var(--bone-dim); text-align: center;
}
.legal-bar a { color: var(--brass); text-decoration: none; margin: 0 0.45rem; border-bottom: 1px solid transparent; transition: color .15s, border-color .15s; }
.legal-bar a:hover { color: var(--bullion-bright); border-bottom-color: var(--bullion-deep); }

/* Reduce motion sweep */
@media (prefers-reduced-motion: reduce) {
  .tier-ambient, .tier-steady, .tier-pulse, .tier-critical { animation: none; }
  .kinetic-rotate, .weight-pulse, .shimmer-text { animation: none !important; }
  .tab-bar .tab.active::after { animation: none; }
  .kinetic-split .ch { opacity: 1; transform: none; animation: none; }
}
