/* ============================================================
   AutoZyme — premium academic theme
   Light is default; dark activated via <html data-theme="dark">.
   ============================================================ */

/* ---------- theme variables ---------- */
:root {
  /* Light — warm paper */
  --bg: #fdfdfb;
  --bg-elev: #f5f4ee;
  --bg-card: #ffffff;
  --bg-soft: #f9f8f3;
  --bg-inset: #f3f1ea;
  --border: #e7e4d9;
  --border-strong: #c9c4b3;
  --border-subtle: #efede6;
  --text: #141419;
  --text-dim: #4b4b54;
  --text-faint: #9a9a9f;
  --accent: #0c4a6e;
  --accent-hover: #0b3d5c;
  --accent-soft: rgba(12, 74, 110, 0.08);
  --accent-hot: #9f1239;
  --accent-good: #166534;
  --accent-warn: #a16207;
  --on-accent: #fdfdfb;

  --seurat-tint: #1d4ed8;
  --seurat-soft: rgba(29, 78, 216, 0.08);
  --scanpy-tint: #be123c;
  --scanpy-soft: rgba(190, 18, 60, 0.07);

  --shadow-sm:
    0 1px 2px rgba(25, 25, 20, 0.04),
    0 1px 1px rgba(25, 25, 20, 0.025);
  --shadow-md:
    0 4px 12px rgba(25, 25, 20, 0.06),
    0 2px 4px rgba(25, 25, 20, 0.04);
  --shadow-hero:
    0 24px 60px rgba(25, 25, 20, 0.07),
    0 6px 18px rgba(25, 25, 20, 0.04);
  --ring-focus: 0 0 0 3px rgba(12, 74, 110, 0.22);

  --max-width: 1120px;
  --max-prose: 64ch;
  --radius: 14px;
  --radius-sm: 8px;
  --radius-pill: 999px;

  --serif: "Fraunces", "Iowan Old Style", "Source Serif Pro", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

[data-theme="dark"] {
  --bg: #0a0a0c;
  --bg-elev: #101014;
  --bg-card: #131318;
  --bg-soft: #0c0c10;
  --bg-inset: #09090c;
  --border: #23232a;
  --border-strong: #3a3a43;
  --border-subtle: #18181d;
  --text: #f3f3f2;
  --text-dim: #a6a6ad;
  --text-faint: #6e6e78;
  --accent: #7dd3fc;
  --accent-hover: #bae6fd;
  --accent-soft: rgba(125, 211, 252, 0.12);
  --accent-hot: #fb7185;
  --accent-good: #86efac;
  --accent-warn: #fcd34d;
  --on-accent: #0a0a0c;

  --seurat-tint: #93c5fd;
  --seurat-soft: rgba(147, 197, 253, 0.1);
  --scanpy-tint: #fda4af;
  --scanpy-soft: rgba(253, 164, 175, 0.1);

  --shadow-sm: 0 0 0 1px rgba(255, 255, 255, 0.02);
  --shadow-md:
    0 12px 28px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.02);
  --shadow-hero:
    0 28px 64px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.03);
  --ring-focus: 0 0 0 3px rgba(125, 211, 252, 0.25);
}

/* ---------- base ---------- */
* { box-sizing: border-box; }

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  font-feature-settings: "cv11", "ss01", "ss03";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Paper-grain texture in light mode — extremely subtle. */
body {
  background-image:
    radial-gradient(circle at 14% 8%, rgba(160, 120, 60, 0.03), transparent 55%),
    radial-gradient(circle at 92% 82%, rgba(12, 74, 110, 0.03), transparent 55%);
  background-attachment: fixed;
}
[data-theme="dark"] body {
  background-image:
    radial-gradient(circle at 14% 8%, rgba(125, 211, 252, 0.05), transparent 55%),
    radial-gradient(circle at 92% 82%, rgba(251, 113, 133, 0.04), transparent 55%);
}

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

:focus-visible {
  outline: none;
  box-shadow: var(--ring-focus);
  border-radius: var(--radius-sm);
}

a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 0.12s ease;
}
a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

code, pre {
  font-family: var(--mono);
  font-size: 0.88em;
  font-feature-settings: "tnum", "cv11";
}
code {
  background: var(--bg-inset);
  border: 1px solid var(--border-subtle);
  border-radius: 5px;
  padding: 1px 6px;
  color: var(--text);
}

h1, h2, h3 {
  text-wrap: balance;
  letter-spacing: -0.02em;
}

p { text-wrap: pretty; }

