/* ---------------------------------------------------------------
   Design tokens — dark only, enforced regardless of OS/browser
   color-scheme preference. The charts (js/charts.js) already always
   render their own fixed dark palette (BARTENDER_CONFIG) no matter what
   the page theme is, so a page that followed prefers-color-scheme: light
   produced a jarring light-page/dark-charts mismatch. Keeping just one,
   always-dark palette here keeps the page and every chart consistent.
   --------------------------------------------------------------- */
:root {
  color-scheme: dark;

  --surface: #1a1a19;
  --page: #101010;
  --text-primary: #ffffff;
  --text-secondary: #c3c2b7;
  --text-muted: #898781;
  --gridline: #2c2c2a;
  --border: rgba(255, 255, 255, 0.30);
  --border-strong: rgba(255, 255, 255, 0.50);

  --series-quality: #9085e9;
  --series-speed: #199e70;
  --series-cost: #d95926;
  --brand-accent: #d95926;
  --brand-accent-ink: #ffffff;

  --accent-coral: #ff6f6c;
  --accent-coral-ink: #0f0f0f;

  --font-display: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-md: 0;
  --radius-lg: 0;
  --radius-pill: 999px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--page);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.45;
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 450; letter-spacing: -0.03em; line-height: 1; margin: 0; }
p { margin: 0; }
button { font-family: inherit; }
select { font-family: inherit; }

.section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 56px 24px;
}
.section + .section { border-top: 1px solid var(--border); }

/* ---------- Top nav ---------- */
.topnav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background-color 200ms ease-in-out, border-color 200ms ease-in-out;
}
.topnav.scrolled {
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom-color: var(--border);
}
.nav-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-primary);
  text-decoration: none;
  white-space: nowrap;
}
.brand-mark { color: var(--accent-coral); display: inline-flex; }
.nav-right { display: flex; align-items: center; gap: 32px; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.nav-link {
  background: none;
  border: none;
  padding: 6px 2px;
  font-size: 0.92rem;
  color: var(--text-secondary);
  text-decoration: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  position: relative;
}
.nav-link.active {
  color: var(--text-primary);
  font-weight: 600;
  border-bottom-color: var(--accent-coral);
}
.nav-ctas { display: flex; align-items: center; gap: 10px; }

.btn {
  border-radius: 4px;
  border: 1px solid transparent;
  padding: 9px 18px;
  font-size: 0.88rem;
  font-weight: 450;
  letter-spacing: -0.03em;
  font-family: var(--font-display);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  display: inline-block;
}
.btn-primary { background: var(--accent-coral); color: var(--accent-coral-ink); }
.btn-secondary { background: none; border-color: var(--border-strong); color: var(--text-primary); }
.btn-suggest { background: color-mix(in srgb, var(--series-quality) 14%, var(--surface)); color: var(--series-quality); }
.btn-ghost { background: var(--surface); border-color: var(--border-strong); color: var(--text-primary); padding: 7px 14px; font-size: 0.82rem; }

/* mock/inert affordance: real cursor + hover, but a small "Coming soon" pop */
.mock { position: relative; }
.mock::after {
  content: attr(data-mock);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--text-primary);
  color: var(--surface);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease, transform 120ms ease;
  z-index: 30;
}
.mock:hover::after,
.mock:focus-visible::after,
.mock.show-mock::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- Mobile nav trigger, panel close button + backdrop ----------
   All inert on desktop (hidden/transparent/unclickable) and only take
   effect inside the max-width:900px query below, which turns .nav-right
   into an off-canvas panel that sits above .topnav -- so the panel gets
   its own close button (.nav-panel-close) rather than reusing the trigger,
   which would otherwise be hidden behind the open panel. */
.nav-hamburger, .nav-panel-close {
  display: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-primary);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
/* Duplicate of the header .brand, shown only inside the mobile drawer
   (.nav-panel-brand) since the header's own brand link is out of view
   above the drawer -- otherwise the drawer opens on an empty top. */
.nav-panel-brand { display: none; }
.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}
.nav-backdrop.is-open { opacity: 1; pointer-events: auto; }
body.nav-open { overflow: hidden; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; text-align: center; padding-top: 72px; min-height: 36rem; }
.hero-inner, .hero .stats-bar { position: relative; z-index: 1; }

