/* Pluto website — core styles. Reader styles live in reader.css. */

:root {
  color-scheme: dark;
  --bg: #060a16;
  --bg-2: #0a1022;
  --surface: #0f162c;
  --surface-2: #141d38;
  --surface-3: #1b2547;
  --border: rgba(150, 168, 220, 0.13);
  --border-strong: rgba(150, 168, 220, 0.26);
  --text: #e9edf7;
  --text-2: #aab3cb;
  --muted: #7a85a3;
  --accent: #9a8cff;
  --accent-strong: #b3a8ff;
  --accent-ink: #120c33;
  --teal: #3dd9c1;
  --blue: #6aa6ff;
  --good: #34c76f;
  --bad: #f06a6a;
  --warn: #f5b543;
  --c-pluto: #3987e5;
  --c-base: #e0702f;
  --grid: rgba(150, 168, 220, 0.10);
  --code-bg: #0a1024;
  --shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.6);
  --glow-a: rgba(124, 107, 255, 0.28);
  --glow-b: rgba(61, 217, 193, 0.16);
  --radius: 16px;
  --radius-sm: 10px;
  --maxw: 1200px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Inter Tight", "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --font-serif: "Source Serif 4", Georgia, serif;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f7fb;
  --bg-2: #eef0f7;
  --surface: #ffffff;
  --surface-2: #f3f4fa;
  --surface-3: #e8ebf5;
  --border: rgba(20, 30, 70, 0.10);
  --border-strong: rgba(20, 30, 70, 0.20);
  --text: #0c1226;
  --text-2: #465170;
  --muted: #6b7591;
  --accent: #5b45d6;
  --accent-strong: #4a35c4;
  --accent-ink: #ffffff;
  --teal: #0b8f7d;
  --blue: #2a6fd0;
  --good: #128a43;
  --bad: #cf3a3a;
  --warn: #b97a06;
  --c-pluto: #2a78d6;
  --c-base: #eb6834;
  --grid: rgba(20, 30, 70, 0.08);
  --code-bg: #0e1530;
  --shadow: 0 20px 50px -24px rgba(20, 30, 70, 0.28);
  --glow-a: rgba(91, 69, 214, 0.14);
  --glow-b: rgba(11, 143, 125, 0.10);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f6f7fb; --bg-2: #eef0f7; --surface: #ffffff; --surface-2: #f3f4fa; --surface-3: #e8ebf5;
    --border: rgba(20, 30, 70, 0.10); --border-strong: rgba(20, 30, 70, 0.20);
    --text: #0c1226; --text-2: #465170; --muted: #6b7591;
    --accent: #5b45d6; --accent-strong: #4a35c4; --accent-ink: #ffffff;
    --teal: #0b8f7d; --blue: #2a6fd0; --good: #128a43; --bad: #cf3a3a; --warn: #b97a06;
    --c-pluto: #2a78d6; --c-base: #eb6834; --grid: rgba(20, 30, 70, 0.08); --code-bg: #0e1530;
    --shadow: 0 20px 50px -24px rgba(20, 30, 70, 0.28);
    --glow-a: rgba(91, 69, 214, 0.14); --glow-b: rgba(11, 143, 125, 0.10);
  }
}

