/* WebsiteBench project page
   Type: Schibsted Grotesk (display, UI, body), Martian Mono (URLs, code, IDs).
   The hero's split title and the demo divider share one idea: reference on the left, rebuild on the right. */

:root {
  --paper: #FFFFFF;
  --paper-2: #F4F5F8;
  --paper-3: #E9ECF2;
  --ink: #14171D;
  --ink-2: #454D5B;
  --ink-3: #5F6778;
  --rule: #E2E5EB;
  --rule-2: #CBD1DA;
  --accent: #2D5BE3;
  --accent-strong: #1F45C2;
  --accent-soft: #EBF0FD;
  --pass: #1D7A3A;
  --pass-soft: #E4F4E9;
  --fail: #C8322C;
  --fail-soft: #FCEBEA;
  --c1: #2D5BE3;
  --c2: #C98A12;
  --c3: #2E9A66;
  --c4: #7E6BD9;
  --cell: #D5DAE2;
  --on-c1: #FFFFFF;
  --on-c3: #14171D;
  --plate: #FFFFFF;
  --code-edge: transparent;
  --term: #14171D;
  --cat-bg: #14171D;
  --cat-ink: #FFFFFF;
  --cat-edge: transparent;
  --shadow: 0 1px 2px rgba(20, 23, 29, .06), 0 10px 30px rgba(20, 23, 29, .08);
  --shadow-lg: 0 2px 4px rgba(20, 23, 29, .05), 0 24px 60px rgba(20, 23, 29, .14);
  --font-sans: 'Schibsted Grotesk', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-mono: 'Martian Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --font-fallback: 'Times New Roman', Times, 'Liberation Serif', 'Nimbus Roman', serif;
  --wrap: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
  --split: 62%;
  --split-px: 100%;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0D1015;
    --paper-2: #141922;
    --paper-3: #1D2330;
    --ink: #E9ECF1;
    --ink-2: #B3BAC6;
    --ink-3: #8F98A8;
    --rule: #242B37;
    --rule-2: #343C4B;
    --accent: #85A2FF;
    --accent-strong: #A9BEFF;
    --accent-soft: #1A2448;
    --pass: #4CC476;
    --pass-soft: #10281A;
    --fail: #FF6B61;
    --fail-soft: #3A1715;
    --c1: #5B8DF5;
    --c2: #B8862A;
    --c3: #3FA36F;
    --c4: #8F80E0;
    --cell: #3A4252;
    --on-c1: #0D1015;
    --on-c3: #0D1015;
    --plate: #F7F8FA;
    --code-edge: #2C3340;
    --term: #07090C;
    --cat-bg: #1D2330;
    --cat-ink: #E9ECF1;
    --cat-edge: #343C4B;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 32px rgba(0, 0, 0, .45);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, .4), 0 24px 60px rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0D1015;
  --paper-2: #141922;
  --paper-3: #1D2330;
  --ink: #E9ECF1;
  --ink-2: #B3BAC6;
  --ink-3: #8F98A8;
  --rule: #242B37;
  --rule-2: #343C4B;
  --accent: #85A2FF;
  --accent-strong: #A9BEFF;
  --accent-soft: #1A2448;
  --pass: #4CC476;
  --pass-soft: #10281A;
  --fail: #FF6B61;
  --fail-soft: #3A1715;
  --c1: #5B8DF5;
  --c2: #B8862A;
  --c3: #3FA36F;
  --c4: #8F80E0;
  --cell: #3A4252;
  --on-c1: #0D1015;
  --on-c3: #0D1015;
  --plate: #F7F8FA;
  --code-edge: #2C3340;
  --term: #07090C;
  --cat-bg: #1D2330;
  --cat-ink: #E9ECF1;
  --cat-edge: #343C4B;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 32px rgba(0, 0, 0, .45);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, .4), 0 24px 60px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
code { font-family: var(--font-mono); font-size: .8em; font-variation-settings: 'wdth' 90; }
h1, h2, h3, h4 { text-wrap: balance; }
p { text-wrap: pretty; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: 0; transform: translateY(-140%); z-index: 100; padding: 10px 14px; background: var(--ink); color: var(--paper); border-radius: 6px; font-weight: 600; text-decoration: none; }
.skip:focus { transform: translateY(12px); color: var(--paper); }
.wrap { width: min(calc(100% - 2 * var(--gutter)), var(--wrap)); margin-inline: auto; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.topbar.is-scrolled { border-bottom-color: var(--rule); }
.topbar-in { display: flex; align-items: center; gap: 20px; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 18px; letter-spacing: -.025em; }
.brand:hover { color: var(--ink); }
.brand-mark { width: 24px; height: 24px; flex: none; }
.toc { display: flex; gap: 2px; margin-left: auto; }
.toc a { position: relative; padding: 6px 11px; border-radius: 6px; color: var(--ink-2); font-size: 15px; font-weight: 500; text-decoration: none; }
.toc a:hover { color: var(--ink); background: var(--paper-2); }
.toc a.is-active { color: var(--ink); }
.toc a.is-active::after { content: ''; position: absolute; left: 11px; right: 11px; bottom: -13px; height: 2px; background: var(--ink); }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--rule); border-radius: 8px; background: transparent; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { color: var(--ink); border-color: var(--rule-2); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .i-sun { display: none; }
:root[data-theme="dark"] .icon-btn .i-sun { display: block; }
:root[data-theme="dark"] .icon-btn .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-btn .i-sun { display: block; }
  :root:not([data-theme="light"]) .icon-btn .i-moon { display: none; }
}
.menu-btn { display: none; }
@media (max-width: 860px) {
  .menu-btn { display: inline-grid; }
  .topbar-actions { margin-left: auto; }
  .toc { position: absolute; top: calc(100% + 6px); right: var(--gutter); display: none; flex-direction: column; gap: 0; min-width: 200px; padding: 8px; border: 1px solid var(--rule); border-radius: 12px; background: var(--paper); box-shadow: var(--shadow-lg); }
  .toc.is-open { display: flex; }
  .toc a { padding: 10px 12px; font-size: 16px; }
  .toc a.is-active::after { display: none; }
  .toc a.is-active { background: var(--paper-2); }
  .topbar-in { position: relative; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  height: 46px; padding: 0 20px;
  border: 1px solid var(--rule-2); border-radius: 9px;
  background: var(--paper); color: var(--ink);
  font: 600 16px/1 var(--font-sans); letter-spacing: -.005em;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn:hover { border-color: var(--ink-3); color: var(--ink); }
.btn svg { width: 19px; height: 19px; }
.btn-ink { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn-ink:hover { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.btn-sm { height: 36px; padding: 0 14px; font-size: 14.5px; border-radius: 8px; }
.btn.is-soon { color: var(--ink-3); border-style: dashed; cursor: default; }
.btn.is-soon:hover { border-color: var(--rule-2); color: var(--ink-3); }
.btn.is-soon small { font: 500 10.5px/1 var(--font-mono); letter-spacing: .02em; padding: 4px 6px; border-radius: 4px; background: var(--paper-2); color: var(--ink-3); }

/* ---------- hero ---------- */
.hero { padding-block: clamp(28px, 3vw, 40px) 0; }
.headline { margin: 0; font-weight: 400; }
.title { display: block; font-size: clamp(36px, calc((100vw - 2 * var(--gutter)) / 11), 92px); font-weight: 850; line-height: .9; letter-spacing: -.05em; }
.title-in { position: relative; display: inline-block; padding-top: .06em; }
.title-ref { display: block; clip-path: inset(-.3em calc(100% - var(--split-px)) -.3em -.2em); }
.title-cand {
  position: absolute; left: 0; top: .06em;
  white-space: nowrap;
  font-family: var(--font-fallback); font-weight: 700; font-size: 1.1em; line-height: .9; letter-spacing: -.01em;
  clip-path: inset(-.3em -.3em -.3em var(--split-px));
}
.title-seam { position: absolute; top: -.02em; bottom: -.04em; left: var(--split-px); width: 3px; margin-left: -1.5px; background: var(--accent); border-radius: 2px; display: none; }
.title-in.is-split .title-seam { display: block; }
.title-tag {
  position: absolute; left: var(--split-px); top: -.1em; transform: translate(10px, -100%);
  padding: 4px 8px; border-radius: 4px; background: var(--fail); color: var(--paper);
  font: 600 12.5px/1.2 var(--font-mono); letter-spacing: 0; white-space: nowrap;
  opacity: 0; transition: opacity .25s ease;
}
.title-in.is-split .title-tag { opacity: 1; }
.title-in.tag-left .title-tag { transform: translate(calc(-100% - 10px), -100%); }
.title-in.no-split .title-seam, .title-in.no-split .title-tag { display: none; }
.hero-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 28px; margin-top: clamp(10px, 1.2vw, 14px); }
.keyline { display: flex; flex-wrap: wrap; gap: 6px 26px; margin: clamp(22px, 3vw, 34px) 0 14px; padding-top: 14px; border-top: 1px solid var(--rule-2); font: 500 13.5px/1.4 var(--font-mono); font-variation-settings: 'wdth' 90; color: var(--ink-2); scroll-margin-top: 84px; }
.keyline span { position: relative; }
.keyline span + span::before { content: ''; position: absolute; left: -15px; top: 50%; width: 4px; height: 4px; margin-top: -2px; border-radius: 50%; background: var(--rule-2); }
.scoring-short { margin-top: clamp(48px, 6vw, 72px); max-width: 70ch; }
.access-col.hidden-col { background: var(--paper-2); border-left: 1px solid var(--rule); }
.access .hidden-col li::before { background: var(--ink-3); border-radius: 50%; }
.question { margin: 0; max-width: 30ch; font-size: clamp(21px, 2.3vw, 30px); font-weight: 600; line-height: 1.15; letter-spacing: -.022em; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding-bottom: 4px; }
.soon { font-size: 14.5px; color: var(--ink-3); padding-left: 6px; }
@media (max-width: 520px) {
  .keyline { flex-direction: column; gap: 4px; }
  .keyline span + span::before { display: none; }
  .soon { flex-basis: 100%; padding-left: 0; }
  .title { padding-bottom: 30px; }
  .title-tag { top: auto; bottom: 4px; transform: translate(10px, 100%); }
  .title-in.tag-left .title-tag { transform: translate(calc(-100% - 10px), 100%); }
  .leaf { font-size: 12px; padding: 4px 8px 4px 5px; }
  .cat-node { padding: 10px 12px; }
}

/* ---------- failure tree ---------- */
.tree { position: relative; margin: clamp(20px, 2.4vw, 32px) 0 0; }
.tree-grid { position: relative; z-index: 1; display: grid; grid-template-columns: max-content minmax(0, 1.3fr) minmax(0, 1fr); column-gap: clamp(40px, 6vw, 96px); row-gap: 9px; align-items: center; }
.tree-lines { position: absolute; left: 0; top: 0; z-index: 0; overflow: visible; pointer-events: none; }
.tree-lines path { fill: none; stroke-linecap: round; transition: stroke-dashoffset .5s ease; }
.tree-lines path.to-cat { stroke: var(--fail); stroke-width: 1.5; opacity: .75; }
.tree-lines path.to-root { stroke: var(--accent); stroke-width: 2; }
.group { display: contents; }
.leaf { grid-column: 1; justify-self: end; display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px 6px 6px; border-radius: 6px; background: var(--fail); color: var(--paper); font: 600 13px/1.25 var(--font-mono); font-variation-settings: 'wdth' 88; white-space: nowrap; }
.leaf i, .cat-node b i { display: inline-grid; place-items: center; flex: none; width: 17px; height: 17px; border-radius: 50%; background: var(--paper); color: var(--fail); font: 800 10.5px/1 var(--font-sans); font-style: normal; }
.cat-node b i { background: var(--cat-ink); }
.cat-node { grid-column: 2; align-self: center; display: block; padding: 12px 16px; border-radius: 12px; background: var(--cat-bg); color: var(--cat-ink); box-shadow: inset 0 0 0 1px var(--cat-edge); text-decoration: none; }
.cat-node { position: relative; padding-right: 40px; }
.cat-node::after { content: ''; position: absolute; right: 18px; top: 50%; width: 9px; height: 9px; margin-top: -6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); opacity: .5; }
.cat-node:hover { background: var(--accent); color: var(--paper); box-shadow: none; }
.cat-node:hover::after { opacity: 1; }
.cat-node:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.cat-node strong { font-weight: 800; opacity: 1; }
.cat-node b { display: flex; align-items: center; gap: 9px; font-size: 16.5px; font-weight: 750; line-height: 1.2; letter-spacing: -.01em; }
.cat-node b i { margin-right: 0; }
.cat-node span { display: block; margin-top: 4px; font-size: 13.5px; opacity: .78; }
.root-node { grid-column: 3; align-self: stretch; display: flex; flex-direction: column; justify-content: center; padding: 22px 24px; border: 2px solid var(--accent); border-radius: 16px; background: var(--accent-soft); }
.root-brand { display: inline-flex; align-items: center; gap: 9px; font-size: 16px; font-weight: 800; letter-spacing: -.02em; }
.root-brand .brand-mark { width: 22px; height: 22px; }
.root-big { display: block; margin-top: 12px; font-size: clamp(52px, 6.2vw, 92px); font-weight: 850; line-height: 1; letter-spacing: -.045em; }
.root-l1 { display: block; margin-top: 6px; font-size: 15px; font-weight: 600; }
.root-l2 { display: block; margin-top: 6px; font-size: 14.5px; color: var(--ink-2); transition: opacity .35s ease; }
.tree.is-armed .root-l2 { opacity: 0; }
.tree.is-armed .root-node.is-punch .root-l2 { opacity: 1; }
.root-l2 em { font-style: normal; font-weight: 800; color: var(--fail); }
.leaf { transition: opacity .3s ease, scale .4s cubic-bezier(.2, .9, .3, 1.25); }
.cat-node, .root-node { transition: opacity .3s ease, translate .45s cubic-bezier(.2, .7, .2, 1), background-color .15s ease, box-shadow .15s ease; }
.tree.is-armed .leaf { opacity: 0; scale: .8; }
.tree.is-armed .cat-node, .tree.is-armed .root-node { opacity: 0; translate: 0 8px; }
.tree.is-armed .leaf.is-on { opacity: 1; scale: 1; }
.tree.is-armed .cat-node.is-on, .tree.is-armed .root-node.is-on { opacity: 1; translate: 0 0; }
.tree-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-top: 14px; }
.tree-foot figcaption { font-size: 14px; color: var(--ink-3); }
@media (max-width: 860px) {
  .tree-grid { grid-template-columns: 1fr; row-gap: 12px; padding-left: 24px; }
  .group { display: flex; flex-wrap: wrap; gap: 6px; padding-left: 10px; border-left: 2px solid var(--fail); }
  .leaf { white-space: normal; font-size: 12.5px; }
  .cat-node, .root-node { grid-column: 1; grid-row: auto !important; }
  .cat-node { margin-bottom: 10px; }
  .root-node { align-self: auto; }
  .root-big { font-size: 48px; }
}

/* ---------- demo ---------- */
.demo { margin: clamp(26px, 3.2vw, 40px) 0 0; }
.demo-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 12px; }
.demo-mock { padding: 4px 11px; border: 1px dashed var(--rule-2); border-radius: 999px; font: 500 13px/1.3 var(--font-mono); font-variation-settings: 'wdth' 90; color: var(--ink-2); }
.demo-mock .short { display: none; }
.demo-run { display: inline-flex; align-items: center; gap: 12px; }
.demo-run .dt-score { font-size: 14.5px; color: var(--ink-2); }
.demo-run .dt-score b { color: var(--ink); font-weight: 800; }
.side { position: absolute; top: 52px; padding: 3px 9px; border-radius: 6px; font: 600 12px/1.3 var(--font-mono); font-variation-settings: 'wdth' 90; white-space: nowrap; pointer-events: none; box-shadow: 0 2px 8px rgba(20, 23, 29, .18); }
.side-ref { right: calc(50% + 8px); background: #14171D; color: #fff; }
.side-cand { left: calc(50% + 8px); background: #fff; color: #1F45C2; box-shadow: inset 0 0 0 1.5px #2D5BE3, 0 2px 8px rgba(20, 23, 29, .18); }
.stage {
  position: relative;
  min-height: 441px;
  container-type: inline-size;
  border: 1px solid var(--rule-2); border-bottom: 0;
  border-radius: 14px 14px 0 0;
  overflow: hidden;
  background: #FAFAF8;
  box-shadow: var(--shadow-lg);
  -webkit-user-select: none; user-select: none;
}
.layer { background: #FAFAF8; }
.layer.is-cand { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--split)); }
.divider {
  position: absolute; top: 0; bottom: 0; left: var(--split); z-index: 6;
  width: 36px; margin-left: -18px;
  display: grid; place-items: end center;
  cursor: ew-resize; touch-action: none;
}
.divider::before { content: ''; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px; background: var(--accent); box-shadow: 0 0 0 1px rgba(255, 255, 255, .55); }
.divider:focus-visible { outline: none; }
.grip {
  position: relative; display: grid; place-items: center;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--accent); color: var(--paper);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .92), 0 6px 18px rgba(45, 91, 227, .45);
  transition: transform .15s ease;
}
.grip svg { width: 22px; height: 22px; }
.divider .grip { margin-bottom: 18px; }
.divider:hover .grip, .divider.is-dragging .grip { transform: scale(1.08); }
.divider:focus-visible .grip { box-shadow: 0 0 0 4px rgba(255, 255, 255, .92), 0 0 0 7px var(--ink); }
.noscript { position: absolute; inset: 0; display: grid; place-content: center; margin: 0; padding: 24px; text-align: center; color: #4A5160; font-size: 15px; }
.ghost { position: absolute; z-index: 7; bottom: 12px; left: 100%; width: 30px; height: 30px; margin: 0 0 0 8px; opacity: 0; pointer-events: none; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .3)); }
.ghost svg { width: 30px; height: 30px; }