.hero-bg-grid, .hero-bg-plus, .hero-bg-dots, .hero-glow-a, .hero-glow-b, .hero-vignette {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.hero-bg-grid {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 104px 104px;
  -webkit-mask-image: radial-gradient(90rem 50rem at 80% 18%, black, transparent 78%);
  mask-image: radial-gradient(90rem 50rem at 80% 18%, black, transparent 78%);
}
.hero-bg-plus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='208' height='208'%3E%3Cpath d='M104 97v14M97 104h14' stroke='rgba(255,255,255,0.28)' stroke-width='1'/%3E%3C/svg%3E");
  background-size: 208px 208px;
  -webkit-mask-image: radial-gradient(70rem 40rem at 82% 22%, black, transparent 70%);
  mask-image: radial-gradient(70rem 40rem at 82% 22%, black, transparent 70%);
}
.hero-glow-a {
  top: -45%; right: -15%; bottom: auto; left: auto;
  height: 130%; width: 70%;
  background-image: radial-gradient(closest-side, hsla(1, 100%, 71%, 0.2), transparent 72%);
  animation: glow-drift-a 22s ease-in-out infinite alternate;
}
.hero-glow-b {
  bottom: -55%; left: -12%; top: auto; right: auto;
  height: 120%; width: 60%;
  background-image: radial-gradient(closest-side, hsla(202, 74%, 45%, 0.3), transparent 72%);
  animation: glow-drift-b 28s ease-in-out infinite alternate;
}
.hero-vignette {
  background-image: linear-gradient(to top, hsla(0, 0%, 6%, 0.8), transparent, transparent);
}
@keyframes glow-drift-a {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-4%, 6%, 0) scale(1.12); }
}
@keyframes glow-drift-b {
  from { transform: translate3d(0, 0, 0) scale(1.08); }
  to { transform: translate3d(5%, -4%, 0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-glow-a, .hero-glow-b { animation: none; }
}
.hero-bg-dots {
  background: radial-gradient(hsla(0, 0%, 100%, 0.1) 1px, transparent 1px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(55rem 32rem at 88% 16%, black, transparent 68%);
  mask-image: radial-gradient(55rem 32rem at 88% 16%, black, transparent 68%);
}

.hero-inner { max-width: 760px; margin: 0 auto; }
@media (prefers-reduced-motion: no-preference) {
  .hero-inner { animation: hero-entrance-in 500ms ease-out both; }
}
@keyframes hero-entrance-in {
  from { opacity: 0; transform: translateY(0.75rem); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Page hero (static variant: recommender/model/suggest intro blocks) ---------- */
.page-hero { position: relative; overflow: hidden; padding: 40px 0; margin-bottom: 8px; }
.page-hero > * { position: relative; z-index: 1; }
@media (prefers-reduced-motion: no-preference) {
  .page-hero { animation: hero-entrance-in 500ms ease-out both; }
}
.page-hero-bg-grid, .page-hero-bg-plus, .page-hero-bg-dots, .page-hero-bg-glow {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.page-hero-bg-grid {
  background-image:
    linear-gradient(hsla(0, 0%, 100%, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, hsla(0, 0%, 100%, 0.07) 1px, transparent 1px);
  background-size: 104px 104px;
}
.page-hero-bg-plus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='208' height='208'%3E%3Cpath d='M104 97v14M97 104h14' stroke='rgba(255,255,255,0.28)' stroke-width='1'/%3E%3C/svg%3E");
  background-size: 208px 208px;
}
.page-hero-bg-dots {
  background: radial-gradient(hsla(0, 0%, 100%, 0.08) 1px, transparent 1px);
  background-size: 22px 22px;
}
.page-hero-bg-glow {
  background-image: radial-gradient(52rem 26rem at 78% 0%, hsla(1, 100%, 71%, 0.12), transparent 70%);
}
.hero h1 { font-size: 2.6rem; line-height: 1.15; letter-spacing: -0.01em; }
.hero .subhead { display: block; margin-top: 18px; color: var(--text-secondary); font-size: 1.05rem; font-weight: 300; line-height: 1.2; }
.hero-ctas { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 28px; }
.hero-ctas .btn { padding: 12px 22px; font-size: 0.95rem; }

.chip-row { display: flex; gap: 8px; }
.chip {
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-secondary);
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.chip.chip-active { background: var(--series-quality); border-color: var(--series-quality); color: #fff; }

.top-models-card {
  margin: 40px auto 0;
  max-width: 340px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  text-align: left;
}
.top-models-title { font-family: var(--font-mono); font-size: 0.72rem; font-weight: 400; color: var(--text-muted); letter-spacing: 0.03em; margin-bottom: 10px; }
#top-models-list { list-style: none; margin: 0; padding: 0; }
#top-models-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 0;
  font-size: 0.92rem;
  border-top: 1px solid var(--border);
}
#top-models-list li:first-child { border-top: none; }
.rank { color: var(--text-muted); width: 20px; font-variant-numeric: tabular-nums; }
.model-name { flex: 1; font-weight: 600; text-align: left; color: inherit; text-decoration: none; }
.model-name:hover { text-decoration: underline; }
.model-score { color: var(--accent-coral); font-weight: 700; font-variant-numeric: tabular-nums; }

.stats-bar {
  margin-top: 48px;
  display: flex;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.stat-item { text-align: center; }
.stat-value { display: block; font-weight: 700; font-size: 1.05rem; }
.stat-label { display: block; color: var(--text-muted); font-size: 0.78rem; margin-top: 2px; }

/* ---------- Section heads ---------- */
.section-head { margin-bottom: 8px; }
.section-head h2 { font-size: 1.6rem; }
.section-meta { color: var(--text-secondary); font-size: 0.9rem; margin-top: 6px; }
.chart-caption { color: var(--text-secondary); font-size: 0.85rem; font-style: italic; margin: 6px 0 18px; }

/* ---------- Chart cards ---------- */
.highlight-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 28px;
}
.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 20px 12px;
}
.chart-card h3 { font-size: 1rem; }
.chart-mount { width: 100%; min-height: 230px; }
.chart-mount-wide { min-height: 340px; }

/* ---------- Compare ---------- */
.metric-toggle {
  display: inline-flex;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  padding: 3px;
  margin-top: 20px;
  gap: 2px;
}
.toggle-btn {
  border: none;
  background: none;
  padding: 8px 20px;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
  cursor: pointer;
}
.toggle-btn.active { background: var(--series-quality); color: #fff; }
.toggle-btn.active[data-metric="cost"] { background: var(--series-cost); }
.toggle-btn.active[data-metric="latency"] { background: var(--series-speed); }

/* ---------- Task detail ---------- */
.section-head-row { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.dropdown-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1.5px solid var(--series-quality);
  border-radius: var(--radius-pill);
  padding: 8px 18px;
  font-weight: 700;
  font-size: 0.9rem;
}
/* A dropdown-pill that opens a checklist popover (multi-select) instead of
   a native <select> — reuses .filter-popover-panel/.model-checklist for the
   floating panel, but sits inline in its section-head-row rather than
   flush right (.filter-popover's margin-left:auto is for the trailing
   funnel icon elsewhere, not appropriate here). Selector is deliberately
   .dialect-picker.filter-popover (both classes are on the element already)
   so this outranks .filter-popover's margin-left:auto regardless of
   declaration order — a single-class .dialect-picker rule silently lost
   that tie-break once, since .filter-popover happens to be declared later. */
.dialect-picker.filter-popover { margin-left: 0; }
/* Same margin override for the task-info icon: it sits right after the
   dropdown-pill rather than being pushed to the row's far right, which
   stays reserved for the model-filter icon via its own margin-left:auto. */
.task-info-popover.filter-popover { margin-left: 0; }
.dialect-picker-trigger {
  background: none;
  border: none;
  font: inherit;
  font-weight: 700;
  color: var(--series-quality);
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.dropdown-pill select {
  border: none;
  background: none;
  font: inherit;
  font-weight: 700;
  color: var(--series-quality);
  cursor: pointer;
}
.model-checklist { display: flex; flex-direction: column; gap: 9px; max-height: 260px; overflow-y: auto; }
.model-checklist label { display: flex; align-items: center; gap: 9px; font-size: 0.88rem; cursor: pointer; }
.model-checklist input[type="checkbox"] { accent-color: var(--series-quality); width: 15px; height: 15px; }

/* ---------- Model filter: icon trigger + floating popover ----------
   Docked to the right end of whichever .section-head-row it sits in
   (Task Detail's or Compare's) via margin-left:auto, so no dedicated
   layout column is reserved for it — the popover floats over the chart
   below instead of pushing it down. */
.filter-popover { position: relative; display: inline-flex; margin-left: auto; }
.filter-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
}
.filter-icon-btn[aria-expanded="true"] { border-color: var(--series-quality); color: var(--series-quality); }
.filter-icon-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: var(--accent-coral);
  color: var(--accent-coral-ink);
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  white-space: nowrap;
}
.filter-popover-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  width: 280px;
  max-width: calc(100vw - 48px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
}
.model-select-search,
.form-input {
  width: 100%;
  padding: 7px 10px;
  border-radius: 0;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-primary);
  font: inherit;
  margin-bottom: 12px;
}
.task-info-panel { width: 320px; }
#task-info-title { font-size: 0.95rem; font-weight: 700; margin-bottom: 6px; }
#task-info-description { color: var(--text-secondary); font-size: 0.85rem; line-height: 1.4; margin-bottom: 10px; }
.filter-facet { margin-bottom: 10px; }
.facet-label { display: block; font-size: 0.72rem; color: var(--text-muted); font-weight: 600; margin-bottom: 6px; }
.chip-row-wrap { flex-wrap: wrap; }
.chip-sm { padding: 5px 12px; font-size: 0.78rem; }
.model-select-actions { display: flex; gap: 14px; margin-bottom: 12px; }
.btn-link {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--series-quality);
  cursor: pointer;
}
.btn-link:hover { text-decoration: underline; }

/* ---------- Recommender wizard ---------- */
.wizard { padding-top: 48px; max-width: 720px; margin: 0 auto; }
.wizard h1 { font-size: 2rem; }
.wizard h2 { font-size: 1.15rem; margin-bottom: 16px; }

.wizard-step-label { color: var(--text-muted); font-size: 0.82rem; font-weight: 600; margin: 24px 0 8px; }
.wizard-progress { height: 6px; border-radius: var(--radius-pill); background: var(--gridline); overflow: hidden; margin-bottom: 32px; }
.wizard-progress-fill { height: 100%; background: var(--accent-coral); border-radius: var(--radius-pill); transition: width 0.25s ease; }

.priority-slider {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 14px;
}
.priority-slider-head { display: flex; align-items: center; justify-content: space-between; }
.priority-slider-label { display: flex; align-items: center; font-weight: 700; font-size: 0.95rem; }
.priority-dot { width: 10px; height: 10px; border-radius: 2px; display: inline-block; margin-right: 9px; }
.priority-slider-importance { font-size: 0.82rem; color: var(--text-secondary); }
.priority-slider-desc { color: var(--text-muted); font-size: 0.82rem; margin: 4px 0 12px; }
.priority-range { width: 100%; accent-color: var(--accent-coral); cursor: pointer; }

.weight-bar { display: flex; height: 10px; border-radius: var(--radius-pill); overflow: hidden; margin: 22px 0 8px; background: var(--gridline); }
.weight-bar-seg { height: 100%; transition: flex-basis 0.15s ease; }

.wizard-match-count { color: var(--text-secondary); font-size: 0.9rem; margin-top: 14px; }

.wizard-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 32px; }

.result-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 14px;
}
.result-rank { font-family: var(--font-display); font-size: 1.6rem; color: var(--text-muted); width: 34px; flex-shrink: 0; }
.result-body { flex: 1; min-width: 0; }
.result-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.result-name { font-weight: 700; font-size: 1.05rem; }
.result-score { font-weight: 700; font-size: 1.2rem; color: var(--accent-coral); }
.result-badges { display: flex; gap: 6px; margin: 6px 0 14px; }
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  font-size: 0.72rem;
  color: var(--text-muted);
}
.result-breakdown { display: flex; flex-direction: column; gap: 7px; }
.result-breakdown-row { display: grid; grid-template-columns: 70px 1fr 64px; align-items: center; gap: 10px; font-size: 0.78rem; }
.result-breakdown-label { color: var(--text-muted); }
.result-breakdown-track { display: block; height: 6px; border-radius: var(--radius-pill); background: var(--gridline); overflow: hidden; }
.result-breakdown-fill { display: block; height: 100%; border-radius: var(--radius-pill); }
.result-breakdown-value { text-align: right; color: var(--text-secondary); font-variant-numeric: tabular-nums; }

