:root, [data-theme="light"] {
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
  --space-1: .25rem; --space-2: .5rem; --space-3: .75rem; --space-4: 1rem; --space-5: 1.25rem;
  --space-6: 1.5rem; --space-8: 2rem; --space-10: 2.5rem; --space-12: 3rem; --space-16: 4rem; --space-20: 5rem;
  --font-display: "DM Sans", system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, sans-serif;
  --radius: 14px;

  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f3f6f9;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #5b6b80;
  --accent: #0e72a6;
  --accent-strong: #0a5a84;
  --accent-soft: #e6f1f8;
  --ink: #0f1a2b;
  --pos: #2f6b3a;
  --warn: #a15c07;
  --shadow: 0 1px 2px rgb(15 23 42 / .05), 0 6px 18px rgb(15 23 42 / .06);
}
[data-theme="dark"] {
  --bg: #0b1220;
  --surface: #111a2c;
  --surface-2: #16223a;
  --border: #24324c;
  --text: #e8edf4;
  --muted: #9aa8bb;
  --accent: #4fb0e3;
  --accent-strong: #7cc6ee;
  --accent-soft: #12304a;
  --ink: #0f1a2b;
  --pos: #7fc48c;
  --warn: #e6a35c;
  --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px rgb(0 0 0 / .25);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1220; --surface: #111a2c; --surface-2: #16223a; --border: #24324c;
    --text: #e8edf4; --muted: #9aa8bb; --accent: #4fb0e3; --accent-strong: #7cc6ee;
    --accent-soft: #12304a; --pos: #7fc48c; --warn: #e6a35c;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px rgb(0 0 0 / .25);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font-body); font-size: var(--text-base); line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.12; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: var(--space-2); background: var(--accent); color: var(--ink); padding: var(--space-2) var(--space-4); border-radius: 8px; z-index: 10; }
.skip:focus { left: var(--space-4); }
.wrap { width: min(1180px, 100% - 2 * var(--space-6)); margin-inline: auto; }

.site-header { position: sticky; top: 0; z-index: 5; background: color-mix(in oklab, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; gap: var(--space-6); padding-block: var(--space-3); }
.brand { display: flex; align-items: center; gap: var(--space-3); color: var(--text); text-decoration: none; font-family: var(--font-display); font-weight: 700; font-size: var(--text-lg); letter-spacing: -0.01em; }
.brand .name { color: var(--accent); }
.brand .dim { color: var(--text); }
.logo { width: 34px; height: 34px; color: var(--text); }
.nav { display: flex; gap: var(--space-5); margin-left: auto; }
.nav a { color: var(--muted); text-decoration: none; font-size: var(--text-sm); font-weight: 500; }
.nav a:hover { color: var(--text); }
.theme-toggle { background: none; border: 1px solid var(--border); color: var(--text); width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; cursor: pointer; }
.theme-toggle:hover { background: var(--surface-2); }

.hero { padding-block: clamp(var(--space-10), 7vw, var(--space-20)); border-bottom: 1px solid var(--border);
  background:
    radial-gradient(ellipse 60% 70% at 85% 10%, color-mix(in oklab, var(--accent) 16%, transparent), transparent 70%),
    var(--bg); }
.hero-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: var(--space-12); align-items: start; }
.eyebrow { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .12em; font-weight: 700; color: var(--accent); margin-bottom: var(--space-4); }
.hero h1 { font-size: var(--text-2xl); font-weight: 700; max-width: 16ch; }
.accent-text { color: var(--accent); }
.lede { margin-top: var(--space-6); color: var(--muted); max-width: 60ch; font-size: var(--text-base); }
.hero-actions { display: flex; gap: var(--space-3); margin-top: var(--space-8); flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; padding: var(--space-3) var(--space-6); border-radius: 8px; font-weight: 700; font-size: var(--text-sm); text-decoration: none; border: 1px solid transparent; }
.btn-primary { background: var(--accent); color: #fff; }
[data-theme="dark"] .btn-primary { color: #06121f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-primary { color: #06121f; } }
.btn-primary:hover { background: var(--accent-strong); color: #fff; }
.btn-ghost { border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

.classification { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-6); box-shadow: var(--shadow); }
.classification h2 { font-size: var(--text-lg); margin-bottom: var(--space-3); }
.classification p { font-size: var(--text-sm); color: var(--muted); }
.classification p strong { color: var(--text); }
.src-list { margin: var(--space-4) 0; padding: 0; list-style: none; display: grid; gap: var(--space-2); font-size: var(--text-sm); }
.src-list li::before { content: "→ "; color: var(--accent); }
.fine { font-size: var(--text-xs); color: var(--muted); }

.section { padding-block: clamp(var(--space-10), 6vw, var(--space-20)); }
.section.alt { background: var(--surface-2); border-block: 1px solid var(--border); }
.section-title { font-size: var(--text-xl); font-weight: 700; }
.section-sub { color: var(--muted); margin-top: var(--space-2); max-width: 65ch; }

.steps { list-style: none; padding: 0; margin: var(--space-8) 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-5); }
.steps li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-6); }
.step-num { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-family: var(--font-display); font-weight: 800; margin-bottom: var(--space-3); }
.steps h3 { font-size: var(--text-lg); margin-bottom: var(--space-2); }
.steps p { color: var(--muted); font-size: var(--text-sm); }
.callout { margin-top: var(--space-6); padding: var(--space-5) var(--space-6); border-left: 4px solid var(--accent); background: var(--accent-soft); border-radius: 0 var(--radius) var(--radius) 0; font-size: var(--text-sm); }
.cite { display: block; margin-top: var(--space-2); font-size: var(--text-xs); color: var(--muted); }

.table-wrap { margin-top: var(--space-6); overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.summary { width: 100%; border-collapse: collapse; font-size: var(--text-sm); min-width: 820px; }
.summary th, .summary td { padding: var(--space-3) var(--space-4); text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.summary tbody tr:last-child td { border-bottom: none; }
.summary tbody tr:hover { background: var(--surface-2); }
.summary th button { all: unset; cursor: pointer; font-weight: 700; font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.summary th button:hover, .summary th button[aria-sort] { color: var(--text); }
.summary th button[aria-sort="ascending"]::after { content: " ↑"; }
.summary th button[aria-sort="descending"]::after { content: " ↓"; }
.summary .num { text-align: right; font-variant-numeric: tabular-nums; }
.summary th.num button { text-align: right; }
.tk { display: flex; align-items: center; gap: var(--space-3); }
.tk a { color: var(--text); text-decoration: none; font-weight: 700; }
.tk a:hover { color: var(--accent); }
.tk small { color: var(--muted); font-weight: 400; }
.badge { display: inline-block; padding: 2px var(--space-2); border-radius: 999px; font-size: var(--text-xs); font-weight: 700; border: 1px solid var(--border); color: var(--muted); }
.badge.live { color: var(--pos); border-color: color-mix(in oklab, var(--pos) 40%, transparent); }
.badge.pending { color: var(--warn); border-color: color-mix(in oklab, var(--warn) 40%, transparent); }
.off { color: var(--muted); }

.filters { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-6); }
.chip { border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: var(--space-2) var(--space-4); border-radius: 999px; font: inherit; font-size: var(--text-sm); font-weight: 500; cursor: pointer; }
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: var(--space-5); margin-top: var(--space-6); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-4); box-shadow: var(--shadow); scroll-margin-top: 90px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-3); }
.sym { display: inline-grid; place-items: center; min-width: 52px; height: 52px; padding-inline: var(--space-2); border-radius: 12px; background: var(--ink); color: #e0b45c; font-family: var(--font-display); font-weight: 800; font-size: var(--text-sm); letter-spacing: .02em; }
.card h3 { font-size: var(--text-lg); }
.card .role { color: var(--muted); font-size: var(--text-sm); }
.title-block { flex: 1; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-2); }
.kpi { background: var(--surface-2); border-radius: 10px; padding: var(--space-2) var(--space-3); }
.kpi span { display: block; font-size: var(--text-xs); color: var(--muted); }
.kpi strong { font-variant-numeric: tabular-nums; font-size: var(--text-sm); }
.model { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; font-size: var(--text-sm); }
.model .badge:not(.etf) { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.block h4 { font-family: var(--font-display); font-size: var(--text-sm); text-transform: uppercase; letter-spacing: .08em; margin: 0 0 var(--space-2); color: var(--accent); }
.block p, .block li { font-size: var(--text-sm); }
.block ul { margin: 0; padding-left: var(--space-5); display: grid; gap: var(--space-2); }
.src { font-size: var(--text-xs); color: var(--muted); white-space: nowrap; }
.src a { color: var(--muted); }
.src a:hover { color: var(--accent); }
.checklist { list-style: none; padding: 0 !important; }
.checklist li { display: flex; gap: var(--space-2); align-items: flex-start; }
.checklist li::before { content: ""; flex: none; width: 14px; height: 14px; margin-top: 5px; border: 1.5px solid var(--accent); border-radius: 4px; }
.empty { color: var(--muted); padding: var(--space-8); text-align: center; grid-column: 1 / -1; }

.glossary { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-4) var(--space-8); margin: var(--space-8) 0 0; }
.glossary div { border-top: 1px solid var(--border); padding-top: var(--space-3); }
.glossary dt { font-family: var(--font-display); font-weight: 700; font-size: var(--text-base); }
.glossary dd { margin: var(--space-1) 0 0; color: var(--muted); font-size: var(--text-sm); }

