/* ─── Variables ─────────────────────────────────────────────────────────── */
:root {
  --bg:            #ffffff;
  --bg-soft:       #fafafa;
  --ink:           #1f2328;
  --ink-soft:      #4a5058;
  --ink-mute:      #6b7178;
  --rule:          #e6e8eb;
  --rule-strong:   #d0d4d9;
  --accent:        #2563eb;
  --accent-deep:   #1d4ed8;
  --accent-soft:   #e8eefc;
  --accent2:       #ea7317;
  --accent2-soft:  #fdeede;
  --code-bg:       #0f1419;
  --code-ink:      #e6edf3;
  --shadow:        0 2px 14px rgba(0,0,0,0.06);
  --shadow-up:     0 8px 28px rgba(0,0,0,0.10);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Crimson Pro', 'Source Serif Pro', Georgia, serif;
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Topbar ─────────────────────────────────────────────────────────────── */
.topbar {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 20px;
  padding: 14px 20px 10px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  border-bottom: 1px solid var(--rule);
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar a {
  color: var(--ink-mute);
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}

.topbar a:hover {
  color: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
}

/* ─── Hero ────────────────────────────────────────────────────────────────── */
.hero {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--rule);
}

.hero-inner {
  width: min(860px, calc(100% - 32px));
  margin: 0 auto;
  padding: 44px 0 56px;
  text-align: center;
}

/* double-rule around title image — the Audio-Interaction "title-rule" motif */
.title-rule-top {
  display: block;
  height: 4px;
  background: #9A3898;
  border-radius: 2px;
  margin: 0 auto 16px;
  width: min(920px,100%);
}
.title-rule-bottom {
  display: block;
  height: 1px;
  background: var(--rule-strong);
  margin: 16px auto 0;
  width: min(920px,100%);
}

.title-image {
  display: block;
  width: min(920px, 100%);
  margin: 0 auto;
}

.subtitle {
  width: min(760px, 100%);
  margin: 24px auto 14px;
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: clamp(18px, 2vw, 23px);
  font-style: italic;
  font-weight: 500;
  color: var(--ink-soft);
  line-height: 1.35;
}

.authors {
  width: min(860px, 100%);
  margin: 0 auto 8px;
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 17px;
  color: var(--ink-soft);
  line-height: 1.5;
  word-spacing: 0.3em;
}

.affiliations,
.author-notes {
  width: min(920px, 100%);
  margin: 0 auto 8px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  color: var(--ink-mute);
  font-style: italic;
  line-height: 1.45;
}

.author-notes { margin-bottom: 28px; }

.authors sup,
.affiliations sup,
.author-notes sup { font-size: 0.7em; line-height: 0; }

/* ─── Pill buttons (Audio-Interaction style) ─────────────────────────────── */
.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  font-family: 'Inter', system-ui, sans-serif;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  border: 1.5px solid var(--rule-strong);
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-up);
  text-decoration: none;
}

.button.primary {
  border-color: transparent;
  background: linear-gradient(120deg, var(--accent) 0%, var(--accent2) 130%);
  color: #fff;
}

.button.dark {
  background: #2b2f36;
  border-color: transparent;
  color: #fff;
}

/* ─── Sections ───────────────────────────────────────────────────────────── */
.section { padding: 44px 0; }

.section.muted {
  background: var(--bg-soft);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.container {
  width: min(900px, calc(100% - 32px));
  margin: 0 auto;
}

.container.narrow {
  width: min(720px, calc(100% - 32px));
}

.two-column {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(320px, 1.2fr);
  gap: 36px;
  align-items: start;
}

.evaluation-layout {
  grid-template-columns: minmax(340px, 1fr) minmax(280px, 0.95fr);
  gap: 48px;
  margin-bottom: 24px;
}

/* ─── Typography ─────────────────────────────────────────────────────────── */
h1, h2, h3 { margin: 0 0 12px; line-height: 1.2; }

h1 {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: clamp(30px, 3.2vw, 40px);
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ink);
}

h2 {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: clamp(24px, 2.8vw, 34px);
  font-weight: 600;
  letter-spacing: -0.01em;
}

