/* ============================================================================
   DAPPER LABS — BOARD OF DIRECTORS
   Design system. Mode: Editorial (Rembrandt house style).
   Palette: paper-ink cream. Single accent, reserved for money and metrics.
   ========================================================================= */

/* ---------------------------------------------------------------- TOKENS */
:root {
  /* ink */
  --ink:        #1a1a1a;
  --ink-2:      #4b4b48;
  --ink-3:      #8b8b87;
  --ink-4:      #b4b0a8;

  /* paper */
  --paper:      #faf8f4;
  --paper-2:    #f3f0ea;
  --paper-3:    #ebe7de;
  --rule:       #ddd8ca;
  --rule-soft:  #e8e4d9;

  /* the one accent — money, metrics, active state */
  --accent:      #b34700;
  --accent-2:    #d65a00;
  --accent-soft: rgba(179, 71, 0, 0.075);
  --accent-line: rgba(179, 71, 0, 0.22);

  /* semantic, used sparingly in data views only */
  --pos: #1f6b45;
  --neg: #9b2c2c;
  --warn:#8a6412;

  --shadow-1: 0 1px 2px rgba(26,26,26,.04);
  --shadow-2: 0 1px 0 rgba(26,26,26,.03), 0 10px 30px rgba(26,26,26,.07);
  --shadow-3: 0 24px 80px rgba(26,26,26,.18), 0 2px 8px rgba(26,26,26,.08);

  /* type */
  --serif: "Tiempos Headline", "Newsreader", "Iowan Old Style", "Charter", Georgia, serif;
  --sans:  "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono:  "Geist Mono", ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;

  --t-display: clamp(38px, 6.2vw, 78px);
  --t-h1:      clamp(28px, 3.4vw, 44px);
  --t-h2:      clamp(21px, 2.1vw, 27px);
  --t-h3:      clamp(16px, 1.35vw, 18px);
  --t-body:    clamp(16.5px, 1.15vw, 18.5px);
  --t-small:   clamp(14px, 1vw, 15px);
  --t-meta:    clamp(10.5px, .82vw, 12px);

  /* layout */
  --rail:      292px;
  --measure:   68ch;
  --gutter:    clamp(20px, 4vw, 72px);
  --wide:      1180px;

  --ease:      cubic-bezier(.22,.61,.36,1);
  --ease-out:  cubic-bezier(.16,1,.3,1);
  --dur:       620ms;
}

[data-theme="dark"] {
  --ink: #f2eee5;  --ink-2: #bfbab0;  --ink-3: #7d7970;  --ink-4: #5a564f;
  --paper: #12110f; --paper-2: #1a1917; --paper-3: #22201d;
  --rule: #2e2b27;  --rule-soft: #262320;
  --accent: #ff8340; --accent-2: #ffab77;
  --accent-soft: rgba(255,131,64,.10);
  --accent-line: rgba(255,131,64,.28);
  --pos:#4fb083; --neg:#e08585; --warn:#d3a94a;
  --shadow-2: 0 1px 0 rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.35);
  --shadow-3: 0 24px 80px rgba(0,0,0,.6);
}

