/* SHAREOUT — app.css (shell). Tokens from mockup/v1/DESIGN.md §0–§5, motion §10.
   SCALE (LUAT 50): one root unit --u = 100vw / 1920. Every size is calc(N * var(--u)); 1920 = mockup 1:1,
   1024–2560 scale in proportion, below 1024 a fixed mobile unit. No max-width cap anywhere.
   BORDERS (LUAT 56): this file is the ONLY place with border/outline declarations. Route files use the .rule-* classes. */

/* ---------- 1. tokens ---------- */
:root {
  --u: calc(100vw / 1920);

  /* colours — DESIGN.md §3 */
  --paper: #054B64;            /* page ground (dominant) */
  --surface: #F3E2C7;          /* nav, footer stub, sheets */
  --surface-hi: #F7E5D0;       /* sheet body, slip */
  --surface-hi-2: #FAE9D4;
  --surface-container: #E7D1AD;
  --ink: #1B3464;
  --olive: #7A8C37;
  --orange: #F26B38;
  --mint: #97FCE4;
  --reported: #8A7F6A;
  --muted: #675A54;
  --on-ground: #F7EAD7;
  --ticker: #0E4C5E;
  --chalk: #2B3A33;
  --chalk-text: #F0EDE0;
  --blocked: #C8452A;
  --steel: #4F7FA6;
  --teal-accent: #1E8C8C;

  /* rules — DESIGN.md §3 + §4b (widths = BORDER_TABLE medians, hairlines never below 1 px) */
  --rule-paper: #C5B39F;
  --rule-paper-strong: #99947C;
  --rule-edge: #FFF6E2;
  --rule-ink: #1B3464;
  --rule-orange: #F05F25;
  --rule-chalk-yellow: #FFE27D;
  --rule-chalk-lime: #EFF180;
  --rule-nav-sep: #D2BC98;
  --rule-w-row: max(1px, calc(1.8 * var(--u)));       /* row-rule median 1.8 */
  --rule-w-cell: max(1px, calc(1.6 * var(--u)));      /* cell-rule median 1.65 */
  --rule-w-col: max(1px, calc(2 * var(--u)));         /* col-divider median 2.1 */
  --rule-w-edge: max(1px, calc(2.4 * var(--u)));      /* sheet-edge median 2.4 */
  --rule-w-ink: max(2px, calc(3 * var(--u)));         /* ink-rule median 2.9 */
  --rule-w-accent: max(2px, calc(3 * var(--u)));      /* accent-rule / nav active 3 */
  --rule-w-chip: max(2px, calc(3.3 * var(--u)));      /* token-chip-selected 3.3 */
  --rule-w-btn: max(1px, calc(2 * var(--u)));         /* btn-outline 2.1 */
  --rule-w-panel: max(1px, calc(2.8 * var(--u)));     /* panel-sheet 2.8 */
  --rule-w-note: max(1px, calc(2.2 * var(--u)));      /* input-note 2.2 · select-pill 2.3 · formula-bar 2.3 */
  --rule-w-notecard: max(1px, calc(1.7 * var(--u)));  /* note-card 1.7 */
  --rule-w-flow: max(2px, calc(2.8 * var(--u)));      /* flow-chip 2.8 */
  --rule-w-flow-navy: max(2px, calc(3.8 * var(--u))); /* flow-chip-navy 3.8 */
  --rule-w-table: max(2px, calc(2.9 * var(--u)));     /* table-compare 2.9 */
  --rule-w-state: max(2px, calc(3.3 * var(--u)));     /* chalk state cards 3.2–3.4 */

  /* type — DESIGN.md §2 */
  --f-display: "DM Sans", "Hind Guntur", system-ui, sans-serif;
  --f-ui: "Hind Guntur", system-ui, sans-serif;
  --f-num: "Source Sans 3", "Hind Guntur", system-ui, sans-serif;
  --fs-hero: calc(66 * var(--u));
  --fs-hero-sub: max(14px, calc(24 * var(--u)));
  --fs-route-title: calc(50 * var(--u));
  --fs-section: max(16px, calc(26 * var(--u)));
  --fs-nav: max(12px, calc(16 * var(--u)));
  --fs-body: max(12px, calc(15 * var(--u)));
  --fs-label: max(12px, calc(15 * var(--u)));
  --fs-meta: max(12px, calc(13 * var(--u)));
  --fs-figure: max(14px, calc(24 * var(--u)));
  --fs-slip: max(18px, calc(34 * var(--u)));

  /* materials — DESIGN.md §4 */
  --r-sheet: calc(11 * var(--u));
  --r-chip: calc(5 * var(--u));
  --r-card: calc(8 * var(--u));
  --r-input: calc(4 * var(--u));
  --sh-sheet: 0 calc(6 * var(--u)) calc(16 * var(--u)) rgba(2, 24, 34, .45);
  --sh-raise: 0 calc(3 * var(--u)) calc(8 * var(--u)) rgba(27, 52, 100, .30);

  /* page frame — frame.json (gutter 24 / 5 @1920, container 1890) */
  --gutter-l: calc(24 * var(--u));
  --gutter-r: calc(5 * var(--u));
  --gap-section: calc(64 * var(--u));     /* section gap 48–96 (LUAT 56 #22) */
  --gap-block: calc(32 * var(--u));
  --inset: calc(76 * var(--u));           /* lower sections inset (mockup x≈87 → 100 @1920, minus gutter) */

  /* motion — DESIGN.md §10 */
  --ease-desk: cubic-bezier(.2, .8, .2, 1);
  --ease-stamp: cubic-bezier(.34, 1.56, .64, 1);
  --d-quick: 220ms;
  --d-base: 320ms;
  --d-count: 500ms;
  --d-swap: 450ms;
  --rt-nudge: 24px;
  --rt-dur: 320ms;

  accent-color: var(--olive);
  scrollbar-color: #2C7088 var(--paper);
}
@media (max-width: 1023.98px) {
  :root { --u: 0.72px; --gutter-l: 12px; --gutter-r: 12px; --inset: 0px; --gap-section: 40px; }
}

