/* ==========================================================================
   Tiny Snake — design tokens
   One neutral scale, one accent (the snake green), 4px spacing grid,
   4px controls / 6px surfaces. Borders do the structural work, not shadows.
   ========================================================================== */

:root {
  color-scheme: dark;
  accent-color: var(--accent);

  /* Surfaces */
  --bg: #0a0d11;
  --surface: #0f141a;
  --surface-2: #151b22;
  --surface-inset: #0b0f14;
  --line: #222a34;
  --line-strong: #3a4552;

  /* Text */
  --text: #eef2f5;
  --text-muted: #9aa5b1;
  --text-faint: #7c8794;

  /* Accent — matches the rendered snake */
  --accent: #59f0bf;
  --accent-strong: #34d399;
  --accent-ink: #06251c;
  --accent-soft: rgba(89, 240, 191, 0.1);
  --accent-line: rgba(89, 240, 191, 0.32);
  --danger: #ff657c;

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

  /* Radii */
  --r-sm: 3px;
  --r-md: 4px;
  --r-lg: 6px;
  --r-full: 999px;

  /* Layering */
  --z-sticky: 60;
  --z-dropdown: 70;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
}

/* ==========================================================================
   Base
   ========================================================================== */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
  -webkit-text-size-adjust: 100%;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  border: 3px solid var(--bg);
  border-radius: var(--r-full);
  background: var(--line-strong);
}

::-webkit-scrollbar-thumb:hover {
  background: #4a5663;
}

::selection {
  background: rgba(89, 240, 191, 0.24);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font-ui);
  font-size: 0.9375rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

p {
  margin: 0;
}

a {
  color: inherit;
}

button,
a,
.select-trigger {
  touch-action: manipulation;
}

button,
input,
select {
  font: inherit;
}

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

section[id] {
  scroll-margin-top: var(--space-6);
}

.app-shell {
  width: min(1280px, calc(100% - 48px));
  margin: 0 auto;
  padding: var(--space-6) 0 var(--space-12);
}

/* ==========================================================================
   Top bar
   ========================================================================== */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  margin-bottom: var(--space-12);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.brand-mark {
  width: 28px;
  height: 28px;
  border: 6px solid var(--accent);
  border-left-color: transparent;
  border-radius: var(--r-full);
  transform: rotate(-8deg);
}

.brand h1 {
  font-size: 1.0625rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.brand p {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.topnav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.topnav a {
  border-radius: var(--r-md);
  padding: 7px 10px;
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 120ms ease, background-color 120ms ease;
}

.topnav a:hover {
  color: var(--text);
  background: var(--surface-2);
}

.topnav a[aria-current] {
  color: var(--text);
  background: var(--surface-2);
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.8fr);
  gap: var(--space-12);
  align-items: center;
  margin-bottom: var(--space-16);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 500;
}

.hero-meta span + span::before {
  content: "·";
  margin-right: var(--space-2);
  color: var(--line-strong);
}

.hero h2 {
  font-size: clamp(2.4rem, 4.6vw, 4.25rem);
  font-weight: 650;
  line-height: 1.02;
  letter-spacing: -0.045em;
}

.hero-copy > p {
  max-width: 640px;
  margin-top: var(--space-5);
  color: var(--text-muted);
  font-size: clamp(1rem, 1.3vw, 1.125rem);
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-6);
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 0 var(--space-4);
  color: var(--text);
  background: var(--surface-2);
  font-size: 0.875rem;
  font-weight: 550;
  text-decoration: none;
  transition: border-color 120ms ease, background-color 120ms ease;
}

.button-link:hover {
  border-color: var(--line-strong);
}

.primary-link {
  border-color: var(--accent);
  color: var(--accent-ink);
  background: var(--accent);
}

.primary-link:hover {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
}

/* TL;DR card */

.tldr-card {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--space-5);
  background: var(--surface);
}

.tldr-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--line);
  color: var(--text-faint);
  font-size: 0.6875rem;
  font-weight: 650;
  letter-spacing: 0.1em;
}

.model-state {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--r-full);
  background: #f8bd52;
}

.model-state.ready .status-dot {
  background: var(--accent);
}

.model-state.error .status-dot {
  background: var(--danger);
}

.tldr-card p {
  margin-top: var(--space-3);
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.6;
}

.tldr-lead {
  color: var(--text) !important;
  font-size: 1.0625rem !important;
  font-weight: 600;
}