/* ---------------------------------------------------------------- RESET */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  font-size: var(--t-body);
  line-height: 1.62;
  color: var(--ink-2);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11", "kern";
  transition: background 400ms var(--ease), color 400ms var(--ease);
}
img, svg { max-width: 100%; display: block; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: var(--ink); text-decoration-color: var(--accent-line); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: var(--accent); }
::selection { background: var(--accent-soft); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* ================================================================== GATE */
.gate {
  position: fixed; inset: 0; z-index: 999;
  display: grid; place-items: center;
  background: var(--paper);
  padding: var(--gutter);
}
.gate[hidden] { display: none; }
.gate.is-leaving { animation: gateOut 700ms var(--ease-out) forwards; }
@keyframes gateOut {
  to { opacity: 0; filter: blur(14px); transform: scale(1.03); visibility: hidden; }
}
.gate-inner { width: 100%; max-width: 380px; text-align: left; }
.gate-mark {
  font-family: var(--mono); font-size: var(--t-meta);
  letter-spacing: .22em; text-transform: uppercase; color: var(--accent);
  display: flex; align-items: center; gap: 12px; margin-bottom: 28px;
}
.gate-mark::before { content: ""; width: 22px; height: 1px; background: var(--accent); }
.gate h1 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(30px, 4vw, 42px); line-height: 1.06;
  letter-spacing: -.025em; color: var(--ink); margin-bottom: 14px;
}
.gate p { font-size: var(--t-small); color: var(--ink-3); margin-bottom: 30px; }
.gate-field { display: flex; gap: 8px; }
.gate input {
  flex: 1; font-family: var(--mono); font-size: 15px; letter-spacing: .05em;
  padding: 13px 15px; color: var(--ink);
  background: var(--paper-2); border: 1px solid var(--rule); border-radius: 3px;
  transition: border-color 200ms var(--ease), background 200ms var(--ease);
}
.gate input:focus { outline: none; border-color: var(--accent); background: var(--paper); }
.gate button[type="submit"] {
  padding: 13px 22px; background: var(--ink); color: var(--paper);
  border-radius: 3px; font-size: 14px; font-weight: 500;
  transition: background 200ms var(--ease), transform 120ms var(--ease);
}
.gate button[type="submit"]:hover { background: var(--accent); }
.gate button[type="submit"]:active { transform: translateY(1px); }
.gate-err {
  margin-top: 14px; font-family: var(--mono); font-size: 11.5px;
  letter-spacing: .1em; text-transform: uppercase; color: var(--neg);
  opacity: 0; transition: opacity 200ms var(--ease);
}
.gate-err.show { opacity: 1; }
.gate-inner.shake { animation: shake 380ms var(--ease); }
@keyframes shake {
  10%,90% { transform: translateX(-2px); }
  20%,80% { transform: translateX(4px); }
  30%,50%,70% { transform: translateX(-7px); }
  40%,60% { transform: translateX(7px); }
}
.gate-foot {
  margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--rule);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-4);
}

/* ============================================================ APP SHELL */
.app { opacity: 0; }
.app.ready { animation: appIn 900ms var(--ease-out) forwards; }
@keyframes appIn { from { opacity:0; transform: translateY(10px);} to { opacity:1; transform:none; } }

/* reading progress */
.progress-rail {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 90;
  background: transparent; pointer-events: none;
}
.progress-bar {
  height: 100%; width: 100%; background: var(--accent);
  transform: scaleX(0); transform-origin: 0 50%;
  transition: transform 90ms linear;
}

/* ============================================================ SIDE RAIL */
.rail {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--rail); z-index: 80;
  display: flex; flex-direction: column;
  background: var(--paper);
  border-right: 1px solid var(--rule);
  transition: transform 420ms var(--ease-out), background 400ms var(--ease);
}
.rail-head {
  padding: 26px 26px 18px;
  border-bottom: 1px solid var(--rule-soft);
}
.rail-mark {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 10px;
}
.rail-title {
  font-family: var(--serif); font-size: 19px; line-height: 1.2;
  font-weight: 500; letter-spacing: -.01em; color: var(--ink);
}
.rail-date {
  margin-top: 7px; font-family: var(--mono); font-size: 10.5px;
  letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3);
}

.rail-nav { flex: 1; overflow-y: auto; padding: 16px 14px 20px; position: relative; scrollbar-width: thin; }
.rail-nav::-webkit-scrollbar { width: 6px; }
.rail-nav::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 3px; }

/* sliding active indicator */
.nav-marker {
  position: absolute; left: 14px; width: 2px; background: var(--accent);
  border-radius: 1px; top: 0; height: 0; opacity: 0;
  transition: transform 380ms var(--ease-out), height 380ms var(--ease-out), opacity 220ms var(--ease);
  pointer-events: none;
}