footer.site-footer {
  border-top: 1px solid var(--border);
  padding: 48px 24px;
  color: var(--text-muted);
  font-size: 0.8rem;
}
.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr repeat(4, 1fr);
  gap: 32px;
}
.footer-tagline { color: var(--text-secondary); font-size: 1rem; line-height: 1.4; max-width: 16rem; margin-top: 12px; }
.footer-col-title { font-family: var(--font-mono); font-size: 0.8125rem; font-weight: 400; text-transform: uppercase; letter-spacing: -0.02em; color: var(--text-primary); margin-bottom: 1.75rem; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.3125rem; }
.footer-col a { color: var(--text-secondary); text-decoration: none; font-size: 1rem; line-height: 1.3; }
.footer-col a:hover { color: var(--text-primary); }

/* ---------- Model card page ---------- */
.back-link { display: inline-block; margin-bottom: 24px; }

.model-hero {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}
.model-logo {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
/* Brand SVGs ship as flat black paths; masking with a currentColor-style
   fill lets one file work in both themes instead of needing light/dark
   asset pairs — see img/logos/. */
.model-logo-img {
  display: block;
  width: 60%;
  height: 60%;
  background-color: var(--text-primary);
  -webkit-mask-image: var(--logo-url);
  mask-image: var(--logo-url);
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}
.model-logo-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--series-quality);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.6rem;
}
.model-hero-body { flex: 1; min-width: 0; }
.model-hero-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.model-hero-top h1 { font-size: 2rem; }
.model-provider { color: var(--text-secondary); font-size: 1rem; margin-top: 4px; }
.model-rank { color: var(--text-muted); font-size: 0.85rem; margin-top: 6px; }
.model-homepage-link {
  display: inline-block;
  margin-top: 14px;
}

