/* ============================================================
   Data product pages (/data/*.html)

   The page bodies are generated upstream (brochure builder) and carry both
   component classes and inline `var(--…)` references to a small local token
   set. This file re-points that token set at the Intnax design system and
   restyles every component in the site's idiom — warm paper, hairlines,
   single teal accent, display/body/mono trio from site.css.

   Loaded only by /data pages, so the local tokens live on :root.
   --ink and --border-strong also exist in site.css; they are aliased to the
   same values there, so site chrome (header, footer) is unaffected.
   ============================================================ */

:root {
  /* type */
  --fd: var(--font-display);
  --fb: var(--font-body);
  --fm: var(--font-mono);

  /* surfaces */
  --bg: var(--surface-canvas);
  --surface: var(--surface-sunken);
  --raised: var(--surface-card);
  --code: var(--tan-100);

  /* hairlines + ink */
  --border: var(--border-default);
  --border-strong: var(--tan-400);
  --ink: #0e0e0d;
  --muted: var(--text-secondary);

  /* accent — single teal, no second hue */
  --acc: var(--accent);
  --acc-text: var(--accent);
  --acc-dim: var(--accent-soft);
  --acc-surface: var(--blue-50);

  /* verdict pair — desaturated so they sit on warm paper */
  --pass: #4c7355;
  --fail: #a1524a;

  /* heat ramp — teal, 5 steps, paired with legible text colors */
  --h0: #f0ebe1; --h0t: #7d786e;
  --h1: #dfe7e9; --h1t: #3d5c66;
  --h2: #bcd0d6; --h2t: #24444f;
  --h3: #7ea6b1; --h3t: #f6f2eb;
  --h4: #3c6b7c; --h4t: #f6f2eb;

  /* radius */
  --r: var(--radius-md);
  --rl: var(--radius-lg);
  --rp: var(--radius-pill);

  --max-data: var(--max);
}

/* ============================================================ Shell */
.data-page > section,
.data-page > div,
.data-page > header { width: 100%; margin: 0; padding: 0; }
.data-page .wrap { width: min(var(--max-data), calc(100% - 48px)); margin: 0 auto; }
.data-page section.blk { padding: 72px 0 0; }
.data-page .mono { font-family: var(--fm); }

/* ============================================================ Section sub-navigation */
.top {
  position: sticky;
  top: 65px;
  z-index: 40;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(246, 242, 235, 0.86);
  backdrop-filter: blur(20px) saturate(1.1);
}
.top .wrap { width: min(var(--max-data), calc(100% - 48px)); margin: 0 auto; }
.crumb {
  padding: 13px 0 0;
  color: var(--text-muted);
  font-family: var(--fm);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
}
.crumb b { color: var(--text-secondary); font-weight: 500; }
.tabs { display: flex; gap: 26px; padding: 8px 0 0; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  padding: 8px 0 11px;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-size: 14px;
  white-space: nowrap;
  transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.tabs a:hover { color: var(--text-primary); text-decoration: none; }
.tabs a.on { color: var(--text-primary); border-bottom-color: var(--accent); }

/* ============================================================ Page hero */
.data-page > .d-hero { padding: 76px 0 48px; }
.d-hero h1 {
  font-family: var(--fd);
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.025em;
}
.d-hero h1.mid { font-size: clamp(2rem, 3.2vw, 2.8rem); }
.d-hero .pitch { max-width: 760px; margin-top: 22px; color: var(--text-secondary); font-size: 17px; line-height: 1.62; }
.chips { margin-top: 28px; display: flex; gap: 8px; flex-wrap: wrap; }
.chips span {
  padding: 6px 15px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-pill);
  background: var(--surface-card);
  color: var(--text-secondary);
  font-size: 13px;
}