.nav-group { margin-bottom: 4px; }
.nav-label {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--ink-4);
  padding: 16px 12px 7px;
}
.nav-a {
  display: flex; align-items: baseline; gap: 10px;
  padding: 7px 12px; border-radius: 3px;
  font-size: 14px; line-height: 1.35; color: var(--ink-2);
  text-decoration: none;
  transition: color 180ms var(--ease), background 180ms var(--ease);
}
.nav-a:hover { color: var(--ink); background: var(--paper-2); }
.nav-a.active { color: var(--accent); font-weight: 500; }
.nav-num {
  font-family: var(--mono); font-size: 10px; color: var(--ink-4);
  min-width: 16px; font-variant-numeric: tabular-nums;
  transition: color 180ms var(--ease);
}
.nav-a.active .nav-num { color: var(--accent); }
.nav-a.sub { padding-left: 38px; font-size: 13px; color: var(--ink-3); }
.nav-a.sub:hover { color: var(--ink-2); }
.nav-a.sub.active { color: var(--accent); }

.rail-foot {
  padding: 14px 20px 18px; border-top: 1px solid var(--rule-soft);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.icon-btn {
  width: 30px; height: 30px; display: grid; place-items: center;
  border-radius: 3px; color: var(--ink-3);
  transition: color 180ms var(--ease), background 180ms var(--ease);
}
.icon-btn:hover { color: var(--ink); background: var(--paper-2); }
.icon-btn svg { width: 15px; height: 15px; }
.kbd-hint {
  font-family: var(--mono); font-size: 10px; letter-spacing: .08em;
  color: var(--ink-4); display: flex; align-items: center; gap: 5px;
}
.kbd-hint kbd {
  font-family: var(--mono); font-size: 9.5px; padding: 2px 5px;
  border: 1px solid var(--rule); border-radius: 3px; background: var(--paper-2);
  color: var(--ink-3);
}

/* mobile top bar */
.topbar {
  display: none; position: fixed; top: 0; left: 0; right: 0; z-index: 85;
  align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 16px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--rule);
}
.topbar-title {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.scrim {
  position: fixed; inset: 0; z-index: 79; background: rgba(20,18,15,.35);
  opacity: 0; pointer-events: none; transition: opacity 300ms var(--ease);
  backdrop-filter: blur(2px);
}
.scrim.show { opacity: 1; pointer-events: auto; }

/* ============================================================== CONTENT */
.main { margin-left: var(--rail); }
.wrap { max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter); }

/* ---- hero ---- */
.hero { padding: clamp(76px, 11vh, 132px) 0 clamp(48px, 7vh, 78px); }
.hero-eyebrow {
  font-family: var(--mono); font-size: var(--t-meta); letter-spacing: .2em;
  text-transform: uppercase; color: var(--accent);
  display: flex; align-items: center; gap: 12px; margin-bottom: 30px;
}
.hero-eyebrow::before { content: ""; width: 26px; height: 1px; background: var(--accent); }
.hero h1 {
  font-family: var(--serif); font-weight: 500;
  font-size: var(--t-display); line-height: 1.02; letter-spacing: -.032em;
  color: var(--ink); max-width: 19ch;
}
.hero h1 em { font-style: italic; color: var(--accent); }
.hero-lede {
  margin-top: 30px; max-width: 60ch;
  font-size: clamp(18px, 1.5vw, 21.5px); line-height: 1.52; color: var(--ink-2);
}
.hero-meta {
  margin-top: 46px; padding-top: 20px; border-top: 1px solid var(--rule);
  display: flex; flex-wrap: wrap; gap: 10px 34px;
  font-family: var(--mono); font-size: var(--t-meta);
  letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3);
}
.hero-meta b { color: var(--ink-2); font-weight: 500; }

/* ---- the bottom line / BLUF strip ---- */
.bluf {
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  padding: 40px 0 44px; margin-bottom: clamp(48px, 7vh, 84px);
}
.bluf-label {
  font-family: var(--mono); font-size: var(--t-meta); letter-spacing: .18em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: 26px;
}
.metrics {
  display: grid; gap: 1px; background: var(--rule-soft);
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  border: 1px solid var(--rule-soft);
}
.metric { background: var(--paper); padding: 22px 20px 20px; }
.metric-v {
  font-family: var(--sans); font-size: clamp(30px, 3.4vw, 44px);
  font-weight: 600; line-height: 1; letter-spacing: -.035em;
  color: var(--accent); font-variant-numeric: tabular-nums;
  display: flex; align-items: baseline; gap: 2px;
}
.metric-v .unit { font-size: .48em; font-weight: 500; letter-spacing: -.01em; }
.metric-k {
  margin-top: 11px; font-size: 13.5px; line-height: 1.4; color: var(--ink-2);
}
.metric-n {
  margin-top: 5px; font-family: var(--mono); font-size: 10px;
  letter-spacing: .1em; text-transform: uppercase; color: var(--ink-4);
}

