/* TensorChain dashboard: the site's tokens (light by default, dark by system or data-theme), the console's geometry. */
:root {
  color-scheme: light dark;
  --space-3xs: 2px; --space-2xs: 4px; --space-xs: 8px; --space-sm: 12px; --space-md: 16px; --space-lg: 24px; --space-xl: 40px; --space-2xl: 64px; --space-3xl: 96px; --space-4xl: 144px;
  --text-xs: 0.8125rem; --text-sm: 0.875rem; --text-md: 1rem; --text-lg: 1.25rem; --text-xl: 1.5625rem; --text-2xl: 1.953rem; --text-3xl: 2.441rem;
  --text-display-s: clamp(2.25rem, 4vw + 0.5rem, 3.75rem); --text-display: clamp(2.75rem, 5vw + 1rem, 5.25rem);
  --text-section: clamp(2rem, 2.5vw + 1rem, 3.5rem); --text-title: clamp(1.25rem, 0.75vw + 0.875rem, 1.625rem); --text-lead: clamp(1.125rem, 0.35vw + 1rem, 1.375rem);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1); --ease-in: cubic-bezier(0.7, 0, 0.84, 0); --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-micro: 120ms; --dur-short: 220ms; --dur-long: 420ms;
  --container: 1440px; --gutter: 64px; --gap-columns: 32px; --section-gap-s: 120px; --section-gap: 144px; --section-gap-l: 176px;
  --z-base: 1; --z-raised: 10; --z-dropdown: 100; --z-sticky: 200; --z-sticky-nav: 300; --z-modal: 400; --z-toast: 500; --z-tooltip: 600;
  --font-display: "Host Grotesk", ui-sans-serif, system-ui, sans-serif; --font-body: var(--font-display);
  --font-outlier: "Atkinson Hyperlegible Mono", ui-monospace, monospace;
  --radius-card: 9px; --radius-pill: 5px; --rule-hair: 1px;
  --tracking-display: -0.03em; --display-weight: 500;

  /* Light, the default: the swarm-console palette. Amber marks, charcoal acts. */
  --color-paper: #f6f7f4; --color-paper-2: #ffffff; --color-paper-3: #f8f9f6;
  --color-ink: #232620; --color-ink-2: #4d5448; --color-muted: #686e65;
  --color-rule: #dce0d6; --color-rule-2: #cbd1c3;
  --color-accent: #8f600f; --color-accent-fill: #f2b442; --color-accent-ink: #232620; --color-accent-soft: #fbf3df; --color-focus: #b57d22;
  --color-action: #262922; --color-action-hover: #41463a; --color-action-ink: #ffffff;
  --color-cool: #3c6390; --color-cool-soft: #eaf0f6;
  --color-ok: #487653; --color-ok-soft: #edf5ec; --color-bad: #a3392c; --color-bad-soft: #fbecea;
  --color-error: #a3392c; --color-success: #487653;
  --shadow-card: 0 1px 2px rgb(35 38 32 / 0.05);
}