/* browser chrome inside each layer */
.chrome { display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 14px; background: #ECEEF2; border-bottom: 1px solid #D9DDE3; color: #4A5160; }
.chrome .dots { display: flex; gap: 7px; flex: none; }
.chrome .dots i { width: 11px; height: 11px; border-radius: 50%; background: #FF5F57; }
.chrome .dots i:nth-child(2) { background: #FEBC2E; }
.chrome .dots i:nth-child(3) { background: #28C840; }
.chrome .navs { display: flex; gap: 4px; flex: none; color: #9AA1AD; }
.chrome .navs svg { width: 16px; height: 16px; }
.chrome .url { flex: 1; min-width: 0; display: flex; align-items: center; gap: 1px; height: 28px; padding: 0 12px; border-radius: 14px; background: #fff; border: 1px solid #D9DDE3; font: 500 12.5px/1 var(--font-mono); font-variation-settings: 'wdth' 90; white-space: nowrap; overflow: hidden; }
.chrome .host { color: #14171D; font-weight: 600; }
.chrome .path { color: #6A7282; overflow: hidden; text-overflow: ellipsis; }

/* the mock pet shop */
.site { position: relative; overflow: hidden; background: #FAFAF8; color: #1B1E24; font-family: var(--font-sans); font-size: 13px; line-height: 1.35; }
.s-head { display: flex; align-items: center; gap: 20px; height: 52px; padding: 0 22px; background: #fff; border-bottom: 1px solid #ECECE6; }
.s-logo { display: inline-flex; align-items: center; gap: 7px; font-weight: 800; font-size: 17px; letter-spacing: -.03em; }
.s-logo svg { width: 20px; height: 20px; fill: #E0662F; }
.s-nav { display: flex; gap: 18px; font-size: 13.5px; font-weight: 500; color: #4E5460; }
.is-cand .s-nav { gap: 19px; }
.s-cart { position: relative; margin-left: auto; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; border: 1px solid #E6E6E0; background: #fff; color: #1B1E24; }
.s-cart svg { width: 19px; height: 19px; }
.s-cart b { position: absolute; top: -6px; right: -7px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: #C4501D; color: #fff; font-size: 11px; font-weight: 800; line-height: 19px; text-align: center; transition: transform .2s ease; }
.s-cart b.is-zero { background: #B9BDC5; }
.s-cart b.bump { transform: scale(1.3); }
.s-main { display: grid; gap: 16px; padding: 16px 22px; }
.s-h { margin: 0 0 9px; font-size: 14px; font-weight: 750; letter-spacing: -.01em; }
.s-cats { position: relative; }
.s-tiles { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.s-tile { display: grid; justify-items: center; gap: 4px; padding: 10px 6px 9px; border-radius: 12px; background: var(--tile, #F3EFE6); font-size: 13px; font-weight: 650; }
.s-tile svg { width: 58px; height: 58px; }
.s-shop-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.s-shop-head .s-h { margin: 0; }
.s-tabs { position: relative; display: inline-flex; gap: 2px; padding: 3px; border-radius: 9px; background: #EFEFEA; }
.s-tabs button { border: 0; padding: 5px 12px; border-radius: 6px; background: transparent; color: #5A606B; font: 600 12.5px/1.2 var(--font-sans); cursor: pointer; }
.s-tabs button[aria-selected="true"] { background: #fff; color: #1B1E24; box-shadow: 0 1px 2px rgba(0, 0, 0, .1); }
.s-products { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.s-card { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid #ECECE6; border-radius: 11px; background: #fff; }
.s-thumb { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 9px; background: #F4F1EA; }
.s-thumb svg { width: 32px; height: 32px; }
.s-name { font-size: 12.5px; font-weight: 650; line-height: 1.25; }
.s-price { margin-top: 2px; font-size: 12.5px; font-weight: 750; }
.s-price.deal { color: #C8322C; }
.s-price s { margin-left: 5px; color: #6E737E; font-weight: 500; }
.s-add { display: inline-grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 8px; background: #1B1E24; color: #fff; font: 700 17px/1 var(--font-sans); cursor: pointer; }
.s-add:hover { background: #C4501D; }
.s-groom { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px 12px 16px; border-radius: 12px; background: #1B1E24; color: #fff; }
.s-groom p { margin: 0; font-size: 13.5px; }
.s-groom p b { font-weight: 750; }
.s-groom p span { color: #B9BDC5; }
.s-book { position: relative; flex: none; border: 0; border-radius: 8px; padding: 9px 14px; background: #C4501D; color: #fff; font: 700 12.5px/1 var(--font-sans); cursor: pointer; }
.s-book:hover { background: #A94215; }
.s-groom.is-booked { background: #1D7A3A; }
.s-groom.is-booked .s-ok { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #fff; color: #1D7A3A; flex: none; }
.s-ok svg { width: 16px; height: 16px; }
.s-404 { position: absolute; top: 52px; left: 0; right: 0; bottom: 0; display: grid; place-content: center; justify-items: center; gap: 6px; background: #FAFAF8; text-align: center; }
.s-404 .code404 { font-size: 72px; font-weight: 850; letter-spacing: -.05em; line-height: 1; color: #1B1E24; }
.s-404 p { margin: 0; color: #5A606B; }
.s-404 .p404 { font: 500 12px var(--font-mono); color: #6E737E; }
.s-404 button { margin-top: 10px; border: 1px solid #D9DDE3; border-radius: 8px; padding: 8px 14px; background: #fff; font: 600 12.5px var(--font-sans); cursor: pointer; }
.s-restart { position: absolute; inset: 0; z-index: 4; display: grid; place-content: center; justify-items: center; gap: 10px; background: rgba(250, 250, 248, .92); font: 600 13px var(--font-sans); color: #4E5460; }
.s-restart .spin { width: 26px; height: 26px; border-radius: 50%; border: 3px solid #D9DDE3; border-top-color: #2D5BE3; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* defect markers, styled like a devtools inspector overlay */
.bug-box { position: absolute; z-index: 2; border: 1.5px dashed #C8322C; border-radius: 13px; pointer-events: none; }
.bug {
  position: absolute; z-index: 3;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 8px 4px 6px; border: 0; border-radius: 5px;
  background: #C8322C; color: #fff;
  font: 600 11px/1.2 var(--font-mono); font-variation-settings: 'wdth' 90; letter-spacing: -.01em; white-space: nowrap;
  box-shadow: 0 3px 8px rgba(200, 50, 44, .35);
  cursor: help;
  opacity: 0; scale: .9;
  transition: opacity .35s ease, scale .35s ease, box-shadow .15s ease;
}
.bug svg { width: 11px; height: 11px; flex: none; }
.bug-n { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; background: #fff; color: #C8322C; font: 800 10px/1 var(--font-sans); font-style: normal; }
.dt-n { display: inline-grid; place-items: center; width: 17px; height: 17px; margin-right: 8px; border-radius: 50%; background: var(--fail); color: var(--paper); font: 800 10.5px/1 var(--font-sans); font-style: normal; vertical-align: 1px; }
.stage.show-bugs .bug { opacity: 1; scale: 1; }
.bug.at-tiles { top: -3px; right: 0; }
.bug.at-tabs { top: 50%; right: calc(100% + 12px); transform: translateY(-50%); }
.bug.at-book { top: 50%; right: calc(100% + 12px); transform: translateY(-50%); }
.bug.at-cart { top: 50%; right: calc(100% + 12px); transform: translateY(-50%); }
.s-name, .s-price { display: block; }
.s-booked p { margin: 0; }
.bug.is-hot, .bug:hover, .bug:focus-visible { box-shadow: 0 0 0 3px rgba(200, 50, 44, .25), 0 3px 8px rgba(200, 50, 44, .35); outline: none; }
.hot-ring { outline: 2px solid #2D5BE3; outline-offset: 3px; border-radius: 10px; }
.hot-ring-bad { outline: 2px solid #C8322C; outline-offset: 3px; border-radius: 10px; }
.tip {
  position: absolute; z-index: 8; max-width: 300px;
  padding: 12px 14px; border-radius: 10px;
  background: #14171D; color: #E9ECF1;
  font-size: 13.5px; line-height: 1.45;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .3);
  pointer-events: none;
}
.tip b { display: block; margin-bottom: 4px; color: #fff; font-size: 14px; }
.tip small { display: block; margin-top: 7px; color: #9AA3B2; font: 500 11px var(--font-mono); }

/* hidden tests panel */
.devtools { border: 1px solid var(--rule-2); border-radius: 0 0 14px 14px; background: var(--paper-2); box-shadow: var(--shadow-lg); }
.dt-bar { display: flex; align-items: stretch; gap: 16px; min-height: 44px; padding-right: 10px; border-bottom: 1px solid var(--rule); }
.dt-tab { display: flex; align-items: center; padding: 0 16px; border-bottom: 2px solid var(--accent); margin-bottom: -1px; font: 600 12px var(--font-mono); color: var(--ink); }
.dt-score { display: flex; align-items: center; font-size: 14px; color: var(--ink-2); }
.dt-score b { color: var(--ink); font-weight: 800; margin-right: 4px; }
.dt-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.dt-btn { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border: 1px solid var(--rule-2); border-radius: 7px; background: var(--paper); color: var(--ink); font: 600 13.5px/1 var(--font-sans); cursor: pointer; }
.dt-btn:hover { border-color: var(--ink-3); }
.dt-btn svg { width: 15px; height: 15px; }
.dt-btn-quiet { color: var(--ink-2); }
.dt-btn-primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.dt-btn-primary:hover { background: var(--accent); border-color: var(--accent); }
.dt-btn:disabled { opacity: .55; cursor: progress; }
.dt-row.is-pending .dt-ico, .dt-row.is-running .dt-ico { background: var(--cell); }
.dt-row.is-pending .dt-ico svg, .dt-row.is-running .dt-ico svg { display: none; }
.dt-row.is-pending .dt-detail, .dt-row.is-running .dt-detail { opacity: 0; }
.dt-row.is-pending .dt-text { color: var(--ink-3); }
.dt-row.is-running .dt-ico { background: transparent; border: 2.5px solid var(--cell); border-top-color: var(--accent); animation: spin .6s linear infinite; }
.dt-list .dt-row.is-running, .dt-list .dt-row.is-running.is-hot { background: var(--paper); border-left-color: var(--accent); }
.dt-row.is-done .dt-ico { animation: pop .3s ease; }
@keyframes pop { 0% { transform: scale(.4); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }
.dt-list { margin: 0; padding: 6px 0 8px; list-style: none; }
.dt-list:empty { min-height: 236px; }
.dt-row { display: grid; grid-template-columns: 20px 118px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 7px 16px 7px 13px; border-left: 3px solid transparent; font-size: 14.5px; cursor: default; }
.dt-row:hover, .dt-row.is-hot { background: var(--paper); border-left-color: var(--rule-2); }
.dt-row.bad:hover, .dt-row.bad.is-hot { border-left-color: var(--fail); }
.dt-row.ok:hover, .dt-row.ok.is-hot { border-left-color: var(--pass); }
.dt-ico { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; color: var(--paper); }
.dt-ico svg { width: 12px; height: 12px; }
.ok .dt-ico { background: var(--pass); }
.bad .dt-ico { background: var(--fail); }
.dt-group { font: 500 12px/1.2 var(--font-mono); font-variation-settings: 'wdth' 90; color: var(--ink-3); }
.dt-text { color: var(--ink); }
.dt-detail { font: 500 12px/1.2 var(--font-mono); font-variation-settings: 'wdth' 88; color: var(--ink-2); text-align: right; }
.bad .dt-detail { color: var(--fail); }
.demo figcaption { margin-top: 14px; font-size: 14.5px; color: var(--ink-3); max-width: 90ch; }

@container (max-width: 900px) {
  .side { display: none; }
  .bug.at-tabs { top: -12px; right: -8px; transform: none; width: 22px; height: 22px; padding: 0; justify-content: center; border-radius: 50%; font-size: 0; gap: 0; }
  .bug.at-tabs .bug-n { width: auto; height: auto; background: none; color: #fff; font-size: 11px; }
}
@container (max-width: 700px) {
  .s-nav { display: none; }
  .s-products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .s-products .s-card:nth-child(3) { display: none; }
}
@container (max-width: 480px) {
  .site { font-size: 12px; }
  .s-404 { top: 48px; }
  .bug { width: 22px; height: 22px; padding: 0; justify-content: center; border-radius: 50%; font-size: 0; gap: 0; }
  .bug-n { width: auto; height: auto; background: none; color: #fff; font-size: 11px; }
  .bug.at-cart { top: 50%; right: calc(100% + 6px); left: auto; transform: translateY(-50%); }
  .bug.at-tiles { top: -4px; right: 0; }
  .bug.at-tabs { top: -12px; right: -8px; transform: none; }
  .bug.at-book { top: -11px; right: -9px; transform: none; }
  .s-groom p span { display: none; }
  .s-head { padding: 0 14px; height: 48px; }
  .s-main { padding: 12px 14px; gap: 13px; }
  .s-tiles { gap: 6px; }
  .s-tile { padding: 8px 2px 7px; font-size: 11.5px; border-radius: 10px; }
  .s-tile svg { width: 42px; height: 42px; }
  .s-shop-head { flex-wrap: wrap; }
  .s-products { grid-template-columns: 1fr; gap: 7px; }
  .s-products .s-card:nth-child(3) { display: none; }
  .s-card { padding: 7px 8px; grid-template-columns: 36px minmax(0, 1fr) auto; }
  .s-thumb { width: 36px; height: 36px; }
  .s-thumb svg { width: 28px; height: 28px; }
  .s-groom { padding: 10px 10px 10px 12px; }
  .s-groom p { font-size: 12.5px; }
  .s-book { padding: 8px 10px; }
  .chrome { gap: 8px; padding: 0 10px; }
  .chrome .navs { display: none; }
}

@media (max-width: 720px) {
  .dt-bar { flex-wrap: wrap; row-gap: 0; padding-right: 0; }
  .dt-actions { width: 100%; padding: 8px 12px; border-top: 1px solid var(--rule); margin-left: 0; }
  .dt-tab { min-height: 42px; }
  .dt-row { grid-template-columns: 20px minmax(0, 1fr) auto; gap: 3px 10px; padding: 8px 14px 8px 11px; }
  .dt-group { grid-column: 2; grid-row: 1; }
  .dt-detail { grid-column: 3; grid-row: 1; text-align: right; }
  .dt-text { grid-column: 2 / -1; grid-row: 2; }
  .dt-ico { grid-row: 1 / span 2; align-self: start; margin-top: 2px; }
  .dt-btn .long, .tab .long { display: none; }
  .demo-mock .long { display: none; }
  .demo-mock .short { display: inline; }
  .demo-run .dt-score { font-size: 13.5px; }
}

/* ---------- key facts ---------- */
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: clamp(28px, 4vw, 48px) 0 0; border-top: 1px solid var(--rule-2); }
.facts > div { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 8px; padding: 18px 16px 0 0; }
.facts > div + div { padding-left: 20px; border-left: 1px solid var(--rule); }
.facts dd { margin: 0; font-size: clamp(30px, 3vw, 40px); font-weight: 800; line-height: 1; letter-spacing: -.035em; }
.facts dt { font-size: 14.5px; line-height: 1.35; color: var(--ink-3); }
@media (max-width: 760px) {
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 22px; }
  .facts > div:nth-child(3) { padding-left: 0; border-left: 0; }
}

/* ---------- sections ---------- */
.section { padding-block: clamp(64px, 8vw, 112px) 0; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; padding-top: 18px; margin-bottom: clamp(24px, 3.5vw, 40px); border-top: 2px solid var(--ink); }
.sec-head h2 { margin: 0; max-width: 21ch; font-size: clamp(33px, 4.5vw, 60px); font-weight: 800; line-height: 1.02; letter-spacing: -.038em; }
.route { flex: none; font: 500 13px var(--font-mono); color: var(--ink-3); text-decoration: none; }
/* Reference sections (Related, FAQ, Cite) use a quieter heading than the story sections. */
#related .sec-head h2 { max-width: 28ch; font-size: clamp(28px, 3.4vw, 44px); line-height: 1.06; }
.route:hover { color: var(--accent); }
.intro { margin: 0 0 clamp(36px, 5vw, 56px); max-width: 62ch; font-size: clamp(18px, 1.5vw, 20.5px); line-height: 1.55; color: var(--ink-2); }
h3 { margin: 0 0 14px; font-size: clamp(22px, 2.1vw, 28px); font-weight: 750; line-height: 1.15; letter-spacing: -.022em; }
h4 { margin: 0; }

/* ---------- task ---------- */
.task-intro { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 80px); align-items: center; }
.task-intro .intro { margin-bottom: 18px; }
.intro-2 { margin: 0; max-width: 62ch; font-size: 17.5px; color: var(--ink-2); }
.fig-link-lg { display: flex; margin-top: clamp(28px, 3.5vw, 40px); font-size: 15.5px; }
.epigraph { margin: 0; padding-left: 24px; border-left: 3px solid var(--accent); }
.epigraph blockquote { margin: 0; font-size: clamp(24px, 2.5vw, 34px); font-weight: 650; line-height: 1.15; letter-spacing: -.025em; }
.epigraph figcaption { margin-top: 12px; font-size: 14.5px; color: var(--ink-3); }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 44px); margin: clamp(48px, 6vw, 80px) 0 0; padding: 0; list-style: none; counter-reset: step; }
.step { position: relative; padding-top: 60px; }
.step::before { counter-increment: step; content: counter(step); position: absolute; top: 0; left: 0; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--ink); color: var(--paper); font: 700 15px/1 var(--font-mono); }
.step:not(:last-child)::after { content: ''; position: absolute; top: 19px; left: 54px; right: calc(-1 * clamp(20px, 3vw, 44px) + 14px); height: 2px; background: repeating-linear-gradient(90deg, var(--rule-2) 0 6px, transparent 6px 11px); }
.step h3 { font-size: 22px; margin-bottom: 8px; }
.step p { margin: 0; font-size: 17px; color: var(--ink-2); }
.access { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: clamp(48px, 6vw, 72px); border: 1px solid var(--rule); border-radius: 16px; overflow: hidden; }
.access-col { padding: clamp(22px, 3vw, 34px); }
.access h3 { display: flex; align-items: center; gap: 12px; font-size: 19px; margin-bottom: 16px; }
.access-ico { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; flex: none; }
.access-ico svg { width: 18px; height: 18px; }
.access-ico.ok { background: var(--pass-soft); color: var(--pass); }
.access-ico.lock { background: var(--paper-3); color: var(--ink-2); }
.access ul { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.access li { position: relative; padding-left: 22px; font-size: 16.5px; color: var(--ink-2); }
.access li::before { content: ''; position: absolute; left: 2px; top: .62em; width: 8px; height: 8px; border-radius: 2px; background: var(--pass); }
@media (max-width: 860px) {
  .task-intro { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; gap: 28px; }
  .step { padding: 0 0 0 60px; }
  .step:not(:last-child)::after { top: 48px; bottom: -22px; left: 19px; right: auto; width: 2px; height: auto; background: repeating-linear-gradient(180deg, var(--rule-2) 0 6px, transparent 6px 11px); }
  .access { grid-template-columns: 1fr; }
  .access-col.hidden-col { border-left: 0; border-top: 1px solid var(--rule); }
}

/* figure plates */
.plate { margin: clamp(48px, 6vw, 72px) 0 0; }
.plate-btn { display: block; width: 100%; padding: clamp(10px, 2vw, 24px); border: 1px solid var(--rule); border-radius: 16px; background: var(--plate); cursor: zoom-in; transition: border-color .15s ease, box-shadow .15s ease; }
.plate-btn:hover { border-color: var(--rule-2); box-shadow: var(--shadow); }
.plate-btn img { display: block; width: 100%; height: auto; }
.plate figcaption { margin-top: 14px; max-width: 92ch; font-size: 14.5px; color: var(--ink-3); }
.plate figcaption b { color: var(--ink); font-weight: 700; }

/* ---------- results ---------- */
.legend { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-bottom: 14px; font-size: 14px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.g-frontier { background: var(--c1); }
.g-open { background: var(--c2); }
.board-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: 16px; background: var(--paper); }
.board { width: 100%; min-width: 860px; border-collapse: collapse; font-size: 15.5px; }
.board th, .board td { padding: 13px 16px; border-bottom: 1px solid var(--rule); text-align: right; white-space: nowrap; }
.board tbody tr:last-child > * { border-bottom: 0; }
.board thead th { background: var(--paper-2); color: var(--ink-3); font-size: 13px; font-weight: 600; }
.board thead th button { all: unset; position: relative; display: inline-flex; align-items: center; cursor: pointer; border-radius: 4px; }
.board thead th button:hover { color: var(--ink); }
.board thead th button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.board thead th[aria-sort] { color: var(--ink); }
.board .arrow { position: absolute; left: calc(100% + 5px); top: 50%; width: 0; height: 0; margin-top: -2px; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid currentColor; opacity: 0; }
.board th[aria-sort] .arrow { opacity: 1; }
.board th[aria-sort="ascending"] .arrow { transform: rotate(180deg); }
.board .rank { width: 40px; text-align: left; color: var(--ink-3); font: 500 12.5px var(--font-mono); }
.board .model { text-align: left; }
.board td.model { position: sticky; left: 0; z-index: 1; background: var(--paper); }
.board thead th.model { position: sticky; left: 0; z-index: 2; }
.m-name { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; color: var(--ink); }
.m-org { display: block; margin: 2px 0 0 20px; font-size: 12.5px; color: var(--ink-3); }
.m-sub { display: none; }
.phone-only { display: none; }
.col-overall { width: 30%; }
.ov { display: grid; grid-template-columns: minmax(80px, 1fr) 54px; align-items: center; gap: 14px; }
.ov .bar { position: relative; height: 10px; border-radius: 5px; background: var(--paper-3); overflow: hidden; }
.ov .bar::after { content: ''; position: absolute; top: 0; bottom: 0; left: 25%; width: 2px; margin-left: -1px; background: var(--ink-3); opacity: .55; }
.board tr.group-break > * { border-top: 2px solid var(--ink); }
.ov .bar i { display: block; height: 100%; border-radius: 5px; background: var(--c1); }
.ov .bar i.open { background: var(--c2); }
.ov b { font-weight: 700; }
.board .best { font-weight: 800; color: var(--ink); }
/* Numbers use the mono face so decimals line up; this sans widens the point under tabular figures. */
.board td:not(.model):not(.rank), .ov b { font-family: var(--font-mono); font-variation-settings: 'wdth' 84; font-size: 14px; letter-spacing: -.01em; }
.board .best, .ov b.best { font-weight: 700; }
.board td { color: var(--ink-2); }
.board tr:hover td { background: var(--paper-2); }
.board tr:hover td.model { background: var(--paper-2); }
.board-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; margin-bottom: 14px; }
.board-tools .legend { margin-bottom: 0; }
.link-btn { display: inline-flex; align-items: flex-start; gap: 8px; padding: 6px 2px; border: 0; background: none; color: var(--accent); font: 600 14.5px/1.4 var(--font-sans); text-align: left; cursor: pointer; }
.link-btn:hover { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 3px; }
.link-btn svg { flex: none; width: 16px; height: 16px; margin-top: .15em; }
.fig-link { justify-self: start; margin-top: 4px; }
@media (max-width: 860px) {
  .sort-hint { display: none; }
  .board { min-width: 0; }
  .board th:nth-child(n+4), .board td:nth-child(n+4) { display: none; }
  .board td.model { white-space: normal; }
  .m-sub { display: flex; gap: 10px; margin: 4px 0 0 19px; font: 500 12px/1.4 var(--font-mono); font-variation-settings: 'wdth' 86; color: var(--ink-2); white-space: nowrap; }
  .m-sub em { margin-right: 3px; font-style: normal; color: var(--ink-3); }
  .phone-only { display: inline !important; }
  .board .ov { grid-template-columns: 40px minmax(40px, 1fr); gap: 10px; }
  .board .ov b { order: -1; }
  .board .col-overall { width: 34%; }
  .board th, .board td { padding: 12px 10px; }
  .m-org { margin-left: 19px; }
}
.table-note strong { color: var(--ink); }
.table-note { margin: 12px 0 0; font-size: 14px; color: var(--ink-3); max-width: 90ch; }
.takeaway { margin: clamp(24px, 3vw, 36px) 0 0; max-width: 70ch; font-size: 18px; color: var(--ink-2); }
.takeaway strong { color: var(--ink); }

.chart-block { margin-top: clamp(56px, 7vw, 96px); }
.chart-legend { margin: -4px 0 6px; }
.tabs { display: flex; gap: 26px; margin-bottom: 18px; border-bottom: 1px solid var(--rule); overflow-x: auto; scrollbar-width: none; }
.tab { all: unset; margin-bottom: -1px; padding: 10px 0 12px; border-bottom: 2px solid transparent; color: var(--ink-3); font-size: 15.5px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.scatter { position: relative; min-height: clamp(330px, calc((100vw - 80px) * .52), 460px); }
.scatter svg { display: block; overflow: visible; }
.scatter .grid line { stroke: var(--rule); stroke-width: 1; }
.scatter .axis-t { fill: var(--ink-3); font: 500 12.5px var(--font-sans); }
.scatter .axis-title { fill: var(--ink-2); font: 600 12.5px var(--font-sans); }
.scatter .pt { transition: transform .6s cubic-bezier(.2, .8, .2, 1); }
.scatter .pt circle.mark { stroke: var(--paper); stroke-width: 2.5; fill: var(--c1); }
.scatter .pt.g-open circle.mark { fill: var(--c2); }
.scatter .lab { fill: var(--ink); font: 600 12.5px var(--font-sans); paint-order: stroke; stroke: var(--paper); stroke-width: 4px; stroke-linejoin: round; pointer-events: none; transition: transform .6s cubic-bezier(.2, .8, .2, 1), opacity .2s ease; }
.scatter .pt.is-dim, .scatter .lab.is-dim { opacity: .3; }
.scatter .lab.is-hidden { opacity: 0; }
#results.is-linked .gb-row[data-model]:not(.is-hl) { opacity: .28; }
#results.is-linked .board tbody tr:not(.is-hl) td { opacity: .45; }
.gb-row, .board tbody td { transition: opacity .15s ease; }
.scatter .hit { fill: transparent; cursor: pointer; }
.scatter .frontier { fill: none; stroke: var(--ink-3); stroke-width: 1.5; stroke-dasharray: 5 5; opacity: .7; transition: opacity .25s ease; }
.scatter .frontier.is-moving { opacity: 0; }
.scatter .note path { fill: none; stroke: var(--ink-2); stroke-width: 1.25; stroke-linejoin: round; }
.scatter .note text { fill: var(--ink); font: 600 13px var(--font-sans); paint-order: stroke; stroke: var(--paper); stroke-width: 4px; stroke-linejoin: round; }
.scatter .note { transition: opacity .3s ease; }
.scatter .note.is-off { opacity: 0; }
.legend .dash { display: inline-block; width: 22px; height: 0; border-top: 1.5px dashed var(--ink-3); }
.chart-tip { position: absolute; z-index: 5; min-width: 190px; padding: 10px 12px; border: 1px solid var(--rule-2); border-radius: 10px; background: var(--paper); box-shadow: var(--shadow); font-size: 13.5px; line-height: 1.45; pointer-events: none; }
.chart-tip b { display: block; font-size: 14.5px; }
.chart-tip dl { display: grid; grid-template-columns: auto auto; gap: 2px 14px; margin: 6px 0 0; }
.chart-tip dt { color: var(--ink-3); }
.chart-tip dd { margin: 0; text-align: right; }
.chart-note { margin: 14px 0 0; max-width: 80ch; font-size: 14.5px; color: var(--ink-3); }

/* test-group small multiples */
.groups-chart { margin-top: clamp(56px, 7vw, 96px); }
.chart-sub { margin: -6px 0 18px; max-width: 72ch; font-size: 15px; color: var(--ink-3); }
.gbars { overflow-x: auto; }
.gb-row { display: grid; grid-template-columns: 190px repeat(3, minmax(150px, 1fr)); gap: 0 20px; align-items: center; min-width: 700px; padding: 6px 0; border-bottom: 1px solid var(--rule); }
.gb-head { border-bottom: 2px solid var(--ink); padding: 0 0 8px; font-size: 13.5px; font-weight: 700; }
.gb-name { display: inline-flex; align-items: center; gap: 9px; font-size: 14.5px; font-weight: 600; white-space: nowrap; }
.gb-cell { position: relative; display: flex; align-items: center; gap: 8px; min-width: 0; }
.gb-track { position: relative; flex: 1; min-width: 0; height: 22px; background: linear-gradient(90deg, var(--rule) 1px, transparent 1px) 0 0 / 50% 100%; }
.gb-track i { position: absolute; left: 0; top: 4px; width: var(--w); height: 14px; border-radius: 0 4px 4px 0; background: var(--c1); }
.gb-track i.open { background: var(--c2); }
.gb-cell b { flex: none; width: 38px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
@media (min-width: 1100px) { .gb-cell b { width: auto; padding: 0 3px; background: var(--paper); } }
@media (min-width: 1100px) {
  .gb-cell { gap: 0; }
  .gb-cell b { position: absolute; top: 50%; left: calc(var(--w) + 7px); transform: translateY(-50%); }
}
.gb-cell b.best { color: var(--ink); font-weight: 800; }
.gb-axis { border-bottom: 0; padding-top: 4px; }
.gb-ticks { position: relative; flex: 1; height: 16px; font-size: 12.5px; color: var(--ink-3); }
.gb-ticks em { position: absolute; top: 0; font-style: normal; transform: translateX(-50%); }
.gb-ticks em:nth-child(1) { left: 0; transform: none; }
.gb-ticks em:nth-child(2) { left: 50%; }
.gb-ticks em:nth-child(3) { left: 100%; transform: translateX(-100%); }
@media (max-width: 700px) {
  .gbars { overflow: visible; }
  .gb-row { grid-template-columns: repeat(3, minmax(0, 1fr)); min-width: 0; gap: 4px 12px; padding: 8px 0; }
  .gb-name { grid-column: 1 / -1; font-size: 14px; }
  .gb-head > span:first-child, .gb-axis > span:first-child { display: none; }
  .gb-track { height: 18px; }
  .gb-track i { top: 3px; height: 12px; }
  .gb-cell { gap: 5px; }
  .gb-cell b { width: 32px; font-size: 12.5px; }
  .gb-ticks em:nth-child(2) { display: none; }
}

/* case evidence strips */
.evidence { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; margin: 0 0 26px; }
.ev { display: flex; flex-direction: column; margin: 0; }
.ev > .ev-frame, .ev > .ev-term { flex: 1; }
.ev figcaption { margin-bottom: 8px; font-size: 13px; font-weight: 700; color: var(--ink-3); }
.ev.is-bad figcaption { color: var(--fail); }
.ev.is-good figcaption { color: var(--pass); }
.ev-frame { overflow: hidden; border: 1px solid #D9DDE3; border-radius: 12px; background: #FAFAF8; color: #1B1E24; }
.ev.is-bad .ev-frame { box-shadow: 0 0 0 2px var(--fail); border-color: transparent; }
.ev-url { padding: 7px 12px; border-bottom: 1px solid #E3E5E9; background: #ECEEF2; font: 500 11.5px var(--font-mono); font-variation-settings: 'wdth' 88; color: #555D6D; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-url b { color: #14171D; font-weight: 600; }
.ev-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 12px; }
.ev-tile { display: grid; justify-items: center; gap: 2px; padding: 8px 4px 6px; border-radius: 10px; }
.ev-tile svg { width: 48px; height: 48px; }
.ev-tile b { font-size: 12.5px; font-weight: 650; }
.ev-tabs { display: flex; gap: 18px; padding: 12px 14px 0; font-size: 13px; font-weight: 650; color: #555D6D; border-bottom: 1px solid #E3E5E9; }
.ev-tabs span { padding-bottom: 8px; border-bottom: 2px solid transparent; }
.ev-tabs span.on { color: #1B1E24; border-bottom-color: #1B1E24; }
.ev-posters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 12px 14px 14px; }
.ev-posters i { aspect-ratio: 2 / 3; border-radius: 6px; }
.ev-screen { margin: 12px auto 6px; width: 70%; padding: 3px 0; border-radius: 0 0 20px 20px; background: #E3E5E9; text-align: center; font-size: 10.5px; font-weight: 600; color: #555D6D; }
.ev-seats { display: grid; gap: 5px; justify-content: center; padding: 6px 0 4px; }
.ev-seatrow { display: flex; align-items: center; gap: 5px; }
.ev-seatrow em { width: 14px; font-style: normal; font-size: 11px; font-weight: 700; color: #555D6D; }
.ev-seatrow i { width: 20px; height: 16px; border-radius: 4px 4px 2px 2px; background: #D5D9E0; }
.ev-seatrow i.sel { background: #2D5BE3; }
.ev-total { display: flex; justify-content: space-between; margin: 6px 14px 12px; padding-top: 8px; border-top: 1px dashed #D5D9E0; font-size: 13px; }
.ev-total b { font-weight: 800; }
.ev-term { display: grid; align-content: start; gap: 4px; padding: 14px 16px; border-radius: 12px; background: var(--term); color: #D6DBE4; font: 400 12.5px/1.6 var(--font-mono); font-variation-settings: 'wdth' 90; }
.ev-term p { margin: 0; }
.ev-term .k { color: #9DB5FF; margin-right: 8px; }
.ev-term .ok { color: #7FE0A0; margin-right: 8px; }
.ev-note { grid-column: 1 / -1; margin: 0; font-size: 12.5px; color: var(--ink-3); }
@media (max-width: 640px) { .evidence { grid-template-columns: 1fr; } }

/* scoring widget */
.try { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--rule); }
.try-h { margin: 0 0 10px; font-size: 14px; font-weight: 700; color: var(--ink); }
.try-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) 44px; align-items: center; gap: 12px; margin-bottom: 6px; font-size: 14.5px; color: var(--ink-2); }
.try-check { display: flex; gap: 10px; }
.try input[type="range"] { width: 100%; accent-color: var(--pass); }
.try input[type="range"].below { accent-color: var(--fail); }
.try input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--pass); }
.try output { font: 600 13px var(--font-mono); text-align: right; color: var(--ink); }
.try-out { display: flex; align-items: center; gap: 12px; margin: 12px 0 0; font-size: 15px; color: var(--ink-2); }
.try-p { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 8px; font: 800 18px var(--font-sans); color: var(--paper); }
.try-p.p1 { background: var(--pass); }
.try-p.p0 { background: var(--fail); }

/* ---------- findings ---------- */
.finding { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 32px clamp(32px, 6vw, 96px); padding-block: clamp(44px, 6vw, 76px); border-top: 1px solid var(--rule); }
.intro + .finding { padding-top: 0; border-top: 0; }
.finding-text p { margin: 0 0 1em; color: var(--ink-2); max-width: 58ch; }
.finding-text p:last-child { margin-bottom: 0; }
.finding-tag { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 18px !important; padding: 5px 12px 5px 5px; border-radius: 8px; background: var(--fail-soft); color: var(--fail) !important; font-size: 14px; font-weight: 700; }
.finding-tag.is-note { padding: 5px 12px; background: var(--paper-2); color: var(--ink-2) !important; }
.finding-sub { border-top: 0; padding-top: 0; }
@media (min-width: 1000px) { .finding-text { position: sticky; top: 96px; align-self: start; } }
.grid-title b { color: var(--fail); font-weight: 800; }
.viz-title b { white-space: nowrap; }
.finding-tag span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: var(--fail); color: var(--paper); font: 700 12px/1 var(--font-mono); }
.finding-viz { display: grid; align-content: start; gap: 14px; }
.viz-title { margin: 8px 0 0; font-size: 13.5px; font-weight: 600; color: var(--ink-3); }
.viz-title:first-child { margin-top: 0; }
.viz-foot { margin: 4px 0 0; font-size: 14px; color: var(--ink-3); }
.loadbars { display: grid; gap: 18px; }
.loadbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: baseline; }
.lb-label { font-size: 16px; font-weight: 600; }
.lb-val { font-size: 14px; color: var(--ink-3); }
.lb-val b { margin-right: 6px; font-size: 20px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); }
.lb-track { grid-column: 1 / -1; position: relative; height: 12px; border-radius: 6px; background: var(--paper-3); overflow: hidden; }
.lb-track i { position: absolute; inset: 0 auto 0 0; border-radius: 6px; background: var(--c1); }
.is-stalled .lb-track i { background: var(--fail); min-width: 8px; }
.is-stalled .lb-val b { color: var(--fail); }
.pair-bars { display: grid; gap: 12px; }
.pb { display: grid; grid-template-columns: 190px minmax(0, 1fr) 56px; align-items: center; gap: 14px; font-size: 15px; }
.pb-track, .d-track { position: relative; height: 26px; background: linear-gradient(90deg, var(--rule) 1px, transparent 1px) 0 0 / 33.333% 100%; box-shadow: inset -1px 0 0 var(--rule); }
.pb-track i { display: block; height: 100%; border-radius: 0 5px 5px 0; background: var(--ink-3); }
.pb.is-up .pb-track i { background: var(--c1); }
.pb-val { font-size: 19px; font-weight: 800; text-align: right; letter-spacing: -.02em; }
.units { display: grid; grid-template-columns: repeat(18, minmax(0, 1fr)); gap: 4px; max-width: 520px; }
.u { display: inline-block; aspect-ratio: 1; border-radius: 4px; background: var(--cell); }
.u.up { background: var(--pass); }
.u.eq { background: var(--cell); }
.u.down { background: var(--fail); }
.u.ok { background: var(--pass); }
.u.bad { background: var(--fail); opacity: .82; }
.unit-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: var(--ink-2); }
.unit-legend span { display: inline-flex; align-items: center; gap: 8px; }
.unit-legend .u { width: 12px; height: 12px; flex: none; }
.mini-compare { width: 100%; margin-top: 10px; border-collapse: collapse; font-size: 14.5px; }
.mini-compare th, .mini-compare td { padding: 9px 10px 9px 0; border-bottom: 1px solid var(--rule); text-align: left; }
.mini-compare thead th { font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.mini-compare tbody th { font-weight: 650; }
.mini-compare td { color: var(--ink-2); }
.waffle { display: grid; grid-template-columns: repeat(auto-fill, minmax(13px, 1fr)); gap: 4px; }
.waffle .u { border-radius: 3px; }
.wf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(13px, 1fr)); gap: 4px; }
.u.wf-done { background: var(--ink); }
.u.wf-started { background: color-mix(in srgb, var(--c1) 30%, var(--paper)); }
.u.wf-none { background: transparent; box-shadow: inset 0 0 0 1.5px var(--rule-2); }
.stack { display: flex; height: 40px; gap: 2px; border-radius: 7px; overflow: hidden; }
.seg { display: flex; align-items: center; padding-left: 10px; min-width: 0; font-size: 13.5px; white-space: nowrap; overflow: hidden; }
.seg b { font-weight: 700; }
.seg.t-explore { background: var(--c1); color: var(--on-c1); }
.seg.t-edit { background: var(--ink); color: var(--paper); }
.seg.t-check { background: color-mix(in srgb, var(--c1) 34%, var(--paper)); color: var(--ink); }
.seg.t-other { background: var(--cell); }
.stack-legend { display: grid; grid-template-columns: repeat(2, minmax(0, max-content)); gap: 6px 22px; font-size: 14px; color: var(--ink-2); }
.stack-legend span { display: inline-flex; align-items: center; gap: 8px; }
.stack-legend b { color: var(--ink); font-weight: 700; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.sw.t-explore { background: var(--c1); }
.sw.t-edit { background: var(--ink); }
.sw.t-check { background: color-mix(in srgb, var(--c1) 34%, var(--paper)); }
.sw.t-other { background: var(--cell); }
.timeline { display: grid; gap: 16px; }
.tl-row { display: grid; grid-template-columns: 150px minmax(0, 1fr); align-items: center; gap: 14px; }
.tl-label { font-size: 14.5px; font-weight: 600; }
.tl-track { position: relative; height: 26px; border-radius: 5px; background: repeating-linear-gradient(90deg, var(--paper-3) 0 calc(25% - 1px), var(--rule-2) calc(25% - 1px) 25%); }
.tl-bar { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 5px; background: var(--ink-3); }
.tl-bar.alt { background: var(--c2); }
.tl-bar.good { background: var(--c3); }
.tl-unused { position: absolute; top: 5px; bottom: 5px; right: 0; border: 1.5px dashed var(--rule-2); border-left: 0; border-radius: 0 4px 4px 0; }
.tl-end { position: absolute; top: 50%; transform: translate(8px, -50%); font-size: 13px; font-weight: 700; white-space: nowrap; color: var(--ink); text-shadow: 0 0 4px var(--paper), 0 0 4px var(--paper); }
.tl-end.tl-in { transform: translate(calc(-100% - 10px), -50%); color: var(--on-c3); text-shadow: none; }
.tl-mark, .tl-mark-key { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-left: -1.5px; border-radius: 2px; background: var(--fail); }
.tl-mark-key { position: static; display: inline-block; height: 14px; margin: 0 8px 0 0; vertical-align: -2px; }
.tl-axis { position: relative; height: 16px; margin-left: 164px; font-size: 12.5px; color: var(--ink-3); }
.tl-axis span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.tl-axis span:first-child { transform: none; }
.tl-axis span:last-child { transform: translateX(-100%); }
.tl-note { margin: 0; font-size: 14px; color: var(--ink-3); }
.deltas { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 10px 0 0; border-top: 1px solid var(--rule); }
.deltas > div { padding: 12px 10px 0 0; }
.deltas dt { font-size: 13px; color: var(--ink-3); }
.deltas dd { margin: 2px 0 0; font-size: 17px; font-weight: 750; letter-spacing: -.01em; white-space: nowrap; }
.deltas dd span { color: var(--ink-3); font-weight: 400; }
.depth { display: grid; gap: 14px; }
.d-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) 62px; align-items: center; gap: 14px; }
.d-label { font-size: 14.5px; font-weight: 600; }
.d-track i { display: block; height: 100%; border-radius: 0 5px 5px 0; background: var(--c1); }
.pb-axis, .d-axis { margin-top: -6px; }
.pb-axis .ticks, .d-axis .ticks { position: relative; height: 16px; font-size: 12.5px; color: var(--ink-3); }
.pb-axis .ticks em, .d-axis .ticks em { position: absolute; top: 0; font-style: normal; transform: translateX(-50%); }
.pb-axis .ticks em:first-child, .d-axis .ticks em:first-child { transform: none; }
.pb-axis .ticks em:last-child, .d-axis .ticks em:last-child { transform: translateX(-100%); }
.d-val { font-size: 17px; font-weight: 800; text-align: right; }
.pull-fig { margin-top: 18px; }
.pull-fig blockquote { font-size: clamp(19px, 1.6vw, 22px); line-height: 1.3; }
@media (max-width: 900px) {
  .finding { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .pb, .d-row { grid-template-columns: minmax(0, 1fr) 56px; }
  .pb-label, .d-label { grid-column: 1 / -1; }
  .pb-axis > span:first-child, .d-axis > span:first-child { display: none; }
  .tl-row { grid-template-columns: 1fr; gap: 6px; }
  .tl-axis { margin-left: 0; }
  .deltas { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 10px; }
  .stack-legend { grid-template-columns: 1fr; }
  .seg { padding-left: 6px; font-size: 12px; }
  .seg.t-edit b { display: none; }
}

/* case studies */
.cases { margin-top: clamp(24px, 4vw, 40px); padding-block: clamp(48px, 6vw, 80px); background: var(--paper-2); box-shadow: 0 0 0 100vmax var(--paper-2); clip-path: inset(0 -100vmax); }
.cases .case { background: var(--paper); }
.cases-h { margin-bottom: 8px; }
.cases-sub { margin: 0 0 24px; max-width: 70ch; color: var(--ink-2); font-size: 16.5px; }
.case { padding: clamp(20px, 3vw, 32px); border: 1px solid var(--rule); border-radius: 16px; background: var(--paper-2); }
.case-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; margin-bottom: 20px; }
.case-title { margin: 0; font-size: 21px; font-weight: 750; letter-spacing: -.015em; }
.verdict { display: inline-flex; align-items: center; gap: 8px; padding: 5px 11px; border-radius: 20px; font-size: 13.5px; font-weight: 700; }
.verdict::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.verdicts { display: inline-flex; flex-wrap: wrap; gap: 8px; }
.case-twist { margin-top: 12px !important; padding: 10px 12px; border-left: 3px solid var(--fail); border-radius: 0 8px 8px 0; background: var(--fail-soft); color: var(--ink) !important; font-size: 15px !important; }
.verdict.ok { background: var(--pass-soft); color: var(--pass); }
.verdict.bad { background: var(--fail-soft); color: var(--fail); }
.case-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.5fr) minmax(0, .9fr); gap: clamp(18px, 3vw, 36px); }
.case-k { margin: 0 0 6px; font-size: 13px; font-weight: 700; color: var(--ink-3); }
.case-ref p:not(.case-k), .case-out p:not(.case-k) { margin: 0; font-size: 15.5px; color: var(--ink-2); }
.trace { position: relative; display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.trace::before { content: ''; position: absolute; top: 8px; bottom: 8px; left: 6px; width: 2px; background: var(--rule-2); }
.trace li { position: relative; display: grid; gap: 3px; padding-left: 26px; font-size: 15px; color: var(--ink-2); }
.trace li::before { content: ''; position: absolute; left: 1px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--paper-2); border: 2px solid var(--ink-3); }
.trace li.good::before { background: var(--pass); border-color: var(--pass); }
.trace li.bad::before { background: var(--fail); border-color: var(--fail); }
.trace li > code { font-size: 12px; color: var(--ink-3); }
.trace span code { font-size: .86em; color: var(--ink); }
@media (max-width: 960px) {
  .case-grid { grid-template-columns: 1fr; }
}
.caught { margin-top: clamp(48px, 6vw, 72px); }
.caught ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px clamp(24px, 4vw, 56px); margin: 0; padding: 0; list-style: none; }
.caught li { position: relative; padding-left: 26px; font-size: 16.5px; color: var(--ink-2); }
.caught li::before { content: ''; position: absolute; left: 0; top: .5em; width: 12px; height: 12px; border-radius: 3px; background: var(--fail); transform: rotate(45deg) scale(.75); }
.caught b { color: var(--ink); }
@media (max-width: 760px) { .caught ul { grid-template-columns: 1fr; } }

/* ---------- benchmark ---------- */
.corpus { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 32px clamp(32px, 6vw, 96px); align-items: start; }
.corpus-text p { margin: 0; color: var(--ink-2); max-width: 54ch; }
.corpus-text .named { margin-top: 24px; font-size: 14px; font-weight: 600; color: var(--ink-3); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; padding: 0; list-style: none; }
.chips li { padding: 5px 11px; border: 1px solid var(--rule-2); border-radius: 999px; font-size: 14px; font-weight: 550; color: var(--ink-2); background: var(--paper); }
.cat { display: grid; grid-template-columns: 190px 30px minmax(0, 1fr); align-items: center; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--rule); }
.cat:first-child { border-top: 1px solid var(--rule); }
.cat-name { font-size: 14.5px; font-weight: 600; }
.cat-n { font-size: 14.5px; font-weight: 800; text-align: right; }
.wins { display: flex; flex-wrap: wrap; gap: 3px; }
.win { width: 12px; height: 12px; border-radius: 3px; background: var(--ink-2); }
@media (max-width: 900px) {
  .corpus { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .cat { grid-template-columns: minmax(0, 1fr) 30px; }
  .wins { grid-column: 1 / -1; }
}
.groups { margin-top: clamp(64px, 8vw, 104px); }
.groups-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) minmax(0, 1fr); border: 1px solid var(--rule); border-radius: 16px; overflow: hidden; }
.grp { padding: clamp(20px, 2.6vw, 30px); }
.grp + .grp { border-left: 1px solid var(--rule); }
.grp-wide { background: var(--paper-2); }
.grp-k { margin: 0 0 4px; font: 600 12.5px var(--font-mono); color: var(--accent); }
.grp h4 { margin-bottom: 8px; font-size: 22px; font-weight: 750; letter-spacing: -.02em; }
.grp p { margin: 0; font-size: 16px; color: var(--ink-2); }
.levels { display: grid; gap: 10px; margin: 16px 0; padding: 0; list-style: none; }
.levels li { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 10px; font-size: 15.5px; color: var(--ink-2); }
.levels b { display: grid; place-items: center; height: 26px; border-radius: 6px; background: var(--paper); border: 1px solid var(--rule-2); font: 600 12px var(--font-mono); color: var(--ink); }
.grp-note { padding-top: 12px; border-top: 1px dashed var(--rule-2); font-size: 14.5px !important; }
@media (max-width: 900px) {
  .groups-grid { grid-template-columns: 1fr; }
  .grp + .grp { border-left: 0; border-top: 1px solid var(--rule); }
}
.scoring { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px clamp(32px, 6vw, 96px); margin-top: clamp(64px, 8vw, 104px); align-items: start; }
.ticks { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.ticks li { position: relative; padding-left: 28px; color: var(--ink-2); font-size: 16.5px; }
.ticks li::before { content: ''; position: absolute; left: 0; top: .42em; width: 16px; height: 16px; border-radius: 50%; background: var(--pass-soft); box-shadow: inset 0 0 0 5px var(--pass-soft), inset 0 0 0 16px var(--pass); transform: scale(.7); }
.formula { padding: clamp(22px, 3vw, 34px); border: 1px solid var(--rule); border-radius: 16px; background: var(--paper-2); }
.formula-eq { font-size: clamp(22px, 2.2vw, 28px); margin: 6px 0 14px; color: var(--ink); font-family: 'Noto Sans Math', math; }
.formula-key { display: grid; gap: 8px; margin: 18px 0 0; padding-top: 16px; border-top: 1px solid var(--rule); font-size: 14.5px; }
.formula-key > div { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 10px; }
.formula-key dt { font-size: 16px; font-style: italic; color: var(--ink); }
.formula-key dd { margin: 0; color: var(--ink-2); }
@media (max-width: 900px) { .scoring { grid-template-columns: 1fr; } }
.validity { margin-top: clamp(64px, 8vw, 104px); }
.validity > p { margin: 0 0 28px; max-width: 72ch; color: var(--ink-2); }
.design-wrap, .rel-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: 16px; }
.design, .rel { width: 100%; border-collapse: collapse; font-size: 15px; }
.design { min-width: 680px; }
.design caption { padding: 14px 18px; text-align: left; font-size: 13.5px; font-weight: 600; color: var(--ink-3); background: var(--paper-2); border-bottom: 1px solid var(--rule); }
.design th, .design td, .rel th, .rel td { padding: 12px 18px; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
.design thead th, .rel thead th { font-size: 13px; font-weight: 600; color: var(--ink-3); background: var(--paper-2); }
.design tbody th { font-weight: 650; white-space: nowrap; }
.design td { color: var(--ink-2); }
.design td:last-child { color: var(--fail); }
.design tbody tr:last-child > *, .rel tbody tr:last-child > * { border-bottom: 0; }
.contract { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 32px clamp(32px, 6vw, 96px); margin-top: clamp(64px, 8vw, 104px); align-items: start; }
.contract-text p { margin: 0; color: var(--ink-2); }
.code-wrap { overflow-x: auto; border-radius: 14px; background: #14171D; }
.code { margin: 0; padding: clamp(18px, 2.4vw, 26px); color: #D6DBE4; font: 400 13px/1.9 var(--font-mono); font-variation-settings: 'wdth' 88; }
.code code { font-size: 1em; font-variation-settings: inherit; }
.code .k { color: #9DB5FF; font-weight: 600; }
.contract-list { display: grid; gap: 0; margin: 0; padding: clamp(14px, 2vw, 20px) clamp(18px, 2.4vw, 26px); border-radius: 14px; background: var(--term); }
.contract-list > div { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 4px 20px; padding: 9px 0; border-bottom: 1px solid #262B35; }
.contract-list > div:last-child { border-bottom: 0; }
.contract-list dt { color: #9DB5FF; font: 600 13px/1.6 var(--font-mono); font-variation-settings: 'wdth' 88; }
.contract-list dd { margin: 0; color: #C3C9D4; font-size: 15px; line-height: 1.5; }
@media (max-width: 560px) { .contract-list > div { grid-template-columns: 1fr; } }
.code .c { color: #8B94A5; }
@media (max-width: 900px) { .contract { grid-template-columns: 1fr; } }

/* ---------- related ---------- */
.rel { min-width: 980px; }
.rel tbody th { font-weight: 650; white-space: nowrap; }
.rel td { color: var(--ink-2); }
.rel td.yes { color: var(--pass); font-weight: 650; }
.rel td.no { color: var(--ink-3); }
.rel tr.ours > * { background: var(--accent-soft); color: var(--ink); font-weight: 650; }
.rel tr.ours th { box-shadow: inset 3px 0 0 var(--accent); }
.rel td:nth-child(3) { white-space: nowrap; }
.rel td.yes, .rel td.no { font-size: 17px; line-height: 1.2; }
.rel tr.ours td.yes { color: var(--pass); }

/* dark panels keep an edge on the dark page */
.code-wrap, .bib, .contract-list, .ev-term { box-shadow: inset 0 0 0 1px var(--code-edge); }

/* sideways-scrolling tables show a fade while more columns hide to the right */
.board-wrap.can-scroll, .rel-wrap.can-scroll, .design-wrap.can-scroll { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 48px), transparent); }
@media (max-width: 600px) {
  .route { display: none; }
}

@media (max-width: 600px) {
  .design { min-width: 0; }
  .design caption { display: block; }
  .design thead, .rel thead { display: none; }
  .design tbody, .rel tbody, .design tr, .rel tr, .design th, .rel th, .design td, .rel td { display: block; }
  .design tr, .rel tr { padding: 14px 16px; border-bottom: 1px solid var(--rule); }
  .design tbody tr:last-child, .rel tbody tr:last-child { border-bottom: 0; }
  .design th, .design td, .rel th, .rel td { padding: 2px 0; border: 0; white-space: normal; }
  .design tbody th, .rel tbody th { margin-bottom: 6px; font-size: 16px; }
  .design td::before, .rel td::before { content: attr(data-label); display: block; margin-top: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
  .rel tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
  .rel tbody th { grid-column: 1 / -1; }
  .rel td { font-size: 14.5px; }
  .rel td::before { margin-top: 8px; font-size: 12px; }
  .rel tr.ours { box-shadow: inset 3px 0 0 var(--accent); background: var(--accent-soft); }
  .rel tr.ours > * { background: none; }
  .rel tr.ours th { box-shadow: none; }
  .design-wrap.can-scroll, .rel-wrap.can-scroll { -webkit-mask-image: none; mask-image: none; }
}

@media (max-width: 900px) {
  .rel { min-width: 0; }
  .rel thead { display: none; }
  .rel tbody, .rel tr, .rel th, .rel td { display: block; }
  .rel tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; padding: 14px 16px; border-bottom: 1px solid var(--rule); }
  .rel tbody tr:last-child { border-bottom: 0; }
  .rel th, .rel td { padding: 2px 0; border: 0; white-space: normal; }
  .rel tbody th { grid-column: 1 / -1; margin-bottom: 6px; font-size: 16px; }
  .rel td { font-size: 14.5px; }
  .rel td::before { content: attr(data-label); display: block; margin-top: 8px; font-size: 12px; font-weight: 600; color: var(--ink-3); }
  .rel tr.ours { box-shadow: inset 3px 0 0 var(--accent); background: var(--accent-soft); }
  .rel tr.ours > * { background: none; }
  .rel tr.ours th { box-shadow: none; }
  .rel-wrap.can-scroll { -webkit-mask-image: none; mask-image: none; }
}
@media (min-width: 640px) and (max-width: 900px) { .rel tbody tr { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------- faq ---------- */
.faq { max-width: 880px; border-top: 1px solid var(--rule); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary { position: relative; display: block; padding: 20px 48px 20px 0; font-size: clamp(18px, 1.6vw, 21px); font-weight: 650; letter-spacing: -.01em; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ''; position: absolute; right: 8px; top: 50%; width: 12px; height: 12px; margin-top: -9px; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: rotate(45deg); transition: transform .2s ease; }
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -3px; }
.faq summary:hover { color: var(--accent); }
.faq details p { margin: -4px 0 22px; max-width: 70ch; color: var(--ink-2); }

/* FAQ and Cite share the last screen on wide layouts */
@media (min-width: 1000px) {
  .end-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 0 clamp(40px, 5vw, 72px); align-items: start; }
  .end-grid .sec-head h2 { font-size: clamp(28px, 3vw, 40px); }
  .end-grid .bib { max-width: none; }
  .end-grid #cite .tabs { max-width: none; }
}

/* ---------- cite ---------- */
#cite .tabs { max-width: 860px; }
.bib { position: relative; max-width: 860px; border-radius: 14px; background: var(--term); overflow: hidden; }
.cite-bar { max-width: 860px; }
.end-grid .cite-bar { max-width: none; }
.bib .code { overflow-x: auto; }
.cite-bar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.cite-bar .tabs { flex: 1; margin-bottom: 0; }
.copy { margin-bottom: 8px; }
.copy.is-done { color: var(--pass); border-color: var(--pass); }
#cite .bib { margin-top: 16px; }
#plaincite { white-space: pre-wrap; }

/* ---------- footer ---------- */
.footer { margin-top: clamp(96px, 12vw, 160px); padding-block: 40px 56px; border-top: 1px solid var(--rule); color: var(--ink-3); font-size: 15px; }
.footer-in { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 32px; }
.footer p { margin: 0; }
.footer-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 800; letter-spacing: -.02em; }
.footer-links { display: flex; gap: 20px; margin-left: auto !important; }
@media (max-width: 900px) { .footer-links { margin-left: 0 !important; flex-basis: 100%; } }
.footer a { color: var(--ink-2); text-decoration: none; }
.footer a:hover { color: var(--accent); }

/* ---------- lightbox ---------- */
.lightbox { width: min(96vw, 1600px); max-width: none; max-height: 94vh; padding: 0; border: 0; border-radius: 14px; background: #fff; box-shadow: 0 30px 80px rgba(0, 0, 0, .4); overflow: auto; }
.lightbox::backdrop { background: rgba(10, 12, 16, .72); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.lightbox img { display: block; width: 100%; height: auto; min-width: 900px; padding: 20px; }
.lb-close { position: sticky; top: 10px; left: calc(100% - 52px); z-index: 2; display: grid; place-items: center; width: 40px; height: 40px; margin: 10px 10px -50px auto; border: 0; border-radius: 50%; background: #14171D; color: #fff; cursor: pointer; }
.lb-close svg { width: 18px; height: 18px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