.mini-flow {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-4) 0;
}

.mini-flow span {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 8px 6px;
  color: var(--text-muted);
  background: var(--surface-inset);
  font-size: 0.75rem;
  text-align: center;
}

.mini-flow b {
  color: var(--accent-strong);
  font-weight: 600;
}

.tldr-card small {
  display: block;
  color: var(--text-faint);
  font-size: 0.75rem;
  line-height: 1.5;
}

/* ==========================================================================
   Workspace: game + controls
   ========================================================================== */

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(340px, 0.75fr);
  gap: var(--space-4);
  align-items: start;
}

.game-panel,
.control-section,
.stats,
.model-card {
  border: 1px solid var(--line);
  background: var(--surface);
}

.game-panel {
  border-radius: var(--r-lg);
  padding: var(--space-3);
  overflow: hidden;
}

#gameCanvas {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--r-md);
  background: #091520;
}

.canvas-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  padding: var(--space-3) var(--space-1) 2px;
}

.canvas-footer strong {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
}

.canvas-footer div > span:not(.live-pill span) {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.live-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-muted);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.live-pill span {
  width: 7px;
  height: 7px;
  border-radius: var(--r-full);
  background: var(--accent);
}

.control-panel {
  display: grid;
  gap: var(--space-3);
}

.control-section,
.model-card {
  border-radius: var(--r-lg);
  padding: var(--space-5);
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.section-heading h2 {
  font-size: 0.9375rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.section-heading p {
  margin-top: var(--space-1);
  color: var(--text-muted);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.run-summary {
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* Run settings: every field shares label → control → hint structure,
   so the two columns keep the same rhythm. */

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4) var(--space-3);
}

.field {
  display: grid;
  grid-template-rows: auto 40px auto;
  gap: 6px;
}

.field label {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 550;
  letter-spacing: 0.01em;
}

.field-hint {
  color: var(--text-faint);
  font-size: 0.6875rem;
  line-height: 1.4;
}

input,
select {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 0 11px;
  color: var(--text);
  background: var(--surface-inset);
  font-size: 0.875rem;
  caret-color: var(--accent);
  transition: border-color 120ms ease;
}

input:hover,
select:hover {
  border-color: var(--line-strong);
}

input:focus-visible,
select:focus-visible {
  outline: none;
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

#seed {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}

select {
  appearance: none;
  padding-right: var(--space-8);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%239aa5b1' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
}

/* Best-effort theming for the native popup on no-JS Chromium/Firefox. */
select option {
  color: var(--text);
  background: var(--surface-2);
}

input[type="number"] {
  appearance: textfield;
  -webkit-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

/* Themed selects: native popups are OS-drawn, so the enhancement script pairs
   each select with this listbox; the native element stays as the value source. */

.select {
  position: relative;
}

.select-native {
  display: none;
}

.select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  width: 100%;
  height: 40px;
  min-height: 40px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  color: var(--text);
  background: var(--surface-inset);
  font-size: 0.875rem;
  font-weight: 400;
  text-align: left;
  cursor: pointer;
}

.select-trigger:hover {
  border-color: var(--line-strong);
}

.select-trigger[aria-expanded="true"] {
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.select-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.select-chevron {
  flex: none;
  width: 12px;
  height: 12px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%239aa5b1' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px 12px no-repeat;
  transition: transform 150ms ease;
}

.select.is-open .select-chevron {
  transform: rotate(180deg);
}

.select-menu {
  position: absolute;
  z-index: var(--z-dropdown);
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  max-height: 280px;
  margin: 0;
  padding: var(--space-1);
  overflow: auto;
  overscroll-behavior: contain;
  list-style: none;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface-2);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
}

.select-menu:focus-visible {
  outline: none;
}

.select.drop-up .select-menu {
  top: auto;
  bottom: calc(100% + 6px);
}

.select-menu [role="option"] {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 8px 10px;
  border-radius: var(--r-sm);
  color: var(--text-muted);
  font-size: 0.8125rem;
  cursor: pointer;
}

.select-menu [role="option"].is-active {
  color: var(--text);
  background: var(--surface-inset);
}

.select-menu [role="option"][aria-selected="true"] {
  color: var(--accent);
}

.select-menu [role="option"][aria-selected="true"]::after {
  content: "✓";
  flex: none;
  color: var(--accent);
  font-size: 0.75rem;
}

/* Windows high-contrast strips background colors, so keep states visible. */
@media (forced-colors: active) {
  .select-menu [role="option"].is-active {
    outline: 2px solid CanvasText;
    outline-offset: -2px;
  }

  .select-menu [role="option"][aria-selected="true"] {
    font-weight: 700;
  }

  .select-trigger[aria-expanded="true"] {
    outline: 2px solid CanvasText;
    outline-offset: 2px;
  }
}

.button-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: var(--space-2);
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
}

button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 0 var(--space-4);
  color: var(--text);
  background: var(--surface-2);
  font-size: 0.875rem;
  font-weight: 550;
  cursor: pointer;
  transition: border-color 120ms ease, background-color 120ms ease;
}

button:hover:not(:disabled) {
  border-color: var(--line-strong);
}

button:active:not(:disabled) {
  background: var(--surface-inset);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

button.primary {
  border-color: var(--accent);
  color: var(--accent-ink);
  background: var(--accent);
  font-weight: 650;
}

button.primary:hover:not(:disabled) {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
}

/* Live stats: one panel with internal dividers instead of four cards */

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: 1fr;
  border-radius: var(--r-lg);
  overflow: hidden;
}

.stat {
  padding: var(--space-3) var(--space-4);
}

.stat span {
  display: block;
  color: var(--text-faint);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.stat strong {
  display: block;
  margin-top: 6px;
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.stat:nth-child(odd) {
  border-right: 1px solid var(--line);
}

.stat:nth-child(n + 3) {
  border-top: 1px solid var(--line);
}

/* Benchmark */

.benchmark-button {
  width: 100%;
  border-color: var(--accent-line);
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
}

.benchmark-button:hover:not(:disabled) {
  border-color: var(--accent);
  background: rgba(89, 240, 191, 0.14);
}

.benchmark-results {
  display: grid;
  margin-top: var(--space-4);
  border-top: 1px solid var(--line);
}

.benchmark-results div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.benchmark-results div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.benchmark-results strong {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Model summary */

.model-card > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
}

.model-card > div:first-child strong {
  font-size: 0.9375rem;
  font-weight: 600;
}

.eyebrow {
  color: var(--accent-strong);
  font-size: 0.6875rem;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.model-card dl {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: var(--space-4) 0;
}

.model-card dl div {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--space-2) var(--space-2) var(--space-3);
  background: var(--surface-inset);
}

.model-card dt {
  color: var(--text-faint);
  font-size: 0.6875rem;
}

.model-card dd {
  margin: 4px 0 0;
  font-size: 0.8125rem;
  font-weight: 550;
}

.model-card p {
  color: var(--text-muted);
  font-size: 0.8125rem;
  line-height: 1.55;
}

/* ==========================================================================
   Story / results
   ========================================================================== */

.story-section,
.results-section {
  margin-top: 72px;
}

.story-heading {
  max-width: 720px;
  margin-bottom: var(--space-6);
}

.story-heading h2 {
  margin: var(--space-2) 0 var(--space-3);
  font-size: clamp(1.75rem, 3.2vw, 2.5rem);
  font-weight: 650;
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.story-heading p {
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.65;
}

.compact-heading {
  max-width: 800px;
}

.comparison-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.comparison-card > div {
  display: grid;
  grid-template-columns: 0.7fr 1fr 1fr;
  gap: var(--space-5);
  align-items: center;
  min-height: 56px;
  padding: var(--space-3) var(--space-5);
  border-top: 1px solid var(--line);
}

.comparison-card > div:first-child {
  min-height: 44px;
  border-top: 0;
  background: var(--surface-inset);
}

.comparison-card span {
  color: var(--text-faint);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.comparison-card strong {
  font-size: 0.8125rem;
  font-weight: 600;
}

.comparison-card p {
  color: var(--text-muted);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.plain-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.85fr 0.85fr;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.plain-card {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--space-5);
  background: var(--surface);
}

.featured-card {
  border-color: var(--accent-line);
}

.card-kicker {
  color: var(--accent-strong);
  font-size: 0.6875rem;
  font-weight: 650;
  letter-spacing: 0.1em;
}

.plain-card h3,
.evaluation-copy h3 {
  margin: var(--space-2) 0;
  font-size: 1rem;
  line-height: 1.35;
}

.plain-card > p,
.evaluation-copy p {
  color: var(--text-muted);
  font-size: 0.8125rem;
  line-height: 1.65;
}

.plain-card p strong {
  color: var(--text);
}

.muted-note {
  margin-top: var(--space-3) !important;
  padding-top: var(--space-3);
  border-top: 1px solid var(--line);
  color: var(--text-faint) !important;
}

.step-flow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: var(--space-5);
}

.step-flow div {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--space-3);
  background: var(--surface-inset);
}

.step-flow b {
  display: flex;
  width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-full);
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 0.6875rem;
}

.step-flow span {
  display: block;
  margin-top: var(--space-2);
  color: var(--text-muted);
  font-size: 0.6875rem;
  line-height: 1.4;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
}

.metric-grid article {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--space-5);
  background: var(--surface);
}

.metric-grid span {
  color: var(--text-faint);
  font-size: 0.6875rem;
  font-weight: 650;
  letter-spacing: 0.08em;
}

.metric-grid strong {
  display: block;
  margin: var(--space-2) 0 6px;
  font-size: 1.625rem;
  font-weight: 650;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.metric-grid p {
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.5;
}

.evaluation-card {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: var(--space-6);
  align-items: center;
  margin-top: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--space-6);
  background: var(--surface);
}

.score-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}

