:root {
  color-scheme: dark;
  --bg: #0f0f0e;
  --surface: #1a1a19;
  --surface-2: #222220;
  --line: #2e2e2b;
  --grid: #2a2a27;
  --ink: #ecebe6;
  --ink-2: #b9b7af;
  --muted: #8a887f;
  --accent: #e9c46a;
  --good: #3fb37f;
  --bad: #e5484d;
  --radius: 14px;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --sans: "Space Grotesk", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ink); }
code, .mono { font-family: var(--mono); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
[hidden] { display: none !important; }

/* top bar */
.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-row { display: flex; align-items: center; gap: 24px; height: 60px; }
.brand { display: flex; gap: 10px; align-items: center; font-weight: 700; letter-spacing: .12em; text-decoration: none; }
.brand-mark { color: var(--accent); font-size: 20px; }
.nav { display: flex; gap: 18px; }
.nav a { color: var(--ink-2); text-decoration: none; font-size: 14px; }
.nav a:hover { color: var(--ink); }
.top-links { margin-left: auto; display: flex; gap: 10px; }

.btn {
  font: 600 14px var(--sans); color: #17150f; background: var(--accent);
  border: 0; border-radius: 999px; padding: 10px 18px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 8px;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { border-color: var(--ink-2); }
.btn.small { padding: 5px 12px; font-size: 12px; }

/* hero */
.hero { padding: 64px 0 24px; }
.eyebrow { font: 500 13px var(--mono); color: var(--accent); margin: 0 0 16px; }
.eyebrow .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--good); margin-right: 8px; box-shadow: 0 0 0 4px color-mix(in srgb, var(--good) 25%, transparent); }
h1 { font-size: clamp(34px, 6vw, 60px); line-height: 1.05; margin: 0 0 20px; letter-spacing: -.02em; }
.lede { max-width: 720px; color: var(--ink-2); font-size: 18px; margin: 0; }
.ca-row { margin-top: 24px; display: inline-flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 6px 6px 16px; max-width: 100%; }
.ca-row code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.ca-label { color: var(--muted); font: 600 12px var(--mono); }
.banner { margin-top: 24px; padding: 12px 16px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); color: var(--ink); font-size: 14px; }

/* sections */
.section { padding: 40px 0 8px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
h2 { margin: 0; font-size: 24px; letter-spacing: -.01em; }
h3 { margin: 0 0 6px; font-size: 16px; }

/* agent cards */
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; position: relative; overflow: hidden; }
.card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--c); }
.card-top { display: flex; justify-content: space-between; align-items: baseline; }
.rank { font: 600 12px var(--mono); color: var(--muted); }
.agent-name { font-size: 22px; font-weight: 700; margin: 2px 0 0; }
.agent-style { font: 12px var(--mono); color: var(--ink-2); text-transform: uppercase; letter-spacing: .08em; }
.equity { font: 600 26px var(--mono); margin: 14px 0 0; }
.pnl { font: 600 14px var(--mono); }
.up { color: var(--good); } .down { color: var(--bad); }
.spark { display: block; width: 100%; height: 44px; margin: 12px 0; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; font-size: 12px; color: var(--muted); }
.stats b { display: block; color: var(--ink); font: 600 14px var(--mono); }
.positions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; min-height: 26px; }
.chip { font: 12px var(--mono); padding: 3px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); }
.chip.L { border-color: color-mix(in srgb, var(--good) 50%, transparent); }
.chip.S { border-color: color-mix(in srgb, var(--bad) 50%, transparent); }
.blurb { color: var(--ink-2); font-size: 13px; margin: 12px 0 0; }
.benched { position: absolute; top: 14px; right: 14px; font: 600 11px var(--mono); color: var(--bad); }

