:root {
  color-scheme: dark;
  --bg: #0b0c0e; --surface: #141518; --surface-2: #1c1e22; --line: #26292f; --line-2: #33373e;
  --text: #f2f2ef; --text-2: #b9b8ae; --muted: #7d7c74;
  --brain: #3987e5; --human: #d95926; --coin: #199e70; --hold: #c98500; --btc: #c98500; --eth: #9a6bdc; --spx: #d95926;
  --up: #2bb383; --down: #e66767; --accent: #3987e5;
  --radius: 12px; --maxw: 1120px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f6f4; --surface: #ffffff; --surface-2: #f0f0ec; --line: #e2e2dc; --line-2: #d4d4cc;
  --text: #0b0b0b; --text-2: #52514e; --muted: #8a8980;
  --brain: #2a78d6; --human: #eb6834; --coin: #1baf7a; --hold: #eda100; --btc: #eda100; --eth: #8452cf; --spx: #eb6834;
  --up: #14935f; --down: #d63b3a; --accent: #2a78d6;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Inter, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--text); text-decoration-color: var(--line-2); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--text-2); }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }

/* nav */
.nav { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.nav .wrap { display: flex; align-items: center; gap: 18px; height: 56px; }
.logo { display: flex; align-items: center; gap: 9px; font-weight: 650; letter-spacing: -0.01em; text-decoration: none; white-space: nowrap; }
.logo svg { width: 22px; height: 22px; }
.links { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.links::-webkit-scrollbar { display: none; }
.links a { text-decoration: none; color: var(--text-2); padding: 6px 10px; border-radius: 8px; font-size: 14px; white-space: nowrap; }
.links a:hover { color: var(--text); background: var(--surface-2); }
.links a.on { color: var(--text); background: var(--surface-2); }
.nav-r { display: flex; gap: 6px; align-items: center; }
.iconbtn { width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--text-2); cursor: pointer; text-decoration: none; }
.iconbtn:hover { color: var(--text); background: var(--surface-2); }
.iconbtn svg { width: 16px; height: 16px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--up); display: inline-block; box-shadow: 0 0 0 0 color-mix(in srgb, var(--up) 60%, transparent); animation: pulse 2s infinite; vertical-align: middle; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--up) 55%, transparent); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (max-width: 640px) { .nav .wrap { flex-wrap: wrap; height: auto; gap: 4px 10px; padding-top: 8px; padding-bottom: 6px; } .logo { flex: 1; } .links { order: 3; flex-basis: 100%; justify-content: space-between; } .links a { padding: 6px 8px; font-size: 14px; } .toc-m { top: 92px; } }

/* type */
h1 { font-size: clamp(30px, 5vw, 48px); line-height: 1.08; letter-spacing: -0.03em; margin: 0 0 14px; font-weight: 700; }
h2 { font-size: 22px; letter-spacing: -0.02em; margin: 0 0 12px; }
h3 { font-size: 16px; margin: 0 0 8px; }
.lede { color: var(--text-2); font-size: 17px; max-width: 680px; margin: 0 0 22px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; margin-bottom: 16px; }
.muted { color: var(--muted); } .t2 { color: var(--text-2); }
.mono { font-family: var(--mono); font-size: 12.5px; }
.small { font-size: 13px; }
section { padding: 34px 0; }
section + section { border-top: 1px solid var(--line); }
.sec-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.sec-h h2 { margin: 0; }
.sec-h a { font-size: 14px; color: var(--text-2); }

/* surfaces */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card + .card { margin-top: 14px; }
.grid > .card, .grid > .card + .card { margin-top: 0; }
.card h3 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.card h3 span { color: var(--muted); font-weight: 400; font-size: 12px; }
.grid { display: grid; gap: 12px; }
.g4 { grid-template-columns: repeat(4, 1fr); } .g5 { grid-template-columns: repeat(5, 1fr); } .g3 { grid-template-columns: repeat(3, 1fr); } .g2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 860px) { .g4, .g5 { grid-template-columns: repeat(2, 1fr); } .g3 { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .g2 { grid-template-columns: 1fr; } }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.tile .k { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.tile .v { font-size: 28px; font-weight: 650; letter-spacing: -0.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.tile .s { font-size: 12px; color: var(--text-2); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 10px; font-weight: 600; font-size: 14.5px; text-decoration: none; border: 1px solid var(--line-2); color: var(--text); background: var(--surface); }
.btn.primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn:hover { filter: brightness(1.08); }
.btns { display: flex; gap: 10px; flex-wrap: wrap; }

/* data */
.pos { color: var(--up); } .neg { color: var(--down); }
.long { color: var(--up); } .short { color: var(--down); }
.pick { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--line); margin: 2px 4px 2px 0; font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pick small { color: var(--muted); }
.badge { display: inline-block; font-size: 11.5px; padding: 1px 7px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); }
.tbl { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 8px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }
.bar { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; display: inline-block; vertical-align: middle; }
.bar i { display: block; height: 100%; background: var(--brain); border-radius: 3px; }
.empty { color: var(--muted); padding: 22px; text-align: center; }
svg text { fill: var(--text-2); font-size: 11px; font-family: inherit; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); margin-top: 8px; }
.legend i { width: 14px; height: 3px; display: inline-block; vertical-align: middle; margin-right: 6px; border-radius: 2px; }
.tip { position: fixed; pointer-events: none; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px; font-size: 12px; display: none; z-index: 30; box-shadow: 0 6px 24px rgba(0,0,0,.25); }

/* feed */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 74px 18px 1fr; gap: 8px; padding: 7px 0; font-size: 13.5px; border-bottom: 1px dashed var(--line); align-items: start; }
.feed li:last-child { border-bottom: 0; }
.feed time { color: var(--muted); font-family: var(--mono); font-size: 12px; padding-top: 1px; }
.feed .ic { width: 18px; height: 18px; border-radius: 5px; display: grid; place-items: center; font-size: 10px; background: var(--surface-2); color: var(--text-2); }
.feed .k-decision .ic { background: color-mix(in srgb, var(--brain) 25%, transparent); color: var(--brain); }
.feed .k-score .ic { background: color-mix(in srgb, var(--coin) 25%, transparent); color: var(--coin); }
.feed .k-request .ic { background: color-mix(in srgb, var(--hold) 22%, transparent); color: var(--hold); }

