/* ------------------------------------------------------------------
   /models/ — model catalog + mirror.
   Palette and metrics follow the approved "Models — Editorial Catalog"
   Paper board (--r-* token set, shared with /download).
   ------------------------------------------------------------------ */

:root {
  --m-canvas: #fafaf9;
  --m-raised: #ffffff;
  --m-rail: #f3f3f1;
  --m-ink: #16181b;
  --m-ink-2: #56585c;
  --m-ink-3: #7b7e84;
  --m-hairline: #e7e7e4;
  --m-hairline-strong: #d5d5d1;
  --m-band: #1b1d21;
  --m-band-ink: #f4f3f1;
  --m-band-track: #33373d;
  --m-band-edge: #4a515c;
  --m-amber: #efa23a;
  --m-amber-deep: #b97817;
  --m-amber-tint: #fbf1e2;
  --m-on-amber: #241a08;
  --m-ready: #2e7d55;
  --m-ready-tint: #ecf5f0;
  --m-steel-tint: #eef2f7;
  --m-segment-track: #e8ebe7;
  --m-input-line: #c8ced6;

  /* Sticky-header height, and the sliver of the next section deliberately
     left visible at the fold so a full-height panel still reads as a page
     rather than a slide. */
  --m-header: 78px;
  --m-peek: 56px;
}

html[data-theme="dark"] {
  --m-canvas: #141619;
  --m-raised: #1d2024;
  --m-rail: #191b1e;
  --m-ink: #f2f2f0;
  --m-ink-2: #a9acb2;
  --m-ink-3: #8b9099;
  --m-hairline: #26292e;
  --m-hairline-strong: #32363c;
  --m-band: #14161a;
  --m-band-ink: #f4f3f1;
  --m-band-track: #2b2f35;
  --m-band-edge: #414852;
  --m-amber: #efa23a;
  --m-amber-deep: #eab05a;
  --m-amber-tint: #2a2113;
  --m-ready: #5fc7a0;
  --m-ready-tint: #182a22;
  --m-steel-tint: #1e2a3a;
  --m-segment-track: #24272b;
  --m-input-line: #3a4048;
}

.models-page {
  background: var(--m-raised);
  color: var(--m-ink);
}

.models-page main {
  overflow: clip;
}

.models-page h1,
.models-page h2,
.models-page h3,
.models-page p {
  margin: 0;
}

.models-page a {
  text-decoration: none;
}

.models-inner {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
}

.models-page section {
  border-top: 1px solid var(--m-hairline);
}

.models-page section:first-of-type {
  border-top: 0;
}

/* Focus — one visible ring for every interactive control on the page. */
.models-page a:focus-visible,
.models-page button:focus-visible,
.models-page input:focus-visible,
.models-page select:focus-visible {
  outline: 2px solid var(--m-amber-deep);
  outline-offset: 2px;
  border-radius: 3px;
}

.m-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--m-amber-deep);
  font: 600 11px/16px var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.m-eyebrow::before {
  width: 24px;
  height: 2px;
  background: var(--m-amber);
  content: "";
}

/* ------------------------------ hero ------------------------------ */

.models-hero {
  background: var(--m-raised);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 720px) minmax(0, 380px);
  align-items: start;
  justify-content: space-between;
  gap: 60px;
  padding: 62px 0 44px;
}

.hero-copy h1 {
  margin-top: 18px;
  font-size: 50px;
  font-weight: 700;
  line-height: 56px;
  letter-spacing: -.02em;
}

.hero-copy > p {
  max-width: 620px;
  margin-top: 18px;
  color: var(--m-ink-2);
  font-size: 16px;
  line-height: 26px;
}

.mirror-status {
  display: grid;
  gap: 12px;
}

.mirror-status-label {
  color: var(--m-ink-3);
  font: 10px/14px var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.mirror-state {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--m-ready);
  font: 12px/18px var(--mono);
}

.mirror-state i {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: currentColor;
}

/* --------------------------- proof strip --------------------------- */

.proof-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--m-hairline);
}

.proof-strip > div {
  min-width: 0;
  padding: 20px 24px 22px;
  border-right: 1px solid var(--m-hairline);
}

.proof-strip > div:first-child {
  padding-left: 0;
}

.proof-strip > div:last-child {
  border-right: 0;
}

.proof-strip dt {
  margin-bottom: 9px;
  color: var(--m-ink-3);
  font: 10px/14px var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.proof-strip dd {
  margin: 0;
  color: var(--m-ink);
  font: 15px/22px var(--mono);
}

.proof-strip dd.is-amber {
  color: var(--m-amber-deep);
}

/* ---------------------------- RAM picker ---------------------------- */

.ram-section {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: calc(100vh - var(--m-header) - var(--m-peek));
  min-height: calc(100svh - var(--m-header) - var(--m-peek));
  padding: 96px 0 104px;
  background: var(--m-canvas);
}

.centred-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  text-align: center;
}

