/* ==========================================================================
   UBA RESEARCH — monochrome research system.
   SF typography, black / white / grayscale only.
   ========================================================================== */

:root {
  --paper: #f7f7f5;
  --paper-2: #ececea;
  --paper-3: #dededb;
  --card: #ffffff;
  --ink: #0b0b0b;
  --ink-2: #343434;
  --muted: #666666;
  --faint: #8c8c8c;
  --rule: #d9d9d6;
  --rule-2: #b4b4b0;
  --accent: #0b0b0b;
  --accent-2: #0b0b0b;
  --accent-soft: #e5e5e2;
  --signal: #0b0b0b;
  --signal-2: #333333;
  --teal: #0b0b0b;
  --gold: #0b0b0b;
  --night: #0b0b0b;
  --night-2: #141414;
  --night-3: #1f1f1f;
  --night-ink: #f7f7f5;
  --night-ink-2: #d0d0cc;
  --night-muted: #9a9a96;
  --night-rule: #333333;
  --serif: var(--sans);
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "SF Pro", "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: var(--sans);
  --code: "SF Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  --reading: 17px;
  --sidebar: 296px;
  --article: 790px;
  --header: 84px;
  --ease: cubic-bezier(.2, .7, .25, 1);
  --shadow: 0 30px 80px rgba(0, 0, 0, .12);
}

[data-theme="night"] {
  --paper: #0b0b0b;
  --paper-2: #141414;
  --paper-3: #1e1e1e;
  --card: #111111;
  --ink: #f7f7f5;
  --ink-2: #d0d0cc;
  --muted: #9a9a96;
  --faint: #6e6e6a;
  --rule: #333333;
  --rule-2: #4a4a46;
  --accent: #f7f7f5;
  --accent-2: #ffffff;
  --accent-soft: #262626;
  --signal: #f7f7f5;
  --signal-2: #d0d0cc;
  --teal: #f7f7f5;
  --gold: #f7f7f5;
  --night: #000000;
  --night-2: #0b0b0b;
  --night-3: #141414;
  --night-ink: #f7f7f5;
  --night-ink-2: #d0d0cc;
  --night-muted: #9a9a96;
  --night-rule: #333333;
  --shadow: 0 30px 80px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header) + 28px); }
