/* Article layout after the multi-harness RL post: a centered hero, a meta row, a table of contents beside one
   reading column. Tokens follow its palette; the --series-* and --surface-* names are the ones lora.js reads. */
:root {
  --page: #ffffff;
  --surface-1: #f9f9f9;
  --surface-2: #f1f1f0;
  --surface-3: #e6e6e4;
  --text-primary: rgba(0, 0, 0, .85);
  --text-secondary: rgba(0, 0, 0, .7);
  --text-muted: rgba(0, 0, 0, .58);
  --border: rgba(0, 0, 0, .1);
  --axis-ink: #8a8a86;
  --accent: rgb(236, 149, 106);
  --fx-accent: rgb(78, 165, 183);
  --series-pi: #2a78d6;
  --series-hermes: #eb6834;
  --series-opencode: #1baf7a;
  --good: rgb(74, 166, 81);
  --bad: rgb(237, 83, 80);
  --code-bg: #f6f8fa;
  --sans: "Source Sans 3", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #0f1115; --surface-1: #15181e; --surface-2: #1b1f26; --surface-3: #262b34;
    --text-primary: rgba(255, 255, 255, .9); --text-secondary: rgba(255, 255, 255, .78); --text-muted: rgba(255, 255, 255, .62);
    --border: rgba(255, 255, 255, .14); --axis-ink: #8f939b; --code-bg: #12151b;
    --series-pi: #3987e5; --series-hermes: #d95926; --series-opencode: #199e70;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --page: #0f1115; --surface-1: #15181e; --surface-2: #1b1f26; --surface-3: #262b34;
  --text-primary: rgba(255, 255, 255, .9); --text-secondary: rgba(255, 255, 255, .78); --text-muted: rgba(255, 255, 255, .62);
  --border: rgba(255, 255, 255, .14); --axis-ink: #8f939b; --code-bg: #12151b;
  --series-pi: #3987e5; --series-hermes: #d95926; --series-opencode: #199e70;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--page); color: var(--text-primary); font: 16px/1.6 var(--sans); }
a { color: inherit; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
code, .mono { font-family: var(--mono); font-size: .86em; }
code { background: var(--code-bg); padding: 1px 5px; border-radius: 4px; }

.theme-toggle { position: absolute; top: 14px; right: 16px; z-index: 10; width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-1); color: var(--text-primary); cursor: pointer; font-size: 15px; }

.hero { padding: 72px 16px 8px; text-align: center; }
/* The multi-harness RL post's title: its font stack, which renders as the system UI font, at weight 800 */
.hero-title { margin: 0 auto 12px; max-width: 1040px; font-family: "Source Sans Pro", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans", sans-serif; font-size: clamp(26px, 3.4vw, 36px); line-height: 1.12; font-weight: 800; letter-spacing: -.02em; text-wrap: balance; }
.hero-title { margin-bottom: 28px; }
.hero-desc { margin: 28px auto 8px; max-width: 55%; font-size: 15px; font-style: italic; color: var(--text-muted); }
@media (max-width: 860px) { .hero-desc { max-width: 90%; } }
.hero-banner { max-width: 1040px; margin: 0 auto; text-align: left; }
.hero-video { display: block; width: 100%; height: auto; border: 1px solid var(--border); border-radius: 12px; background: #fff; }

.meta { max-width: 1040px; margin: 28px auto 0; padding: 14px 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 14px 24px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); font-size: 15px; }
.meta h3 { margin: 0 0 2px; font-size: 12px; font-weight: 400; letter-spacing: .02em; text-transform: uppercase; color: var(--text-muted); }
.meta p { margin: 0; }

.content-grid { max-width: 1040px; margin: 0 auto; padding: 0 16px 96px; display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 48px; }
.toc { position: sticky; top: 24px; align-self: start; margin-top: 72px; max-height: calc(100vh - 48px); overflow-y: auto; overscroll-behavior: contain; font-size: 14px; }
.toc h4 { margin: 0 0 8px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.toc ol { margin: 0; padding: 0; list-style: none; counter-reset: toc; }
.toc li { counter-increment: toc; margin: 6px 0; }
.toc a { text-decoration: none; color: var(--text-muted); }
.toc a::before { content: counter(toc) ". "; }
.toc a:hover, .toc a.on { color: var(--text-primary); }
.toc ol ol { margin: 4px 0 8px 14px; counter-reset: sub; font-size: 13px; }
.toc ol li:not(.open) > ol { display: none; }
.toc ol ol li { counter-increment: sub; margin: 4px 0; }
.toc ol ol a::before { content: counter(toc) "." counter(sub) " "; }
@media (max-width: 860px) {
  .content-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toc { display: none; }
}

main { max-width: 700px; min-width: 0; }
main h2 { margin: 72px 0 28px; padding-bottom: 12px; border-bottom: 1px solid var(--border); font-size: clamp(22px, 2.6vw, 30px); font-weight: 600; line-height: 1.2; }
main h3 { margin: 40px 0 12px; font-size: clamp(18px, 2.1vw, 21px); font-weight: 700; line-height: 1.25; }
main ul { padding-left: 22px; }
main li { margin: 6px 0; }
.tldr { margin: 48px 0 0; padding: 16px 20px; border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 10px; background: var(--surface-1); }
.tldr h4 { margin: 0 0 6px; font-size: 12px; font-weight: 800; letter-spacing: 1.1px; text-transform: uppercase; color: var(--text-muted); }
.tldr ul { margin: 0; }
.note { color: var(--text-muted); font-size: 14px; }

figure { margin: 32px 0; }
figure.wide { margin-left: -40px; margin-right: -40px; }
@media (max-width: 860px) { figure.wide { margin-left: 0; margin-right: 0; } }
figcaption { margin-top: 8px; font-size: 13.5px; color: var(--text-muted); }
figcaption b { color: var(--text-primary); font-weight: 600; }

.table-wrap { overflow-x: auto; margin: 20px 0; border: 1px solid var(--border); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 600; font-size: 13px; color: var(--text-muted); background: var(--surface-1); }
th, td { padding: 8px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-family: var(--mono); font-size: 13px; white-space: nowrap; }

/* Figure cards, as the post's diagrams: a header row, a body, an italic caption strip */
.fx { border: 1px solid var(--border); border-radius: 12px; background: var(--surface-1); overflow: hidden; }
.fx__header { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 13px 18px; border-bottom: 1px solid var(--border); }
.fx__title { margin-right: auto; font-size: 11px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-muted); }
.fx__body { padding: 18px; background: color-mix(in oklab, var(--text-muted) 3%, transparent); }
.fx__caption { padding: 10px 18px; border-top: 1px solid var(--border); font-size: 12.5px; font-style: italic; color: var(--text-muted); }

/* safeagents event and code */
pre.code { margin: 16px 0; padding: 12px 14px; overflow-x: auto; background: var(--code-bg); border: 1px solid var(--border); border-radius: 8px; font: 12.5px/1.55 var(--mono); }
.sa-event { margin: 18px 0; border: 1px solid var(--border); border-left: 4px solid var(--bad); border-radius: 8px; background: var(--surface-1); overflow: hidden; }
.sa-event__head { padding: 8px 14px; font-size: 13px; color: var(--text-muted); border-bottom: 1px solid var(--border); }
.sa-event__tag { color: var(--bad); letter-spacing: .04em; }
.sa-event pre { margin: 0; padding: 10px 14px; overflow-x: auto; font: 12.5px/1.55 var(--mono); white-space: pre-wrap; word-break: break-all; }
.sa-event__notice { padding: 8px 14px; font: 12.5px/1.5 var(--mono); color: var(--bad); background: color-mix(in oklab, var(--bad) 8%, var(--surface-1)); }

/* LoRA diagram (lora.js), in the same card style */
.lora-fx { border: 1px solid var(--border); border-radius: 12px; background: var(--surface-1); overflow: hidden; }
.lora-fx__header { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 13px 18px; border-bottom: 1px solid var(--border); }
.lora-fx__title { margin-right: auto; font-size: 11px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-muted); }
.lora-fx__seg { display: inline-flex; gap: 4px; }
.lora-fx__btn { display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface-1); color: var(--text-primary); font: 600 12px var(--sans); cursor: pointer; }
.lora-fx__btn:hover { border-color: var(--fx-accent); }
.lora-fx__btn.on { border-color: var(--fx-accent); background: color-mix(in oklab, var(--fx-accent) 12%, var(--surface-1)); }
.lora-fx__speed { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; color: var(--text-muted); }
.lora-fx__speed input { width: 90px; accent-color: var(--fx-accent); }
.lora-fx__speed-val { min-width: 32px; text-align: right; font: 11px var(--mono); color: var(--text-primary); }
.lora-fx__body { padding: 14px 10px 6px; background: color-mix(in oklab, var(--text-muted) 3%, transparent); overflow-x: auto; }
.lora-fx__body svg { display: block; width: 100%; min-width: 720px; height: auto; }
.lora-fx__caption { min-height: 3.2em; padding: 10px 18px; border-top: 1px solid var(--border); font-size: 12.5px; font-style: italic; color: var(--text-muted); }
.lora-fx__zone { fill: var(--surface-1); stroke: var(--border); }
.lora-fx__zone-tag { fill: var(--surface-1); stroke: var(--border); }
.lora-fx__zone-label { font: 800 10.5px var(--sans); letter-spacing: 1px; text-transform: uppercase; fill: var(--text-muted); }
.lora-fx__chip-title { font: 600 13px var(--sans); fill: var(--text-primary); }
.lora-fx__chip-sub { font: 11px var(--mono); fill: var(--text-muted); }
.lora-fx__base { fill: var(--surface-3); stroke: var(--border); }
.lora-fx__base-stripe { stroke: var(--surface-2); stroke-width: 5; }
.lora-fx__base-label-bg { fill: var(--surface-1); opacity: .92; }
.lora-fx__base-label { font: 700 12.5px var(--sans); fill: var(--text-primary); }
.lora-fx__hint { font: italic 12px var(--sans); fill: var(--text-muted); }
.lora-fx__packet-label { font: 11px var(--mono); fill: var(--text-secondary); stroke: var(--surface-1); stroke-width: 3px; paint-order: stroke; }
.lora-fx__track { fill: var(--surface-3); }
.lora-fx__value { font: 12px var(--mono); fill: var(--text-primary); }