.disclaimer { max-width: 75ch; }
.disclaimer h2 { font-size: var(--text-lg); margin-bottom: var(--space-3); }
.disclaimer p { color: var(--muted); font-size: var(--text-sm); margin-bottom: var(--space-3); }

.site-footer { border-top: 1px solid var(--border); padding-block: var(--space-6); font-size: var(--text-sm); color: var(--muted); }
.footer-inner { display: flex; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; }
.footer-inner a { color: var(--muted); }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: var(--space-8); }
  .steps { grid-template-columns: 1fr; }
  .nav { display: none; }
  .theme-toggle { margin-left: auto; }
  .glossary { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .cards { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.mcap-grid > div { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-6); }
.mcap-grid h3 { font-size: var(--text-lg); margin-bottom: var(--space-2); }
.mcap-grid p { color: var(--muted); font-size: var(--text-sm); }
.kpis { grid-template-columns: 1fr 1fr; }
.kpi-wide { grid-column: 1 / -1; order: 3; }
.summary td.wrapcell { white-space: normal; min-width: 120px; }
.summary th, .summary td { padding-inline: var(--space-3); }

.muted-cell { color: var(--muted); }
.table-note { margin-top: var(--space-3); }

.logo-img { width: 52px; height: 52px; border-radius: 50%; flex: none; box-shadow: 0 0 0 1px var(--border); }
.logo-sm { width: 26px; height: 26px; border-radius: 50%; flex: none; box-shadow: 0 0 0 1px var(--border); }
.tk { gap: var(--space-2); }
.ticker { font-family: var(--font-body); font-size: var(--text-xs); font-weight: 700; color: var(--muted); letter-spacing: .06em; margin-left: var(--space-1); }

/* ---------- Live sections ---------- */
.btn-sm { padding: var(--space-2) var(--space-4); font-size: var(--text-sm); }
.btn:disabled { opacity: .55; cursor: progress; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; }
.amend-summary, .whale-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-3); margin-top: var(--space-6); }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-1); }
.section.alt .stat { background: var(--surface); }
.stat-num { font-family: var(--font-display); font-weight: 700; font-size: var(--text-xl); line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--muted); font-size: var(--text-sm); }
.stat-next { font-weight: 700; font-size: var(--text-base); color: var(--accent); }
.amend-controls { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); flex-wrap: wrap; margin-top: var(--space-6); }
.amend-controls .filters { margin-top: 0; }
.amend-table td { vertical-align: top; }
.amend-name { font-weight: 700; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--border); }
.amend-name:hover { color: var(--accent); border-color: var(--accent); }
.amend-what { max-width: 34ch; color: var(--muted); font-size: var(--text-sm); }
.vote-col { min-width: 190px; }
.vote { display: flex; align-items: center; gap: var(--space-3); }
.vote-bar { position: relative; flex: 1; height: 8px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); }
.vote-fill { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: color-mix(in oklab, var(--accent) 55%, var(--surface-2)); }
.vote-fill.ok { background: var(--accent); }
.vote-thr { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--text); border-radius: 2px; }
.vote-num { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; font-size: var(--text-sm); }
.badge.st-live { color: var(--pos); border-color: color-mix(in oklab, var(--pos) 40%, transparent); }
.badge.st-countdown { color: #fff; background: var(--accent); border-color: var(--accent); }
.badge.st-pending { color: var(--warn); border-color: color-mix(in oklab, var(--warn) 40%, transparent); }
[data-theme="dark"] .badge.st-countdown { color: #06121f; }
.loading-row { text-align: center; color: var(--muted); padding: var(--space-8) var(--space-4) !important; }
.activity-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-5); margin-top: var(--space-6); }
.act-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-6); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: var(--space-4); min-height: 200px; }
.act-card.skeleton { background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; min-height: 340px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.act-head { display: flex; align-items: center; gap: var(--space-3); }
.act-head img { border-radius: 50%; }
.act-head h3 { font-size: var(--text-lg); line-height: 1.1; }
.act-metrics { display: grid; gap: var(--space-3); margin: 0; }
.act-metrics div { border-top: 1px solid var(--border); padding-top: var(--space-3); }
.act-metrics dd { margin: 0; }
.act-k { color: var(--muted); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; display: block; }
.act-v { font-weight: 700; font-size: var(--text-base); font-variant-numeric: tabular-nums; display: block; margin-top: 2px; }
.act-largest { background: var(--surface-2); border-radius: 10px; padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-1); }
.act-largest .badge { margin-right: var(--space-1); }
.whale { margin-top: var(--space-12); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(var(--space-5), 3vw, var(--space-8)); }
.whale-head { display: flex; justify-content: space-between; gap: var(--space-6); align-items: flex-end; flex-wrap: wrap; }
.whale-head h3 { font-size: var(--text-lg); }
.whale-ctl { display: flex; flex-direction: column; gap: var(--space-1); }
.whale-ctl select { font: inherit; padding: var(--space-2) var(--space-3); border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.whale .stat { background: var(--surface-2); border-color: transparent; }
.whale-table td a { color: var(--text); }
.whale-table td.num a { font-weight: 700; color: var(--accent); }
@media (max-width: 900px) {
  .activity-grid { grid-template-columns: 1fr; }
  .amend-summary, .whale-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.nav { gap: var(--space-4); }
.nav a { white-space: nowrap; }
@media (max-width: 1080px) { .nav { display: none; } }
.amend-table { min-width: 980px; }
.amend-table td { white-space: normal; }
.amend-table td:nth-child(2), .amend-table .vote-num { white-space: nowrap; }
.amend-what { min-width: 240px; }
.vote-bar { min-width: 90px; }
.whale-table { min-width: 640px; }

/* ---------- Film teaser ---------- */
.film { position: relative; isolation: isolate; overflow: hidden; background: #08101f; color: #f3f6fb; min-height: clamp(420px, 52vw, 640px); display: flex; align-items: center; }
.film-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% 15%; z-index: -2; }
.film-shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgb(6 12 26 / .92) 0%, rgb(6 12 26 / .72) 34%, rgb(6 12 26 / .15) 62%, rgb(6 12 26 / 0) 100%); }
.film-inner { padding-block: var(--space-16); }
.film-copy { max-width: 34rem; display: flex; flex-direction: column; gap: var(--space-4); }
.film-badge { align-self: flex-start; font-size: var(--text-xs); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #ffd27a; border: 1px solid rgb(255 210 122 / .5); border-radius: 999px; padding: 4px var(--space-3); background: rgb(255 210 122 / .08); }
.film-title { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 700; line-height: 1.05; letter-spacing: -0.02em; color: #fff; text-wrap: balance; }
.film-title span { display: block; color: #ffd27a; }
.film-lede { color: #d5deea; font-size: var(--text-base); max-width: 52ch; }
.film-note { color: #9fb0c6; font-size: var(--text-sm); }
@media (max-width: 700px) {
  .film { flex-direction: column; align-items: stretch; min-height: 0; }
  .film picture { display: block; }
  .film-poster { position: static; height: auto; aspect-ratio: 16 / 9; }
  .film-shade { display: none; }
  .film-inner { padding-block: var(--space-8) var(--space-10); }
}
