/* ============================================================
   ACE-BENCH — Academic project page
   Clean, focused, three-axis (utility / cost / privacy) design
   ============================================================ */

:root {
  /* Ink + surfaces */
  --ink:        #161d1a;
  --ink-soft:   #3c4742;
  --muted:      #6a7670;
  --faint:      #94a09a;
  --line:       #e5eae6;
  --line-soft:  #eef2ee;
  --bg:         #ffffff;
  --bg-soft:    #f5f8f5;
  --bg-tint:    #fbfdfb;

  /* Brand */
  --brand:      #0d9488;
  --brand-deep: #0b7a70;
  --brand-tint: #e7f5f2;

  /* Three axes (semantic, used everywhere) */
  --utility:      #0e9f6e;
  --utility-tint: #e6f6ee;
  --utility-text: #0a7a55;
  --cost:         #d97a06;
  --cost-tint:    #fbeedb;
  --cost-text:    #a85d05;
  --privacy:      #4f46e5;
  --privacy-tint: #ebeafc;

  /* Execution families (match teaser figure: edge=blue, cloud=red) */
  --edge:   #2563eb;
  --cloud:  #dc2626;
  --mix:    #7c3aed;

  --shadow-sm: 0 1px 2px rgba(20, 35, 30, .05), 0 1px 3px rgba(20, 35, 30, .06);
  --shadow-md: 0 4px 14px rgba(20, 35, 30, .07), 0 2px 6px rgba(20, 35, 30, .05);
  --shadow-lg: 0 18px 50px rgba(20, 35, 30, .10);

  --radius:    14px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --maxw: 1120px;

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans:  "Inter", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.svg-sprite { position: absolute; }

.ic {
  width: 1em; height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

a { color: var(--brand-deep); text-decoration: none; }
a:hover { color: var(--brand); }
a:focus-visible, button:focus-visible, select:focus-visible {
  outline: 2px solid var(--brand-deep);
  outline-offset: 2px;
  border-radius: 6px;
}
.copy-btn:focus-visible { outline-color: #cfe9e4; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

h1, h2, h3, h4 { margin: 0; color: var(--ink); letter-spacing: -0.01em; }
p { margin: 0; }

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

.kicker {
  display: inline-block;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--utility-text);
  margin-bottom: 14px;
}
.bare-head .kicker { margin-bottom: 0; }
.section-head.bare-head { margin-bottom: 20px; }

/* ============================ HEADER / NAV ============================ */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-shell {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 600; }
.brand-mark {
  height: 32px; min-width: 32px; padding: 0 9px;
  display: grid; place-items: center;
  background: var(--brand);
  color: #fff;
  border-radius: 9px;
  font-family: var(--serif);
  font-weight: 700;
  font-style: italic;
  font-size: 16px;
  letter-spacing: .01em;
  box-shadow: var(--shadow-sm);
}
.brand-text { font-size: 16px; letter-spacing: .02em; }
.brand-text strong { font-weight: 700; }

.nav-links { margin-left: auto; display: flex; gap: 26px; }
.nav-links a {
  font-size: 14.5px; font-weight: 500; color: var(--ink-soft);
  position: relative; padding: 4px 0;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a[aria-current="page"] { color: var(--brand-deep); }
.nav-links a[aria-current="page"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
  background: var(--brand); border-radius: 2px;
}
.nav-cta {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 14px; font-weight: 600; color: #fff;
  background: var(--ink);
  padding: 8px 15px; border-radius: 9px;
}
.nav-cta:hover { color: #fff; background: #0b1311; }
.nav-cta .ic { font-size: 16px; stroke-width: 1.9; }

.lang-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--sans); font-size: 14px; font-weight: 600; color: var(--ink-soft);
  background: #fff; border: 1px solid var(--line); border-radius: 9px;
  padding: 7px 12px; cursor: pointer;
  transition: border-color .12s ease, color .12s ease, background .12s ease;
}
.lang-toggle .ic { font-size: 16px; }
.lang-toggle:hover { color: var(--ink); border-color: #d7ddd8; background: var(--bg-tint); }

@media (max-width: 860px) {
  .nav-links { display: none; }
}
@media (max-width: 460px) {
  .lang-toggle span { display: none; }
  .lang-toggle { padding: 7px 9px; }
}

/* ============================ HERO ============================ */
.hero {
  text-align: center;
  padding: 64px 0 8px;
  background:
    radial-gradient(900px 380px at 50% -120px, var(--brand-tint), transparent 70%),
    linear-gradient(180deg, var(--bg-tint), var(--bg));
}
.hero-shell { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }
.hero-venue {
  font-size: 12.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: var(--brand-deep); margin-bottom: 18px;
}
.hero-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(24px, 3.4vw, 34px);
  line-height: 1.2;
  letter-spacing: -0.012em;
  margin: 0 auto 26px;
  max-width: 940px;
}
.title-accent {
  color: var(--brand-deep);
  font-style: italic;
}

.author-list {
  list-style: none; margin: 0 0 10px; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 8px;
  font-size: 17px; font-weight: 500; color: var(--ink);
}
.author-list li:not(:last-child)::after { content: ","; margin-left: 1px; }
.author-list sup { color: var(--brand-deep); font-weight: 600; font-size: .68em; }
.affil-list {
  list-style: none; margin: 0 0 4px; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 18px;
  font-size: 14px; color: var(--muted);
}
.affil-list sup { color: var(--brand-deep); }
.corr-note { font-size: 13px; color: var(--muted); margin-bottom: 26px; }
.corr-note span { color: var(--brand-deep); }

.hero-actions {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 12px;
  margin-bottom: 34px;
}
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14.5px; font-weight: 600;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  padding: 10px 18px;
  border-radius: 11px;
  box-shadow: var(--shadow-sm);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.btn .ic { font-size: 17px; }
.btn:hover { color: var(--ink); transform: translateY(-1px); box-shadow: var(--shadow-md); border-color: #d7ddd8; }
.btn-primary {
  color: #fff; background: var(--ink); border-color: var(--ink);
}
.btn-primary:hover { color: #fff; background: #0b1311; }

.hero-thesis {
  max-width: 800px; margin: 0 auto;
  text-align: left;
  font-size: 18px; line-height: 1.62; color: var(--ink-soft);
}
.hero-thesis strong { color: var(--ink); font-weight: 650; }
.hero-thesis em { font-style: normal; font-weight: 600; }
.hero-thesis em:nth-of-type(1) { color: var(--utility); }
.hero-thesis em:nth-of-type(2) { color: var(--cost-text); }
.hero-thesis em:nth-of-type(3) { color: var(--privacy); }

/* Hero figure */
.hero-figure {
  max-width: 800px; margin: 48px auto 0; padding: 0 28px;
}
.hero-figure img {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-lg);
}
figcaption {
  margin-top: 16px;
  font-size: 14.5px; line-height: 1.55; color: var(--muted);
  text-align: left;
  max-width: none; margin-left: 0; margin-right: 0;
}
figcaption strong { color: var(--ink-soft); font-weight: 650; }
figcaption em { color: var(--ink-soft); font-style: italic; }

/* ============================ TL;DR ============================ */
.tldr { padding: 72px 0 12px; }
.tldr-head { text-align: center; margin-bottom: 34px; }
.tldr-head h2 { font-family: var(--serif); font-weight: 600; font-size: 30px; }
.tldr-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px;
}
.tldr-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 22px 22px;
  box-shadow: var(--shadow-sm);
  transition: transform .14s ease, box-shadow .14s ease;
  overflow: hidden;
}
.tldr-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
}
.tldr-card:nth-child(1)::before { background: var(--privacy); }
.tldr-card:nth-child(2)::before { background: var(--brand); }
.tldr-card:nth-child(3)::before { background: var(--cost); }
.tldr-card:nth-child(4)::before { background: var(--cloud); }
.tldr-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.tldr-num {
  font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--muted);
}
.tldr-card h3 { font-size: 17px; font-weight: 700; margin: 8px 0 9px; line-height: 1.25; }
.tldr-card p { font-size: 14px; color: var(--ink-soft); line-height: 1.55; margin-top: auto; }
.tldr-card strong { color: var(--ink); font-weight: 700; }