/* ---------- 2. base ---------- */
*, *::before, *::after { box-sizing: border-box; }
:where(button, input, select, textarea) { border: 0; font: inherit; color: inherit; }
:where(button) { background: none; padding: 0; cursor: pointer; }
:where(button:disabled, [aria-disabled="true"]) { cursor: not-allowed; }
html { -webkit-text-size-adjust: 100%; background: var(--paper); }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font: 500 var(--fs-body)/1.25 var(--f-ui);
  color: var(--ink);
  /* §3b atmosphere layers that scroll with the page (top → bottom in paint order) */
  background:
    radial-gradient(calc(900 * var(--u)) calc(500 * var(--u)) at 82% calc(300 * var(--u)), rgba(242, 107, 56, .13), transparent 70%),
    radial-gradient(calc(1400 * var(--u)) calc(900 * var(--u)) at 40% calc(1500 * var(--u)), rgba(27, 120, 145, .35), transparent 70%),
    linear-gradient(180deg, #0E4C5E 0, #054B64 calc(860 * var(--u)), #034862 100%),
    var(--paper);
}
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; }
::selection { background: var(--orange); color: var(--surface-hi); }
:focus-visible { outline: max(2px, calc(3 * var(--u))) solid var(--orange); outline-offset: max(2px, calc(3 * var(--u))); }
.tnum { font-family: var(--f-num); font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* §3b fixed layers: dock grid + grain (never block clicks) */
.atm { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
.atm > span { position: absolute; inset: 0; }
.atm-grid {
  background-image:
    linear-gradient(rgba(151, 185, 196, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(151, 185, 196, .05) 1px, transparent 1px);
  background-size: calc(48 * var(--u)) calc(48 * var(--u));
}
.atm-glow { background: radial-gradient(60% 50% at 50% 110%, rgba(3, 40, 56, .55), transparent 70%); }
.atm-noise {
  opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- 3. nav N9 (chrome/nav.html, measured: ticker 28→32, bar 111→127 @1920) ---------- */
.site-head { position: relative; z-index: 20; font-family: var(--f-ui); color: var(--ink); }
.ticker { height: calc(32 * var(--u)); min-height: 24px; background: var(--ticker); color: var(--surface); overflow: hidden; display: flex; align-items: center; }
.ticker-track { display: flex; width: max-content; white-space: nowrap; }
.ticker-run { display: inline-flex; align-items: center; padding-left: calc(48 * var(--u)); font: 700 max(12px, calc(13 * var(--u)))/1 var(--f-ui); letter-spacing: .04em; }
.ticker-run b { font-weight: 700; letter-spacing: .05em; }
.ticker-run i { font-style: normal; color: var(--olive); margin: 0 calc(20 * var(--u)); }
.ticker-run [data-ticker-items] i { margin: 0 calc(16 * var(--u)); }

.bar {
  height: calc(127 * var(--u));
  margin: 0 calc(31 * var(--u)) 0 calc(29 * var(--u));
  background: var(--surface);
  border-radius: 0 0 calc(14 * var(--u)) calc(14 * var(--u));
  display: flex; align-items: center;
  padding: 0 calc(46 * var(--u)) 0 calc(50 * var(--u));
  box-shadow: 0 calc(8 * var(--u)) calc(22 * var(--u)) rgba(14, 76, 94, .2);
  border-bottom: var(--rule-w-edge) solid var(--rule-edge);
}
.brand { display: flex; align-items: center; gap: calc(24 * var(--u)); margin-right: auto; color: var(--ink); text-decoration: none; }
.brand-mark { height: max(36px, calc(56 * var(--u))); width: auto; aspect-ratio: 1800 / 2048; object-fit: contain; }
.brand-word { font: 800 max(20px, calc(31 * var(--u)))/1 var(--f-display); letter-spacing: -.005em; }
.routes { display: flex; align-items: center; gap: calc(32 * var(--u)); }
.routes a { position: relative; color: var(--ink); text-decoration: none; font: 700 max(12px, calc(18 * var(--u)))/1 var(--f-ui); padding: calc(6 * var(--u)) 0; transition: color var(--d-quick) var(--ease-desk); }
.routes a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: calc(-6 * var(--u)); height: var(--rule-w-accent);
  background: var(--orange); border-radius: 3px; transform: scaleX(0); transform-origin: left center;
  transition: transform var(--d-base) var(--ease-desk);
}
.routes a.is-active::after, .routes a[aria-current="page"]::after { transform: scaleX(1); }
.routes a:hover::after { transform: scaleX(.35); }
.routes a.is-active:hover::after { transform: scaleX(1); }
.routes-sep { display: block; width: 0; height: max(16px, calc(26 * var(--u))); margin: 0 calc(-4 * var(--u)) 0 0; }
.routes .social { padding-left: 0; }
.is-soon { opacity: .55; cursor: not-allowed; }
.routes a.is-soon::after { display: none; }
.nav-toggle { display: none; }

/* ---------- 4. page frame (frame.json) — one container for every route ---------- */
.page {
  display: block;
  margin: 0 var(--gutter-r) 0 var(--gutter-l);
  min-height: 60vh;
  padding-bottom: var(--gap-section);
}
.page:focus { outline: none; }
/* a route section that the mockup draws full-bleed (hero art band) escapes the gutters */
.frame-bleed { margin-left: calc(-1 * var(--gutter-l)); margin-right: calc(-1 * var(--gutter-r)); }
/* lower sections that the mockup insets (x≈87–1585 mockup) */
.frame-inset { margin-left: var(--inset); margin-right: calc(var(--inset) + 19 * var(--u)); }
.stack-sections > * + * { margin-top: var(--gap-section); }

/* ---------- 5. shared components (DESIGN.md §5) ---------- */
.sheet {
  position: relative;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.4' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .35 0 0 0 0 .2 0 0 0 .5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)' opacity='.25'/%3E%3C/svg%3E"),
    var(--surface-hi);
  border-radius: var(--r-sheet);
  box-shadow: var(--sh-sheet);
  color: var(--ink);
}
.sec-title {
  position: relative; margin: 0; padding-left: calc(20 * var(--u));
  font: 800 var(--fs-section)/1.1 var(--f-display); text-transform: uppercase; color: var(--ink);
}
.sec-title::before { content: ""; position: absolute; left: 0; top: .08em; bottom: .08em; width: calc(6 * var(--u)); min-width: 3px; background: var(--orange); border-radius: 1px; }
.sec-title.is-olive::before { background: var(--olive); }
.sec-title.is-yellow::before { background: #E8B53A; }
.route-title { margin: 0; font: 800 var(--fs-route-title)/1 var(--f-display); text-transform: uppercase; color: var(--on-ground); }
.hero-title { margin: 0; font: 700 var(--fs-hero)/.98 var(--f-display); letter-spacing: -.017em; color: var(--on-ground); }
.hero-sub { margin: 0; font: 500 var(--fs-hero-sub)/1.2 var(--f-ui); color: var(--on-ground); }
.label { font: 700 var(--fs-label)/1.2 var(--f-ui); letter-spacing: .02em; text-transform: uppercase; }
.meta { font: italic 400 var(--fs-meta)/1.2 var(--f-num); color: var(--muted); }
.figure { font: 700 var(--fs-figure)/1.05 var(--f-num); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.quote { font: italic 400 var(--fs-body)/1.25 var(--f-num); }
.mint-chip { background: var(--mint); color: var(--ink); padding: 0 calc(6 * var(--u)); border-radius: calc(6 * var(--u)); }

/* chips / segmented (period = ink fill, route/amount = olive fill) */
.chip {
  display: inline-flex; align-items: center; justify-content: center; gap: calc(6 * var(--u));
  min-height: calc(32 * var(--u)); padding: 0 calc(16 * var(--u));
  border-radius: var(--r-chip); background: var(--surface-hi-2); color: var(--ink);
  font: 500 var(--fs-body)/1 var(--f-ui);
  transition: background-color var(--d-quick) var(--ease-desk), color var(--d-quick) var(--ease-desk), transform var(--d-quick) var(--ease-desk);
}
.chip:hover { transform: translateY(calc(-1 * var(--u))); }
.chip[aria-pressed="true"], .chip.is-on { background: var(--ink); color: var(--surface-hi); }
.chip.is-olive[aria-pressed="true"], .chip.is-olive.is-on { background: var(--olive); color: var(--surface-hi); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: calc(8 * var(--u));
  min-height: calc(36 * var(--u)); padding: 0 calc(20 * var(--u)); border-radius: var(--r-chip);
  font: 700 var(--fs-body)/1 var(--f-ui); text-decoration: none; cursor: pointer;
  transition: transform var(--d-quick) var(--ease-desk), box-shadow var(--d-quick) var(--ease-desk), filter var(--d-quick);
}
.btn-olive { background: var(--olive); color: var(--surface-hi); box-shadow: var(--sh-raise); }
.btn-orange { background: var(--orange); color: #FFF6E2; box-shadow: var(--sh-raise); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn:not(:disabled):not([aria-disabled="true"]):hover { transform: translateY(calc(-2 * var(--u))); }
.btn:not(:disabled):not([aria-disabled="true"]):active { transform: translateY(0) scale(.98); }
/* BUY on Montra: pre-launch = grey paper; launched (launch.js sets data-launch-done) = solid ink, never looks disabled */
.btn-buy { background: #D9CDBA; color: #8B8070; min-height: calc(46 * var(--u)); font-size: max(13px, calc(18 * var(--u))); }
.btn-buy[data-launch-done] { background: var(--ink); color: var(--surface-hi); box-shadow: var(--sh-raise); cursor: pointer; }
.btn-buy[data-launch-done]:hover { filter: brightness(1.15); }

/* inputs: the frame wraps the whole control (padding inside the frame) */
.field { display: inline-flex; align-items: center; gap: calc(8 * var(--u)); min-height: calc(34 * var(--u)); padding: 0 calc(12 * var(--u)); background: var(--surface-hi-2); border-radius: var(--r-input); }
.field input { background: transparent; min-width: 0; width: 100%; font: 700 max(13px, calc(18 * var(--u)))/1 var(--f-num); font-variant-numeric: tabular-nums; color: var(--ink); }
.field input:focus { outline: none; }
.field:focus-within { box-shadow: 0 0 0 max(2px, calc(3 * var(--u))) rgba(242, 107, 56, .45); }

/* status pill (never colour alone: icon + word) */
.status { display: inline-flex; align-items: center; gap: calc(6 * var(--u)); min-height: calc(30 * var(--u)); padding: 0 calc(10 * var(--u)); border-radius: calc(15 * var(--u)); font: 700 var(--fs-meta)/1 var(--f-ui); }
.status[data-status="ok"] { background: var(--olive); color: #FFF6E2; }
.status[data-status="slow"] { background: var(--orange); color: #FFF6E2; }
.status[data-status="blocked"] { background: var(--blocked); color: #FFF6E2; }
.status[data-status="down"] { background: var(--muted); color: #FFF6E2; }
.status[data-status="link"] { background: var(--reported); color: #FFF6E2; }

/* ---------- 6. BORDER classes — one per component of BORDER_TABLE / DESIGN.md §4b ---------- */
.rule-row { border-bottom: var(--rule-w-row) solid var(--rule-paper); }
.rule-row:last-child { border-bottom-color: transparent; }
.rule-cell { border-bottom: var(--rule-w-cell) solid var(--rule-paper); }
.rule-col { border-left: var(--rule-w-col) solid var(--rule-nav-sep); }
.sheet .rule-col, .rule-col.on-paper { border-left-color: var(--rule-paper); }
.rule-sheet, .sheet { border: var(--rule-w-edge) solid var(--rule-edge); }
.rule-ink { border-bottom: var(--rule-w-ink) solid var(--rule-ink); }
.rule-accent { border-bottom: var(--rule-w-accent) solid var(--orange); }
.rule-accent-left { border-left: calc(6 * var(--u)) solid var(--orange); }
.rule-reported { border-bottom: var(--rule-w-cell) dashed var(--reported); }
.rule-chip-selected { border: var(--rule-w-chip) solid var(--rule-orange); }
.rule-btn { border: var(--rule-w-btn) solid var(--rule-paper-strong); }
.rule-panel { border: var(--rule-w-panel) solid var(--rule-edge); }
.rule-note { border: var(--rule-w-note) solid var(--rule-paper); }
.rule-notecard { border: var(--rule-w-notecard) solid var(--rule-paper-strong); }
.rule-pill { border: var(--rule-w-note) solid var(--rule-paper); }
.rule-input { border: var(--rule-w-note) solid var(--rule-paper-strong); }
.rule-flow { border: var(--rule-w-flow) solid var(--rule-edge); }
.rule-flow-navy { border: var(--rule-w-flow-navy) solid var(--rule-ink); }
.rule-formula { border: var(--rule-w-note) solid var(--rule-paper); }
.rule-table { border: var(--rule-w-table) solid var(--rule-paper); }
.rule-state-ok { border: var(--rule-w-state) solid var(--rule-chalk-lime); }
.rule-state-slow { border: var(--rule-w-state) solid var(--rule-chalk-yellow); }
.rule-state-blocked { border: var(--rule-w-state) solid var(--rule-orange); }
/* shared edges: the second of two adjacent framed boxes never redraws the shared side */
.rule-table .rule-row:last-child, .rule-panel > .rule-row:last-child { border-bottom: 0; }
.rule-col:first-child { border-left: 0; }
/* fill-edge rims (mockup draws a bright hairline where a coloured head meets paper, and around filled chips) — no layout change */
:root { --rim-shadow: 0 0 0 max(1px, calc(1.3 * var(--u))) #FFFCF0, 0 0 0 max(2px, calc(2.8 * var(--u))) rgba(27, 52, 100, .6); }
.rule-edge-top { box-shadow: inset 0 max(1px, calc(1.3 * var(--u))) 0 0 rgba(28, 30, 12, .6), inset 0 max(2px, calc(3.4 * var(--u))) 0 0 #FFF9EA; }
.rule-rim { box-shadow: var(--rim-shadow); }
.rule-row-top { box-shadow: inset 0 var(--rule-w-row) 0 0 var(--rule-paper); }
.rule-flat-b { border-bottom-width: 0; }

/* ---------- 7. footer F3 (chrome/footer.html, measured 59→68 @1920) ---------- */
.site-foot { margin: 0; padding: calc(8 * var(--u)) var(--gutter-r) 0 var(--gutter-l); background: var(--paper); position: relative; z-index: 15; }
.stub {
  position: relative;
  min-height: calc(68 * var(--u));
  background: var(--surface);
  color: var(--ink);
  display: grid;
  grid-template-columns: auto auto minmax(calc(80 * var(--u)), 1fr) auto auto auto auto;
  align-items: center;
  column-gap: calc(26 * var(--u));
  padding: calc(6 * var(--u)) calc(40 * var(--u)) 0 calc(36 * var(--u));
  font: 500 var(--fs-meta)/1 var(--f-ui);
  border-radius: calc(4 * var(--u)) calc(4 * var(--u)) 0 0;
  /* perforated top edge (receipt stub) */
  -webkit-mask: radial-gradient(circle at 50% 0, transparent calc(4 * var(--u)), #000 calc(4.6 * var(--u))) 0 0 / calc(16 * var(--u)) 100% repeat-x;
  mask: radial-gradient(circle at 50% 0, transparent calc(4 * var(--u)), #000 calc(4.6 * var(--u))) 0 0 / calc(16 * var(--u)) 100% repeat-x;
}
.foot-mark { height: max(28px, calc(40 * var(--u))); width: auto; aspect-ratio: 1800 / 2048; }
.foot-label { font: 700 max(13px, calc(19 * var(--u)))/1 var(--f-display); }
.foot-leaders { height: 1px; border-bottom: max(1px, calc(2 * var(--u))) dotted var(--ink); opacity: .7; }
.foot-sources { white-space: nowrap; }
.foot-ca { display: inline-flex; align-items: center; gap: calc(14 * var(--u)); padding-left: calc(24 * var(--u)); white-space: nowrap; }
.foot-ca-val b { font: 700 var(--fs-meta)/1 var(--f-num); }
.foot-copy { min-height: calc(26 * var(--u)); padding: 0 calc(10 * var(--u)); border-radius: var(--r-input); font: 700 var(--fs-meta)/1 var(--f-ui); background: transparent; }
.foot-copy:disabled { opacity: .5; }
.foot-links { display: inline-flex; gap: calc(22 * var(--u)); padding-left: calc(24 * var(--u)); }
.foot-links a { text-decoration: none; }
.foot-period { padding-left: calc(24 * var(--u)); font: 600 max(14px, calc(22 * var(--u)))/1 var(--f-num); letter-spacing: .05em; font-variant-numeric: tabular-nums; }

/* ---------- 8. route fragment loader states (router v3 notice / retry panel) ---------- */
.page > .route-error, .page [data-router-error] { color: var(--on-ground); font: 500 var(--fs-body)/1.4 var(--f-ui); }

/* ---------- 9. MOTION (DESIGN.md §10) — transform/opacity only, all off under reduced motion ---------- */
/* ticker: slow pay-desk marquee, pauses on hover */
.ticker-track.is-running { animation: so-ticker 46s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes so-ticker { to { transform: translateX(-50%); } }

/* reveal = "slip feed": paper slides out from under the desk lip (down 10 → 0, slight tilt settles) */
[data-reveal] { opacity: 0; transform: translateY(calc(10 * var(--u))) rotate(-.35deg); transform-origin: left top; }
[data-reveal].is-in { opacity: 1; transform: none; transition: opacity var(--d-base) var(--ease-desk), transform var(--d-base) var(--ease-desk); transition-delay: var(--reveal-delay, 0ms); }

/* stamp = a figure is stamped when it settles (end of count-up, live tick) */
.is-stamped { animation: so-stamp var(--d-quick) var(--ease-stamp); }
@keyframes so-stamp { 0% { transform: scale(1.08) rotate(-1.2deg); } 100% { transform: none; } }

/* live tick = harbor-lamp flash on a cell whose live value just landed */
.is-ticked { position: relative; }
.is-ticked::after { content: ""; position: absolute; inset: calc(-3 * var(--u)) calc(-6 * var(--u)); border-radius: var(--r-input); background: radial-gradient(closest-side, rgba(242, 107, 56, .35), transparent); pointer-events: none; animation: so-lamp 900ms var(--ease-desk) forwards; }
@keyframes so-lamp { 0% { opacity: 0; } 25% { opacity: 1; } 100% { opacity: 0; } }

/* grow-in = a bar/fill is paid out from the left like a strip from the till */
[data-grow] { transform: scaleX(0); transform-origin: left center; }
[data-grow].is-in { transform: scaleX(var(--grow, 1)); transition: transform var(--d-count) var(--ease-desk); }

/* hover lift = a pay slip lifts off the desk by 2 px */
.lift { transition: transform var(--d-quick) var(--ease-desk), box-shadow var(--d-quick) var(--ease-desk); }
.lift:hover { transform: translateY(calc(-2 * var(--u))); box-shadow: 0 calc(10 * var(--u)) calc(22 * var(--u)) rgba(2, 24, 34, .45); }

/* hero lamp breathing (decoration only) */
.lamp-breathe { animation: so-lamp-breathe 5.6s ease-in-out infinite; }
@keyframes so-lamp-breathe { 0%, 100% { opacity: .75; } 50% { opacity: 1; } }

/* art parallax: scroll-driven, art only (LUAT 67 rule a) */
@supports ((animation-timeline: view()) and (animation-range: entry)) {
  .art-drift { animation: so-drift linear both; animation-timeline: view(); animation-range: cover 0% cover 100%; }
  @keyframes so-drift { from { transform: translateY(calc(-14 * var(--u))) scale(1.03); } to { transform: translateY(calc(14 * var(--u))) scale(1.03); } }
}

/* route change: kit router v3 View Transition, tuned for this world */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: var(--rt-dur); }
html[data-rt-dir="back"] { --rt-nudge: -24px; }

@media (prefers-reduced-motion: reduce) {
  .ticker-track.is-running, .lamp-breathe, .art-drift, .is-stamped, .is-ticked::after { animation: none !important; }
  [data-reveal], [data-reveal].is-in { opacity: 1; transform: none; transition: none; }
  [data-grow], [data-grow].is-in { transform: scaleX(var(--grow, 1)); transition: none; }
  .lift, .lift:hover, .chip, .btn, .routes a::after { transition: none; }
}

/* ---------- 10. mobile (< 1024): drawer nav, stacked footer, no horizontal scroll ---------- */
@media (max-width: 1023.98px) {
  .bar { height: 64px; margin: 0 8px; padding: 0 14px; border-radius: 0 0 10px 10px; position: relative; }
  .brand-mark { height: 40px; }
  .brand-word { font-size: 20px; }
  .nav-toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 10px; font: 700 14px/1 var(--f-ui); color: var(--ink); }
  .nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after { display: block; width: 18px; height: 2px; background: var(--ink); border-radius: 2px; position: relative; }
  .nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
  .nav-toggle-bars::before { top: -6px; } .nav-toggle-bars::after { top: 6px; }
  .routes {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 30;
    flex-direction: column; align-items: stretch; gap: 0; padding: 8px 18px 14px;
    background: var(--surface); border-radius: 10px; box-shadow: var(--sh-sheet);
    opacity: 0; transform: translateY(-8px); visibility: hidden;
    transition: opacity var(--d-quick) var(--ease-desk), transform var(--d-quick) var(--ease-desk), visibility 0s linear var(--d-quick);
  }
  .bar[data-open] .routes { opacity: 1; transform: none; visibility: visible; transition-delay: 0s; }
  .routes a { font-size: 16px; padding: 12px 0; }
  .routes a::after { bottom: 6px; width: 40px; right: auto; }
  .routes-sep { display: none; }
  .ticker { height: 28px; }
  .stub { grid-template-columns: auto 1fr; row-gap: 10px; padding: 18px 16px 14px; font-size: 13px; }
  .foot-leaders { display: none; }
  .foot-sources { white-space: normal; grid-column: 1 / -1; }
  .foot-ca, .foot-links, .foot-period { grid-column: 1 / -1; padding-left: 0; border-left: 0; flex-wrap: wrap; white-space: normal; }
}

/* shell-only: spacing of the route heading stub (route jobs replace routes/<name>.html) */
[data-route-stub] { padding: calc(96 * var(--u)) 0 calc(48 * var(--u)); display: grid; gap: calc(16 * var(--u)); }
