/* base.css — shared styles for every 3z-Intelligence page. No frameworks.

   Wave 3 (W3A): fluid rhythm, link affordance in running text, complete
   hover / focus-visible / active states, 44px tap targets, reduced-motion +
   forced-colors + print respect, and the index proof components.
   Contract: every Wave-1 selector still exists (other pages depend on it). */

/* ---- reset-ish ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 6rem; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-100);
  line-height: var(--lh-body);
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4 {
  color: var(--text-strong); line-height: var(--lh-tight); margin: 0 0 var(--sp-3);
  letter-spacing: var(--track-tight); text-wrap: balance;
}
h1 { font-size: var(--fs-225); }
h2 { font-size: var(--fs-1875); }
h3 { font-size: var(--fs-125); letter-spacing: -0.01em; line-height: var(--lh-snug); }
h4 { font-size: var(--fs-100); letter-spacing: 0; }
p, ul, ol, dl { margin: 0 0 var(--sp-4); }
p, li, dd, figcaption { text-wrap: pretty; }
b, strong { color: var(--text-strong); }
img, svg { max-width: 100%; height: auto; }
::selection { background: rgb(240 96 42 / 0.32); color: var(--text-strong); }

/* ---- links ---- */
a {
  color: var(--accent-text); text-decoration-line: none;
  text-decoration-thickness: 1px; text-underline-offset: 0.22em;
  transition: color var(--dur-1) var(--ease-1), text-decoration-color var(--dur-1) var(--ease-1);
}
a:hover { text-decoration-line: underline; }
/* Links inside running text carry an underline, not just a hue: ember-300
   against body ink is only 1.36:1, so color alone fails WCAG 1.4.1
   (axe: link-in-text-block). Classed links — buttons, nav, cards — opt out
   simply by having a class. */
main :is(p, li, dd, td, figcaption, caption, .hint, .notice) a:not([class]) {
  text-decoration-line: underline;
  text-decoration-color: color-mix(in srgb, currentColor 55%, transparent);
}
main :is(p, li, dd, td, figcaption, caption, .hint, .notice) a:not([class]):hover {
  text-decoration-color: currentColor; text-decoration-thickness: 2px;
}

/* ---- code ---- */
code, pre, kbd, samp { font-family: var(--font-mono); font-size: var(--fs-875); }
pre code { font-size: inherit; }   /* a block's size is set once, on the pre */
:not(pre) > code {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px;
  padding: 0.06em 0.36em; font-size: 0.875em; color: var(--text-strong);
}
pre {
  background: var(--surface-inset);
  border: var(--border-1);
  border-radius: var(--radius-m);
  padding: var(--sp-4);
  overflow-x: auto;            /* code blocks may scroll; page body must not */
  margin: 0 0 var(--sp-4);
  line-height: 1.6;
  tab-size: 2;
}
kbd { background: var(--slate-800); border: var(--border-1); border-bottom-width: 2px; border-radius: 4px; padding: 0.1em 0.4em; }

/* ---- tables ---- */
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
caption { caption-side: top; text-align: left; color: var(--text-faint); font-size: var(--fs-875); padding-bottom: var(--sp-3); }
th, td { text-align: left; padding: var(--sp-3); border-bottom: 1px solid var(--slate-800); vertical-align: top; }
th { color: var(--text-strong); font-size: var(--fs-875); font-weight: 600; }
thead th {
  color: var(--text-muted); font-size: var(--fs-75); text-transform: uppercase;
  letter-spacing: 0.08em; border-bottom-color: var(--line); vertical-align: bottom;
}
tbody tr { transition: background-color var(--dur-1) var(--ease-1); }
tbody tr:hover { background: rgb(255 255 255 / 0.025); }
.num, thead th.num { text-align: right; white-space: nowrap; }

/* ---- focus (one ring, everywhere) ---- */
:focus-visible { outline: var(--ring); outline-offset: var(--ring-offset); }