.centred-head h2 {
  font-size: 32px;
  font-weight: 700;
  line-height: 38px;
  letter-spacing: -.01em;
}

.centred-head > p {
  max-width: 640px;
  color: var(--m-ink-2);
  font-size: 14px;
  line-height: 22px;
}

.centred-head .kicker {
  color: var(--m-amber-deep);
  font: 11px/16px var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* The two picker panels carry the page's editorial weight; the catalog
   below keeps the compact heading because it is a data table. */
.ram-section .centred-head,
.families-section .centred-head {
  gap: 18px;
}

.ram-section .centred-head h2,
.families-section .centred-head h2 {
  font-size: 46px;
  line-height: 54px;
  letter-spacing: -.022em;
}

.ram-section .centred-head > p,
.families-section .centred-head > p {
  max-width: 660px;
  font-size: 17px;
  line-height: 27px;
}

.families-section .centred-head .kicker {
  font-size: 12px;
  line-height: 18px;
}

.ram-tabs {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  margin-top: 48px;
  padding: 6px;
  border-radius: 10px;
  background: var(--m-rail);
}

.ram-tab {
  min-height: 56px;
  padding: 16px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--m-ink-2);
  font: 15px/24px var(--mono);
  cursor: pointer;
  transition: background .14s ease, color .14s ease;
}

.ram-tab:hover {
  color: var(--m-ink);
}

.ram-tab[aria-selected="true"] {
  background: var(--m-amber);
  color: var(--m-on-amber);
  font-weight: 600;
}

/* Card is the subject, table is the reference: the card keeps the raised
   surface and the extra column width, the table sits plainly on canvas. */
.ram-result {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
  /* Equal heights so the card doesn't leave a ragged edge beside the
     taller tier table; .ram-metrics uses margin-top:auto to take up the
     slack from inside. */
  align-items: stretch;
  gap: 56px;
  margin-top: 44px;
}

.ram-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 24px;
  padding: 40px;
  border: 1px solid var(--m-hairline);
  border-radius: 12px;
  background: var(--m-raised);
}

.ram-card-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ram-badge {
  padding: 9px 14px;
  border-radius: 6px;
  background: var(--m-amber-tint);
  color: var(--m-amber-deep);
  font: 600 13px/18px var(--mono);
  letter-spacing: .04em;
}

.ram-reason {
  color: var(--m-ready);
  font: 13px/20px var(--mono);
  letter-spacing: .04em;
  text-transform: uppercase;
}

.ram-card h3 {
  margin-top: 4px;
  font-size: 40px;
  font-weight: 700;
  line-height: 46px;
  letter-spacing: -.025em;
}

.ram-card .ram-note {
  margin-top: -10px;
  color: var(--m-ink-2);
  font-size: 17px;
  line-height: 27px;
}

.ram-alt {
  padding: 14px 18px;
  border-left: 3px solid var(--m-amber);
  background: var(--m-amber-tint);
  color: var(--m-ink-2);
  font-size: 14px;
  line-height: 22px;
}

.ram-metrics {
  display: grid;
  /* Alias takes the slack — it is the longest value and should not wrap
     into two lines beside two short numeric columns. */
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 24px 32px;
  margin-top: auto;
  padding-top: 28px;
  border-top: 1px solid var(--m-hairline);
}

.ram-metrics div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 10px;
}

.ram-metrics dt,
.ram-metrics .k {
  color: var(--m-ink-3);
  font: 12px/16px var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.ram-metrics .v {
  overflow-wrap: anywhere;
  color: var(--m-ink);
  font: 22px/28px var(--mono);
}

.ram-metrics .v.is-alias {
  font-size: 15px;
  line-height: 28px;
}

/* Noticeable, but deliberately quieter than the 40px model name. */
.ram-card .cmd code {
  padding: 16px 18px;
  font-size: 13px;
  line-height: 20px;
}

.ram-card .copy-cmd {
  width: 52px;
  flex-basis: 52px;
}

/* Two engine picks — smart + fast — sit side by side inside the card. */
.ram-picks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}

.ram-pick {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 14px;
}

.ram-pick[data-role="fast"] {
  padding-left: 28px;
  border-left: 1px solid var(--m-hairline);
}

.pick-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pick-role {
  align-self: flex-start;
  padding: 5px 11px;
  border-radius: 5px;
  font: 600 11px/14px var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
}

.pick-role.smart {
  background: var(--m-amber-tint);
  color: var(--m-amber-deep);
}