.stat-tile-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}
.stat-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 22px;
}
.stat-tile-label { font-family: var(--font-mono); font-size: 0.78rem; font-weight: 400; letter-spacing: 0.02em; text-transform: uppercase; }
.stat-tile-value { font-family: var(--font-display); font-size: 2.6rem; font-weight: 700; line-height: 1.1; margin-top: 8px; }
.stat-tile-sub { font-size: 0.85rem; color: var(--text-secondary); margin-top: 6px; }
.stat-tile.stat-na .stat-tile-value { color: var(--text-muted); }

.model-about { margin-bottom: 40px; }
.model-about h2, .model-breakdown h2 { font-size: 1.25rem; margin-bottom: 10px; }
.model-about p { color: var(--text-secondary); max-width: 720px; }
.model-breakdown { margin-bottom: 40px; }

.mc-field { margin-bottom: 22px; }
.mc-field-title { font-size: 0.9rem; font-weight: 700; margin-bottom: 8px; }
.mc-row { display: grid; grid-template-columns: 130px 1fr 64px; align-items: center; gap: 10px; font-size: 0.85rem; padding: 6px 0; }
.mc-row-self .mc-label { font-weight: 700; color: var(--text-primary); }
.mc-label { color: var(--text-secondary); }
.mc-track { display: block; height: 8px; border-radius: var(--radius-pill); background: var(--gridline); overflow: hidden; }
.mc-fill { display: block; height: 100%; border-radius: var(--radius-pill); }
.mc-value { text-align: right; color: var(--text-secondary); font-variant-numeric: tabular-nums; }