/* ---- sections ---- */
.section { padding: clamp(52px, 8vh, 96px) 0; border-top: 1px solid var(--rule-soft); }
.section:first-of-type { border-top: 0; }
.section.intro { padding-top: 0; border-top: 0; }
.lede-prose > p {
  font-size: clamp(17.5px, 1.4vw, 20px); line-height: 1.58;
  color: var(--ink-2); max-width: 64ch;
}
.lede-prose > p:first-child { color: var(--ink); }
.lede-prose > p:first-child::first-letter {
  font-family: var(--serif); float: left; font-size: 3.4em; line-height: .82;
  padding: .06em .09em 0 0; color: var(--accent); font-weight: 500;
}
.section-head { margin-bottom: 40px; }
.section-num {
  font-family: var(--mono); font-size: var(--t-meta); letter-spacing: .2em;
  text-transform: uppercase; color: var(--accent);
  display: flex; align-items: center; gap: 12px; margin-bottom: 18px;
}
.section-num::after {
  content: ""; height: 1px; background: var(--accent-line); flex: 1;
  transform: scaleX(0); transform-origin: 0 50%;
  transition: transform 900ms var(--ease-out) 120ms;
}
.reveal.is-in .section-num::after { transform: scaleX(1); }
.section h2 {
  font-family: var(--serif); font-weight: 500; font-size: var(--t-h1);
  line-height: 1.1; letter-spacing: -.028em; color: var(--ink); max-width: 22ch;
}
.section-sub {
  margin-top: 18px; max-width: 62ch; font-size: clamp(17px, 1.3vw, 19.5px);
  color: var(--ink-2); line-height: 1.55;
}

h3 {
  font-family: var(--sans); font-size: var(--t-h2); font-weight: 600;
  line-height: 1.25; letter-spacing: -.018em; color: var(--ink);
  margin: 52px 0 16px; max-width: 30ch;
}
h4 {
  font-family: var(--sans); font-size: clamp(15.5px, 1.2vw, 17.5px);
  font-weight: 600; line-height: 1.35; letter-spacing: -.008em;
  color: var(--ink); margin: 38px 0 13px; max-width: 40ch;
  padding-left: 15px; border-left: 2px solid var(--accent-line);
}
.label {
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3);
  margin: 40px 0 14px;
}
p { max-width: var(--measure); margin-bottom: 19px; }
p strong { color: var(--ink); font-weight: 600; }
p em { font-style: italic; }
.prose > *:last-child { margin-bottom: 0; }

ul, ol { max-width: var(--measure); margin: 0 0 20px 0; padding-left: 0; list-style: none; }
ul li, ol li { position: relative; padding-left: 26px; margin-bottom: 11px; }
ul li::before {
  content: ""; position: absolute; left: 3px; top: .68em;
  width: 5px; height: 1px; background: var(--accent);
}
ol { counter-reset: li; }
ol li::before {
  counter-increment: li; content: counter(li);
  position: absolute; left: 0; top: .05em;
  font-family: var(--mono); font-size: 11px; color: var(--accent);
  font-variant-numeric: tabular-nums;
}

/* ---- pull quote / uncomfortable truth ---- */
.pull {
  margin: 40px 0; padding: 26px 0 26px 30px;
  border-left: 2px solid var(--accent); max-width: 60ch;
}
.pull p {
  font-family: var(--serif); font-size: clamp(19px, 1.8vw, 24px);
  line-height: 1.38; letter-spacing: -.015em; color: var(--ink);
  margin: 0;
}
.pull cite {
  display: block; margin-top: 14px; font-family: var(--mono); font-style: normal;
  font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3);
}

