/* BlueHour Stress Test. One stylesheet, no framework. */

@font-face { font-family: 'Plex'; src: url('/assets/fonts/ibm-plex-sans-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Plex'; src: url('/assets/fonts/ibm-plex-sans-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Plex'; src: url('/assets/fonts/ibm-plex-sans-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Serif4'; src: url('/assets/fonts/source-serif-4-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Serif4'; src: url('/assets/fonts/source-serif-4-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }

:root {
  color-scheme: light;
  --night: #0a1424;
  --night-2: #13233d;
  --ink: #14213a;
  --text-2: #43506a;
  --muted: #5b6880;
  --steel: #245a8f;
  --steel-dark: #1b4670;
  --dawn: #9cbde6;
  --paper: #f4f6f9;
  --surface: #ffffff;
  --band: #e6ebf2;
  --rule: #d3dbe6;
  --rule-strong: #b5c1d1;
  --focus: #1e66c8;

  /* status: reserved for state, always paired with a label */
  --good: #0ca30c;
  --good-text: #0b6e0b;
  --warning: #fab219;
  --warning-text: #7a5300;
  --serious: #ec835a;
  --critical: #d03b3b;
  --critical-text: #a32424;
  --info: #2a78d6;

  /* comparison series, validated for CVD separation */
  --series-timely: #2a78d6;
  --series-delayed: #eb6834;
  --series-none: #6250d6;

  --serif: 'Serif4', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --sans: 'Plex', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --mono-num: 'Plex', system-ui, sans-serif;

  --wrap: 1180px;
  --gutter: 24px;
  --radius: 6px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-feature-settings: 'tnum' 0;
  overflow-x: hidden;
}
img, svg { max-width: 100%; }
figure { margin: 0; }
a { color: var(--steel); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--steel-dark); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
.num { font-variant-numeric: tabular-nums; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; color: var(--ink); line-height: 1.15; letter-spacing: -0.012em; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.1rem, 4.6vw, 3.35rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); }
h3 { font-size: 1.3rem; line-height: 1.25; }
h4 { font-family: var(--sans); font-size: 1rem; font-weight: 600; margin: 0 0 0.4em; }
p { margin: 0 0 1em; }
.lede { font-size: 1.2rem; line-height: 1.55; color: var(--text-2); max-width: 62ch; }
.prose { max-width: 68ch; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li { margin-bottom: 0.35em; }
.small { font-size: 0.9rem; }
.muted { color: var(--muted); }
strong { font-weight: 600; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: 72px 0; }
.section + .section { border-top: 1px solid var(--rule); }
.section--band { background: var(--surface); }
.section--night { background: var(--night); color: #e8eef7; }
.section--night h2, .section--night h3 { color: #fff; }
.section--night .lede, .section--night p { color: #c9d5e6; }
.section--night a { color: var(--dawn); }
.section--night a.btn, .section--night a.btn:hover { color: #fff; }
.section--night :focus-visible { outline-color: var(--dawn); }

.skip { position: absolute; left: -9999px; top: 0; z-index: 100; background: #fff; color: var(--ink); padding: 10px 14px; }
.skip:focus { left: 12px; top: 12px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- header ---------- */
.site-header { background: var(--night); color: #fff; position: sticky; top: 0; z-index: 50; }
.site-header :focus-visible { outline-color: var(--dawn); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 64px; }
.brand { display: flex; align-items: baseline; gap: 8px; color: #fff; text-decoration: none; font-family: var(--serif); font-size: 1.25rem; font-weight: 600; white-space: nowrap; }
.brand span { color: var(--dawn); font-weight: 400; }
.brand:hover { color: #fff; }
.nav ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; }
.nav a { display: block; padding: 8px 10px; color: #d6e2f2; text-decoration: none; font-size: 0.93rem; border-radius: 4px; }
.nav a:hover { color: #fff; background: var(--night-2); }
.nav a[aria-current="page"] { color: #fff; box-shadow: inset 0 -2px 0 var(--dawn); border-radius: 0; }
.nav .nav-cta a { border: 1px solid var(--dawn); color: #fff; margin-left: 6px; }
.menu-toggle { display: none; background: none; border: 1px solid #45597a; color: #fff; font: inherit; font-size: 0.95rem; padding: 8px 14px; border-radius: 4px; cursor: pointer; }

@media (max-width: 1080px) {
  .menu-toggle { display: inline-block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 64px; background: var(--night); border-top: 1px solid #22344f; padding: 8px var(--gutter) 20px; }
  .nav.open { display: block; }
  .nav ul { flex-direction: column; gap: 0; }
  .nav a { padding: 12px 4px; font-size: 1.05rem; border-bottom: 1px solid #1d2e48; border-radius: 0; }
  .nav a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--dawn); padding-left: 12px; }
  .nav .nav-cta a { margin: 12px 0 0; border-radius: 4px; text-align: center; }
}

.disclosure { background: var(--band); border-bottom: 1px solid var(--rule); font-size: 0.88rem; color: var(--text-2); }
.disclosure p { margin: 0; padding: 8px 0; display: flex; gap: 10px; align-items: center; }
.disclosure svg { flex: none; }

/* ---------- buttons and controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 500; font-size: 1rem; line-height: 1.2; padding: 12px 20px; border-radius: var(--radius); border: 1px solid var(--steel); background: var(--steel); color: #fff; text-decoration: none; cursor: pointer; min-height: 44px; }
.btn:hover { background: var(--steel-dark); border-color: var(--steel-dark); color: #fff; text-decoration: none; }
.btn--ghost { background: transparent; color: var(--steel); }
.btn--ghost:hover { background: #e9f0f8; color: var(--steel-dark); }
.section--night .btn--ghost, .hero .btn--ghost { color: #fff; border-color: var(--dawn); }
.section--night .btn--ghost:hover, .hero .btn--ghost:hover { background: var(--night-2); }
.hero .btn, .section--night .btn { }
.btn--small { padding: 8px 14px; font-size: 0.92rem; min-height: 36px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

label { font-weight: 500; }
input[type="text"], input[type="email"], select, textarea {
  font: inherit; font-size: 1rem; color: var(--ink); background: #fff; width: 100%;
  border: 1px solid var(--rule-strong); border-radius: 4px; padding: 10px 12px; min-height: 44px;
}
textarea { min-height: 140px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--focus); }
input[type="range"] { width: 100%; accent-color: var(--steel); min-height: 32px; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { font-weight: 600; padding: 0; margin-bottom: 8px; }

.choice { position: relative; display: block; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice .choice-body { display: block; border: 1px solid var(--rule-strong); border-radius: var(--radius); background: #fff; padding: 14px 16px; cursor: pointer; height: 100%; }
.choice:hover .choice-body { border-color: var(--steel); }
.choice input:checked + .choice-body { border-color: var(--steel); box-shadow: inset 0 0 0 2px var(--steel); background: #f3f7fc; }
.choice input:focus-visible + .choice-body { outline: 3px solid var(--focus); outline-offset: 2px; }
.choice-title { display: block; font-weight: 600; }
.choice-meta { display: block; font-size: 0.9rem; color: var(--muted); margin-top: 2px; }
.choice input:checked + .choice-body .choice-title::after { content: ' (selected)'; font-weight: 400; font-size: 0.85rem; color: var(--steel); }

.check { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.check input { width: 20px; height: 20px; margin: 3px 0 0; accent-color: var(--steel); }
.check .check-title { font-weight: 600; display: block; }
.check .check-text { display: block; font-size: 0.92rem; color: var(--text-2); }
.check .check-meta { display: block; font-size: 0.85rem; color: var(--muted); margin-top: 2px; }

/* ---------- hero ---------- */
.hero { background: var(--night); color: #e8eef7; padding: 56px 0 64px; position: relative; overflow: hidden; }
.hero h1 { color: #fff; max-width: 16ch; }
.hero .lede { color: #c9d5e6; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 48px; align-items: center; }
.hero-tag { font-family: var(--serif); font-size: 1.35rem; color: var(--dawn); margin: 0 0 20px; }
.hero-figure { background: #0f1c31; border: 1px solid #22344f; border-radius: 8px; padding: 16px; }
.hero-figure figcaption { font-size: 0.9rem; color: #b6c4d8; margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; }
.hero-figure .btn--ghost { color: #fff; border-color: #45597a; }
.hero-clock { font-variant-numeric: tabular-nums; color: #fff; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; gap: 32px; } .hero h1 { max-width: none; } }

.principles { display: flex; flex-wrap: wrap; gap: 6px 28px; font-family: var(--serif); font-size: 1.1rem; color: #c9d5e6; margin-top: 28px; }

/* ---------- content blocks ---------- */
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
.split-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
@media (max-width: 860px) { .split, .split-3 { grid-template-columns: 1fr; } }

.event-class { border-top: 4px solid var(--steel); background: #fff; padding: 28px 28px 24px; border-radius: 0 0 var(--radius) var(--radius); box-shadow: 0 1px 0 var(--rule); }
.event-class--bp { border-top-color: var(--night); }
.event-class .glyph { font-family: var(--serif); font-size: 3.4rem; line-height: 1; color: var(--steel); margin-bottom: 10px; }
.event-class--bp .glyph { color: var(--night); }
.event-class--ls { border-top-color: var(--warning-text); }
.event-class--ls .glyph { color: var(--warning-text); }
.split-3 .event-class { padding: 24px 22px 20px; }
.split-3 .event-class h3 { font-size: 1.4rem; }
.event-class h3 { font-size: 1.6rem; }
.event-class .q { font-family: var(--serif); font-size: 1.2rem; line-height: 1.4; }
.event-class dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; font-size: 0.95rem; margin: 16px 0 0; }
.event-class dt { color: var(--muted); }
.event-class dd { margin: 0; }

.statement { font-family: var(--serif); font-size: clamp(1.35rem, 2.6vw, 1.85rem); line-height: 1.35; max-width: 34ch; color: var(--ink); margin: 0; }
.section--night .statement { color: #fff; }

.chain { list-style: none; padding: 0; margin: 24px 0 0; display: flex; flex-wrap: wrap; gap: 0; counter-reset: chain; }
.chain { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.chain li { padding: 10px 0 0; border-top: 3px solid var(--rule-strong); font-weight: 500; }
.chain li:last-child { border-top-color: var(--critical); }
.chain li span { display: block; font-size: 0.85rem; font-weight: 400; color: var(--muted); }

.concepts { display: grid; gap: 0; border-top: 1px solid var(--rule); }
.concept { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; padding: 22px 0; border-bottom: 1px solid var(--rule); }
.concept h3 { font-size: 1.15rem; margin: 0; }
.concept .role { display: block; font-family: var(--sans); font-size: 0.88rem; font-weight: 400; color: var(--muted); margin-top: 4px; }
@media (max-width: 720px) { .concept { grid-template-columns: 1fr; gap: 6px; } }

.callout { border-left: 3px solid var(--steel); padding: 4px 0 4px 18px; margin: 24px 0; color: var(--text-2); }
.caveat { border-left: 3px solid var(--warning); background: #fff8e6; padding: 12px 16px; margin: 16px 0; font-size: 0.95rem; }
.caveat strong { color: var(--warning-text); }

/* ---------- severity ---------- */
.severity-picker { background: #fff; border: 1px solid var(--rule); border-radius: var(--radius); padding: 24px; }
.severity-scale { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; margin: 8px 0 18px; }
.severity-scale button { font: inherit; font-variant-numeric: tabular-nums; font-weight: 600; border: 1px solid var(--rule-strong); background: #fff; color: var(--ink); border-radius: 4px; min-height: 44px; cursor: pointer; }
.severity-scale button[aria-pressed="true"] { background: var(--night); border-color: var(--night); color: #fff; }
.severity-scale button:hover { border-color: var(--steel); }
.severity-readout h3 { margin-bottom: 4px; }
.param-table { width: 100%; border-collapse: collapse; font-size: 0.93rem; margin-top: 12px; }
.param-table th, .param-table td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.param-table th { font-weight: 500; color: var(--text-2); width: 60%; }
.param-table td { font-variant-numeric: tabular-nums; }

/* ---------- data tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.93rem; background: #fff; }
table.data caption { text-align: left; font-weight: 600; padding: 0 0 8px; }
table.data th, table.data td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.data thead th { background: var(--band); font-weight: 600; font-size: 0.88rem; }
table.data td.n, table.data th.n { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- state badges ---------- */
.state { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem; font-weight: 500; white-space: nowrap; }
.state::before { content: ''; width: 10px; height: 10px; border-radius: 50%; border: 2px solid currentColor; flex: none; }
.state--healthy { color: var(--muted); }
.state--exposed { color: var(--warning-text); }
.state--exposed::before { background: var(--warning); border-color: var(--warning-text); }
.state--disrupted { color: var(--critical-text); }
.state--disrupted::before { background: var(--critical); border-color: var(--critical-text); border-radius: 2px; }
.state--isolated { color: var(--ink); }
.state--isolated::before { background: repeating-linear-gradient(45deg, var(--ink) 0 2px, transparent 2px 4px); border-radius: 1px; }
.state--recovering { color: #1d5fae; }
.state--recovering::before { background: var(--info); border-color: #1d5fae; border-radius: 50% 50% 2px 2px; }
.state--restored { color: var(--good-text); }
.state--restored::before { background: var(--good); border-color: var(--good-text); }
.state--future { color: var(--muted); }
.state--future::before { border-style: dashed; }
.state--retired { color: var(--muted); text-decoration: line-through; }
.state--retired::before { border-style: dotted; }
table.data td.sig-on { color: var(--critical-text); font-weight: 600; }
table.data td.sig-on::after { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--critical); margin-left: 5px; vertical-align: 1px; }

.status-pill { display: inline-flex; gap: 8px; align-items: center; font-weight: 600; padding: 4px 12px; border-radius: 999px; border: 1px solid currentColor; font-size: 0.95rem; }
.status-pill--prevented, .status-pill--contained { color: var(--good-text); background: #ecf8ec; }
.status-pill--degraded { color: var(--warning-text); background: #fff5dc; }
.status-pill--failed { color: var(--critical-text); background: #fdecec; }
.pass { color: var(--good-text); font-weight: 600; }
.fail { color: var(--critical-text); font-weight: 600; }

/* ---------- dependency map ---------- */
.depmap { background: #fff; border: 1px solid var(--rule); border-radius: var(--radius); padding: 12px; }
.depmap svg { display: block; width: 100%; height: auto; }
.depmap .edge { fill: none; stroke: #8796ad; }
.depmap .edge--concentration { stroke: #4a5a74; }
.depmap .edge--commonMode { stroke: var(--critical); stroke-dasharray: 5 4; }
.depmap .edge--optional { stroke-dasharray: 2 4; }
.depmap .edge.hot { stroke: var(--critical); }
.depmap .edge.dim { stroke-opacity: 0.15; }
.depmap .node rect { fill: #fff; stroke: #8796ad; stroke-width: 1.5; }
.depmap .node text { font-family: var(--sans); font-size: 12px; fill: var(--ink); }
.depmap .node .sub { font-size: 10.5px; fill: var(--muted); }
.depmap .node--exposed rect { fill: #fff4d6; stroke: #c28a00; stroke-width: 2; }
.depmap .node--disrupted rect { fill: #fbe1e1; stroke: var(--critical); stroke-width: 2.5; }
.depmap .node--isolated rect { stroke: var(--ink); stroke-width: 2; stroke-dasharray: 4 2; }
.depmap .node--recovering rect { fill: #e3eefb; stroke: var(--info); stroke-width: 2; }
.depmap .node--restored rect { fill: #e5f6e5; stroke: var(--good-text); stroke-width: 2; }
.depmap .node--future rect { fill: none; stroke: var(--rule-strong); stroke-dasharray: 3 3; }
.depmap .node--future text { fill: var(--muted); }
.depmap .node--retired rect { fill: none; stroke: var(--rule-strong); stroke-dasharray: 1 4; }
.depmap .node--retired text { fill: var(--muted); text-decoration: line-through; }
.depmap-dark .node--future rect, .depmap-dark .node--retired rect { fill: none; }
.depmap .node.selected rect { stroke: var(--focus); stroke-width: 3; }
.depmap .node { cursor: pointer; }
.depmap .node:focus { outline: none; }
.depmap .node:focus-visible rect { stroke: var(--focus); stroke-width: 3.5; }
.depmap .group-label { font-family: var(--sans); font-size: 12px; font-weight: 600; fill: var(--muted); }
.depmap-dark { background: transparent; border: 0; padding: 0; }
.depmap-dark .node rect { fill: #13233d; stroke: #3b5070; }
.depmap-dark .node text { fill: #e3eaf5; }
.depmap-dark .node .sub { fill: #9fb1c9; }
.depmap-dark .edge { stroke: #3e5475; }
.depmap-dark .node--exposed rect { fill: #3d3315; stroke: var(--warning); }
.depmap-dark .node--disrupted rect { fill: #4a1e24; stroke: #ff7a7a; }
.depmap-dark .node--recovering rect { fill: #17345c; stroke: #6aa6ee; }
.depmap-dark .node--restored rect { fill: #173d24; stroke: #5ad35a; }
.depmap-dark .node--isolated rect { stroke: #cfd8e6; }
.depmap-dark .edge.hot { stroke: #ff7a7a; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0 0; padding: 0; list-style: none; font-size: 0.85rem; }
.legend-line { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.legend-line svg { flex: none; }
.hero .legend .state, .hero .legend-line { color: #c9d5e6; }

.node-detail { background: #fff; border: 1px solid var(--rule); border-radius: var(--radius); padding: 14px 16px; font-size: 0.93rem; margin-top: 12px; }
.node-detail h4 { margin-bottom: 6px; }
.node-detail ul { margin: 6px 0 0; padding-left: 1.1em; }

.view-toggle { display: inline-flex; border: 1px solid var(--rule-strong); border-radius: 4px; overflow: hidden; }
.view-toggle button { font: inherit; font-size: 0.88rem; background: #fff; border: 0; padding: 6px 12px; cursor: pointer; color: var(--text-2); min-height: 34px; }
.view-toggle button[aria-pressed="true"] { background: var(--night); color: #fff; }
.view-toggle button + button { border-left: 1px solid var(--rule-strong); }

/* ---------- gauges ---------- */
.gauges { display: grid; gap: 14px; }
.gauge-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 0.93rem; }
.gauge-name { font-weight: 600; }
.gauge-value { font-variant-numeric: tabular-nums; font-weight: 600; }
.gauge-track { position: relative; height: 14px; background: var(--band); border-radius: 3px; margin-top: 6px; }
.gauge-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--steel); }
.gauge-fill.warning { background: var(--warning); }
.gauge-fill.critical { background: var(--critical); }
.gauge-mark { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); }
.gauge-mark--warn { background: #8a6100; }
.gauge-meta { display: flex; justify-content: space-between; font-size: 0.82rem; color: var(--muted); margin-top: 4px; }
.triple { margin-top: 6px; padding: 10px 12px; border-radius: 4px; font-size: 0.92rem; border: 1px solid var(--rule); background: #fff; }
.triple--on { border-color: var(--critical); background: #fdecec; color: var(--critical-text); font-weight: 500; }

/* ---------- line chart ---------- */
.chart { background: #fff; border: 1px solid var(--rule); border-radius: var(--radius); padding: 14px; position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .legend svg { display: inline; width: 28px; height: 10px; }
.chart .axis text { font-size: 11px; fill: var(--muted); font-family: var(--sans); }
.chart .grid line { stroke: #e3e8ef; }
.chart .baseline { stroke: var(--rule-strong); }
.chart .series { fill: none; stroke-width: 2; }
.chart .thr { stroke: var(--critical); stroke-dasharray: 4 3; stroke-width: 1; }
.chart .thr-label { font-size: 11px; fill: var(--critical-text); font-family: var(--sans); }
.chart .direct { font-size: 11.5px; font-weight: 600; font-family: var(--sans); fill: var(--ink); }
.chart .cross { stroke: var(--ink); stroke-width: 1; }
.chart-tip { position: absolute; pointer-events: none; background: var(--night); color: #fff; font-size: 0.82rem; padding: 8px 10px; border-radius: 4px; white-space: nowrap; transform: translate(-50%, -110%); }
.chart-tip[hidden] { display: none; }
.chart-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.chart-head h3, .chart-head h4 { margin: 0; }

/* ---------- lab ---------- */
.lab-steps { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 24px; counter-reset: step; }
.lab-steps li { counter-increment: step; font-size: 0.88rem; color: var(--muted); padding: 6px 12px 6px 10px; border: 1px solid var(--rule); border-radius: 999px; background: #fff; }
.lab-steps li::before { content: counter(step); font-variant-numeric: tabular-nums; font-weight: 600; margin-right: 6px; }
.lab-steps li[aria-current="step"] { color: #fff; background: var(--night); border-color: var(--night); }
.lab-steps li.done { color: var(--ink); border-color: var(--rule-strong); }

.panel { background: #fff; border: 1px solid var(--rule); border-radius: var(--radius); padding: 24px; }
.panel + .panel { margin-top: 20px; }
.panel h2 { font-size: 1.6rem; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.choice-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 860px) { .choice-grid--3 { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .choice-grid--2 { grid-template-columns: 1fr; } }

.stage-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 32px; align-items: start; }
@media (max-width: 960px) { .stage-grid { grid-template-columns: 1fr; } }

.playbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 0; }
.playbar .clock { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 9ch; }
.playbar input[type="range"] { flex: 1 1 200px; }
.stage-now { font-size: 0.95rem; padding: 10px 14px; background: var(--band); border-radius: 4px; margin-bottom: 12px; min-height: 2.6em; }
.stage-list { list-style: none; padding: 0; margin: 0; font-size: 0.9rem; counter-reset: st; }
.stage-list li { counter-increment: st; display: grid; grid-template-columns: 26px 1fr auto; gap: 6px; padding: 5px 0; border-bottom: 1px solid var(--rule); color: var(--muted); }
.stage-list li::before { content: counter(st); font-variant-numeric: tabular-nums; }
.stage-list li.reached { color: var(--ink); }
.stage-list li.current { font-weight: 600; color: var(--ink); }
.stage-list .t { font-variant-numeric: tabular-nums; }

.log { max-height: 360px; overflow: auto; font-size: 0.88rem; border: 1px solid var(--rule); border-radius: 4px; background: #fff; }
.log ol { list-style: none; margin: 0; padding: 0; }
.log li { display: grid; grid-template-columns: 64px 1fr; gap: 8px; padding: 6px 10px; border-bottom: 1px solid #edf0f4; }
.log li .t { font-variant-numeric: tabular-nums; color: var(--muted); }
.log li.k-decision, .log li.k-control { background: #f3f7fc; }
.log li.k-control-defeated, .log li.k-relapse, .log li.k-unintended { background: #fff5f0; }
.log li.k-threshold { background: #fffaeb; }

.decision-box { border: 2px solid var(--night); border-radius: var(--radius); padding: 20px; background: #fff; }
.decision-box h3 { margin-bottom: 6px; }
.timing-note { font-size: 0.92rem; color: var(--text-2); margin-top: 14px; }

.assumption-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; }
@media (max-width: 640px) { .assumption-grid { grid-template-columns: 1fr; } }
.assumption-grid .hint { display: block; font-size: 0.85rem; color: var(--muted); font-weight: 400; }
.range-row { display: flex; align-items: center; gap: 10px; }
.range-row output { font-variant-numeric: tabular-nums; min-width: 4ch; font-weight: 600; }

/* ---------- report ---------- */
.report-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; align-items: flex-start; }
.answers { display: grid; gap: 0; margin: 20px 0; border-top: 1px solid var(--rule); }
.answer { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--rule); }
.answer h3 { font-size: 1.1rem; margin: 0; }
.answer p { margin: 0; max-width: 72ch; }
@media (max-width: 720px) { .answer { grid-template-columns: 1fr; gap: 4px; } }
.tabs [role="tablist"] { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--rule-strong); margin-bottom: 16px; }
.tabs [role="tab"] { font: inherit; font-weight: 500; background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 14px; cursor: pointer; color: var(--text-2); min-height: 44px; }
.tabs [role="tab"][aria-selected="true"] { color: var(--ink); border-bottom-color: var(--steel); }
.kv { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.kv th, .kv td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.kv th { font-weight: 500; color: var(--text-2); width: 42%; }
.fingerprint { font-variant-numeric: tabular-nums; letter-spacing: 0.03em; }
.mom-chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 8px 0 0; }
.mom-chips li { border: 1px solid var(--rule-strong); border-radius: 4px; padding: 6px 10px; font-size: 0.88rem; background: #fff; }
.mom-chips li strong { display: block; }
.empty { text-align: left; padding: 32px; border: 1px dashed var(--rule-strong); border-radius: var(--radius); background: #fff; }

/* ---------- architecture ---------- */
.arch { background: #fff; border: 1px solid var(--rule); border-radius: var(--radius); padding: 16px; }
.arch svg { display: block; width: 100%; height: auto; }
.arch text { font-family: var(--sans); }
.mom-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 32px; }
.mom-list li { padding: 16px 0; border-bottom: 1px solid var(--rule); }
.mom-id { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--steel); }
.safeguards { counter-reset: sg; list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 32px; }
.safeguards li { counter-increment: sg; padding: 16px 0 16px 40px; border-bottom: 1px solid var(--rule); position: relative; }
.safeguards li::before { content: counter(sg); position: absolute; left: 0; top: 14px; font-family: var(--serif); font-size: 1.5rem; color: var(--steel); }

/* ---------- back to zero ---------- */
.btz-hero { background: var(--night); color: #e8eef7; padding: 64px 0; }
.btz-hero h1 { color: #fff; font-size: clamp(2.6rem, 7vw, 5rem); letter-spacing: 0.02em; margin-bottom: 8px; }
.btz-hero .sub { font-family: var(--serif); font-size: clamp(1.2rem, 2.4vw, 1.6rem); color: var(--dawn); max-width: 40ch; margin-bottom: 24px; }
.btz-hero p { color: #c9d5e6; max-width: 64ch; }
.still-exists { font-family: var(--serif); font-size: clamp(1.2rem, 2.3vw, 1.5rem); line-height: 1.5; color: #fff; max-width: 40ch; margin: 28px 0; }
.scenes-nav { list-style: none; padding: 0; margin: 0 0 20px; display: flex; flex-wrap: wrap; gap: 6px; counter-reset: sc; }
.scenes-nav li { counter-increment: sc; }
.scenes-nav button { font: inherit; font-size: 0.88rem; background: #fff; border: 1px solid var(--rule); border-radius: 999px; padding: 6px 12px; cursor: pointer; color: var(--text-2); min-height: 36px; }
.scenes-nav button::before { content: counter(sc); font-weight: 600; margin-right: 6px; font-variant-numeric: tabular-nums; }
.scenes-nav button[aria-current="step"] { background: var(--night); color: #fff; border-color: var(--night); }
.systems-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 28px; }
.section--night .systems-list strong { color: #fff; }
.systems-list li { padding: 12px 0; border-bottom: 1px solid var(--rule); }
.systems-list--dark li { border-bottom-color: #22344f; }
.systems-list--dark .state--healthy { color: #9fb1c9; }
.systems-list--dark .state--exposed { color: #f6c453; }
.systems-list--dark .state--disrupted { color: #ff8f8f; }
.systems-list--dark .state--recovering { color: #8dbbf2; }
.systems-list--dark .state--restored { color: #7fdc7f; }
.systems-list--dark .muted { color: #9fb1c9; }
.systems-list .n { font-family: var(--serif); color: var(--steel); font-size: 1.2rem; margin-right: 8px; }
.outcome-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.outcome { border: 1px solid var(--rule); border-radius: var(--radius); padding: 16px; background: #fff; }
.outcome.yours { border: 2px solid var(--night); }
.outcome h4 { margin-bottom: 4px; }

/* ---------- forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; max-width: 760px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.field-hint { display: block; font-size: 0.85rem; color: var(--muted); font-weight: 400; margin-top: 2px; }
.field-error { display: block; color: var(--critical-text); font-size: 0.88rem; margin-top: 4px; font-weight: 500; }
.field-error[hidden] { display: none; }
[aria-invalid="true"] { border-color: var(--critical) !important; }
.form-summary { border: 2px solid var(--critical); background: #fdecec; padding: 12px 16px; border-radius: 4px; margin-bottom: 16px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- footer ---------- */
.site-footer { background: var(--night); color: #b6c4d8; padding: 48px 0 32px; font-size: 0.93rem; margin-top: 0; }
.site-footer a { color: #d6e2f2; }
.site-footer :focus-visible { outline-color: var(--dawn); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.footer-grid h2 { font-family: var(--sans); font-size: 0.95rem; font-weight: 600; color: #fff; margin-bottom: 10px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 6px; }
.footer-tagline { font-family: var(--serif); color: #fff; font-size: 1.1rem; margin-bottom: 6px; }
.footer-bottom { border-top: 1px solid #22344f; margin-top: 32px; padding-top: 16px; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- utilities ---------- */
.stack > * + * { margin-top: 16px; }
.mt-0 { margin-top: 0; }
.mt-24 { margin-top: 24px; }
.mt-40 { margin-top: 40px; }
.notice { padding: 12px 16px; background: var(--band); border-radius: 4px; font-size: 0.95rem; }
.noscript { padding: 16px; background: #fff5dc; border: 1px solid var(--warning); border-radius: 4px; }
[hidden] { display: none !important; }

@media (max-width: 640px) {
  :root { --gutter: 16px; }
  .section { padding: 52px 0; }
  .panel { padding: 18px; }
  body { font-size: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* On phones the composition diagram would shrink below legible size; the list that follows carries the same content. */
@media (max-width: 640px) {
  .arch svg { display: none; }
  .arch figcaption::before { content: 'Stress Testing orchestrates the six MOMs listed below. '; }
}

/* ---------- Entropio early warning (Last Straw) ---------- */
.sig-list { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 10px; }
.sig-row { border: 1px solid var(--rule); border-radius: 4px; padding: 8px 10px; background: #fff; }
.sig-row--on { border-color: var(--critical); }
.sig-head { display: flex; justify-content: space-between; gap: 10px; font-size: 0.88rem; }
.sig-label { color: var(--text-2); }
.sig-value { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sig-row--on .sig-value { color: var(--critical-text); }
.sig-spark { display: block; width: 100%; height: 44px; margin-top: 4px; }
.sig-line { fill: none; stroke: var(--steel); stroke-width: 2; vector-effect: non-scaling-stroke; }
.sig-row--on .sig-line { stroke: var(--critical); }
.sig-thr-line { stroke: var(--critical); stroke-dasharray: 4 3; stroke-width: 1; vector-effect: non-scaling-stroke; }
.sig-now { stroke: var(--rule-strong); stroke-width: 1; vector-effect: non-scaling-stroke; }
.sig-thr { font-size: 0.8rem; color: var(--muted); }
.sig-status { font-size: 0.9rem; margin: 10px 0 0; }
.growth-table td.n { white-space: nowrap; }