h3 {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 17px;
  font-weight: 700;
}

p { margin: 0 0 16px; }

code {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.82em;
}

pre {
  overflow-x: auto;
  padding: 20px 24px;
  border-radius: 10px;
  background: var(--code-bg);
  color: var(--code-ink);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 13.5px;
  line-height: 1.7;
}

pre code {
  padding: 0;
  background: transparent;
  color: inherit;
  font-size: inherit;
}

/* ─── Citation box ───────────────────────────────────────────────────────── */
.citation-box { position: relative; }
.citation-box pre { margin: 0; padding-right: 100px; }

.citation-copy {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 6px 14px;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 6px;
  background: rgba(255,255,255,0.08);
  color: var(--code-ink);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background .16s, border-color .16s;
}
.citation-copy:hover { background: rgba(255,255,255,0.18); }
.citation-copy:focus-visible { outline: 2px solid #7cb1ff; outline-offset: 2px; }
.citation-copy.is-copied { background: #2f9e6c; border-color: #2f9e6c; color: #fff; cursor: default; }

/* ─── Stats row (stat-pill style) ────────────────────────────────────────── */
.stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 32px;
  font-family: 'Inter', system-ui, sans-serif;
}

.stats div {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 24px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
  min-width: 140px;
}

.stats strong {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--accent);
  letter-spacing: -0.01em;
}

.stats div:nth-child(2n) strong { color: var(--accent2); }

.stats span {
  margin-top: 4px;
  font-size: 12px;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}

/* ─── Section heading ────────────────────────────────────────────────────── */
.section-heading {
  width: min(820px, 100%);
  margin: 0 auto 36px;
  text-align: center;
}

.section-heading p {
  font-size: 17px;
  color: var(--ink-soft);
  margin-bottom: 0;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.subsection-title {
  margin: 56px 0 22px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}

.section-heading + .subsection-title { margin-top: 0; }

.property-grid + .subsection-title,
.table-wrap + .subsection-title {
  margin-top: 72px;
}

.design-copy {
  max-width: 850px;
  color: var(--ink-soft);
  margin-bottom: 22px;
}

/* ─── Tables ─────────────────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
}

.leaderboard {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14.5px;
}

.leaderboard th,
.leaderboard td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--rule);
  text-align: center;
  white-space: nowrap;
}

.leaderboard th:nth-child(2),
.leaderboard th:nth-child(3),
.leaderboard td:nth-child(2),
.leaderboard td:nth-child(3) { text-align: left; }

.leaderboard th {
  background: var(--bg-soft);
  color: var(--ink);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

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

.leaderboard tbody tr:first-child td {
  background: var(--accent-soft);
}

.note {
  margin: 18px auto 0;
  width: min(820px, 100%);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  color: var(--ink-mute);
  text-align: center;
}

.comparison-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14.5px;
}

.comparison-table th,
.comparison-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--rule);
  text-align: center;
}

.comparison-table th:first-child,
.comparison-table td:first-child { text-align: left; font-weight: 700; }

.comparison-table th {
  background: var(--bg-soft);
  color: var(--ink);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

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

.comparison-table .ours td { background: var(--accent-soft); }

.comparison-table .yes {
  color: #12663d;
  font-size: 20px;
  font-weight: 800;
}

.comparison-table .no {
  color: #8a2d2d;
  font-size: 20px;
  font-weight: 800;
}

/* ─── Paper figures ──────────────────────────────────────────────────────── */
.paper-figure {
  width: min(980px, 100%);
  margin: 0 auto;
}

.paper-figure img {
  display: block;
  width: 100%;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}

.paper-figure figcaption {
  width: min(900px, 100%);
  margin: 14px auto 0;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  color: var(--ink-mute);
  text-align: center;
  line-height: 1.6;
}

/* ─── Cards: rubric / property / finding ─────────────────────────────────── */
.rubric-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.rubric-card,
.property-grid article,
.finding-grid article {
  padding: 20px 22px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
}

.rubric-card p,
.property-grid p,
.finding-grid p {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px;
  color: var(--ink-soft);
  margin-bottom: 0;
  line-height: 1.5;
}

.pipeline { margin: 18px 0 0; padding-left: 22px; }
.pipeline li { white-space: nowrap;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 8px;
}

/* eyebrow label (JetBrains Mono tag, Audio-Interaction panel-eyebrow) */
h3.eyebrow-above::before {
  content: attr(data-eyebrow);
  display: block;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.finding-grid article h3::before {
  content: "Finding";
  display: block;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent2);
  margin-bottom: 4px;
}

/* ─── Family grid ────────────────────────────────────────────────────────── */
.family-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.family-grid div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
}

