:root {
  --ink: #0e1c36;
  --text: #2b3547;
  --muted: #65708a;
  --line: #e3e7ee;
  --paper: #ffffff;
  --soft: #f6f8fb;
  --blue: #3474cc;
  --blue-deep: #1f4f99;

  --std: #d4584f;  --std-soft: #fcefee;
  --rob: #8c67c4;  --rob-soft: #f4effb;
  --safe: #2f9a5f; --safe-soft: #ecf7f0;
  --marl: #3a74d0; --marl-soft: #edf3fc;

  --max: 1080px;
  --narrow: 820px;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(14, 28, 54, .05), 0 8px 28px rgba(14, 28, 54, .06);
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body { margin: 0; color: var(--text); background: var(--paper); font-family: var(--sans); font-size: 17px; line-height: 1.68; -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, p { margin-top: 0; }
b, strong { color: var(--ink); font-weight: 600; }

.wrap { width: min(var(--max), calc(100% - 40px)); margin: 0 auto; }
.wrap.narrow { width: min(var(--narrow), calc(100% - 40px)); }
.section { padding: 88px 0; }
.band { background: var(--soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* ---------- Top nav ---------- */
.topnav { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .86); backdrop-filter: saturate(1.6) blur(12px); -webkit-backdrop-filter: saturate(1.6) blur(12px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.topnav.scrolled { border-bottom-color: var(--line); }
.topnav-inner { width: min(var(--max), calc(100% - 40px)); margin: 0 auto; height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.wordmark { font-weight: 700; font-size: 1.05rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink); opacity: 0; transition: opacity .25s; }
.wordmark span { color: var(--blue); }
.topnav.scrolled .wordmark { opacity: 1; }
.wordmark:hover { text-decoration: none; }
.topnav-links { display: flex; gap: 4px; }
.topnav-links a { padding: 6px 12px; border-radius: 999px; color: var(--muted); font-size: .9rem; font-weight: 500; }
.topnav-links a:hover, .topnav-links a.active { color: var(--ink); background: var(--soft); text-decoration: none; }

/* ---------- Hero ---------- */
.hero { width: min(var(--max), calc(100% - 40px)); margin: 0 auto; padding: 28px 0 56px; text-align: center; }
.project-logo { width: clamp(240px, 36vw, 380px); margin: 0 auto 30px; }
h1 { max-width: 980px; margin: 0 auto 24px; color: var(--ink); font-family: var(--serif); font-size: clamp(1.8rem, 3.5vw, 3rem); font-weight: 600; line-height: 1.18; letter-spacing: -.015em; }
.c-std { color: var(--std); } .c-rob { color: var(--rob); } .c-safe { color: var(--safe); } .c-marl { color: var(--marl); }
.authors { margin-bottom: 2px; color: var(--ink); font-size: 1.25rem; font-weight: 600; }
.affiliation { margin-bottom: 28px; color: var(--muted); font-size: 1.125rem; }
.hero-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 1rem; font-weight: 500; transition: transform .15s, background .15s; }
.btn:hover { background: var(--blue-deep); text-decoration: none; transform: translateY(-1px); }
.btn svg { width: 18px; height: 18px; }
.btn small { font-size: .78rem; opacity: .75; }
.btn-muted { background: #eef1f6; color: var(--muted); cursor: default; }
.btn-muted:hover { background: #eef1f6; transform: none; }

/* ---------- Figures ---------- */
.figure { margin: 0 0 28px; }
.figure img { width: 100%; padding: 12px; border-radius: var(--radius); border: 1px solid var(--line); background: #fff; }
.figure figcaption { max-width: 900px; margin: 12px auto 0; color: var(--muted); font-size: .92rem; line-height: 1.55; text-align: center; }
.figure figcaption b { color: var(--ink); }
.zoomable img { cursor: zoom-in; }
.teaser .figure img { padding: 14px; box-shadow: var(--shadow); }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(6, 1fr); margin-top: 56px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stat { padding: 22px 12px; text-align: center; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat strong { display: block; color: var(--ink); font-family: var(--serif); font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 600; line-height: 1.1; }
.stat span { color: var(--muted); font-size: .85rem; }

/* ---------- Section headings ---------- */
.eyebrow { margin-bottom: 10px; color: var(--blue); font-size: .8rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.section-title { margin-bottom: 18px; color: var(--ink); font-family: var(--serif); font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 600; line-height: 1.2; letter-spacing: -.01em; }
.narrow .section-title { text-align: center; }
.lead { max-width: 820px; margin-bottom: 36px; font-size: 1.08rem; }
.abstract { margin: 0; text-align: justify; hyphens: auto; }

/* ---------- Why piano ---------- */
.why-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; }
.why-figure { margin: 0; }
.why-figure img { width: 100%; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); }
.why-list { list-style: none; margin: 0; padding: 0; counter-reset: why; }
.why-list li { position: relative; padding: 0 0 24px 52px; counter-increment: why; }
.why-list li:last-child { padding-bottom: 0; }
.why-list li::before { content: counter(why); position: absolute; left: 0; top: 0; width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 600; font-size: .9rem; display: grid; place-items: center; }
.why-list h3 { margin-bottom: 4px; color: var(--ink); font-size: 1.1rem; }
.why-list p { margin: 0; color: var(--muted); font-size: .98rem; }

/* ---------- Comparison table ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.compare { width: 100%; border-collapse: collapse; font-size: .95rem; }
.compare caption { caption-side: bottom; padding: 12px; color: var(--muted); font-size: .88rem; border-top: 1px solid var(--line); }
.compare th, .compare td { padding: 12px 18px; text-align: center; border-bottom: 1px solid var(--line); white-space: nowrap; }
.compare tbody tr:last-child th, .compare tbody tr:last-child td { border-bottom: 0; }
.compare thead th { color: var(--ink); font-weight: 600; background: var(--soft); }
.compare tbody th { text-align: left; color: var(--text); font-weight: 500; }
.compare .y { color: var(--safe); font-weight: 700; }
.compare .n { color: #c3c9d4; }
.compare .ours { background: #eef4fd; color: var(--ink); font-weight: 600; }
.compare thead .ours { background: var(--blue); color: #fff; }
.compare .ours.y { color: var(--blue); }

/* ---------- Leaderboard ---------- */
.leaderboard { margin: 0 0 36px; scroll-margin-top: 76px; }
.leaderboard-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 16px; }
.leaderboard-head .eyebrow { margin-bottom: 5px; }
.leaderboard-head h3 { color: var(--ink); font-family: var(--serif); font-size: 1.55rem; line-height: 1.2; }
.leaderboard-head > p { margin: 0; color: var(--muted); font-size: .88rem; white-space: nowrap; }
.leaderboard-controls { display: flex; align-items: end; gap: 28px; margin-bottom: 14px; padding: 14px 16px; border-radius: 12px; background: var(--soft); }
.leaderboard-controls label, .method-filters legend { color: var(--ink); font-size: .82rem; font-weight: 600; }
.song-filter { display: grid; gap: 5px; }
.song-filter select { min-width: 250px; padding: 8px 34px 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text); font: 500 .9rem var(--sans); }
.method-filters { display: flex; gap: 16px; margin: 0; padding: 0; border: 0; }
.method-filters legend { margin-bottom: 7px; }
.method-filters label { display: inline-flex; align-items: center; gap: 6px; font-size: .9rem; cursor: pointer; }
.method-filters input { width: 16px; height: 16px; accent-color: var(--blue); }
.sort-button { padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; white-space: nowrap; }
.sort-button:hover, .sort-button.is-active { color: var(--blue); }
.sort-button span { display: inline-block; min-width: 1em; margin-left: 3px; }
.leaderboard-table th:nth-child(2) { text-align: left; }
.leaderboard-table td { font-variant-numeric: tabular-nums; }
.leaderboard-table .leader th, .leaderboard-table .leader td { background: #f5f8fd; }
.leaderboard-table .leader td:first-child { color: var(--blue); font-weight: 700; }
.method-tag { display: inline-block; min-width: 42px; padding: 2px 8px; border-radius: 999px; font-size: .72rem; font-weight: 700; letter-spacing: .04em; }
.method-tag.rl { background: var(--std-soft); color: var(--std); }
.method-tag.llm { background: var(--marl-soft); color: var(--marl); }
.leaderboard-note { margin: 12px 4px 0; color: var(--muted); font-size: .86rem; line-height: 1.55; }
.leaderboard-note b { color: var(--ink); }
.leaderboard-empty { margin: 0; padding: 24px; border: 1px solid var(--line); border-top: 0; color: var(--muted); text-align: center; }

/* ---------- Tracks ---------- */
.tracks { padding-top: 8px; }
.track-index { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.ti { display: block; padding: 18px 20px; border-radius: var(--radius); border: 1px solid var(--line); border-top: 4px solid var(--c); color: var(--ink); font-weight: 600; font-size: 1.08rem; transition: transform .15s, box-shadow .15s; }
.ti:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow); }
.ti span { display: block; color: var(--c); font-size: .8rem; letter-spacing: .1em; }
.ti em { display: block; margin-top: 4px; color: var(--muted); font-size: .84rem; font-style: normal; font-weight: 400; }
.t-std { --c: var(--std); --c-soft: var(--std-soft); }
.t-rob { --c: var(--rob); --c-soft: var(--rob-soft); }
.t-safe { --c: var(--safe); --c-soft: var(--safe-soft); }
.t-marl { --c: var(--marl); --c-soft: var(--marl-soft); }

.track { border-top: 1px solid var(--line); }
.track:first-of-type { border-top: 0; }
.track-head { display: flex; align-items: flex-start; gap: 22px; margin-bottom: 36px; }
.track-num { flex: none; width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: var(--c-soft); color: var(--c); font-family: var(--serif); font-size: 1.6rem; font-weight: 700; }
.track-head h2 { margin: 2px 0 4px; color: var(--ink); font-family: var(--serif); font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 600; line-height: 1.15; }
.track-head p { margin: 0; color: var(--muted); font-size: 1.08rem; }
.track .figure img { border-color: color-mix(in srgb, var(--c) 22%, var(--line)); }

.track-body { display: grid; grid-template-columns: 1.35fr 1fr; gap: 40px; align-items: start; margin-bottom: 20px; }
.prose p { margin-bottom: 16px; }
.math { font-family: var(--serif); font-style: italic; white-space: nowrap; color: var(--ink); }
.math sub, .math sup { font-size: .7em; }

.song-card { padding: 22px 24px; border-radius: var(--radius); background: var(--c-soft); }
.song-card h3 { margin-bottom: 2px; color: var(--ink); font-size: 1rem; }
.song-note { margin-bottom: 14px; color: var(--muted); font-size: .82rem; }
.songs { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.songs li { display: grid; grid-template-columns: 1fr 88px 34px; align-items: center; gap: 10px; font-size: .82rem; line-height: 1.3; }
.songs .name { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.songs .name small { color: var(--muted); }
.songs .bar { height: 7px; border-radius: 99px; background: rgba(14, 28, 54, .08); overflow: hidden; }
.songs .bar i { display: block; height: 100%; border-radius: 99px; background: var(--c); }
.songs .val { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }

.results-title { margin: 44px 0 20px; color: var(--c); font-size: .8rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; display: flex; align-items: center; gap: 14px; }
.results-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.cards { display: grid; gap: 16px; margin: 8px 0 8px; }
.cards.two { grid-template-columns: repeat(2, 1fr); }
.cards.three { grid-template-columns: repeat(3, 1fr); }
.cards.four { grid-template-columns: repeat(4, 1fr); }
.card { padding: 20px 22px; border-radius: var(--radius); background: var(--c-soft); }
.card h3 { margin-bottom: 6px; color: var(--ink); font-size: 1.02rem; }
.card p, .card li { margin: 0; color: var(--text); font-size: .94rem; line-height: 1.6; }
.card ul { margin: 0; padding-left: 18px; }
.card li { margin-bottom: 4px; }
.card li::marker { color: var(--c); }
.card-note { margin-top: 12px !important; padding-top: 12px; border-top: 1px dashed color-mix(in srgb, var(--c) 35%, transparent); color: var(--muted) !important; }
.letter { color: var(--c); font-family: var(--serif); font-size: 1.3em; }

.takeaway { position: relative; margin: 4px 0 18px; padding: 18px 22px 18px 24px; border-radius: 0 var(--radius) var(--radius) 0; border-left: 4px solid var(--c); background: var(--c-soft); }
.takeaway b { color: var(--c); }

.more { margin-top: 8px; border: 1px solid var(--line); border-radius: var(--radius); }
.more summary { padding: 14px 20px; cursor: pointer; color: var(--ink); font-weight: 500; font-size: .95rem; list-style: none; display: flex; align-items: center; gap: 10px; }
.more summary::-webkit-details-marker { display: none; }
.more summary::before { content: "+"; width: 22px; height: 22px; border-radius: 50%; background: var(--c-soft); color: var(--c); display: grid; place-items: center; font-weight: 700; transition: transform .2s; }
.more[open] summary::before { content: "−"; }
.more > .figure { padding: 8px 20px 0; }

/* ---------- Findings ---------- */
.findings { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.finding { padding: 26px; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(14, 28, 54, .04); }
.finding-num { display: inline-grid; place-items: center; width: 32px; height: 32px; margin-bottom: 14px; border-radius: 10px; background: #eef4fd; color: var(--blue); font-weight: 700; font-size: .92rem; }
.finding h3 { margin-bottom: 8px; color: var(--ink); font-size: 1.05rem; line-height: 1.35; }
.finding p { margin: 0; color: var(--muted); font-size: .94rem; line-height: 1.6; }
.finding-summary { background: var(--ink); border-color: var(--ink); }
.finding-summary h3 { color: #fff; }
.finding-summary p { color: #c5cedf; }

/* ---------- Videos ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 26px; }
.chip { padding: 7px 16px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--muted); font: 500 .9rem var(--sans); cursor: pointer; transition: all .15s; }
.chip:hover { border-color: #c9d0dc; color: var(--ink); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip.f-std.is-active { background: var(--std); border-color: var(--std); }
.chip.f-rob.is-active { background: var(--rob); border-color: var(--rob); }
.chip.f-safe.is-active { background: var(--safe); border-color: var(--safe); }
.chip.f-marl.is-active { background: var(--marl); border-color: var(--marl); }
.video-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.video-card { margin: 0; }
.video-card[hidden] { display: none; }
.video-frame { aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; background: #0d1424; }
.video-frame img, .video-frame video { width: 100%; height: 100%; object-fit: cover; }
.video-placeholder { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: #8a96ad; font-size: .88rem; background: repeating-linear-gradient(90deg, #111a2d 0 22px, #0d1424 22px 24px); }
.video-placeholder svg { width: 44px; height: 44px; padding: 10px; border-radius: 50%; background: rgba(255, 255, 255, .08); color: #c5cedf; }
.video-card figcaption { padding: 12px 2px 0; display: grid; gap: 1px; font-size: .9rem; }
.video-card figcaption strong { color: var(--ink); font-size: 1rem; }
.video-card figcaption span:last-child { color: var(--muted); }
.tag { justify-self: start; margin-bottom: 4px; padding: 1px 9px; border-radius: 999px; background: var(--c-soft); color: var(--c); font-size: .74rem; font-weight: 600; letter-spacing: .03em; }

/* ---------- BibTeX ---------- */
.bibtex { position: relative; }
.bibtex pre { margin: 0; padding: 22px 24px; overflow-x: auto; border-radius: var(--radius); background: var(--ink); color: #dbe4f3; font: 400 .88rem/1.7 var(--mono); }
.copy { position: absolute; top: 12px; right: 12px; padding: 5px 12px; border: 1px solid rgba(255, 255, 255, .2); border-radius: 8px; background: rgba(255, 255, 255, .06); color: #dbe4f3; font: 500 .8rem var(--sans); cursor: pointer; }
.copy:hover { background: rgba(255, 255, 255, .14); }

/* ---------- Footer ---------- */
.footer { padding: 32px 0; color: var(--muted); font-size: .9rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 32px; background: rgba(8, 14, 28, .88); cursor: zoom-out; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; background: #fff; }
.lightbox-close { position: absolute; top: 14px; right: 18px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .stats { grid-template-columns: repeat(3, 1fr); }
  .stat:nth-child(3) { border-right: 0; }
  .stat:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .track-index { grid-template-columns: repeat(2, 1fr); }
  .why-grid, .track-body { grid-template-columns: 1fr; gap: 32px; }
  .cards.four { grid-template-columns: repeat(2, 1fr); }
  .findings { grid-template-columns: repeat(2, 1fr); }
  .video-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 680px) {
  body { font-size: 16px; }
  .wrap, .wrap.narrow, .hero, .topnav-inner { width: calc(100% - 32px); }
  .section { padding: 60px 0; }
  .topnav-links a:not([href="#tracks"]):not([href="#leaderboard"]):not([href="#citation"]) { display: none; }
  .topnav-links a { padding: 6px 9px; }
  .stats { grid-template-columns: repeat(2, 1fr); margin-top: 36px; }
  .stat { border-right: 1px solid var(--line) !important; border-bottom: 1px solid var(--line); }
  .stat:nth-child(2n) { border-right: 0 !important; }
  .stat:nth-last-child(-n+2) { border-bottom: 0; }
  .track-index, .cards.two, .cards.three, .cards.four, .findings, .video-grid { grid-template-columns: 1fr; }
  .track-head { gap: 16px; }
  .track-num { width: 52px; height: 52px; font-size: 1.3rem; border-radius: 14px; }
  .teaser .figure img { padding: 6px; }
  .abstract { text-align: left; }
  .songs li { grid-template-columns: 1fr 64px 30px; }
  .leaderboard-head { display: block; }
  .leaderboard-head > p { margin-top: 6px; }
  .leaderboard-controls { display: grid; gap: 14px; }
  .song-filter select { width: 100%; min-width: 0; }
  .footer-inner { flex-direction: column; }
}