/* steps */
.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr 1fr; } }
.step { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--surface); font-size: 13px; }
.step b { display: block; font-size: 13.5px; }
.step.done { border-color: color-mix(in srgb, var(--up) 45%, var(--line)); }
.step.done b::before { content: "✓ "; color: var(--up); }
.step.now { border-color: var(--brain); box-shadow: 0 0 0 1px var(--brain) inset; }

/* answers */
details.role { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
details.role + details.role { margin-top: 10px; }
details.role > summary { list-style: none; cursor: pointer; padding: 14px 16px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
details.role > summary::-webkit-details-marker { display: none; }
details.role > summary .chev { transition: transform .15s; color: var(--muted); }
details.role[open] > summary .chev { transform: rotate(90deg); }
.answers { padding: 0 16px 14px; display: grid; gap: 10px; }
.answer { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: var(--bg); }
.answer .hd { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); margin-bottom: 6px; }
.answer p { margin: 6px 0; font-size: 13.5px; color: var(--text-2); }
.answer .cites { font-size: 12px; color: var(--muted); }
.answer .cites a { color: var(--muted); margin-right: 8px; }

/* docs */
.docs { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 40px; padding: 28px 0 80px; }
.toc { position: sticky; top: 76px; align-self: start; max-height: calc(100vh - 96px); overflow-y: auto; font-size: 14px; }
.toc h4 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 18px 0 6px; font-weight: 600; }
.toc h4:first-child { margin-top: 0; }
.toc a { display: block; text-decoration: none; color: var(--text-2); padding: 4px 10px; border-left: 2px solid var(--line); }
.toc a:hover { color: var(--text); }
.toc a.on { color: var(--text); border-left-color: var(--accent); background: var(--surface); }
.toc-m { display: none; }
@media (max-width: 860px) {
  .docs { grid-template-columns: minmax(0, 1fr); gap: 0; padding-top: 12px; }
  .toc { display: none; }
  .toc-m { display: block; position: sticky; top: 56px; z-index: 10; background: var(--bg); padding: 8px 0; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
  .toc-m summary { cursor: pointer; font-size: 14px; color: var(--text-2); list-style: none; padding: 6px 0; }
  .toc-m summary::-webkit-details-marker { display: none; }
  .toc-m .toc { display: block; position: static; max-height: 60vh; padding-bottom: 8px; }
}
.doc { max-width: 760px; }
.doc section { padding: 8px 0 26px; border: 0; scroll-margin-top: 72px; }
.doc section + section { border-top: 1px solid var(--line); padding-top: 26px; }
.doc h1 { font-size: 34px; }
.doc h2 { font-size: 24px; margin-top: 6px; }
.doc h3 { font-size: 16.5px; margin-top: 20px; }
.doc p, .doc li { color: var(--text-2); }
.doc strong { color: var(--text); }
.doc ul, .doc ol { padding-left: 22px; }
.doc li { margin: 4px 0; }
.doc code { font-family: var(--mono); font-size: 12.5px; background: var(--surface-2); border: 1px solid var(--line); padding: 1px 5px; border-radius: 5px; color: var(--text); }
.doc pre { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; overflow-x: auto; font-family: var(--mono); font-size: 12.5px; color: var(--text); }
.callout { border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 8px; padding: 10px 14px; background: var(--surface); margin: 14px 0; }
.callout.warn { border-left-color: var(--hold); }
.callout p { margin: 4px 0; }
.doc table { margin: 10px 0; }
.doc-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 30px; }

footer.site { border-top: 1px solid var(--line); padding: 26px 0 40px; color: var(--muted); font-size: 13px; }
footer.site .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
footer.site a { color: var(--text-2); margin-right: 14px; }
.doc td { overflow-wrap: anywhere; }

/* hero with the live brain */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 32px; align-items: center; }
.hero h1 { font-size: clamp(30px, 4.2vw, 46px); }
.brainfig { margin: 0; background: radial-gradient(ellipse at 50% 45%, color-mix(in srgb, var(--brain) 10%, transparent), transparent 70%); border-radius: 16px; }
.brainfig figcaption { margin-top: 6px; }
.brainfig .legend { font-size: 12px; gap: 10px; }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; gap: 18px; } }