/* ---------- layout ---------- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 28px;
}

header.site {
  border-bottom: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
}
header.site .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 20px;
  letter-spacing: -0.02em;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.brand:hover { color: var(--text); text-decoration: none; }
.brand .mark {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, #7dd3fc, #0c4a6e 70%);
  box-shadow: 0 0 0 1px rgba(12, 74, 110, 0.25), inset 0 0 6px rgba(255, 255, 255, 0.25);
}
[data-theme="dark"] .brand .mark {
  background: radial-gradient(circle at 30% 30%, #bae6fd, #075985 70%);
  box-shadow: 0 0 0 1px rgba(125, 211, 252, 0.35), inset 0 0 6px rgba(255, 255, 255, 0.2);
}

nav.site {
  display: flex;
  align-items: center;
}
nav.site a {
  color: var(--text-dim);
  margin-left: 24px;
  font-size: 14px;
  font-weight: 500;
  position: relative;
  padding: 4px 0;
}
nav.site a:hover {
  color: var(--text);
  text-decoration: none;
}
nav.site a.active {
  color: var(--text);
}
nav.site a.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -21px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
}

a.gh-link {
  margin-left: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: color 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}
a.gh-link:hover {
  color: var(--text);
  background: var(--bg-soft);
  border-color: var(--border);
  text-decoration: none;
}
a.gh-link svg { display: block; }

button.theme-toggle {
  margin-left: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: var(--radius-pill);
  padding: 5px 12px;
  font-size: 11px;
  font-family: var(--mono);
  cursor: pointer;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: border-color 0.12s ease, color 0.12s ease, background 0.12s ease;
}
button.theme-toggle:hover {
  border-color: var(--border-strong);
  color: var(--text);
  background: var(--bg-soft);
}
button.theme-toggle .label-dark { display: inline; }
button.theme-toggle .label-light { display: none; }
[data-theme="dark"] button.theme-toggle .label-dark { display: none; }
[data-theme="dark"] button.theme-toggle .label-light { display: inline; }

footer.site {
  border-top: 1px solid var(--border-subtle);
  padding: 40px 0 56px;
  color: var(--text-faint);
  font-size: 13px;
  margin-top: 96px;
}
footer.site .container {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
footer.site a { color: var(--text-dim); }
footer.site a:hover { color: var(--text); }

/* ---------- hero ---------- */
.hero {
  padding: 96px 0 80px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 50% 40% at 10% 15%, var(--accent-soft), transparent 70%),
    radial-gradient(ellipse 45% 35% at 95% 90%, var(--seurat-soft), transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.hero > .container { position: relative; z-index: 1; }

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--radius-pill);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-dim);
  box-shadow: var(--shadow-sm);
  margin-bottom: 28px;
  animation: az-fade-up 0.6s ease both;
}
.hero-kicker .pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-good);
  box-shadow: 0 0 0 0 var(--accent-good);
  animation: az-pulse 2.4s ease-in-out infinite;
}
@keyframes az-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent-good) 45%, transparent); }
  50%      { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent-good) 0%, transparent); }
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.04;
  margin: 0 0 20px;
  letter-spacing: -0.025em;
  max-width: 18ch;
  animation: az-fade-up 0.75s ease 0.06s both;
}
.hero h1 em {
  font-style: italic;
  font-variation-settings: "opsz" 144;
  color: var(--accent);
  font-weight: 400;
}
.hero p.lede {
  font-size: 19px;
  line-height: 1.55;
  color: var(--text-dim);
  max-width: 60ch;
  margin: 0 0 32px;
  animation: az-fade-up 0.8s ease 0.12s both;
}
.hero .cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  animation: az-fade-up 0.85s ease 0.18s both;
}
.hero .cta a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 14.5px;
  font-weight: 500;
  background: var(--bg-card);
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
  box-shadow: var(--shadow-sm);
}
.hero .cta a:hover {
  border-color: var(--border-strong);
  text-decoration: none;
  transform: translateY(-1px);
}
.hero .cta a.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}
.hero .cta a.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--on-accent);
}
.hero .cta a .arrow {
  transition: transform 0.15s ease;
  display: inline-block;
}
.hero .cta a:hover .arrow { transform: translateX(2px); }

.hero-footnote {
  margin-top: 44px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-faint);
  letter-spacing: 0.02em;
  animation: az-fade-up 0.9s ease 0.26s both;
}
.hero-footnote .sep { margin: 0 12px; color: var(--border-strong); }
.hero-footnote a { color: var(--text-dim); }
.hero-footnote a:hover { color: var(--accent); }

