/* =========================================================================
   tinymodels — design system

   One stylesheet, no framework, no build step, no network fonts. Tokens first,
   then shell, then components. Light and dark are both first-class, driven by
   prefers-color-scheme and via `color-scheme` so native controls follow.
   ========================================================================= */

:root {
  /* Both palettes live side by side and resolve against the used colour scheme,
     which `color-scheme` selects. One list, so a forced theme cannot drift. */
  color-scheme: light dark;

  --bg: light-dark(#f5f6f8, #171b22);
  --surface: light-dark(#ffffff, #20242d);
  --surface-2: light-dark(#f2f3f6, #292e38);
  --surface-3: light-dark(#e9ebef, #323945);
  --ink: light-dark(#0e1117, #e0e4ea);
  --ink-2: light-dark(#454c59, #b0b8c4);
  --muted: light-dark(#666e7c, #98a0ae);
  --line: light-dark(#e3e5ea, #333942);
  --line-2: light-dark(#d2d6de, #434a56);

  --accent: light-dark(#4f46e5, #9c8cff);
  --accent-hover: light-dark(#4338ca, #b6aaff);
  --accent-ink: light-dark(#ffffff, #14121f);
  --accent-soft: light-dark(#eceafe, #27204d);
  --accent-line: light-dark(#cfcafb, #443a80);

  /* Energy: ambient colour that sits behind the page and behind the primary
     actions. The dark palette leans into a violet glow, the light one keeps a
     whisper of the same hue so the two read as one brand. */
  --glow-1: light-dark(rgba(79, 70, 229, 0.05), rgba(124, 92, 255, 0.17));
  --glow-2: light-dark(rgba(192, 132, 252, 0.04), rgba(56, 189, 248, 0.09));
  --accent-glow: light-dark(rgba(79, 70, 229, 0.16), rgba(140, 116, 255, 0.32));
  --mark-gradient: linear-gradient(135deg, #6d5cff, #a45cff 55%, #c86bff);
  --btn-gradient: linear-gradient(135deg, #5b50f0, #7a5cf5);

  --ok: light-dark(#0d7a4f, #57d592);
  --ok-soft: light-dark(#e4f6ed, #16312a);
  --warn: light-dark(#a15c07, #eebb6b);
  --warn-soft: light-dark(#fdf2e0, #332a19);

  --topbar-bg: light-dark(rgba(255, 255, 255, 0.82), rgba(28, 32, 39, 0.84));

  /* Shadows are not colours, so light-dark() cannot carry them. These three are
     the only tokens that need the media query below. */
  --shadow-1: 0 1px 2px rgba(16, 20, 30, 0.05);
  --shadow-2: 0 4px 16px -4px rgba(16, 20, 30, 0.1), 0 2px 6px -2px rgba(16, 20, 30, 0.06);
  --shadow-3: 0 12px 32px -8px rgba(16, 20, 30, 0.16), 0 4px 10px -4px rgba(16, 20, 30, 0.08);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;

  --font: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter,
    "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --shell: 1200px;
  --header-h: 3.75rem;
}

/* TINYMODELS_THEME pins the appearance instead of following the operating system. */
:root[data-theme="light"] {
  color-scheme: light;
}
:root[data-theme="dark"] {
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-2: 0 4px 16px -4px rgba(0, 0, 0, 0.38), 0 2px 6px -2px rgba(0, 0, 0, 0.3);
    --shadow-3: 0 12px 32px -8px rgba(0, 0, 0, 0.46), 0 4px 10px -4px rgba(0, 0, 0, 0.34);
    --btn-gradient: linear-gradient(135deg, #7c63ff, #a05cff);
  }
}
:root[data-theme="dark"] {
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-2: 0 4px 16px -4px rgba(0, 0, 0, 0.38), 0 2px 6px -2px rgba(0, 0, 0, 0.3);
  --shadow-3: 0 12px 32px -8px rgba(0, 0, 0, 0.46), 0 4px 10px -4px rgba(0, 0, 0, 0.34);
  --btn-gradient: linear-gradient(135deg, #7c63ff, #a05cff);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  /* Ambient glows bleed from the top corners; every surface above them is
     opaque, so contrast is decided by the tokens, not by the glow. */
  background:
    radial-gradient(72rem 32rem at 88% -12%, var(--glow-2), transparent 62%),
    radial-gradient(80rem 36rem at 4% -14%, var(--glow-1), transparent 58%)
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 650;
  letter-spacing: -0.019em;
  line-height: 1.22;
  text-wrap: balance;
}

p {
  margin: 0 0 0.8rem;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 120ms ease;
}
a:hover {
  color: var(--accent-hover);
}

code,
kbd,
pre,
.mono {
  font-family: var(--mono);
  font-size: 0.875em;
  font-variant-ligatures: none;
}

svg.icon {
  flex: none;
  display: block;
}

::selection {
  background: var(--accent-soft);
  color: var(--ink);
}

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

/* ---------------------------------------------------------------- shell --- */

.shell {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.topbar {
  z-index: 50;
  background: var(--topbar-bg);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 680;
  font-size: 1.06rem;
  letter-spacing: -0.03em;
  color: var(--ink);
  white-space: nowrap;
  flex: 1 1 0;
  min-width: 0;
}
.brand:hover {
  color: var(--ink);
  text-decoration: none;
}
.brand .mark {
  display: grid;
  place-items: center;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 9px;
  background: var(--mark-gradient);
  color: #ffffff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12) inset, 0 2px 10px -2px var(--accent-glow);
}

.topsearch {
  position: relative;
  flex: 0 1 27rem;
  min-width: 0;
}
.topsearch .icon {
  position: absolute;
  left: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.topsearch input {
  width: 100%;
  height: 2.4rem;
  padding: 0 0.8rem 0 2.2rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.topsearch input::placeholder {
  color: var(--muted);
}
.topsearch input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow:
    0 0 0 3px var(--accent-soft),
    0 0 18px -4px var(--accent-glow);
}

.topnav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
  flex: 1 1 0;
  min-width: 0;
}
.topnav > a.navlink {
  color: var(--ink-2);
  font-size: 0.885rem;
  font-weight: 560;
  padding: 0.42rem 0.8rem;
  border-radius: 999px;
  border: 1px solid transparent;
}
.topnav > a.navlink:hover {
  background: var(--surface-2);
  color: var(--ink);
  text-decoration: none;
}
.topnav > a.navlink[aria-current="page"] {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent);
}

main {
  flex: 1 0 auto;
  padding: 2rem 0 4rem;
}

.pagefoot {
  border-top: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.84rem;
}
.pagefoot .shell {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  align-items: center;
  padding-top: 1.15rem;
  padding-bottom: 1.15rem;
}
.pagefoot a {
  color: var(--ink-2);
}
.pagefoot .sep {
  color: var(--line-2);
}

/* --------------------------------------------------------------- atoms --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  height: 2.4rem;
  padding: 0 0.95rem;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  font-size: 0.885rem;
  font-weight: 560;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease, box-shadow 120ms ease,
    transform 120ms ease;
}
.btn:hover {
  text-decoration: none;
}
.btn:active {
  transform: translateY(0.5px);
}

.btn-primary {
  background: var(--btn-gradient);
  color: #ffffff;
  box-shadow:
    var(--shadow-1),
    0 4px 16px -6px var(--accent-glow);
}
.btn-primary:hover {
  background: var(--btn-gradient);
  color: #ffffff;
  box-shadow:
    var(--shadow-2),
    0 6px 22px -6px var(--accent-glow);
  filter: saturate(115%) brightness(106%);
}

.btn-outline {
  background: var(--surface);
  border-color: var(--line-2);
  color: var(--ink);
}
.btn-outline:hover {
  border-color: var(--muted);
  color: var(--ink);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-2);
}
.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.btn-sm {
  height: 1.95rem;
  padding: 0 0.65rem;
  font-size: 0.82rem;
  border-radius: 8px;
}

.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.5;
  pointer-events: none;
}

/* A small quiet marker, used where a figure was measured by this hub rather than
   quoted from a publisher. */
.marker {
  display: inline-block;
  margin-right: 0.35rem;
  padding: 0.05rem 0.35rem;
  border: 1px solid var(--accent-line);
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 620;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  height: 1.6rem;
  padding: 0 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 0.775rem;
  font-weight: 530;
  white-space: nowrap;
}
.badge .icon {
  opacity: 0.85;
}
.badge-strong {
  background: var(--surface);
}

/* family tints — one declaration per family, both palettes */
.badge-text,
.tile-text {
  --fam: light-dark(#5b52e8, #aaa4ff);
  --fam-soft: light-dark(#eceafe, #262350);
  --fam-line: light-dark(#d3cffb, #3f3a78);
}
.badge-embed,
.tile-embed {
  --fam: light-dark(#0b6a80, #6fd0e8);
  --fam-soft: light-dark(#e0f3f8, #153039);
  --fam-line: light-dark(#bfe5ee, #245566);
}
.badge-vision,
.tile-vision {
  --fam: light-dark(#17795c, #63d6ab);
  --fam-soft: light-dark(#e2f5ed, #153329);
  --fam-line: light-dark(#c1e8d9, #256051);
}
.badge-video,
.tile-video {
  --fam: light-dark(#b5386a, #f58cb4);
  --fam-soft: light-dark(#fce7ef, #3a1e2c);
  --fam-line: light-dark(#f7c9db, #6a3450);
}
.badge-audio,
.tile-audio {
  --fam: light-dark(#9a6207, #e8b45e);
  --fam-soft: light-dark(#fbf0dc, #332a19);
  --fam-line: light-dark(#f0d9ac, #5c4a24);
}
.badge-other,
.tile-other {
  --fam: light-dark(#5c6472, #9aa3b2);
  --fam-soft: light-dark(#eef0f3, #242833);
  --fam-line: light-dark(#d9dde3, #3a4150);
}

.badge[class*="badge-"] {
  background: var(--fam-soft);
  border-color: var(--fam-line);
  color: var(--fam);
}

.tile {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  flex: none;
  border-radius: var(--radius);
  background: var(--fam-soft, var(--surface-2));
  border: 1px solid var(--fam-line, var(--line));
  color: var(--fam, var(--ink-2));
}
.tile-lg {
  width: 3.4rem;
  height: 3.4rem;
  border-radius: var(--radius-lg);
}

.hashchip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  max-width: 100%;
  padding: 0.25rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 0.72rem;
}
.hashchip > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hashchip:hover {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
  text-decoration: none;
}
.hashchip .icon {
  color: var(--muted);
}

.dotsep {
  color: var(--line-2);
}

.muted {
  color: var(--muted);
}
.small {
  font-size: 0.855rem;
}
.tiny {
  font-size: 0.775rem;
}
.nowrap {
  white-space: nowrap;
}
.row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
}

.notice {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  padding: 0.8rem 0.95rem;
  margin: 0 0 1.25rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 0.9rem;
}
.notice > .icon {
  margin-top: 0.15rem;
  color: var(--accent);
}
.notice.good {
  border-left-color: var(--ok);
}
.notice.good > .icon {
  color: var(--ok);
}
.notice.bad {
  border-left-color: var(--warn);
}
.notice.bad > .icon {
  color: var(--warn);
}
.notice p:last-child {
  margin-bottom: 0;
}

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

.hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.5rem;
  padding: 2.6rem 2.2rem 2.3rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(60rem 20rem at 85% -60%, var(--glow-2), transparent 60%),
    radial-gradient(90rem 26rem at 8% -40%, var(--glow-1), transparent 55%),
    var(--surface);
  box-shadow: var(--shadow-1);
}
.hero h1 {
  font-size: clamp(1.9rem, 1.15rem + 2.5vw, 2.85rem);
  margin-bottom: 0.6rem;
  letter-spacing: -0.028em;
}
/* Gradient text on the phrase that carries the promise. Large display type only,
   where the 3:1 large-text bar applies to the darkest gradient stop. */
.hero h1 .grad {
  font-style: normal;
  background: var(--mark-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.lede {
  max-width: 44rem;
  margin: 0 0 1.45rem;
  color: var(--ink-2);
  font-size: 1.01rem;
}
.hero-copy {
  min-width: 0;
}

/* A floating cluster of family tiles: pure CSS, purely decorative, the same
   five family tints the catalogue rows scan by. Staggered with --i. */
.hero-visual {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  padding: 0.4rem;
}
.hv-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  width: 6.2rem;
  height: 6.2rem;
  border: 1px solid var(--fam-line, var(--line));
  border-radius: var(--radius-lg);
  background: var(--fam-soft, var(--surface-2));
  color: var(--fam, var(--ink-2));
  box-shadow:
    var(--shadow-2),
    0 0 26px -8px color-mix(in srgb, var(--fam, transparent) 45%, transparent);
  animation: hv-float 5.5s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * -1.1s);
}
.hv-tile i {
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 620;
  letter-spacing: 0.04em;
}
.hv-tile:nth-child(even) {
  transform: translateY(0.85rem);
}
@keyframes hv-float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -0.45rem; }
}
@media (prefers-reduced-motion: reduce) {
  .hv-tile { animation: none; }
}
@media (max-width: 1080px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-visual { display: none; }
}
.hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
  padding: 0.22rem 0.6rem;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.755rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: 0 0 14px -6px var(--accent-glow);
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.stat {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0.5rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 55%, transparent), transparent),
    var(--surface);
  box-shadow: var(--shadow-1);
}
.stat b {
  color: var(--accent);
  font-size: 1.05rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.stat span {
  color: var(--muted);
  font-size: 0.8rem;
}

/* -------------------------------------------------------------- filters --- */

.filters {
  padding: 0.95rem 1rem 1rem;
  margin-bottom: 1.35rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
}
.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 0.65rem 0.7rem;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  min-width: 0;
}
.field > .label {
  color: var(--muted);
  font-size: 0.735rem;
  font-weight: 600;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}
input,
select,
textarea {
  font: inherit;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  padding: 0.42rem 0.55rem;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.filters select {
  height: 2.15rem;
  padding: 0 1.75rem 0 0.6rem;
  font-size: 0.875rem;
  font-weight: 530;
  border-radius: 9px;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow:
    0 0 0 3px var(--accent-soft),
    0 0 16px -6px var(--accent-glow);
}
select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) 51%, calc(100% - 10px) 51%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 1.9rem;
}
.filter-foot {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}
.filter-foot .count {
  color: var(--muted);
  font-size: 0.855rem;
  font-variant-numeric: tabular-nums;
}
.filter-foot .spacer {
  flex: 1;
}

/* ------------------------------------------------------------ catalogue --- */

.model-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(19.5rem, 1fr));
  gap: 0.75rem;
}

/* One card per model: what it is, what it runs on, how big it is, how fast it
   ran here, and how to get it — all on the tile. */
.model-card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-width: 0;
  padding: 1rem 1.05rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}
.model-card:hover {
  border-color: var(--accent-line);
  box-shadow:
    var(--shadow-2),
    0 0 26px -10px var(--accent-glow);
  transform: translateY(-2px);
}
.model-card > * {
  min-width: 0;
}

.card-ident {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  color: var(--ink);
}
.card-ident:hover {
  text-decoration: none;
}
.card-ident:hover .card-name {
  color: var(--accent);
}
.card-ident .fam {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 12px;
  background: var(--fam-soft, var(--surface-2));
  border: 1px solid var(--fam-line, var(--line));
  color: var(--fam, var(--ink-2));
  box-shadow: 0 0 14px -5px color-mix(in srgb, var(--fam, transparent) 55%, transparent);
  transition: box-shadow 140ms ease, transform 140ms ease;
}
.model-card:hover .card-ident .fam {
  transform: scale(1.08);
  box-shadow: 0 0 20px -5px color-mix(in srgb, var(--fam, transparent) 75%, transparent);
}
.card-titles {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.card-name {
  font-size: 0.96rem;
  font-weight: 640;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-org {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 520;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-summary {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.82rem;
  line-height: 1.45;
  /* Two lines of summary, then an ellipsis: cards stay the same height even
     when one model's card copy runs long. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.chip {
  padding: 0.16rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 0.71rem;
  font-weight: 560;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.card-meta {
  display: block;
  margin-top: -0.25rem;
  color: var(--muted);
  font-size: 0.72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-foot {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: auto;
  padding-top: 0.55rem;
  border-top: 1px solid var(--line);
}
.card-foot .row-bench {
  min-width: 0;
}
.card-foot .row-bench {
  margin-right: auto;
}
.card-dl {
  flex: none;
}

/* The one comparable figure: milliseconds for one fixed input, the same unit
   and the same meaning on every card that has one, a dash where none does. */
.row-bench {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
}
.bench-value {
  color: var(--accent);
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
a.bench-value:hover {
  color: var(--accent-hover);
}
.bench-metric {
  color: var(--muted);
  font-size: 0.71rem;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 11rem;
}

.block {
  display: block;
}

.sectionlabel {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.55rem 0.15rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.empty {
  grid-column: 1 / -1;
  padding: 2.5rem 1.25rem;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line-2);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

/* ---------------------------------------------------------- model page --- */

.crumbs {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.crumbs a {
  color: var(--ink-2);
}

.model-head {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  flex-wrap: wrap;
  padding: 1.35rem 1.5rem;
  margin-bottom: 1.5rem;
  background:
    radial-gradient(70rem 18rem at 8% -45%, var(--accent-soft), transparent 60%),
    var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
}
.model-head .ident {
  display: flex;
  gap: 0.95rem;
  align-items: flex-start;
  min-width: 0;
  flex: 1 1 26rem;
}
.model-head h1 {
  font-size: clamp(1.3rem, 1.05rem + 1vw, 1.7rem);
  overflow-wrap: anywhere;
  margin-bottom: 0.3rem;
}
.model-head .org {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 550;
  margin-bottom: 0.2rem;
}
.model-head .summary {
  margin: 0 0 0.7rem;
  color: var(--ink-2);
  font-size: 0.925rem;
  max-width: 48rem;
}
.model-head .actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
  margin-left: auto;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20rem;
  gap: 1.5rem;
  align-items: start;
}

.side {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: sticky;
  top: calc(var(--header-h) + 1.25rem);
}
.side .panel {
  padding: 1rem 1.05rem;
}
.side h2 {
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.7rem;
}

.facts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin: 0;
}
.facts > div {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 0.6rem;
  padding: 0.42rem 0;
  border-top: 1px solid var(--line);
}
.facts > div:first-child {
  border-top: 0;
  padding-top: 0;
}
.facts dt {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.8rem;
}
.facts dd {
  margin: 0;
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}
.facts dd.mono {
  font-size: 0.79rem;
}

/* the rendered model card */
.prose {
  padding: 1.5rem 1.75rem 1.9rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  overflow-wrap: break-word;
}
.prose > :first-child {
  margin-top: 0;
}
.prose h1 {
  font-size: 1.3rem;
  margin: 1.7rem 0 0.55rem;
}
.prose h2 {
  font-size: 1.08rem;
  margin: 1.8rem 0 0.5rem;
  padding-top: 1.05rem;
  border-top: 1px solid var(--line);
}
.prose h3 {
  font-size: 0.98rem;
  margin: 1.45rem 0 0.45rem;
}
.prose > .doc-section:first-child > h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.prose .doc-section > h2 {
  scroll-margin-top: calc(var(--header-h) + 1rem);
}
.prose h4 {
  font-size: 0.92rem;
  margin: 1.25rem 0 0.4rem;
}
.prose :is(h1, h2, h3, h4) a {
  color: inherit;
}
.prose :is(h1, h2, h3, h4) {
  scroll-margin-top: calc(var(--header-h) + 1rem);
}
.prose p,
.prose ul,
.prose ol,
.prose blockquote,
.prose table,
.prose pre {
  margin: 0 0 0.95rem;
}
.prose ul,
.prose ol {
  padding-left: 1.35rem;
}
.prose li {
  margin: 0.22rem 0;
}
.prose li::marker {
  color: var(--muted);
}
.prose a {
  text-decoration: underline;
  text-decoration-color: var(--accent-line);
  text-underline-offset: 2px;
}
.prose a:hover {
  text-decoration-color: currentColor;
}
.prose strong {
  font-weight: 640;
}
.prose code {
  padding: 0.12em 0.36em;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  font-size: 0.83em;
}
.prose pre {
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  overflow-x: auto;
  line-height: 1.6;
}
.prose pre code {
  padding: 0;
  border: 0;
  background: none;
  font-size: 0.82rem;
}
.prose blockquote {
  padding: 0.15rem 0 0.15rem 1rem;
  border-left: 3px solid var(--line-2);
  color: var(--ink-2);
}
.prose hr {
  height: 1px;
  border: 0;
  background: var(--line);
  margin: 1.75rem 0;
}
.prose img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.865rem;
  display: block;
  overflow-x: auto;
}
.prose th,
.prose td {
  border: 1px solid var(--line);
  padding: 0.42rem 0.6rem;
  text-align: left;
  vertical-align: top;
}
.prose th {
  background: var(--surface-2);
  font-weight: 600;
  white-space: nowrap;
}
.prose tbody tr:nth-child(even) {
  background: color-mix(in srgb, var(--surface-2) 45%, transparent);
}
.prose ul:has(input[type="checkbox"]) {
  list-style: none;
  padding-left: 0.2rem;
}
.prose input[type="checkbox"] {
  margin-right: 0.4rem;
  accent-color: var(--accent);
}

/* checksum / verify block */
.hashbox {
  display: flex;
  align-items: stretch;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}
.hashbox code {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 0.735rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.hashbox .btn {
  height: auto;
  padding: 0 0.6rem;
}

.cmd {
  margin: 0.7rem 0 0;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 0.735rem;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.linklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
  font-size: 0.85rem;
}
.linklist a {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}
.linklist a span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------------------------------------------------------------- form --- */

.upload-head {
  max-width: 52rem;
  margin-bottom: 1.5rem;
}
.upload-head h1 {
  font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2rem);
  margin-bottom: 0.5rem;
}
.upload-head p {
  color: var(--ink-2);
  margin: 0;
}

.formstack {
  display: grid;
  gap: 1.1rem;
  max-width: 52rem;
}
.formsection {
  padding: 1.25rem 1.35rem 1.4rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
}
.formsection > header {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  margin-bottom: 0.35rem;
}
.formsection > header .step {
  display: grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  flex: none;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.formsection > header h2 {
  font-size: 1.02rem;
}
.formsection > p.hint {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.855rem;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0.8rem 1rem;
}
.grid-1 {
  display: grid;
  gap: 0.8rem;
}
.field input,
.field select,
.field textarea {
  width: 100%;
}
input[type="file"] {
  width: 100%;
  padding: 1rem;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  background: var(--surface-2);
  font-size: 0.875rem;
  cursor: pointer;
}
input[type="file"]:hover {
  border-color: var(--accent);
}
input[type="file"]::file-selector-button {
  margin-right: 0.7rem;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 550;
  cursor: pointer;
}
textarea {
  width: 100%;
  min-height: 17rem;
  font-family: var(--mono);
  font-size: 0.83rem;
  line-height: 1.65;
  resize: vertical;
}
.or {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0.85rem 0;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.or::before,
.or::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}
.formactions {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------- error --- */

.errorpage {
  max-width: 44rem;
  margin: 3rem auto;
  padding: 2rem;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
}
.errorpage .tile {
  margin: 0 auto 1rem;
}
.errorpage h1 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}
.errorpage p {
  color: var(--ink-2);
}
.errorpage .code {
  display: inline-block;
  margin-bottom: 1.25rem;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
}

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

@media (max-width: 1080px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .side {
    position: static;
  }
  /* The card grid relaxes to fewer, wider cards rather than squeezing. */
  .model-grid {
    grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  }
}

@media (max-width: 860px) {
  .topsearch {
    max-width: none;
  }
}

@media (max-width: 720px) {
  .shell {
    padding: 0 1rem;
  }
  main {
    padding-top: 1.25rem;
  }
  /* Two rows: brand + nav, then the search across the full width. Search stays
     available on a phone rather than disappearing. */
  .topbar-inner {
    flex-wrap: wrap;
    height: auto;
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
    row-gap: 0.55rem;
    gap: 0.6rem;
  }
  .topsearch {
    order: 3;
    flex: 1 1 100%;
    max-width: none;
  }
  .brand,
  .topnav {
    flex: 0 0 auto;
  }
  .topnav {
    margin-left: auto;
  }
  .topnav > a.navlink:not(.btn) {
    display: none;
  }
  .prose :is(h1, h2, h3, h4) {
    scroll-margin-top: 7.5rem;
  }
  .hero,
  .model-head {
    padding: 1.4rem 1.15rem;
  }
  .model-head .actions {
    margin-left: 0;
    width: 100%;
  }
  .model-head .actions .btn {
    flex: 1 1 auto;
  }
  .facts > div {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }
  .facts dt {
    font-size: 0.755rem;
  }
  .prose {
    padding: 1.15rem 1.1rem 1.4rem;
  }
  .pagefoot .shell {
    gap: 0.35rem 0.9rem;
  }
}

@media (max-width: 520px) {
  .model-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .model-head .actions .btn {
    font-size: 0.85rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ------------------------------------------------------- hub + compare --- */

.hero-slim {
  padding: 1.8rem 1.75rem 1.6rem;
  display: block;
}
.hero-slim .lede {
  margin-bottom: 0.6rem;
}
.hero-slim .small a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent-line);
  text-underline-offset: 2px;
}

.hub-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-1);
  font-size: 0.875rem;
}
.hub-table th,
.hub-table td {
  padding: 0.55rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.hub-table thead th {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  background: var(--surface-2);
}
.hub-table tbody tr:last-child td {
  border-bottom: none;
}
.hub-table tbody th {
  font-weight: 600;
  text-align: left;
}
.hub-table tbody tr {
  transition: background 120ms ease;
}
.hub-table tbody tr:hover {
  background: color-mix(in srgb, var(--surface-2) 55%, transparent);
}
.hub-table .hub-ms a {
  color: var(--accent);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.hub-table.compare th,
.hub-table.compare td {
  font-size: 0.895rem;
}
.hub-table.compare tbody th.compare-label {
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 650;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  white-space: nowrap;
}

a.badge {
  color: inherit;
}
a.badge:hover {
  color: var(--accent);
  border-color: var(--accent-line);
}
@media (max-width: 720px) {
  .hub-table {
    display: block;
    overflow-x: auto;
  }
}