.family-grid span {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.family-grid strong {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
}

/* ─── Property / finding grids ───────────────────────────────────────────── */
.property-grid,
.finding-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

/* ─── Demo section ───────────────────────────────────────────────────────── */
.demo-model-stack { display: grid; gap: 20px; }

.model-demo-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.model-label {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 220px;
  padding: 20px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
}

.model-label h3 {
  margin-bottom: 6px;
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
}

.model-label span {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.demo-placeholder {
  display: grid;
  place-items: center;
  min-height: 220px;
  border: 1px dashed #c8d4e2;
  border-radius: 10px;
  background: var(--bg-soft);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.demo-carousel { min-width: 0; }

.demo-window {
  --demo-gap: 18px;
  overflow: hidden;
  width: 100%;
}

.demo-track {
  display: flex;
  flex-wrap: nowrap;
  gap: var(--demo-gap);
  width: 100%;
  transform: translate3d(0, 0, 0);
}

.demo-track.is-sliding { transition: transform 600ms ease; }

.demo-card {
  display: flex;
  flex: 0 0 calc((100% - 2 * var(--demo-gap)) / 3);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
  min-width: 0;
}

.demo-card video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  background: var(--code-bg);
}

.demo-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px 18px;
}

.demo-details { flex: 1; min-width: 0; }

.demo-card h3 {
  margin-bottom: 4px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.demo-card p { margin-bottom: 0; }

.demo-meta {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.demo-scores { margin-top: 12px; }

.score-overall {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  width: min(240px, 100%);
  padding: 8px 12px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--bg-soft);
}

.score-overall span {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--ink-mute);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.score-overall strong {
  font-family: 'Crimson Pro', Georgia, serif;
  color: var(--accent);
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 10px;
  width: 100%;
  margin-top: 10px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11px;
  color: var(--ink-mute);
}

.score-grid span {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px;
}

.score-grid b {
  color: var(--ink);
  font-weight: 600;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  white-space: nowrap;
}

.play-link {
  flex: 0 0 auto;
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 999px;
  background: linear-gradient(120deg, var(--accent) 0%, var(--accent2) 140%);
  color: #fff;
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 700;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
  border: none;
  box-shadow: 0 4px 14px rgba(37,99,235,0.25);
  transition: box-shadow .15s ease, transform .15s ease;
}

.play-link::before {
  content: "";
  width: 0;
  height: 0;
  border-top: 4.5px solid transparent;
  border-bottom: 4.5px solid transparent;
  border-left: 7px solid currentColor;
}

.play-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37,99,235,0.35);
  text-decoration: none;
}

/* ─── Footer ─────────────────────────────────────────────────────────────── */
footer {
  padding: 36px 16px;
  text-align: center;
  border-top: 1px solid var(--rule);
  background: var(--bg-soft);
}

