/* Kintechs site styles. Tokens are documented in DESIGN.md. */

@font-face {
  font-family: "Public Sans";
  src: url("/assets/fonts/public-sans-latin-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;

  /* Neutrals carry a trace of the brand hue (110) so greys read as one family. */
  --bg: oklch(0.125 0.004 110);
  --surface: oklch(0.152 0.005 110);
  --surface-2: oklch(0.188 0.006 110);
  --line: oklch(0.262 0.006 110);
  --line-soft: oklch(0.207 0.005 110);
  --grid: oklch(0.212 0.005 110);
  --ink: oklch(0.96 0.003 110);
  --ink-2: oklch(0.83 0.004 110);
  --muted: oklch(0.70 0.006 110);
  --faint: oklch(0.62 0.006 110);

  --signal: oklch(0.87 0.17 118);
  --signal-hover: oklch(0.91 0.15 118);
  --signal-ink: oklch(0.17 0.04 118);
  --olive: oklch(0.35 0.075 110);
  --cool: oklch(0.76 0.09 235);
  --amber: oklch(0.82 0.14 78);
  --breach: oklch(0.70 0.19 28);
  --violet: oklch(0.72 0.12 300);

  --font: "Public Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;

  /* Type scale: 12 / 13 / 14 / 16 / 18 / 24, headings fluid above that. */
  --fs-cap: 0.75rem;
  --fs-xs: 0.8125rem;
  --fs-sm: 0.875rem;
  --fs-md: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.5rem;

  /* Spacing: tight inside components, generous between sections. */
  --s1: 0.25rem; --s2: 0.5rem; --s3: 0.75rem; --s4: 1rem; --s5: 1.5rem;
  --s6: 2rem; --s7: 3rem; --s8: 4rem; --s9: clamp(3rem, 2rem + 3vw, 4.5rem);

  --r-sm: 3px;
  --r: 4px;
  --r-lg: 6px;
  --wrap: 1200px;
  --head-h: 60px;
  --ease: cubic-bezier(0.25, 1, 0.5, 1); /* ease-out-quart */

  --z-sticky: 10; --z-menu: 20;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-2);
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: 1.6;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
::selection { background: color-mix(in oklch, var(--signal) 32%, transparent); color: var(--ink); }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; border-radius: var(--r-sm); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--s4); top: var(--s4); background: var(--signal); color: var(--signal-ink); padding: var(--s2) var(--s3); border-radius: var(--r); z-index: var(--z-menu); }

h1, h2, h3 {
  color: var(--ink);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.02em;
  text-wrap: balance;
  margin: 0;
}
h1 { font-size: clamp(2rem, 1.5rem + 2vw, 2.75rem); letter-spacing: -0.026em; }
h2 { font-size: clamp(1.375rem, 1.15rem + 0.9vw, 1.75rem); }
h3 { font-size: var(--fs-lg); line-height: 1.3; letter-spacing: -0.01em; }
p { margin: 0; text-wrap: pretty; }
.num, .mono { font-variant-numeric: tabular-nums; }
.lede { font-size: var(--fs-lg); line-height: 1.6; color: var(--ink-2); max-width: 60ch; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
section { padding-block: var(--s9); }
section + section { border-top: 1px solid var(--line-soft); }

.up { color: var(--signal); }
.down { color: var(--breach); }
html:not(.ready) [data-k] { color: var(--muted); }

/* ---------- Header ---------- */
.site-head {
  position: sticky; top: 0; z-index: var(--z-sticky);
  background: color-mix(in oklch, var(--bg) 94%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.site-head .wrap { display: flex; align-items: center; gap: var(--s6); height: var(--head-h); }
.logo { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--ink); font-weight: 650; font-size: 1.0625rem; letter-spacing: -0.02em; }
.logo img { width: 20px; height: 20px; }
.nav { display: flex; gap: var(--s5); margin-left: auto; align-items: center; }
.nav a:not(.btn) { display: flex; align-items: center; height: var(--head-h); text-decoration: none; color: var(--muted); font-size: var(--fs-sm); transition: color 0.15s var(--ease), box-shadow 0.15s var(--ease); }
.nav a:not(.btn):hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--signal); }
.menu-toggle { display: none; margin-left: auto; align-items: center; background: none; border: 1px solid var(--line); color: var(--ink); border-radius: var(--r); min-height: 40px; padding: 0 0.85rem; font: 500 var(--fs-sm) var(--font); cursor: pointer; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 40px; padding: 0 1rem;
  border-radius: var(--r); border: 1px solid var(--line); background: transparent;
  color: var(--ink); text-decoration: none; font: 500 var(--fs-sm)/1 var(--font); letter-spacing: -0.005em;
  cursor: pointer;
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
}
.btn:hover { border-color: oklch(0.36 0.006 110); background: var(--surface); }
.btn:active { background: var(--surface-2); }
.btn.primary { background: var(--signal); border-color: var(--signal); color: var(--signal-ink); font-weight: 600; }
.btn.primary:hover { background: var(--signal-hover); border-color: var(--signal-hover); }
.btn:disabled { opacity: 0.55; cursor: progress; }
.nav .btn { min-height: 34px; padding: 0 0.85rem; }
.actions { display: flex; flex-wrap: wrap; gap: var(--s3); }

