/* ---------- tokens: light is the default, dark is opt-in ---------- */
:root {
  color-scheme: light;
  --paper: #f6f4ef;
  --band: #efece4;
  --card: #ffffff;
  --ink: #15171b;
  --ink-2: #3a3e46;
  --muted: #646872;
  --line: #e0dcd2;
  --line-2: #cfcabd;
  --accent: #e8551c;
  --accent-ink: #b33f0f;
  --accent-soft: #fde6da;
  --strict: #23925a;
  --service: #d39a12;
  --wrong: #cf3a4a;
  --none: #b3aea2;
  --unscored: #8f8a7e;
  --code-bg: #f1eee7;
  --grid: rgb(21 23 27 / 0.05);
  --shadow: 0 1px 2px rgb(21 23 27 / 0.05), 0 12px 32px -8px rgb(21 23 27 / 0.12);
  --sans: "IBM Plex Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #111316;
  --band: #16191d;
  --card: #1c1f24;
  --ink: #f1eee7;
  --ink-2: #c9c6bf;
  --muted: #9a9ea7;
  --line: #2b2f36;
  --line-2: #3a3f48;
  --accent: #ff6a2b;
  --accent-ink: #ff8a57;
  --accent-soft: #3a2116;
  --strict: #3dbb78;
  --service: #e8b13a;
  --wrong: #f0626f;
  --none: #4f545e;
  --unscored: #8a8f9b;
  --code-bg: #24282e;
  --grid: rgb(255 255 255 / 0.04);
  --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 12px 32px -8px rgb(0 0 0 / 0.5);
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; }
code, pre, kbd { font-family: var(--mono); font-size: 0.86em; }
:not(pre) > code { background: var(--code-bg); padding: 0.12em 0.4em; border-radius: 5px; }
h1, h2, h3 { line-height: 1.12; letter-spacing: -0.025em; margin: 0; font-weight: 600; }
h2 { font-size: clamp(1.75rem, 3.2vw, 2.5rem); }
h3 { font-size: 1.05rem; letter-spacing: -0.01em; }
.muted { color: var(--muted); }
.ok { color: var(--strict); font-weight: 600; }
.bad { color: var(--wrong); font-weight: 600; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
section { padding: 96px 0; }
.band { background: var(--band); border-block: 1px solid var(--line); }
.section-head { max-width: 720px; margin-bottom: 40px; }
.section-head p { color: var(--muted); margin: 14px 0 0; }
.section-head .kicker,
.kicker {
  margin: 0 0 10px; color: var(--accent-ink);
  font: 600 0.75rem var(--mono); text-transform: uppercase; letter-spacing: 0.12em;
}

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 85%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.top-row { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; }
.mark { width: 28px; height: 28px; fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.6; flex: none; }
.mark-br { stroke: var(--ink); }
.mark-pulse { stroke: var(--accent); }
.wordmark { font: 600 1.18rem var(--mono); letter-spacing: -0.04em; }
.brand.small .mark { width: 22px; height: 22px; }
.brand.small .wordmark { font-size: 1rem; }
nav { display: flex; align-items: center; gap: 24px; font-size: 0.92rem; }
nav a { text-decoration: none; color: var(--muted); font-weight: 500; }
nav a:hover { color: var(--ink); }
.theme-toggle {
  display: inline-grid; place-items: center; width: 36px; height: 36px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--card); color: var(--ink); cursor: pointer;
}
.theme-toggle:hover { border-color: var(--line-2); }
.theme-toggle svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.i-sun { display: none; }
:root[data-theme="dark"] .i-sun { display: block; }
:root[data-theme="dark"] .i-moon { display: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 18px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--card); color: var(--ink);
  font: 600 0.93rem var(--sans); text-decoration: none; cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.btn:hover { border-color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn.primary:hover { background: color-mix(in srgb, var(--ink) 86%, var(--accent)); }
.btn.small { padding: 7px 13px; font-size: 0.85rem; border-radius: 8px; }

/* ---------- hero ---------- */
.hero { position: relative; isolation: isolate; padding: 88px 0 96px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent);
  mask-image: linear-gradient(to bottom, #000 55%, transparent);
}
.hero-grid { display: grid; grid-template-columns: 1.12fr 0.88fr; gap: 64px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 22px;
  padding: 5px 12px 5px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--card);
  font: 500 0.8rem var(--mono); color: var(--ink-2);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
h1 { font-size: clamp(2.5rem, 5.4vw, 4.1rem); letter-spacing: -0.04em; line-height: 1.04; font-weight: 600; }
h1 em { font-style: normal; color: var(--accent); }
.lede { font-size: 1.15rem; color: var(--ink-2); margin: 22px 0 30px; max-width: 580px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin: 44px 0 0; padding-top: 22px; border-top: 1px solid var(--line); max-width: 600px; }
.stats dt { font: 600 1.75rem var(--mono); letter-spacing: -0.04em; }
.stats dd { margin: 4px 0 0; color: var(--muted); font-size: 0.84rem; line-height: 1.4; }

/* ---------- features ---------- */
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.features article { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 22px; }
.features h3 { margin: 16px 0 8px; }
.features p { margin: 0; color: var(--muted); font-size: 0.92rem; }
.f-ico { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink); }
.f-ico svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- replay ---------- */
.story-pick { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-top: 22px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.seg { font: 600 0.87rem var(--sans); color: var(--muted); background: none; border: 0; border-radius: 8px; padding: 8px 14px; cursor: pointer; }
.seg:hover { color: var(--ink); }
.seg[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.replay { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.controls { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.clock { margin-left: auto; font: 0.85rem var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.steps { position: relative; list-style: none; margin: 0; padding: 0 4px 0 0; max-height: min(680px, calc(100vh - 150px)); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.steps li { position: relative; margin-left: 8px; padding: 0 0 8px 18px; border-left: 2px solid var(--line); }
.steps li.future { display: none; }
.steps li::before { content: ""; position: absolute; left: -8px; top: 13px; width: 10px; height: 10px; border-radius: 50%; background: var(--paper); border: 2px solid var(--line-2); }
.steps li.k-tool::before { border-color: var(--accent); }
.steps li.k-bad::before { border-color: var(--wrong); background: var(--wrong); }
.steps li.k-good::before { border-color: var(--strict); background: var(--strict); }
.steps li.inspector-slot { padding: 0 0 10px 18px; }
.steps li.inspector-slot::before { display: none; }
.step {
  display: block; width: 100%; text-align: left; font: inherit; color: inherit; overflow-wrap: anywhere;
  background: none; border: 1px solid transparent; border-radius: 9px; padding: 7px 11px; cursor: default;
}
button.step { cursor: pointer; }
button.step:hover { border-color: var(--line); background: var(--card); }
button.step.active { border-color: var(--accent); background: var(--card); box-shadow: 0 0 0 3px var(--accent-soft); }
.step .t { font: 0.74rem var(--mono); color: var(--muted); margin-right: 8px; font-variant-numeric: tabular-nums; }
.step .eid { font: 600 0.8rem var(--mono); color: var(--accent-ink); margin-right: 6px; }
.step .tool { font: 500 0.85rem var(--mono); }
.step .args { font: 0.77rem var(--mono); color: var(--muted); margin-left: 6px; }
.step.say { color: var(--ink-2); font-size: 0.93rem; }
.step.bad { color: var(--wrong); font-size: 0.93rem; }
.step.good { color: var(--strict); font-weight: 600; font-size: 0.93rem; }

.inspector {
  position: sticky; top: 80px; max-width: 100%;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px;
  max-height: calc(100vh - 104px); overflow: auto; box-shadow: var(--shadow);
}
.inspector h3 { font: 600 0.92rem var(--mono); letter-spacing: 0; }
.inspector h3 .eid { color: var(--accent-ink); }
.inspector .args { font: 0.78rem var(--mono); color: var(--muted); margin: 6px 0 12px; overflow-wrap: anywhere; }
.inspector pre { margin: 0; max-width: 100%; white-space: pre; overflow-x: auto; font-size: 0.76rem; line-height: 1.55; background: var(--code-bg); padding: 12px; border-radius: 9px; }
.inspector .cited { font-size: 0.82rem; color: var(--muted); margin: 12px 0 0; }

/* ---------- report ---------- */
.report { margin-top: 56px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 30px; box-shadow: var(--shadow); }
.report-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: baseline; margin-bottom: 6px; }
.report-head h3 { font-size: 1.25rem; }
.report .rc { font-size: 1.04rem; }
.report h4 { margin: 26px 0 8px; font: 600 0.72rem var(--mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.report p { margin: 0; }
.hyp { border-top: 1px solid var(--line); padding: 13px 0; display: grid; grid-template-columns: 110px 1fr; gap: 12px; }
.hyp .st { font: 600 0.7rem var(--mono); text-transform: uppercase; letter-spacing: 0.06em; padding-top: 3px; }
.st.likely { color: var(--strict); }
.st.ruled_out { color: var(--muted); }
.st.open { color: var(--service); }
.cite { font: 600 0.74rem var(--mono); color: var(--accent-ink); background: var(--accent-soft); border: 0; border-radius: 5px; padding: 2px 7px; margin: 2px 2px 0 0; cursor: pointer; }
.cite:hover { background: color-mix(in srgb, var(--accent) 28%, transparent); }
.cite-row { margin-top: 7px; font-size: 0.8rem; color: var(--muted); }
.report ul { margin: 0; padding-left: 18px; }
.report li { margin: 4px 0; }
.score { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 8px; }
.score div { background: var(--code-bg); border-radius: 10px; padding: 12px 14px; }
.score b { display: block; font-size: 0.98rem; }
.score span { font-size: 0.8rem; color: var(--muted); overflow-wrap: anywhere; }

/* ---------- results ---------- */
.table-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 4px 8px 0; overflow-x: auto; }
.results { width: 100%; border-collapse: collapse; font-size: 0.93rem; min-width: 640px; }
.results th { text-align: left; font: 600 0.7rem var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--line); }
.results td { padding: 15px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.results tr:last-child td { border-bottom: 0; }
.results .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.results .cfg b { display: block; font-weight: 600; }
.results .cfg span { color: var(--muted); font-size: 0.85rem; }
.w-bar { width: 40%; }
.bar { display: flex; align-items: center; gap: 14px; }
.bar-track { position: relative; flex: 1; height: 10px; background: var(--code-bg); border-radius: 5px; }
.bar-fill { position: absolute; inset: 0 auto 0 0; background: var(--strict); border-radius: 5px; }
.bar-ci { position: absolute; top: -4px; bottom: -4px; border-inline: 2px solid var(--ink); opacity: 0.4; }
.bar-ci::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 2px solid var(--ink); }
.bar-num { font-variant-numeric: tabular-nums; min-width: 92px; text-align: right; }
.bar-num small { color: var(--muted); }
.findings { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 24px; }
.findings article { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 22px; }
.findings p { margin: 8px 0 0; color: var(--muted); font-size: 0.93rem; }

/* ---------- matrix ---------- */
.legend { list-style: none; padding: 0; margin: 0 0 20px; display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 0.85rem; color: var(--muted); }
.legend li { display: inline-flex; align-items: center; gap: 8px; }
.sq { display: inline-block; width: 14px; height: 14px; border-radius: 3px; flex: none; vertical-align: -2px; }
.sq.strict { background: var(--strict); }
.sq.service { background: var(--service); }
.sq.wrong { background: var(--wrong); }
.sq.none { background: var(--none); }
.sq.unscored { background: transparent; box-shadow: inset 0 0 0 2px var(--unscored); }
.sq.harm { box-shadow: 0 0 0 2px var(--card), 0 0 0 3.5px var(--ink); }
.legend .sq.harm { box-shadow: 0 0 0 2px var(--paper), 0 0 0 3.5px var(--ink); }
.sq.unscored.harm { box-shadow: inset 0 0 0 2px var(--unscored), 0 0 0 2px var(--card), 0 0 0 3.5px var(--ink); }
.matrix { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.m-head, .m-row > summary { display: grid; grid-template-columns: minmax(150px, 1.4fr) repeat(6, minmax(0, 1fr)); gap: 8px; align-items: center; padding: 10px 16px; }
.m-head { font: 500 0.7rem var(--mono); color: var(--muted); border-bottom: 1px solid var(--line); line-height: 1.3; background: var(--code-bg); }
.m-head span:not(:first-child) { text-align: center; }
.m-row { border-bottom: 1px solid var(--line); }
.m-row:last-child { border-bottom: 0; }
.m-row > summary { cursor: pointer; list-style: none; }
.m-row > summary::-webkit-details-marker { display: none; }
.m-row > summary:hover { background: color-mix(in srgb, var(--code-bg) 60%, transparent); }
.m-row[open] > summary { background: var(--code-bg); }
.m-name { font: 0.8rem var(--mono); overflow-wrap: anywhere; }
.m-name::before { content: "▸"; color: var(--muted); margin-right: 6px; display: inline-block; transition: transform 0.15s; }
.m-row[open] .m-name::before { transform: rotate(90deg); }
.m-cell { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; }
.m-cell .sq { width: 12px; height: 12px; }
.m-cell .sq.harm { margin: 0 3px; }
.m-detail { padding: 12px 16px 18px; overflow-x: auto; }
.m-detail p { margin: 0 0 10px; font-size: 0.88rem; color: var(--muted); }
.m-detail table { border-collapse: collapse; font-size: 0.8rem; min-width: 620px; width: 100%; }
.m-detail th, .m-detail td { text-align: left; padding: 7px 8px; border-top: 1px solid var(--line); vertical-align: top; }
.m-detail th { color: var(--muted); font-weight: 600; }
.m-detail td code { font-size: 0.76rem; }

/* ---------- architecture ---------- */
.flow-scroll { overflow-x: auto; margin-bottom: 44px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.flow { display: block; width: 100%; height: auto; min-width: 640px; }
.flow .boxes rect { fill: var(--paper); stroke: var(--line-2); stroke-width: 1.5; }
.flow .boxes rect.hl { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 2; }
.flow .links path { stroke: var(--muted); stroke-width: 1.5; fill: none; marker-end: url(#arr); }
.flow marker path { fill: var(--muted); }
.flow text { text-anchor: middle; font-family: var(--sans); }
.flow .t1 text { fill: var(--ink); font-size: 15px; font-weight: 600; }
.flow .t2 text { fill: var(--muted); font-size: 12.5px; font-family: var(--mono); }
.cols { display: grid; grid-template-columns: repeat(2, 1fr); gap: 36px 48px; }
.cols p { color: var(--muted); margin: 8px 0 0; }
.faults { margin-top: 14px; font-size: 0.88rem; }
.faults summary { cursor: pointer; font-weight: 600; color: var(--accent-ink); }
.faults ul { list-style: none; padding: 0; margin: 10px 0 0; }
.faults li { padding: 6px 0; border-top: 1px solid var(--line); color: var(--muted); }
.faults li code { color: var(--ink); }

/* ---------- cta + footer ---------- */
.cta { padding: 80px 0; }
.cta-row { display: flex; align-items: center; justify-content: space-between; gap: 28px; flex-wrap: wrap; }
.cta h2 { max-width: 640px; }
.cta p { margin: 12px 0 0; font: 0.85rem var(--mono); }
.foot { border-top: 1px solid var(--line); }
.foot-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding-block: 24px; color: var(--muted); font-size: 0.85rem; }

/* ---------- evidence dialog ---------- */
.evidence-dialog { border: 1px solid var(--line); border-radius: 14px; padding: 0; width: min(760px, calc(100vw - 32px)); max-height: 80vh; background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.evidence-dialog::backdrop { background: rgb(0 0 0 / 0.4); }
.evidence-dialog form { padding: 18px; }
.dlg-close { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.evidence-dialog pre { margin: 0; white-space: pre-wrap; word-break: break-word; font-size: 0.76rem; background: var(--code-bg); padding: 12px; border-radius: 9px; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .features { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 48px; }
  .hero { padding-top: 56px; }
  .replay { grid-template-columns: minmax(0, 1fr); }
  .inspector { position: static; max-height: none; margin: 4px 0 10px; box-shadow: none; }
  .steps { max-height: none; overflow: visible; padding-right: 0; }
  .findings, .cols { grid-template-columns: 1fr; }
  .score { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  section { padding: 64px 0; }
  .wrap { padding: 0 16px; }
  .hide-sm { display: none; }
  nav { gap: 16px; font-size: 0.86rem; }
  .features { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; gap: 14px; }
  .stats div { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: baseline; }
  .stats dt { font-size: 1.4rem; }
  .stats dd { margin: 0; }
  .story-pick { display: flex; }
  .seg { flex: 1 1 auto; }
  .hyp { grid-template-columns: 1fr; gap: 4px; }
  .report { padding: 20px; }
  .table-card { padding: 0; }
  .results { min-width: 0; font-size: 0.85rem; }
  .bar-track { display: none; }
  .w-bar { width: auto; }
  .results th, .results td { padding-inline: 8px; }
  .results th { font-size: 0.62rem; }
  .results .cfg span { font-size: 0.78rem; }
  .bar-num { min-width: 0; text-align: left; }
  .results th:nth-child(3), .results td:nth-child(3) { display: none; }
  .m-head, .m-row > summary { grid-template-columns: minmax(96px, 1.2fr) repeat(6, minmax(0, 1fr)); gap: 4px; padding: 10px; }
  .m-head span:not(:first-child) { font-size: 0.6rem; writing-mode: vertical-rl; transform: rotate(180deg); justify-self: center; max-height: 96px; }
  .m-cell .sq { width: 9px; height: 9px; }
  .m-cell .sq.harm { margin: 0 2px; box-shadow: 0 0 0 1px var(--card), 0 0 0 2.5px var(--ink); }
  .m-cell { gap: 2px; }
  .m-name { font-size: 0.7rem; }
  .cta-row .btn { width: 100%; }
}
@media (max-width: 400px) {
  nav a[href="#features"] { display: none; }
}

/* ---------- hero diff card ---------- */
.diff-card {
  margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow); overflow: hidden; font: 0.82rem/1.5 var(--mono);
}
.dc-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--code-bg); }
.dc-alert { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--wrong); }
.dc-pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--wrong); animation: pulse 1.6s ease-out infinite; }
.dc-meta { color: var(--muted); }
.dc-body { padding: 10px 0; }
.dc-note { color: var(--muted); margin-left: 6px; }
.dc-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 11px 16px; border-top: 1px solid var(--line); color: var(--muted); }
.dc-wait { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); font-weight: 500; }
.dot-wait { width: 8px; height: 8px; border-radius: 50%; background: var(--service); animation: pulse-amber 1.8s ease-out infinite; }
.dl { display: grid; grid-template-columns: 28px 1fr; padding: 1px 16px 1px 0; }
.dl .g { text-align: center; color: var(--muted); user-select: none; }
.dl.del { background: color-mix(in srgb, var(--wrong) 10%, transparent); color: var(--wrong); }
.dl.del .g { color: var(--wrong); }
.dl.add { background: color-mix(in srgb, var(--strict) 12%, transparent); color: var(--strict); }
.dl.add .g { color: var(--strict); }
.dl.hunk { color: var(--accent-ink); margin-top: 6px; }
.dl.hunk:first-child { margin-top: 0; }
.dl.ctx { color: var(--ink-2); }
.diff-card .dl, .diff-card .dc-foot { opacity: 0; animation: rise 0.45s cubic-bezier(.2,.7,.2,1) forwards; animation-delay: calc(var(--d, 0) * 0.22s + 0.2s); }
@keyframes rise { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--wrong) 55%, transparent); } 100% { box-shadow: 0 0 0 9px transparent; } }
@keyframes pulse-amber { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--service) 55%, transparent); } 100% { box-shadow: 0 0 0 9px transparent; } }