.pick-role.fast {
  background: var(--m-steel-tint);
  color: var(--m-ink-2);
}

.ram-card .pick-name {
  margin-top: 0;
  font-size: 26px;
  line-height: 32px;
  letter-spacing: -.02em;
}

.pick-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 0;
  padding: 16px 0;
  list-style: none;
  border-top: 1px solid var(--m-hairline);
  border-bottom: 1px solid var(--m-hairline);
  color: var(--m-ink-3);
  font: 13px/20px var(--mono);
}

.pick-stats b {
  color: var(--m-ink);
  font-weight: 600;
}

.pick-caveat {
  margin: 0;
  color: var(--m-amber-deep);
  font: 13px/20px var(--mono);
}

.ram-pick .cmd {
  margin-top: auto;
}

/* Stack the two picks below the card's own stacking point. */
@media (max-width: 760px) {
  .ram-picks {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .ram-pick[data-role="fast"] {
    padding-left: 0;
    padding-top: 24px;
    border-left: none;
    border-top: 1px solid var(--m-hairline);
  }
  .ram-card .pick-name {
    font-size: 23px;
    line-height: 29px;
  }
}

.ram-compare {
  min-width: 0;
  padding: 6px 0 0;
}

.ram-compare table {
  width: 100%;
  border-collapse: collapse;
}

.ram-compare th {
  padding: 0 12px 16px;
  border-bottom: 1px solid var(--m-hairline-strong);
  color: var(--m-ink-3);
  font: 12px/16px var(--mono);
  font-weight: 400;
  letter-spacing: .08em;
  text-align: left;
  text-transform: uppercase;
}

.ram-compare th:first-child,
.ram-compare td:first-child {
  padding-left: 0;
}

.ram-compare th:last-child,
.ram-compare td:last-child {
  padding-right: 0;
}

.ram-compare td {
  padding: 20px 12px;
  border-bottom: 1px solid var(--m-hairline);
  color: var(--m-ink-2);
  font: 15px/22px var(--mono);
}

.ram-compare tr:last-child td {
  border-bottom: 0;
}

.ram-compare .c-model {
  width: 40%;
  color: var(--m-ink);
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
}

.ram-compare .c-ram {
  width: 20%;
}

/* Amber marks the live selection without boxing the row in. */
.ram-compare tbody tr {
  cursor: pointer;
}

.ram-compare tbody tr:hover td {
  color: var(--m-ink);
}

.ram-compare tr[aria-current="true"] td {
  background: var(--m-amber-tint);
  color: var(--m-ink);
  font-weight: 600;
}

.ram-compare tr[aria-current="true"] td:first-child {
  box-shadow: inset 3px 0 0 var(--m-amber);
}

.ram-compare tr[aria-current="true"] .c-ram {
  color: var(--m-amber-deep);
}

.ram-foot {
  margin-top: 40px;
  color: var(--m-ink-3);
  font-size: 13px;
  line-height: 21px;
}

.ram-foot a {
  color: var(--m-amber-deep);
}

/* ------------------------- curated families ------------------------- */

.families-section {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--m-header) - var(--m-peek));
  min-height: calc(100svh - var(--m-header) - var(--m-peek));
  padding: 96px 0 104px;
  background: var(--m-raised);
}

/* Seven full-size tabs exceed the measure at 1440, so the row wraps —
   top-align the control beside it rather than letting it float mid-height. */
.family-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 20px;
  margin-top: 48px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--m-hairline);
}

.family-tabs {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 8px;
}

.family-tab {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 13px 20px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--m-ink-2);
  font: 14px/22px var(--mono);
  cursor: pointer;
  transition: background .14s ease, color .14s ease;
  white-space: nowrap;
}

.family-tab:hover {
  background: var(--m-rail);
  color: var(--m-ink);
}

.family-tab[aria-selected="true"] {
  background: var(--m-amber-tint);
  border-color: var(--m-amber);
  color: var(--m-amber-deep);
  font-weight: 600;
}

.family-tab .count {
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--m-rail);
  color: var(--m-ink-3);
  font-size: 12px;
}

.family-tab[aria-selected="true"] .count {
  background: var(--m-amber);
  color: var(--m-on-amber);
}

.expand-all {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 13px 20px;
  border: 1px solid var(--m-amber);
  border-radius: 8px;
  background: transparent;
  color: var(--m-amber-deep);
  font: 14px/22px var(--mono);
  cursor: pointer;
  transition: background .14s ease;
}

.expand-all:hover {
  background: var(--m-amber-tint);
}