/* ---------- Ticker ---------- */
.ticker {
  height: 36px; display: flex; align-items: center; overflow: hidden;
  border-bottom: 1px solid var(--line-soft); background: var(--bg);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent);
}
.ticker-track { display: flex; width: max-content; animation: tk-scroll var(--tk-dur, 60s) linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.tk-run { display: flex; align-items: center; flex: none; }
.tk { display: inline-flex; align-items: baseline; gap: 0.45rem; white-space: nowrap; padding: 0 1rem; font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.tk em { font-style: normal; color: var(--muted); }
.tk b { color: var(--ink); font-weight: 500; }
.tk i { font-style: normal; }
.tk-sep { width: 1px; height: 10px; background: var(--line); flex: none; }
@keyframes tk-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- Home ---------- */
.home-hero { padding-block: clamp(3.5rem, 2rem + 5vw, 6rem) clamp(2.5rem, 1.5rem + 3vw, 4rem); }
.home-hero h1 { font-size: clamp(2.25rem, 1.35rem + 3.4vw, 3.5rem); line-height: 1.06; letter-spacing: -0.032em; max-width: 19ch; margin-bottom: var(--s5); }
.home-hero h1 em { font-style: normal; color: inherit; }
.home-hero .lede { max-width: 54ch; margin-bottom: var(--s6); }
.home-hero + section { border-top: 0; padding-top: 0; }

.sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3) var(--s6); margin-bottom: var(--s5); flex-wrap: wrap; }
.sec-head p { max-width: 52ch; color: var(--muted); }
.src { font-size: var(--fs-cap); color: var(--faint); font-variant-numeric: tabular-nums; }

/* Headline tiles: a ruled grid on the page background, not a wall of cards. */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); border-radius: var(--r); overflow: hidden; }
.tile {
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
  padding: 14px 16px 14px;
  background: var(--bg);
  text-decoration: none; color: inherit;
  transition: background-color 0.15s var(--ease);
}
.tile:hover { background: var(--surface); }
.t-l { font-size: var(--fs-xs); color: var(--muted); }
.t-v { margin-top: 2px; font-size: var(--fs-xl); font-weight: 500; line-height: 1.2; letter-spacing: -0.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.t-s { font-size: var(--fs-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.spark { height: 30px; margin-top: auto; padding-top: 10px; box-sizing: content-box; }
.spark:not([data-spark]) { display: none; }
.spark svg { width: 100%; height: 30px; overflow: visible; }

.explore { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-soft); }
.explore a { display: grid; grid-template-columns: minmax(10rem, 15rem) minmax(0, 1fr) auto; gap: var(--s5); align-items: baseline; padding: 20px 0; border-bottom: 1px solid var(--line-soft); text-decoration: none; color: var(--muted); transition: color 0.15s var(--ease); }
.explore b { color: var(--ink); font-size: var(--fs-lg); font-weight: 600; letter-spacing: -0.01em; }
.explore i { font-style: normal; color: var(--muted); transition: transform 0.2s var(--ease), color 0.2s var(--ease); }
.explore a:hover { color: var(--ink-2); }
.explore a:hover i { color: var(--ink); transform: translateX(3px); }

/* Market overview: the chart leads at full width, the table follows. */
.stack { display: grid; gap: var(--s3); }

/* Portfolio risk: chart on the left, the written brief as a text column. */
.risk-split { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: var(--s6) clamp(2rem, 4vw, 3.5rem); align-items: start; }
.brief-col { padding-top: var(--s2); }
.brief-col h3 { margin-bottom: var(--s1); }
.brief-col .brief-meta { margin-bottom: var(--s4); }
.brief-col .brief p { font-size: 0.9375rem; line-height: 1.65; margin-bottom: var(--s3); }
.brief-col .btn { margin-top: var(--s3); }

/* ---------- Panels ---------- */
.panel {
  margin: 0; min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
  box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.025);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2) var(--s3); min-height: 48px; padding: 10px 16px 2px; flex-wrap: wrap; }