/* ---------- story player ---------- */
.story { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 28px; align-items: start; }
.story-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.progress { flex: 1; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 2px; }
.beats { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.beat-btn {
  display: grid; grid-template-columns: 36px 1fr; gap: 14px; width: 100%; text-align: left;
  font: inherit; color: inherit; background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; cursor: pointer; transition: border-color .25s, box-shadow .25s, opacity .3s, transform .3s;
}
.beat-btn:hover { border-color: var(--line-2); }
.beat.todo .beat-btn { opacity: 0.45; }
.beat.todo .beat-p { display: none; }
.beat.done .beat-p { display: none; }
.beat.on .beat-btn { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.beat.on .beat-p { animation: rise .4s ease-out; }
.beat-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--code-bg); color: var(--muted); }
.beat-ico svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.beat.tone-bad:not(.todo) .beat-ico { background: color-mix(in srgb, var(--wrong) 14%, transparent); color: var(--wrong); }
.beat.tone-good:not(.todo) .beat-ico { background: color-mix(in srgb, var(--strict) 15%, transparent); color: var(--strict); }
.beat.tone-warn:not(.todo) .beat-ico { background: color-mix(in srgb, var(--service) 18%, transparent); color: color-mix(in srgb, var(--service) 70%, var(--ink)); }
.beat.tone-info:not(.todo) .beat-ico { background: var(--accent-soft); color: var(--accent-ink); }
.beat-txt { display: grid; gap: 2px; min-width: 0; }
.beat-k { font: 0.72rem var(--mono); color: var(--muted); }
.beat-txt b { font-weight: 600; }
.beat-p { color: var(--ink-2); font-size: 0.92rem; margin-top: 4px; }