footer p {
  margin: 0;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  color: var(--ink-mute);
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 820px) {
  .topbar { gap: 8px 14px; overflow-x: auto; justify-content: flex-start; padding: 12px 16px 8px; -webkit-overflow-scrolling: touch; white-space: nowrap; }
  .topbar::-webkit-scrollbar { display: none; }
  .subtitle { font-size: 19px; }
  .two-column,
  .model-demo-row,
  .property-grid,
  .finding-grid { grid-template-columns: 1fr; }
  .model-label { min-height: auto; flex-direction: row; align-items: center; gap: 12px; padding: 14px 18px; }
  .model-label .model-label-icon { margin-bottom: 0; width: 32px; height: 32px; }
  .model-label h3 { margin-bottom: 0; }
  .model-label span { margin-left: auto; }
  .demo-placeholder { min-height: auto; padding: 28px 20px; }
  .demo-window { overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
  .demo-window::-webkit-scrollbar { height: 4px; }
  .demo-track {
    display: flex;
    overflow-x: auto;
    width: max-content;
    transform: none !important;
    transition: none !important;
    scroll-snap-type: x proximity;
  }
  .demo-card {
    flex: 0 0 min(340px, calc(100vw - 48px));
    scroll-snap-align: start;
  }
  .stats { gap: 10px; }
  .stats div { min-width: 120px; padding: 12px 18px; }
  .family-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── Phone (≤520px) ────────────────────────────────────────────────────── */
@media (max-width: 520px) {
  body { font-size: 17px; }
  .section { padding: 32px 0; }
  .hero-inner { padding: 28px 0 36px; }
  .topbar { font-size: 13px; gap: 8px 12px; padding: 10px 14px 6px; }
  .title-image { width: 92%; }
  .title-rule-top, .title-rule-bottom { width: 92%; }

  /* Hero text */
  .subtitle { font-size: 17px; padding: 0 14px; }
  .authors { font-size: 15px; word-spacing: 0.18em; padding: 0 12px; }
  .affiliations, .author-notes { font-size: 12px; padding: 0 12px; }

  /* Buttons stack two-up */
  .actions { gap: 8px; padding: 0 14px; }
  .button { padding: 9px 14px; font-size: 14px; }

  /* Stats: 2-column grid (more compact than full stack) */
  .stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 0 4px; }
  .stats div { min-width: 0; padding: 12px 10px; }
  .stats strong { font-size: 24px; }

  /* Section heading */
  .section-heading { margin-bottom: 22px; }
  .section-heading p { font-size: 15px; }

  /* Tables: shrink to fit on phones, no horizontal scroll, all columns visible */
  .table-wrap {
    position: relative;
    overflow: visible;
    -webkit-overflow-scrolling: touch;
  }
  .table-wrap::after { content: none; }
  .leaderboard, .comparison-table {
    min-width: 0;
    width: 100%;
    table-layout: fixed;
    font-size: 11px;
  }
  .leaderboard th, .leaderboard td {
    padding: 8px 4px;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.3;
  }
  .leaderboard th { font-size: 9.5px; letter-spacing: 0; padding: 8px 3px; }
  .leaderboard th:nth-child(2),
  .leaderboard td:nth-child(2),
  .leaderboard th:nth-child(3),
  .leaderboard td:nth-child(3) { text-align: center; }
  .leaderboard td:nth-child(1) { padding: 8px 2px; }   /* Rank */
  /* Keep agent/model icon a touch tighter */
  .model-icon { width: 14px; height: 14px; margin-right: 2px; vertical-align: -2px; }
  .hib-arrow { margin-left: 1px; font-size: 0.85em; }
  .leaderboard tbody td strong { font-size: 12px; }

  .comparison-table { font-size: 12px; }
  .comparison-table th, .comparison-table td {
    padding: 10px 6px;
    white-space: normal;
    word-break: break-word;
    line-height: 1.3;
  }
  .comparison-table th { font-size: 10.5px; letter-spacing: 0; }
  .comparison-table .yes, .comparison-table .no { font-size: 17px; }

  /* Family grid */
  .family-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .family-grid div { padding: 12px 14px; }
  .family-grid strong { font-size: 20px; }

  /* Cards */
  .rubric-grid { grid-template-columns: 1fr; }
  .property-grid, .finding-grid { gap: 14px; }
  .rubric-card, .property-grid article, .finding-grid article { padding: 16px 18px; }

  /* Demo cards: full screen width minus margin */
  .demo-card { flex: 0 0 calc(100vw - 32px); }
  .demo-card video, .demo-video-placeholder { aspect-ratio: 16 / 9; }
  .demo-content { gap: 12px; padding: 14px 16px 16px; }
  .demo-card h3 { font-size: 14px; }
  .demo-meta { font-size: 10px; }
  .score-overall { width: 100%; max-width: none; }
  .score-grid { width: 100%; }
  .play-link { align-self: stretch; justify-content: center; }

  /* Citation */
  .citation-box pre { padding: 16px 18px; padding-top: 56px; padding-right: 18px; font-size: 11.5px; }
  .citation-copy { top: 10px; right: 10px; padding: 5px 10px; font-size: 12px; }

  /* Visitor badge wraps nicely */
  footer p { padding: 0 14px; line-height: 1.6; }

  /* Back to top: smaller, pulled in */
  #back-to-top { display: none !important; }
}

/* ── PC-only banner for Try-to-Play (small screens only) ──────────────── */
.pc-only-banner {
  display: none;
  position: fixed;
  inset: auto 16px 16px 16px;
  z-index: 110;
  padding: 14px 18px;
  border: 1.5px solid var(--accent);
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  box-shadow: var(--shadow-up);
  animation: pc-banner-pop .25s ease-out;
}
.pc-only-banner.is-visible { display: flex; gap: 12px; align-items: flex-start; }
.pc-only-banner svg { flex-shrink: 0; width: 22px; height: 22px; color: var(--accent); margin-top: 1px; }
.pc-only-banner strong { display: block; margin-bottom: 2px; font-weight: 700; }
.pc-only-banner button {
  margin-left: auto; flex-shrink: 0;
  border: none; background: transparent; cursor: pointer;
  color: var(--ink-mute); font-size: 18px; line-height: 1;
  padding: 0 4px;
}
@keyframes pc-banner-pop {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Cursor glow + ripples ──────────────────────────────────────────────── */
#cursor-glow {
  position: fixed; top: 0; left: 0;
  width: 360px; height: 360px;
  margin: -180px 0 0 -180px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 60;
  opacity: 0;
  background: radial-gradient(circle at center,
    rgba(255,182,92,0.16) 0%,
    rgba(255,200,128,0.10) 32%,
    rgba(255,224,176,0.04) 56%,
    rgba(255,255,255,0) 72%);
  transform: translate3d(-9999px, -9999px, 0);
  transition: opacity 0.4s ease;
  will-change: transform;
}

.cursor-ripple {
  position: fixed; top: 0; left: 0;
  width: 22px; height: 22px;
  margin: -11px 0 0 -11px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 59;
  border: 1.5px solid rgba(255,176,80,0.32);
  opacity: 0;
  transform: translate3d(var(--x,-9999px), var(--y,-9999px), 0) scale(0.3);
  will-change: transform, opacity;
}
.cursor-ripple.go { animation: cursor-ripple-spread 0.8s ease-out forwards; }
@keyframes cursor-ripple-spread {
  0%   { opacity: 0.45; transform: translate3d(var(--x), var(--y), 0) scale(0.3); }
  100% { opacity: 0;    transform: translate3d(var(--x), var(--y), 0) scale(2.3); }
}
@media (hover: none), (prefers-reduced-motion: reduce) {
  #cursor-glow, .cursor-ripple { display: none; }
}

/* ─── Back to top ────────────────────────────────────────────────────────── */
#back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1.5px solid var(--rule-strong);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
  color: var(--ink-mute);
  box-shadow: var(--shadow-up);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity .25s ease, transform .25s ease, color .15s, background .15s;
}
#back-to-top svg { width: 18px; height: 18px; }
#back-to-top:hover { color: var(--accent); background: #fff; }
#back-to-top.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }

/* ─── Author / affiliation hover highlight ───────────────────────────────── */
.author, .aff {
  cursor: default;
  transition: color .15s, font-weight .15s;
}
.aff-dim { opacity: 0.35 !important; }
.aff-highlight { color: var(--ink) !important; }

/* ─── Model icons ────────────────────────────────────────────────────────── */
.model-icon {
  width: 18px;
  height: 18px;
  vertical-align: middle;
  margin-right: 6px;
  border-radius: 4px;
  object-fit: contain;
}

.model-label-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: contain;
  margin-bottom: 8px;
}

.visitor-badge {
  vertical-align: middle;
  margin-right: 6px;
  height: 14px;
  width: auto;
}

.btn-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
  margin-right: 4px;
}

/* ─── Play modal ─────────────────────────────────────────────────────────── */
.play-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.play-modal.is-open { display: flex; }

body.play-modal-open { overflow: hidden; }

.play-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 24, 32, 0.45);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  cursor: pointer;
  animation: play-modal-fade .18s ease-out;
}

.play-modal-frame {
  position: relative;
  width: min(1280px, 96vw, calc(92vh * 16 / 9));
  aspect-ratio: 16 / 9;
  max-height: 92vh;
  background: #0d1117;
  border: 0;
  border-radius: 0;
  /* layered hard shadows = pixel staircase */
  box-shadow:
    0 0 0 4px #0d1117,
    0 0 0 8px #00ff9d,
    0 0 0 12px #0d1117,
    0 0 0 14px #ff52a2,
    8px 8px 0 14px rgba(0,0,0,0.55);
  /* pixel corner notches via clip-path */
  clip-path: polygon(
    8px 0, calc(100% - 8px) 0, 100% 8px,
    100% calc(100% - 8px), calc(100% - 8px) 100%,
    8px 100%, 0 calc(100% - 8px), 0 8px
  );
  overflow: hidden;
  image-rendering: pixelated;
  animation: play-modal-pop .22s steps(4, end);
}