.panel-title { color: var(--ink); font-weight: 600; font-size: var(--fs-sm); letter-spacing: -0.005em; }
.panel-title .mono { margin-left: 0.4rem; color: var(--muted); font-weight: 400; font-size: var(--fs-xs); }
.chip-row { display: inline-flex; gap: var(--s2); flex-wrap: wrap; }
.chips { display: inline-flex; padding: 2px; border: 1px solid var(--line-soft); border-radius: var(--r); background: var(--bg); }
.chips button {
  min-height: 24px; padding: 0 0.55rem;
  font: 500 var(--fs-cap)/1 var(--font); font-variant-numeric: tabular-nums; letter-spacing: 0.01em;
  color: var(--muted); background: none; border: 0; border-radius: var(--r-sm); cursor: pointer;
  transition: color 0.15s var(--ease), background-color 0.15s var(--ease);
}
.chips button:hover { color: var(--ink-2); }
.chips button[aria-pressed="true"] { color: var(--ink); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.csv-btn {
  margin-left: auto; min-height: 24px; padding: 0 0.5rem;
  font: 500 var(--fs-cap)/1 var(--font); letter-spacing: 0.02em;
  color: var(--muted); background: transparent; border: 1px solid var(--line-soft); border-radius: var(--r-sm); cursor: pointer;
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease), background-color 0.15s var(--ease);
}
.csv-btn:hover { color: var(--ink); border-color: var(--line); background: var(--surface-2); }

.chart { position: relative; padding: 8px 16px 4px; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.foot { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s2) var(--s4); flex-wrap: wrap; padding: 8px 16px 14px; font-size: var(--fs-cap); color: var(--muted); }
.foot > span:last-child:not(.legend) { color: var(--faint); }
.legend { display: inline-flex; flex-wrap: wrap; gap: 4px 16px; color: var(--ink-2); }
.legend .key { display: inline-flex; align-items: center; gap: 6px; }
.legend .key::before { content: ""; width: 12px; height: 2px; border-radius: 1px; background: var(--c, currentColor); }

.readout { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 8px 0 0; border-top: 1px solid var(--line-soft); }
.readout div { padding: 10px 16px 12px; }
.readout div + div { border-left: 1px solid var(--line-soft); }
.readout dt { font-size: var(--fs-cap); color: var(--muted); }
.readout dd { margin: 2px 0 0; color: var(--ink); font-size: var(--fs-md); font-weight: 500; font-variant-numeric: tabular-nums; }
.readout dd.bad { color: var(--breach); }