/* G2Plot renders the plot itself to canvas (not DOM), and its tooltip DOM
   uses hashed CSS-in-JS class names rather than a stable selector — so all
   chart chrome (axes, gridlines, tooltip) is themed directly in chart
   config via js/charts.js (tooltip.domStyles) instead of here. */

/* ---------- Suggest a model/task ---------- */
.suggest-layout {
  display: grid;
  grid-template-columns: minmax(280px, 380px) 1fr;
  gap: 24px;
  align-items: start;
  margin-top: 28px;
}
.suggest-form-card { max-width: 420px; }
.suggest-stat-row { margin-bottom: 0; }
.form-field { margin-bottom: 14px; }
.form-field label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }

/* ---------- Scroll reveal ---------- */
[data-reveal] { transition: opacity 700ms ease-out, transform 700ms ease-out; }
.reveal-pending { opacity: 0; transform: translateY(24px); }
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .highlight-cards { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2rem; }
  .hero-ctas { flex-direction: column; }
  .nav-hamburger { display: inline-flex; }
  .nav-right {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: min(84vw, 320px);
    background: var(--surface);
    border-left: 1px solid var(--border);
    /* Above .topnav (20) and .nav-backdrop (40) so the panel -- including
       its first link -- is fully visible, not hidden behind the header. */
    z-index: 45;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 24px;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 260ms ease;
  }
  .nav-right.is-open { transform: translateX(0); }
  .nav-panel-close { display: inline-flex; position: absolute; top: 16px; right: 16px; }
  .nav-panel-brand { display: flex; margin-bottom: 24px; }
  .nav-links { flex-direction: column; align-items: stretch; gap: 0; width: 100%; flex-wrap: nowrap; }
  .nav-link { width: 100%; padding: 14px 0; border-bottom: 1px solid var(--border); font-size: 1rem; text-align: left; }
  .nav-ctas { flex-direction: column; align-items: stretch; gap: 10px; width: 100%; margin-top: 20px; }
  .nav-ctas .btn { width: 100%; text-align: center; }
  .stat-tile-row { grid-template-columns: 1fr; }
  .mc-row { grid-template-columns: 90px 1fr 56px; }
  .suggest-layout { grid-template-columns: 1fr; }
  .suggest-form-card { max-width: none; }
  .footer-inner { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .nav-right, .nav-backdrop { transition: none; }
}