/* ---- callout ---- */
.callout {
  margin: 34px 0; padding: 22px 26px;
  background: var(--paper-2); border-left: 2px solid var(--ink-4);
  max-width: var(--measure);
}
.callout.accent { border-left-color: var(--accent); background: var(--accent-soft); }
.callout .label { margin: 0 0 9px; color: var(--ink-2); }
.callout.accent .label { color: var(--accent); }
.callout p { margin-bottom: 0; font-size: var(--t-small); line-height: 1.6; }
.callout p + p { margin-top: 12px; }

/* ---- progressive disclosure ---- */
.disclose {
  margin: 34px 0; border-top: 1px solid var(--rule); position: relative;
}
/* an accent hairline draws across the top edge as the strip enters view */
.disclose::after {
  content: ""; position: absolute; top: -1px; left: 0; height: 1px; width: 100%;
  background: var(--accent); transform: scaleX(0); transform-origin: 0 50%;
  transition: transform 1000ms var(--ease-out) 260ms;
}
.disclose.is-in::after, .disclose.is-open::after { transform: scaleX(1); }

.disclose-btn {
  position: relative; width: 100%;
  display: flex; align-items: center; gap: 14px;
  padding: 16px 2px; text-align: left;
  transition: color 200ms var(--ease);
}
.disclose-btn::before {
  content: ""; position: absolute; inset: 0 -16px; border-radius: 3px;
  background: var(--accent-soft); opacity: 0;
  transition: opacity 280ms var(--ease);
}
.disclose-btn > * { position: relative; }
.disclose-btn:hover::before { opacity: 1; }
.disclose-btn:hover .disclose-t { color: var(--accent); }
.disclose-btn:hover .disclose-chev { border-color: var(--accent); color: var(--accent); }
.disclose-btn:hover .disclose-hint { color: var(--ink-2); }