*, *::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: 400 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { max-width: 100%; }
a { color: var(--accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
code, pre, kbd { font-family: var(--font-mono); }
:not(pre) > code {
  font-size: 0.88em; padding: 0.12em 0.4em; border-radius: 6px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  white-space: nowrap;
}
::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 26px; height: 26px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 24px; height: 64px;
  display: flex; align-items: center; gap: 24px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font: 650 18px/1 var(--font-display); letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; border-radius: 50%; }
.brand .ver { font: 500 11px/1 var(--font-mono); color: var(--muted); border: 1px solid var(--border); padding: 4px 6px; border-radius: 999px; }
.nav { display: flex; gap: 2px; margin-left: auto; position: relative; }
.nav a {
  position: relative; z-index: 1;
  color: var(--text-2); font: 500 14px/1 var(--font); padding: 10px 14px; border-radius: 999px;
  transition: color .2s;
}
.nav a:hover { color: var(--text); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--text); }
.nav-pill {
  position: absolute; top: 0; height: 100%; border-radius: 999px; z-index: 0;
  background: var(--surface-2); border: 1px solid var(--border);
  transition: left .35s cubic-bezier(.2,.8,.2,1), width .35s cubic-bezier(.2,.8,.2,1);
}
.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  color: var(--text-2); background: transparent; border: 1px solid var(--border); cursor: pointer;
}
.icon-btn:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.theme-toggle .moon { display: none; }
:root[data-theme="light"] .theme-toggle .sun { display: none; }
:root[data-theme="light"] .theme-toggle .moon { display: block; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .theme-toggle .sun { display: none; }
  :root:not([data-theme]) .theme-toggle .moon { display: block; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px; height: 46px; padding: 0 20px;
  border-radius: 12px; font: 600 15px/1 var(--font); cursor: pointer; border: 1px solid transparent;
  transition: transform .15s, background .2s, border-color .2s, box-shadow .2s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 88%, white), var(--accent));
  color: var(--accent-ink);
  box-shadow: 0 10px 30px -10px var(--accent), inset 0 1px 0 rgba(255,255,255,.25);
}
.btn-ghost { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13.5px; border-radius: 10px; }

/* ---------- Layout ---------- */
main { min-height: 70vh; }
.view { display: none; }
.view.active { display: block; animation: viewIn .45s cubic-bezier(.2,.8,.2,1); }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: 96px 0; position: relative; }
.section-tight { padding: 64px 0; }
.section + .section { border-top: 1px solid var(--border); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font: 600 12px/1 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-strong);
}
.eyebrow::before { content: ""; width: 18px; height: 1px; background: currentColor; opacity: .7; }
h1, h2, h3, h4 { font-family: var(--font-display); letter-spacing: -0.02em; margin: 0; color: var(--text); }
h1 { font-size: clamp(40px, 5.2vw, 68px); line-height: 1.02; font-weight: 700; letter-spacing: -0.035em; }
h2 { font-size: clamp(30px, 3.8vw, 46px); line-height: 1.08; font-weight: 680; }
h3 { font-size: 20px; line-height: 1.3; font-weight: 620; letter-spacing: -0.01em; }
.lede { font-size: clamp(17px, 1.6vw, 20px); color: var(--text-2); max-width: 64ch; line-height: 1.6; }
.section-head { display: grid; gap: 16px; margin-bottom: 48px; max-width: 760px; }
.section-head.center { text-align: center; margin-left: auto; margin-right: auto; justify-items: center; }
.gradient-text {
  background: linear-gradient(100deg, var(--text) 10%, var(--accent-strong) 55%, var(--teal) 95%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.muted { color: var(--muted); }
.small { font-size: 13.5px; }

.grid { display: grid; gap: 20px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 980px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; position: relative;
}
.card-hover { transition: border-color .25s, transform .25s, box-shadow .25s; }
.card-hover:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow); }
.card h3 { margin-bottom: 8px; }
.card p { color: var(--text-2); margin: 0; font-size: 15px; }
.icon-tile {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 18px;
  color: var(--accent-strong);
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 22%, transparent), color-mix(in srgb, var(--teal) 10%, transparent));
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.icon-tile .icon { width: 22px; height: 22px; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: 72px 0 40px; isolation: isolate; }
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto; height: 120%; z-index: -2;
  background:
    radial-gradient(40% 50% at 70% 35%, var(--glow-a), transparent 70%),
    radial-gradient(35% 40% at 20% 20%, var(--glow-b), transparent 70%);
}
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: center; }
@media (max-width: 980px) { .hero-grid { grid-template-columns: 1fr; } }
.hero-copy { display: grid; gap: 24px; }
.hero .badge {
  display: inline-flex; align-items: center; gap: 10px; width: fit-content;
  padding: 6px 12px 6px 6px; border-radius: 999px; border: 1px solid var(--border-strong);
  background: color-mix(in srgb, var(--surface) 70%, transparent); color: var(--text-2); font-size: 13px;
}
.hero .badge b { font: 600 11px/1 var(--font-mono); color: var(--accent-ink); background: var(--accent); padding: 5px 8px; border-radius: 999px; }
.hero .badge:hover { text-decoration: none; border-color: var(--accent); color: var(--text); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-canvas-wrap { position: relative; aspect-ratio: 1 / 0.95; min-height: 360px; margin-right: -24px; }
@media (max-width: 980px) { .hero-canvas-wrap { margin-right: 0; aspect-ratio: 1 / 0.8; } }
.hero-canvas-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-legend { position: absolute; left: 0; right: 0; bottom: 4px; display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; font: 500 12px/1 var(--font-mono); color: var(--muted); }
.hero-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin-top: 48px; border: 1px solid var(--border); border-radius: var(--radius); background: color-mix(in srgb, var(--surface) 70%, transparent); overflow: hidden; }
.stat { padding: 24px 26px; border-left: 1px solid var(--border); }
.stat:first-child { border-left: 0; }
.stat .num { font: 700 38px/1 var(--font-display); letter-spacing: -0.03em; color: var(--text); font-variant-numeric: tabular-nums; }
.stat .num small { font-size: 0.55em; font-weight: 600; color: var(--text-2); margin-left: 2px; }
.stat .lbl { margin-top: 10px; color: var(--text-2); font-size: 14px; line-height: 1.45; }
.stat .src { margin-top: 8px; font: 500 11.5px/1.3 var(--font-mono); color: var(--muted); }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, 1fr); } .stat:nth-child(3) { border-left: 0; } .stat:nth-child(n+3) { border-top: 1px solid var(--border); } }
@media (max-width: 480px) { .stats { grid-template-columns: 1fr; } .stat { border-left: 0; } .stat + .stat { border-top: 1px solid var(--border); } }