/* ---- layout ---- */
.wrap { max-width: var(--content-max); margin-inline: auto; padding-inline: var(--sp-4); }
.prose { max-width: var(--prose-max); }
.readable :is(p, li, dd) { max-width: var(--measure); }
.section { padding-block: var(--section-y); }
.section > h2 { margin-bottom: var(--sp-6); }
.section-head { max-width: 46rem; margin-bottom: var(--sp-6); }
.section-head h2 { margin-bottom: var(--sp-3); }
.section-head > :last-child { margin-bottom: 0; }
.eyebrow {
  display: flex; align-items: center; gap: var(--sp-2);
  color: var(--accent-metric); font-size: var(--fs-75); font-weight: 700;
  text-transform: uppercase; letter-spacing: var(--track-caps); margin-bottom: var(--sp-3);
}
.eyebrow::before {   /* the ember bar from the mark */
  content: ""; flex: none; width: 0.875rem; height: 3px; border-radius: 2px; background: var(--accent);
}
.lede { color: var(--text-quiet); font-size: clamp(var(--fs-112), 1rem + 0.45vw, var(--fs-125)); line-height: 1.5; max-width: 42rem; }
.lede-wide { max-width: none; }

/* ---- skip link (a11y) ---- */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 99;
  background: var(--accent); color: var(--on-accent); font-weight: 700;
  padding: var(--sp-2) var(--sp-4); border-radius: var(--radius-s);
}
.skip-link:focus { left: var(--sp-2); top: var(--sp-2); }

/* ---- header / nav ---- */
.site-header {
  border-bottom: var(--border-1);
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  position: sticky; top: 0; z-index: 20;
}
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .site-header { -webkit-backdrop-filter: saturate(150%) blur(10px); backdrop-filter: saturate(150%) blur(10px); }
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-2) var(--sp-4); min-height: 3.5rem; flex-wrap: wrap; padding-block: var(--sp-2);
}
.brand {
  display: inline-flex; align-items: center; gap: var(--sp-2); min-height: var(--tap-min);
  color: var(--text-strong); font-weight: 700; border-radius: var(--radius-s);
}
.brand:hover { text-decoration: none; }
.brand svg { display: block; }
.brand svg rect:last-child {   /* the ember bar fills a little on hover */
  transform-box: fill-box; transform-origin: left center;
  transition: transform var(--dur-3) var(--ease-out);
}
.brand:hover svg rect:last-child, .brand:focus-visible svg rect:last-child { transform: scaleX(1.55); }
.brand .brand-word { font-size: var(--fs-100); letter-spacing: 0.01em; }
.site-nav ul {
  display: flex; flex-wrap: wrap; gap: var(--sp-1); list-style: none;
  margin: 0 calc(-1 * var(--sp-2)); padding: 0;
}
.site-nav a {
  display: inline-flex; align-items: center; min-height: 2.25rem; padding-inline: var(--sp-2);
  border-radius: var(--radius-s); color: var(--text-muted); font-size: var(--fs-875); font-weight: 600;
  transition: color var(--dur-1) var(--ease-1), background-color var(--dur-1) var(--ease-1), box-shadow var(--dur-1) var(--ease-1);
}
.site-nav a:hover { color: var(--text-strong); background: var(--surface-1); text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--text-strong); box-shadow: inset 0 -2px 0 var(--accent); text-decoration: none; }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: var(--tap-min); border: 1px solid transparent; border-radius: var(--radius-m); cursor: pointer;
  font: 600 var(--fs-875)/1.2 var(--font-body); padding: var(--sp-3) var(--sp-5);
  text-align: center; text-decoration: none; -webkit-tap-highlight-color: transparent;
  transition: background-color var(--dur-1) var(--ease-1), border-color var(--dur-1) var(--ease-1),
              color var(--dur-1) var(--ease-1), box-shadow var(--dur-2) var(--ease-1), transform var(--dur-1) var(--ease-1);
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); box-shadow: var(--glow-accent); }
.btn-ghost { background: transparent; color: var(--text-strong); border-color: var(--line-control); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--ink-500); }
.btn-danger { background: transparent; color: var(--danger-400); border-color: var(--danger-400); }
.btn-danger:hover { background: color-mix(in srgb, var(--danger-400) 14%, transparent); }
.btn-sm { min-height: 2rem; padding: var(--sp-2) var(--sp-3); font-size: var(--fs-75); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; box-shadow: none; transform: none; }