.disclose-chev {
  position: relative;
  flex: none; width: 24px; height: 24px; display: grid; place-items: center;
  border: 1px solid var(--rule); border-radius: 50%; color: var(--ink-3);
  transition: transform 340ms var(--ease-out), border-color 200ms var(--ease), color 200ms var(--ease);
}
.disclose-chev svg { width: 9px; height: 9px; }
/* a slow double sonar ring, once, when the strip first arrives — then it rests */
.disclose-chev::before {
  content: ""; position: absolute; inset: -1px; border-radius: 50%;
  border: 1px solid var(--accent); opacity: 0; pointer-events: none;
}
.disclose.is-in .disclose-chev::before {
  animation: sonar 2600ms var(--ease-out) 700ms 2;
}
.disclose.is-open .disclose-chev::before { animation: none; opacity: 0; }
@keyframes sonar {
  0%       { transform: scale(1);   opacity: .5; }
  60%,100% { transform: scale(2.1); opacity: 0; }
}
.disclose.is-open .disclose-chev {
  transform: rotate(90deg); border-color: var(--accent); color: var(--accent);
}
.disclose-t {
  flex: 1; font-size: 15.5px; font-weight: 500; color: var(--ink); letter-spacing: -.005em;
  transition: color 200ms var(--ease);
}
/* the census — what you get if you open it */
.disclose-hint {
  font-family: var(--mono); font-size: 10px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-4); white-space: nowrap;
  transition: color 200ms var(--ease);
}
@media (max-width: 640px) { .disclose-hint { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .disclose::after { transform: scaleX(1); }
  .disclose-chev::before { animation: none !important; }
}
.disclose-body {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows 460ms var(--ease-out);
}
.disclose.is-open .disclose-body { grid-template-rows: 1fr; }
.disclose-inner {
  overflow: hidden;
  opacity: 0; transition: opacity 300ms var(--ease) 60ms;
}
.disclose.is-open .disclose-inner { opacity: 1; }
.disclose-pad { padding: 6px 0 30px; }

/* ---- tables ---- */
.tablewrap {
  margin: 32px 0; position: relative;
  max-width: var(--wide);
}
.tablewrap.wide { width: 100%; }
.tablescroll { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.tablescroll::-webkit-scrollbar { height: 6px; }
.tablescroll::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 3px; }
.table-cap {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: 13px;
  display: flex; align-items: baseline; gap: 10px;
}
.table-cap::after { content: ""; flex: 1; height: 1px; background: var(--rule-soft); }

table { border-collapse: collapse; width: 100%; font-size: var(--t-small); }
thead th {
  font-family: var(--mono); font-size: 10px; font-weight: 500;
  letter-spacing: .13em; text-transform: uppercase; color: var(--ink-3);
  text-align: left; padding: 0 16px 11px 0; white-space: nowrap;
  border-bottom: 1px solid var(--ink-4);
}
thead th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody td {
  padding: 13px 16px 13px 0; border-bottom: 1px solid var(--rule-soft);
  color: var(--ink-2); vertical-align: top; line-height: 1.45;
}
tbody td:first-child { color: var(--ink); font-weight: 500; padding-right: 26px; }
tbody tr:last-child td { border-bottom: 1px solid var(--rule); }
tbody tr.emph td { background: var(--accent-soft); color: var(--ink); font-weight: 500; }
tbody tr.emph td:first-child { box-shadow: inset 2px 0 0 var(--accent); padding-left: 12px; }
tbody td .mono { font-family: var(--mono); font-size: .93em; }
td.num { font-family: var(--mono); font-size: 13.5px; color: var(--ink); }
tbody tr { opacity: 0; transform: translateY(6px); }
tbody tr.row-in { animation: rowIn 480ms var(--ease-out) forwards; }
@keyframes rowIn { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { tbody tr { opacity: 1; transform: none; } }

.pill {
  display: inline-block; font-family: var(--mono); font-size: 9.5px;
  letter-spacing: .1em; text-transform: uppercase; padding: 3px 8px;
  border: 1px solid var(--rule); border-radius: 2px; color: var(--ink-3);
  white-space: nowrap;
}
.pill.hot   { border-color: var(--accent-line); color: var(--accent); background: var(--accent-soft); }
.pill.warm  { border-color: var(--rule); color: var(--ink-2); }
.pill.cold  { border-color: var(--rule-soft); color: var(--ink-4); }
.pill.yes   { border-color: rgba(31,107,69,.3); color: var(--pos); }
.pill.no    { border-color: rgba(155,44,44,.3); color: var(--neg); }
.pill.open  { border-color: rgba(138,100,18,.3); color: var(--warn); }

/* ---- native bar chart ---- */
.chart { margin: 34px 0; max-width: 760px; }
.chart-row {
  display: grid; grid-template-columns: 74px 1fr 96px;
  align-items: center; gap: 16px; padding: 9px 0;
  border-bottom: 1px solid var(--rule-soft);
}
.chart-row:last-child { border-bottom: 0; }
.chart-lab {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-3);
}
.chart-track { height: 22px; position: relative; background: var(--paper-2); }
.chart-fill {
  position: absolute; inset: 0 auto 0 0; width: 0;
  background: var(--accent); opacity: .16;
  transition: width 1100ms var(--ease-out);
}
.chart-fill.solid { opacity: 1; background: var(--accent); }
.chart-fill.ghost { background: var(--ink-3); opacity: .13; }
.chart-val {
  font-family: var(--mono); font-size: 12.5px; text-align: right;
  color: var(--ink); font-variant-numeric: tabular-nums;
}
.chart-legend {
  display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 16px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-3);
}
.chart-legend span { display: flex; align-items: center; gap: 7px; }
.chart-legend i { width: 14px; height: 8px; display: block; }
.swatch-a { background: var(--accent); }
.swatch-b { background: var(--accent); opacity: .2; }
.swatch-c { background: var(--ink-3); opacity: .2; }

