/* ============================================================================
   Latent Mining / Bio - release design system  (programbench register)
   Clean, narrow, mono-forward. Inter (headline/body) + JetBrains Mono (identity,
   labels, all numbers). Single deep-lab-green accent. Light, uncrowded, every
   number a tabular-nums data value. No serif display anywhere.
   ============================================================================ */

:root {
  --bg:        #fafafa;
  --surface:   #ffffff;
  --ink:       #0b0d12;
  --ink-2:     #3a3f4a;
  --muted:     #6b7280;
  --line:      #e6e8ec;
  --line-2:    #d8dbe0;

  --accent:     #0f5d4d;   /* deep lab green: links, primary metric, wordmark mark */
  --accent-2:   #0a4034;   /* hover */
  --accent-tint:#e6f0ec;

  --solve:  #0f5d4d;   /* outcome semantics */
  --near:   #b4730d;
  --fail:   #b03f30;
  --near-tint: #f6ecd7;
  --fail-tint: #f4e2dd;

  --gold:   #9a7611;
  --silver: #7c828c;
  --bronze: #9e6a2b;

  --maxw: 940px;
  --maxw-narrow: 760px;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }
.narrow { max-width: var(--maxw-narrow); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
::selection { background: var(--accent); color: #fff; }

/* ---------- header ---------- */
header.site {
  position: sticky; top: 0; z-index: 30;
  background: rgba(250,250,250,0.86);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav {
  max-width: var(--maxw); margin: 0 auto; padding: 15px 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 22px;
}
.wordmark {
  font-family: var(--mono); font-weight: 700; font-size: 15px;
  letter-spacing: -0.01em; color: var(--ink); white-space: nowrap;
}
.wordmark .slash { color: var(--accent); }
.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a {
  font-family: var(--mono); font-size: 12.5px; font-weight: 500;
  letter-spacing: 0.02em; color: var(--ink-2);
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--accent); text-decoration: none; }
.nav-cta {
  font-family: var(--mono); font-size: 12.5px; font-weight: 600;
  border: 1px solid var(--line-2); border-radius: 6px; padding: 6px 12px; color: var(--ink);
}
.nav-cta:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* ---------- shared section + type ---------- */
.eyebrow {
  font-family: var(--mono); font-size: 12px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent);
  display: inline-block;
}
.eyebrow.alt { color: var(--muted); }
.section { padding: 96px 0; border-bottom: 1px solid var(--line); }
.section.tight { padding: 64px 0; }
h1, h2, h3, h4 { margin: 0; }
.section h2 {
  font-size: clamp(25px, 3.6vw, 33px); font-weight: 800; letter-spacing: -0.02em;
  line-height: 1.16; margin: 14px 0 0; max-width: 22ch;
}
.lead { color: var(--ink-2); font-size: 18px; max-width: 64ch; margin: 18px 0 0; }
.prose { color: var(--ink-2); font-size: 16px; max-width: 68ch; }
.prose p { margin: 0 0 16px; } .prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--ink); font-weight: 600; }

/* ---------- hero ---------- */
.hero { padding: 84px 0 80px; border-bottom: 1px solid var(--line); }
.hero.center { text-align: center; }
.hero h1 {
  font-size: clamp(33px, 5.4vw, 54px); font-weight: 800; letter-spacing: -0.034em;
  line-height: 1.06; margin: 20px 0 0; max-width: 18ch;
}
.hero.center h1 { margin-left: auto; margin-right: auto; }
.hero h1 .accent { color: var(--accent); }
.hero-sub { color: var(--ink-2); font-size: 19px; line-height: 1.55; max-width: 60ch; margin: 22px 0 0; }
.hero.center .hero-sub { margin-left: auto; margin-right: auto; }
.hero-cta { display: flex; gap: 12px; margin-top: 30px; flex-wrap: wrap; }
.hero.center .hero-cta { justify-content: center; }

