/* Layout: one reading column (~66ch) under a slim masthead; figures break out to a wider
   measure. Plain-text-file motifs (paths, directives) are the subject's own vernacular. */
:root {
  --paper: #f3f5f8;
  --surface: #ffffff;
  --ink: #12151a;
  --ink-2: #434a56;
  --muted: #687080;
  --rule: #dde2e9;
  --rule-strong: #c3cad4;
  --wash: #e8ecf2;
  --c-training: #eb6834;
  --c-search: #2a78d6;
  --c-assist: #1baf7a;
  --c-custom: #2a78d6;
  --c-shopify: #1baf7a;
  --c-wp: #4a3aa7;
  --c-wix: #e87ba4;
  --c-sale: #eda100;
  --c-none: #9aa2ad;
  --up: #0f6b3a;
  --focus: #2a78d6;
  --font-display: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Newsreader", Georgia, "Times New Roman", serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --measure: 40rem;
  --wide: 68rem;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0e1116; --surface: #161a21; --ink: #eef1f5; --ink-2: #b9c0cc; --muted: #8d95a3;
    --rule: #262c36; --rule-strong: #3a4250; --wash: #1d222b;
    --c-training: #d95926; --c-search: #3987e5; --c-assist: #199e70;
    --c-custom: #3987e5; --c-shopify: #199e70; --c-wp: #9085e9; --c-wix: #d55181; --c-sale: #c98500; --c-none: #6b7380;
    --up: #3fbf6f; --focus: #6da7ec;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0e1116; --surface: #161a21; --ink: #eef1f5; --ink-2: #b9c0cc; --muted: #8d95a3;
  --rule: #262c36; --rule-strong: #3a4250; --wash: #1d222b;
  --c-training: #d95926; --c-search: #3987e5; --c-assist: #199e70;
  --c-custom: #3987e5; --c-shopify: #199e70; --c-wp: #9085e9; --c-wix: #d55181; --c-sale: #c98500; --c-none: #6b7380;
  --up: #3fbf6f; --focus: #6da7ec;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body {
  background: var(--paper); color: var(--ink);
  font-family: var(--font-body); font-size: 1.125rem; line-height: 1.6;
  padding-inline: 16px; padding-block: 0 4rem;
}
a { color: inherit; text-decoration-color: var(--rule-strong); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; line-height: 1.12; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
code, .mono { font-family: var(--font-mono); font-size: 0.86em; }
.wrap { max-width: var(--wide); margin-inline: auto; }
.col { max-width: var(--measure); }

/* masthead */
.mast {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10;
  margin-inline: -16px; padding: 10px 16px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule);
}
.mast .wrap { display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap; }
.brand { font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; text-decoration: none; letter-spacing: -0.02em; }
.brand span { color: var(--c-search); }
.asof { font-family: var(--font-display); font-size: 0.82rem; color: var(--muted); }
.mast nav { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.btn {
  font-family: var(--font-display); font-weight: 600; font-size: 0.86rem;
  border: 1px solid var(--rule-strong); background: var(--surface); color: var(--ink);
  padding: 6px 12px; border-radius: 999px; text-decoration: none; cursor: pointer;
}
.btn:hover { border-color: var(--ink-2); }
.btn.primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.proto-note {
  font-family: var(--font-display); font-size: 0.82rem; color: var(--ink-2);
  border: 1px dashed var(--rule-strong); border-radius: 8px; padding: 8px 12px; margin-top: 18px;
}

/* hero */
.hero { padding-block: 2.6rem 1.4rem; display: grid; gap: 14px; }
.hero h1 { font-size: clamp(2.1rem, 5.4vw, 3.6rem); font-weight: 800; max-width: 16ch; letter-spacing: -0.025em; }
.hero p { font-size: 1.22rem; color: var(--ink-2); max-width: 38rem; }

/* section scaffolding */
.eyebrow {
  font-family: var(--font-display); font-weight: 700; font-size: 0.74rem;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.block { padding-block: 2.4rem; border-top: 1px solid var(--rule); display: grid; gap: 18px; }
.block > h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); font-weight: 800; max-width: 26ch; }
.lede { font-size: 1.15rem; color: var(--ink-2); max-width: var(--measure); }
.prose { display: grid; gap: 14px; max-width: var(--measure); }
.sowhat {
  max-width: var(--measure); font-size: 1.05rem; padding: 14px 16px; border-radius: 10px;
  background: var(--wash);
}
.sowhat b { font-family: var(--font-display); font-weight: 700; }
.fine { font-family: var(--font-display); font-size: 0.8rem; color: var(--muted); line-height: 1.5; max-width: var(--measure); }