/* Chart primitives (SVG). Grid lines are aligned to the pixel grid in app.js. */
.ax text { fill: oklch(0.64 0.005 110); font-family: var(--font); font-size: 11px; font-variant-numeric: tabular-nums; }
.ax line, .grid line { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.zero { stroke: oklch(0.36 0.006 110); stroke-width: 1; shape-rendering: crispEdges; }
.ln { fill: none; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.ln.draw { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: draw 0.9s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.guide { stroke: oklch(0.48 0.005 110); stroke-width: 1; stroke-dasharray: 3 3; shape-rendering: crispEdges; }
.hmark { stroke: var(--surface); stroke-width: 2; }
.lastv text { font-family: var(--font); font-size: 10.5px; font-weight: 600; font-variant-numeric: tabular-nums; fill: oklch(0.15 0.02 110); }
.cell { font-family: var(--font); font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; }
.dotring { stroke: var(--surface); stroke-width: 1.5; }

/* Tooltip */
.tip {
  position: absolute; top: 8px; z-index: 5; pointer-events: none; min-width: 176px;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r);
  background: oklch(0.175 0.006 110 / 0.97); box-shadow: 0 10px 28px -14px oklch(0 0 0 / 0.85);
  font-size: var(--fs-cap); line-height: 1.7; font-variant-numeric: tabular-nums; color: var(--ink-2);
}
.tip b { display: block; margin-bottom: 4px; padding-bottom: 4px; border-bottom: 1px solid var(--line-soft); font-weight: 500; color: var(--muted); }
.tip span { display: flex; align-items: center; gap: 8px; }
.tip i { width: 10px; height: 2px; border-radius: 1px; flex: none; }
.tip em { margin-left: auto; padding-left: 16px; font-style: normal; font-weight: 500; color: var(--ink); }

/* Horizontal bar lists */
.hbars { display: grid; gap: 10px; padding: 6px 0 4px; }
.hbar { display: grid; grid-template-columns: minmax(5.5rem, 8.5rem) minmax(0, 1fr) minmax(7.5rem, auto); align-items: center; gap: 12px; font-size: var(--fs-xs); }
.hb-l { color: var(--ink-2); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-t { height: 6px; border-radius: 1px; background: oklch(0.2 0.005 110); overflow: hidden; }
.hb-t i { display: block; height: 100%; border-radius: 1px; }
.hb-v { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hb-v b { color: var(--ink); font-weight: 500; }
.hb-v em { margin-left: 6px; font-style: normal; color: var(--muted); }

/* ---------- Data tables ---------- */
.panel .scroll { overflow-x: auto; }
.dt { width: 100%; min-width: 560px; border-collapse: collapse; font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.dt th, .dt td { padding: 9px 12px; border-bottom: 1px solid var(--line-soft); text-align: right; white-space: nowrap; }
.dt tr > :first-child { padding-left: 16px; }
.dt tr > :last-child { padding-right: 16px; }
.dt thead th { padding-block: 10px 8px; border-bottom-color: var(--line); font-size: var(--fs-cap); font-weight: 500; color: var(--muted); }
.dt th[scope=row], .dt thead th:first-child, .dt td:first-child { text-align: left; }
.dt:has(td.rank) thead th:nth-child(2) { text-align: left; }
.dt th[scope=row] { color: var(--ink); font-weight: 500; }
.dt tbody tr { transition: background-color 0.12s var(--ease); }
.dt tbody tr:hover { background: oklch(1 0 0 / 0.025); }
.dt tbody tr:last-child th, .dt tbody tr:last-child td { border-bottom: 0; }
.dt tr.total th, .dt tr.total td { border-top: 1px solid var(--line); }
.dt .rank { width: 2rem; color: var(--faint); }
.dt .nm { color: var(--muted); font-weight: 400; }
.dt th .nm { display: block; margin-top: 1px; font-size: var(--fs-cap); }
.dt:has(td.rank) th .nm { display: inline; margin: 0 0 0 6px; font-size: var(--fs-xs); }
.dot { display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; vertical-align: 1px; }
.flag { display: inline-block; padding: 3px 6px; border-radius: var(--r-sm); font-size: var(--fs-cap); font-weight: 500; line-height: 1.2; background: oklch(1 0 0 / 0.05); }
.flag.normal { color: var(--signal); background: color-mix(in oklch, var(--signal) 11%, transparent); }
.flag.watch { color: var(--amber); background: color-mix(in oklch, var(--amber) 12%, transparent); }
.flag.alert { color: var(--breach); background: color-mix(in oklch, var(--breach) 14%, transparent); }
.state { font-size: var(--fs-xs); }
.state::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; vertical-align: 1px; }
.state.ok::before { background: var(--signal); }
.state.stale::before { background: var(--amber); }

/* ---------- Dashboard pages ---------- */
.dash-head { display: flex; justify-content: space-between; align-items: end; gap: var(--s4) var(--s5); flex-wrap: wrap; padding-block: var(--s7) var(--s5); }
.dash-head h1 { font-size: clamp(2rem, 1.5rem + 2vw, 2.75rem); }
.dash-head .lede { margin-top: var(--s3); }
.dash-nav { position: sticky; top: var(--head-h); z-index: calc(var(--z-sticky) - 1); background: color-mix(in oklch, var(--bg) 94%, transparent); backdrop-filter: saturate(140%) blur(12px); border-block: 1px solid var(--line-soft); }
.dash-nav .wrap { display: flex; gap: var(--s5); height: 44px; align-items: center; overflow-x: auto; scrollbar-width: none; }
.dash-nav .wrap::-webkit-scrollbar { display: none; }
.dash-nav a { color: var(--muted); text-decoration: none; font-size: var(--fs-sm); white-space: nowrap; transition: color 0.15s var(--ease); }
.dash-nav a:hover { color: var(--ink); }
.group { padding-block: 3.5rem; border-top: 1px solid var(--line-soft); scroll-margin-top: calc(var(--head-h) + 44px); }
.dash-nav + .group { border-top: 0; }
.group > .wrap > h2 { margin-bottom: var(--s5); }
.group > .wrap > h2:has(+ p) { margin-bottom: var(--s2); }
.group > .wrap > p { max-width: 68ch; margin-bottom: var(--s5); color: var(--muted); }
.group > .wrap > p a { color: var(--ink-2); text-underline-offset: 3px; text-decoration-color: var(--line); }
.group > .wrap > p a:hover { color: var(--ink); text-decoration-color: currentColor; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: var(--s3); align-items: start; }
.block { margin-top: var(--s3); }

/* KPI strips: hairline-ruled cells; empty cells of a wrapped row stay clean. */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); margin: 0 0 var(--s3); border: 1px solid var(--line-soft); border-radius: var(--r); overflow: hidden; }
.kpis div { padding: 10px 16px 12px; box-shadow: 1px 0 0 var(--line-soft), 0 1px 0 var(--line-soft); }
.kpis dt { font-size: var(--fs-cap); line-height: 1.35; color: var(--muted); }
.kpis dd { margin: 4px 0 0; font-size: 1.25rem; font-weight: 500; line-height: 1.2; letter-spacing: -0.015em; color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------- Research ---------- */
.page-body { padding-block: var(--s7); }
.page-body-lg { padding-block: var(--s7) var(--s8); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s6) clamp(2rem, 5vw, 4.5rem); align-items: start; }
.brief { max-width: 68ch; }
.brief p { font-size: var(--fs-md); line-height: 1.7; color: var(--ink-2); margin-bottom: var(--s4); }
.brief-meta { font-size: var(--fs-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.doc-hero .brief-meta { margin-top: var(--s3); }
.section-note { margin-bottom: var(--s4); color: var(--muted); }
.archive { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-soft); }
.archive a { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr) auto auto; gap: var(--s4); padding: 12px 0; border-bottom: 1px solid var(--line-soft); text-decoration: none; color: var(--ink-2); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; transition: color 0.15s var(--ease); }
.archive a:hover { color: var(--ink); }
.archive .mono { color: var(--ink); font-weight: 500; }
.panel-gap { margin-bottom: var(--s5) !important; }

/* ---------- Team and contact ---------- */
.team { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: var(--s7) clamp(2rem, 5vw, 4.5rem); align-items: start; }
.person h3 { font-size: 1.25rem; }
.people { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-soft); }
.people li { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s4); padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.people b { color: var(--ink); font-weight: 600; font-size: 1rem; }
.people span { font-size: var(--fs-sm); color: var(--muted); text-align: right; }
.person .role { display: block; margin: 2px 0 var(--s4); font-size: var(--fs-sm); color: var(--muted); }
.person p { max-width: 64ch; margin-bottom: var(--s3); font-size: 0.9375rem; line-height: 1.65; }
.links { display: flex; gap: var(--s4); flex-wrap: wrap; margin-top: var(--s4); font-size: var(--fs-sm); }
.links a { color: var(--ink); text-decoration-color: var(--line); text-underline-offset: 3px; transition: text-decoration-color 0.15s var(--ease); }
.links a:hover { text-decoration-color: var(--ink); }
.collab h3 { margin-bottom: var(--s4); }
.collab .actions { margin-top: var(--s5); }
.roles { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-soft); }
.roles li { padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.roles b { display: block; color: var(--ink); font-weight: 600; font-size: 0.9375rem; }
.roles span { font-size: var(--fs-sm); color: var(--muted); }
#team .sec-head { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: var(--s3) clamp(2rem, 5vw, 4.5rem); }
#contact .split { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
#contact .lede { margin-top: var(--s3); }

/* ---------- Footer ---------- */
.site-foot { border-top: 1px solid var(--line-soft); padding-block: var(--s8) var(--s6); font-size: var(--fs-sm); color: var(--muted); }
.foot-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); gap: var(--s6); padding-bottom: var(--s7); }
.foot-brand p { margin-top: var(--s3); max-width: 30ch; }
.foot-grid nav { display: flex; flex-direction: column; gap: 10px; }
.foot-grid h4 { margin: 0 0 2px; font-size: var(--fs-sm); font-weight: 600; color: var(--ink); }
.foot-grid nav a { color: var(--muted); text-decoration: none; transition: color 0.15s var(--ease); }
.foot-grid nav a:hover { color: var(--ink); }
.foot-legal { display: flex; justify-content: space-between; align-items: center; gap: var(--s3) var(--s4); flex-wrap: wrap; padding-top: var(--s5); border-top: 1px solid var(--line-soft); font-size: var(--fs-xs); color: var(--faint); }
.foot-legal nav { display: flex; gap: var(--s5); flex-wrap: wrap; }
.foot-legal a { color: var(--faint); text-decoration: none; transition: color 0.15s var(--ease); }
.foot-legal a:hover { color: var(--ink); }
.foot-note { margin-top: var(--s3); font-size: var(--fs-cap); color: var(--faint); }
.foot-note a { color: var(--muted); text-underline-offset: 2px; }