/* ---- cards ---- */
.card {
  background: linear-gradient(180deg, rgb(255 255 255 / 0.025), rgb(255 255 255 / 0) 42%), var(--surface-1);
  border: var(--border-1); border-radius: var(--radius-l);
  padding: var(--sp-5); box-shadow: var(--shadow-card);
}
.card h3 { margin-bottom: var(--sp-2); }
.card > :last-child { margin-bottom: 0; }
.grid-3 { display: grid; gap: var(--sp-5); grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr)); }
.grid-2 { display: grid; gap: var(--sp-5); grid-template-columns: repeat(auto-fit, minmax(min(18rem, 100%), 1fr)); }
.grid-3 > *, .grid-2 > *, .dash > * { min-width: 0; }   /* long code/table lines scroll inside, never widen the page */
/* .grid-4 — the four plan cards: 4 across, else 2 x 2, else 1, never 3 + 1
   (W3 #20). auto-fit alone wraps four 14rem tracks 3 + 1 at 720-967px of row
   (iPad portrait), so below 64em the track minimum is held above a third of
   the row, which caps it at two columns. */
.grid-4 { display: grid; gap: var(--sp-5); grid-template-columns: repeat(auto-fit, minmax(min(14rem, 100%), 1fr)); }
.grid-4 > * { min-width: 0; }
@media (max-width: 63.99em) { .grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(max(14rem, 34%), 100%), 1fr)); } }

/* ---- hero (interior pages) ---- */
.hero { padding-block: var(--section-y); }
.hero .btn { margin-block: var(--sp-4) 0; margin-inline-end: var(--sp-3); }

/* ---- hero (index): band + split ---- */
.hero-band {
  position: relative; isolation: isolate; overflow: hidden; border-bottom: var(--border-1);
  background:
    radial-gradient(52rem 28rem at 92% -14%, rgb(240 96 42 / 0.15), transparent 62%),
    radial-gradient(40rem 24rem at -12% 112%, rgb(91 113 153 / 0.16), transparent 62%),
    var(--bg);
}
.hero-band::before {   /* faint engineering grid, masked to fade out */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgb(255 255 255 / 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 0.035) 1px, transparent 1px);
  background-size: 2.5rem 2.5rem;
  -webkit-mask-image: radial-gradient(ellipse 72% 64% at 70% 28%, #000 18%, transparent 74%);
  mask-image: radial-gradient(ellipse 72% 64% at 70% 28%, #000 18%, transparent 74%);
}
.hero-split {
  display: grid; gap: var(--sp-7); align-items: center;
  grid-template-columns: minmax(0, 1fr); padding-block: var(--section-y);
}
.hero-split h1 {
  font-size: var(--fs-display); line-height: var(--lh-display);
  letter-spacing: var(--track-display); max-width: 20ch; margin-bottom: var(--sp-5);
}
.hero-split .lede { max-width: 38rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin: var(--sp-5) 0 0; }
.proof-row {
  display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-5);
  list-style: none; margin: var(--sp-6) 0 0; padding: 0;
}
.proof-row li { display: flex; align-items: baseline; gap: var(--sp-2); color: var(--text-muted); font-size: var(--fs-875); }
.proof-row b { font: 700 var(--fs-100)/1 var(--font-mono); color: var(--accent-metric); }