/* pulse */
.pulse { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.tile {
  background: var(--surface); border: 1px solid var(--rule); border-radius: 12px;
  padding: 16px; display: grid; gap: 8px; align-content: start; min-width: 0;
}
.tile .label { font-family: var(--font-display); font-weight: 600; font-size: 0.86rem; color: var(--ink-2); }
.tile .big { font-family: var(--font-display); font-weight: 800; font-size: 2.6rem; line-height: 1; letter-spacing: -0.03em; }
.tile .pop { font-family: var(--font-display); font-size: 0.86rem; color: var(--ink-2); line-height: 1.4; }
.tile .chg {
  font-family: var(--font-display); font-size: 0.8rem; color: var(--muted); line-height: 1.45;
  border-top: 1px solid var(--rule); padding-top: 8px; margin-top: 2px;
}
.delta { font-weight: 700; color: var(--up); font-variant-numeric: tabular-nums; }
.changes { display: grid; gap: 6px; padding: 0; margin: 0; list-style: none; font-size: 1.02rem; max-width: var(--measure); }
.changes li { padding-left: 1.2em; position: relative; }
.changes li::before { content: "↗"; position: absolute; left: 0; color: var(--up); font-family: var(--font-display); }
.changes li.down::before { content: "↘"; color: var(--muted); }
.tile .chg.flag { color: var(--ink-2); }
.switch { margin-top: 18px; display: grid; gap: 10px; }
.switch h3 { font-size: 1.25rem; font-weight: 800; margin: 0; }
.switch p { margin: 0; max-width: var(--measure); }
.switch-rows { display: grid; gap: 8px; }
.switch-rows .row { display: grid; grid-template-columns: minmax(8rem, 13rem) 1fr 3.6rem; gap: 10px; align-items: center; }
.switch-rows .lab { font-family: var(--font-display); font-size: 0.86rem; color: var(--ink-2); }
.switch-rows .track { height: 22px; background: var(--wash); border-radius: 6px; overflow: hidden; }
.switch-rows .fill { display: block; height: 100%; min-width: 2px; background: var(--c-training); }
.switch-rows .val { font-family: var(--font-display); font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
@media (max-width: 520px) { .switch-rows .row { grid-template-columns: 1fr 3.6rem; } .switch-rows .lab { grid-column: 1 / -1; } }

/* quiz */
.quiz { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.q {
  background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: 16px;
  display: grid; gap: 12px; align-content: start; min-width: 0;
}
.q h3 { font-size: 1.08rem; font-weight: 700; line-height: 1.3; }
.q .num { font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); }
.choices { display: grid; gap: 6px; }
.choice {
  font-family: var(--font-display); font-size: 0.92rem; text-align: left;
  border: 1px solid var(--rule-strong); background: var(--paper); color: var(--ink);
  padding: 9px 12px; border-radius: 8px; cursor: pointer;
}
.choice:hover:not(:disabled) { border-color: var(--ink-2); }
.choice:disabled { cursor: default; }
.choice.right { border-color: var(--up); box-shadow: inset 3px 0 0 var(--up); }
.choice.picked:not(.right) { border-color: var(--c-training); box-shadow: inset 3px 0 0 var(--c-training); }
.reveal { font-family: var(--font-display); font-size: 0.92rem; line-height: 1.45; color: var(--ink-2); }
.reveal strong { color: var(--ink); }
.slider-row { display: grid; gap: 6px; font-family: var(--font-display); font-size: 0.9rem; }
.slider-row output { font-weight: 800; font-size: 1.5rem; }
input[type=range] { width: 100%; accent-color: var(--c-search); }
.guessbar { position: relative; height: 26px; border-radius: 6px; background: var(--wash); margin-top: 4px; }
.guessbar .fill { position: absolute; inset: 0 auto 0 0; background: var(--c-shopify); border-radius: 6px 4px 4px 6px; }
.guessbar .mark { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); }

/* figures */
figure { margin: 0; display: grid; gap: 10px; min-width: 0; }
figcaption { font-family: var(--font-display); font-size: 0.82rem; color: var(--muted); line-height: 1.45; max-width: var(--measure); }
.panel { background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: 16px; min-width: 0; }
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-svg text { font-family: var(--font-display); fill: var(--muted); font-size: 11px; }
.chart-svg .val { fill: var(--ink); font-weight: 700; font-size: 12px; }
.chart-svg .grid { stroke: var(--rule); stroke-width: 1; }
.chart-svg .base { stroke: var(--rule-strong); stroke-width: 1; }
.tip {
  position: fixed; z-index: 20; pointer-events: none; max-width: 260px;
  font-family: var(--font-display); font-size: 0.8rem; line-height: 1.4;
  background: var(--ink); color: var(--paper); padding: 8px 10px; border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,.18);
}
details.numbers { font-family: var(--font-display); font-size: 0.85rem; max-width: var(--measure); }
details.numbers summary { cursor: pointer; color: var(--ink-2); }
.tablewrap { overflow-x: auto; margin-top: 8px; }
table { border-collapse: collapse; font-variant-numeric: tabular-nums; width: 100%; }
th, td { text-align: right; padding: 4px 10px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }

/* file mockups */
.files { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 12px; }
.file { background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; min-width: 0; display: grid; align-content: start; }
.file .path { font-family: var(--font-mono); font-size: 0.8rem; padding: 8px 12px; border-bottom: 1px solid var(--rule); color: var(--ink-2); display: flex; justify-content: space-between; gap: 8px; }
.file pre { margin: 0; padding: 12px; font-family: var(--font-mono); font-size: 0.8rem; line-height: 1.6; overflow-x: auto; color: var(--ink); }
.file pre .c { color: var(--muted); }
.file pre .k { color: var(--c-search); font-weight: 600; }
.file pre .x { color: var(--c-training); font-weight: 600; }
.file .job { font-family: var(--font-display); font-size: 0.88rem; padding: 10px 12px; border-top: 1px solid var(--rule); color: var(--ink-2); }

/* bands chart */
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-family: var(--font-display); font-size: 0.82rem; color: var(--ink-2); }
.legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }

/* zoo */
.famchips { display: flex; flex-wrap: wrap; gap: 6px; }
.famchip {
  font-family: var(--font-display); font-size: 0.82rem; border: 1px solid var(--rule-strong);
  background: var(--surface); color: var(--ink); border-radius: 999px; padding: 4px 10px 4px 8px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.famchip[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.famchip .sw { width: 10px; height: 10px; border-radius: 50%; }
.famchip .n { color: var(--muted); font-variant-numeric: tabular-nums; }
#zoo-canvas { width: 100%; display: block; cursor: crosshair; touch-action: pan-y; }
.zoo-detail { font-family: var(--font-display); font-size: 0.9rem; color: var(--ink-2); min-height: 1.5em; }
button.hl {
  font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer;
  font-weight: 600; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px;
}
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.stat { border-left: 2px solid var(--rule-strong); padding-left: 10px; font-family: var(--font-display); }
.stat b { display: block; font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
.stat span { font-size: 0.8rem; color: var(--ink-2); }

/* example cards */
.examples { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.ex { background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: 14px; display: grid; gap: 10px; align-content: start; min-width: 0; }
.ex .kind { font-family: var(--font-display); font-weight: 700; font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; }
.ex .kind.good { color: var(--up); }
.ex .kind.typical { color: var(--c-search); }
.ex .kind.bad { color: var(--c-training); }
.ex .kind.extreme { color: var(--c-wp); }
.ex h3 { font-family: var(--font-mono); font-size: 0.95rem; font-weight: 600; overflow-wrap: anywhere; }
.ex p { font-family: var(--font-display); font-size: 0.86rem; color: var(--ink-2); line-height: 1.45; }
.ex .facts { font-family: var(--font-mono); font-size: 0.74rem; color: var(--muted); }
.meter { position: relative; height: 8px; border-radius: 4px; background: var(--wash); }
.meter i { position: absolute; top: -3px; width: 3px; height: 14px; border-radius: 2px; background: var(--ink); }
.meter-scale { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 0.66rem; color: var(--muted); }
.ticks { display: flex; flex-wrap: wrap; gap: 3px; }
.ticks i { width: 9px; height: 9px; border-radius: 2px; background: var(--c-search); }
.ticks i.h1 { background: var(--ink); width: 22px; }
.ticks em { font-family: var(--font-mono); font-size: 0.7rem; color: var(--muted); font-style: normal; }

/* bots dot plot */
.dotplot .row-label { font-weight: 700; fill: var(--ink); font-size: 13px; }
.dotplot .names { fill: var(--ink-2); font-size: 11.5px; }
.stack { display: flex; height: 38px; gap: 2px; border-radius: 8px; overflow: hidden; }
.stack div { display: flex; align-items: center; padding-inline: 10px; font-family: var(--font-display); font-weight: 700; font-size: 0.9rem; color: #fff; white-space: nowrap; overflow: hidden; }
.stack-key { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-family: var(--font-display); font-size: 0.85rem; color: var(--ink-2); }

/* hall of fame */
.fame { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; }
.fame .card { background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: 14px; display: grid; gap: 8px; align-content: start; min-width: 0; }
.fame .card code { display: block; font-size: 0.86rem; padding: 8px 10px; border-radius: 6px; background: var(--wash); overflow-x: auto; white-space: pre; }
.fame .card h3 { font-size: 1.05rem; font-weight: 700; }
.fame .card p { font-family: var(--font-display); font-size: 0.88rem; color: var(--ink-2); line-height: 1.45; }
.fame .card .host { font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); }

/* lookup */
.lookup { display: grid; gap: 14px; }
.lookup form { display: flex; gap: 8px; flex-wrap: wrap; }
.lookup input[type=text] {
  flex: 1 1 240px; min-width: 0; font-family: var(--font-mono); font-size: 1rem;
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--rule-strong); background: var(--surface); color: var(--ink);
}
.picks { display: flex; flex-wrap: wrap; gap: 6px; font-family: var(--font-display); font-size: 0.85rem; color: var(--muted); align-items: center; }
.picks button { font: inherit; background: none; border: 0; padding: 0; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.result { background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: 16px; display: grid; gap: 14px; min-width: 0; }
.result .who { font-family: var(--font-mono); font-size: 0.82rem; color: var(--muted); }
.result .verdict { font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; line-height: 1.25; text-wrap: balance; }
.chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; }
.chip { font-family: var(--font-display); font-size: 0.84rem; border: 1px solid var(--rule); border-radius: 8px; padding: 6px 10px; display: flex; justify-content: space-between; gap: 8px; }
.chip .st { font-weight: 700; white-space: nowrap; }
.chip .st.s-block { color: var(--c-training); }
.chip .st.s-allow { color: var(--up); }
.chip .st.s-none { color: var(--muted); font-weight: 500; }
.facts-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; font-family: var(--font-display); font-size: 0.88rem; color: var(--ink-2); }
.facts-row div { border-top: 1px solid var(--rule); padding-top: 8px; }
.facts-row b { color: var(--ink); display: block; }

/* explore */
.explore { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.ecard {
  background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: 14px;
  display: grid; gap: 6px; align-content: start; text-decoration: none; min-width: 0;
}
a.ecard:hover { border-color: var(--ink-2); }
.ecard h3 { font-size: 1.05rem; font-weight: 700; }
.ecard p { font-family: var(--font-display); font-size: 0.86rem; color: var(--ink-2); line-height: 1.45; }
.pill { justify-self: start; font-family: var(--font-display); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--rule-strong); color: var(--ink-2); }
.pill.new { border-color: var(--c-search); color: var(--c-search); }

footer.block { font-family: var(--font-display); font-size: 0.88rem; color: var(--ink-2); line-height: 1.55; }
footer ul { margin: 0; padding-left: 1.1em; display: grid; gap: 6px; max-width: var(--measure); }

@media (max-width: 560px) {
  body { font-size: 1.06rem; }
  .asof { order: 3; width: 100%; }
  .mast nav { margin-left: auto; }
  .mast nav .btn:not(.primary) { display: none; }
  .tile .big { font-size: 2.2rem; }
}

/* static-build additions */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.chg.none { font-style: italic; }
.bars { display: grid; gap: 6px; font-family: var(--font-display); font-size: 0.86rem; }
.bars .row { display: grid; grid-template-columns: minmax(7rem, 11rem) 1fr 3.5rem; gap: 8px; align-items: center; }
.bars .track { height: 10px; border-radius: 5px; background: var(--wash); position: relative; overflow: hidden; }
.bars .track i { position: absolute; inset: 0 auto 0 0; border-radius: 5px; background: var(--c-search); }
.bars .v { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.provenance { font-family: var(--font-mono); font-size: 0.74rem; color: var(--muted); overflow-wrap: anywhere; }