/* Dark: the site as it was before 2026-11-25, when the system asks for it (unless the visitor picked light). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-paper: oklch(17% 0.008 250); --color-paper-2: oklch(21% 0.009 250); --color-paper-3: oklch(13.5% 0.007 250);
    --color-ink: oklch(95% 0.005 250); --color-ink-2: oklch(83% 0.008 250); --color-muted: oklch(71% 0.01 250);
    --color-rule: oklch(31% 0.01 250); --color-rule-2: oklch(42% 0.012 250);
    --color-accent: oklch(82% 0.15 80); --color-accent-fill: oklch(82% 0.15 80); --color-accent-ink: oklch(18% 0.04 75); --color-accent-soft: oklch(29% 0.05 80); --color-focus: oklch(82% 0.15 80);
    --color-action: oklch(82% 0.15 80); --color-action-hover: oklch(86% 0.13 80); --color-action-ink: oklch(18% 0.04 75);
    --color-cool: oklch(77% 0.12 245); --color-cool-soft: oklch(29% 0.05 245);
    --color-ok: oklch(76% 0.15 150); --color-ok-soft: oklch(24.5% 0.03 150); --color-bad: oklch(70% 0.17 25); --color-bad-soft: oklch(24.5% 0.035 25);
    --color-error: oklch(72% 0.15 27); --color-success: oklch(76% 0.13 150);
    --shadow-card: none;
  }
}
:root[data-theme="dark"] {
  --color-paper: oklch(17% 0.008 250); --color-paper-2: oklch(21% 0.009 250); --color-paper-3: oklch(13.5% 0.007 250);
  --color-ink: oklch(95% 0.005 250); --color-ink-2: oklch(83% 0.008 250); --color-muted: oklch(71% 0.01 250);
  --color-rule: oklch(31% 0.01 250); --color-rule-2: oklch(42% 0.012 250);
  --color-accent: oklch(82% 0.15 80); --color-accent-fill: oklch(82% 0.15 80); --color-accent-ink: oklch(18% 0.04 75); --color-accent-soft: oklch(29% 0.05 80); --color-focus: oklch(82% 0.15 80);
  --color-action: oklch(82% 0.15 80); --color-action-hover: oklch(86% 0.13 80); --color-action-ink: oklch(18% 0.04 75);
  --color-cool: oklch(77% 0.12 245); --color-cool-soft: oklch(29% 0.05 245);
  --color-ok: oklch(76% 0.15 150); --color-ok-soft: oklch(24.5% 0.03 150); --color-bad: oklch(70% 0.17 25); --color-bad-soft: oklch(24.5% 0.035 25);
  --color-error: oklch(72% 0.15 27); --color-success: oklch(76% 0.13 150);
  --shadow-card: none;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { scrollbar-color: var(--color-muted) var(--color-paper); scroll-padding-top: var(--space-3xl); }
body { margin: 0; background: var(--color-paper); color: var(--color-ink); font-family: var(--font-body); font-size: var(--text-md); line-height: 1.55; -webkit-font-smoothing: antialiased; caret-color: var(--color-accent); }
::selection { background: color-mix(in oklab, var(--color-accent) 25%, transparent); }
:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.16em; }
h1, h2, h3 { margin: 0; font-family: var(--font-display); font-weight: var(--display-weight, 700); font-synthesis: none; letter-spacing: var(--tracking-display); line-height: 1.05; overflow-wrap: break-word; min-width: 0; text-wrap: balance; }
h1 { max-width: 20ch; font-size: var(--text-display); } h2 { max-width: 30ch; font-size: var(--text-section); } h3 { max-width: 40ch; font-size: var(--text-title); line-height: 1.2; }
.lead { font-size: var(--text-lead); line-height: 1.45; max-width: 52ch; }
p { margin: 0; text-wrap: pretty; }
p:not([class]) { max-width: 65ch; }
img, video { max-width: 100%; height: auto; display: block; }
svg { display: block; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); box-sizing: border-box; }
.num, .figure, td.num { font-variant-numeric: tabular-nums; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
[data-slot] { position: relative; overflow: hidden; background: linear-gradient(160deg, var(--color-paper-2, var(--color-paper)), var(--color-paper-3, var(--color-paper))); }
[data-slot] > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
[data-slot]:has(> img) > :not(img):not([data-keep]) { display: none !important; }
@media (max-width: 60rem) { :root { --gutter: 24px; --section-gap-s: 80px; --section-gap: 96px; --section-gap-l: 120px; } }
@media (max-width: 40rem) { :root { --gutter: 16px; --section-gap-s: 56px; --section-gap: 72px; --section-gap-l: 96px; --gap-columns: 16px; } }
@media (prefers-reduced-motion: reduce) { *:not(.keep-motion), *:not(.keep-motion)::before, *:not(.keep-motion)::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; } }
/* photographs: duotone paper-3 ink */
[data-slot]:has(> img) { isolation: isolate; background: var(--color-ink); outline: 1px solid color-mix(in oklab, var(--color-ink) 8%, transparent); outline-offset: -1px; }
[data-slot] > img { z-index: 0; filter: grayscale(1) contrast(1.08); mix-blend-mode: multiply; }
[data-slot]:has(> img)::before { content: ""; position: absolute; inset: 0; z-index: 1; background: var(--color-paper-3); mix-blend-mode: lighten; pointer-events: none; }

@font-face { font-family: "Host Grotesk"; src: url("fonts/HostGrotesk-400.woff2") format("woff2"); font-weight: 400 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible Mono"; src: url("fonts/AtkinsonHyperlegibleMono-400.woff2") format("woff2"); font-weight: 400 500; font-style: normal; font-display: swap; }


body { font-size: 15px; }
.top { position: sticky; top: 0; z-index: var(--z-sticky-nav); background: var(--color-paper-2); border-bottom: var(--rule-hair) solid var(--color-rule); }
.top__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-lg); max-width: 1480px; margin-inline: auto; padding: var(--space-sm) var(--space-xl); }
.brand { display: inline-flex; align-items: center; gap: var(--space-xs); font-family: var(--font-display); font-size: var(--text-xl); font-weight: 500; letter-spacing: var(--tracking-display); color: var(--color-ink); text-decoration: none; }
.brand img { width: 28px; height: 28px; }
.brand span { color: var(--color-muted); font-size: var(--text-md); letter-spacing: 0; margin-left: var(--space-xs); }
.top__meta { font-size: var(--text-sm); color: var(--color-muted); }

.layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: var(--space-xl); max-width: 1480px; margin-inline: auto; padding: var(--space-xl); }
.rail { position: sticky; top: 88px; align-self: start; display: grid; gap: var(--space-2xs); }
.rail a { padding: var(--space-xs) var(--space-sm); border-radius: var(--radius-pill); color: var(--color-ink-2); text-decoration: none; font-size: var(--text-sm); }
.rail a:hover { background: var(--color-paper-3); color: var(--color-ink); }
.rail a:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
main { display: grid; gap: var(--space-2xl); min-width: 0; }