/* ---- figures ---- */
.figure { margin: 44px 0; }
.figure.wide { max-width: var(--wide); }
.figure-frame {
  position: relative; background: var(--paper-2);
  border: 1px solid var(--rule); overflow: hidden;
  cursor: zoom-in;
  transition: border-color 260ms var(--ease), box-shadow 400ms var(--ease), transform 400ms var(--ease-out);
}
.figure-frame:hover { border-color: var(--ink-4); box-shadow: var(--shadow-2); transform: translateY(-2px); }
.figure-frame img { width: 100%; height: auto; display: block; }
.figure-zoom {
  position: absolute; right: 12px; bottom: 12px;
  display: flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-2);
  background: color-mix(in srgb, var(--paper) 84%, transparent);
  backdrop-filter: blur(8px); padding: 5px 9px;
  border: 1px solid var(--rule); border-radius: 2px;
  opacity: 0; transform: translateY(4px);
  transition: opacity 240ms var(--ease), transform 240ms var(--ease-out);
}
.figure-frame:hover .figure-zoom { opacity: 1; transform: none; }
.figure figcaption {
  margin-top: 13px; display: flex; gap: 12px; align-items: baseline;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .11em;
  text-transform: uppercase; color: var(--ink-3);
}
.figure figcaption b { color: var(--accent); font-weight: 500; }

/* missing-asset placeholder */
.figure-frame.pending {
  cursor: default; display: grid; place-items: center; min-height: 220px;
  background:
    repeating-linear-gradient(45deg, transparent 0 9px, var(--rule-soft) 9px 10px);
}
.figure-frame.pending:hover { transform: none; box-shadow: none; border-color: var(--rule); }
.pending-note {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-3); text-align: center;
  background: var(--paper); padding: 10px 16px; border: 1px solid var(--rule);
}
.pending-note b { display: block; color: var(--ink-2); margin-bottom: 4px; }

/* ---- lightbox ---- */
.lightbox {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center;
  padding: clamp(16px, 4vw, 56px);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  opacity: 0; pointer-events: none;
  transition: opacity 300ms var(--ease);
}
.lightbox.show { opacity: 1; pointer-events: auto; }
.lightbox img {
  max-width: 100%; max-height: 84vh; object-fit: contain;
  border: 1px solid var(--rule); box-shadow: var(--shadow-3);
  transform: scale(.96); opacity: 0;
  transition: transform 460ms var(--ease-out), opacity 340ms var(--ease);
}
.lightbox.show img { transform: none; opacity: 1; }
.lightbox-cap {
  margin-top: 18px; font-family: var(--mono); font-size: 11px;
  letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3);
}
.lightbox-close {
  position: absolute; top: 22px; right: 24px;
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 1px solid var(--rule); border-radius: 50%; color: var(--ink-2);
  background: var(--paper);
  transition: color 200ms var(--ease), border-color 200ms var(--ease), transform 200ms var(--ease);
}
.lightbox-close:hover { color: var(--accent); border-color: var(--accent); transform: rotate(90deg); }

/* ---- cross links to side pages ---- */
.xlinks {
  display: grid; gap: 1px; background: var(--rule-soft);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  border: 1px solid var(--rule-soft); margin: 40px 0;
}
.xlink {
  background: var(--paper); padding: 24px 24px 22px; text-decoration: none;
  display: block; position: relative; overflow: hidden;
  transition: background 260ms var(--ease);
}
.xlink::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: var(--accent); transform: scaleX(0); transform-origin: 0 50%;
  transition: transform 420ms var(--ease-out);
}
.xlink:hover { background: var(--paper-2); }
.xlink:hover::after { transform: scaleX(1); }
.xlink-k {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 12px;
}
.xlink-t {
  font-size: 17px; font-weight: 600; color: var(--ink); line-height: 1.28;
  letter-spacing: -.012em; margin-bottom: 8px;
}
.xlink-d { font-size: 13.5px; color: var(--ink-3); line-height: 1.5; }
.xlink-go {
  margin-top: 16px; font-family: var(--mono); font-size: 10px;
  letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3);
  display: flex; align-items: center; gap: 7px;
  transition: color 200ms var(--ease), gap 260ms var(--ease-out);
}
.xlink:hover .xlink-go { color: var(--accent); gap: 12px; }

/* ---- footer ---- */
.foot {
  margin-top: clamp(60px, 9vh, 110px);
  border-top: 1px solid var(--rule); padding: 40px 0 70px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-4);
  display: flex; flex-wrap: wrap; gap: 12px 32px; justify-content: space-between;
}