/* ---------- Terminal / code ---------- */
.term {
  background: var(--code-bg); border: 1px solid rgba(150,168,220,.16); border-radius: 14px; overflow: hidden;
  box-shadow: var(--shadow); color: #d6dcf0;
}
.term-bar { display: flex; align-items: center; gap: 8px; padding: 10px 12px 10px 16px; border-bottom: 1px solid rgba(150,168,220,.12); }
.term-bar .lights { display: flex; gap: 6px; }
.term-bar .lights i { width: 10px; height: 10px; border-radius: 50%; background: #2a3354; }
.term-bar .title { font: 500 12px/1 var(--font-mono); color: #7f89a8; margin-left: 8px; }
.term-bar .copy { margin-left: auto; }
.term pre { margin: 0; padding: 18px 20px; overflow-x: auto; font-size: 13.5px; line-height: 1.75; }
.term .c { color: #6c779a; }
.term .k { color: #b7a9ff; }
.term .s { color: #7ee2cf; }
.term .p { color: #7f89a8; user-select: none; }
.term .o { color: #f3c37a; }
.copy {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 8px;
  font: 500 12px/1 var(--font); color: #aab3cb; background: rgba(255,255,255,.04); border: 1px solid rgba(150,168,220,.16); cursor: pointer;
}
.copy:hover { color: #fff; background: rgba(255,255,255,.08); }
.copy.done { color: #7ee2cf; border-color: rgba(126,226,207,.4); }

/* ---------- Features ---------- */
.feature-card { display: flex; flex-direction: column; }
.feature-card .tag { margin-top: auto; padding-top: 18px; font: 500 12px/1.4 var(--font-mono); color: var(--muted); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.split.wide-right { grid-template-columns: 0.85fr 1.15fr; }
@media (max-width: 980px) { .split, .split.wide-right { grid-template-columns: 1fr; gap: 32px; } }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.checklist li { display: grid; grid-template-columns: 22px 1fr; gap: 12px; color: var(--text-2); }
.checklist li .icon { color: var(--teal); margin-top: 3px; }
.checklist li b { color: var(--text); font-weight: 600; }

/* ---------- Architecture ---------- */
.arch { display: grid; grid-template-columns: 1.35fr 0.65fr; gap: 20px; }
@media (max-width: 980px) { .arch { grid-template-columns: 1fr; } }
.arch-svg { width: 100%; height: auto; display: block; }
.arch-node { cursor: pointer; }
.arch-node rect { fill: var(--surface-2); stroke: var(--border-strong); stroke-width: 1; transition: fill .2s, stroke .2s; }
.arch-node text { fill: var(--text); font: 600 13px var(--font); }
.arch-node .sub { fill: var(--muted); font: 500 11px var(--font-mono); }
.arch-node:hover rect, .arch-node.on rect { stroke: var(--accent); fill: color-mix(in srgb, var(--accent) 14%, var(--surface-2)); }
.arch-node:focus { outline: none; }
.arch-node:focus-visible rect { stroke: var(--accent); stroke-width: 2; }
.arch-frame { fill: none; stroke: var(--border-strong); stroke-dasharray: 4 5; }
.arch-frame-label { fill: var(--muted); font: 600 10.5px var(--font-mono); letter-spacing: .1em; }
.arch-core { fill: color-mix(in srgb, var(--accent) 7%, var(--surface)); stroke: color-mix(in srgb, var(--accent) 45%, transparent); }
.arch-link { stroke: var(--border-strong); stroke-width: 1.5; fill: none; }
.arch-flow { stroke: var(--accent); stroke-width: 2; fill: none; stroke-dasharray: 3 9; animation: flow 1.2s linear infinite; opacity: .8; }
@keyframes flow { to { stroke-dashoffset: -24; } }
.arch-detail h3 { margin: 6px 0 10px; }
.arch-detail p { color: var(--text-2); margin: 0 0 14px; font-size: 15px; }
.arch-detail .kv { display: grid; gap: 8px; margin-top: 8px; }
.arch-detail .kv div { display: flex; gap: 10px; font-size: 13.5px; color: var(--text-2); }
.arch-detail .kv code { white-space: normal; }

/* ---------- Tabs (segmented) ---------- */
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.seg button {
  font: 500 13.5px/1 var(--font); color: var(--text-2); background: transparent; border: 0; border-radius: 9px;
  padding: 10px 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
}
.seg button:hover { color: var(--text); }
.seg button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 0 var(--border-strong), 0 4px 14px -6px rgba(0,0,0,.4); }

/* ---------- Playground ---------- */
.pg { display: grid; grid-template-columns: 1.25fr 0.75fr; gap: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
@media (max-width: 980px) { .pg { grid-template-columns: 1fr; } }
.pg-stage { position: relative; padding: 18px; border-right: 1px solid var(--border); min-height: 420px; background:
  radial-gradient(60% 60% at 50% 45%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 70%); }
@media (max-width: 980px) { .pg-stage { border-right: 0; border-bottom: 1px solid var(--border); } }
.pg-stage svg { width: 100%; height: auto; display: block; }
.pg-caption { min-height: 48px; margin: 6px 6px 0; color: var(--text-2); font-size: 14.5px; }
.pg-caption b { color: var(--text); }
.pg-side { display: flex; flex-direction: column; min-height: 0; }
.pg-controls { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.pg-controls .spacer { flex: 1; }
.pg-progress { height: 3px; background: var(--surface-3); border-radius: 2px; overflow: hidden; flex: 1; }
.pg-progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--teal)); transition: width .3s; }
.pg-log { flex: 1; overflow: auto; max-height: 420px; padding: 12px 0; font: 12.5px/1.6 var(--font-mono); background: var(--code-bg); color: #c8cfe6; }
.pg-log .ln { padding: 3px 16px; display: grid; grid-template-columns: 46px 1fr; gap: 8px; animation: lnIn .35s ease; }
.pg-log .ln.hi { background: rgba(154,140,255,.10); }
.pg-log .t { color: #5f6a8e; }
.pg-log .ok { color: #7ee2cf; } .pg-log .err { color: #ff8f8f; } .pg-log .op { color: #b7a9ff; } .pg-log .note { color: #f3c37a; }
@keyframes lnIn { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
.pg-metrics { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--border); }
.pg-metrics div { padding: 12px 14px; border-left: 1px solid var(--border); }
.pg-metrics div:first-child { border-left: 0; }
.pg-metrics b { display: block; font: 650 20px/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.pg-metrics span { font-size: 12px; color: var(--muted); }

.sv-agent circle.body { fill: var(--surface-2); stroke: var(--border-strong); stroke-width: 1.5; transition: fill .3s, stroke .3s; }
.sv-agent.holding circle.body { stroke: var(--teal); fill: color-mix(in srgb, var(--teal) 16%, var(--surface-2)); }
.sv-agent.waiting circle.body { stroke: var(--warn); }
.sv-agent.stale circle.body { stroke: var(--bad); fill: color-mix(in srgb, var(--bad) 12%, var(--surface-2)); }
.sv-agent.dead { opacity: .35; }
.sv-agent text { fill: var(--text); font: 600 12px var(--font-mono); text-anchor: middle; }
.sv-agent .status { fill: var(--muted); font: 500 10.5px var(--font-mono); }
.sv-core circle { fill: url(#coreGrad); stroke: color-mix(in srgb, var(--accent) 60%, transparent); stroke-width: 1.5; }
.sv-core text { fill: #fff; font: 700 13px var(--font-display); text-anchor: middle; }
.sv-core .sub { fill: rgba(255,255,255,.7); font: 500 10px var(--font-mono); }
.sv-res rect { fill: var(--surface); stroke: var(--border-strong); stroke-width: 1.5; transition: stroke .3s; }
.sv-res.locked rect { stroke: var(--teal); }
.sv-res text { fill: var(--text); font: 600 11.5px var(--font-mono); text-anchor: middle; }
.sv-res .sub { fill: var(--muted); font: 500 10.5px var(--font-mono); }
.sv-link { stroke: var(--border); stroke-width: 1.2; }
.sv-edge { stroke: var(--warn); stroke-width: 2; fill: none; stroke-dasharray: 5 5; animation: flow 1s linear infinite; }
.sv-edge.cycle { stroke: var(--bad); }
.sv-packet { filter: drop-shadow(0 0 6px currentColor); }
.sv-queue rect { fill: var(--surface-2); stroke: var(--border-strong); }
.sv-queue text { fill: var(--text-2); font: 500 10.5px var(--font-mono); }
.sv-token { fill: var(--text); font: 700 11px var(--font-mono); }

/* ---------- Roles ---------- */
.roles { display: grid; grid-template-columns: 300px 1fr; gap: 20px; }
@media (max-width: 860px) { .roles { grid-template-columns: 1fr; } }
.role-list { display: grid; gap: 6px; align-content: start; }
.role-list button {
  display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px 14px; border-radius: 12px; cursor: pointer;
  background: transparent; border: 1px solid transparent; color: var(--text-2); font: 500 14.5px/1.2 var(--font);
}
.role-list button:hover { background: var(--surface-2); color: var(--text); }
.role-list button[aria-selected="true"] { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.role-list .icon { color: var(--accent-strong); }
.role-panel h3 { font-size: 24px; margin-bottom: 6px; }
.role-panel .owns { font: 500 13px var(--font-mono); color: var(--teal); margin-bottom: 14px; }
.role-panel p { color: var(--text-2); margin: 0 0 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: 500 12.5px/1 var(--font-mono); padding: 7px 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }

/* ---------- Charts ---------- */
.chart-card { padding: 24px 24px 18px; }
.chart-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.chart-head h3 { font-size: 18px; }
.chart-head p { margin: 4px 0 0; font-size: 14px; color: var(--text-2); }
.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; color: var(--text-2); align-items: center; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.chart { width: 100%; position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .axis text, .chart .lab { fill: var(--muted); font: 500 11.5px var(--font); }
.chart .lab-strong { fill: var(--text); font: 600 12.5px var(--font); }
.chart .val { fill: var(--text-2); font: 600 11.5px var(--font); font-variant-numeric: tabular-nums; }
.chart .gridline { stroke: var(--grid); }
.chart .baseline { stroke: var(--border-strong); }
.chart .refline { stroke: var(--text-2); stroke-dasharray: 4 4; opacity: .7; }
.chart .whisker { stroke: var(--text-2); stroke-width: 1.4; }
.chart .mark { transition: opacity .2s; }
.chart .dim .mark { opacity: .35; }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .band { fill: var(--surface-2); }
.chart-foot { margin-top: 10px; font-size: 12.5px; color: var(--muted); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.chart-foot button { background: none; border: 0; color: var(--accent-strong); font: 500 12.5px var(--font); cursor: pointer; padding: 0; }
.tooltip {
  position: fixed; z-index: 100; pointer-events: none; opacity: 0; transform: translateY(4px);
  transition: opacity .12s, transform .12s;
  background: var(--surface-3); color: var(--text); border: 1px solid var(--border-strong); border-radius: 10px;
  padding: 10px 12px; font-size: 13px; box-shadow: var(--shadow); max-width: 280px;
}
.tooltip.on { opacity: 1; transform: none; }
.tooltip .tt-title { font-weight: 600; margin-bottom: 6px; }
.tooltip .tt-row { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.tooltip .tt-row b { color: var(--text); margin-left: auto; padding-left: 12px; }
.tooltip i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-top: 12px; }
.data-table th, .data-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.data-table th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.data-table td { color: var(--text-2); font-variant-numeric: tabular-nums; }

.callouts { display: grid; gap: 14px; }
.callout { display: grid; grid-template-columns: 36px 1fr; gap: 14px; padding: 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.callout .icon-tile { width: 36px; height: 36px; margin: 0; border-radius: 10px; }
.callout .icon-tile .icon { width: 18px; height: 18px; }
.callout b { display: block; color: var(--text); font-weight: 600; margin-bottom: 2px; }
.callout span { color: var(--text-2); font-size: 14.5px; }

.study { display: grid; gap: 28px; }
.study-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px; align-items: end; }
.study-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font: 500 12px/1 var(--font-mono); padding: 7px 10px; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--text-2); }
.pill .icon { width: 14px; height: 14px; }
.pill.live { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }

/* ---------- SmartTasks jobs board ---------- */
.jobs > * { min-width: 0; }
.pg > * { min-width: 0; }
.jobs { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
@media (max-width: 980px) { .jobs { grid-template-columns: 1fr; } }
.jobs-main { padding: 22px; border-right: 1px solid var(--border); }
@media (max-width: 980px) { .jobs-main { border-right: 0; border-bottom: 1px solid var(--border); } }
.jobs-cmd { font: 500 13px/1.6 var(--font-mono); background: var(--code-bg); color: #d6dcf0; padding: 12px 14px; border-radius: 10px; overflow-x: auto; white-space: nowrap; }
.jobs-cmd .k { color: #b7a9ff; } .jobs-cmd .s { color: #7ee2cf; } .jobs-cmd .o { color: #f3c37a; }
.jobs-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin: 18px 0; }
@media (max-width: 520px) { .jobs-grid { grid-template-columns: repeat(4, 1fr); } }
.job { position: relative; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); padding: 10px 8px 8px; overflow: hidden; min-height: 64px; }
.job .jn { font: 600 12px var(--font-mono); color: var(--text); }
.job .js { font: 500 10.5px var(--font-mono); color: var(--muted); margin-top: 4px; }
.job .bar { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--blue); width: 0; }
.job.running { border-color: color-mix(in srgb, var(--blue) 55%, transparent); }
.job.running .js { color: var(--blue); }
.job.succeeded { border-color: color-mix(in srgb, var(--good) 50%, transparent); }
.job.succeeded .js { color: var(--good); } .job.succeeded .bar { background: var(--good); }
.job.stopped { border-color: color-mix(in srgb, var(--bad) 55%, transparent); background: color-mix(in srgb, var(--bad) 8%, var(--surface-2)); }
.job.stopped .js { color: var(--bad); } .job.stopped .bar { background: var(--bad); }
.job.queued .js { color: var(--muted); }
.jobs-controls { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.slider { display: flex; align-items: center; gap: 10px; font: 500 13px var(--font-mono); color: var(--text-2); }
.slider input { accent-color: var(--accent); width: 130px; }
.jobs-side { display: flex; flex-direction: column; }
.jobs-side .pg-log { max-height: 300px; min-height: 220px; }
.compare { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--border); }
.compare div { padding: 14px 16px; border-left: 1px solid var(--border); }
.compare div:first-child { border-left: 0; }
.compare b { font: 700 26px/1 var(--font-display); font-variant-numeric: tabular-nums; display: block; }
.compare span { font-size: 12.5px; color: var(--muted); }
.compare .with b { color: var(--teal); }

.lifecycle svg { width: 100%; height: auto; display: block; }
.lc-node rect { fill: var(--surface-2); stroke: var(--border-strong); }
.lc-node text { fill: var(--text); font: 600 12px var(--font-mono); text-anchor: middle; }
.lc-node.end rect { fill: var(--surface); }
.lc-node.good rect { stroke: color-mix(in srgb, var(--good) 60%, transparent); }
.lc-node.bad rect { stroke: color-mix(in srgb, var(--bad) 55%, transparent); }
.lc-node.run rect { stroke: var(--blue); fill: color-mix(in srgb, var(--blue) 12%, var(--surface-2)); }
.lc-edge { stroke: var(--border-strong); stroke-width: 1.4; fill: none; }
.lc-arrow { fill: var(--border-strong); }

.table-clean { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table-clean th, .table-clean td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table-clean th { font: 600 12px var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.table-clean td { color: var(--text-2); }
.table-clean td:first-child { color: var(--text); }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }

/* ---------- Papers list ---------- */
.papers-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
@media (max-width: 860px) { .papers-grid { grid-template-columns: 1fr; } }
.paper-card { display: flex; flex-direction: column; gap: 14px; padding: 28px; cursor: pointer; color: inherit; }
.paper-card:hover { text-decoration: none; }
.paper-card.featured { grid-column: 1 / -1; display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 32px; padding: 0; overflow: hidden; }
.paper-card.featured .pc-body { padding: 36px; display: flex; flex-direction: column; gap: 14px; }
.paper-card.featured .pc-art { background: #fff; display: grid; place-items: center; padding: 20px; border-left: 1px solid var(--border); }
.paper-card.featured .pc-art img { width: 100%; height: auto; border-radius: 8px; }
@media (max-width: 860px) { .paper-card.featured { grid-template-columns: 1fr; } .paper-card.featured .pc-art { border-left: 0; border-top: 1px solid var(--border); } }
.pc-kicker { display: flex; align-items: center; gap: 10px; font: 600 12px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent-strong); }
.pc-kicker .num { color: var(--muted); }
.paper-card h3 { font-size: 22px; line-height: 1.25; }
.paper-card.featured h3 { font-size: clamp(24px, 2.6vw, 32px); }
.paper-card p { margin: 0; color: var(--text-2); }
.pc-take { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pc-take li { display: grid; grid-template-columns: 18px 1fr; gap: 10px; font-size: 14.5px; color: var(--text-2); }
.pc-take li .icon { width: 16px; height: 16px; color: var(--teal); margin-top: 3px; }
.pc-meta { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 14px; font-size: 13px; color: var(--muted); padding-top: 6px; }
.pc-meta .read { margin-left: auto; color: var(--accent-strong); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.paper-card:hover .read .icon { transform: translateX(3px); }
.pc-meta .read .icon { transition: transform .2s; }

/* ---------- Start (newcomer path) ---------- */
.steps { display: grid; gap: 0; counter-reset: step; position: relative; }
.step { display: grid; grid-template-columns: 56px 1fr; gap: 24px; padding-bottom: 44px; position: relative; }
.step::before {
  content: ""; position: absolute; left: 27px; top: 56px; bottom: 0; width: 2px;
  background: linear-gradient(var(--border-strong), transparent);
}
.step:last-child::before { display: none; }
.step-n {
  width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center;
  font: 700 18px var(--font-display); color: var(--accent-strong);
  background: var(--surface); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 8%, transparent);
}
.step-body { display: grid; gap: 14px; min-width: 0; padding-top: 6px; }
.step-body h3 { font-size: 22px; }
.step-body > p { color: var(--text-2); margin: 0; max-width: 70ch; }
.expect { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--text-2); padding: 12px 14px; border-radius: 12px; border: 1px dashed var(--border-strong); }
.expect .icon { color: var(--teal); margin-top: 2px; }
.alt-tabs .seg { margin-bottom: 12px; }
.alt-panel { display: none; }
.alt-panel.on { display: block; }

.idea-card { display: flex; flex-direction: column; gap: 10px; }
.idea-card .lvl { display: flex; gap: 8px; flex-wrap: wrap; }
.idea-card .from { margin-top: auto; padding-top: 10px; font: 500 12.5px var(--font-mono); color: var(--muted); }

.rules-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (max-width: 760px) { .rules-grid { grid-template-columns: 1fr; } }
.rule { display: grid; grid-template-columns: 28px 1fr; gap: 12px; padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.rule .n { font: 700 13px var(--font-mono); color: var(--accent-strong); }
.rule b { color: var(--text); display: block; margin-bottom: 4px; }
.rule span { color: var(--text-2); font-size: 14.5px; }

details.faq { border-bottom: 1px solid var(--border); padding: 18px 0; }
details.faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 20px; font: 600 17px var(--font-display); color: var(--text); }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary .icon { transition: transform .25s; color: var(--muted); }
details.faq[open] summary .icon { transform: rotate(45deg); }
details.faq p { color: var(--text-2); margin: 12px 0 0; max-width: 75ch; }

.cta-band {
  border: 1px solid var(--border); border-radius: 24px; padding: 56px; text-align: center; display: grid; gap: 18px; justify-items: center;
  background:
    radial-gradient(50% 80% at 50% 0%, var(--glow-a), transparent 70%),
    var(--surface);
}
@media (max-width: 600px) { .cta-band { padding: 36px 22px; } }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); margin-top: 40px; padding: 48px 0 56px; color: var(--muted); font-size: 14px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.site-footer h4 { font: 600 13px var(--font); color: var(--text); margin-bottom: 12px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.site-footer a { color: var(--text-2); }
.site-footer a:hover { color: var(--text); }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s cubic-bezier(.2,.8,.2,1), transform .7s cubic-bezier(.2,.8,.2,1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .view.active { animation: none; }
  .arch-flow, .sv-edge { animation: none; }
}

/* ---------- Mobile header ---------- */
.menu-btn { display: none; }
@media (max-width: 900px) {
  .header-inner { gap: 12px; padding: 0 16px; }
  .nav { position: fixed; inset: 64px 0 auto 0; flex-direction: column; gap: 4px; padding: 12px 16px 18px; margin: 0;
    background: var(--bg); border-bottom: 1px solid var(--border); transform: translateY(-110%); transition: transform .3s; z-index: 40; }
  .nav.open { transform: none; }
  .nav a { padding: 14px 12px; font-size: 16px; border-radius: 10px; }
  .nav a[aria-current="page"] { background: var(--surface-2); }
  .nav-pill { display: none; }
  .menu-btn { display: inline-grid; }
  .header-actions { margin-left: auto; }
  .wrap { padding: 0 16px; }
  .section { padding: 64px 0; }
}

/* Grid children may shrink below their content width (long code lines scroll inside). */
.grid > *, .split > *, .hero-grid > *, .arch > *, .roles > *, .papers-grid > *, .steps > *, .step-body > *, .footer-grid > * { min-width: 0; }
@media (max-width: 600px) { :not(pre) > code { white-space: normal; overflow-wrap: anywhere; } }