/* ---- terminal card (hero artifact) ---- */
.term {
  margin: 0; min-width: 0; overflow: hidden;
  background: var(--surface-inset); border: var(--border-1); border-radius: var(--radius-l);
  box-shadow: var(--shadow-raise);
}
.term-bar {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4); border-bottom: var(--border-1);
  color: var(--text-muted); font: 600 var(--fs-75)/1.4 var(--font-mono);
}
.term-bar::before { content: ""; flex: none; width: 0.625rem; height: 0.625rem; border-radius: 3px; background: var(--accent); }
.term pre { margin: 0; border: 0; border-radius: 0; background: transparent; padding: var(--sp-4) var(--sp-5); line-height: 1.75; }
.term .c { color: var(--text-faint); }
.term .k { color: var(--text-quiet); }
.term .s { color: var(--accent-text); }
.term-label {
  margin: 0; padding: var(--sp-2) var(--sp-5); border-block: 1px dashed var(--line);
  color: var(--text-muted); font: 600 var(--fs-75)/1.4 var(--font-mono); letter-spacing: 0.02em;
}
.term-label::before { content: "\2193\00a0"; color: var(--accent-metric); }
.term-foot { margin: 0; padding: var(--sp-3) var(--sp-5); border-top: var(--border-1); color: var(--text-muted); font-size: var(--fs-875); }

/* ---- pillars + steps ---- */
.pillar { display: flex; flex-direction: column; gap: var(--sp-3); }
.pillar h3 { margin: 0; }
.pillar p { margin: 0; }
.pillar .pillar-proof {
  margin-top: auto; padding-top: var(--sp-3); border-top: 1px solid var(--line);
  color: var(--text-muted); font-size: var(--fs-875);
}
.pillar-proof::before { content: "\2192\00a0"; color: var(--accent-metric); font-weight: 700; }
.steps {
  counter-reset: step; list-style: none; margin: 0; padding: 0;
  display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
}
.steps > li {
  counter-increment: step; min-width: 0; padding: var(--sp-5);
  background: var(--surface-1); border: var(--border-1); border-radius: var(--radius-l);
}
.steps > li::before {
  content: counter(step, decimal-leading-zero); display: block; margin-bottom: var(--sp-3);
  color: var(--accent-metric); font: 700 var(--fs-75)/1 var(--font-mono); letter-spacing: 0.08em;
}
.steps h3 { font-size: var(--fs-100); margin-bottom: var(--sp-2); }
.steps p { margin: 0; color: var(--text-muted); font-size: var(--fs-875); }
.after-grid { margin: var(--sp-5) 0 0; }

/* ---- model strip / teaser ---- */
.strip { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(min(19rem, 100%), 1fr)); }
.chip {
  background: linear-gradient(180deg, rgb(255 255 255 / 0.025), rgb(255 255 255 / 0) 40%), var(--surface-1);
  border: var(--border-1); border-radius: var(--radius-l);
  padding: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-2);
  min-width: 0;
}
.chip-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--sp-1) var(--sp-3); }
.chip-head h3 { margin: 0; color: var(--text-strong); font-size: var(--fs-125); letter-spacing: -0.01em; }
.chip b { color: var(--text-strong); }
.chip .model-id { color: var(--text-muted); font: var(--fs-75)/1.5 var(--font-mono); }
.chip .metric { color: var(--accent-metric); font-family: var(--font-mono); font-size: var(--fs-875); margin-top: var(--sp-2); }
.chip-stats {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-3);
  margin: var(--sp-2) 0; padding-block: var(--sp-4); border-block: 1px solid var(--line);
}
.chip-stats dt { color: var(--text-faint); font-size: var(--fs-75); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.chip-stats dd { margin: var(--sp-1) 0 0; color: var(--text-strong); font: 700 var(--fs-150)/1.1 var(--font-mono); font-variant-numeric: tabular-nums; }
.chip-stats dd small { font-size: var(--fs-75); font-weight: 600; color: var(--text-muted); margin-left: 0.15em; }
.chip-stats .lead dd { color: var(--accent-metric); }
.chip .sub { color: var(--text-muted); font-size: var(--fs-875); margin: 0; }
.chip .sub b { font-size: inherit; color: var(--text-quiet); font-weight: 600; }

/* ---- benchmarks (proof layout) ---- */
.bench { display: grid; gap: var(--sp-5); grid-template-columns: minmax(0, 1fr); }
.table-scroll {
  overflow-x: auto; border: var(--border-1); border-radius: var(--radius-l);
}
/* Scroll affordance: an edge glow appears only on the side that has more
   content (local covers hide it at either end). Pure CSS, no listeners. */
.table-scroll, .method pre {
  --sx-bg: var(--surface-1);
  background:
    linear-gradient(90deg, var(--sx-bg) 40%, transparent) left / 2rem 100% no-repeat local,
    linear-gradient(270deg, var(--sx-bg) 40%, transparent) right / 2rem 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgb(164 178 200 / 0.3), transparent) left / 0.75rem 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgb(164 178 200 / 0.3), transparent) right / 0.75rem 100% no-repeat scroll,
    var(--sx-bg);
}
.method pre { --sx-bg: var(--surface-inset); font-size: var(--fs-75); margin: 0; }
.table-scroll caption { padding: var(--sp-4) var(--sp-4) var(--sp-2); }
.table-scroll :is(th, td):first-child { padding-left: var(--sp-4); }
.table-scroll :is(th, td):last-child { padding-right: var(--sp-4); }
.table-scroll tbody tr:last-child > * { border-bottom: 0; }
.bench-table { min-width: 36rem; }
.derived { color: var(--text-muted); }
.method {
  display: grid; gap: var(--sp-5) var(--sp-7); align-items: start;
  grid-template-columns: repeat(auto-fit, minmax(min(22rem, 100%), 1fr));
  padding: var(--sp-5); border: var(--border-1); border-radius: var(--radius-l); background: var(--surface-1);
}
.method > * { min-width: 0; }
.method h3 { font-size: var(--fs-100); }
.facts {
  display: grid; grid-template-columns: max-content minmax(0, 1fr);
  gap: var(--sp-2) var(--sp-4); margin: 0; font-size: var(--fs-875);
}
.facts dt {
  color: var(--text-faint); font-size: var(--fs-75); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em; padding-top: 0.2em;
}
.facts dd { margin: 0; }