/* ---- scroll reveal ---- */
.reveal { opacity: 0; transform: translateY(14px); }
.reveal.is-in {
  animation: revealIn 780ms var(--ease-out) forwards;
  animation-delay: var(--d, 0ms);
}
@keyframes revealIn { to { opacity: 1; transform: none; } }

/* ---- command palette ---- */
.palette {
  position: fixed; inset: 0; z-index: 300; display: grid;
  place-items: start center; padding-top: 14vh;
  background: rgba(20,18,15,.28); backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none; transition: opacity 220ms var(--ease);
}
.palette.show { opacity: 1; pointer-events: auto; }
.palette-box {
  width: min(560px, 92vw); background: var(--paper);
  border: 1px solid var(--rule); border-radius: 6px; box-shadow: var(--shadow-3);
  overflow: hidden; transform: translateY(-10px) scale(.98);
  transition: transform 300ms var(--ease-out);
}
.palette.show .palette-box { transform: none; }
.palette input {
  width: 100%; padding: 17px 20px; font-size: 15.5px; color: var(--ink);
  background: transparent; border: 0; border-bottom: 1px solid var(--rule-soft);
}
.palette input:focus { outline: none; }
.palette input::placeholder { color: var(--ink-4); }
.palette-list { max-height: 46vh; overflow-y: auto; padding: 7px; }
.palette-item {
  display: flex; align-items: baseline; gap: 12px; width: 100%;
  padding: 10px 13px; border-radius: 4px; text-align: left;
  font-size: 14.5px; color: var(--ink-2); text-decoration: none;
}
.palette-item .pnum {
  font-family: var(--mono); font-size: 10px; color: var(--ink-4);
  min-width: 22px; font-variant-numeric: tabular-nums;
}
.palette-item .ptag {
  margin-left: auto; font-family: var(--mono); font-size: 9.5px;
  letter-spacing: .1em; text-transform: uppercase; color: var(--ink-4);
}
.palette-item.sel { background: var(--accent-soft); color: var(--accent); }
.palette-item.sel .pnum, .palette-item.sel .ptag { color: var(--accent); }
.palette-empty { padding: 26px 20px; font-size: 14px; color: var(--ink-4); text-align: center; }

/* ============================================================ RESPONSIVE */
@media (max-width: 1080px) {
  :root { --rail: 268px; }
  .rail { transform: translateX(-100%); box-shadow: var(--shadow-3); }
  .rail.open { transform: none; }
  .main { margin-left: 0; padding-top: 46px; }
  .topbar { display: flex; }
  html { scroll-padding-top: 66px; }
}
@media (max-width: 640px) {
  :root { --measure: 100%; }
  .hero { padding-top: 54px; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .metric { padding: 17px 15px 15px; }
  .chart-row { grid-template-columns: 62px 1fr 76px; gap: 10px; }
  .pull { padding-left: 20px; }
  table { font-size: 13.5px; }
  thead th, tbody td { padding-right: 12px; }
  .foot { flex-direction: column; gap: 10px; }
}
@media (max-width: 420px) {
  .metrics { grid-template-columns: 1fr; }
}

/* ================================================================ PRINT */
@media print {
  .rail, .topbar, .progress-rail, .gate, .palette, .lightbox, .scrim, .figure-zoom { display: none !important; }
  body { background: #fff; color: #111; font-size: 10.5pt; line-height: 1.45; }
  .main { margin: 0; }
  .app { opacity: 1 !important; animation: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .disclose-body { grid-template-rows: 1fr !important; }
  .disclose-inner { opacity: 1 !important; }
  .section { page-break-inside: auto; border-top: 1px solid #ccc; padding: 18pt 0; }
  h2, h3 { page-break-after: avoid; }
  table, .figure, .callout, .pull { page-break-inside: avoid; }
  tbody tr { opacity: 1 !important; transform: none !important; }
  .chart-fill { transition: none !important; }
  a { text-decoration: none; color: #111; }
  @page { margin: 16mm 14mm; }
}