.expand-all svg {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.family-panel[hidden] {
  display: none;
}

.family-head {
  display: grid;
  grid-template-columns: minmax(0, 440px) minmax(0, 1fr);
  grid-template-areas:
    "name intro"
    "tag  intro";
  align-content: start;
  align-items: start;
  gap: 16px 56px;
  padding: 56px 0 20px;
}

.family-head h3 {
  grid-area: name;
  font-size: 36px;
  font-weight: 700;
  line-height: 44px;
  letter-spacing: -.022em;
}

.family-tag {
  grid-area: tag;
  justify-self: start;
  padding: 6px 12px;
  border-radius: 5px;
  background: var(--m-amber-tint);
  color: var(--m-amber-deep);
  font: 12px/18px var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.family-intro {
  grid-area: intro;
  min-width: 0;
  max-width: 620px;
  color: var(--m-ink-2);
  font-size: 16px;
  line-height: 27px;
}

.family-rows {
  display: grid;
}

/* Four zones: the name block leads, metrics sit in their own lane, the
   description runs beneath, and the command holds the right edge. */
.family-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px minmax(0, 400px);
  grid-template-areas:
    "alias size cmd"
    "blurb blurb cmd";
  align-items: start;
  gap: 14px 36px;
  min-height: 132px;
  padding: 32px 0;
  border-top: 1px solid var(--m-hairline);
}

.family-row .r-alias {
  grid-area: alias;
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 9px;
}

.family-row .alias {
  overflow-wrap: anywhere;
  color: var(--m-ink);
  font: 600 22px/28px var(--mono);
  letter-spacing: -.015em;
}

.family-row .repo {
  overflow-wrap: anywhere;
  color: var(--m-ink-3);
  font: 12px/18px var(--mono);
}

.family-row .repo a {
  color: var(--m-amber-deep);
}

.family-row .r-size {
  grid-area: size;
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
  /* Nudge the 17px metric onto the 22px alias's baseline. */
  padding-top: 3px;
}

.family-row .size {
  color: var(--m-ink);
  font: 17px/24px var(--mono);
}

.family-row .tier {
  color: var(--m-amber-deep);
  font: 12px/18px var(--mono);
}

.family-row .blurb {
  grid-area: blurb;
  min-width: 0;
  max-width: 620px;
  padding-right: 0;
  color: var(--m-ink-2);
  font-size: 15px;
  line-height: 24px;
}

.family-row .cmd {
  grid-area: cmd;
  align-self: center;
}

.family-row .cmd code {
  padding: 14px 16px;
  font-size: 12px;
  line-height: 19px;
}

.family-row .copy-cmd {
  width: 46px;
  flex-basis: 46px;
}

/* Comparison mode: tighter rhythm, but the model name stays primary. */
.models-inner:has(#expandAll[aria-pressed="true"]) .family-head {
  padding-top: 44px;
}

.models-inner:has(#expandAll[aria-pressed="true"]) .family-row {
  min-height: 0;
  padding: 22px 0;
  gap: 10px 32px;
}

.models-inner:has(#expandAll[aria-pressed="true"]) .family-row .alias {
  font-size: 20px;
  line-height: 26px;
}

/* An explanatory pairing note, never a runnable command. */
.pair-note {
  margin-top: 8px;
  padding: 18px 22px;
  border-radius: 8px;
  background: var(--m-steel-tint);
  color: var(--m-ink-2);
  font-size: 14px;
  line-height: 23px;
}

.pair-note code {
  border: 0;
  background: transparent;
  color: var(--m-ink);
  font-family: var(--mono);
  font-size: 13px;
}

/* --------------------------- command block --------------------------- */

.cmd {
  display: flex;
  min-width: 0;
  align-items: stretch;
  overflow: hidden;
  border-radius: 4px;
  background: var(--m-band);
}

.cmd code {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  /* Anchor the `$` to the first line — centring it against a wrapped
     two-line command makes the prompt look like it belongs to line two. */
  align-items: flex-start;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  color: var(--m-band-ink);
  font-family: var(--mono);
  font-size: 10px;
  line-height: 16px;
  /* Wrap rather than scroll: a long alias (deepseek-coder-v2-lite-16b-4bit)
     otherwise truncates mid-token against the copy button and reads broken. */
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.cmd code .p {
  flex: 0 0 auto;
  color: #8d949e;
  user-select: none;
}

/* Copy control — dark surface, light glyph. Never amber. */
.copy-cmd {
  display: inline-flex;
  width: 38px;
  flex: 0 0 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--m-band-edge);
  border-radius: 0 4px 4px 0;
  background: var(--m-band-track);
  color: var(--m-band-ink);
  cursor: pointer;
  transition: background .14s ease, border-color .14s ease;
}

.copy-cmd:hover {
  border-color: #78808b;
  background: #40454d;
}

.copy-cmd svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.copy-cmd.is-copied {
  color: #7fd6ab;
}

.cmd-lg code {
  padding: 13px 14px;
  font-size: 11px;
  line-height: 18px;
}

.cmd-lg .copy-cmd {
  width: 42px;
  flex-basis: 42px;
}

.cmd-wrap code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ---------------------------- model catalog ---------------------------- */

.catalog-section {
  padding: 56px 0 60px;
  background: var(--m-canvas);
}

.catalog-live {
  color: var(--m-amber-deep);
  font: 11px/16px var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.catalog-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
}

.catalog-search {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  align-items: center;
  gap: 12px;
  height: 46px;
  padding: 0 16px;
  border: 1px solid var(--m-input-line);
  border-radius: 5px;
  background: var(--m-raised);
}

.catalog-search svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  fill: none;
  stroke: var(--m-ink-2);
  stroke-width: 2;
  stroke-linecap: round;
}