/* ---------- Document pages (methodology, legal, status) ---------- */
.doc-hero { padding-block: clamp(3rem, 2rem + 4vw, 4.5rem) var(--s7); border-bottom: 1px solid var(--line-soft); }
.doc-hero h1 { margin-bottom: var(--s4); }
.doc { display: grid; grid-template-columns: 13rem minmax(0, 1fr); gap: clamp(2rem, 5vw, 4.5rem); padding-block: var(--s8); }
.toc { position: sticky; top: calc(var(--head-h) + 24px); align-self: start; display: flex; flex-direction: column; }
.toc a { padding: 6px 0 6px 12px; border-left: 1px solid var(--line-soft); color: var(--muted); font-size: var(--fs-sm); text-decoration: none; transition: color 0.15s var(--ease), border-color 0.15s var(--ease); }
.toc a:hover { color: var(--ink); border-left-color: var(--muted); }
.doc article > section { padding-block: 0 var(--s8); border: 0; }
.doc h2 { margin-bottom: var(--s4); scroll-margin-top: calc(var(--head-h) + 24px); }
.doc p { max-width: 68ch; margin-bottom: var(--s4); }
.spec { display: grid; grid-template-columns: 10rem minmax(0, 1fr); max-width: 52rem; margin: var(--s5) 0; border-top: 1px solid var(--line-soft); }
.spec dt, .spec dd { margin: 0; padding: 11px 0; border-bottom: 1px solid var(--line-soft); }
.spec dt { padding-right: var(--s4); font-size: var(--fs-sm); font-weight: 500; color: var(--muted); }
.spec dd { color: var(--ink-2); }
.doc .panel { max-width: 52rem; margin: var(--s5) 0; }
.note { font-size: var(--fs-sm); color: var(--muted); }