body {
  margin: 0; overflow-x: hidden;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: var(--reading);
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body::after {
  content: "";
  position: fixed; inset: 0; z-index: 1000; pointer-events: none;
  opacity: .045; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.6'/%3E%3C/svg%3E");
}
[data-theme="night"] body::after { mix-blend-mode: screen; opacity: .035; }
::selection { background: var(--accent); color: #fff; }
a { color: inherit; }
img { max-width: 100%; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { text-wrap: balance; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.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-link:focus {
  position: fixed; z-index: 1200; top: 10px; left: 10px; width: auto; height: auto;
  clip: auto; margin: 0; padding: 8px 12px; background: var(--ink); color: var(--paper);
  font: 12px var(--mono);
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 100; height: var(--header);
  display: flex; align-items: center; gap: 32px; padding: 0 34px;
  background: color-mix(in srgb, var(--paper) 93%, transparent);
  backdrop-filter: blur(14px) saturate(130%);
  border-bottom: 1px solid color-mix(in srgb, var(--rule) 70%, transparent);
}
.brand { display: flex; align-items: center; gap: 13px; text-decoration: none; color: var(--ink); flex: 0 0 auto; }
.brand-mark { width: 34px; height: 34px; color: var(--accent); display: block; }
.brand-name { font: 500 13px var(--mono); letter-spacing: .08em; line-height: 1.2; }
.brand-name small { display: block; font-size: 8px; letter-spacing: .2em; color: var(--muted); margin-top: 4px; }
.topnav { display: flex; align-items: center; gap: 29px; flex: 1; margin-left: 22px; }
.topnav a {
  color: var(--muted); font-family: var(--mono); font-size: 11px; letter-spacing: .03em;
  text-decoration: none; white-space: nowrap; padding: 4px 0; position: relative;
  transition: color .18s;
}
.topnav a span { color: var(--faint); margin-right: 6px; }
.topnav a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -2px; height: 1px;
  background: var(--accent); transition: right .22s var(--ease);
}
.topnav a:hover, .topnav a.active { color: var(--ink); }
.topnav a:hover::after, .topnav a.active::after { right: 0; }
.top-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.download-link {
  display: inline-flex; align-items: center; gap: 16px; height: 36px; padding: 0 16px;
  background: var(--ink); color: var(--paper); text-decoration: none;
  font: 10.5px var(--mono); letter-spacing: .02em; white-space: nowrap;
  transition: background .18s, color .18s;
}
.download-link span { color: color-mix(in srgb, var(--paper) 55%, transparent); font-size: 13px; }
.download-link:hover { background: var(--accent); color: #fff; }
.download-link:hover span { color: #fff; }
.icon-btn {
  width: 36px; height: 36px; border: 0; background: transparent; display: grid; place-items: center;
  color: var(--muted); transition: color .18s, background .18s;
}
.icon-btn:hover { color: var(--ink); background: var(--paper-2); }
.icon-btn svg { width: 17px; height: 17px; }
.menu-toggle { display: none; }
.progress { position: fixed; left: 0; top: 0; z-index: 130; width: 100%; height: 2px; pointer-events: none; }
.progress span { display: block; height: 100%; width: 0; background: var(--accent); }

/* ---------- shell / sidebar ---------- */
.shell {
  display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr);
  max-width: 1580px; margin: 0 auto;
}
.shell-full { display: block; max-width: none; }
.sidebar { border-right: 1px solid var(--rule); min-width: 0; }
.side-inner {
  position: sticky; top: var(--header); height: calc(100vh - var(--header));
  overflow-y: auto; padding: 30px 20px 60px;
  scrollbar-width: thin; scrollbar-color: var(--rule-2) transparent;
}
.side-label {
  display: flex; justify-content: space-between; align-items: baseline;
  font: 9px var(--mono); letter-spacing: .18em; color: var(--faint);
  text-transform: uppercase; margin: 0 10px 12px;
}
.side-label span { letter-spacing: .04em; }
.chapter-nav { display: flex; flex-direction: column; gap: 1px; }
.chapter-link {
  display: grid; grid-template-columns: 31px minmax(0, 1fr); gap: 8px; align-items: baseline;
  padding: 8px 10px; text-decoration: none; border-left: 2px solid transparent;
  color: var(--muted); transition: color .18s, background .18s, border-color .18s;
}
.chapter-link .num { font: 12px var(--mono); color: var(--faint); }
.chapter-link .t { font-size: 12.5px; line-height: 1.5; }
.chapter-link:hover { color: var(--ink); background: var(--card); }
.chapter-link.active { color: var(--ink); background: var(--card); border-left-color: var(--accent); }
.chapter-link.active .num { color: var(--accent); }
.side-divider { height: 1px; background: var(--rule); margin: 23px 10px; }
.toc { display: flex; flex-direction: column; border-left: 1px solid var(--rule); margin-left: 10px; }
.toc a {
  display: block; padding: 5px 0 5px 12px; margin-left: -1px;
  border-left: 1px solid transparent; color: var(--muted); text-decoration: none;
  font-size: 11.8px; line-height: 1.55; transition: color .18s, border-color .18s;
}
.toc a:hover { color: var(--ink); }
.toc a.active { color: var(--accent); border-left-color: var(--accent); }
.toc a.lvl3 { padding-left: 23px; font-size: 11px; color: var(--faint); }
.side-meta {
  margin: 25px 10px 0; padding-top: 15px; border-top: 1px solid var(--rule);
  font: 9px/1.9 var(--mono); color: var(--faint); letter-spacing: .035em;
}
.side-meta b { color: var(--muted); font-weight: 400; }
.nav-scrim { display: none; }
.main { min-width: 0; }

/* ---------- home hero ---------- */
.hero {
  position: relative; overflow: hidden; background: var(--night); color: var(--night-ink);
  border-bottom: 1px solid #000;
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(247, 247, 245, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(247, 247, 245, .055) 1px, transparent 1px),
    radial-gradient(circle at 78% 20%, rgba(255, 255, 255, .10), transparent 42%),
    radial-gradient(circle at 12% 92%, rgba(255, 255, 255, .05), transparent 38%);
  background-size: 56px 56px, 56px 56px, 100% 100%, 100% 100%;
  mask-image: linear-gradient(to bottom, #000 0%, #000 78%, transparent 100%);
}
.hero::after {
  content: "UBA"; position: absolute; right: -8vw; bottom: -12vw; z-index: 0;
  font: 400 clamp(200px, 26vw, 390px)/.7 var(--serif); letter-spacing: -.08em;
  color: transparent; -webkit-text-stroke: 1px rgba(247, 247, 245, .055);
  pointer-events: none;
}
.hero-inner {
  position: relative; z-index: 1; max-width: 1560px; margin: 0 auto;
  padding: 66px 36px 0; display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(410px, .8fr);
  gap: 54px; min-height: 620px;
}
.hero-copy { display: flex; flex-direction: column; justify-content: center; padding-bottom: 36px; }
.eyebrow {
  display: flex; align-items: center; gap: 10px; margin-bottom: 28px;
  font: 9.5px var(--mono); letter-spacing: .19em; color: var(--night-muted); text-transform: uppercase;
}
.eyebrow .pulse {
  width: 7px; height: 7px; background: var(--night-ink); border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(255, 255, 255, .10); animation: pulse 2.6s infinite;
}
.hero h1 {
  margin: 0; max-width: 820px;
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(54px, 6.15vw, 90px); line-height: .98; letter-spacing: -.055em;
}
.hero h1 .accent { color: #bdbdb8; }
.hero h1 .thin { color: var(--night-muted); }
.hero-lede {
  max-width: 610px; margin: 30px 0 0;
  font-size: 17px; line-height: 1.85; color: var(--night-ink-2);
}
.hero-lede b { color: var(--night-ink); font-weight: 500; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 33px; }
.btn {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 22px;
  height: 43px; padding: 0 17px; border: 1px solid currentColor;
  font: 11px var(--mono); letter-spacing: .02em; text-decoration: none;
  transition: background .18s, color .18s, border-color .18s;
}
.btn-primary { background: var(--night-ink); color: var(--night); border-color: var(--night-ink); }
.btn-primary:hover { background: #d9d9d6; border-color: #d9d9d6; color: #0b0b0b; }
.btn-ghost { color: var(--night-ink-2); border-color: rgba(247, 247, 245, .3); }
.btn-ghost:hover { color: var(--night); background: var(--night-ink); border-color: var(--night-ink); }
.btn .arrow { font-size: 14px; }
.hero-meta {
  display: flex; flex-wrap: wrap; gap: 20px; margin-top: 48px;
  font: 9px var(--mono); letter-spacing: .09em; color: var(--night-muted); text-transform: uppercase;
}
.hero-meta span { display: inline-flex; align-items: center; gap: 8px; }
.hero-meta i { display: inline-block; width: 18px; height: 1px; background: var(--night-rule); }

/* instrument panel */
.instrument {
  align-self: end; margin-bottom: -1px; border: 1px solid rgba(247, 247, 245, .22);
  background: rgba(11, 11, 11, .72); backdrop-filter: blur(10px);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .35);
}
.instrument-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 15px; border-bottom: 1px solid rgba(247, 247, 245, .16);
  font: 8.5px var(--mono); letter-spacing: .14em; color: var(--night-muted);
}
.instrument-head b { color: var(--night-ink); font-weight: 400; }
.instrument-head .live { display: inline-flex; align-items: center; gap: 6px; color: var(--night-ink); }
.instrument-head .live::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; animation: pulse 2s infinite; }
.trace { position: relative; padding: 18px 15px 0; }
.trace svg { display: block; width: 100%; height: 166px; overflow: visible; }
.trace-grid { stroke: rgba(247, 247, 245, .08); stroke-width: 1; }
.trace-line { fill: none; stroke: var(--night-ink); stroke-width: 1.6; }
.trace-fill { fill: url(#traceGrad); }
.trace-dot { fill: var(--night-ink); }
.trace-label { font: 7px var(--mono); fill: var(--night-muted); letter-spacing: .06em; }
.scan {
  position: absolute; top: 18px; bottom: 0; width: 1px; left: 15px;
  background: linear-gradient(to bottom, transparent, var(--night-ink), transparent);
  opacity: .65; animation: scan 7s linear infinite;
}
.trace-axis { display: flex; justify-content: space-between; padding: 7px 15px 12px; border-bottom: 1px solid rgba(247, 247, 245, .12); font: 7px var(--mono); color: #6e6e6a; letter-spacing: .08em; }
.funnel { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid rgba(247, 247, 245, .12); }
.funnel div { padding: 12px 13px 13px; border-right: 1px solid rgba(247, 247, 245, .12); }
.funnel div:last-child { border-right: 0; }
.funnel dt { font: 7.5px var(--mono); letter-spacing: .1em; color: var(--night-muted); }
.funnel dd { margin: 5px 0 0; font: 24px var(--serif); color: var(--night-ink); line-height: 1; }
.funnel small { display: block; margin-top: 5px; font: 7px var(--mono); color: #6e6e6a; }
.event-log { padding: 9px 15px 12px; }
.event-line {
  display: grid; grid-template-columns: 48px 1fr auto; gap: 10px; align-items: baseline;
  padding: 4px 0; font: 8px var(--mono); color: var(--night-muted);
  animation: event-in .5s both;
}
.event-line:nth-child(2) { animation-delay: .4s; }
.event-line:nth-child(3) { animation-delay: .8s; }
.event-line:nth-child(4) { animation-delay: 1.2s; }
.event-line b { color: var(--night-ink-2); font-weight: 400; }
.event-line em { font-style: normal; color: var(--night-ink); }
.event-line i { color: #6e6e6a; font-style: normal; }
.instrument-foot {
  display: flex; justify-content: space-between; gap: 12px; padding: 9px 15px;
  border-top: 1px solid rgba(247, 247, 245, .12);
  font: 7px var(--mono); letter-spacing: .09em; color: #6e6e6a;
}
.instrument-foot span:last-child { color: var(--night-ink); }

/* ticker */
.ticker {
  overflow: hidden; background: var(--paper-2); color: var(--ink); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule-2);
  white-space: nowrap;
}
.ticker-track { display: inline-flex; gap: 0; animation: marquee 38s linear infinite; }
.ticker span {
  display: inline-flex; align-items: center; gap: 11px; padding: 8px 22px;
  font: 9.5px var(--mono); letter-spacing: .07em; text-transform: uppercase;
}
.ticker span::after { content: "✳"; font-size: 9px; opacity: .45; }
.ticker b { font-weight: 600; }

/* ---------- home index ---------- */
.home-index {
  max-width: 1560px; margin: 0 auto; padding: 84px 36px 104px;
  display: grid; grid-template-columns: 310px minmax(0, 1fr); gap: 66px;
}
.index-side { min-width: 0; }
.index-side-inner { position: sticky; top: calc(var(--header) + 36px); }
.section-kicker {
  display: flex; align-items: center; gap: 9px; margin-bottom: 17px;
  font: 9px var(--mono); letter-spacing: .18em; color: var(--accent); text-transform: uppercase;
}
.section-kicker::before { content: ""; width: 24px; height: 1px; background: var(--accent); }
.index-side h2 {
  margin: 0 0 18px; font: 400 35px/1.22 var(--serif); letter-spacing: -.035em;
}
.index-side p { margin: 0; font-size: 13.5px; line-height: 1.9; color: var(--ink-2); }
.index-stats { margin: 30px 0 0; border-top: 1px solid var(--rule); }
.index-stats div { display: flex; justify-content: space-between; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--rule); }
.index-stats dt { font: 9px var(--mono); letter-spacing: .06em; color: var(--muted); text-transform: uppercase; }
.index-stats dd { margin: 0; font: 17px var(--serif); color: var(--ink); }
.index-note { margin-top: 27px; font: 8.5px/1.9 var(--mono); color: var(--faint); letter-spacing: .03em; }
.index-note b { color: var(--accent); font-weight: 400; }
.index-feed { min-width: 0; }
.feed-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding-bottom: 13px; border-bottom: 1px solid var(--rule-2);
}
.feed-filters { display: flex; flex-wrap: wrap; gap: 18px; }
.feed-filter {
  background: transparent; border: 0; padding: 0; font: 9.5px var(--mono);
  letter-spacing: .04em; color: var(--muted); white-space: nowrap;
}
.feed-filter:hover { color: var(--ink); }
.feed-filter.active { color: var(--ink); text-decoration: underline; text-underline-offset: 6px; text-decoration-color: var(--signal); }
.feed-search { background: transparent; border: 0; padding: 0; font: 9.5px var(--mono); color: var(--muted); white-space: nowrap; }
.feed-search span { color: var(--faint); }
.feed-search:hover { color: var(--accent); }
.chapter-list { border-bottom: 1px solid var(--rule); }
.chapter-row {
  position: relative; display: grid; grid-template-columns: 52px minmax(0, 1fr) 74px;
  gap: 18px; padding: 20px 0; border-top: 1px solid var(--rule);
  text-decoration: none; transition: transform .2s var(--ease), color .18s;
}
.chapter-row:first-child { border-top: 0; }
.chapter-row:hover { transform: translateX(6px); }
.chapter-row .cr-num { font: 13px var(--mono); color: var(--faint); padding-top: 5px; }
.chapter-row .cr-body { min-width: 0; }
.chapter-row .cr-meta { display: flex; align-items: center; gap: 9px; margin-bottom: 6px; font: 8.5px var(--mono); letter-spacing: .1em; color: var(--muted); text-transform: uppercase; }
.chapter-row .cr-meta .cat { color: var(--accent); }
.chapter-row .cr-meta .dot { width: 3px; height: 3px; background: var(--rule-2); border-radius: 50%; }
.chapter-row h3 { margin: 0; font: 400 22px/1.45 var(--serif); letter-spacing: -.02em; }
.chapter-row p { margin: 5px 0 0; font-size: 12.5px; line-height: 1.75; color: var(--muted); }
.chapter-row .cr-time { padding-top: 5px; font: 8.5px var(--mono); color: var(--faint); text-align: right; white-space: nowrap; }
.chapter-row .cr-time b { display: block; font: 400 15px var(--serif); color: var(--muted); margin-bottom: 2px; }
.chapter-row:hover h3 { color: var(--accent); }
.chapter-row.featured {
  grid-template-columns: 64px minmax(0, 1fr) 78px; margin: 0 0 1px; padding: 24px 22px;
  background: var(--ink); color: var(--paper); border-top: 0;
}
.chapter-row.featured:hover { transform: none; background: #262626; color: #fff; }
.chapter-row.featured .cr-num { color: var(--paper); font-size: 16px; }
.chapter-row.featured .cr-meta { color: color-mix(in srgb, var(--paper) 55%, transparent); }
.chapter-row.featured .cr-meta .cat { color: var(--paper); }
.chapter-row.featured h3 { font-size: 31px; line-height: 1.26; letter-spacing: -.03em; }
.chapter-row.featured p { color: color-mix(in srgb, var(--paper) 65%, transparent); max-width: 600px; }
.chapter-row.featured .cr-time { color: color-mix(in srgb, var(--paper) 55%, transparent); }
.chapter-row.featured .cr-time b { color: var(--paper); }
.chapter-row.featured:hover .cr-meta .cat, .chapter-row.featured:hover .cr-num { color: #fff; }
.chapter-row.featured .cr-arrow { display: inline-block; margin-left: 8px; transition: transform .2s; }
.chapter-row.featured:hover .cr-arrow { transform: translate(3px, -3px); }
.chapter-row[hidden] { display: none; }
.feed-foot { display: flex; justify-content: space-between; gap: 18px; padding-top: 15px; font: 8.5px var(--mono); color: var(--faint); letter-spacing: .03em; }
.feed-foot a { color: var(--muted); text-decoration: none; }
.feed-foot a:hover { color: var(--accent); }


[data-theme="night"] .chapter-row.featured { background: #1e1e1e; color: #fff; }
[data-theme="night"] .chapter-row.featured:hover { background: #2a2a2a; }
[data-theme="night"] .chapter-row.featured .cr-meta,
[data-theme="night"] .chapter-row.featured .cr-time,
[data-theme="night"] .chapter-row.featured p { color: rgba(255, 255, 255, .7); }
[data-theme="night"] .chapter-row.featured .cr-time b,
[data-theme="night"] .chapter-row.featured h3 { color: #fff; }
[data-theme="night"] .chapter-row.featured .cr-meta .cat,
[data-theme="night"] .chapter-row.featured .cr-num { color: #d0d0cc; }

/* ---------- judgments ---------- */
.judgments { background: var(--paper-2); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); position: relative; overflow: hidden; }
.judgments::after {
  content: "10"; position: absolute; right: -1vw; top: -7vw; z-index: 0;
  font: 400 clamp(260px, 30vw, 470px)/1 var(--serif); color: transparent;
  -webkit-text-stroke: 1px color-mix(in srgb, var(--ink) 9%, transparent); pointer-events: none;
}
.judgments-inner {
  position: relative; z-index: 1; max-width: 1560px; margin: 0 auto; padding: 80px 36px 92px;
  display: grid; grid-template-columns: 310px minmax(0, 1fr); gap: 66px;
}
.judgments h2 { margin: 0 0 16px; font: 400 36px/1.2 var(--serif); letter-spacing: -.035em; }
.judgments-intro p { margin: 0; font-size: 13px; line-height: 1.9; color: var(--ink-2); }
.judgments-intro .intro-link { display: inline-flex; gap: 18px; margin-top: 25px; font: 9.5px var(--mono); color: var(--accent); text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 3px; }
.judgment-list { border-top: 1px solid var(--rule-2); }
.judgment { border-bottom: 1px solid var(--rule-2); }
.judgment summary {
  display: grid; grid-template-columns: 34px minmax(0, 1fr) 18px; gap: 14px;
  align-items: baseline; padding: 18px 0; cursor: pointer; list-style: none;
}
.judgment summary::-webkit-details-marker { display: none; }
.judgment .jn { font: 9px var(--mono); color: var(--signal); }
.judgment .jt { font: 400 17px/1.55 var(--serif); letter-spacing: -.01em; }
.judgment .jp { color: var(--muted); font: 18px var(--mono); transition: transform .2s; }
.judgment[open] .jp { transform: rotate(45deg); color: var(--accent); }
.judgment p { margin: -3px 36px 20px 48px; font-size: 12.5px; line-height: 1.95; color: var(--ink-2); }
.judgment p a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- stack section ---------- */
.stack-section { max-width: 1560px; margin: 0 auto; padding: 92px 36px 100px; display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 70px; }
.stack-intro h2 { margin: 0 0 18px; font: 400 40px/1.16 var(--serif); letter-spacing: -.04em; }
.stack-intro p { margin: 0; font-size: 13.5px; line-height: 1.9; color: var(--ink-2); }
.stack-intro .index-note { margin-top: 30px; }
.stack-board { border-top: 1px solid var(--rule-2); display: grid; grid-template-columns: 1.1fr .9fr; gap: 0; min-height: 470px; }
.stack-list { border-right: 1px solid var(--rule); }
.stack-item {
  display: grid; grid-template-columns: 30px 112px minmax(0, 1fr); gap: 13px; align-items: center;
  width: 100%; padding: 15px 12px 15px 0; border: 0; border-bottom: 1px solid var(--rule);
  background: transparent; text-align: left; color: var(--muted); transition: background .18s, color .18s, padding .18s;
}
.stack-item .si { font: 8.5px var(--mono); color: var(--faint); }
.stack-item .sn { font: 10px var(--mono); letter-spacing: .08em; }
.stack-item .sd { font-size: 12px; line-height: 1.55; }
.stack-item:hover { color: var(--ink); background: var(--card); }
.stack-item.active { color: var(--paper); background: var(--ink); padding-left: 13px; }
.stack-item.active .si { color: var(--signal); }
.stack-item.active .sn { color: var(--signal); }
[data-theme="night"] .stack-item.active { color: var(--night); background: var(--night-ink); }
.stack-detail { padding: 24px 0 24px 30px; display: flex; flex-direction: column; }
.stack-detail .sd-kicker { font: 8.5px var(--mono); letter-spacing: .13em; color: var(--accent); text-transform: uppercase; }
.stack-detail h3 { margin: 9px 0 10px; font: 400 28px/1.2 var(--serif); letter-spacing: -.03em; }
.stack-detail p { margin: 0 0 13px; font-size: 12.5px; line-height: 1.9; color: var(--ink-2); }
.stack-detail ul { margin: 0 0 16px; padding: 0; list-style: none; }
.stack-detail li { position: relative; padding-left: 14px; font-size: 11.5px; line-height: 1.8; color: var(--muted); }
.stack-detail li::before { content: "—"; position: absolute; left: 0; color: var(--signal); }
.stack-detail .sd-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--rule); font: 8.5px/1.8 var(--mono); color: var(--faint); }
.stack-detail .sd-foot b { color: var(--accent); font-weight: 400; }

/* ---------- paths ---------- */
.paths { max-width: 1560px; margin: 0 auto; padding: 0 36px 100px; }
.paths-head { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; padding-bottom: 14px; border-bottom: 1px solid var(--rule-2); }
.paths-head h2 { margin: 0; font: 400 27px/1.2 var(--serif); letter-spacing: -.03em; }
.paths-head span { font: 8.5px var(--mono); letter-spacing: .12em; color: var(--faint); }
.path-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-left: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.path-card {
  display: flex; flex-direction: column; min-height: 190px; padding: 23px 23px 20px;
  border-right: 1px solid var(--rule); text-decoration: none; transition: background .18s, color .18s;
}
.path-card .pc-num { font: 8.5px var(--mono); color: var(--signal); letter-spacing: .1em; }
.path-card h3 { margin: 16px 0 8px; font: 400 21px/1.35 var(--serif); letter-spacing: -.02em; }
.path-card p { margin: 0; font-size: 12px; line-height: 1.8; color: var(--muted); }
.path-card .pc-foot { margin-top: auto; padding-top: 20px; display: flex; justify-content: space-between; font: 8.5px var(--mono); color: var(--faint); }
.path-card:hover { background: var(--ink); color: var(--paper); }
.path-card:hover p, .path-card:hover .pc-foot { color: color-mix(in srgb, var(--paper) 60%, transparent); }
.path-card:hover h3 { color: var(--signal); }

/* ---------- footer ---------- */
.site-footer { background: var(--night); color: var(--night-ink); border-top: 1px solid #000; }
.footer-inner { max-width: 1560px; margin: 0 auto; padding: 46px 36px 30px; }
.footer-top { display: flex; justify-content: space-between; gap: 36px; align-items: flex-start; padding-bottom: 38px; border-bottom: 1px solid var(--night-rule); }
.footer-brand { font: 500 14px var(--mono); letter-spacing: .08em; }
.footer-brand small { display: block; margin-top: 7px; font: 8px var(--mono); letter-spacing: .16em; color: var(--night-muted); }
.footer-note { max-width: 520px; margin: 0; font-size: 12px; line-height: 1.85; color: var(--night-ink-2); }
.footer-links { display: flex; flex-wrap: wrap; gap: 24px; }
.footer-links a { font: 9px var(--mono); letter-spacing: .06em; color: var(--night-muted); text-decoration: none; }
.footer-links a:hover { color: var(--signal); }
.footer-bottom { display: flex; justify-content: space-between; gap: 20px; padding-top: 17px; font: 8px var(--mono); letter-spacing: .05em; color: #6e6e6a; }
.footer-bottom b { color: var(--night-ink-2); font-weight: 400; }

/* ---------- article ---------- */
.article {
  max-width: calc(var(--article) + 110px); margin: 0 auto; padding: 0 50px 110px;
}
.chapter-head { position: relative; padding: 70px 0 34px; border-bottom: 1px solid var(--rule-2); margin-bottom: 44px; }
.chapter-ghost {
  position: absolute; right: -8px; top: 18px; z-index: 0;
  font: 400 210px/.8 var(--serif); letter-spacing: -.08em;
  color: transparent; -webkit-text-stroke: 1px color-mix(in srgb, var(--ink) 10%, transparent);
  pointer-events: none;
}
.chapter-kicker { position: relative; z-index: 1; font: 9px var(--mono); letter-spacing: .17em; color: var(--accent); text-transform: uppercase; }
.chapter-head h1 {
  position: relative; z-index: 1; margin: 16px 0 0; max-width: 780px;
  font: 400 clamp(40px, 4.6vw, 62px)/1.18 var(--serif); letter-spacing: -.05em;
  word-break: auto-phrase; text-wrap: pretty;
}
.standfirst {
  position: relative; z-index: 1; max-width: 700px; margin: 20px 0 0;
  font: 400 19px/1.8 var(--serif); color: var(--ink-2);
}
.chapter-meta {
  position: relative; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
  margin-top: 25px; font: 8.5px var(--mono); letter-spacing: .06em; color: var(--muted);
}
.chapter-meta .sep { width: 1px; height: 11px; background: var(--rule-2); }
.text-size { display: inline-flex; align-items: center; gap: 2px; margin-left: auto; }
.text-size button {
  width: 28px; height: 24px; border: 1px solid var(--rule); background: transparent;
  font: 9px var(--mono); color: var(--muted);
}
.text-size button:hover { color: var(--ink); border-color: var(--rule-2); background: var(--card); }
.prose { overflow-wrap: anywhere; max-width: var(--article); font-size: var(--reading); line-height: 1.95; }
.prose > :first-child { margin-top: 0; }
.prose h2 {
  position: relative; margin: 62px 0 20px; padding-top: 17px; border-top: 1px solid var(--rule);
  font: 400 30px/1.3 var(--serif); letter-spacing: -.03em;
  word-break: auto-phrase; text-wrap: pretty;
}
.prose h2::before { content: ""; position: absolute; top: -1px; left: 0; width: 54px; height: 2px; background: var(--accent); }
.prose h3 { margin: 35px 0 10px; font: 500 21px/1.45 var(--serif); letter-spacing: -.015em; }
.prose h4 { margin: 26px 0 8px; font-size: 15.5px; line-height: 1.55; }
.prose p { margin: 0 0 1.06em; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose em { font-style: italic; }
.prose a {
  color: var(--accent-2); text-decoration: underline; text-decoration-thickness: 1px;
  text-underline-offset: 3px; transition: background .15s, color .15s;
}
.prose a:hover { background: var(--accent); color: var(--card); text-decoration: none; }
.prose a.ext::after { content: "↗"; font-size: .65em; margin-left: 2px; vertical-align: super; text-decoration: none; }
.prose ul, .prose ol { margin: 0 0 1.18em 1.35em; padding: 0; }
.prose li { margin: .34em 0; }
.prose li > p { margin: 0 0 .4em; }
.prose blockquote {
  margin: 27px 0; padding: 17px 21px; background: var(--card);
  border-left: 3px solid var(--accent); color: var(--ink-2);
  font-size: 14.5px; line-height: 1.85;
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose blockquote strong:first-child { color: var(--accent); }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 44px 0; }
.prose img { display: block; margin: 24px auto; }
.prose code {
  font-family: var(--code); font-size: .82em; background: var(--paper-2);
  border: 1px solid var(--rule); padding: .1em .34em; overflow-wrap: anywhere;
}
.prose pre {
  position: relative; font-family: var(--code); margin: 24px 0; padding: 18px 20px; overflow-x: auto;
  background: var(--ink); color: #f7f7f5; border: 1px solid var(--ink);
  font-size: 11.5px; line-height: 1.75;
}
.prose pre code { overflow-wrap: normal; background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }
.copy-btn {
  position: absolute; top: 8px; right: 8px; border: 1px solid rgba(247, 247, 245, .22);
  background: rgba(247, 247, 245, .06); color: rgba(247, 247, 245, .7);
  font: 8px var(--mono); padding: 4px 7px; opacity: 0; transition: opacity .18s, background .18s;
}
.prose pre:hover .copy-btn { opacity: 1; }
.copy-btn:hover { background: rgba(247, 247, 245, .14); color: #fff; }
.prose .anchor {
  position: absolute; left: -1.1em; top: 17px; color: var(--accent); opacity: 0;
  text-decoration: none; font: 400 .6em var(--mono); transition: opacity .15s;
}
.prose h2:hover .anchor, .prose h3:hover .anchor { opacity: .75; }

/* tables */
.prose table { width: 100%; border-collapse: collapse; margin: 0; font-size: 13.5px; line-height: 1.75; }
.table-wrap {
  max-width: 100%; margin: 27px 0 33px; overflow-x: auto;
  border: 1px solid var(--rule); background: var(--card);
  scrollbar-width: auto; scrollbar-color: var(--rule-2) var(--paper-2);
}
.table-wrap.table-wide {
  width: max(100%, min(1150px, calc(100vw - var(--sidebar) - 90px)));
  max-width: none; margin-left: 50%; transform: translateX(-50%);
}
.prose th, .prose td {
  min-width: 9em; max-width: 24em; padding: 11px 13px; text-align: left; vertical-align: top;
  border-bottom: 1px solid var(--rule); border-right: 1px solid color-mix(in srgb, var(--rule) 65%, transparent);
}
.prose th:last-child, .prose td:last-child { border-right: 0; }
.prose thead th {
  position: sticky; top: 0; background: var(--paper-2); border-bottom-color: var(--rule-2);
  font-size: 12px; font-weight: 600; color: var(--ink); line-height: 1.55; z-index: 1;
}
.prose tbody td:first-child { color: var(--ink); font-weight: 500; }
.prose tbody tr:last-child td { border-bottom: 0; }
.prose tbody tr:nth-child(even) { background: color-mix(in srgb, var(--paper-2) 22%, transparent); }
.prose tbody tr:hover { background: var(--paper-2); }
.prose td strong { font-weight: 600; }

/* diagrams */
.diagram {
  width: min(1080px, calc(100vw - var(--sidebar) - 90px));
  margin: 30px 0 34px 50%; padding: 14px; transform: translateX(-50%);
  background: var(--card); border: 1px solid var(--rule);
}
.diagram img, .diagram svg { display: block; width: 100%; height: auto; margin: 0 auto; }
.diagram figcaption {
  margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--rule);
  font: 8.5px/1.6 var(--mono); letter-spacing: .04em; color: var(--faint);
}

/* pager / end */
.chapter-end { margin-top: 54px; padding-top: 18px; border-top: 1px solid var(--rule); font: 9px var(--mono); color: var(--faint); display: flex; justify-content: space-between; gap: 20px; }
.chapter-end a { color: var(--muted); text-decoration: none; }
.pager { display: grid; grid-template-columns: 1fr 1fr; margin-top: 38px; border-top: 1px solid var(--rule-2); border-bottom: 1px solid var(--rule); }
.pager a { display: block; padding: 23px 25px; text-decoration: none; transition: background .18s; }
.pager a:hover { background: var(--card); }
.pager a.next { text-align: right; border-left: 1px solid var(--rule); }
.pager .plabel { font: 8.5px var(--mono); letter-spacing: .13em; color: var(--faint); }
.pager .ptitle { display: block; margin-top: 7px; font: 400 19px/1.35 var(--serif); }
.pager a:hover .ptitle { color: var(--accent); }

/* ---------- subpages ---------- */
.subpage { max-width: 1120px; margin: 0 auto; padding: 62px 52px 100px; }
.subpage-head { border-bottom: 1px solid var(--rule-2); padding-bottom: 28px; margin-bottom: 38px; }
.subpage-head h1 { margin: 12px 0 0; font: 400 clamp(42px, 5.2vw, 64px)/1.08 var(--serif); letter-spacing: -.045em; }
.subpage-head p { max-width: 720px; margin: 17px 0 0; font: 400 18px/1.8 var(--serif); color: var(--ink-2); }
.about-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 58px; align-items: start; }
.about-grid h2 { margin: 35px 0 10px; font: 400 25px/1.3 var(--serif); }
.about-grid h2:first-child { margin-top: 0; }
.about-grid p, .about-grid li { font-size: 13.5px; line-height: 1.95; color: var(--ink-2); }
.about-grid ul { padding-left: 1.2em; }
.about-card { position: sticky; top: calc(var(--header) + 28px); background: var(--card); border: 1px solid var(--rule); padding: 21px; }
.about-card .mono { font: 8.5px var(--mono); letter-spacing: .1em; color: var(--faint); text-transform: uppercase; }
.about-card dl { display: grid; grid-template-columns: 84px 1fr; gap: 8px 10px; margin: 14px 0 0; font-size: 11.5px; }
.about-card dt { color: var(--muted); }
.about-card dd { margin: 0; color: var(--ink-2); }
.confidence { display: grid; gap: 9px; margin-top: 19px; }
.confidence div { display: flex; gap: 9px; align-items: baseline; font-size: 11px; line-height: 1.65; color: var(--muted); }
.confidence b { font: 8px var(--mono); color: var(--accent); border: 1px solid var(--accent); padding: 1px 4px; flex: none; }
.method-steps { display: grid; gap: 1px; margin: 22px 0 28px; border: 1px solid var(--rule); background: var(--rule); }
.method-step { display: grid; grid-template-columns: 38px 1fr; gap: 13px; padding: 15px; background: var(--card); }
.method-step .ms-n { font: 9px var(--mono); color: var(--signal); }
.method-step b { display: block; font-size: 13px; margin-bottom: 3px; }
.method-step span { font-size: 11.5px; line-height: 1.7; color: var(--muted); }

/* references */
.ref-tools { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 15px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin-bottom: 27px; }
.ref-search { flex: 1; min-width: 220px; height: 40px; border: 1px solid var(--rule); background: var(--card); padding: 0 12px; font-size: 12.5px; outline: none; }
.ref-search:focus { border-color: var(--accent); }
.ref-count { font: 8.5px var(--mono); letter-spacing: .07em; color: var(--muted); white-space: nowrap; }
.ref-group { margin: 33px 0 0; }
.ref-group h2 { display: flex; align-items: baseline; gap: 12px; margin: 0 0 9px; padding-bottom: 8px; border-bottom: 1px solid var(--rule); font: 400 22px/1.3 var(--serif); }
.ref-group h2 span { font: 8px var(--mono); letter-spacing: .09em; color: var(--faint); }
.ref-item { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--rule); align-items: baseline; }
.ref-item .rn { font: 8px var(--mono); color: var(--faint); }
.ref-item a { text-decoration: none; font-size: 12px; line-height: 1.65; color: var(--ink-2); }
.ref-item a:hover { color: var(--accent); text-decoration: underline; }
.ref-item .domain { font: 8px var(--mono); color: var(--faint); letter-spacing: .03em; white-space: nowrap; }
.ref-empty { padding: 28px 0; font: 400 18px var(--serif); color: var(--muted); display: none; }

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 600; display: none; }
.lightbox.open { display: block; }
body.lightbox-open { overflow: hidden; }
.lightbox-backdrop { position: absolute; inset: 0; background: rgba(10, 12, 8, .9); backdrop-filter: blur(5px); }
.lightbox-panel {
  position: relative; width: min(96vw, 1440px); height: 92vh; margin: 4vh auto;
  display: flex; flex-direction: column; background: var(--card);
  border: 1px solid var(--rule-2); box-shadow: 0 40px 120px rgba(0, 0, 0, .45);
}
.lightbox-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  padding: 9px 14px; border-bottom: 1px solid var(--rule);
  font: 8.5px var(--mono); letter-spacing: .08em; color: var(--muted);
}
.lightbox-actions { display: flex; align-items: center; gap: 14px; }
.lightbox-actions button { border: 0; background: transparent; color: var(--muted); font: 8.5px var(--mono); }
.lightbox-actions button:hover { color: var(--accent); }
.lightbox-stage { flex: 1; overflow: auto; padding: 18px; background: var(--paper); }
.lightbox-stage img { max-width: none; height: auto; display: block; margin: 0 auto; }

/* ---------- search ---------- */
.search-modal { position: fixed; inset: 0; z-index: 500; display: none; }
.search-modal.open { display: block; }
.search-backdrop { position: absolute; inset: 0; background: rgba(10, 12, 8, .64); backdrop-filter: blur(7px); }
.search-panel {
  position: relative; width: min(800px, calc(100vw - 28px)); margin: 10vh auto 0;
  background: var(--card); border: 1px solid var(--rule-2); box-shadow: 0 38px 110px rgba(0, 0, 0, .38);
  animation: search-in .22s var(--ease);
}
@keyframes search-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.search-top { display: flex; align-items: center; gap: 14px; padding: 0 20px; border-bottom: 1px solid var(--rule); }
.search-top svg { width: 19px; height: 19px; color: var(--muted); flex: none; }
.search-input { flex: 1; height: 66px; border: 0; background: transparent; outline: none; font: 400 22px var(--serif); color: var(--ink); }
.search-input::placeholder { color: var(--faint); }
.search-input::-webkit-search-cancel-button, .ref-search::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.search-esc { border: 1px solid var(--rule); background: transparent; color: var(--faint); font: 8px var(--mono); padding: 3px 6px; }
.search-hint { padding: 9px 20px; border-bottom: 1px solid var(--rule); font: 8px var(--mono); letter-spacing: .08em; color: var(--faint); display: flex; justify-content: space-between; gap: 12px; }
.search-results { max-height: 56vh; overflow-y: auto; padding: 8px; }
.search-result { display: block; padding: 12px 15px; border-bottom: 1px solid var(--rule); text-decoration: none; color: inherit; transition: background .15s; }
.search-result:last-child { border-bottom: 0; }
.search-result:hover, .search-result.active { background: var(--paper-2); }
.search-result .sr-chapter { font: 8px var(--mono); letter-spacing: .11em; color: var(--accent); text-transform: uppercase; }
.search-result .sr-title { margin: 4px 0; font: 400 17px/1.4 var(--serif); }
.search-result .sr-snippet { font-size: 11px; line-height: 1.7; color: var(--muted); }
.search-result mark { background: var(--ink); color: var(--paper); padding: 0 2px; }
.search-empty { padding: 32px 20px; text-align: center; font: 400 17px var(--serif); color: var(--muted); }

/* ---------- utilities ---------- */
.to-top {
  position: fixed; right: 21px; bottom: 21px; z-index: 90; width: 39px; height: 39px;
  border: 1px solid var(--rule); background: var(--card); color: var(--muted);
  display: grid; place-items: center; opacity: 0; pointer-events: none;
  transition: opacity .2s, color .2s, transform .2s;
}
.to-top.show { opacity: 1; pointer-events: auto; }
.to-top:hover { color: var(--accent); transform: translateY(-2px); }
.to-top svg { width: 15px; height: 15px; }
.mobile-only { display: none; }
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 1240px) {
  :root { --sidebar: 260px; }
  .article { padding-left: 36px; padding-right: 36px; }
  .hero-inner { gap: 34px; }
  .home-index, .judgments-inner, .stack-section { gap: 42px; }
}
@media (max-width: 1040px) {
  .hero-inner { grid-template-columns: 1fr; padding-top: 52px; }
  .hero-copy { padding-bottom: 10px; }
  .instrument { width: min(100%, 620px); margin-bottom: 0; }
  .hero::after { font-size: 360px; }
  .home-index { grid-template-columns: 1fr; gap: 42px; }
  .index-side-inner { position: static; display: grid; grid-template-columns: 1.2fr .8fr; gap: 30px; }
  .index-side h2 { font-size: 31px; }
  .index-stats { margin-top: 0; }
  .judgments-inner { grid-template-columns: 1fr; gap: 34px; }
  .judgments-intro { max-width: 650px; }
  .stack-section { grid-template-columns: 1fr; gap: 38px; }
  .stack-intro { max-width: 680px; }
  .path-grid { grid-template-columns: 1fr; border-left: 1px solid var(--rule); }
  .path-card { border-bottom: 1px solid var(--rule); min-height: 160px; }
  .path-card:last-child { border-bottom: 0; }
}
@media (max-width: 920px) {
  :root { --header: 70px; }
  .topbar { padding: 0 18px; gap: 12px; }
  .topnav { display: none; }
  .menu-toggle { display: grid; }
  .brand-name { font-size: 12px; }
  .download-link { display: none; }
  .shell { display: block; }
  .sidebar {
    position: fixed; z-index: 150; top: var(--header); bottom: 0; left: 0;
    width: min(326px, 87vw); background: var(--paper); border-right: 1px solid var(--rule-2);
    transform: translateX(-102%); transition: transform .28s var(--ease);
    box-shadow: 18px 0 50px rgba(0, 0, 0, .13);
  }
  .side-inner { position: static; height: 100%; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .nav-scrim { display: block; position: fixed; inset: var(--header) 0 0 0; z-index: 140; background: rgba(11, 11, 11, .42); backdrop-filter: blur(3px); }
  body.nav-open { overflow: hidden; }
  .article { padding: 0 26px 78px; }
  .chapter-head { padding-top: 49px; }
  .chapter-ghost { font-size: 150px; top: 15px; }
  .standfirst { font-size: 17.5px; }
  .diagram, .table-wrap.table-wide { width: 100%; max-width: 100%; margin-left: 0; transform: none; }
  .prose h2 { font-size: 26px; margin-top: 50px; }
  .prose h3 { font-size: 19.5px; }
  .about-grid { grid-template-columns: 1fr; gap: 30px; }
  .about-card { position: static; }
  .subpage { padding: 44px 24px 80px; }
  .footer-top { flex-direction: column; gap: 24px; }
  .footer-bottom { flex-direction: column; gap: 8px; }
}
@media (max-width: 680px) {
  .hero-inner { padding: 44px 18px 0; min-height: 0; }
  .hero h1 { font-size: clamp(40px, 10.6vw, 58px); }
  .mobile-only { display: inline; }
  .hero-lede { font-size: 15px; margin-top: 24px; }
  .hero-meta { gap: 12px; margin-top: 34px; }
  .hero-meta i { display: none; }
  .hero::after { font-size: 250px; bottom: -4vw; }
  .instrument { width: 100%; }
  .trace svg { height: 140px; }
  .funnel dd { font-size: 20px; }
  .home-index, .judgments-inner, .stack-section, .paths { padding-left: 18px; padding-right: 18px; }
  .home-index { padding-top: 56px; padding-bottom: 76px; }
  .index-side-inner { display: block; }
  .index-stats { margin-top: 24px; }
  .feed-toolbar { align-items: flex-start; gap: 10px; }
  .feed-filters { gap: 13px; }
  .feed-search { display: none; }
  .chapter-row { grid-template-columns: 34px minmax(0, 1fr); gap: 11px; padding: 17px 0; }
  .chapter-row .cr-time { display: none; }
  .chapter-row h3 { font-size: 19px; }
  .chapter-row p { font-size: 11.5px; }
  .chapter-row.featured { grid-template-columns: 34px minmax(0, 1fr); padding: 20px 16px; }
  .chapter-row.featured h3 { font-size: 24px; }
  .chapter-row.featured .cr-time { display: none; }
  .judgments::after { font-size: 240px; top: -30px; }
  .judgments h2 { font-size: 31px; }
  .judgment summary { grid-template-columns: 27px minmax(0, 1fr) 15px; gap: 9px; }
  .judgment .jt { font-size: 16px; }
  .judgment p { margin-left: 36px; margin-right: 0; }
  .stack-board { grid-template-columns: 1fr; min-height: 0; }
  .stack-list { border-right: 0; border-bottom: 1px solid var(--rule); }
  .stack-detail { padding: 22px 0 8px; }
  .stack-item { grid-template-columns: 27px 95px minmax(0, 1fr); }
  .paths-head { align-items: flex-start; flex-direction: column; gap: 4px; }
  .article { padding: 0 18px 64px; }
  .chapter-head h1 { font-size: 38px; }
  .chapter-ghost { display: none; }
  .chapter-meta { gap: 9px; }
  .chapter-meta .sep { display: none; }
  .text-size { margin-left: 0; }
  .prose { font-size: var(--reading); line-height: 1.9; }
  .prose h2 { font-size: 23px; }
  .prose h3 { font-size: 18px; }
  .prose blockquote { padding: 14px 15px; font-size: 13.5px; }
  .prose th, .prose td { padding: 10px 11px; font-size: 12.5px; }
  .pager { grid-template-columns: 1fr; }
  .pager a.next { border-left: 0; border-top: 1px solid var(--rule); text-align: left; }
  .subpage { padding: 36px 18px 64px; }
  .ref-item { grid-template-columns: 29px minmax(0, 1fr); }
  .ref-item .domain { display: none; }
  .search-panel { margin-top: 6vh; }
  .search-input { font-size: 19px; height: 58px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media print {
  .topbar, .sidebar, .pager, .to-top, .progress, .search-modal, .text-size, .nav-scrim, .hero-actions, .ticker, .site-footer, .chapter-end { display: none !important; }
  body { background: #fff; font-size: 10.5pt; }
  body::after { display: none; }
  .article { max-width: none; padding: 0; }
  .chapter-head { padding-top: 0; }
  .prose { max-width: none; }
  .prose a { color: #000; text-decoration: none; }
  .prose a.ext::after { content: " (" attr(href) ")"; font-size: 8pt; }
  .table-wrap, .diagram { break-inside: avoid; }
}


/* ---------- SF type scale ---------- */
.hero h1,
.chapter-head h1,
.subpage-head h1,
.index-side h2,
.judgments h2,
.stack-intro h2,
.paths-head h2,
.about-grid h2,
.ref-group h2 { font-weight: 600; letter-spacing: -.045em; }
.chapter-row h3,
.path-card h3,
.judgment .jt,
.pager .ptitle { font-weight: 500; }
.prose h2,
.prose h3,
.prose h4 { font-weight: 600; letter-spacing: -.025em; }
.standfirst,
.hero-lede { font-weight: 400; }
.hero h1 { letter-spacing: -.05em; }
.hero h1 .accent { color: #bdbdb8; }
.chapter-head h1 { letter-spacing: -.045em; }

/* motion */
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes scan { 0% { left: 15px; } 100% { left: calc(100% - 15px); } }
@keyframes marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
@keyframes event-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