.catalog-search input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--m-ink);
  font-family: inherit;
  font-size: 14px;
  line-height: 20px;
}

.catalog-search input::placeholder {
  color: var(--m-ink-3);
}

.catalog-search input:focus {
  outline: none;
}

/* The inner input drops its own ring (above) so the whole control reads as
   one focus target — use the same ring every other control gets. */
.catalog-search:focus-within {
  border-color: var(--m-amber-deep);
  outline: 2px solid var(--m-amber-deep);
  outline-offset: 2px;
}

.segmented {
  display: flex;
  flex: 0 0 auto;
  gap: 4px;
  padding: 4px;
  border-radius: 5px;
  background: var(--m-segment-track);
}

.segmented button {
  min-height: 38px;
  padding: 9px 14px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--m-ink-2);
  font: 11px/16px var(--mono);
  cursor: pointer;
  white-space: nowrap;
}

.segmented button:hover {
  color: var(--m-ink);
}

.segmented button[aria-pressed="true"] {
  background: var(--m-raised);
  color: var(--m-ink);
  font-weight: 600;
}

.catalog-sort {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  color: var(--m-ink-3);
  font: 10px/14px var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.catalog-sort select {
  height: 46px;
  padding: 0 10px;
  border: 1px solid var(--m-input-line);
  border-radius: 5px;
  background: var(--m-raised);
  color: var(--m-ink);
  font: 11px/16px var(--mono);
  cursor: pointer;
}

.catalog-shell {
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid var(--m-hairline);
  border-radius: 6px;
  background: var(--m-raised);
  /* The site header is sticky; keep the first row clear of it when
     pagination scrolls the table back into view. */
  scroll-margin-top: 84px;
}

.catalog-headrow,
.catalog-row {
  display: grid;
  grid-template-columns: minmax(0, 280px) 132px 118px 74px minmax(0, 330px) minmax(0, 196px);
  align-items: center;
  gap: 12px;
  padding: 16px;
}

.catalog-headrow {
  padding-top: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--m-hairline);
  background: var(--m-rail);
  color: var(--m-ink-3);
  font: 10px/14px var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.catalog-row {
  border-bottom: 1px solid var(--m-hairline);
}

.catalog-row:last-child {
  border-bottom: 0;
}

.catalog-row .c-alias {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.catalog-row .alias {
  overflow-wrap: anywhere;
  color: var(--m-ink);
  font: 12px/17px var(--mono);
}

.catalog-row .repo {
  overflow-wrap: anywhere;
  color: var(--m-ink-3);
  font: 9px/14px var(--mono);
}

.catalog-row .c-status {
  display: flex;
  align-items: center;
  gap: 7px;
  font: 10px/16px var(--mono);
  letter-spacing: .04em;
  text-transform: uppercase;
}

.catalog-row .c-status i {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: currentColor;
}

.status-mirrored { color: var(--m-ready); }
.status-partial { color: var(--m-amber-deep); }
.status-pending { color: var(--m-ink-3); }

.catalog-row .c-size {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--m-ink-2);
  font: 11px/16px var(--mono);
}

/* Context window of this exact build, under its size. */
.catalog-row .c-ctx {
  color: var(--m-ink-3);
  font: 9px/14px var(--mono);
}

/* AA Intelligence Index — borrowed, base-model level. Deliberately quieter
   than our own measured numbers, and an em dash where we have no match. */
.catalog-headrow .c-iq,
.catalog-row .c-iq {
  text-align: right;
}

.catalog-row .c-iq {
  color: var(--m-ink-2);
  font: 12px/16px var(--mono);
}

.catalog-row .c-iq .c-none {
  color: var(--m-ink-3);
}

.catalog-note {
  margin: 14px 2px 0;
  color: var(--m-ink-3);
  font-size: 12.5px;
  line-height: 1.65;
}

.catalog-note b { color: var(--m-ink-2); font-weight: 600; }
.catalog-note code { font-family: var(--mono); font-size: 11.5px; }

.catalog-row .c-files {
  display: flex;
  min-width: 0;
  justify-content: flex-end;
  padding-left: 12px;
  color: var(--m-amber-deep);
  font: 10px/16px var(--mono);
  text-align: right;
}

.catalog-row .c-files span {
  color: var(--m-ink-3);
}

.catalog-empty {
  padding: 46px 20px 50px;
  text-align: center;
}

.catalog-empty strong {
  display: block;
  margin-bottom: 8px;
  color: var(--m-ink);
  font-size: 15px;
  font-weight: 600;
}

.catalog-empty p {
  color: var(--m-ink-2);
  font-size: 13px;
  line-height: 20px;
}

.catalog-empty button {
  margin-top: 14px;
  padding: 9px 14px;
  border: 1px solid var(--m-hairline-strong);
  border-radius: 5px;
  background: transparent;
  color: var(--m-ink);
  font: 11px/16px var(--mono);
  cursor: pointer;
}

.catalog-empty button:hover {
  background: var(--m-rail);
}

.catalog-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
}