.score-pair div {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--space-4);
  background: var(--surface-inset);
}

.score-pair span,
.score-pair small {
  display: block;
  color: var(--text-faint);
  font-size: 0.625rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.score-pair strong {
  display: block;
  margin: 6px 0 3px;
  font-size: 1.5rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.honesty-callout {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: var(--space-4);
  margin-top: var(--space-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  padding: var(--space-4) var(--space-5);
  background: var(--surface-inset);
}

.honesty-callout strong {
  font-size: 0.8125rem;
}

.honesty-callout p {
  color: var(--text-muted);
  font-size: 0.8125rem;
  line-height: 1.6;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1100px) {
  .hero {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .control-panel {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  .run-section,
  .model-card {
    grid-column: 1 / -1;
  }

  .plain-grid {
    grid-template-columns: 1fr 1fr;
  }

  .featured-card {
    grid-column: 1 / -1;
  }

  .metric-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  body {
    padding-top: 44px; /* clears the fixed section nav */
  }

  section[id] {
    scroll-margin-top: 60px;
  }

  .app-shell {
    width: min(100% - 32px, 1280px);
    padding-top: var(--space-5);
  }

  .topbar {
    gap: var(--space-2);
    margin-bottom: var(--space-6);
  }

  .topnav {
    position: fixed;
    inset: 0 0 auto;
    z-index: var(--z-sticky);
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-1);
    height: 44px;
    padding-right: max(var(--space-4), env(safe-area-inset-right));
    padding-left: max(var(--space-4), env(safe-area-inset-left));
    border-bottom: 1px solid var(--line);
    background: var(--bg);
  }

  .topnav a {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    border-radius: 0;
    padding: 0 var(--space-2);
    font-weight: 550;
    white-space: nowrap;
  }

  .topnav a:hover {
    color: var(--text);
    background: transparent;
  }

  .topnav a[aria-current] {
    color: var(--text);
    background: transparent;
  }

  .topnav a[aria-current]::after {
    content: "";
    position: absolute;
    right: var(--space-2);
    bottom: 0;
    left: var(--space-2);
    height: 2px;
    border-radius: var(--r-full);
    background: var(--accent);
  }

  .hero {
    margin-bottom: 44px;
  }

  .control-panel {
    grid-template-columns: 1fr;
  }

  .run-section,
  .model-card {
    grid-column: auto;
  }

  .live-pill {
    display: none;
  }

  .plain-grid,
  .metric-grid,
  .evaluation-card,
  .score-pair {
    grid-template-columns: 1fr;
  }

  .featured-card {
    grid-column: auto;
  }

  .comparison-card > div {
    grid-template-columns: 0.7fr 1fr 1fr;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
  }

  .comparison-card p,
  .comparison-card strong {
    font-size: 0.75rem;
  }

  input,
  select,
  #seed,
  .select-trigger {
    font-size: 1rem;
  }

  .step-flow {
    grid-template-columns: 1fr 1fr;
  }

  .honesty-callout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 460px) {
  .field-grid {
    grid-template-columns: 1fr;
  }

  .button-row {
    grid-template-columns: 1fr;
  }

  .model-card dl {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