h1 { font-size: var(--text-3xl); max-width: none; }
h2 { font-size: var(--text-2xl); max-width: none; }
h3 { font-size: var(--text-lg); max-width: none; }
.sub { color: var(--color-muted); max-width: 80ch; }
.section { display: grid; gap: var(--space-lg); scroll-margin-top: 88px; }
.section__head { display: grid; gap: var(--space-xs); }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-md); }
.metric, .panel { border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-card); background: var(--color-paper-2); box-shadow: var(--shadow-card); }
.metric { display: grid; gap: var(--space-xs); padding: var(--space-lg); }
.metric__label { font-size: var(--text-sm); color: var(--color-muted); }
.metric__value { font-family: var(--font-display); font-size: var(--text-2xl); letter-spacing: var(--tracking-display); line-height: 1.1; font-variant-numeric: tabular-nums; }
.metric__note { font-size: var(--text-xs); color: var(--color-muted); }
.panel { display: grid; gap: var(--space-md); padding: var(--space-lg); min-width: 0; }
.panel__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-sm); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-md); }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px var(--space-xs); border-radius: var(--radius-pill); font-size: var(--text-xs); font-weight: 500; background: var(--color-paper-3); color: var(--color-ink-2); white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill--ok { background: var(--color-ok-soft); color: var(--color-ok); }
.pill--bad { background: var(--color-bad-soft); color: var(--color-bad); }
.pill--warn { background: var(--color-accent-soft); color: var(--color-accent); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
th, td { text-align: left; padding: var(--space-sm) var(--space-md); border-bottom: var(--rule-hair) solid var(--color-rule); vertical-align: middle; }
thead th { font-size: var(--text-xs); font-weight: 500; color: var(--color-muted); background: var(--color-paper-3); }
tbody tr:hover { background: var(--color-paper-3); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-outlier); font-size: var(--text-xs); }
.muted { color: var(--color-muted); }

/* the heat table: % change in held-out loss, own field outlined */
.heat td.cell { position: relative; text-align: right; font-variant-numeric: tabular-nums; min-width: 7.5rem; }
.heat .bar { position: absolute; right: var(--space-md); bottom: 6px; height: 3px; border-radius: 2px; background: var(--color-ok); opacity: 0.7; }
.heat .bar--worse { background: var(--color-bad); }
.heat td.own { box-shadow: inset 0 0 0 2px var(--color-accent-fill); font-weight: 600; }

/* charts */
.chart { width: 100%; height: auto; overflow: visible; }
.chart text { font-family: var(--font-body); font-size: 11px; fill: var(--color-muted); }
.chart .axis { stroke: var(--color-rule-2); stroke-width: 1; }
.chart .grid { stroke: var(--color-rule); stroke-width: 1; }
.chart .seg { stroke-width: 3; stroke-linecap: round; }
.chart .seg--accept { stroke: var(--color-ok); }
.chart .seg--reject { stroke: var(--color-bad); }
.chart .dot--accept { fill: var(--color-ok); }
.chart .dot--reject { fill: var(--color-bad); }
.chart .dot--start { fill: var(--color-paper-2); stroke-width: 2; }
.chart .dot--start.dot--accept { stroke: var(--color-ok); }
.chart .dot--start.dot--reject { stroke: var(--color-bad); }
.chart .held { stroke: var(--color-accent-fill); stroke-width: 2; stroke-dasharray: 5 4; }
.chart .held-label { fill: var(--color-accent); }
.chart .bar-base { fill: var(--color-rule-2); }
.chart .bar-expert { fill: var(--color-action); }
.chart .val { fill: var(--color-ink-2); font-variant-numeric: tabular-nums; }
.legend { display: flex; flex-wrap: wrap; gap: var(--space-md); font-size: var(--text-xs); color: var(--color-muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.key { width: 14px; height: 3px; border-radius: 2px; background: currentColor; }
.key--ok { color: var(--color-ok); } .key--bad { color: var(--color-bad); } .key--held { color: var(--color-accent-fill); }
.key--base { color: var(--color-rule-2); height: 10px; } .key--expert { color: var(--color-action); height: 10px; }

.progress { height: 10px; border-radius: 5px; background: var(--color-paper-3); border: var(--rule-hair) solid var(--color-rule); overflow: hidden; }
.progress > div { height: 100%; background: var(--color-accent-fill); }
.reasons { margin: 0; padding-left: var(--space-lg); display: grid; gap: var(--space-2xs); font-size: var(--text-sm); color: var(--color-ink-2); }
.sources { margin: 0; padding-left: var(--space-lg); font-size: var(--text-xs); color: var(--color-muted); }
.empty { color: var(--color-muted); font-size: var(--text-sm); }

@media (max-width: 60rem) {
  .layout { grid-template-columns: minmax(0, 1fr); padding: var(--space-md); }
  .rail { position: static; display: flex; flex-wrap: wrap; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .top__inner { padding: var(--space-sm) var(--space-md); }
}
@media (max-width: 40rem) {
  .brand span { display: none; }
  .top__meta { font-size: var(--text-xs); text-align: right; max-width: 9rem; }
  .metric__value { font-size: var(--text-xl); overflow-wrap: anywhere; }
}