.catalog-count {
  color: var(--m-ink-3);
  font: 10px/16px var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.pager button {
  min-width: 32px;
  min-height: 32px;
  padding: 6px 9px;
  border: 1px solid var(--m-hairline-strong);
  border-radius: 4px;
  background: var(--m-raised);
  color: var(--m-ink-2);
  font: 11px/18px var(--mono);
  cursor: pointer;
}

.pager button:hover:not(:disabled) {
  background: var(--m-rail);
  color: var(--m-ink);
}

.pager button[aria-current="page"] {
  border-color: var(--m-amber);
  background: var(--m-amber);
  color: var(--m-on-amber);
  font-weight: 600;
}

.pager button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.pager .gap {
  padding: 0 2px;
  color: var(--m-ink-3);
  font: 11px/18px var(--mono);
}

/* -------------------------- measured benchmarks -------------------------- */

.bench-section {
  padding: 56px 0 60px;
  background: var(--m-raised);
}

.bench-wrap {
  margin-top: 22px;
  overflow-x: auto;
  border: 1px solid var(--m-hairline);
  border-radius: 6px;
  scrollbar-width: thin;
}

.bench-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.bench-table th {
  padding: 12px 16px;
  border-bottom: 1px solid var(--m-hairline);
  background: var(--m-rail);
  color: var(--m-ink-3);
  font: 10px/14px var(--mono);
  font-weight: 400;
  letter-spacing: .06em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.bench-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--m-hairline);
  color: var(--m-ink-2);
  font: 12px/18px var(--mono);
}

.bench-table tbody tr:last-child td {
  border-bottom: 0;
}

.bench-table tbody tr:hover {
  background: var(--m-canvas);
}

.bench-table td:first-child {
  white-space: nowrap;
}

.bench-table td a {
  color: var(--m-ink);
  font-weight: 600;
}

.bench-table td a:hover {
  color: var(--m-amber-deep);
}

.bench-table td b {
  color: var(--m-ink);
}

.method-note {
  margin-top: 14px;
  color: var(--m-ink-3);
  font-size: 12px;
  line-height: 19px;
}

/* --------------------------- direct downloads --------------------------- */

.direct-section {
  padding: 60px 0 64px;
  background: var(--m-canvas);
}

.direct-grid {
  display: grid;
  grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
  gap: 60px;
  align-items: start;
}

.direct-copy h2 {
  margin-top: 16px;
  font-size: 32px;
  font-weight: 700;
  line-height: 38px;
  letter-spacing: -.01em;
}

.direct-copy p {
  margin-top: 16px;
  color: var(--m-ink-2);
  font-size: 14px;
  line-height: 22px;
}