/* ============================================================ Stat strip */
.strip {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--surface-card);
  box-shadow: var(--shadow-rest);
  overflow: hidden;
}
.strip .cell { padding: 22px 22px 20px; border-right: 1px solid var(--border-subtle); }
.strip .cell:last-child { border-right: 0; }
.strip b {
  display: block;
  font-family: var(--fd);
  font-size: 30px;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.strip span {
  display: block;
  margin-top: 8px;
  color: var(--text-muted);
  font-family: var(--fm);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
}

/* ============================================================ Section heads */
.shead { margin-bottom: 4px; }
.shead .no {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
  font-family: var(--fm);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.shead .no::before { content: ""; width: 18px; height: 1px; background: var(--accent); }
.shead h2 {
  margin-top: 14px;
  font-family: var(--fd);
  font-size: clamp(1.7rem, 2.4vw, 2.2rem);
  font-weight: 400;
  line-height: 1.14;
  letter-spacing: -0.02em;
}
.lead { max-width: 780px; margin: 16px 0 26px; color: var(--text-secondary); font-size: 16px; line-height: 1.62; }
.lead b { color: var(--text-primary); font-weight: 500; }

/* ============================================================ Cards */
.claims { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.claims.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.claim, .tcard {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--surface-card);
  box-shadow: var(--shadow-rest);
  transition: transform var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
.claim:hover, .tcard:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: var(--shadow-lg); }
.claim { padding: 26px; }
.claim .n, .tcard .cat {
  color: var(--accent);
  font-family: var(--fm);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.claim h3 { margin: 12px 0 10px; font-family: var(--fd); font-size: 21px; font-weight: 500; line-height: 1.2; letter-spacing: -0.015em; }
.claim p { color: var(--text-secondary); font-size: 14.5px; line-height: 1.62; }
.claim p b { color: var(--text-primary); font-weight: 500; }

/* task cards */
.tgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.tcard { padding: 24px 24px 18px; display: flex; flex-direction: column; }
.tcard h3 { margin: 10px 0 9px; font-family: var(--fd); font-size: 18px; font-weight: 500; line-height: 1.28; letter-spacing: -0.01em; }
.tcard p { flex: 1; color: var(--text-secondary); font-size: 13.8px; line-height: 1.6; }
.tcard .foot {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-family: var(--fm);
  font-size: 11px;
  line-height: 1.6;
}

/* ============================================================ Tables */
.data-page table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--surface-card);
  box-shadow: var(--shadow-rest);
  overflow: hidden;
  font-size: 14px;
}
.data-page th {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-default);
  background: var(--surface-sunken);
  color: var(--text-muted);
  font-family: var(--fm);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: left;
}
.data-page td { padding: 13px 16px; border-top: 1px solid var(--border-subtle); color: var(--text-primary); vertical-align: top; line-height: 1.6; }
.data-page tr:first-child td { border-top: 0; }
.data-page td.num { font-family: var(--fm); text-align: right; font-variant-numeric: tabular-nums; }
.data-page td.hcell { padding: 11px 6px; font-family: var(--fm); font-size: 12.5px; text-align: center; font-variant-numeric: tabular-nums; }

/* wide tables stay readable on narrow screens by scrolling in place */
.data-page .table-scroll { overflow-x: auto; overscroll-behavior-x: contain; }
@media (max-width: 680px) {
  .data-page .table-scroll table { min-width: 540px; }
}

/* ============================================================ Leaderboard */
.lb {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--surface-card);
  box-shadow: var(--shadow-rest);
  overflow: hidden;
}
.lbrow { display: flex; align-items: center; gap: 16px; padding: 18px 22px; border-top: 1px solid var(--border-subtle); }
.lbrow:first-child { border-top: 0; }
.lbrow.top1 { background: var(--accent-soft); }
.lbrow .rk { width: 26px; color: var(--text-muted); font-family: var(--fm); font-size: 12px; }
.lbrow .nm { min-width: 190px; font-size: 16px; font-weight: 500; }
.lbrow .nm small { margin-left: 8px; color: var(--text-muted); font-family: var(--fm); font-size: 11.5px; font-weight: 400; }
.lbrow .metrics { margin-left: auto; display: flex; gap: 30px; text-align: right; }
.lbrow .metrics div { min-width: 78px; }
.lbrow .metrics b { display: block; font-family: var(--fd); font-size: 20px; font-weight: 400; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.lbrow .metrics span { color: var(--text-muted); font-family: var(--fm); font-size: 10.5px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; }

/* ============================================================ Failure modes */
.modes {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--surface-card);
  box-shadow: var(--shadow-rest);
  overflow: hidden;
}
.modes li { padding: 20px 24px 22px; border-top: 1px solid var(--border-subtle); }
.modes li:first-child { border-top: 0; }
.mode-head { display: flex; align-items: baseline; gap: 12px; }
.mode-name { font-size: 16px; font-weight: 500; }
.mode-fig { margin-left: auto; color: var(--text-muted); font-family: var(--fm); font-size: 12px; font-variant-numeric: tabular-nums; }
.mode-bar { display: block; height: 5px; margin: 12px 0 10px; border-radius: var(--radius-pill); background: var(--tan-100); overflow: hidden; }
.mode-fill { display: block; height: 100%; border-radius: var(--radius-pill); background: var(--accent); }
.mode-sig { display: block; color: var(--text-secondary); font-size: 14px; line-height: 1.62; }