footer { max-width: 1040px; margin: 0 auto; padding: 24px 16px 48px; border-top: 1px solid var(--border); font-size: 14px; color: var(--text-muted); }
.wide > .lora-fx { margin: 0; }

/* Task browser (tasks.js), after the multi-harness RL post's: task chips, a file tree, the selected file */
.tb-tasks { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tb-chip { appearance: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font: 12px var(--sans); line-height: 1; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--text-muted); }
.tb-chip i { width: 8px; height: 8px; border-radius: 50%; }
.tb-chip:hover { color: var(--text-primary); }
.tb-chip[aria-pressed="true"] { color: var(--text-primary); border-color: var(--text-primary); font-weight: 600; }
.tb-q { margin: 0 0 12px; font-size: 13.5px; color: var(--text-primary); }
.tb-q span { color: var(--text-muted); }
.tb-body { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 12px; align-items: start; }
.tb-tree { border: 1px solid var(--border); border-radius: 10px; padding: 8px 0; background: var(--page); max-height: 420px; overflow: auto; }
.tb-root { padding: 0 10px 6px; font: 600 12px var(--mono); color: var(--text-muted); word-break: break-all; }
.tb-entry { appearance: none; display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 4px 10px; font: 12.5px var(--mono); color: var(--text-secondary); cursor: pointer; }
.tb-entry span { display: block; font-size: 10.5px; color: var(--text-muted); }
.tb-entry:hover { background: var(--surface-2); }
.tb-entry[aria-pressed="true"] { background: color-mix(in oklab, var(--fx-accent) 14%, transparent); color: var(--text-primary); }
.tb-view { border: 1px solid var(--border); border-radius: 10px; background: var(--page); min-width: 0; }
.tb-path { padding: 7px 12px; border-bottom: 1px solid var(--border); font: 12px var(--mono); color: var(--text-muted); }
.tb-file { margin: 0; padding: 12px; max-height: 420px; overflow: auto; font: 12px/1.55 var(--mono); white-space: pre-wrap; word-break: break-word; color: var(--text-primary); }
@media (max-width: 640px) { .tb-body { grid-template-columns: 1fr; } .tb-tree { max-height: 180px; } }