/* ---- call to action band ---- */
.cta-band {
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); border-radius: var(--radius-l);
  padding: clamp(1.5rem, 0.75rem + 3.5vw, 3.25rem);
  background: radial-gradient(42rem 18rem at 100% 0%, rgb(240 96 42 / 0.13), transparent 62%), var(--surface-1);
}
.cta-band h2 { margin-bottom: var(--sp-3); }
.cta-band .lede { margin-bottom: 0; }

/* ---- prose pages (privacy, legal) ---- */
.prose h2 { margin-top: var(--sp-7); }
.prose > h1 + .lede { margin-bottom: var(--sp-6); }
.prose ul { padding-left: 1.25rem; }
.prose li { margin-bottom: var(--sp-2); }
.prose li::marker { color: var(--accent-metric); }
.page-actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-7); }

/* ---- pricing ---- */
.plan-card { display: flex; flex-direction: column; }
.plan-card .price { font-size: var(--fs-150); color: var(--text-strong); font-weight: 700; }
.plan-card .price small { color: var(--text-muted); font-size: var(--fs-875); font-weight: 400; }
.plan-card ul { list-style: none; padding: 0; margin: var(--sp-3) 0 var(--sp-5); }
.plan-card li { padding-left: 1.4rem; position: relative; margin-bottom: var(--sp-2); }
.plan-card li::before { content: "\203A"; position: absolute; left: 0.2rem; color: var(--accent-metric); font-weight: 700; }
.plan-card .spacer { flex: 1; }
.pack-strip { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(min(13rem, 100%), 1fr)); }
.pack { border-color: var(--slate-600); }
.pack .price { font-size: var(--fs-150); color: var(--text-strong); font-weight: 700; margin-bottom: var(--sp-1); }
.pack .disc { color: var(--ok-400); font-weight: 700; }