/* Metric library */
.lib-tools { display: flex; gap: var(--s3); align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: var(--s4); }
.filter { display: flex; gap: 6px; flex-wrap: wrap; }
.filter button {
  min-height: 32px; padding: 0 0.75rem;
  font: 500 var(--fs-xs)/1 var(--font); color: var(--muted);
  background: transparent; border: 1px solid var(--line-soft); border-radius: var(--r); cursor: pointer;
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease), background-color 0.15s var(--ease);
}
.filter button:hover { color: var(--ink); border-color: var(--line); }
.filter button[aria-pressed="true"] { color: var(--ink); background: var(--surface-2); border-color: var(--line); }
.count { font-size: var(--fs-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line-soft); border-radius: var(--r); }
table { width: 100%; min-width: 680px; border-collapse: collapse; font-size: var(--fs-sm); }
th, td { padding: 10px 16px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: top; }
th { position: sticky; top: 0; background: var(--surface); font-size: var(--fs-cap); font-weight: 500; color: var(--muted); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: oklch(1 0 0 / 0.02); }
td.m { color: var(--ink); font-weight: 500; }
td.m .mono { display: block; margin-top: 2px; font-family: var(--font-mono); font-size: 0.71875rem; font-weight: 400; color: var(--faint); }
td .cat { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; font-size: var(--fs-xs); color: var(--ink-2); }
td .cat::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--cat, var(--muted)); }
.cat[data-c="market"] { --cat: var(--signal); }
.cat[data-c="liquidity"] { --cat: var(--cool); }
.cat[data-c="derivatives"] { --cat: var(--violet); }
.cat[data-c="stablecoin"] { --cat: var(--amber); }
.cat[data-c="counterparty"] { --cat: var(--ink-2); }
.cat[data-c="flows"] { --cat: var(--muted); }
tr[hidden] { display: none; }