/* ============================================================ Per-model rails */
.rails {
  padding: 8px 24px 18px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--surface-card);
  box-shadow: var(--shadow-rest);
}
.rail { padding: 16px 0 6px; border-top: 1px solid var(--border-subtle); }
.rail:first-child { border-top: 0; }
.rail .rl { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; font-size: 14px; }
.rail .rl b { font-weight: 500; }
.rail .rl span { margin-left: auto; color: var(--text-muted); font-family: var(--fm); font-size: 11.5px; }
.track { position: relative; height: 30px; border-radius: var(--radius-pill); background: linear-gradient(var(--tan-100), var(--tan-100)) center/100% 2px no-repeat; }
.dot { position: absolute; top: 5px; width: 12px; height: 12px; border: 2px solid var(--surface-card); border-radius: 50%; transform: translateX(-50%); box-shadow: 0 0 0 1px var(--border-strong); }
.axis { margin-top: 4px; display: flex; justify-content: space-between; color: var(--text-muted); font-family: var(--fm); font-size: 10.5px; }
.legend { margin-top: 14px; display: flex; gap: 18px; flex-wrap: wrap; color: var(--text-secondary); font-size: 12.5px; }
.legend i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 50%; vertical-align: -1px; }

/* ============================================================ Deep dives, quotes, placeholders */
.deep {
  margin-top: 16px;
  padding: 22px 24px;
  border: 1px solid var(--border-default);
  border-left: 2px solid var(--accent);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  background: var(--surface-card);
  box-shadow: var(--shadow-rest);
}
.deep b { font-size: 16px; font-weight: 500; }
.deep p { margin-top: 10px; color: var(--text-secondary); font-size: 14.5px; line-height: 1.62; }
.quote {
  margin-top: 12px;
  padding: 13px 15px;
  border-radius: var(--radius-md);
  background: var(--tan-100);
  color: var(--text-primary);
  font-family: var(--fm);
  font-size: 12.5px;
  line-height: 1.65;
}
.ph {
  padding: 30px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface-sunken);
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
}

/* ============================================================ CTA band */
.band {
  margin-top: 52px;
  padding: 44px 48px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  align-items: center;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  background: var(--surface-raised);
}
.band b { font-family: var(--fd); font-size: clamp(1.4rem, 2vw, 1.8rem); font-weight: 400; line-height: 1.16; letter-spacing: -0.02em; }
.band small { display: block; max-width: 640px; margin-top: 12px; color: var(--text-secondary); font-size: 15px; line-height: 1.6; }

/* ============================================================ Page meta line */
.data-meta {
  margin: 64px 0 0;
  padding: 20px 0 8px;
  border-top: 1px solid var(--border-default);
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 12.5px;
}
.data-meta .upd { margin-left: auto; font-family: var(--fm); }

/* ============================================================ Responsive */
@media (max-width: 1040px) {
  .tgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .claims.c3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .top { position: static; }
  .data-page .wrap, .top .wrap { width: min(var(--max-data), calc(100% - 32px)); }
  .strip { grid-template-columns: repeat(2, 1fr); }
  .strip .cell:nth-child(2n) { border-right: 0; }
  .strip .cell { border-top: 1px solid var(--border-subtle); }
  .strip .cell:nth-child(-n + 2) { border-top: 0; }
  .data-page > .d-hero { padding: 40px 0 28px; }
  .data-page section.blk { padding: 56px 0 0; }
  .band { padding: 32px; grid-template-columns: 1fr; }
  .lbrow { flex-wrap: wrap; }
  .lbrow .metrics { margin-left: 0; gap: 20px; }
}
@media (max-width: 680px) {
  .claims, .claims.c3, .tgrid { grid-template-columns: minmax(0, 1fr); }
  .data-page table { font-size: 13px; }
  .data-page th, .data-page td { padding: 11px 12px; }
}