@keyframes az-fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- sections ---------- */
section { padding: 72px 0; }
section h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(28px, 3vw, 36px);
  letter-spacing: -0.022em;
  margin: 0 0 10px;
  line-height: 1.15;
}
.section-head {
  margin-bottom: 32px;
  max-width: 60ch;
}
.section-head h2 { margin-bottom: 6px; }
.section-head .sub {
  color: var(--text-faint);
  font-size: 14px;
  font-family: var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
section h2 .subtitle {
  color: var(--text-faint);
  font-weight: 400;
  font-size: 14px;
  font-family: var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-left: 10px;
  font-style: normal;
}

hr.ornament {
  border: none;
  margin: 0;
  height: 24px;
  background:
    radial-gradient(circle, var(--border-strong) 1px, transparent 1.5px) center / 10px 24px repeat-x;
  opacity: 0.55;
}

/* ---------- journal-style stats row ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0;
  padding: 28px 0 8px;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-soft);
  border-radius: var(--radius);
}
.stat {
  padding: 22px 26px;
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.stat:last-child { border-right: none; }
.stat .v {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 42px;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.stat .v .unit {
  color: var(--text-faint);
  font-size: 22px;
  font-weight: 400;
  margin-left: 2px;
  letter-spacing: -0.01em;
  font-family: var(--serif);
}
.stat .l {
  color: var(--text-faint);
  font-size: 11.5px;
  font-family: var(--mono);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  margin-top: 6px;
}

/* ---------- card grid ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 22px 20px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.15s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}
.card:hover::before { opacity: 0.7; }

.card .title {
  font-weight: 600;
  font-size: 15.5px;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-top: 12px;
}
.card .sub {
  color: var(--text-faint);
  font-size: 12px;
  margin-top: 4px;
  font-family: var(--mono);
  letter-spacing: 0.02em;
}
.card .speedup {
  margin-top: 16px;
  font-family: var(--serif);
  font-size: 40px;
  font-weight: 400;
  color: var(--accent-good);
  letter-spacing: -0.025em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.card .detail {
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  font-size: 12px;
  color: var(--text-dim);
  font-family: var(--mono);
  display: flex;
  align-items: center;
  gap: 4px;
}
.card .detail span.arrow { color: var(--text-faint); margin: 0 4px; }

.card.package-card .title { font-size: 20px; margin-top: 14px; font-family: var(--serif); font-weight: 500; letter-spacing: -0.01em; }
.card.package-card .sub { margin-top: 2px; }
.card.package-card .list {
  margin-top: 14px;
  color: var(--text-dim);
  font-size: 13.5px;
  line-height: 1.7;
}
.card.package-card .list code {
  margin: 0 2px;
}
.card.package-card .repo-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-dim);
  letter-spacing: 0.02em;
  width: 100%;
}
.card.package-card .repo-link:hover { color: var(--accent); text-decoration: none; }
.card.package-card .repo-link svg { flex-shrink: 0; }
.card.package-card .repo-link .arr { margin-left: auto; color: var(--text-faint); transition: transform 0.15s ease; }
.card.package-card .repo-link:hover .arr { transform: translateX(3px); color: var(--accent); }

/* suggestion ref_url link */
.sugg .ref-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  margin-left: 8px;
}
.sugg .ref-link:hover { text-decoration: none; background: color-mix(in srgb, var(--accent) 15%, transparent); }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 10.5px;
  font-family: var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  color: var(--text-dim);
  background: var(--bg-inset);
}
.badge.seurat { border-color: color-mix(in srgb, var(--seurat-tint) 35%, transparent); color: var(--seurat-tint); background: var(--seurat-soft); }
.badge.scanpy { border-color: color-mix(in srgb, var(--scanpy-tint) 35%, transparent); color: var(--scanpy-tint); background: var(--scanpy-soft); }

/* ---------- table ---------- */
.table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}
table.benchmarks {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
table.benchmarks th,
table.benchmarks td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}
table.benchmarks th {
  background: var(--bg-soft);
  color: var(--text-dim);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  cursor: pointer;
  user-select: none;
  font-family: var(--mono);
  transition: color 0.12s ease;
}
table.benchmarks th:hover { color: var(--text); }
table.benchmarks th.active { color: var(--accent); }
table.benchmarks th.active::after { content: " ▾"; font-size: 9px; }
table.benchmarks th.active.asc::after { content: " ▴"; }
table.benchmarks tr:last-child td { border-bottom: none; }
table.benchmarks tr { transition: background 0.1s ease; }
table.benchmarks tbody tr:hover td { background: var(--bg-soft); }

td.num { font-family: var(--mono); text-align: right; font-variant-numeric: tabular-nums; }
td.speedup { color: var(--accent-good); font-weight: 600; }
td.speedup.low { color: var(--accent-warn); }
.pill-pass { color: var(--accent-good); font-weight: 600; }
.pill-fail { color: var(--accent-hot); font-weight: 600; }

