:root {
  --ink: #1a1c23;
  --muted: #5c6270;
  --line: #e4e6ec;
  --bg: #ffffff;
  --soft: #f7f8fb;
  --accent: #6b4bd6;       /* LilyPond-ish violet */
  --accent-soft: #efeafc;
  --gold: #c8961e;
  --ok: #1f9d57;
  --bad: #d7443e;
  --maxw: 1040px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h2 { font-size: 1.7rem; margin: 0 0 .6rem; letter-spacing: -.01em; }
h3 { font-size: 1.2rem; }

/* ---------- hero ---------- */
.hero {
  background: radial-gradient(120% 120% at 50% -10%, var(--accent-soft) 0%, #fff 60%);
  border-bottom: 1px solid var(--line);
  padding: 0 1.2rem 2.6rem;
  text-align: center;
}
.topnav {
  display: flex; align-items: center; justify-content: space-between;
  max-width: var(--maxw); margin: 0 auto; padding: 1rem 0;
}
.brand { font-weight: 700; }
.navlinks a { color: var(--muted); margin-left: 1.2rem; font-size: .92rem; font-weight: 500; }
.hero h1 {
  font-family: "Newsreader", Georgia, serif;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 600; line-height: 1.1; letter-spacing: -.02em;
  margin: 1.4rem auto .4rem; max-width: 16ch;
}
.subtitle { font-size: 1.15rem; color: var(--muted); margin: 0 0 1.4rem; }
.authors {
  list-style: none; padding: 0; margin: 0 0 .3rem;
  display: flex; flex-wrap: wrap; gap: .2rem 1.1rem; justify-content: center; font-weight: 500;
}
.authors sup { color: var(--accent); }
.affil { color: var(--muted); font-size: .9rem; margin: .2rem auto 1rem; max-width: 60ch; }
.venue { font-size: .95rem; margin: 0 0 1.6rem; }
.buttons { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; }
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .55rem 1.1rem; border: 1px solid var(--line); border-radius: 999px;
  background: #fff; color: var(--ink); font-weight: 600; font-size: .92rem;
  transition: transform .08s ease, box-shadow .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---------- layout ---------- */
main { max-width: var(--maxw); margin: 0 auto; padding: 1rem 1.2rem 3rem; }
section { padding: 2.4rem 0; border-bottom: 1px solid var(--line); }
section:last-child { border-bottom: none; }
.prose p { color: #33363f; max-width: 72ch; }
.note { color: var(--muted); font-size: .86rem; max-width: 80ch; }

/* ---------- benchmark cards + task table ---------- */
.cards2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1.2rem 0; }
.card { background: var(--soft); border: 1px solid var(--line); border-radius: 14px; padding: 1.1rem 1.3rem; }
.card h3 { margin: 0 0 .4rem; }
.card p { margin: 0; font-size: .94rem; }
.tasktable, .resulttable { width: 100%; border-collapse: collapse; font-size: .88rem; margin-top: .6rem; }
.tasktable th, .tasktable td, .resulttable th, .resulttable td {
  padding: .42rem .6rem; border-bottom: 1px solid var(--line); text-align: left;
}
.tasktable th, .resulttable th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
.tasktable td:first-child { font-weight: 600; color: var(--accent); vertical-align: top; }

/* ---------- generation gallery ---------- */
.picker { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.2rem 0; }
.pill {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: .5rem 1rem; border-radius: 999px; cursor: pointer; font: inherit; font-weight: 600; font-size: .9rem;
}
.pill.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.promptcard {
  background: var(--soft); border: 1px solid var(--line); border-radius: 14px;
  padding: 1rem 1.2rem; margin-bottom: 1.2rem;
}
.metablock pre {
  margin: 0 0 .6rem; font-family: var(--mono); font-size: .8rem;
  color: var(--accent); white-space: pre-wrap;
}
.userprompt { margin: 0; font-size: .95rem; }
.grid4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.panel {
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  background: #fff; display: flex; flex-direction: column;
}
.panel-head { padding: .7rem .9rem; border-bottom: 1px solid var(--line); background: var(--soft); }
.panel-head h4 { margin: 0 0 .35rem; font-size: .98rem; }
.badges { display: flex; flex-wrap: wrap; gap: .3rem; }
.badge {
  font-size: .7rem; font-weight: 600; padding: .15rem .5rem; border-radius: 999px;
  background: #eef0f5; color: var(--muted);
}
.badge.ok { background: #e3f6ec; color: var(--ok); }
.badge.warn { background: #fceeea; color: var(--bad); }
.score {
  background: #fff; padding: .8rem; max-height: 300px; overflow: auto;
  border-bottom: 1px solid var(--line); display: flex; justify-content: center;
}
.score .svg { width: 100%; max-width: 100%; }
.panel audio { width: 100%; margin: .6rem .9rem; width: calc(100% - 1.8rem); }
.noaudio { color: var(--muted); font-size: .85rem; margin: .6rem .9rem; }
.panel details { border-top: 1px solid var(--line); }
details summary {
  cursor: pointer; padding: .55rem .9rem; font-size: .85rem; font-weight: 600; color: var(--muted);
}
.panel pre, details pre {
  margin: 0; padding: .8rem .9rem; background: #1f2230; color: #e6e8f0;
  font-family: var(--mono); font-size: .76rem; overflow: auto; max-height: 340px; line-height: 1.5;
}

/* ---------- understanding ---------- */
.cathead { margin: 1.6rem 0 .6rem; color: var(--muted); font-size: .95rem; text-transform: uppercase; letter-spacing: .05em; }
.ucard {
  border: 1px solid var(--line); border-left: 4px solid var(--line);
  border-radius: 12px; padding: 1rem 1.2rem; margin-bottom: .9rem; background: #fff;
}
.ucard.verdict-all { border-left-color: var(--ok); }
.ucard.verdict-none { border-left-color: var(--bad); }
.ucard.verdict-some { border-left-color: var(--gold); }
.ucard-head { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.ucard-head h4 { margin: 0; font-family: var(--mono); font-size: 1rem; }
.cat { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  background: var(--accent-soft); color: var(--accent); padding: .15rem .55rem; border-radius: 999px; }
.scoretag { margin-left: auto; font-size: .8rem; font-weight: 600; color: var(--muted); }
.instruction { color: #3a3d46; font-size: .92rem; margin: .5rem 0 .2rem; }
.ucard details pre { background: #1f2230; color: #e6e8f0; border-radius: 8px; margin: .5rem 0; }
.options { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0; }
.opt { font-size: .82rem; padding: .25rem .6rem; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); }
.opt.gold { border-color: var(--ok); background: #e3f6ec; color: var(--ok); font-weight: 600; }
.gold-only { font-size: .9rem; margin: .5rem 0; }
.preds { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .5rem; margin-top: .6rem; }
.pred { display: flex; align-items: center; gap: .4rem; padding: .4rem .6rem; border-radius: 8px; font-size: .84rem; }
.pred.right { background: #e9f7ef; }
.pred.wrong { background: #fbecea; }
.pred-model { font-weight: 600; }
.pred-ans { font-family: var(--mono); margin-left: auto; }
.pred-mark { font-weight: 700; }
.pred.right .pred-mark { color: var(--ok); }
.pred.wrong .pred-mark { color: var(--bad); }

/* ---------- result tables ---------- */
.resulttable td.best { font-weight: 700; color: var(--accent); }
.resulttable td.regime { font-weight: 600; vertical-align: middle; background: var(--soft); }
.resulttable tr.regime-start td { border-top: 2px solid var(--line); }
.resulttable .cat-cell { color: var(--accent); font-weight: 600; }
.resulttable .task-cell { font-family: var(--mono); font-size: .82rem; }
.resulttable .metric-cell, .resulttable .dir { color: var(--muted); font-weight: 400; }
.resulttable tr.agg td { font-weight: 700; border-top: 2px solid var(--line); }

/* ---------- citation / footer ---------- */
.bibtex { background: #1f2230; color: #e6e8f0; border-radius: 12px; padding: 1.1rem 1.3rem; overflow: auto; font-family: var(--mono); font-size: .8rem; }
footer { max-width: var(--maxw); margin: 0 auto; padding: 2rem 1.2rem 3rem; color: var(--muted); font-size: .85rem; text-align: center; }
footer p { margin: .3rem 0; }

@media (max-width: 680px) {
  .cards2 { grid-template-columns: 1fr; }
  .navlinks { display: none; }
  .scoretag { margin-left: 0; }
}