/* chart */
.chart-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; color: var(--ink-2); margin-bottom: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 3px; border-radius: 2px; background: var(--c); display: inline-block; }
.legend i.dash { background: repeating-linear-gradient(90deg, var(--muted) 0 4px, transparent 4px 7px); }
.chart { position: relative; height: 320px; }
.chart svg { width: 100%; height: 100%; display: block; overflow: visible; }
.chart .axis text { fill: var(--muted); font: 11px var(--mono); }
.chart .grid line { stroke: var(--grid); }
.chart .end-label { font: 600 11px var(--mono); fill: var(--ink-2); }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg button { font: 500 13px var(--sans); color: var(--ink-2); background: none; border: 0; border-radius: 999px; padding: 5px 12px; cursor: pointer; }
.seg button.on { background: var(--surface-2); color: var(--ink); }
.table-view { margin-top: 12px; font-size: 13px; color: var(--ink-2); }
.table-view summary { cursor: pointer; color: var(--muted); }
.table-view table { width: 100%; border-collapse: collapse; margin-top: 8px; font-family: var(--mono); font-size: 12px; }
.table-view th, .table-view td { text-align: right; padding: 4px 8px; border-bottom: 1px solid var(--line); }
.table-view th:first-child, .table-view td:first-child { text-align: left; }
.table-scroll { max-height: 280px; overflow: auto; }

.tooltip { position: fixed; z-index: 20; pointer-events: none; background: #0b0b0a; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: 12px var(--mono); color: var(--ink); min-width: 170px; box-shadow: 0 8px 24px rgb(0 0 0 / .4); }
.tooltip .row { display: flex; justify-content: space-between; gap: 14px; }
.tooltip .sw { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--c); }
.tooltip .t { color: var(--muted); margin-bottom: 6px; }

/* feed */
.feed { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.hour { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.hour > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 14px; padding: 14px 18px; flex-wrap: wrap; }
.hour > summary::-webkit-details-marker { display: none; }
.hour-time { font: 600 14px var(--mono); min-width: 130px; }
.hour-acts { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.act { font: 12px var(--mono); padding: 2px 8px; border-radius: 6px; background: var(--surface-2); border-left: 3px solid var(--c); }
.hour-link { font: 12px var(--mono); color: var(--muted); }
.hour-body { padding: 0 18px 16px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.agent-calls { border-top: 1px solid var(--line); padding-top: 10px; }
.agent-calls h4 { margin: 0 0 6px; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.agent-calls h4 i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); display: inline-block; }
.call { font-size: 13px; color: var(--ink-2); margin: 4px 0; }
.call b { font-family: var(--mono); color: var(--ink); font-weight: 600; }
.call .by { color: var(--muted); font: 11px var(--mono); }
.denied { color: var(--bad); font: 12px var(--mono); }

/* verify */
.verify-card, .vote-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.verify-card p, .vote-card p { color: var(--ink-2); margin-top: 0; max-width: 760px; }
.checks { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 8px; }
.checks li { padding-left: 30px; position: relative; color: var(--ink-2); font-size: 14px; }
.checks li::before { content: "○"; position: absolute; left: 6px; color: var(--muted); font-family: var(--mono); }
.checks li.ok { color: var(--ink); } .checks li.ok::before { content: "✓"; color: var(--good); }
.checks li.fail::before { content: "✕"; color: var(--bad); }
.checks li.skip::before { content: "–"; }
.checks li.run::before { content: "◌"; color: var(--accent); }
.checks li .detail { display: block; font: 12px var(--mono); color: var(--muted); }

/* vote */
.vote-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 18px 0; }
.vote-opt { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; text-align: left; color: var(--ink); cursor: pointer; font: inherit; }
.vote-opt:hover { border-color: var(--c); }
.vote-opt.on { border-color: var(--c); box-shadow: inset 0 0 0 1px var(--c); }
.vote-opt b { display: block; font-size: 16px; }
.vote-opt .bar { height: 4px; border-radius: 2px; background: var(--line); margin-top: 10px; overflow: hidden; }
.vote-opt .bar i { display: block; height: 100%; background: var(--c); border-radius: 2px; }
.vote-opt .w { font: 12px var(--mono); color: var(--muted); }
.vote-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.rules { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.rules > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.rules p { margin: 0; color: var(--ink-2); font-size: 14px; }

.foot { display: flex; justify-content: space-between; gap: 16px; padding: 40px 16px 56px; color: var(--muted); font: 12px var(--mono); flex-wrap: wrap; }
.foot a { color: var(--muted); }

@media (max-width: 900px) {
  .cards, .vote-grid, .rules { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav { display: none; }
}
@media (max-width: 560px) {
  .cards, .vote-grid, .rules, .hour-body { grid-template-columns: 1fr; }
  .hero { padding-top: 40px; }
  .chart { height: 260px; }
  .hour-time { min-width: 0; }
}