.table-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.table-filters select,
.table-filters input {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 8px 12px;
  font-size: 13.5px;
  font-family: var(--sans);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.table-filters input:focus,
.table-filters select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--ring-focus);
}

/* ---------- suggestions ---------- */
.sugg-list { display: flex; flex-direction: column; gap: 14px; }
.sugg {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.sugg:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }

.sugg .votes {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding-top: 2px;
}
.sugg .votes button {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: var(--radius-sm);
  padding: 5px 9px;
  cursor: pointer;
  font-size: 13px;
  font-family: var(--mono);
  transition: all 0.12s ease;
  width: 44px;
}
.sugg .votes button:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.sugg .votes button.active-up {
  color: var(--accent-good);
  border-color: var(--accent-good);
  background: color-mix(in srgb, var(--accent-good) 10%, transparent);
}
.sugg .votes button.active-down {
  color: var(--accent-hot);
  border-color: var(--accent-hot);
  background: color-mix(in srgb, var(--accent-hot) 10%, transparent);
}
.sugg .votes .score {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 400;
  min-width: 36px;
  text-align: center;
  padding: 4px 0;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.sugg .body .title { font-weight: 600; font-size: 16px; letter-spacing: -0.01em; }
.sugg .body .meta {
  color: var(--text-faint);
  font-size: 12px;
  margin-top: 4px;
  font-family: var(--mono);
  letter-spacing: 0.02em;
}
.sugg .body .desc {
  margin-top: 10px;
  color: var(--text-dim);
  font-size: 14.5px;
  line-height: 1.6;
  white-space: pre-wrap;
}
.sugg .body .actions {
  margin-top: 12px;
  font-size: 13px;
}
.sugg .body .actions a.toggle-comments,
.sugg .body .actions a[data-toggle-comments] {
  color: var(--text-dim);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 12.5px;
}
.sugg .body .actions a:hover { color: var(--accent); text-decoration: none; }

.comments {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
  display: none;
}
.comments.open { display: block; }
.comment {
  padding: 10px 0;
  border-bottom: 1px dashed var(--border-subtle);
  font-size: 13.5px;
}
.comment:last-of-type { border-bottom: none; }
.comment .author { color: var(--text-dim); font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.02em; }
.comment .text { margin-top: 4px; white-space: pre-wrap; line-height: 1.55; }

.form-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.form-row label {
  font-size: 11px;
  color: var(--text-faint);
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 500;
}
.form-row input,
.form-row textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px 12px;
  font-family: var(--sans);
  font-size: 14.5px;
  resize: vertical;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.form-row input:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--ring-focus);
}
button.submit {
  background: var(--accent);
  border: none;
  color: var(--on-accent);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  font-family: var(--sans);
  transition: background 0.12s ease, transform 0.12s ease;
  box-shadow: var(--shadow-sm);
}
button.submit:hover { background: var(--accent-hover); transform: translateY(-1px); }
button.submit:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.flash {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 13.5px;
  display: none;
}
.flash.ok {
  background: color-mix(in srgb, var(--accent-good) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent-good) 40%, transparent);
  color: var(--accent-good);
  display: block;
}
.flash.err {
  background: color-mix(in srgb, var(--accent-hot) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent-hot) 40%, transparent);
  color: var(--accent-hot);
  display: block;
}

.new-sugg-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-sm);
}
.new-sugg-form h3 {
  margin: 0 0 14px;
  font-size: 18px;
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.01em;
}

.loading { color: var(--text-faint); font-style: italic; }

.comment-form {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}
.comment-form input[name="author"] { flex: 0 0 160px; }
.comment-form input[name="text"] { flex: 1; }

hr.sep { border: none; border-top: 1px solid var(--border); margin: 28px 0; }

/* ---------- long-form copy ---------- */
.prose { max-width: var(--max-prose); }
.prose p { color: var(--text-dim); font-size: 16px; line-height: 1.75; }
.prose ul { color: var(--text-dim); font-size: 16px; line-height: 1.75; padding-left: 22px; }
.prose li { margin-bottom: 8px; }
.prose h2 { font-size: 34px; margin-top: 0; }
.prose h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 22px;
  margin-top: 36px;
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}
.prose em { font-family: var(--serif); font-style: italic; color: var(--text); }
.prose strong { color: var(--text); font-weight: 600; }

/* ---------- preprint pill (hero footnote addendum) ---------- */
.preprint-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 10px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-pill);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
  background: transparent;
  margin-right: 8px;
}
.preprint-pill .tag {
  color: var(--text-dim);
  font-weight: 500;
}