/* ---------- evidence panels ---------- */
.ev-panel { position: sticky; top: 80px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; box-shadow: var(--shadow); min-height: 200px; }
.ev-cites { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 0.8rem; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.ev-cites .muted { margin-right: 4px; }
.cite.on { background: var(--accent); color: #fff; }
.ev-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ev-head .eid { font: 600 0.8rem var(--mono); color: var(--accent-ink); background: var(--accent-soft); padding: 1px 7px; border-radius: 5px; }
.ev-head b { font-weight: 600; }
.ev-tool { font-size: 0.75rem; }
.ev-tabs { margin-left: auto; display: inline-flex; padding: 2px; border: 1px solid var(--line); border-radius: 8px; }
.ev-tabs button { font: 600 0.75rem var(--sans); border: 0; background: none; color: var(--muted); padding: 3px 9px; border-radius: 6px; cursor: pointer; }
.ev-tabs button[aria-pressed="true"] { background: var(--code-bg); color: var(--ink); }
.ev-args { font: 0.76rem var(--mono); color: var(--muted); margin-top: 6px; overflow-wrap: anywhere; }
.ev-body { margin-top: 12px; font-size: 0.86rem; }
.ev-body pre { margin: 0; white-space: pre; overflow-x: auto; font-size: 0.75rem; line-height: 1.55; background: var(--code-bg); padding: 12px; border-radius: 9px; }
.ev-sum { color: var(--muted); font-size: 0.8rem; margin-bottom: 8px; }
.ev-sub { color: var(--muted); font-size: 0.75rem; margin: 12px 0 4px; font-family: var(--mono); }
.ev-empty { padding: 18px; text-align: center; color: var(--muted); background: var(--code-bg); border-radius: 9px; font-size: 0.85rem; }
.ev-row { display: grid; align-items: center; gap: 10px; padding: 7px 4px; border-top: 1px solid var(--line); opacity: 0; animation: rise .35s ease-out forwards; animation-delay: calc(var(--i, 0) * 45ms); }
.ev-row:first-of-type { border-top: 0; }
.ev-row code { background: none; padding: 0; overflow-wrap: anywhere; }
.ev-row .r { text-align: right; font: 0.78rem var(--mono); color: var(--muted); white-space: nowrap; }
.ev-th { font: 600 0.66rem var(--mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); opacity: 1; animation: none; }
.ev-health, .ev-th { grid-template-columns: minmax(84px, 1fr) 96px minmax(80px, 1.3fr) 58px; }
.ev-health.dim { color: var(--muted); }
.ev-meter { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ev-meter .v { font: 0.78rem var(--mono); min-width: 42px; text-align: right; }
.trk { flex: 1; height: 6px; border-radius: 3px; background: var(--code-bg); overflow: hidden; }
.trk i, .sp-bar i { display: block; height: 100%; border-radius: 3px; animation: grow .8s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--i, 0) * 45ms + .1s); }
@keyframes grow { from { width: 0; } }
i.ok { background: var(--strict); } i.bad { background: var(--wrong); } i.warn { background: var(--service); }
.pill.ok { background: color-mix(in srgb, var(--strict) 14%, transparent); color: var(--strict); }
.pill.bad { background: color-mix(in srgb, var(--wrong) 14%, transparent); color: var(--wrong); }
.pill.warn { background: color-mix(in srgb, var(--service) 20%, transparent); color: color-mix(in srgb, var(--service) 65%, var(--ink)); }
.pill.off { background: var(--code-bg); color: var(--muted); }
.ev-row .pill { justify-self: start; text-transform: none; letter-spacing: 0; font-family: var(--sans); font-size: 0.72rem; }
.ev-diff { font: 0.8rem/1.5 var(--mono); }
.ev-diff .ev-row { display: block; padding: 4px 0; }
.ev-hunk { color: var(--accent-ink); padding: 2px 0 4px; }
.ev-hunk span { opacity: .7; }
.ev-diff .dl { padding-right: 8px; border-radius: 4px; }
.ev-tpl { grid-template-columns: 48px minmax(60px, 1fr) minmax(0, 1.4fr); }
.ev-count { font: 600 0.82rem var(--mono); text-align: right; }
.ev-log { grid-template-columns: 52px 76px minmax(0, 1fr); font-size: 0.8rem; }
.lvl { font: 600 0.68rem var(--mono); }
.lvl.error { color: var(--wrong); } .lvl.warn { color: var(--service); } .lvl.info { color: var(--muted); }
.ev-alert { grid-template-columns: auto 1fr; align-items: start; }
.ev-desc { color: var(--muted); font-size: 0.82rem; }
.ev-span { grid-template-columns: minmax(0, 1.5fr) minmax(50px, 1fr) 64px; font-size: 0.78rem; padding: 4px; }
.sp-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); }
.sp-name b { font-weight: 600; }
.sp-bar { height: 8px; border-radius: 3px; background: var(--code-bg); overflow: hidden; }
.ev-kv { grid-template-columns: 130px minmax(0, 1fr); }
.ev-kv.hl, .ev-flag.hl { background: color-mix(in srgb, var(--service) 14%, transparent); border-radius: 6px; }
.ev-kv.hl code { font-weight: 600; }
.ev-flag { grid-template-columns: minmax(0, 1.3fr) 48px minmax(0, 1.5fr); font-size: 0.82rem; }
.ev .cited { font-size: 0.8rem; color: var(--muted); margin: 12px 0 0; }
.st.confirmed { color: var(--strict); }