@media (max-width: 980px) { .tldr-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .tldr-grid { grid-template-columns: 1fr; } }

/* ============================ SECTION SHELL ============================ */
.section { padding: 78px 0; }
.section-soft { background: var(--bg-soft); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.section-head { max-width: none; margin: 0 0 40px; }
.section-head h2 {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(26px, 3.6vw, 36px); line-height: 1.18;
}
.section-lede {
  margin-top: 16px; font-size: 17px; line-height: 1.62; color: var(--ink-soft);
}
.section-lede strong { color: var(--ink); font-weight: 650; }
.section-lede em { font-style: italic; color: var(--ink-soft); }

/* ============================ PROBLEM ============================ */
.problem-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
.problem-card {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 24px; box-shadow: var(--shadow-sm);
  transition: transform .14s ease, box-shadow .14s ease;
}
.problem-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.tier-label {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 5px 11px; border-radius: 999px; margin-bottom: 14px;
}
.tier-label .ic { font-size: 15px; stroke-width: 1.9; }
.problem-card.edge  .tier-label { color: var(--edge);  background: #e8f0fe; }
.problem-card.cloud .tier-label { color: var(--cloud); background: #fdeaea; }
.problem-card.gap   .tier-label { color: var(--ink-soft); background: var(--line-soft); }
.problem-card h3 { font-size: 19px; font-weight: 700; margin-bottom: 10px; }
.problem-card p { font-size: 14.5px; color: var(--ink-soft); line-height: 1.58; }
.problem-card em { font-style: italic; }
.stat-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.stat-pill {
  font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 7px;
  background: var(--line-soft); color: var(--ink-soft);
}
.stat-pill.good { background: var(--utility-tint); color: #0a7a55; }
.stat-pill.warn { background: var(--cost-tint); color: #a85d05; }
.stat-pill.bad  { background: #fdeaea; color: #c12626; }
.stat-pill.neutral { background: var(--privacy-tint); color: #4035c4; }

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

/* ============================ BENCHMARK ============================ */
.metric-band {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; margin-bottom: 40px; box-shadow: var(--shadow-sm);
}
.metric { background: var(--bg); padding: 24px 18px; text-align: center; }
.metric strong {
  display: block; font-family: var(--serif); font-weight: 600;
  font-size: 40px; line-height: 1; color: var(--brand-deep); letter-spacing: -0.02em;
}
.metric span { font-size: 13px; color: var(--muted); margin-top: 8px; display: block; }

.wide-figure {
  margin: 0 0 44px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 24px; box-shadow: var(--shadow-md);
}
.wide-figure img { display: block; width: 100%; height: auto; border-radius: 8px; }
.wide-figure figcaption { margin-top: 18px; max-width: none; text-align: left; }

.axis-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.axis-card {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 24px; box-shadow: var(--shadow-sm); position: relative;
  border-top: 3px solid var(--line);
  transition: transform .14s ease, box-shadow .14s ease;
}
.axis-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.axis-card.utility { border-top-color: var(--utility); }
.axis-card.cost    { border-top-color: var(--cost); }
.axis-card.privacy { border-top-color: var(--privacy); }
.axis-icon {
  display: inline-grid; place-items: center; width: 44px; height: 44px;
  border-radius: 12px; margin-bottom: 16px; font-size: 22px;
}
.axis-card.utility .axis-icon { color: var(--utility); background: var(--utility-tint); }
.axis-card.cost    .axis-icon { color: var(--cost);    background: var(--cost-tint); }
.axis-card.privacy .axis-icon { color: var(--privacy); background: var(--privacy-tint); }
.axis-card h3 { font-size: 19px; font-weight: 700; margin-bottom: 9px; }
.axis-card p { font-size: 14.5px; color: var(--ink-soft); line-height: 1.58; }
.axis-card em { font-style: italic; }
.axis-card sup { font-size: .68em; }

@media (max-width: 880px) { .axis-grid, .metric-band { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .axis-grid { grid-template-columns: 1fr; } }

.taxonomy {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  margin-top: 36px; padding-top: 28px; border-top: 1px dashed var(--line);
}
.taxonomy-label { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.taxonomy ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 9px; }
.taxonomy li {
  font-size: 13.5px; font-weight: 500; color: var(--ink-soft);
  background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px;
}

/* ============================ STRATEGIES ============================ */
.strategy-columns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.col-title {
  font-size: 14px; font-weight: 700; color: var(--ink);
  padding-bottom: 12px; margin-bottom: 16px; border-bottom: 2px solid var(--line);
}
.col-title small { display: block; font-weight: 500; color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.strategy-stack { display: flex; flex-direction: column; gap: 16px; }
.strategy-card {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow-sm);
  transition: transform .14s ease, box-shadow .14s ease;
}
.strategy-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.strat-kicker {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13.5px; font-weight: 700; margin-bottom: 14px;
}
.strat-kicker .ic { font-size: 16px; stroke-width: 1.9; }
.strat-kicker.edge  { color: var(--edge); }
.strat-kicker.cloud { color: var(--cloud); }
.strat-kicker.mix   { color: var(--mix); }
.strategy-card p { font-size: 14px; color: var(--ink-soft); line-height: 1.55; }
.strategy-card em { font-style: italic; }

/* mini diagrams */
.mini {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  background: var(--bg-soft); border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm); padding: 12px; margin-bottom: 14px;
  min-height: 56px;
}
.m-node {
  font-size: 11.5px; font-weight: 700; color: #fff;
  padding: 5px 9px; border-radius: 7px; white-space: nowrap;
}
.m-edge   { background: var(--edge); }
.m-cloud  { background: var(--cloud); }
.m-router { background: var(--mix); }
.m-step {
  font-size: 11px; font-weight: 700; color: var(--ink-soft);
  width: 30px; height: 26px; display: grid; place-items: center;
  background: #fff; border: 1.5px solid var(--edge); border-radius: 7px;
}
.m-step.c { color: #fff; background: var(--cloud); border-color: var(--cloud); }
.m-arrow {
  width: 22px; height: 2px; background: var(--faint); position: relative; flex: none;
}
.m-arrow::after {
  content: ""; position: absolute; right: -1px; top: -3px;
  border-left: 6px solid var(--faint); border-top: 4px solid transparent; border-bottom: 4px solid transparent;
}
.m-branch { width: 100%; height: 0; }
.m-assist { font-size: 12px; font-weight: 700; color: var(--mix); }

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

/* ============================================================ FINDINGS */
.findings-layout {
  display: grid; grid-template-columns: 1fr; gap: 26px; align-items: start;
}
.plot-card {
  position: relative;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow-md);
}
.plot-axes-note {
  display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 8px;
  font-size: 12.5px; font-weight: 600; color: var(--muted);
}
.plot-axes-note span { display: inline-flex; align-items: center; gap: 6px; }
.plot-axes-note .ic { font-size: 15px; }
.plot-axes-note span:nth-child(1) .ic { color: var(--utility); }
.plot-axes-note span:nth-child(2) .ic { color: var(--cost); }
.plot-axes-note span:nth-child(3) .ic { color: var(--privacy); }
#tradeoff-canvas { width: 100%; height: auto; display: block; }
#plot-tooltip {
  display: none; position: absolute; z-index: 5;
  background: var(--ink); color: #fff;
  font-size: 12.5px; line-height: 1.5;
  padding: 9px 12px; border-radius: 9px; pointer-events: none;
  box-shadow: var(--shadow-lg); max-width: 220px;
}
#plot-tooltip strong { font-size: 13px; }

.finding-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.finding {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow-sm);
  border-top: 4px solid var(--brand);
}
.finding-tag {
  display: inline-block; font-family: var(--mono); font-size: 11.5px; font-weight: 500;
  color: var(--brand-deep); letter-spacing: .04em; margin-bottom: 8px;
}
.finding h3 { font-size: 17px; font-weight: 700; line-height: 1.3; margin-bottom: 8px; }
.finding p { font-size: 14px; color: var(--ink-soft); line-height: 1.56; }
.finding em { font-style: italic; }
.finding strong { color: var(--ink); font-weight: 700; }

.findings-footnote {
  margin-top: 30px; padding: 18px 22px;
  background: var(--brand-tint); border-radius: var(--radius);
  font-size: 14.5px; line-height: 1.6; color: #0a5f57;
}
.findings-footnote em { font-style: italic; font-weight: 600; }

@media (max-width: 920px) { .finding-list { grid-template-columns: 1fr; } }

/* ============================ LEADERBOARD ============================ */
.leaderboard-toolbar {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between;
  margin-bottom: 18px;
}
.lb-filter { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.lb-filter select {
  font-family: var(--sans); font-size: 14px; color: var(--ink);
  padding: 9px 14px; border: 1px solid var(--line); border-radius: 9px; background: #fff;
  box-shadow: var(--shadow-sm); cursor: pointer; min-width: 180px;
}
.leaderboard-tabs { display: flex; flex-wrap: wrap; gap: 6px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 11px; padding: 4px; }
.leaderboard-tabs button {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--sans); font-size: 13.5px; font-weight: 600; color: var(--ink-soft);
  background: transparent; border: none; border-radius: 8px; padding: 8px 13px; cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.leaderboard-tabs button .ic { font-size: 15px; }
.leaderboard-tabs button:hover { color: var(--ink); }
.leaderboard-tabs button.active { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }

.table-shell {
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm); background: #fff;
  overflow-x: auto;
}
table { width: 100%; border-collapse: collapse; min-width: 720px; }
thead th {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); text-align: left; padding: 14px 18px;
  background: var(--bg-soft); border-bottom: 1px solid var(--line); white-space: nowrap;
}
thead th sup { font-size: .7em; }
tbody td { padding: 16px 18px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr.top-row { background: var(--brand-tint); }
tbody tr:hover { background: var(--bg-tint); }
tbody tr.top-row:hover { background: #ddf0ec; }

.rank { font-family: var(--mono); font-size: 13px; color: var(--muted); font-weight: 500; width: 44px; }
.method-cell { min-width: 250px; }
.method-name { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 15px; color: var(--ink); }
.method-name .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.top-badge {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--brand-deep); background: #fff; border: 1px solid var(--brand); border-radius: 999px; padding: 2px 8px;
}
.model-line { font-size: 13px; color: var(--ink-soft); margin-top: 5px; display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.ml-tag {
  font-size: 10px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 5px; margin-right: 1px;
}
.ml-tag.edge  { color: var(--edge);  background: #e8f0fe; }
.ml-tag.cloud { color: var(--cloud); background: #fdeaea; }
.ml-sep { color: var(--faint); font-weight: 600; margin: 0 2px; }
.run-detail { font-size: 11.5px; color: var(--muted); margin-top: 5px; font-family: var(--mono); }

.score-cell { width: 26%; min-width: 188px; }
.score-bar-wrap { display: flex; align-items: center; gap: 10px; }
.score-bar { flex: 1; height: 8px; background: var(--line-soft); border-radius: 999px; overflow: hidden; min-width: 60px; }
.score-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--utility), #34c98a); border-radius: 999px; }
.score-bar-wrap strong { font-size: 14px; font-variant-numeric: tabular-nums; color: var(--ink); }

.compact-metric { width: 108px; text-align: center; font-size: 14px; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
thead th:nth-child(n+3) { text-align: center; }
.pass-metric { color: var(--ink-soft); }
.privacy-metric { color: var(--privacy); }
.cost-metric { color: var(--cost-text); }

.leaderboard-note { margin-top: 16px; font-size: 13px; color: var(--muted); line-height: 1.55; }

/* ============================ RESOURCES + CITATION ============================ */
.resource-split { display: grid; grid-template-columns: 1fr 1.15fr; gap: 24px; align-items: stretch; }
.resource-cards { display: flex; flex-direction: column; gap: 16px; }
.resource-card {
  display: flex; flex-direction: column; flex: 1;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow-sm); color: var(--ink);
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
.resource-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--brand); color: var(--ink); }
.res-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.res-icon {
  display: inline-grid; place-items: center; width: 42px; height: 42px; flex: none;
  border-radius: 11px; background: var(--brand-tint); color: var(--brand-deep);
  font-size: 21px;
}
.resource-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 0; }
.resource-card p { font-size: 14px; color: var(--ink-soft); line-height: 1.55; }
.res-go {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
  margin-top: auto; padding-top: 14px; font-size: 13px; font-weight: 600; color: var(--brand-deep); font-family: var(--mono);
}
.res-go .ic { font-size: 15px; transition: transform .14s ease; }
.resource-card:hover .res-go .ic { transform: translateX(3px); }

.citation-card {
  background: var(--ink); border-radius: var(--radius); padding: 24px 26px; box-shadow: var(--shadow-md);
}
.citation-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.citation-card h3 { color: #fff; font-size: 15px; font-weight: 700; margin-bottom: 0; letter-spacing: .03em; }
.copy-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--sans); font-size: 12.5px; font-weight: 600; color: #cfe9e4;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16);
  border-radius: 8px; padding: 6px 12px; cursor: pointer;
  transition: background .14s ease, color .14s ease, border-color .14s ease;
}
.copy-btn .ic { font-size: 15px; }
.copy-btn:hover { background: rgba(255,255,255,.16); color: #fff; }
.copy-btn.copied { background: var(--brand); border-color: var(--brand); color: #fff; }
.citation-card pre { margin: 0; overflow-x: auto; }
.citation-card code {
  font-family: var(--mono); font-size: 12.5px; line-height: 1.65; color: #cfe9e4; white-space: pre;
}

@media (max-width: 880px) { .resource-split { grid-template-columns: 1fr; } }

/* ============================ FOOTER ============================ */
footer { border-top: 1px solid var(--line); padding: 36px 0; background: var(--bg-tint); }
.footer-shell { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 18px; }
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-brand strong { display: block; font-size: 14px; letter-spacing: .03em; color: var(--ink); }
.footer-brand span { font-size: 13px; color: var(--muted); }
.footer-links { display: flex; gap: 22px; }
.footer-links a { font-size: 14px; color: var(--ink-soft); font-weight: 500; }
.footer-links a:hover { color: var(--brand-deep); }

/* ============================ SCROLL REVEAL ============================ */
.js-reveal .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .62s cubic-bezier(.22, .7, .2, 1), transform .62s cubic-bezier(.22, .7, .2, 1);
  will-change: opacity, transform;
}
.js-reveal .reveal.is-visible {
  opacity: 1;
  transform: none;
  will-change: auto;
}

/* ============================ MISC ============================ */
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
  .js-reveal .reveal { opacity: 1 !important; transform: none !important; }
}

@media print {
  .js-reveal .reveal { opacity: 1 !important; transform: none !important; }
  .site-header { position: static; backdrop-filter: none; }
  .hero { background: none; }
  .btn, .nav-cta, .copy-btn { box-shadow: none; }
}
