:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --accent: #4f46e5;
  --track: #eef0f4;
  --max: #111827;
  --t4: #4f46e5;
  --t3: #2563eb;
  --t2: #0891b2;
  --t1: #0d9488;
  --t0: #9ca3af;
  --cloud: #d1d5db;
  --amber: #d97706;
  --radius: 12px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0d12;
    --surface: #12151c;
    --text: #e5e7eb;
    --muted: #9ca3af;
    --line: #232733;
    --line-strong: #323849;
    --accent: #a5b4fc;
    --track: #1c202a;
    --max: #f3f4f6;
    --t4: #818cf8;
    --t3: #60a5fa;
    --t2: #22d3ee;
    --t1: #2dd4bf;
    --t0: #6b7280;
    --cloud: #3a4050;
    --amber: #fbbf24;
    color-scheme: dark;
  }
}
/* Chosen with the theme switch (theme.js); same values as above. */
:root[data-theme="dark"] {
  --bg: #0b0d12;
  --surface: #12151c;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --line: #232733;
  --line-strong: #323849;
  --accent: #a5b4fc;
  --track: #1c202a;
  --max: #f3f4f6;
  --t4: #818cf8;
  --t3: #60a5fa;
  --t2: #22d3ee;
  --t1: #2dd4bf;
  --t0: #6b7280;
  --cloud: #3a4050;
  --amber: #fbbf24;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "tnum" 1, "cv11" 1;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }

.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text); letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 18px; height: 18px; border-radius: 5px; background: linear-gradient(135deg, var(--t4), var(--t1)); }
.nav { display: flex; gap: 18px; font-size: 14px; }
.nav a { color: var(--muted); }
.nav a:hover { color: var(--text); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--text); font-weight: 600; }
.nav { margin-left: auto; }
.theme-toggle {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0; margin-left: -4px;
  color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 8px; cursor: pointer;
}
.theme-toggle:hover { color: var(--text); border-color: var(--line-strong); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.hero { padding: 40px 0 24px; }
.eyebrow { margin: 0 0 8px; color: var(--muted); font-size: 13px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; }
h1 { margin: 0 0 12px; font-size: clamp(26px, 4.4vw, 38px); line-height: 1.15; letter-spacing: -0.02em; font-weight: 700; }
.lede { margin: 0; max-width: 720px; color: var(--muted); font-size: 16px; }
.lede strong { color: var(--text); font-weight: 600; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin: 0 0 20px;
}
.card-head { margin-bottom: 14px; }
h2 { margin: 0 0 4px; font-size: 18px; letter-spacing: -0.01em; font-weight: 600; }
.muted { color: var(--muted); }
.card-head .muted { margin: 0; font-size: 13.5px; }
.note { margin: 14px 0 0; font-size: 13.5px; color: var(--muted); }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -20px; padding: 0 20px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
thead th { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
tbody th { font-weight: 500; }
.num { text-align: right; }
th.num { text-align: right; }

.tier-table td, .tier-table th { padding: 14px 10px; }
.tier-cell { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.tier-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 58px; padding: 3px 9px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; color: #fff; white-space: nowrap;
}
.tier-max { background: var(--max); color: var(--surface); }
.tier-t4 { background: var(--t4); }
.tier-t3 { background: var(--t3); }
.tier-t2 { background: var(--t2); }
.tier-t1 { background: var(--t1); }
.tier-t0 { background: var(--t0); }
.tier-bg-max { background: var(--max); }
.tier-bg-t4 { background: var(--t4); }
.tier-bg-t3 { background: var(--t3); }
.tier-bg-t2 { background: var(--t2); }
.tier-bg-t1 { background: var(--t1); }
.tier-bg-t0 { background: var(--t0); }
.bar-cloud { background: var(--cloud); }

.score { font-weight: 600; font-size: 15px; }

.model { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.model-link { font-weight: 600; color: var(--text); }
.model-link:hover { color: var(--accent); }
.setting { font-size: 12px; color: var(--muted); }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.pill-muted { background: var(--track); color: var(--muted); }
.pill-cloud { background: transparent; border: 1px solid var(--line-strong); color: var(--muted); font-size: 11px; padding: 1px 7px; }

/* Bar chart */
.bars { margin-top: 6px; }
.plot { --label-w: 290px; --gap: 12px; position: relative; padding-top: 22px; }
.edges { position: absolute; top: 0; bottom: 0; left: calc(var(--label-w) + var(--gap)); right: 0; pointer-events: none; }
.bar-row { display: grid; grid-template-columns: var(--label-w) 1fr; align-items: center; gap: var(--gap); height: 26px; position: relative; z-index: 1; }
.bar-row.is-ref .bar-label a { font-weight: 700; }
.bar-label { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-label a { color: var(--text); }
.bar-label .setting { margin-left: 5px; }
.bar-tag { min-width: 52px; margin-right: 8px; padding: 1px 0; font-size: 11px; text-align: center; box-sizing: border-box; display: inline-block; }
.bar-track { position: relative; height: 14px; }
.bar { display: block; height: 100%; border-radius: 3px; }
.bar-value { position: absolute; top: -2px; margin-left: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.plot .edge {
  position: absolute; top: 0; bottom: 0; width: 0;
  border-left: 1px dashed var(--line-strong);
}
.edge-label { position: absolute; top: 0; left: 4px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.edge-ref { border-left: 1px solid var(--text); opacity: 0.55; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 16px; font-size: 12.5px; color: var(--muted); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.prose p { margin: 10px 0; max-width: 760px; }

.data-table { font-size: 13.5px; }
.data-table td, .data-table th { padding: 9px 10px; white-space: nowrap; }
.data-table .tier-badge { min-width: 0; font-size: 11.5px; padding: 2px 8px; }

.site-footer { padding: 24px 0 40px; color: var(--muted); font-size: 13px; }

@media (max-width: 640px) {
  .nav { gap: 12px; font-size: 13px; }
  .header-inner { gap: 10px; }
  .theme-toggle { width: 30px; height: 30px; margin-left: -2px; }
  .card { padding: 16px; }
  .table-scroll { margin: 0 -16px; padding: 0 16px; }
  .tier-table th, .tier-table td { padding: 12px 6px; }
  .tier-table thead th { white-space: normal; }
  .plot { --label-w: 160px; --gap: 8px; }
  .bar-label .setting { display: none; }
}
@media (max-width: 400px) {
  .header-inner { gap: 6px; }
  .nav { gap: 7px; font-size: 12px; }
  .brand { gap: 5px; font-size: 13.5px; }
  .theme-toggle { width: 28px; height: 28px; }
}
/* Narrow phones: the six menu links get their own row under the logo */
@media (max-width: 440px) {
  .header-inner { flex-wrap: wrap; height: auto; padding-top: 8px; padding-bottom: 6px; row-gap: 4px; }
  .nav { order: 3; flex: 1 0 100%; justify-content: space-between; margin-left: 0; font-size: 13px; gap: 4px; }
  .theme-toggle { margin-left: auto; }
}
@media (max-width: 400px) { .nav { font-size: 12px; } }
.th-sub { display: block; font-weight: 500; text-transform: none; letter-spacing: 0; }
.sub-pill { margin-left: 6px; font-weight: 500; }
.bars { overflow: hidden; }
@media (max-width: 640px) {
  .edge-label { display: none; }
  .edge-ref .edge-label { display: block; left: auto; right: 4px; }
  .sub-pill { margin: 2px 0 0; }
}
.bar-track { margin-right: 40px; }
.edges { right: 40px; }
@media (max-width: 640px) {
  .tier-table { font-size: 14px; }
  .tier-table .tier-badge { min-width: 0; padding: 3px 8px; font-size: 12px; }
  .tier-table thead th { font-size: 11px; }
  .tier-table td:last-child { overflow-wrap: anywhere; }
}
.tier-table .params { white-space: nowrap; font-size: 14px; }
@media (max-width: 640px) { .tier-table .params { white-space: normal; font-size: 13px; } }
.params-inline { display: none; }
@media (max-width: 640px) {
  .tier-table .params { display: none; }
  .params-inline { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
}

.explain:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.tier-table thead th.params { font-size: 12px; }

/* Local / Cloud tabs */
.tabs { display: flex; gap: 4px; margin: 0 0 16px; border-bottom: 1px solid var(--line); }
.tab { font: inherit; font-weight: 600; color: var(--muted); background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 16px; margin-bottom: -1px; cursor: pointer; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
section[hidden] { display: none; }
.top-gap { height: 20px; }

/* Size on disk column: 4-bit build first, full-precision release under it */
.disk { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 1px; white-space: nowrap; }
.disk-main { font-weight: 600; color: var(--text); text-decoration: none; font-variant-numeric: tabular-nums; }
.disk-main:hover { text-decoration: underline; }
.disk-main.est { font-weight: 500; font-style: italic; color: var(--muted); }
.disk .sub { font-size: 12px; color: var(--muted); }
.disk .disk-native.est { font-style: italic; }
.tier-table thead th.disk-col { font-size: 12px; }
@media (max-width: 640px) {
  .tier-table .disk-col { font-size: 13px; }
  .disk { white-space: normal; }
}
.disk-inline { display: none; }
@media (max-width: 640px) {
  .tier-table .disk-col { display: none; }
  .disk-inline { display: block; font-size: 12px; color: var(--muted); }
}

/* Tier summary chart: bars use the tier colours (.tier-bg-*) */
.tier-bars { display: grid; gap: 10px; margin: 4px 0 22px; }
.tb-row { display: grid; grid-template-columns: 330px 1fr 44px 52px; align-items: center; gap: 12px; }
.tb-label { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13.5px; white-space: nowrap; }
.tb-label .tier-badge { min-width: 52px; padding: 2px 8px; font-size: 12px; }
.tb-model { color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.tb-model:hover { color: var(--accent); }
.tb-explain { font-size: 12.5px; font-weight: 500; text-align: right; }
.tb-track { height: 16px; border-radius: 4px; background: var(--track); overflow: hidden; }
.tb-bar { display: block; height: 100%; border-radius: 4px; }
.tb-value { font-size: 13px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .tb-row { grid-template-columns: 1fr 40px 48px; gap: 4px 8px; }
  .tb-label { grid-column: 1 / -1; font-size: 13px; }
}

/* Intelligence Index column: short header on phones */
.th-short { display: none; }
@media (max-width: 640px) {
  .tier-table .th-long { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .tier-table .th-short { display: inline; }
}

/* Two-level menu: sections in the header row, pages of the section in a row of tabs below */
.nav { gap: 22px; font-size: 15px; font-weight: 500; }
.nav a[aria-current="page"] { box-shadow: 0 2px 0 var(--accent); padding-bottom: 2px; }
.nav .nav-minor { font-size: 13px; font-weight: 400; margin-left: 6px; }
.subnav { border-top: 1px solid var(--line); }
.subnav-inner { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; font-size: 14px; }
.subnav-inner::-webkit-scrollbar { display: none; }
.subnav-inner a { flex: none; color: var(--muted); font-weight: 600; padding: 9px 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.subnav-inner a:hover { color: var(--text); text-decoration: none; }
.subnav-inner a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }
.subnav-inner a:first-child { margin-left: -14px; }
.tabs-in-menu { display: none; }
@media (max-width: 640px) { .nav { gap: 16px; font-size: 14px; } .nav .nav-minor { margin-left: 0; } }
@media (max-width: 440px) {
  .nav { justify-content: flex-start; gap: 18px; font-size: 14px; }
  .nav .nav-minor { margin-left: auto; }
  .subnav-inner a { padding: 8px 12px; font-size: 13.5px; }
  .subnav-inner a:first-child { margin-left: -12px; }
}

/* Visually hidden text (kept for search engines and screen readers) */
.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; }