/* Pull figure (hero.js): drawn on the page, in its colors, with no card around it */
.hs { position: relative; overflow: hidden; }
.hs-stage { position: absolute; left: 0; width: 960px; height: 540px; transform-origin: 0 0; color: var(--text-primary); font-family: var(--sans); line-height: 1.2; }
.hs-stage canvas { position: absolute; inset: 0; width: 960px; height: 540px; }
.hs-stage > div, .hs-scene > div { position: absolute; }
.hs-scene { position: absolute; inset: 0; }
.hs-title { left: 0; right: 0; top: 18px; text-align: center; font-size: 30px; font-weight: 700; }
.hs-counters { left: 36px; top: 60px; font: 700 11px var(--sans); letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted); }
.hs-counters b { font: 800 16px var(--sans); letter-spacing: 0; color: var(--text-primary); margin-right: 5px; font-variant-numeric: tabular-nums; }
.hs-counters i { font-style: normal; opacity: .45; margin: 0 8px; }
.hs-counters .hs-accent { color: var(--fx-accent); }
.hs-label { font: 700 10.5px var(--sans); letter-spacing: 1.3px; text-transform: uppercase; color: var(--text-muted); }
.hs-live { color: #e5484d; }
.hs-card { border: 1.5px solid var(--border); border-radius: 10px; background: color-mix(in oklab, var(--surface-1) 70%, transparent); }
.hs-harness { left: 36px; width: 290px; height: 78px; padding: 10px 12px; }
.hs-name { font-size: 19px; font-weight: 700; display: flex; align-items: center; gap: 9px; }
.hs-logo { border-radius: 6px; object-fit: contain; vertical-align: middle; }
.hs-logo[data-h="opencode"] { background: #fff; padding: 2px; border: 1px solid var(--border); }
.hs-sub { font: 12px var(--mono); color: var(--text-muted); margin-top: 1px; }
.hs-tag { position: absolute; right: 12px; top: 12px; font: 600 12px var(--mono); padding: 2px 8px; border-radius: 999px; }
.hs-bars { position: absolute; left: 12px; right: 12px; bottom: 9px; height: 10px; display: flex; gap: 3px; }
.hs-bars i { width: 9px; height: 10px; border-radius: 2px; opacity: .9; }
.hs-server { left: 566px; top: 122px; width: 358px; height: 198px; padding: 12px; }
.hs-base { height: 36px; border-radius: 7px; background: repeating-linear-gradient(90deg, var(--surface-3) 0 9px, var(--surface-2) 9px 14px); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; }
.hs-base span { background: var(--page); padding: 3px 10px; border-radius: 5px; font-weight: 700; font-size: 13.5px; }
.hs-slot { position: absolute; height: 36px; padding: 0 10px; border-radius: 8px; display: flex; flex-direction: column; justify-content: center; border: 1.5px solid; background: var(--page); }
.hs-slot b { font-size: 14px; }
.hs-slot small { font: 11px var(--mono); color: var(--text-muted); }
.hs-trainer { top: 338px; width: 112px; height: 60px; padding: 6px 9px; }
.hs-trainer b { font-size: 13px; display: flex; align-items: center; gap: 5px; }
.hs-trainer small { font: 11px var(--mono); color: var(--text-muted); }
.hs-track { position: absolute; left: 9px; right: 9px; bottom: 7px; height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.hs-fill { height: 100%; width: 0; }
.hs-feed { left: 36px; right: 36px; height: 54px; border-radius: 9px; padding: 6px 14px 6px 13px; border: 1.5px solid var(--border); border-left: 5px solid var(--c) !important; }
.hs-who { font-size: 15px; font-weight: 700; }
.hs-who span { font-weight: 400; color: var(--text-muted); margin-left: 6px; }
.hs-what { font: 500 17px var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 640px; }
.hs-badge { position: absolute; right: 12px; top: 8px; font: 700 12px/1.2 var(--mono); letter-spacing: 1px; padding: 3px 12px; border-radius: 999px; color: #fff; }
.hs-note { position: absolute; right: 14px; bottom: 7px; font: 12px var(--mono); color: var(--c); }
.hs-ckpt { left: 36px; width: 250px; height: 30px; padding: 0 10px; display: flex; align-items: center; justify-content: space-between; font-size: 14px; font-weight: 600; border-radius: 8px; }
.hs-ckpt span { display: flex; align-items: center; gap: 6px; }
.hs-ckpt small { font: 11px var(--mono); color: var(--text-muted); font-weight: 400; }
.hs-score { position: absolute; height: 26px; display: flex; align-items: center; gap: 8px; font: 600 13px var(--mono); }
.hs-bar { height: 8px; border-radius: 4px; background: var(--surface-3); width: 110px; overflow: hidden; }
.hs-bar i { display: block; height: 100%; width: 0; }
.hero-scene { max-width: 860px; margin: 0 auto; }
.hs-guard { transform: rotate(-90deg); transform-origin: 0 0; white-space: nowrap; color: var(--fx-accent); background: var(--page); padding: 0 6px; }
.hs-guard-note { font: 11px/1.35 var(--mono); color: var(--text-muted); text-align: right; }

/* Task-type timeline: one trajectory, the patterns each detector reads off it */
.tt { overflow-x: auto; }
.tt svg { display: block; width: 100%; min-width: 640px; height: auto; }
.tt-top { font: 600 13px var(--sans); fill: var(--text-primary); }
.tt-sub { font: 11px var(--mono); }
.tt-lab { font: 600 12.5px var(--sans); }

.hf-chip { display: inline-flex; align-items: center; gap: 9px; padding: 2px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-1); color: var(--text-primary); text-decoration: none; white-space: nowrap; }
.hf-chip:hover { border-color: var(--text-muted); }