/* ---------- benchmark figure ---------- */
.fig-frame {
  margin-top: 24px;
  padding: 28px 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.fig-frame img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 960px;
  margin: 0 auto;
}
/* Invert trick for scientific figures on dark backgrounds — preserves accent
   hues (hue-rotate 180) while flipping the white/black polarity. Standard
   technique on arxiv-sanity, distill-style blogs, etc. */
[data-theme="dark"] .fig-frame img {
  filter: invert(0.92) hue-rotate(180deg);
  background: #fff;
  border-radius: 4px;
}
.fig-caption {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.6;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: space-between;
  align-items: baseline;
}
.fig-caption .fig-num {
  font-family: var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-size: 11.5px;
  margin-right: 6px;
}
.fig-caption .fig-download {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

/* ---------- install / quickstart code blocks ---------- */
.install-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
}
.install-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}
.install-card .head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.install-card .head .lang {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.install-card pre {
  margin: 0;
  padding: 14px 16px;
  background: var(--bg-inset);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text);
  overflow-x: auto;
  white-space: pre;
  font-family: var(--mono);
}
.install-card pre .comment { color: var(--text-faint); }
.install-card pre .kw { color: var(--accent); }
.install-card .note {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-faint);
  font-family: var(--mono);
  letter-spacing: 0.02em;
}

/* ---------- authors ---------- */
.authors {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.author-card {
  padding: 16px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.author-card .name {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 17px;
  letter-spacing: -0.01em;
}
.author-card .role {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-top: 2px;
}
.author-card .affil {
  color: var(--text-dim);
  font-size: 14px;
  margin-top: 8px;
  line-height: 1.45;
}
.author-card .links {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.author-card .links a { color: var(--text-dim); }
.author-card .links a:hover { color: var(--accent); }

/* ---------- datasets table ---------- */
.datasets-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  font-size: 14px;
}
.datasets-table th,
.datasets-table td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
}
.datasets-table thead th {
  background: var(--bg-soft);
  color: var(--text-dim);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-family: var(--mono);
}
.datasets-table tr:last-child td { border-bottom: none; }
.datasets-table td code { font-size: 12.5px; }
.datasets-table .cells { font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap; }

/* ---------- cite block ---------- */
.cite-block {
  margin-top: 80px;
  padding: 28px 30px;
  background: var(--bg-soft);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
}
.cite-block h3 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 17px;
  letter-spacing: -0.01em;
}
.cite-block pre {
  margin: 0;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-dim);
  overflow-x: auto;
  white-space: pre;
}

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .container { padding: 0 20px; }
  .hero { padding: 64px 0 56px; }
  section { padding: 56px 0; }
  nav.site a { margin-left: 16px; font-size: 13px; }
  nav.site a.active::after { bottom: -21px; }
  .stats { border-radius: var(--radius); }
  .stat {
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    padding: 16px 20px;
  }
  .stat:last-child { border-bottom: none; }
  .stat .v { font-size: 34px; }
  .hero-footnote { margin-top: 32px; }
  .card.package-card .title { font-size: 18px; }
  header.site .container { height: 56px; }
  nav.site a.active::after { bottom: -17px; }
}

/* ---------- mobile: convert benchmark table to stacked cards ---------- */
@media (max-width: 640px) {
  .table-wrap { border: none; border-radius: 0; box-shadow: none; background: transparent; overflow: visible; }
  table.benchmarks { font-size: 14px; }
  table.benchmarks thead { display: none; }
  table.benchmarks, table.benchmarks tbody, table.benchmarks tr, table.benchmarks td { display: block; width: 100%; }
  table.benchmarks tr {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 12px;
    padding: 14px 16px;
    box-shadow: var(--shadow-sm);
  }
  table.benchmarks tr:hover td { background: transparent; }
  table.benchmarks td {
    padding: 6px 0;
    border-bottom: none;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
  }
  table.benchmarks td::before {
    content: attr(data-label);
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--text-faint);
    flex-shrink: 0;
  }
  table.benchmarks td.num { text-align: right; }
  /* Highlight the two most important fields, let others be quieter */
  table.benchmarks td[data-label="Speedup"] {
    font-size: 20px;
    font-weight: 600;
    padding: 8px 0 6px;
    border-top: 1px solid var(--border-subtle);
    margin-top: 4px;
  }
  table.benchmarks td[data-label="Speedup"]::before { font-size: 10.5px; letter-spacing: 0.09em; }

  /* Install cards full-width on mobile */
  .install-card pre { font-size: 11.5px; }
  .fig-frame { padding: 16px; }
  .fig-caption { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