/* ---------- Collaboration dialog ---------- */
.modal { width: min(560px, calc(100% - 2rem)); max-height: calc(100dvh - 2rem); overflow: auto; padding: 0; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: var(--ink-2); box-shadow: 0 24px 64px -24px oklch(0 0 0 / 0.9); }
.modal::backdrop { background: oklch(0.06 0.004 110 / 0.72); }
.modal form, .collab-done { padding: var(--s6); }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s4); }
.modal h2 { font-size: 1.375rem; }
.modal-x { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: var(--r); background: none; color: var(--muted); font: 400 1.5rem/1 var(--font); cursor: pointer; transition: color 0.15s var(--ease), background-color 0.15s var(--ease); }
.modal-x:hover { color: var(--ink); background: var(--surface-2); }
.modal-sub { margin: var(--s2) 0 var(--s5); font-size: var(--fs-sm); color: var(--muted); }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
.fields label { display: grid; gap: 6px; font-size: var(--fs-xs); font-weight: 500; color: var(--ink-2); }
.fields .full { grid-column: 1 / -1; }
.fields input, .fields select, .fields textarea {
  width: 100%; min-height: 44px; padding: 10px 12px;
  font: 400 var(--fs-md)/1.4 var(--font); color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--r);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.fields select {
  appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23a3a39e' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.fields textarea { min-height: 120px; resize: vertical; }
.fields ::placeholder { color: var(--muted); }
.fields input:hover, .fields select:hover, .fields textarea:hover { border-color: oklch(0.34 0.006 110); }
.fields input:focus, .fields select:focus, .fields textarea:focus { outline: none; border-color: var(--signal); box-shadow: 0 0 0 3px color-mix(in oklch, var(--signal) 20%, transparent); }
.fields .hp { position: absolute; left: -9999px; }
.form-msg { min-height: 1.4em; margin: var(--s4) 0 0; font-size: var(--fs-sm); color: var(--muted); }
.form-msg.err { color: var(--breach); }
.modal-actions { display: flex; justify-content: flex-end; gap: var(--s3); margin-top: var(--s4); }

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  /* minmax(0, 1fr): wide tables inside must scroll in their wrapper, not stretch the column. */
  .team, .risk-split, .split, #team .sec-head { grid-template-columns: minmax(0, 1fr); }
  .doc { grid-template-columns: minmax(0, 1fr); }
  .toc { position: static; flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .toc a { padding: 6px 10px; border: 1px solid var(--line-soft); border-radius: var(--r); }
}
@media (max-width: 720px) {
  .nav { display: none; position: absolute; top: var(--head-h); left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; padding: 4px 1.25rem var(--s4); background: var(--bg); border-bottom: 1px solid var(--line); }
  .nav.open { display: flex; }
  .nav a:not(.btn) { height: auto; padding: 12px 0; border-bottom: 1px solid var(--line-soft); font-size: var(--fs-md); }
  .nav a[aria-current="page"] { box-shadow: none; }
  .nav .btn { margin-top: var(--s3); min-height: 44px; }
  .menu-toggle { display: inline-flex; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .t-v { font-size: 1.25rem; }
  .readout { grid-template-columns: 1fr; }
  .readout div + div { border-left: 0; border-top: 1px solid var(--line-soft); }
  .spec { grid-template-columns: 1fr; }
  .spec dt { padding-bottom: 0; border-bottom: 0; }
  .archive a { grid-template-columns: 1fr auto; }
  .archive a span:nth-child(2) { display: none; }
  .explore a { grid-template-columns: 1fr auto; gap: var(--s2) var(--s4); }
  .explore span { grid-column: 1 / -1; grid-row: 2; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-brand { grid-column: 1 / -1; }
  #contact .split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .fields { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .hbar { grid-template-columns: 5rem minmax(0, 1fr); }
  .hb-v { grid-column: 1 / -1; margin-top: -4px; text-align: left; }
}
@media (pointer: coarse) {
  .btn { min-height: 44px; }
  .chips button { min-height: 36px; }
  .csv-btn, .filter button { min-height: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .ln.draw { stroke-dashoffset: 0; }
  .ticker { overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
  .ticker-track { animation: none !important; }
  .tk-run[aria-hidden] { display: none; }
}