/* instrument status strip (graft) */
.statusline {
  font-family: var(--mono); font-size: 12.5px; color: var(--muted);
  font-variant-numeric: tabular-nums; margin-top: 26px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
  padding: 11px 16px; display: inline-flex; gap: 0; flex-wrap: wrap; align-items: center;
}
.hero.center .statusline { display: inline-flex; }
.statusline b { color: var(--ink); font-weight: 600; }
.statusline .sep { color: var(--line-2); margin: 0 12px; }
.statusline .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); display: inline-block; margin-right: 8px; }

.btn {
  font-family: var(--mono); font-size: 13.5px; font-weight: 600; letter-spacing: 0.01em;
  padding: 11px 20px; border-radius: 7px; display: inline-flex; align-items: center; gap: 8px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn-primary { background: var(--accent); color: #fff; border: 1px solid var(--accent); }
.btn-primary:hover { background: var(--accent-2); text-decoration: none; }
.btn-ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line-2); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* ---------- stat strip ---------- */
.stat-strip {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin-top: 52px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow: hidden;
}
.stat { padding: 22px 18px; border-right: 1px solid var(--line); text-align: center; }
.stat:last-child { border-right: none; }
.stat .v { font-family: var(--mono); font-weight: 700; font-size: 26px; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.stat .v.accent { color: var(--accent); }
.stat .l { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-top: 8px; }

/* ---------- method steps ---------- */
.steps { margin-top: 44px; border-top: 1px solid var(--line); }
.step { display: grid; grid-template-columns: 60px 1fr; gap: 22px; padding: 28px 4px; border-bottom: 1px solid var(--line); align-items: start; }
.step-idx { font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--accent); border: 1px solid var(--line-2); border-radius: 6px; padding: 6px 0; text-align: center; }
.step h3 { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.step p { margin: 8px 0 0; color: var(--ink-2); font-size: 15.5px; max-width: 62ch; }
.step .tag { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: 0.05em; text-transform: uppercase; margin-top: 10px; display: inline-block; }

/* ---------- Latent Mining loop figure ---------- */
.method-loop {
  margin-top: 42px;
  width: min(1200px, 94vw);
  margin-left: 50%;
  transform: translateX(-50%);
}
.method-loop-canvas {
  position: relative;
  min-width: min(760px, 100%);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
}
.method-loop img {
  width: 100%;
  height: auto;
  display: block;
}
.method-loop figcaption {
  margin: 16px auto 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  max-width: 72ch;
}

/* ---------- evidence chips ---------- */
.chip-block { margin-top: 26px; }
.chip-label { font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); display: block; margin-bottom: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chip { font-family: var(--mono); font-size: 12.5px; font-weight: 500; border: 1px solid var(--line); background: var(--surface); border-radius: 7px; padding: 7px 12px; color: var(--ink-2); }
.chip.hid { border-color: var(--accent); background: var(--accent-tint); color: var(--accent-2); }

/* ---------- A/B benchmark-gap diagram (graft) ---------- */
.gap { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 0; margin-top: 40px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.gap-col { padding: 26px 26px 28px; }
.gap-col.b { background: var(--accent-tint); border-left: 1px solid var(--line); }
.gap-h { font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 16px; }
.gap-col.b .gap-h { color: var(--accent-2); }
.gap-flow { display: flex; flex-direction: column; gap: 8px; }
.gap-flow.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gnode { border: 1px solid var(--line-2); border-radius: 7px; background: var(--surface); padding: 10px 12px; font-size: 13px; color: var(--ink-2); }
.gnode .gl { font-family: var(--mono); font-size: 9.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); display: block; margin-bottom: 3px; }
.gnode strong { color: var(--ink); font-weight: 600; }
.gnode.dim { opacity: 0.55; }
.gnode.gate { border-color: var(--accent); background: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.gnode.gate .gl { color: var(--accent); }
.gap-arrow { font-family: var(--mono); color: var(--muted); text-align: center; font-size: 12px; line-height: 1; }
.gap-cap { margin-top: 14px; font-family: var(--mono); font-size: 12px; color: var(--muted); line-height: 1.6; }
.gap-cap b { color: var(--ink-2); }

/* ---------- finding callout ---------- */
.finding { border: 1px solid var(--line-2); border-left: 3px solid var(--accent); background: var(--surface); border-radius: 10px; padding: 30px 32px; margin-top: 34px; }
.finding .label { font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.finding p { margin: 14px 0 0; font-size: 19px; line-height: 1.5; color: var(--ink); }
.finding p .em { color: var(--accent); font-weight: 600; }
.callout { border: 1px solid var(--line); border-left: 3px solid var(--accent); background: var(--surface); border-radius: 10px; padding: 22px 24px; color: var(--ink-2); font-size: 15px; line-height: 1.6; }
.callout.warn { border-left-color: var(--near); }
.callout b { color: var(--ink); }

/* ---------- outcome cards ---------- */
.outcomes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 30px; }
.outcome { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 22px 20px; border-top: 3px solid var(--line-2); }
.outcome.solve { border-top-color: var(--solve); }
.outcome.near  { border-top-color: var(--near); }
.outcome.fail  { border-top-color: var(--fail); }
.outcome .pct { font-family: var(--mono); font-weight: 700; font-size: 29px; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.outcome.solve .pct { color: var(--solve); }
.outcome .n { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-top: 4px; }
.outcome .name { font-size: 14.5px; font-weight: 600; margin-top: 12px; }
.outcome .desc { font-size: 13px; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.integrity { margin-top: 16px; font-family: var(--mono); font-size: 12.5px; color: var(--muted); border: 1px solid var(--line); border-radius: 8px; padding: 13px 16px; background: var(--surface); font-variant-numeric: tabular-nums; line-height: 1.8; }
.integrity .ok { color: var(--accent); font-weight: 600; }

/* ---------- stacked outcome bar ---------- */
.stack { display: flex; height: 16px; border-radius: 5px; overflow: hidden; border: 1px solid var(--line); }
.stack span { height: 100%; transition: width 0.7s var(--ease); }
.stack .s { background: var(--solve); } .stack .n { background: var(--near); } .stack .f { background: var(--fail); }
.stack-legend { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 13px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.stack-legend span { display: inline-flex; align-items: center; gap: 7px; }
.sw { width: 10px; height: 10px; border-radius: 3px; }
.sw.s { background: var(--solve); } .sw.n { background: var(--near); } .sw.f { background: var(--fail); }

/* ---------- tables ---------- */
.table-box { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-top: 26px; }
.table-scroll { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
table.t thead th {
  font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--muted); text-align: left;
  padding: 13px 18px; border-bottom: 1px solid var(--line); background: #f4f5f7; white-space: nowrap;
}
table.t thead th.r { text-align: right; }
table.t tbody td { padding: 15px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 14px; color: var(--ink-2); }
table.t tbody tr:last-child td { border-bottom: none; }
table.t tbody tr:hover { background: #f6f8f7; }
table.t tr.total td { background: #f4f5f7; font-weight: 600; color: var(--ink); }
table.t td.num, table.t th.r { font-family: var(--mono); font-variant-numeric: tabular-nums; text-align: right; }
table.t td b, table.t .strong { color: var(--ink); font-weight: 600; }
.cellmono { font-family: var(--mono); font-size: 13px; }
.cellmono.dim { color: var(--muted); }

/* rank + provider glyph */
.rank { font-family: var(--mono); font-weight: 700; font-size: 14px; width: 32px; height: 32px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; border: 1px solid var(--line); color: var(--ink-2); }
.rank.r1, .rank.r2, .rank.r3 { background: var(--surface); color: var(--ink-2); }
.rank.rx { background: var(--surface); color: var(--muted); }
.model { display: flex; align-items: center; gap: 11px; }
.glyph { width: 30px; height: 30px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; font-family: var(--mono); font-weight: 700; font-size: 12px; color: var(--muted); background: #fff; border: 1px solid var(--line); flex-shrink: 0; overflow: hidden; }
.glyph img { width: 19px; height: 19px; object-fit: contain; display: block; }
.model .nm { font-weight: 700; font-size: 14.5px; letter-spacing: -0.01em; color: var(--ink); }
.model .pv { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-top: 2px; }

/* status tag */
.tag { font-family: var(--mono); font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.tag.ok { background: var(--accent-tint); color: var(--accent-2); }
.tag.run { background: var(--near-tint); color: #7a5408; }
.tag.plan { background: #f3f4f5; color: var(--muted); }
.tag .pulse { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.25; } }

/* trace explorer */
.trace-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 28px; }
.trace-metric { border: 1px solid var(--line); border-radius: 8px; padding: 16px; background: var(--surface); }
.trace-metric .v { font-family: var(--mono); font-size: 26px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.trace-metric .l { margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.explorer { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); overflow: hidden; margin-top: 28px; }
.explorer-controls { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 16px; border-bottom: 1px solid var(--line); background: #f7f8f9; }
.searchbox { width: 100%; min-height: 38px; border: 1px solid var(--line); border-radius: 7px; padding: 0 12px; font: 500 13px var(--sans); color: var(--ink); background: #fff; }
.searchbox:focus, .seg button:focus, .rowbtn:focus, .nm-card-btn:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; background: #fff; }
.seg button { min-height: 36px; border: 0; border-right: 1px solid var(--line); padding: 0 12px; background: transparent; color: var(--muted); font: 700 11px var(--mono); cursor: pointer; }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { color: var(--accent); background: var(--accent-tint); }
.selectbox { min-height: 38px; border: 1px solid var(--line); border-radius: 7px; padding: 0 10px; background: #fff; color: var(--ink-2); font: 700 11px var(--mono); }
.explorer-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 0; }
.signature { border-right: 1px solid var(--line); padding: 22px; }
.signature h3, .evidence-pane h3 { font-size: 15px; font-weight: 800; color: var(--ink); }
.signature p, .evidence-pane p { margin-top: 7px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.timeline { margin-top: 18px; display: grid; gap: 12px; }
.tstep { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: start; }
.tstep .idx { font-family: var(--mono); font-size: 11px; color: var(--muted); padding-top: 3px; }
.tstep .move { color: var(--ink-2); font-size: 13.5px; line-height: 1.45; }
.tstep .move b { color: var(--ink); }
.mini-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.mini-tags span { border: 1px solid var(--line); border-radius: 5px; padding: 2px 6px; color: var(--muted); background: #f7f8f9; font: 700 10px var(--mono); }
.evidence-pane { padding: 22px; }
.matrix-wrap { margin-top: 16px; max-height: 420px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.rowbtn { width: 100%; border: 0; background: transparent; text-align: left; color: inherit; cursor: pointer; font: inherit; padding: 0; }
.rowbtn b { color: var(--ink); }
.polarity { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 5px; padding: 2px 7px; font: 700 10px var(--mono); color: var(--muted); background: #f7f8f9; }
.polarity.process { color: var(--solve); border-color: color-mix(in srgb, var(--solve) 35%, var(--line)); }
.polarity.failure { color: var(--fail); border-color: color-mix(in srgb, var(--fail) 35%, var(--line)); }
.polarity.gap { color: #8a5a00; border-color: #e7cf91; background: #fff8e6; }
.detail-pane { margin-top: 16px; border: 1px solid var(--line); border-radius: 8px; padding: 16px; background: #fbfbfa; }
.model-bars { display: grid; gap: 10px; margin-top: 20px; }
.model-bar { display: grid; grid-template-columns: minmax(126px, .35fr) 1fr auto; gap: 12px; align-items: center; font-size: 13px; color: var(--ink-2); }
.model-bar .track { height: 9px; border-radius: 999px; background: #eceef0; overflow: hidden; }
.model-bar .fill { height: 100%; border-radius: inherit; background: var(--accent); }
.bars { display: grid; gap: 14px; margin-top: 8px; }
.brow { display: grid; grid-template-columns: minmax(140px, .5fr) 1fr auto; gap: 14px; align-items: center; font-size: 13.5px; }
.brow .l { color: var(--ink-2); }
.btrack { height: 10px; background: #eceef0; border-radius: 999px; overflow: hidden; }
.bfill { height: 100%; background: var(--fail); border-radius: inherit; }
.bval { font-family: var(--mono); font-size: 12px; color: var(--muted); text-align: right; min-width: 56px; }
.nm-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 28px; }
.nm-card-btn { width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 18px; cursor: pointer; }
.nm-card-btn[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.nm-card-btn .c { font-family: var(--mono); font-weight: 700; font-size: 30px; font-variant-numeric: tabular-nums; color: var(--ink); }
.nm-card-btn .t { font-weight: 700; font-size: 14px; margin: 10px 0 6px; color: var(--ink); }
.nm-card-btn .r { color: var(--muted); font-size: 13px; line-height: 1.5; }
@media (max-width: 820px) {
  .trace-metrics { grid-template-columns: 1fr; }
  .explorer-controls { grid-template-columns: 1fr; }
  .explorer-grid { grid-template-columns: 1fr; }
  .signature { border-right: 0; border-bottom: 1px solid var(--line); }
  .model-bar { grid-template-columns: 1fr; gap: 6px; }
  .nm-grid { grid-template-columns: 1fr; }
  .brow { grid-template-columns: 1fr; gap: 5px; }
  .bval { text-align: left; }
}

/* small inline bar (assay solve rate) */
.minibar { display: inline-flex; align-items: center; gap: 9px; }
.minibar .track { width: 84px; height: 8px; background: #eceef0; border-radius: 999px; overflow: hidden; }
.minibar .fill { height: 100%; background: var(--accent); border-radius: inherit; }

/* ---------- claim boundary cards ---------- */
.boundary { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 28px; }
.bcard { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 24px 22px; }
.bcard h4 { font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.bcard.supported h4 { color: var(--accent); }
.bcard.running h4 { color: #7a5408; }
.bcard.not h4 { color: var(--muted); }
.bcard ul { margin: 14px 0 0; padding: 0; list-style: none; }
.bcard li { font-size: 14px; color: var(--ink-2); padding: 9px 0 9px 22px; position: relative; border-top: 1px solid var(--line); line-height: 1.5; }
.bcard li:first-child { border-top: none; }
.bcard.supported li::before { content: "+"; position: absolute; left: 0; color: var(--accent); font-family: var(--mono); font-weight: 700; }
.bcard.running li::before { content: "~"; position: absolute; left: 2px; color: var(--near); font-family: var(--mono); font-weight: 700; }
.bcard.not li::before { content: "\2212"; position: absolute; left: 0; color: var(--muted); font-family: var(--mono); }

/* ---------- generic cards ---------- */
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 28px; }
.cards.three { grid-template-columns: repeat(3, 1fr); }
.card { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 22px; }
.card h3 { font-size: 16px; font-weight: 700; }
.card p { color: var(--muted); font-size: 14px; line-height: 1.55; margin-top: 9px; }
.card code, code.inline { font-family: var(--mono); font-size: 12.5px; background: #f3f4f5; padding: 1px 6px; border-radius: 4px; color: var(--ink); }

/* ---------- next grid + footer ---------- */
.next-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin-top: 30px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
.next-grid a { padding: 24px 20px; border-right: 1px solid var(--line); display: block; color: var(--ink); }
.next-grid a:last-child { border-right: none; }
.next-grid a:hover { background: #f6f8f7; text-decoration: none; }
.next-grid a[aria-disabled="true"] { pointer-events: none; opacity: 0.45; cursor: default; }
.next-grid a[aria-disabled="true"]:hover { background: transparent; }
.next-grid .k { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.next-grid .t { font-weight: 700; font-size: 16px; margin-top: 10px; }
.next-grid .d { font-size: 13px; color: var(--muted); margin-top: 6px; line-height: 1.5; }

footer.site { padding: 52px 0 64px; }
.foot-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.foot-mark { font-family: var(--mono); font-weight: 700; font-size: 14px; }
.foot-mark .slash { color: var(--accent); }
.foot-links { display: flex; gap: 20px; flex-wrap: wrap; }
.foot-links a { font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); }
.foot-meta { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-top: 22px; line-height: 1.8; }
.foot-cite { color: var(--muted); font-size: 13px; line-height: 1.6; max-width: 64ch; margin-top: 22px; }
.foot-cite b { color: var(--ink-2); }
.foot-cite pre { font-family: var(--mono); font-size: 11px; line-height: 1.5; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; margin-top: 12px; overflow-x: auto; color: var(--ink-2); }

/* ---------- report-specific ---------- */
.report { max-width: var(--maxw-narrow); }
.report .rsec { padding-top: 46px; }
.report h2 { max-width: 28ch; }
.report h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.abstract { border: 1px solid var(--line); border-left: 3px solid var(--accent); background: var(--surface); border-radius: 10px; padding: 24px 26px; }
.abstract p { color: var(--ink-2); font-size: 15.5px; line-height: 1.62; }
.toc { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 18px; }
.toc a { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.toc a:hover { color: var(--accent); }
.walk { margin-top: 18px; }
.walk .w { display: grid; grid-template-columns: 130px 1fr; gap: 18px; padding: 14px 0; border-top: 1px solid var(--line); }
.walk .w:first-child { border-top: none; }
.walk .w .k { font-family: var(--mono); font-size: 11.5px; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: 0.04em; }
.walk .w .d { color: var(--ink-2); font-size: 14.5px; line-height: 1.55; }
.walk .w .d b { color: var(--ink); }

/* ---------- motion ---------- */
@keyframes fadeUp { from { transform: translateY(10px); } to { transform: translateY(0); } }
.rise { opacity: 1; animation: fadeUp 0.6s var(--ease) both; }
.rise.d1 { animation-delay: 0.05s; } .rise.d2 { animation-delay: 0.12s; }
.rise.d3 { animation-delay: 0.19s; } .rise.d4 { animation-delay: 0.26s; }
@media (prefers-reduced-motion: reduce) { .rise { animation: none; opacity: 1; } .stack span, .btn { transition: none; } }

/* ---------- responsive ---------- */
@media (max-width: 820px) {
  .gap { grid-template-columns: 1fr; }
  .gap-col.b { border-left: none; border-top: 1px solid var(--line); }
  .outcomes, .boundary, .cards, .cards.three { grid-template-columns: 1fr; }
  .next-grid { grid-template-columns: 1fr 1fr; }
  .next-grid a:nth-child(2), .next-grid a:nth-child(4) { border-right: none; }
  .next-grid a:nth-child(1), .next-grid a:nth-child(2) { border-bottom: 1px solid var(--line); }
  .method-loop { overflow-x: auto; padding-bottom: 4px; }
  .method-loop figcaption { min-width: 0; }
}
@media (max-width: 720px) {
  .nav-links { display: none; }
  .section { padding: 64px 0; }
  .hero { padding: 56px 0 60px; }
  .stat-strip { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(2) { border-right: none; }
  .stat:nth-child(1), .stat:nth-child(2) { border-bottom: 1px solid var(--line); }
  .step { grid-template-columns: 46px 1fr; gap: 14px; }
  .walk .w { grid-template-columns: 1fr; gap: 4px; }
  table.t .hide { display: none; }
  .gap-flow.cols { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .wrap, .nav { padding-left: 18px; padding-right: 18px; }
  .next-grid { grid-template-columns: 1fr; }
  .next-grid a { border-right: none !important; border-bottom: 1px solid var(--line); }
  .statusline .sep { margin: 0 8px; }
}
