/* MusicListenBench — shared styles for GitHub Pages and the HF Space */
:root {
  --paper: #ffffff;
  --panel: #f1f3f7;
  --ink: #16202e;
  --muted: #5b6576;
  --rule: #d9dee7;
  --melody: #2f5bea;
  --rhythm: #c2185b;
  --timbre: #0e8f7e;
  --harmony: #7a4cd9;
  --focus: #2f5bea;
  --display: "Inter", "Inter Variable", -apple-system, "Segoe UI", system-ui, sans-serif;
  --body: "Inter", "Inter Variable", -apple-system, "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --measure: 66ch;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121823; --panel: #1b2331; --ink: #e8ecf3; --muted: #9aa5b8; --rule: #2c3647;
    --melody: #7b9bff; --rhythm: #f06292; --timbre: #3cc7b2; --harmony: #b08cff; --focus: #7b9bff;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

/* Soft pastel wash across the whole page, fixed while scrolling */
:root { --glass: rgba(255,255,255,.58); --glass-line: rgba(255,255,255,.75); }
@media (prefers-color-scheme: dark) { :root { --glass: rgba(20,24,33,.62); --glass-line: rgba(255,255,255,.08); } }
body { position: relative; isolation: isolate; background: transparent; }
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(55% 60% at 0% 12%,   #c3cdef 0%, transparent 70%),
    radial-gradient(45% 45% at 45% 5%,   #f5ead0 0%, transparent 70%),
    radial-gradient(40% 45% at 55% 42%,  #f0d4b4 0%, transparent 70%),
    radial-gradient(45% 55% at 100% 30%, #efc9cf 0%, transparent 70%),
    radial-gradient(40% 45% at 80% 70%,  #d3c8d8 0%, transparent 70%),
    radial-gradient(55% 55% at 0% 95%,   #c7e5d8 0%, transparent 70%),
    radial-gradient(50% 50% at 100% 100%,#c9def1 0%, transparent 70%),
    #f1f0ee;
}
@media (prefers-color-scheme: dark) {
  body::before {
    background:
      radial-gradient(55% 60% at 0% 12%,   #26304f 0%, transparent 70%),
      radial-gradient(45% 45% at 50% 20%,  #3a3326 0%, transparent 70%),
      radial-gradient(45% 55% at 100% 30%, #402a33 0%, transparent 70%),
      radial-gradient(55% 55% at 0% 95%,   #1e3a31 0%, transparent 70%),
      radial-gradient(50% 50% at 100% 100%,#1f3244 0%, transparent 70%),
      #14171e;
  }
  .pair { border-color: var(--glass-line) !important; }
}
body {
  margin: 0; color: var(--ink);
  font: 400 1rem/1.6 var(--body); letter-spacing: -.005em; -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 1;
}
a { color: inherit; text-decoration-color: var(--rule); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2rem); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--paper); padding: .5rem 1rem; z-index: 10; }

/* Header */
.site-head { position: relative; }
.site-head .wrap { border-bottom: 1px solid color-mix(in srgb, var(--ink) 10%, transparent); display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 76px; flex-wrap: wrap; }
.brand { display: flex; align-items: baseline; gap: .6rem; text-decoration: none; }
.brand b { font: 600 1.1rem/1 var(--display); letter-spacing: -.02em; }
.brand span { color: var(--muted); font-size: .9rem; }
.nav { display: flex; gap: .15rem; flex-wrap: wrap; padding: .25rem; border-radius: 12px; background: var(--glass); border: 1px solid var(--glass-line); }
.nav a { text-decoration: none; padding: .45rem .85rem; border-radius: 9px; color: var(--muted); font-weight: 500; font-size: .95rem; }
.nav a:hover { color: var(--ink); background: var(--glass); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--paper); box-shadow: 0 1px 2px rgba(0,0,0,.06); }

/* Hero */
.hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); align-items: center; padding: clamp(2.5rem, 7vw, 5rem) 0 clamp(2rem, 5vw, 3.5rem); }
.hero h1 { font: 700 clamp(2.6rem, 6vw, 4.6rem)/.98 var(--display); letter-spacing: -.055em; margin: 0 0 1.25rem; max-width: 12ch; font-feature-settings: "ss01", "cv11"; }
.lede { font-size: 1.15rem; letter-spacing: -.01em; color: var(--muted); max-width: 42ch; margin: 0 0 1.75rem; }
.actions { display: flex; gap: .75rem; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; padding: .7rem 1.15rem; border-radius: 10px; font-weight: 600; letter-spacing: -.01em; text-decoration: none; border: 1.5px solid var(--ink); }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn:hover { transform: translateY(-1px); }

/* Pair widget: the one bold element */
.pair { margin: 0; background: var(--glass); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border: 1px solid color-mix(in srgb, #fff 60%, transparent); box-shadow: 0 24px 60px -40px rgba(60,40,80,.35); border-color: var(--glass-line); border-radius: 18px; padding: 1.25rem 1.25rem 1rem; }
.pair-q { font: 600 1.05rem/1.3 var(--display); letter-spacing: -.015em; margin: 0 0 .9rem; }
.aspects { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.aspects button {
  font: 500 .9rem var(--body); cursor: pointer; padding: .4rem .8rem; border-radius: 999px;
  border: 1.5px solid var(--rule); background: var(--paper); color: var(--ink);
}
.aspects button[aria-pressed="true"] { border-color: var(--c); background: var(--c); color: #fff; }
.pair svg { width: 100%; height: auto; display: block; }
.pair-caption { margin: .75rem 0 0; color: var(--muted); font-size: .95rem; min-height: 3em; }
.lane-label { font: 600 12px var(--body); fill: var(--muted); }
.note { transition: y .35s ease, x .35s ease, width .35s ease, fill .35s ease; }
@media (prefers-reduced-motion: reduce) { .note, .btn { transition: none; } .btn:hover { transform: none; } }

/* Sections */
section.block { padding: clamp(2rem, 5vw, 3.5rem) 0; border-top: 1px solid color-mix(in srgb, var(--ink) 12%, transparent); }
h2 { font: 700 clamp(1.8rem, 3.4vw, 2.6rem)/1.02 var(--display); letter-spacing: -.045em; margin: 0 0 .5rem; }
h3 { font: 600 1.15rem/1.3 var(--display); letter-spacing: -.015em; margin: 1.75rem 0 .4rem; }
.sub { color: var(--muted); margin: 0 0 1.5rem; max-width: var(--measure); }
.prose { max-width: var(--measure); }
.prose p, .prose li { margin: 0 0 .9rem; }
.todo { background: color-mix(in srgb, #f5c542 35%, transparent); padding: 0 .25em; border-radius: 3px; }

/* Leaderboard controls */
.controls { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.controls input[type="search"] {
  flex: 1 1 240px; font: inherit; padding: .6rem .9rem; border-radius: 10px;
  border: 1px solid var(--glass-line); background: var(--glass); color: var(--ink);
}
.seg { display: inline-flex; background: var(--glass); border: 1px solid var(--glass-line); border-radius: 10px; overflow: hidden; }
.seg button { font: 600 .9rem var(--body); padding: .55rem .85rem; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.check { display: inline-flex; gap: .45rem; align-items: center; color: var(--muted); font-weight: 600; font-size: .95rem; }

/* Table */
.table-scroll { overflow-x: auto; border: 1px solid var(--glass-line); border-radius: 16px; background: var(--glass); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: 0 24px 60px -40px rgba(60,40,80,.35); }
table { border-collapse: collapse; width: 100%; min-width: 860px; }
th, td { padding: .8rem .95rem; text-align: left; border-bottom: 1px solid color-mix(in srgb, var(--ink) 8%, transparent); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
th { font-size: .82rem; color: var(--muted); font-weight: 600; background: transparent; white-space: nowrap; }
th button { all: unset; cursor: pointer; display: inline-flex; gap: .3rem; align-items: center; }
th button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
th[aria-sort="descending"] button::after { content: "↓"; }
th[aria-sort="ascending"] button::after { content: "↑"; }
th .dot { width: .6rem; height: .6rem; border-radius: 50%; background: var(--c); display: inline-block; }
td.num { width: 11%; }
.rank { font: 500 .85rem var(--mono); color: var(--muted); width: 3rem; }
.model b { display: block; font-weight: 700; }
.model small { color: var(--muted); }
td.method { white-space: nowrap; }
.tags { margin-top: .3rem; }
.tag { display: inline-block; font-size: .78rem; font-weight: 700; padding: .1rem .5rem; border-radius: 999px; background: var(--panel); color: var(--muted); margin-right: .35rem; }
.tag.self { background: transparent; border: 1px dashed var(--rule); }
.score { display: grid; gap: .3rem; }
.score span { font-weight: 700; }
.bar { height: 5px; border-radius: 3px; background: var(--rule); position: relative; overflow: hidden; }
.bar i { position: absolute; inset: 0 auto 0 0; background: var(--c); border-radius: 3px; }
.bar::after { content: ""; position: absolute; left: var(--chance, 50%); top: -2px; bottom: -2px; width: 1.5px; background: var(--ink); opacity: .45; }
td.overall span { font-size: 1.1rem; }
tr.baseline td { color: var(--muted); font-style: italic; }
tr.baseline .bar i { opacity: .35; }
.empty { padding: 2rem; text-align: center; color: var(--muted); }
.table-note { color: var(--muted); font-size: .9rem; margin-top: .75rem; }

/* Aspect cards on About */
.aspect-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.5rem 2rem; margin: 1.5rem 0; padding: 0; list-style: none; }
.aspect-list li { border-top: 3px solid var(--c); padding-top: .75rem; }
.aspect-list b { font: 700 1.15rem var(--display); display: block; margin-bottom: .25rem; }

/* Steps on Submit (a real sequence) */
ol.steps { counter-reset: s; list-style: none; padding: 0; max-width: var(--measure); }
ol.steps > li { counter-increment: s; position: relative; padding-left: 3rem; margin-bottom: 1.5rem; }
ol.steps > li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 2rem; height: 2rem; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; font: 700 .95rem var(--display); }
pre { font-family: var(--mono); background: var(--glass); border: 1px solid var(--glass-line); padding: 1rem; border-radius: 10px; overflow-x: auto; font-size: .88rem; }
code { font-size: .92em; }

/* Footer */
.site-foot { border-top: 1px solid color-mix(in srgb, var(--ink) 10%, transparent); padding: 2rem 0 3rem; color: var(--muted); font-size: .95rem; }
.site-foot .wrap { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

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

/* leaderboard with FLIP/STAY columns */
table { min-width: 1080px; }
td.num { width: 7%; }
td.plain span { font-weight: 600; font-variant-numeric: tabular-nums; }
tr.group th { background: color-mix(in srgb, var(--ink) 6%, transparent); color: var(--ink); font-size: .85rem; padding: .55rem .95rem; }
.model small.note { display: block; margin-top: .15rem; }