.play-modal-iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
  display: block;
}

.play-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border-radius: 0;
  border: 2px solid #0d1117;
  background: #ff52a2;
  color: #0d1117;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  box-shadow:
    0 0 0 2px #00ff9d,
    4px 4px 0 0 rgba(0,0,0,0.55);
  transition: transform .08s linear, box-shadow .08s linear;
}
.play-modal-close:hover {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 2px #00ff9d, 0 0 0 0 rgba(0,0,0,0);
}
.play-modal-close svg { width: 18px; height: 18px; }

@keyframes play-modal-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes play-modal-pop {
  from { opacity: 0; transform: translateY(-6px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 720px) {
  .play-modal { padding: 0; }
  .play-modal-frame {
    width: 100vw;
    height: 100vh;
    clip-path: none;
    box-shadow: none;
  }
}

.hib-arrow {
  display: inline-block;
  margin-left: 4px;
  color: var(--accent);
  font-size: 0.85em;
  font-weight: 700;
  vertical-align: baseline;
}

/* ─── Video placeholder for cards without recordings ─────────────────────── */
.demo-video-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  background:
    repeating-linear-gradient(45deg,
      rgba(255,255,255,0.04) 0 8px,
      rgba(255,255,255,0.00) 8px 16px),
    var(--code-bg);
  color: rgba(230, 237, 243, 0.55);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  user-select: none;
}

/* ─── Family grid: collapsible on mobile ─────────────────────────────────── */
.family-toggle {
  display: none;
  margin: 14px auto 0;
  padding: 9px 22px;
  border: 1.5px solid var(--rule-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.family-toggle:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-up);
  border-color: var(--accent);
  color: var(--accent);
}

@media (max-width: 820px) {
  .family-toggle { display: block; }
  /* Tablet 3-col → show first 9 (3 rows), hide rest */
  .family-grid:not(.is-expanded) > div:nth-child(n+10) { display: none; }
}
@media (max-width: 520px) {
  /* Phone 2-col → show first 6 (3 rows), hide rest */
  .family-grid:not(.is-expanded) > div:nth-child(n+7) { display: none; }
}

/* ─── Carousel swipe hint (mobile only) ──────────────────────────────────── */
.demo-carousel { position: relative; }
.demo-carousel::after {
  content: "← swipe to browse →";
  display: none;
  margin-top: 8px;
  text-align: center;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--ink-mute);
  animation: swipe-hint-pulse 2.4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes swipe-hint-pulse {
  0%, 100% { opacity: 0.45; transform: translateX(0); }
  25%      { opacity: 1;    transform: translateX(-3px); }
  75%      { opacity: 1;    transform: translateX(3px); }
}
@media (max-width: 820px) {
  .demo-carousel::after { display: block; }
}