.direct-steps {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.direct-step {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.direct-step > span {
  color: var(--m-ink-2);
  font: 10px/14px var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.direct-link {
  color: var(--m-amber-deep);
  font-size: 13px;
  line-height: 20px;
}

.next-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 26px;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--m-hairline);
}

.next-links a {
  color: var(--m-amber-deep);
  font-size: 13px;
  font-weight: 600;
  line-height: 20px;
}

/* -------------------------------- footer -------------------------------- */

.models-page footer {
  margin-top: 0;
  border-top: 0;
  background: #0e1116;
}

.models-page footer .footer-logo img {
  filter: invert(1) brightness(1.8);
}

.models-page footer .foot-links a {
  color: #a8adb5;
}

.models-page footer .foot-links a:hover {
  color: #f4f3f1;
}

.models-page footer .foot-bottom {
  border-color: #272b31;
  color: #7f858e;
}

/* Copy toast */
.copy-status {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 100;
  padding: 9px 12px;
  border: 1px solid #454b54;
  border-radius: 5px;
  background: #17191d;
  color: #f4f3f1;
  font: 12px/16px var(--mono);
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity .16s ease, transform .16s ease;
}

.copy-status.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ------------------------------ responsive ------------------------------ */

@media (max-width: 1080px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 340px);
    gap: 40px;
  }

  .hero-copy h1 {
    font-size: 44px;
    line-height: 50px;
  }

  .ram-section .centred-head h2,
  .families-section .centred-head h2 {
    font-size: 40px;
    line-height: 48px;
  }

  .ram-result {
    gap: 40px;
  }

  .ram-card {
    padding: 34px;
  }

  .ram-card h3 {
    font-size: 36px;
    line-height: 42px;
  }

  /* Shorter tier rows keep the table close to the card's natural height,
     so the stretched card doesn't open a large dead band. */
  .ram-compare td {
    padding: 16px 12px;
  }

  .family-head {
    grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
    gap: 14px 40px;
  }

  .family-row {
    grid-template-columns: minmax(0, 1fr) 130px minmax(0, 330px);
    gap: 12px 28px;
  }

  .catalog-headrow,
  .catalog-row {
    grid-template-columns: minmax(0, 1fr) 118px 104px 62px minmax(0, 268px);
  }

  .catalog-headrow .c-files,
  .catalog-row .c-files {
    display: none;
  }

  .catalog-row .c-alias .repo::after {
    content: attr(data-files);
    display: block;
    margin-top: 3px;
    color: var(--m-amber-deep);
  }
}

@media (max-width: 920px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 48px 0 36px;
  }

  .mirror-status {
    max-width: 460px;
  }

  .ram-section,
  .families-section {
    padding: 76px 0 84px;
  }

  .ram-section .centred-head h2,
  .families-section .centred-head h2 {
    font-size: 36px;
    line-height: 44px;
  }

  .ram-section .centred-head > p,
  .families-section .centred-head > p {
    font-size: 16px;
    line-height: 26px;
  }

  .ram-result {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .ram-card h3 {
    font-size: 32px;
    line-height: 39px;
  }

  .ram-card .ram-note {
    font-size: 16px;
    line-height: 25px;
  }

  .ram-metrics .v {
    font-size: 20px;
    line-height: 26px;
  }

  .ram-compare td {
    padding: 17px 12px;
  }

  .ram-compare .c-model {
    font-size: 16px;
  }

  /* Expand all no longer competes with the tabs for the measure — give the
     tabs the full width so seven of them fold into two rows, not three. */
  .family-bar {
    flex-wrap: wrap;
  }

  .family-tabs {
    flex: 1 1 100%;
  }

  .expand-all {
    margin-left: auto;
  }

  .family-head {
    grid-template-columns: 1fr;
    grid-template-areas:
      "name"
      "tag"
      "intro";
    gap: 14px;
    padding-top: 44px;
  }

  .family-head h3 {
    font-size: 30px;
    line-height: 38px;
  }

  /* Two lanes: name + metrics on one line, then description, then command. */
  .family-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "alias size"
      "blurb blurb"
      "cmd   cmd";
    gap: 16px 24px;
    min-height: 0;
    padding: 28px 0;
  }

  .family-row .alias {
    font-size: 20px;
    line-height: 27px;
  }

  .family-row .r-size {
    align-items: flex-end;
    text-align: right;
  }

  .family-row .blurb {
    max-width: none;
  }

  .models-inner:has(#expandAll[aria-pressed="true"]) .family-row .alias {
    font-size: 19px;
    line-height: 26px;
  }

  .direct-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .proof-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .proof-strip > div {
    border-bottom: 1px solid var(--m-hairline);
  }

  .proof-strip > div:nth-child(2n) {
    border-right: 0;
  }

  .proof-strip > div:nth-child(3) {
    padding-left: 0;
  }

  .proof-strip > div:nth-last-child(-n+2) {
    border-bottom: 0;
  }
}