/* ---- forms ---- */
.field { display: block; margin-bottom: var(--sp-4); }
.field > span { display: block; font-size: var(--fs-875); font-weight: 600; color: var(--text); margin-bottom: var(--sp-1); }
.field input, .field select, .field textarea {
  width: 100%; min-height: var(--tap-min); background: var(--bg); color: var(--text-strong);
  border: var(--border-control); border-radius: var(--radius-m);
  padding: var(--sp-3); font: var(--fs-100) var(--font-body);
  transition: border-color var(--dur-1) var(--ease-1);
}
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--ink-500); }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { border-color: var(--ember-400); outline-offset: 1px; }
.field input::placeholder, .field textarea::placeholder { color: var(--text-faint); opacity: 1; }
.field input[aria-invalid="true"] { border-color: var(--danger-400); }
.hint { color: var(--text-faint); font-size: var(--fs-75); margin-top: var(--sp-1); }
.notice {
  border: var(--border-1); border-left-width: 4px; border-radius: var(--radius-m);
  padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-4); font-size: var(--fs-875);
  background: var(--surface-1); border-left-color: var(--accent);
}
.notice.err { border-left-color: var(--danger-400); color: var(--text-strong); }
.notice.ok  { border-left-color: var(--ok-400); }

/* ---- badges ---- */
.badge {
  display: inline-block; font-size: var(--fs-75); font-weight: 700; letter-spacing: 0.03em;
  padding: 0.15em 0.6em; border-radius: 999px; border: var(--border-1); color: var(--text-muted);
}
.badge.ok { color: var(--ok-400); border-color: var(--ok-400); }
.badge.warn { color: var(--warn-400); border-color: var(--warn-400); }
.badge.bad { color: var(--danger-400); border-color: var(--danger-400); }

/* ---- gauges (usage card) ---- */
.gauge { margin-bottom: var(--sp-5); }
.gauge .g-head { display: flex; justify-content: space-between; gap: var(--sp-3); font-size: var(--fs-875); margin-bottom: var(--sp-2); flex-wrap: wrap; }
.gauge .g-head b { color: var(--text-strong); }
.gauge .g-track {
  position: relative; height: 0.85rem; border-radius: 999px;
  background: var(--slate-600); overflow: hidden;
}
.gauge .g-fill { position: absolute; inset: 0 auto 0 0; background: var(--accent); border-radius: 999px; transition: width var(--dur-3) var(--ease-out); }
.gauge .g-fill.hot { background: var(--danger-400); }
.gauge .g-fill.topup { background: var(--ok-400); }
.gauge .g-cap { color: var(--text-faint); font-size: var(--fs-75); margin-top: var(--sp-1); }

/* ---- chart ---- */
.chart-note { color: var(--text-faint); font-size: var(--fs-75); }
.bars { width: 100%; height: 10rem; display: block; }

/* ---- keys table ---- */
.key-value {
  display: block; background: var(--bg); border: var(--border-1); border-radius: var(--radius-m);
  font-family: var(--font-mono); font-size: var(--fs-875); padding: var(--sp-3);
  word-break: break-all; margin: var(--sp-3) 0; color: var(--text-strong);
}

/* ---- modal (native dialog) ---- */
dialog {
  background: var(--surface-1); color: var(--text); border: var(--border-1);
  border-radius: var(--radius-l); padding: var(--sp-5); max-width: 38rem; width: min(38rem, calc(100vw - 2rem));
  box-shadow: var(--shadow-card);
}
dialog[open] { animation: dialog-in var(--dur-3) var(--ease-out); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(6px) scale(0.985); } to { opacity: 1; transform: none; } }
dialog::backdrop { background: rgb(2 6 14 / 0.72); }
dialog h2 { margin-top: 0; }
.modal-close {
  float: right; min-width: 2.25rem; min-height: 2.25rem; background: none; border: 0; border-radius: var(--radius-s);
  color: var(--text-muted); font-size: var(--fs-125); cursor: pointer; padding: var(--sp-1) var(--sp-2);
}
.modal-close:hover { color: var(--text-strong); background: var(--surface-2); }

