/* talachu — typography-first, minimal, confident */

:root {
  --bg: #ffffff;
  --fg: #141414;
  --muted: #666666;
  --border: #e3e3e3;
  --accent: #141414;
  --code-bg: #f5f5f4;
  --page-max: 1400px;
  --text-max: 76ch;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0e0e;
    --fg: #ececec;
    --muted: #a0a0a0;
    --border: #2c2c2c;
    --accent: #ececec;
    --code-bg: #1a1a1a;
  }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 17px;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-top: 5.4rem;
  padding-bottom: 3.8rem;
}

/* ---- fixed header + footer ---- */

header,
footer {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

header {
  top: 0;
  border-bottom: 1px solid var(--border);
}

footer {
  bottom: 0;
  border-top: 1px solid var(--border);
}

header .bar,
footer .bar {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 1.15rem 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

footer .bar {
  padding: 0.8rem 3rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.logo-img {
  height: 36px;
  width: auto;
  display: block;
}

@media (prefers-color-scheme: dark) {
  .logo-img {
    filter: invert(1);
  }
}

.wrap {
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 1.5rem 3rem 3rem;
  flex: 1;
}

/* ---- header / nav ---- */

nav.small {
  display: flex;
  gap: 2.5rem;
}

nav.small a {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  padding: 0.25rem 0;
}

nav.small a:hover {
  color: var(--fg);
}

/* ---- home: the debate (two columns, full width) ---- */

.debate {
  display: grid;
  grid-template-columns: 5fr 6fr;
  gap: 6.5rem;
  align-items: start;
  padding-top: 2rem;
}

.case .hero-title {
  font-size: clamp(2.6rem, 4.2vw, 3.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.06;
  margin-bottom: 1rem;
}

.hero-title {
  margin-bottom: 1.25rem;
}

.hero-title br {
  display: block;
}

.case .hero-sub {
  font-size: clamp(1.2rem, 1.9vw, 1.45rem);
  font-weight: 550;
  color: var(--muted);
  margin-bottom: 3rem;
  max-width: 44ch;
}

.claims {
  list-style: none;
  margin: 0;
  border-top: 2px solid var(--fg);
}

.claims li {
  padding: 1.35rem 0.25rem;
  border-bottom: 1px solid var(--border);
}

.claims strong {
  display: block;
  font-size: 1.25rem;
  font-weight: 750;
  letter-spacing: -0.01em;
  margin-bottom: 0.25rem;
}

.claims span {
  font-size: 1.02rem;
  color: var(--muted);
  max-width: 46ch;
}

.proof {
  position: sticky;
  top: 8rem;
  padding-top: 3.5rem;
  max-width: 36rem;
}

.proof .calc {
  margin: 0;
  max-width: none;
  background: color-mix(in srgb, var(--code-bg) 45%, transparent);
}

.proof-link {
  margin-top: 1.25rem;
  font-size: 0.98rem;
  color: var(--muted);
}

.proof-link a {
  color: var(--fg);
  font-weight: 550;
}

.calc-question {
  font-size: 1.2rem;
  font-weight: 750;
  letter-spacing: -0.01em;
  margin-bottom: 1.1rem;
}

.calc-question span {
  display: block;
  font-size: 1rem;
  font-weight: 500;
  color: var(--muted);
  margin-top: 0.2rem;
}

/* ---- article / page content ---- */

.page-head {
  padding-top: 1.5rem;
  margin-bottom: 3rem;
  max-width: var(--text-max);
}

.page-title {
  font-size: clamp(2.2rem, 4.5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin-bottom: 0.6rem;
}

.page-sub {
  color: var(--muted);
  font-size: 1.1rem;
}

main h2 {
  font-size: 1.55rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  margin: 3rem 0 1rem;
}

main h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 2rem 0 0.75rem;
}

main p {
  max-width: var(--text-max);
  font-size: 1.05rem;
  margin-bottom: 1.15rem;
}

main ul {
  max-width: var(--text-max);
  margin: 0 0 1.25rem 1.4rem;
}

main li {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}

main li strong {
  font-weight: 700;
}

main a {
  color: var(--fg);
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 3px;
}

main a:hover {
  text-decoration-color: var(--fg);
}

code {
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85em;
  background: var(--code-bg);
  padding: 0.15em 0.45em;
  border-radius: 5px;
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.1rem 1.3rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

pre code {
  background: none;
  padding: 0;
  font-size: 0.9rem;
  line-height: 1.65;
}

/* ---- model card ---- */

.specs {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.55rem 2rem;
  margin: 1.75rem 0;
  font-size: 1rem;
}

.specs dt {
  color: var(--muted);
}

.specs dd {
  margin: 0;
  font-weight: 550;
}

/* benchmark tables are the same object as the memory table, one column over */
.memory-table,
.bench-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
  margin: 1.5rem 0;
}

.memory-table th,
.memory-table td,
.bench-table th,
.bench-table td {
  text-align: left;
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid var(--border);
}

.memory-table th,
.bench-table th {
  color: var(--muted);
  font-weight: 550;
  font-size: 0.9rem;
}

.memory-table td:last-child,
.memory-table th:last-child,
.bench-table td:last-child,
.bench-table th:last-child {
  text-align: right;
}

.job-list {
  margin-bottom: 1.75rem;
}

/* ---- interactive memory calculator ---- */

.calc {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem 2.4rem;
  margin: 2rem 0;
  max-width: 56rem;
}

.calc-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.7rem;
}

.calc-row {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.calc-note {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 2rem;
}

/* ---- footer ---- */
/* see fixed header/footer styles at top */

footer .bar a {
  color: var(--muted);
  text-decoration: none;
}

footer .bar a:hover {
  color: var(--fg);
}

/* ---- master-detail: model pages + blog ---- */

.detail {
  display: grid;
  grid-template-columns: 17rem minmax(0, 1fr);
  gap: 5rem;
  align-items: start;
  padding-top: 0.5rem;
}

.rail {
  position: sticky;
  top: 8rem;
}

.rail-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--muted);
  margin-bottom: 0.7rem;
}

.rail-list {
  list-style: none;
  margin: 0;
  border-top: 2px solid var(--fg);
}

a.rail-item,
span.rail-item {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  padding: 0.95rem 0.25rem;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  text-decoration: none;
}

a.rail-item {
  transition: padding 140ms ease, color 140ms ease;
}

a.rail-item:hover {
  padding-left: 0.75rem;
  color: var(--fg);
}

.rail-item.active {
  color: var(--fg);
}

.rail-item .num {
  font-size: 0.8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.rail-item .rail-name {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.rail-jumps {
  display: grid;
  margin-top: 0.5rem;
}

.rail-jumps a {
  font-size: 0.95rem;
  color: var(--muted);
  text-decoration: none;
  padding: 0.4rem 0 0.4rem 0.75rem;
  border-left: 2px solid var(--border);
}

.rail-jumps a:hover {
  color: var(--fg);
}

.rail-jumps a.active {
  color: var(--fg);
  border-left-color: var(--fg);
  font-weight: 600;
}

.doc {
  min-width: 0;
}

/* shelf: models left, content middle, "on this page" far right */
.detail.shelf {
  grid-template-columns: 15rem minmax(0, 1fr) 11.5rem;
  gap: 4.5rem;
}

/* the blog no longer has a third column, so the article takes that space.
   builds/index.html still uses .detail.shelf with its own .toc column. */
.detail.shelf.two {
  grid-template-columns: 15rem minmax(0, 1fr);
}

.toc {
  position: sticky;
  top: 9.5rem;      /* clear the sticky mod-tabs (5.4rem + ~3.5rem tabs + gap) */
}

.rail-name em.rail-sub {
  display: block;
  font-style: normal;
  font-size: 0.84rem;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--muted);
  margin-top: 0.15rem;
}

.model-doc[hidden] {
  display: none;
}

/* a native #hash jump must clear the fixed header */
.model-doc {
  scroll-margin-top: 7rem;
}

.doc-kicker {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 1.1rem;
}

.doc-title {
  font-size: clamp(2.8rem, 4.5vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.02;
  margin-bottom: 1.1rem;
}

.doc-stand {
  font-size: clamp(1.2rem, 1.8vw, 1.45rem);
  font-weight: 550;
  color: var(--muted);
  line-height: 1.45;
  max-width: 52ch;
}

.doc-hf {
  font-size: 0.95rem;
  margin: -0.5rem 0 1.1rem;
}

.doc-hf a {
  color: var(--fg);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1px;
}

.doc-hf a:hover {
  border-bottom-color: var(--fg);
}

.doc-sec {
  border-top: 1px solid var(--border);
  margin-top: 2.75rem;
  padding-top: 2rem;
  scroll-margin-top: 7.5rem;
}

.doc h2 {
  margin-top: 0;
}

#post-pane {
  min-height: 40vh;
  transition: opacity 160ms ease;
}

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

@media (max-width: 1100px) {
  .detail.shelf {
    grid-template-columns: 14rem minmax(0, 1fr);
    gap: 3rem;
  }
  .toc {
    position: static;
    grid-column: 2;
    margin-top: 0.5rem;
  }
}

@media (max-width: 900px) {
  .wrap {
    padding: 1.25rem 1.5rem 2.5rem;
  }
  header .bar,
  footer .bar {
    padding: 0.9rem 1.5rem;
  }
  nav.small {
    gap: 1.25rem;
  }
  nav.small a {
    font-size: 0.9rem;
  }
  .logo-img {
    height: 26px;
  }
  body {
    padding-top: 4.4rem;
  }
  .proof {
    position: static;
    padding-top: 0;
  }
  .debate {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  .detail {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .detail.shelf {
    grid-template-columns: 1fr;
  }
  .rail {
    position: static;
  }
  .toc {
    grid-column: 1;
    margin-top: 0;
  }
  .rail-jumps {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.25rem;
  }
  .doc-title {
    font-size: clamp(2.2rem, 8vw, 2.8rem);
  }
  .card,
  .calc {
    padding: 1.5rem 1.4rem;
  }
}

/* ---- calculator v2: real inference memory ---- */

.calc select {
  font: inherit;
  font-size: 0.95rem;
  font-weight: 550;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
}

.calc select:hover {
  border-color: var(--muted);
}

.calc-out {
  margin-top: 1.25rem;
}

.out-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.45rem 0;
  border-bottom: 1px dashed var(--border);
  font-size: 1rem;
}

.out-line span {
  color: var(--muted);
  font-weight: 550;
}

.out-line b {
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.out-line.total {
  border-bottom: none;
  padding-top: 0.75rem;
}

.out-line.total span {
  color: var(--fg);
  font-weight: 700;
}

.out-line.total b {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.calc-fit {
  font-weight: 700;
  font-size: 1.05rem;
  margin: 0.75rem 0 0.75rem;
}

.calc-fit.ok { color: #2e7d4f; }
.calc-fit.bad { color: #c0392b; }

@media (prefers-color-scheme: dark) {
  .calc-fit.ok { color: #6fcf97; }
  .calc-fit.bad { color: #e07060; }
}

/* ---- the one hard number at the top of a model guide ---- */

.doc-facts {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
}

/* ---- models hub ---- */

/* ---- about ---- */

.about {
  margin-top: 3rem;
  max-width: 62ch;
  display: grid;
  gap: 1.25rem;
  font-size: 1.15rem;
}

.about-built {
  margin-top: 1.5rem;
  font-size: 1.02rem;
  color: var(--muted);
}

.about-built a {
  color: var(--fg);
  font-weight: 600;
}

/* ---- models page: modality rail, shelf slider, spec sheet ---- */

/* three zones: sticky modality rail, the stage (slider + sheet), on this page */
.detail.models {
  grid-template-columns: 15.5rem minmax(0, 1fr) 10.5rem;
  gap: 0 4.5rem;
  align-items: start;
}

.models-stage {
  min-width: 0;
}

/* for content that must exist but must not be seen (the page h1 lives here) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---- left rail: the modality switch + the promise ---- */

.models-rail {
  position: sticky;
  top: 7rem;
}

/* the modality switch: five numbered rows, the open one inverted */
.mod-tabs {
  display: grid;
  border-top: 2px solid var(--fg);
}

.mod-tab {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.6rem 0.55rem 0.65rem 0.5rem;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--muted);
  transition: color 140ms ease, padding 140ms ease,
    background-color 140ms ease;
}

.mod-tab:hover {
  color: var(--fg);
  padding-left: 0.85rem;
}

.mod-tab.active {
  background: var(--fg);
  border-bottom-color: var(--fg);
  color: var(--bg);
  padding-left: 0.85rem;
}

.mod-tab .num {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.mod-tab.active .num {
  color: color-mix(in srgb, var(--bg) 65%, var(--fg));
}

.mod-tab .tab-name {
  font-size: 0.98rem;
  font-weight: 750;
  letter-spacing: -0.015em;
}

.mod-tab .tab-count {
  margin-left: auto;
  font-size: 0.74rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.mod-tab.active .tab-count {
  color: color-mix(in srgb, var(--bg) 65%, var(--fg));
}

/* the promise lives under the switch, at the foot of the rail */
.promise {
  margin-top: 2rem;
  padding-top: 1.1rem;
  border-top: 1px dashed var(--border);
  font-size: 0.85rem;
  line-height: 1.65;
  color: var(--muted);
}

.promise::before {
  content: "";
  display: block;
  width: 0.55rem;
  height: 0.55rem;
  background: var(--fg);
  margin-bottom: 0.7rem;
}

/* ---- the shelf slider: six cards in a row, smallest first ---- */

.mod-shelf {
  margin-bottom: 2.5rem;
}

.mod-list {
  border-top: 2px solid var(--fg);
}

.mod-list[hidden] {
  display: none;
}

.shelf-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.3rem 1.5rem;
  padding: 0.75rem 0.1rem 0.9rem;
}

.shelf-head .rail-label {
  margin: 0;
  font-size: 0.82rem;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 550;
  color: var(--muted);
  line-height: 1.5;
}

.shelf-range {
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--fg);
}

/* the track is the scroller: the description stays put, the cards slide */
.shelf-track {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding-bottom: 0.5rem;
  scrollbar-width: none;
}

.shelf-track::-webkit-scrollbar {
  display: none;
}

.shelf-card {
  flex: 0 0 13.5rem;
  scroll-snap-align: start;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
  align-content: start;
  padding: 0.95rem 1rem 1.05rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  text-decoration: none;
  transition: border-color 140ms ease, transform 140ms ease,
    box-shadow 140ms ease, background-color 140ms ease;
}

.shelf-card:hover {
  border-color: var(--muted);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px -8px color-mix(in srgb, var(--fg) 18%, transparent);
}

/* the picked model flips to solid — it reads as the one in the window */
.shelf-card.active {
  background: var(--fg);
  border-color: var(--fg);
  box-shadow: 0 4px 16px -4px color-mix(in srgb, var(--fg) 35%, transparent);
}

/* the weight sits top right, across from the name */
.shelf-card .sc-wt {
  grid-row: 1;
  grid-column: 2;
  align-self: baseline;
  font-size: 0.8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.shelf-card.active .sc-wt {
  color: color-mix(in srgb, var(--bg) 72%, var(--fg));
}

.shelf-card .rail-name {
  grid-row: 1;
  grid-column: 1;
  font-size: 1rem;
  font-weight: 750;
  letter-spacing: -0.015em;
  line-height: 1.25;
  /* a long single-word name must wrap inside its column, never run under the
     weight in the next column */
  overflow-wrap: anywhere;
  color: var(--fg);
}

.shelf-card.active .rail-name {
  color: var(--bg);
}

.shelf-card .rail-sub {
  display: block;
  font-style: normal;
  font-size: 0.78rem;
  font-weight: 550;
  letter-spacing: 0;
  margin-top: 0.15rem;
  color: var(--muted);
}

.shelf-card.active .rail-sub {
  color: color-mix(in srgb, var(--bg) 72%, var(--fg));
}

/* the bar is this model's weight against the heaviest on its shelf */
.shelf-card .sc-bar {
  grid-row: 2;
  grid-column: 1 / -1;
  display: block;
  height: 4px;
  border-radius: 999px;
  overflow: hidden;
  background: color-mix(in srgb, var(--fg) 10%, transparent);
}

.shelf-card.active .sc-bar {
  background: color-mix(in srgb, var(--bg) 25%, transparent);
}

.shelf-card .sc-bar i {
  display: block;
  height: 100%;
  width: var(--w, 0%);
  background: var(--fg);
  border-radius: 999px;
  transform-origin: left;
}

.shelf-card.active .sc-bar i {
  background: var(--bg);
}

/* bars sweep in every time a shelf is shown */
.mod-list:not([hidden]) .sc-bar i {
  animation: sc-grow 550ms cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
}

.mod-list:not([hidden]) .shelf-card:nth-child(3) .sc-bar i { animation-delay: 50ms; }
.mod-list:not([hidden]) .shelf-card:nth-child(4) .sc-bar i { animation-delay: 100ms; }
.mod-list:not([hidden]) .shelf-card:nth-child(5) .sc-bar i { animation-delay: 150ms; }
.mod-list:not([hidden]) .shelf-card:nth-child(6) .sc-bar i { animation-delay: 200ms; }
.mod-list:not([hidden]) .shelf-card:nth-child(7) .sc-bar i { animation-delay: 250ms; }
.mod-list:not([hidden]) .shelf-card:nth-child(8) .sc-bar i { animation-delay: 300ms; }

@keyframes sc-grow {
  from { transform: scaleX(0); }
}

/* ---- the spec sheet ---- */

.doc-kicker {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 1rem;
}

.doc-title {
  font-size: clamp(2.9rem, 5vw, 4.4rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.0;
  margin-bottom: 1rem;
}

.doc-stand {
  font-size: clamp(1.15rem, 1.7vw, 1.35rem);
  font-weight: 550;
  color: var(--muted);
  line-height: 1.5;
  max-width: 52ch;
}

/* meta row: the facts pill and the Hugging Face button, side by side */
.doc-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1.1rem;
  margin: 1.5rem 0 0;
}

.doc-meta .doc-hf,
.doc-meta .doc-facts {
  margin: 0;
}

.doc-hf a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  font-weight: 650;
  color: var(--fg);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.45rem 1.05rem;
  transition: border-color 140ms ease, background-color 140ms ease;
}

.doc-hf a::after {
  content: "\2197";
  font-weight: 700;
  font-size: 0.95em;
}

.doc-hf a:hover {
  border-color: var(--fg);
  background: color-mix(in srgb, var(--fg) 4%, transparent);
}

.doc-facts {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  border: none;
  border-radius: 0;
  padding: 0.45rem 0.15rem;
}

/* specs become a hairline grid of stat tiles */
.specs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  margin: 1.9rem 0;
  max-width: 56rem;
}

.specs > dt,
.spec-tile {
  background: var(--bg);
  padding: 0.85rem 1rem 0.95rem;
}

.specs > dt,
.spec-tile dt {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 0;
}

.specs > dd,
.spec-tile dd {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--fg);
  margin: 0.25rem 0 0;
}

/* guides are one document now — no section tabs */

/* the panel needs air under the standfirst, where the tabs used to sit */
.doc-panel {
  margin-top: 2.4rem;
}

.doc-panel > .doc-sec:first-child {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

.bench-note {
  font-size: 0.95rem;
  color: var(--muted);
  max-width: 62ch;
  line-height: 1.6;
}

/* tighter section rhythm inside the guide */
.doc-sec {
  position: relative;
  margin-top: 2.5rem;
  padding-top: 2.25rem;
  border-top: 1px solid var(--border);
}

.doc-sec:first-of-type {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

.doc-sec h2 {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
  color: var(--fg);
}

.doc-sec p {
  margin-bottom: 1rem;
  line-height: 1.75;
}

.job-list {
  margin: 1.25rem 0 1rem;
  padding-left: 1.5rem;
}

.job-list li {
  margin-bottom: 0.6rem;
  line-height: 1.65;
}

/* memory + benchmark tables: quiet headers, right-set numbers */
.memory-table,
.bench-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.98rem;
  margin: 1.5rem 0;
  max-width: 42rem;
}

.memory-table th,
.memory-table td,
.bench-table th,
.bench-table td {
  text-align: left;
  padding: 0.6rem 0.9rem 0.6rem 0;
  border-bottom: 1px solid var(--border);
}

.memory-table th,
.bench-table th {
  color: var(--muted);
  font-weight: 650;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.memory-table td:last-child,
.memory-table th:last-child,
.bench-table td:last-child,
.bench-table th:last-child {
  text-align: right;
  padding-right: 0;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.memory-table td:nth-child(2) {
  color: var(--muted);
  font-size: 0.92rem;
}

/* copy button on every quickstart block */
.copy-btn {
  position: absolute;
  top: 2.3rem;
  right: 0;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  cursor: pointer;
  transition: color 140ms ease, border-color 140ms ease;
}

.copy-btn:hover {
  color: var(--fg);
  border-color: var(--fg);
}

.copy-btn.ok {
  color: var(--bg);
  background: var(--fg);
  border-color: var(--fg);
}

.doc-sec:first-of-type .copy-btn {
  top: 0;
}

/* walk the shelf from the bottom of the guide: two cards */
.doc-step {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  border-top: none;
  margin-top: 3.25rem;
  padding-top: 0;
}

.doc-step a,
.doc-step span {
  display: block;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.25rem 1.15rem;
  max-width: none;
  text-decoration: none;
  color: var(--muted);
  transition: border-color 140ms ease, background-color 140ms ease;
}

.doc-step a:hover {
  border-color: var(--fg);
  background: color-mix(in srgb, var(--fg) 3%, transparent);
}

.doc-step .step-dir {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
  color: var(--muted);
}

.doc-step .step-name {
  display: block;
  font-size: 1.08rem;
  font-weight: 750;
  letter-spacing: -0.015em;
  color: var(--fg);
  line-height: 1.3;
}

.doc-step > :last-child {
  text-align: right;
}

/* ---- right: on this page ---- */

.detail.models .toc {
  position: sticky;
  top: 7rem;
}

.detail.models .rail-jumps {
  display: grid;
  margin-top: 0;
  border-top: 2px solid var(--fg);
}

.detail.models .rail-jumps a {
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: none;
  padding: 0.42rem 0 0.42rem 0.85rem;
  border-left: 2px solid transparent;
  transition: color 140ms ease, border-color 140ms ease;
}

.detail.models .rail-jumps a:hover {
  color: var(--fg);
}

.detail.models .rail-jumps a.active {
  color: var(--fg);
  border-left-color: var(--fg);
  font-weight: 650;
}

/* the pane breathes when a new guide slides in */
#post-pane.swap {
  animation: pane-in 240ms ease;
}

@keyframes pane-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* ---- responsive: the rail folds away as you go down ---- */

@media (max-width: 1280px) {
  .detail.models {
    grid-template-columns: 15rem minmax(0, 1fr);
    gap: 0 3.5rem;
  }
  .detail.models .toc {
    display: none;
  }
}

@media (max-width: 980px) {
  .detail.models {
    grid-template-columns: minmax(0, 1fr);
  }
  .models-rail {
    position: static;
  }
  /* modality becomes a row of pills */
  .mod-tabs {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    gap: 0.4rem;
    border-top: none;
    padding-bottom: 0.25rem;
  }
  .mod-tabs::-webkit-scrollbar {
    display: none;
  }
  .mod-tab {
    flex: 0 0 auto;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.4rem 0.95rem 0.45rem;
    white-space: nowrap;
  }
  .mod-tab:hover {
    padding-left: 0.95rem;
  }
  .mod-tab.active {
    border-color: var(--fg);
    padding-left: 0.95rem;
  }
  .promise {
    margin-top: 1.5rem;
  }
  .mod-shelf {
    margin-bottom: 2rem;
  }
  .shelf-card {
    flex-basis: 12.5rem;
  }
  .shelf-track {
    gap: 0.5rem;
  }
  .doc-step {
    grid-template-columns: 1fr;
  }
  .doc-step > :last-child {
    text-align: left;
  }
  .specs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .copy-btn {
    position: static;
    margin: -0.4rem 0 0.7rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
/* ---- builds: architecture diagram ---- */

.pipe {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem 1.6rem;
  margin: 1.5rem 0;
}

.pipe-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

.pipe-label:not(:first-child) {
  margin-top: 1.5rem;
}

.pipe-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.pipe-box {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.85rem;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.3;
}

.pipe-arrow {
  color: var(--muted);
  font-weight: 700;
}

@media (max-width: 900px) {
  .pipe {
    padding: 1.25rem 1.2rem;
  }
}

.pipe-flow {
  align-items: flex-start;
}

.pipe-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  text-align: center;
  max-width: 12rem;
}

.pipe-cap {
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--muted);
}

.pipe-flow .pipe-arrow {
  padding-top: 0.85rem;
}

.pipe-return {
  margin: 1rem 0 0;
  padding-top: 0.7rem;
  border-top: 1px dashed var(--border);
  text-align: center;
  font-size: 0.88rem;
  color: var(--muted);
}

/* ---- builds: signal box (build identity) ---- */

.sig {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 0.9rem 0;
  margin: 1.6rem 0 2rem;
  display: grid;
  gap: 0.45rem;
}

.sig-row {
  display: flex;
  gap: 1.25rem;
  align-items: baseline;
  font-size: 0.98rem;
}

.sig-row span {
  color: var(--muted);
  font-weight: 550;
  flex-shrink: 0;
  width: 6.5rem;
}

.sig-row b {
  font-weight: 650;
  letter-spacing: -0.01em;
}

/* ---- numbered stages in the diagram ---- */

.pipe-num {
  font-size: 0.72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.pipe-stage .pipe-num {
  order: -1;
}

.pipe-stage {
  gap: 0.3rem;
}

.pipe-stage .pipe-box {
  padding: 0.55rem 0.95rem;
}

@media (max-width: 900px) {
  .sig-row {
    flex-direction: column;
    gap: 0.1rem;
  }
  .sig-row span {
    width: auto;
  }
}

/* ---- builds: timing diagram (overlap) ---- */

.time-grid {
  display: grid;
  grid-template-columns: 4.5rem 1fr auto;
  gap: 0.55rem 1rem;
  align-items: center;
}

.time-name {
  font-size: 0.85rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  text-align: right;
}

.time-bar {
  height: 14px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--fg) 22%, transparent);
  width: var(--w);
  margin-left: var(--d, 0%);
  min-width: 6px;
}

.time-bar-mark {
  background: var(--fg);
}

.time-ms {
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
}

/* ---- builds: loop marker in the diagram ---- */

.pipe-loop {
  margin: 1rem 0 0;
  padding-top: 0.7rem;
  border-top: 1px dashed var(--border);
  text-align: center;
  font-size: 0.88rem;
  color: var(--muted);
}

.pipe-loop-arrow {
  font-size: 1.05rem;
  font-weight: 700;
  margin-right: 0.4rem;
  color: var(--fg);
}

.pipe + .pipe {
  margin-top: 1.25rem;
}

/* ---- focus + skip link (keyboard and screen-reader access) ---- */

:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 3px;
  border-radius: 3px;
}

.skip {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  z-index: 200;
  background: var(--fg);
  color: var(--bg);
  padding: 0.6rem 1rem;
  border-radius: 0 0 6px 6px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.15s ease;
}

.skip:focus {
  top: 0;
}

main:focus {
  outline: none;
}

/* the pane swaps whole documents, so announcing it all would be unusable —
   a short status line names the entry instead. it is for ears, not eyes:
   the model name is already the heading right below it. */
.pane-status {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.pane-status:empty {
  display: none;
}

/* ---- home: the one thing new this week ---- */

.now-band {
  border-top: 2px solid var(--fg);
  margin-top: 5rem;
  padding-top: 1.2rem;
  max-width: none;
}

.now-band a {
  display: block;
  text-decoration: none;
  margin-top: 0.9rem;
}

.now-band strong {
  display: block;
  font-size: clamp(1.6rem, 2.6vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.15;
  max-width: 30ch;
}

.now-band span {
  display: block;
  margin-top: 0.45rem;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--muted);
  max-width: 62ch;
}

.now-band a:hover strong {
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
}

/* ---- home: where to go next ---- */

.onward {
  border-top: 1px solid var(--border);
  margin-top: 3rem;
  padding-top: 1.4rem;
}

.onward-list {
  list-style: none;
  margin: 0;
  max-width: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
}

.onward-list li {
  margin: 0;
}

.onward-list a {
  display: block;
  text-decoration: none;
}

.onward-list strong {
  display: block;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.onward-list span {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--muted);
}

.onward-list a:hover strong {
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
}

@media (max-width: 900px) {
  .onward-list {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .onward {
    margin-top: 2.5rem;
  }
  .now-band {
    margin-top: 3.5rem;
  }
}

/* ---- post date line ---- */

.page-date {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 0.5rem;
}

/* ---- print: the model guides and posts are reference documents ---- */

@media print {
  :root {
    --bg: #fff;
    --fg: #000;
    --muted: #444;
    --border: #bbb;
  }

  header,
  footer,
  .skip,
  .rail,
  .toc,
  .models-rail,
  .copy-btn,
  .mod-tabs,
  .doc-tabs,
  .doc-step,
  .pane-status,
  .onward,
  .calc-row,
  .calc-out,
  .calc-fit,
  .out-tok,
  #out-tok,
  #calc-math {
    display: none !important;
  }

  /* the spec sheet gets the full width */
  .detail.models {
    display: block;
  }

  body {
    padding: 0;
    color: #000;
    background: #fff;
    font-size: 11pt;
  }

  .wrap {
    max-width: none;
    padding: 0;
  }

  main p,
  main li {
    max-width: none;
    font-size: 11pt;
  }

  /* hidden guides and lists become printable pages */
  .model-doc[hidden],
  .mod-list[hidden],
  .doc-panel[hidden] {
    display: block !important;
  }

  .model-doc[hidden] {
    break-before: page;
  }

  .doc-sec {
    break-inside: avoid;
    margin-top: 1.5rem;
  }

  a {
    color: #000;
    text-decoration: none;
  }

  /* show where a link points, since a printed page cannot be clicked */
  main a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 8.5pt;
    color: #555;
    word-break: break-all;
  }

  pre {
    border: 1px solid #ccc;
    page-break-inside: avoid;
    white-space: pre-wrap;
    word-break: break-all;
  }
}

/* the timing view is a different kind of diagram — mark it as such */
.pipe-time {
  background: color-mix(in srgb, var(--fg) 3%, transparent);
}

.pipe-time .pipe-label {
  margin-top: 0;
}

/* --- measurement charts ------------------------------------------- */
.chart {
  margin: 2rem 0;
  padding: 1.25rem 1.25rem 1rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  max-width: 56rem;
}
.chart svg {
  display: block;
  width: 100%;
  height: auto;
}
.chart-cap {
  margin: 0.9rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--muted);
}
.chart-cap strong {
  color: var(--fg);
  font-weight: 650;
}
.qa-list {
  margin: 1.25rem 0;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--code-bg);
  font-size: 0.94rem;
  line-height: 1.7;
}
.qa-list dl {
  margin: 0;
  display: grid;
  grid-template-columns: 11rem 1fr;
  gap: 0.3rem 1rem;
}
.qa-list dt {
  font-weight: 650;
  color: var(--fg);
}
.qa-list dd {
  margin: 0;
  color: var(--muted);
}
@media (max-width: 640px) {
  .qa-list dl {
    grid-template-columns: 1fr;
  }
  .qa-list dd {
    margin-bottom: 0.55rem;
  }
}
.bench-wide {
  max-width: 100%;
  font-size: 0.9rem;
}
.bench-wide th,
.bench-wide td {
  padding: 0.5rem 0.55rem;
}
.bench-wide th:first-child,
.bench-wide td:first-child {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: nowrap;
}
.dim {
  color: var(--muted);
  font-weight: 400;
  font-family: inherit;
  font-size: 0.85em;
}
