/* lexbench-browser landing page — original styling, no third-party CSS */

:root {
  --bg: #fbfaf7;
  --bg-alt: #ffffff;
  --bg-card: #ffffff;
  --text: #14181f;
  --text-muted: #5e6470;
  --text-faint: #8a91a0;
  --border: #e6e3dc;
  --border-strong: #d2cdc1;
  --accent: #1f3a8a;
  --accent-soft: #e7ecf9;
  --accent-2: #6b46c1;
  --accent-2-soft: #ece4f9;
  --peach: #e9a87b;
  --good: #1d8a59;
  --warn: #b66a16;
  --bad: #b3322a;
  --gateway: #6b46c1;
  --killed: #4d566c;
  --max-width: 1200px;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(20, 24, 31, 0.04), 0 1px 1px rgba(20, 24, 31, 0.04);
  --shadow-md: 0 4px 14px rgba(20, 24, 31, 0.06), 0 1px 2px rgba(20, 24, 31, 0.04);
  --shadow-lg: 0 12px 40px rgba(20, 24, 31, 0.08), 0 4px 12px rgba(20, 24, 31, 0.05);
  --transition: 0.18s ease;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

code, pre, .cell-mono {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}

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

/* ==== Top nav ==== */

.topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(251, 250, 247, 0.85);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.topnav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--text);
}
.brand:hover { color: var(--accent); }
.brand-mark {
  color: var(--accent);
  font-size: 1.15em;
  line-height: 1;
}
.brand-name { letter-spacing: -0.01em; }
.topnav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 0.92rem;
}
.topnav-links a {
  color: var(--text-muted);
  font-weight: 500;
}
.topnav-links a:hover { color: var(--text); }
.topnav-cta {
  background: var(--text);
  color: var(--bg) !important;
  padding: 7px 14px;
  border-radius: 999px;
  font-weight: 600;
}
.topnav-cta:hover { background: var(--accent); }

@media (max-width: 820px) {
  .topnav-links a:not(.topnav-cta) { display: none; }
}

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

.hero {
  position: relative;
  padding: 56px 0 64px;
  overflow: hidden;
  isolation: isolate;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(80% 60% at 8% 0%, rgba(31, 58, 138, 0.10) 0%, rgba(31, 58, 138, 0) 60%),
    radial-gradient(60% 60% at 95% 30%, rgba(107, 70, 193, 0.10) 0%, rgba(107, 70, 193, 0) 60%),
    radial-gradient(40% 40% at 70% 90%, rgba(233, 168, 123, 0.10) 0%, rgba(233, 168, 123, 0) 70%);
}
.hero-inner { max-width: var(--max-width); margin: 0 auto; padding: 0 28px; }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
}
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
}

.hero-eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 600;
  margin-bottom: 18px;
}
.hero-title {
  font-size: clamp(2.2rem, 4.4vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.04;
  margin: 0 0 18px;
  white-space: nowrap;
}
@media (max-width: 540px) { .hero-title { white-space: normal; } }
.hero-subtitle {
  font-size: clamp(1.05rem, 1.8vw, 1.28rem);
  color: var(--text-muted);
  margin: 0 0 24px;
  max-width: 32em;
}
.hl {
  background: linear-gradient(180deg, transparent 60%, var(--accent-soft) 60%);
  padding: 0 2px;
  font-weight: 600;
  color: var(--text);
}

.hero-authors {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.author-chip {
  font-size: 0.86rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 999px;
  color: var(--text-muted);
  font-weight: 500;
}
.author-chip.muted { color: var(--text-faint); border-style: dashed; }

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), color var(--transition);
  white-space: nowrap;
}
.btn-icon { font-size: 1.05em; }
.btn-tag {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  background: var(--bg);
  padding: 2px 7px;
  border-radius: 999px;
}
.btn-primary {
  background: var(--text);
  color: var(--bg);
}
.btn-primary:hover { background: var(--accent); color: var(--bg); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}
.community-buttons {
  margin-top: 8px;
}

.hero-art {
  position: relative;
}
.hero-image {
  display: block;
  width: 100%;
  height: auto;
  max-height: 360px;
  object-fit: contain;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  background: var(--bg-card);
}

/* ==== Sections ==== */

.section {
  padding: 72px 0;
  border-top: 1px solid var(--border);
}
.section-alt { background: var(--bg-alt); }
.section-title {
  font-size: clamp(1.55rem, 2.6vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}
.section-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 0.85em;
  background: var(--accent);
  border-radius: 2px;
  margin-right: 12px;
  vertical-align: -0.05em;
}
.section-lede {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 56em;
  margin: 0 0 32px;
}

/* ==== Dimensions grid (Overview) ==== */

.dim-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.dim-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  position: relative;
  overflow: hidden;
}
.dim-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  opacity: 0.85;
}
.dim-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-soft);
}
.dim-icon {
  font-size: 1.6rem;
  line-height: 1;
  margin-top: 4px;
}
.dim-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.dim-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
}
.dim-desc code {
  background: var(--bg);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.88em;
}