/* ---- dashboard ---- */
.dash { display: grid; gap: var(--sp-5); grid-template-columns: repeat(auto-fit, minmax(min(20rem, 100%), 1fr)); align-items: start; }
.dash .span-2 { grid-column: 1 / -1; }
.dash-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-4); }
.auth-view, .dash-view { max-width: var(--content-max); margin-inline: auto; padding: var(--sp-6) var(--sp-4) var(--sp-8); }
.auth-card { max-width: 26rem; margin-inline: auto; }
.tabrow { display: flex; gap: var(--sp-2); margin-bottom: var(--sp-5); }
.tabrow .btn { flex: 1; }
.tabrow .btn[aria-pressed="true"] { background: var(--slate-800); border-color: var(--ember-400); color: var(--text-strong); }
.hidden { display: none !important; }
.muted { color: var(--text-faint); }
.mono { font-family: var(--font-mono); font-size: var(--fs-875); }
.nowrap { white-space: nowrap; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---- footer ---- */
.site-footer { border-top: var(--border-1); margin-top: var(--section-y); padding-block: var(--sp-6) var(--sp-7); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: var(--sp-4) var(--sp-6); }
.site-footer nav ul { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-4); list-style: none; margin: 0; padding: 0; }
.site-footer a { display: inline-block; padding-block: var(--sp-1); color: var(--text-muted); font-size: var(--fs-875); }
.site-footer a:hover { color: var(--text-strong); }
.fineprint { color: var(--text-faint); font-size: var(--fs-75); max-width: 34rem; margin-bottom: var(--sp-2); }

/* ---- wide screens ---- */
@media (min-width: 60em) {
  .hero-split { grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); gap: var(--sp-8); }
}

/* ---- small screens (375px first) ---- */
@media (max-width: 30em) {
  /* Header: the brand on one row, the nav under it as ONE strip that scrolls
     sideways. Seven links used to wrap to two rows, a three-row sticky
     header about 9rem tall on a phone. */
  .site-header .wrap { flex-flow: column nowrap; align-items: stretch; gap: 0; padding-block: var(--sp-1) 0; }
  .site-nav {
    min-width: 0; margin-inline: calc(-1 * var(--sp-4)); padding-inline: var(--sp-4);
    overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav ul { flex-wrap: nowrap; width: max-content; }
  .site-nav a { white-space: nowrap; }
  .site-nav a:focus-visible { outline-offset: -2px; }   /* the strip clips an outside ring */
  .card, pre { padding: var(--sp-4); }
  .hero .btn { display: flex; margin-inline: 0; margin-block-end: var(--sp-3); }
  .hero-actions .btn { flex: 1 1 100%; }
  .term pre { padding: var(--sp-4); font-size: var(--fs-75); }
  .term-label, .term-foot { padding-inline: var(--sp-4); }
  .facts { grid-template-columns: minmax(0, 1fr); gap: 0 var(--sp-4); }
  .facts dd { margin-bottom: var(--sp-3); }
  .method { padding: var(--sp-4); }
  /* the bench table drops the two columns the model cards already carry */
  .bench-table { min-width: 0; }
  .bench-table :is(th, td):nth-child(n+5) { display: none; }
  .bench-table :is(th, td) { padding-inline: var(--sp-2); }
  .bench-table thead th.num { white-space: normal; }
  .chip-stats dd { font-size: var(--fs-125); }
}

/* ---- user preferences ---- */
@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;
  }
  .btn:active { transform: none; }
  .brand:hover svg rect:last-child, .brand:focus-visible svg rect:last-child { transform: none; }
}
@media (forced-colors: active) {
  .btn, .chip, .term, .table-scroll, .steps > li, .cta-band { border: 1px solid CanvasText; }
  .eyebrow::before, .term-bar::before { background: CanvasText; }
  :focus-visible { outline-color: Highlight; }
}
@media print {
  :root { color-scheme: light; }
  body { background: #fff; color: #000; }
  .site-header, .site-footer nav, .skip-link, .hero-actions, .page-actions, .btn { display: none !important; }
  .hero-band { background: none; border: 0; }
  .hero-band::before { display: none; }
  h1, h2, h3, h4, b, strong, th, .lede { color: #000; }
  a { color: #000; text-decoration: underline; }
  .card, .chip, pre, .term, .table-scroll, .cta-band, .steps > li { background: #fff; box-shadow: none; border-color: #999; }
}
