@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&display=swap');

/* ============================================================
   BenchCAD — design system
   Adapted from terminal-bench (tbench.ai): near-black, monospace,
   light/dark theme. The only color comes from the CAD renders.
   ============================================================ */

/* ---- Theme tokens ---------------------------------------- */
:root {
  /* dark (default) — values mirror tbench.ai */
  --bg: #080808;
  --bg-soft: #0d0d0d;
  --card: #121212;
  --muted: #1a1a1a;
  --border: #2a2a2a;
  --border-soft: #1d1d1d;
  --fg: #fafafa;
  --fg-dim: #9b9b9b;
  --fg-dimmer: #6a6a6a;
  --primary: #ededed;        /* inverted button fill */
  --primary-fg: #0a0a0a;
  --ours: rgba(255, 255, 255, 0.05); /* subtle highlight, still monochrome */
  --ring: rgba(255, 255, 255, 0.16);

  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, "Liberation Mono", "Courier New", monospace;
  --font-sans: "Geist", "Geist Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Space Grotesk", "Geist", system-ui, sans-serif;

  --accent: #ff7a2e;          /* industrial amber */
  --accent-soft: rgba(255, 122, 46, 0.15);
  --accent-ink: #1a0f06;      /* text on amber fills */
  --grid: rgba(190, 175, 160, 0.05);
  --sheet: #f4f1ea;           /* drawing-sheet paper */
  --sheet-ink: #2a2620;
  --sheet-line: #cfc9bd;

  --maxw: 1200px;
  --radius: 4px;
  --pad: 24px;
}

:root[data-theme="light"] {
  --bg: #ffffff;
  --bg-soft: #fafafa;
  --card: #fcfcfc;
  --muted: #f3f3f3;
  --border: #e4e4e4;
  --border-soft: #eeeeee;
  --fg: #0b0b0b;
  --fg-dim: #5f5f5f;
  --fg-dimmer: #8d8d8d;
  --primary: #0b0b0b;
  --primary-fg: #fafafa;
  --ours: rgba(0, 0, 0, 0.04);
  --ring: rgba(0, 0, 0, 0.14);
  --accent: #c2560a;
  --accent-soft: rgba(194, 86, 10, 0.12);
  --grid: rgba(120, 100, 80, 0.06);
}

@media (prefers-color-scheme: light) {
  :root[data-theme="system"] {
    --bg: #ffffff;
    --bg-soft: #fafafa;
    --card: #fcfcfc;
    --muted: #f3f3f3;
    --border: #e4e4e4;
    --border-soft: #eeeeee;
    --fg: #0b0b0b;
    --fg-dim: #5f5f5f;
    --fg-dimmer: #8d8d8d;
    --primary: #0b0b0b;
    --primary-fg: #fafafa;
    --ours: rgba(0, 0, 0, 0.04);
    --ring: rgba(0, 0, 0, 0.14);
    --accent: #c2560a;
    --accent-soft: rgba(194, 86, 10, 0.12);
    --grid: rgba(120, 100, 80, 0.06);
  }
}

/* ---- Reset / base ---------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; display: block; }
code, pre, .mono { font-family: var(--font-mono); }
::selection { background: var(--fg); color: var(--bg); }
hr { border: none; border-top: 1px solid var(--border); margin: 0; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); }
.section { padding: 72px 0; }
.section--soft { background: var(--bg-soft); border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); }
.center { text-align: center; }
.dim { color: var(--fg-dim); }
.nowrap { white-space: nowrap; }

/* ---- Nav -------------------------------------------------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.nav__inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad);
  height: 56px; display: flex; align-items: center; gap: 28px;
}
.brand {
  font-family: var(--font-mono); font-weight: 600; font-size: 16px;
  letter-spacing: -0.02em; display: inline-flex; align-items: center; gap: 9px;
  text-transform: lowercase; white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand__prompt { color: var(--fg-dim); }
/* isometric CAD cube mark — line art in currentColor, adapts to theme */
.brand__cube { width: 1.12em; height: 1.12em; flex: none; vertical-align: -0.18em; }
.nav__links { display: flex; align-items: center; gap: 22px; margin-left: 6px; }
.nav__links a {
  font-family: var(--font-mono); font-size: 13.5px; color: var(--fg-dim);
  transition: color .15s;
}
.nav__links a:hover, .nav__links a.is-active { color: var(--fg); text-decoration: none; }
.nav__spacer { flex: 1; }
.nav__right { display: flex; align-items: center; gap: 12px; }