/* ---------- all tool calls ---------- */
.all-calls { margin-top: 28px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.all-calls > summary { cursor: pointer; padding: 14px 18px; font-weight: 600; list-style: none; }
.all-calls > summary::-webkit-details-marker { display: none; }
.all-calls > summary::before { content: "▸"; display: inline-block; margin-right: 8px; color: var(--muted); transition: transform .15s; }
.all-calls[open] > summary::before { transform: rotate(90deg); }
.all-calls .replay { padding: 4px 18px 18px; }
.all-calls .inspector { box-shadow: none; }

@media (max-width: 900px) {
  .story { grid-template-columns: minmax(0, 1fr); }
  .ev-panel { position: static; }
}
@media (max-width: 640px) {
  .diff-card { font-size: 0.74rem; }
  .ev-health, .ev-th { grid-template-columns: minmax(70px, 1fr) 84px minmax(60px, 1fr); }
  .ev-health .r, .ev-th .r { display: none; }
  .ev-log { grid-template-columns: 48px minmax(0, 1fr); }
  .ev-log code { display: none; }
  .ev-kv { grid-template-columns: 104px minmax(0, 1fr); }
  .ev-panel { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition: none !important; }
}
.pill { font: 600 0.68rem var(--mono); text-transform: uppercase; letter-spacing: 0.08em; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.chip { display: inline-block; font: 600 0.72rem var(--mono); color: var(--accent-ink); background: var(--accent-soft); border-radius: 5px; padding: 0 6px; margin-left: 4px; }
.ev-row .pill { text-transform: none; letter-spacing: 0; font-family: var(--sans); font-size: 0.72rem; justify-self: start; }
@media (max-width: 900px) {
  .beats .ev-panel { margin-top: 8px; box-shadow: none; animation: rise .35s ease-out; }
}

/* ---------- case study ---------- */
.prose { max-width: 760px; padding-top: 56px; padding-bottom: 72px; }
.prose h1 { font-size: clamp(2rem, 4.2vw, 3rem); line-height: 1.1; margin: 10px 0 18px; }
.prose h2 { font-size: clamp(1.35rem, 2.4vw, 1.75rem); margin: 44px 0 12px; }
.prose p, .prose li { color: var(--ink-2); line-height: 1.65; }
.prose .lede { font-size: 1.15rem; color: var(--ink); }
.prose ul { padding-left: 1.2em; }
.prose li { margin: 0 0 12px; }
.prose li b { color: var(--ink); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 28px 0 8px; }
.facts div { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.facts dt { font: 600 0.7rem/1.4 "IBM Plex Mono", monospace; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 4px 0 0; color: var(--ink); font-size: 0.92rem; line-height: 1.45; }
.prose .links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 36px; }
.prose .small { font-size: 0.85rem; }
.prose .muted { color: var(--muted); }

/* ---------- your stack: where Pager sits ---------- */
.hub { display: grid; grid-template-columns: minmax(0, 1fr) 56px minmax(0, 1.25fr) 56px minmax(0, 1fr); align-items: center; gap: 0; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 26px 22px; }
.hub ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.hub-h { margin: 0 0 10px; font: 600 0.68rem var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.ci { font-size: 0.86rem; padding: 7px 11px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--paper); color: var(--ink); }
.ci.docs { border-style: dashed; color: var(--muted); background: transparent; }
.hub-core { display: flex; flex-direction: column; align-items: stretch; }
.core { display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: 12px; border: 2px solid var(--accent); background: var(--accent-soft); animation: core-glow 2.8s ease-in-out infinite; }
.core .mark { width: 34px; height: 34px; flex: none; }
.core b { display: block; font-family: var(--mono); font-size: 0.98rem; }
.core span { font-size: 0.82rem; color: var(--ink-2); }
.reads { grid-template-columns: 1fr; }
.reads .ci { font-size: 0.82rem; }
.wire { height: 2px; margin: 0 8px; border-radius: 2px; background: repeating-linear-gradient(90deg, var(--accent) 0 7px, transparent 7px 14px); background-size: 14px 2px; animation: wire-x 0.9s linear infinite; }
.wire.up { width: 2px; height: 30px; margin: 10px auto; background: repeating-linear-gradient(0deg, var(--muted) 0 6px, transparent 6px 12px); background-size: 2px 12px; animation: wire-up 0.9s linear infinite; }
@keyframes wire-x { from { background-position: 0 0; } to { background-position: 14px 0; } }
@keyframes wire-y { from { background-position: 0 0; } to { background-position: 0 14px; } }
@keyframes wire-up { from { background-position: 0 12px; } to { background-position: 0 0; } }
@keyframes core-glow { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 0%, transparent); } 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 16%, transparent); } }
.hub-legend { margin: 14px 0 34px; }
/* desktop: alerts and reports meet the pager box, not the middle of the read list */
@media (min-width: 901px) {
  .hub { align-items: start; }
  .hub > .wire { margin-top: 46px; }
  .hub-col .hub-h { height: 18px; margin-bottom: 10px; }
}
.ci-key { display: inline-block; width: 22px; height: 12px; border-radius: 4px; border: 1px solid var(--line-2); background: var(--paper); vertical-align: -1px; }
.ci-key.docs { border-style: dashed; background: transparent; }
.setup { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.setup-code pre { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; font-size: 0.8rem; line-height: 1.6; overflow-x: auto; color: var(--ink-2); }
.setup-code pre.cmd { margin-top: 10px; background: var(--ink); color: var(--paper); border-color: var(--ink); }
.setup-points { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.setup-points article { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.setup-points h3 { margin: 0 0 6px; font-size: 0.95rem; }
.setup-points p { margin: 0; color: var(--muted); font-size: 0.88rem; }
.cta .actions { display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 900px) {
  .hub { grid-template-columns: minmax(0, 1fr); padding: 20px 16px; }
  .hub .wire { width: 2px; height: 28px; margin: 12px auto; background: repeating-linear-gradient(180deg, var(--accent) 0 7px, transparent 7px 14px); background-size: 2px 14px; animation: wire-y 0.9s linear infinite; }
  .hub .wire.up { background: repeating-linear-gradient(0deg, var(--muted) 0 6px, transparent 6px 12px); background-size: 2px 12px; animation: wire-up 0.9s linear infinite; }
  .hub ul { grid-template-columns: repeat(2, 1fr); }
  .setup, .setup-points { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) { .hub ul, .reads { grid-template-columns: 1fr; } }

/* ---------- architecture: traffic moves along the links ---------- */
.flow .links path { stroke-dasharray: 6 5; animation: flow-dash 1.1s linear infinite; }
.flow .boxes rect.hl { animation: hl-pulse 2.6s ease-in-out infinite; }
@keyframes flow-dash { to { stroke-dashoffset: -22; } }
@keyframes hl-pulse { 0%, 100% { stroke-width: 2; } 50% { stroke-width: 3.5; } }

/* ---------- phones: keep model names on one line in result tables ---------- */
@media (max-width: 640px) { .results .cfg b { white-space: nowrap; font-size: 0.82rem; } }

/* everything above that moves stops for people who asked for less motion */
@media (prefers-reduced-motion: reduce) {
  .wire, .hub .wire, .core, .flow .links path, .flow .boxes rect.hl { animation: none !important; }
}

/* roadmap */
.setup-points.road { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .setup-points.road { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .setup-points.road { grid-template-columns: minmax(0, 1fr); } }