/* ==== Stat grid ==== */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: transform var(--transition), box-shadow var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-num {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--accent);
  line-height: 1;
}
.stat-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 6px;
}
.stat-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.5;
}

/* ==== Callout ==== */

.callout {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  padding: 18px 22px;
  border-radius: 6px;
  font-size: 0.96rem;
  color: var(--text);
}
.callout em { color: var(--text-muted); font-style: italic; }

/* ==== Wide figures ==== */

.wide-fig {
  margin: 0 0 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.wide-fig img {
  display: block;
  width: 100%;
  height: auto;
  /* keep natural aspect; do not crop */
}
.wide-fig figcaption {
  padding: 12px 22px;
  border-top: 1px solid var(--border);
  font-size: 0.86rem;
  color: var(--text-muted);
  background: var(--bg);
}
.wide-fig figcaption code {
  background: var(--bg-card);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* ==== muted-card ==== */

.muted-card {
  background: var(--bg);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 18px 22px;
  font-size: 0.94rem;
  color: var(--text-muted);
}
.muted-card strong { color: var(--text); }
.muted-card code {
  background: var(--bg-card);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--text);
}

/* ==== Eval metrics ==== */

.metric-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 24px;
}
.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.metric-key {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  font-weight: 600;
}
.metric-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--accent);
  margin: 6px 0 4px;
}
.metric-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* ==== Agents grid ==== */

.agent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.agent-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform var(--transition), box-shadow var(--transition);
}
.agent-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.agent-name {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
}
.agent-desc {
  flex: 1;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
}
.agent-link {
  font-size: 0.85rem;
  font-weight: 500;
  align-self: flex-start;
}
.agent-link[aria-disabled="true"] {
  color: var(--text-faint);
  pointer-events: none;
}

/* ==== Leaderboard ==== */

.lb-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.lb-pill {
  font-size: 0.78rem;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 999px;
  color: var(--text-muted);
}
.lb-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}
.lb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
  min-width: 720px;
}
.lb-table thead th {
  background: var(--bg);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.lb-table thead th.num { text-align: right; }
.lb-table thead th:hover { color: var(--text); }
.lb-table thead th[data-sort-active]::after {
  content: var(--sort-arrow, "▾");
  margin-left: 4px;
  color: var(--accent);
}
.lb-table tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.lb-table tbody tr:last-child td { border-bottom: 0; }
.lb-table tbody tr:hover td { background: rgba(31, 58, 138, 0.025); }
.lb-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.cell-strong { font-weight: 600; }
.cell-mono { color: var(--text-muted); font-size: 0.88em; }
.browser-pill {
  display: inline-block;
  font-size: 0.78rem;
  background: var(--accent-2-soft);
  color: var(--accent-2);
  padding: 2px 9px;
  border-radius: 999px;
  font-weight: 500;
}

/* ==== Failure analysis ==== */

.failure-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}
.failure-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.failure-tag {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 5px;
  margin-bottom: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
}
.tag-completed { color: var(--good); border-color: rgba(29, 138, 89, 0.25); background: rgba(29, 138, 89, 0.08); }
.tag-partial   { color: var(--warn); border-color: rgba(182, 106, 22, 0.25); background: rgba(182, 106, 22, 0.08); }
.tag-goto      { color: var(--bad);  border-color: rgba(179, 50, 42, 0.25); background: rgba(179, 50, 42, 0.08); }
.tag-gateway   { color: var(--gateway); border-color: rgba(107, 70, 193, 0.25); background: rgba(107, 70, 193, 0.08); }
.tag-killed    { color: var(--killed); border-color: rgba(77, 86, 108, 0.25); background: rgba(77, 86, 108, 0.08); }

.failure-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* ==== BibTeX ==== */

.bibtex {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.bibtex pre {
  margin: 0;
  padding: 18px 22px;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--text);
}
.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 0.78rem;
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 500;
  transition: color var(--transition), border-color var(--transition);
}
.copy-btn:hover { color: var(--accent); border-color: var(--accent); }
.copy-btn.copied { color: var(--good); border-color: var(--good); }

/* ==== Footer ==== */

.site-footer {
  background: var(--text);
  color: rgba(255, 255, 255, 0.78);
  padding: 56px 0 40px;
  margin-top: 0;
}
.site-footer .muted { color: rgba(255, 255, 255, 0.55); }
.site-footer .muted a { color: rgba(255, 255, 255, 0.85); }
.site-footer .muted a:hover { color: #fff; }
.site-footer .brand-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-weight: 700;
  margin-bottom: 14px;
}
.site-footer .brand-mark { color: var(--peach); }
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 40px;
}
@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
}
.footer-col h4 {
  margin: 0 0 12px;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 600;
}
.tight {
  list-style: none;
  padding: 0;
  margin: 0;
}
.tight li { margin: 0 0 7px; font-size: 0.92rem; }
.tight li a { color: rgba(255, 255, 255, 0.85); }
.tight li a:hover { color: #fff; }

.small { font-size: 0.86rem; }
.muted { color: var(--text-muted); }