/* theme toggle (3-state segmented, like tbench.ai) */
.theme-toggle {
  display: inline-flex; align-items: center; gap: 2px;
  border: 1px solid var(--border); border-radius: 999px; padding: 3px;
  background: var(--muted);
}
.theme-toggle button {
  all: unset; cursor: pointer; width: 26px; height: 22px;
  display: grid; place-items: center; border-radius: 999px; color: var(--fg-dimmer);
  transition: background .15s, color .15s;
}
.theme-toggle button svg { width: 14px; height: 14px; }
.theme-toggle button[aria-pressed="true"] { background: var(--bg); color: var(--fg); box-shadow: 0 0 0 1px var(--border); }
.theme-toggle button:hover { color: var(--fg); }

.iconlink { color: var(--fg-dim); display: grid; place-items: center; width: 30px; height: 30px; border-radius: var(--radius); }
.iconlink:hover { color: var(--fg); background: var(--muted); text-decoration: none; }
.iconlink svg { width: 19px; height: 19px; }

.nav__burger { all: unset; cursor: pointer; display: none; color: var(--fg); width: 32px; height: 32px; place-items: center; }
.nav__burger svg { width: 22px; height: 22px; }

/* ---- Buttons --------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 13px; line-height: 1;
  text-transform: uppercase; letter-spacing: 0.04em;
  padding: 13px 20px; border-radius: var(--radius);
  border: 1px solid var(--border); background: transparent; color: var(--fg);
  cursor: pointer; transition: background .15s, border-color .15s, transform .05s;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; background: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--primary); color: var(--primary-fg); border-color: var(--primary); }
.btn--primary:hover { background: color-mix(in srgb, var(--primary) 88%, var(--fg)); }
.btn--sm { padding: 8px 14px; font-size: 13px; }
.btn svg { width: 15px; height: 15px; }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

/* ---- Hero ------------------------------------------------- */
.hero { padding: 84px 0 64px; position: relative; isolation: isolate; }
.hero::before {
  content: ""; position: absolute; inset: -40px 0 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px),
                    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 34px 34px; background-position: center top;
  -webkit-mask-image: radial-gradient(ellipse 72% 58% at 50% 34%, #000 28%, transparent 74%);
  mask-image: radial-gradient(ellipse 72% 58% at 50% 34%, #000 28%, transparent 74%);
}
/* dimension-line annotation — CAD drafting accent */
.dimline { display: flex; align-items: center; gap: 12px; justify-content: center; max-width: 480px; margin: 24px auto 0; color: var(--accent); font-family: var(--font-mono); font-size: 12px; }
.dimline__bar { flex: 1; height: 0; border-top: 1px solid var(--accent); position: relative; opacity: .55; }
.dimline__bar::before, .dimline__bar::after { content: ""; position: absolute; top: -4px; width: 1px; height: 9px; background: var(--accent); }
.dimline__bar::before { left: 0; } .dimline__bar::after { right: 0; }
.dimline__label { white-space: nowrap; letter-spacing: .05em; }

/* ===== Industrial hero: two-column + engineering drawing sheet ===== */
.hero__grid { display: grid; grid-template-columns: 1.06fr 0.94fr; gap: 52px; align-items: center; }
.hero__text { text-align: left; }
.hero__kicker { font-family: var(--font-mono); font-size: 12px; color: var(--accent); text-transform: uppercase; letter-spacing: .18em; display: inline-flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.hero__kicker::before { content: ""; width: 26px; height: 1px; background: var(--accent); }
.hero__text h1 { margin: 0; max-width: 14ch; font-size: clamp(34px, 4.3vw, 58px); }
.hero__text .hero__sub { margin: 20px 0 0; text-align: left; max-width: 50ch; }
.hero__text .dimline { margin: 22px 0 0; max-width: 400px; justify-content: flex-start; }
.hero__text .btn-row { justify-content: flex-start; margin-top: 28px; }

/* drawing sheet */
.sheet { position: relative; background: var(--sheet); border: 1px solid var(--sheet-line); border-radius: 3px; aspect-ratio: 4 / 3; box-shadow: 0 24px 64px rgba(0,0,0,.45), 0 0 0 1px rgba(0,0,0,.08); }
.sheet__inner { position: absolute; inset: 13px; border: 1px solid #b9b2a4; display: grid; place-items: center; overflow: hidden; }
.sheet__part { max-width: 64%; max-height: 66%; mix-blend-mode: multiply; }
.sheet__tag { position: absolute; top: 22px; left: 24px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em; color: #6a6256; text-transform: uppercase; z-index: 3; }
.sheet__corner { position: absolute; width: 13px; height: 13px; border: 0 solid var(--accent); z-index: 3; }
.sheet__corner--tl { top: 7px; left: 7px; border-top-width: 2px; border-left-width: 2px; }
.sheet__corner--tr { top: 7px; right: 7px; border-top-width: 2px; border-right-width: 2px; }
.sheet__corner--bl { bottom: 7px; left: 7px; border-bottom-width: 2px; border-left-width: 2px; }
.sheet__corner--br { bottom: 7px; right: 7px; border-bottom-width: 2px; border-right-width: 2px; }
.sheet__dimh { position: absolute; left: 26%; right: 26%; bottom: 62px; height: 0; border-top: 1px solid #6f675a; z-index: 3; }
.sheet__dimh::before, .sheet__dimh::after { content: ""; position: absolute; top: -4px; width: 1px; height: 9px; background: #6f675a; }
.sheet__dimh::before { left: 0; } .sheet__dimh::after { right: 0; }
.sheet__dimh span { position: absolute; left: 50%; top: 0; transform: translate(-50%, -50%); background: var(--sheet); padding: 0 6px; font-family: var(--font-mono); font-size: 11px; color: #5b5346; }
.sheet__dimv { position: absolute; top: 25%; bottom: 32%; right: 58px; width: 0; border-left: 1px solid #6f675a; z-index: 3; }
.sheet__dimv::before, .sheet__dimv::after { content: ""; position: absolute; left: -4px; width: 9px; height: 1px; background: #6f675a; }
.sheet__dimv::before { top: 0; } .sheet__dimv::after { bottom: 0; }
.sheet__dimv span { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); white-space: nowrap; font-family: var(--font-mono); font-size: 11px; color: #5b5346; }
.sheet__tb { position: absolute; right: -1px; bottom: -1px; display: grid; grid-auto-flow: column; border-top: 1px solid #b9b2a4; border-left: 1px solid #b9b2a4; background: var(--sheet); z-index: 4; }
.sheet__tb div { padding: 7px 13px; border-right: 1px solid #d8d2c6; font-family: var(--font-mono); font-size: 9.5px; color: #837a6c; text-transform: uppercase; letter-spacing: .05em; }
.sheet__tb div:last-child { border-right: none; }
.sheet__tb b { display: block; color: #2a2620; font-size: 12px; letter-spacing: 0; text-transform: none; margin-top: 1px; }

/* engineering title block (page bottom band) */
.titleblock { display: grid; grid-template-columns: repeat(6, 1fr); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin: 8px 0 0; }
.titleblock div { padding: 14px 16px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.titleblock div:nth-child(6n) { border-right: none; }
.titleblock .tb-k { font-family: var(--font-mono); font-size: 10px; color: var(--fg-dimmer); text-transform: uppercase; letter-spacing: .12em; }
.titleblock .tb-v { font-family: var(--font-mono); font-size: 16px; color: var(--fg); margin-top: 5px; letter-spacing: -0.01em; }
.titleblock .tb-v.accent { color: var(--accent); }
@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; gap: 36px; }
  .hero__visual { order: -1; }
  .titleblock { grid-template-columns: repeat(3, 1fr); }
  .titleblock div:nth-child(6n) { border-right: 1px solid var(--border); }
  .titleblock div:nth-child(3n) { border-right: none; }
}
@media (max-width: 560px) { .titleblock { grid-template-columns: repeat(2, 1fr); } .sheet__tb { display: none; } }
.hero h1 {
  font-family: var(--font-display); font-weight: 600; text-transform: lowercase;
  letter-spacing: -0.025em; line-height: 1.05; margin: 0 auto;
  font-size: clamp(36px, 6vw, 74px); max-width: 19ch;
}
.hero h1 .accent { color: var(--accent); }
.hero__sub {
  font-family: var(--font-mono); color: var(--fg-dim);
  font-size: clamp(14px, 1.6vw, 18px); margin: 22px auto 0; max-width: 60ch; line-height: 1.55;
}
.hero__sub a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--accent-soft); }
.hero__authors { font-size: 13.5px; color: var(--fg-dim); margin: 26px auto 0; max-width: 70ch; }
.hero__authors b { color: var(--fg); font-weight: 500; }
.hero__collab { font-family: var(--font-mono); font-size: 13px; color: var(--fg-dimmer); margin: 26px auto 0; }
.hero__collab a { color: var(--fg-dim); }
.hero__collab a:hover { color: var(--fg); }

/* prose (about page) */
.prose { max-width: 70ch; margin: 0 auto; color: var(--fg-dim); }
.prose p { margin: 0 0 1em; }
.prose b { color: var(--fg); font-weight: 600; }
.prose code { font-size: 13px; color: var(--fg); }
.prose ul { padding-left: 1.1em; }
.prose li { margin: .4em 0; }

/* stat strip */
.stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 0; margin: 40px auto 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; width: fit-content; max-width: 100%; }
.stat { padding: 18px 26px; text-align: center; border-right: 1px solid var(--border); min-width: 120px; }
.stat:last-child { border-right: none; }
.stat__n { font-family: var(--font-mono); font-size: 26px; font-weight: 600; letter-spacing: -0.02em; }
.stat__l { font-size: 11.5px; color: var(--fg-dim); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.06em; }

/* ---- Affiliations strip ---------------------------------- */
.affil { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 20px; margin: 34px auto 0; }
.affil__item { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; color: var(--fg-dim); transition: color .15s; }
.affil__item:hover { color: var(--fg); text-decoration: none; }
.affil__item svg { height: 17px; width: auto; }
.affil__sep { color: var(--fg-dimmer); user-select: none; }
/* institution wordmark logos — official marks rendered monochrome via mask + currentColor */
.affil__logo { display: inline-block; background: currentColor; flex: none;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-size: contain; mask-size: contain;
  -webkit-mask-position: center; mask-position: center; }
.affil__logo--rice { width: 67px; height: 26px; -webkit-mask-image: url(../img/logos/rice-mark.png); mask-image: url(../img/logos/rice-mark.png); }
.affil__logo--uva  { width: 88px; height: 28px; -webkit-mask-image: url(../img/logos/uva-mark.png); mask-image: url(../img/logos/uva-mark.png); }

/* hero "trusted by" strip */
.trustedby { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 20px; margin: 34px auto 0; }
.trustedby__label { font-family: var(--font-mono); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--fg-dimmer); margin-right: 2px; }

/* ---- Cards ------------------------------------------------ */
.cards { display: grid; gap: 16px; }
.cards--2 { grid-template-columns: repeat(2, 1fr); }
.cards--3 { grid-template-columns: repeat(3, 1fr); }
.cards--4 { grid-template-columns: repeat(4, 1fr); }
.card {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--card); padding: 22px; transition: border-color .15s, background .15s;
  display: block;
}
a.card:hover, .card--link:hover { border-color: var(--ring); text-decoration: none; background: var(--muted); }
.card__eyebrow { font-family: var(--font-mono); font-size: 12px; color: var(--fg-dim); display: flex; align-items: center; gap: 8px; }
.card__title { font-family: var(--font-display); font-weight: 600; font-size: 18px; margin: 10px 0 8px; letter-spacing: -0.01em; }
.card__title code { font-size: 13px; color: var(--fg-dim); font-weight: 500; }
.card p { color: var(--fg-dim); font-size: 14px; margin: 0; }
.card .arrow { margin-left: auto; color: var(--fg-dimmer); }

.section__head { text-align: center; margin-bottom: 38px; }
.section__kicker { font-family: var(--font-mono); font-size: 12px; color: var(--accent); text-transform: uppercase; letter-spacing: 0.16em; display: inline-flex; align-items: center; gap: 8px; }
.section__kicker::before { content: ""; width: 14px; height: 1px; background: var(--accent); }
.section__title { font-family: var(--font-display); font-weight: 600; font-size: clamp(25px, 3.4vw, 35px); letter-spacing: -0.02em; margin: 10px 0 0; }
.section__lead { color: var(--fg-dim); max-width: 64ch; margin: 14px auto 0; font-size: 15px; }

/* ---- Code box (run / submission) ------------------------- */
.codebox { border: 1px solid var(--border); border-radius: var(--radius); background: var(--muted); overflow: hidden; text-align: left; }
.codebox__tabs { display: flex; border-bottom: 1px solid var(--border); }
.codebox__tab { all: unset; cursor: pointer; font-family: var(--font-mono); font-size: 13px; padding: 10px 16px; color: var(--fg-dim); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.codebox__tab[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--fg); }
.codebox__note { font-family: var(--font-mono); font-size: 12.5px; color: var(--fg-dim); padding: 10px 16px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.codebox__body { position: relative; }
.codebox pre { margin: 0; padding: 16px; overflow-x: auto; font-size: 13.5px; line-height: 1.6; }
.codebox .tok-cmd { color: var(--fg); }
.codebox .tok-flag { color: var(--fg-dim); }
.codebox .tok-str { color: var(--fg-dim); }
.copy-btn { all: unset; cursor: pointer; color: var(--fg-dimmer); display: inline-grid; place-items: center; padding: 4px; border-radius: 4px; }
.copy-btn:hover { color: var(--fg); background: var(--bg); }
.copy-btn.is-copied { color: var(--fg); }
.copy-btn svg { width: 15px; height: 15px; }
.codebox__copy-abs { position: absolute; top: 10px; right: 10px; }

/* ---- Gallery (renders) ----------------------------------- */
.gallery { display: grid; grid-template-columns: repeat(8, 1fr); gap: 10px; }
.tile { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); overflow: hidden; }
.tile img { aspect-ratio: 1; object-fit: contain; background: #0c0c0c; width: 100%; }
:root[data-theme="light"] .tile img, :root[data-theme="system"] .tile img { background: #f0f0f0; }
@media (prefers-color-scheme: light) { :root[data-theme="system"] .tile img { background: #f0f0f0; } }
.tile__l { font-family: var(--font-mono); font-size: 10.5px; color: var(--fg-dim); padding: 6px 8px; text-align: center; border-top: 1px solid var(--border-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.figure { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); padding: 18px; }
.figure img { margin: 0 auto; }
.figure__cap { font-size: 13px; color: var(--fg-dim); text-align: center; margin-top: 14px; }

/* ---- Tags / badges --------------------------------------- */
.tag { font-family: var(--font-mono); font-size: 11px; line-height: 1; padding: 4px 7px; border: 1px solid var(--border); border-radius: 3px; color: var(--fg-dim); white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; }
.tag--solid { background: var(--primary); color: var(--primary-fg); border-color: var(--primary); }
.tag--live::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.think-tag { font-family: var(--font-mono); font-size: 10.5px; color: var(--fg-dimmer); border: 1px solid var(--border); border-radius: 3px; padding: 1px 5px; margin-left: 7px; vertical-align: middle; }

/* ---- Leaderboard page ------------------------------------ */
.crumbs { font-family: var(--font-mono); font-size: 13px; color: var(--fg-dim); padding-top: 26px; }
.crumbs a:hover { color: var(--fg); }
.crumbs .sep { color: var(--fg-dimmer); margin: 0 8px; }
.lb-title { font-family: var(--font-display); font-weight: 600; font-size: clamp(28px, 4vw, 44px); letter-spacing: -0.02em; text-transform: lowercase; margin: 14px 0 6px; }
.lb-sub { color: var(--fg-dim); max-width: 80ch; font-size: 14.5px; }

/* task tabs */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 26px 0 0; border-bottom: 1px solid var(--border); }
.tab { all: unset; cursor: pointer; font-family: var(--font-mono); font-size: 14px; padding: 11px 16px; color: var(--fg-dim); border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; align-items: center; gap: 8px; }
.tab:hover { color: var(--fg); }
.tab[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--fg); }
.tab code { font-size: 11.5px; color: var(--fg-dimmer); }

/* filter bar */
.lb-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 22px 0 0; }
.lb-count { font-family: var(--font-mono); font-size: 13px; color: var(--fg-dim); }
.lb-controls .spacer { flex: 1; }
.field { position: relative; }
.field input, .field select {
  font-family: var(--font-mono); font-size: 13px; color: var(--fg);
  background: var(--muted); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 9px 12px; outline: none; min-width: 170px; height: 38px;
}
.field input::placeholder { color: var(--fg-dimmer); }
.field input:focus, .field select:focus { border-color: var(--ring); }
.field select { appearance: none; padding-right: 30px; cursor: pointer; }
.field--select::after { content: "⌄"; position: absolute; right: 12px; top: 7px; color: var(--fg-dimmer); pointer-events: none; font-family: var(--font-mono); }
.toggle { display: inline-flex; align-items: center; gap: 9px; font-family: var(--font-mono); font-size: 13px; color: var(--fg-dim); cursor: pointer; user-select: none; }
.toggle input { display: none; }
.toggle .track { width: 34px; height: 20px; border-radius: 999px; background: var(--muted); border: 1px solid var(--border); position: relative; transition: background .15s; }
.toggle .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 999px; background: var(--fg-dim); transition: transform .15s, background .15s; }
.toggle input:checked + .track { background: var(--primary); border-color: var(--primary); }
.toggle input:checked + .track::after { transform: translateX(14px); background: var(--primary-fg); }
.btn-link { all: unset; cursor: pointer; font-family: var(--font-mono); font-size: 13px; color: var(--fg-dim); }
.btn-link:hover { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }

/* table */
.table-wrap { margin-top: 16px; border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; }
table.lb { width: 100%; border-collapse: collapse; font-size: 14px; }
.lb thead th {
  font-family: var(--font-mono); font-weight: 500; font-size: 12.5px; color: var(--fg-dim);
  text-align: right; padding: 12px 14px; border-bottom: 1px solid var(--border);
  white-space: nowrap; position: sticky; top: 0; background: var(--bg-soft); cursor: pointer; user-select: none;
}
.lb thead th.col-model, .lb thead th.col-org { text-align: left; }
.lb thead th .dirhint { color: var(--fg-dimmer); font-weight: 400; }
.lb thead th .sortcaret { color: var(--accent); margin-left: 4px; }
.lb thead th:not(.is-sorted):hover { color: var(--fg); }
.lb thead th.no-sort { cursor: default; }
.lb thead th.wrap { white-space: normal; min-width: 108px; line-height: 1.25; vertical-align: bottom; }
.lb thead th.is-sorted { color: var(--fg); }
.lb tbody td { padding: 12px 14px; text-align: right; border-bottom: 1px solid var(--border-soft); font-variant-numeric: tabular-nums; white-space: nowrap; }
.lb tbody tr:last-child td { border-bottom: none; }
.lb tbody tr:hover td { background: var(--muted); }
.lb .col-rank { text-align: right; color: var(--fg-dim); font-family: var(--font-mono); width: 56px; }
.lb .col-model { text-align: left; font-family: var(--font-mono); font-weight: 500; }
.lb .col-org { text-align: left; color: var(--fg-dim); font-family: var(--font-mono); font-size: 13px; }
.lb td.is-best { font-weight: 700; }
.lb td.metric { font-family: var(--font-mono); }
.lb tr.row--ours td { background: var(--ours); }
.lb tr.row--ours:hover td { background: color-mix(in srgb, var(--ours) 60%, var(--muted)); }
.lb tr.row--ours .col-model::after { content: "ours"; font-family: var(--font-mono); font-size: 10px; color: var(--fg-dimmer); border: 1px solid var(--border); border-radius: 3px; padding: 1px 5px; margin-left: 8px; }
.lb tr.row--control td { color: var(--fg-dimmer); font-style: italic; }
.lb .verified { color: var(--fg); margin-left: 6px; }
.lb .verified svg { width: 13px; height: 13px; vertical-align: -2px; }
.class-dot { display: inline-block; width: 7px; height: 7px; border-radius: 999px; margin-right: 8px; vertical-align: 1px; border: 1px solid var(--fg-dimmer); }
.class-dot--ours { background: var(--fg); border-color: var(--fg); }
.class-dot--specialist { background: var(--fg-dim); border-color: var(--fg-dim); }
.class-dot--proprietary { background: transparent; }
.class-dot--open { background: var(--fg-dimmer); border-color: var(--fg-dimmer); }
.class-dot--control { background: transparent; border-style: dashed; }
.lb-empty { padding: 40px; text-align: center; color: var(--fg-dim); font-family: var(--font-mono); font-size: 14px; }
.lb-legend { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 14px; font-family: var(--font-mono); font-size: 12px; color: var(--fg-dim); }
.lb-legend span { display: inline-flex; align-items: center; }

/* ---- Team ------------------------------------------------ */
.team { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.member {
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--card);
  padding: 24px 16px; display: flex; flex-direction: column; align-items: center; gap: 12px;
  text-align: center; transition: border-color .15s, background .15s; color: inherit;
}
a.member:hover { border-color: var(--ring); background: var(--muted); text-decoration: none; }
.avatar {
  width: 54px; height: 54px; border-radius: 999px; border: 1px solid var(--border);
  display: grid; place-items: center; background: var(--muted);
  font-family: var(--font-mono); font-size: 17px; font-weight: 600; color: var(--fg); letter-spacing: .02em;
}
.member__name { font-family: var(--font-mono); font-size: 14px; font-weight: 500; line-height: 1.3; }
.member__role { font-size: 11.5px; color: var(--fg-dim); margin-top: -6px; }

/* ---- News ------------------------------------------------ */
.news-item { border-top: 1px solid var(--border); padding: 34px 0; display: grid; grid-template-columns: 130px 1fr; gap: 28px; }
.news-item:first-of-type { border-top: none; }
.news-date { font-family: var(--font-mono); font-size: 13px; color: var(--fg-dim); padding-top: 2px; }
.news-body h3 { font-family: var(--font-mono); font-weight: 600; font-size: 19px; margin: 0 0 10px; letter-spacing: -0.01em; }
.news-body p { color: var(--fg-dim); margin: 0 0 16px; max-width: 64ch; }
.news-shots { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0 18px; max-width: 720px; }
.news-shots img, .news-ph { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); display: block; width: 100%; }
.news-ph { aspect-ratio: 16 / 10; display: grid; place-items: center; border-style: dashed; color: var(--fg-dimmer); font-family: var(--font-mono); font-size: 12px; text-align: center; padding: 12px; }
.news-tag { font-family: var(--font-mono); font-size: 11px; color: var(--fg-dim); border: 1px solid var(--border); border-radius: 3px; padding: 2px 7px; }
@media (max-width: 720px) { .news-item { grid-template-columns: 1fr; gap: 8px; } .news-shots { grid-template-columns: 1fr; } }

/* ---- Steps (contribution) -------------------------------- */
.steps { counter-reset: step; display: grid; gap: 14px; }
.step { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); padding: 20px 22px; position: relative; }
.step__n { counter-increment: step; font-family: var(--font-mono); font-size: 12px; color: var(--fg-dimmer); }
.step__n::before { content: counter(step, decimal-leading-zero) "  "; color: var(--fg); }
.step h3 { font-family: var(--font-mono); font-weight: 600; font-size: 16px; margin: 6px 0 8px; }
.step p { color: var(--fg-dim); margin: 0; font-size: 14px; }
.step code { font-size: 13px; color: var(--fg); }

/* ---- Footer ---------------------------------------------- */
.footer { border-top: 1px solid var(--border); padding: 40px 0; }
.footer__inner { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: space-between; }
.footer__brand { font-family: var(--font-mono); font-weight: 600; text-transform: lowercase; display: inline-flex; gap: 8px; align-items: center; }
.footer p { color: var(--fg-dim); font-size: 13px; margin: 0; }
.footer__links { display: flex; gap: 18px; font-family: var(--font-mono); font-size: 13px; }
.footer__links a { color: var(--fg-dim); }
.footer__links a:hover { color: var(--fg); }

/* ---- BibTeX ---------------------------------------------- */
.bibtex { border: 1px solid var(--border); border-radius: var(--radius); background: var(--muted); overflow: hidden; text-align: left; max-width: 820px; margin: 0 auto; }
.bibtex__bar { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border); font-family: var(--font-mono); font-size: 12.5px; color: var(--fg-dim); }
.bibtex pre { margin: 0; padding: 16px; overflow-x: auto; font-size: 12.5px; line-height: 1.65; color: var(--fg-dim); }

/* ---- Responsive ------------------------------------------ */
@media (max-width: 900px) {
  .cards--2, .cards--3, .cards--4 { grid-template-columns: repeat(2, 1fr); }
  .gallery { grid-template-columns: repeat(4, 1fr); }
  .team { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px) {
  .section { padding: 56px 0; }
  .nav__links { display: none; }
  .nav__burger { display: grid; }
  .nav.is-open .nav__links { display: flex; position: absolute; top: 56px; left: 0; right: 0; flex-direction: column; gap: 0; background: var(--bg); border-bottom: 1px solid var(--border); padding: 8px var(--pad) 16px; }
  .nav.is-open .nav__links a { padding: 10px 0; font-size: 15px; border-bottom: 1px solid var(--border-soft); }
  .cards--3, .cards--4 { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: repeat(3, 1fr); }
  .team { grid-template-columns: repeat(2, 1fr); }
  .stat { padding: 14px 18px; min-width: 50%; border-bottom: 1px solid var(--border); }
  .lb-controls .field input, .lb-controls .field select { min-width: 0; width: 100%; }
  .lb-controls .field { flex: 1 1 100%; }
}
@media (max-width: 460px) {
  .gallery { grid-template-columns: repeat(2, 1fr); }
}