@media (max-width: 760px) {
  .models-inner {
    width: min(100% - 36px, 1180px);
  }

  .models-page .nav-links {
    gap: 14px;
  }

  .models-page .nav-links > a:not(.nav-gh) {
    display: none;
  }

  .models-page .nav-gh {
    padding: 7px 10px;
  }

  .hero-copy h1 {
    font-size: 36px;
    line-height: 42px;
  }

  .centred-head h2 {
    font-size: 27px;
    line-height: 33px;
  }

  /* A viewport-height floor on a phone just manufactures empty space —
     let both picker sections size to their content instead. */
  .ram-section,
  .families-section {
    display: block;
    min-height: 0;
    padding: 56px 0 60px;
  }

  .ram-section .centred-head,
  .families-section .centred-head {
    gap: 14px;
  }

  .ram-section .centred-head h2,
  .families-section .centred-head h2 {
    font-size: 30px;
    line-height: 37px;
  }

  .ram-section .centred-head > p,
  .families-section .centred-head > p {
    font-size: 15px;
    line-height: 24px;
  }

  /* Seven RAM tiers can't hold a readable label in a 7-up grid on a phone;
     become a horizontally scrollable strip with real tap targets. */
  .ram-tabs {
    display: flex;
    overflow-x: auto;
    margin-top: 30px;
    gap: 5px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .ram-tabs::-webkit-scrollbar {
    display: none;
  }

  .ram-tab {
    flex: 0 0 auto;
    min-width: 88px;
    min-height: 50px;
    font-size: 14px;
  }

  .ram-result {
    margin-top: 30px;
  }

  .ram-card {
    padding: 26px 22px;
    gap: 20px;
  }

  .ram-card h3 {
    font-size: 26px;
    line-height: 33px;
  }

  .ram-metrics {
    padding-top: 22px;
    gap: 20px;
  }

  .ram-foot {
    margin-top: 28px;
  }

  .family-bar {
    margin-top: 30px;
  }

  .family-head {
    padding: 36px 0 16px;
  }

  .family-head h3 {
    font-size: 27px;
    line-height: 34px;
  }

  .family-row {
    padding: 26px 0;
  }

  .family-row .alias {
    font-size: 19px;
    line-height: 26px;
  }

  .family-bar {
    align-items: stretch;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 12px;
  }

  /* Undo the 920px two-row split — in a column bar an auto left margin and
     a 100% flex-basis push the button outside the viewport. */
  .family-tabs {
    flex: 0 1 auto;
  }

  .expand-all {
    margin-left: 0;
  }

  .family-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .family-tabs::-webkit-scrollbar {
    display: none;
  }

  .family-tab {
    flex: 0 0 auto;
  }

  .expand-all {
    justify-content: center;
  }

  .family-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 14px;
    padding: 16px 0;
  }

  .family-row .blurb {
    grid-column: 1 / -1;
    padding-right: 0;
  }

  .family-row .r-size {
    align-items: flex-end;
    text-align: right;
  }

  .catalog-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .segmented,
  .catalog-sort {
    justify-content: space-between;
  }

  .catalog-sort select {
    flex: 1 1 auto;
  }

  /* Catalog rows become stacked records rather than fragmented columns. */
  .catalog-headrow {
    display: none;
  }

  .catalog-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 12px;
    padding: 16px 14px;
  }

  .catalog-row .c-status {
    justify-content: flex-end;
  }

  /* Size and intelligence share one line of the stacked record. The header
     row is hidden at this width, so the index carries its own label. */
  .catalog-row .c-size {
    grid-column: 1;
  }

  .catalog-row .c-iq {
    grid-column: 2;
    justify-self: end;
  }

  .catalog-row .c-iq::before {
    content: "AA ";
    color: var(--m-ink-3);
  }

  .catalog-row .cmd {
    grid-column: 1 / -1;
  }

  .direct-copy h2 {
    font-size: 27px;
    line-height: 33px;
  }
}

@media (max-width: 560px) {
  .models-inner {
    width: min(100% - 28px, 1180px);
  }

  .hero-copy h1 {
    font-size: 31px;
    line-height: 37px;
  }

  .proof-strip {
    grid-template-columns: 1fr;
  }

  .proof-strip > div {
    padding-left: 0;
    padding-right: 0;
    border-right: 0;
  }

  .proof-strip > div:nth-last-child(2) {
    border-bottom: 1px solid var(--m-hairline);
  }

  .ram-metrics {
    grid-template-columns: 1fr 1fr;
    gap: 18px;
  }

  .ram-metrics div:last-child {
    grid-column: 1 / -1;
  }

  .ram-card {
    padding: 22px 18px;
  }

  .ram-compare td {
    padding: 15px 10px;
    font-size: 14px;
  }

  .ram-compare .c-model {
    font-size: 15px;
  }

  .ram-compare th {
    padding-bottom: 12px;
    font-size: 11px;
  }

  .catalog-foot {
    justify-content: center;
  }

  .copy-status {
    right: 14px;
    bottom: 14px;
    left: 14px;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .models-page *,
  .models-page *::before,
  .models-page *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
