:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --surface-2: #f3f1ec;
  --ink: #1d2327;
  --muted: #5d676d;
  --line: #e4e0d8;
  --ours: #ED8D5A;
  --ours-ink: #b85a28;
  --ours-soft: #fbe4d6;
  --teal: #4198AC;
  --teal-2: #51999F;
  --mint: #BFDFD2;
  --sky: #7BC0CD;
  --sand: #DBCB92;
  --sand-ink: #8a6a25;
  --heat-0: #ffffff;
  --code-bg: #1f2529;
  --code-ink: #e8ecee;
  --shadow: 0 1px 2px rgba(29, 35, 39, .05), 0 8px 24px rgba(29, 35, 39, .06);
  --radius: 14px;
  --maxw: 1120px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15191b; --surface: #1d2326; --surface-2: #252c30; --ink: #e9ecec; --muted: #a3adb1; --line: #333c41;
    --ours-soft: #4a2f22; --ours-ink: #f3a87f; --sand-ink: #e3cf8d; --heat-0: #1d2326;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  }
}
:root[data-theme="dark"] {
  --bg: #15191b; --surface: #1d2326; --surface-2: #252c30; --ink: #e9ecec; --muted: #a3adb1; --line: #333c41;
  --ours-soft: #4a2f22; --ours-ink: #f3a87f; --sand-ink: #e3cf8d; --heat-0: #1d2326;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.6 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
figure { margin: 0; }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
section { padding: 64px 0; }
section.band { background: var(--surface-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; margin: 0; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); margin-bottom: 10px; }
h3 { font-size: 1.1rem; margin-bottom: 6px; }
.kicker { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 700; color: var(--ours-ink); margin-bottom: 8px; }
.lead { font-size: 1.12rem; color: var(--muted); max-width: 780px; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.center { text-align: center; }
.center .lead { margin-left: auto; margin-right: auto; }

/* nav */
.nav { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.nav .wrap { display: flex; align-items: center; gap: 22px; height: 54px; }
.nav .brand { font-weight: 800; color: var(--ink); letter-spacing: -0.02em; }
.nav .brand span { color: var(--ours); }
.nav .links { display: flex; gap: 18px; margin-left: auto; font-size: .92rem; }
.nav .links a { color: var(--muted); }
.nav .links a:hover { color: var(--ink); text-decoration: none; }
.theme-btn { border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 999px; width: 32px; height: 32px; cursor: pointer; font-size: 15px; }
@media (max-width: 720px) { .nav .links { display: none; } .theme-btn { margin-left: auto; } }

/* hero */
.hero { padding: 56px 0 36px; }
.hero h1 { font-size: clamp(2.3rem, 5.4vw, 3.6rem); font-weight: 800; letter-spacing: -0.03em; }
.hero h1 .accent { color: var(--ours); }
.hero .subtitle { font-size: clamp(1.1rem, 2vw, 1.4rem); color: var(--muted); margin: 10px 0 20px; max-width: 860px; }
.authors { font-size: 1rem; line-height: 1.9; }
.authors a { color: var(--ink); font-weight: 600; }
.authors span { white-space: nowrap; margin-right: 12px; font-weight: 600; }
.affil { color: var(--muted); font-size: .92rem; }
.btns { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 8px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 600; font-size: .95rem; box-shadow: var(--shadow); }
.btn:hover { text-decoration: none; border-color: var(--ours); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn svg { width: 17px; height: 17px; }
.news { display: inline-block; margin-top: 14px; padding: 6px 12px; border-radius: 10px; background: var(--ours-soft); color: var(--ours-ink); font-size: .9rem; }
.teaser { margin: 34px 0 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.teaser img { border-radius: 8px; background: #fff; }
.caption { color: var(--muted); font-size: .92rem; margin-top: 12px; }

/* tiles */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 30px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.tile .v { font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; color: var(--ours-ink); line-height: 1.1; }
.tile .v small { font-size: 1rem; font-weight: 600; color: var(--muted); }
.tile .l { color: var(--muted); font-size: .9rem; margin-top: 6px; }
@media (max-width: 860px) { .tiles { grid-template-columns: repeat(2, 1fr); } }

/* ask / measure / read */
.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 28px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card.ours { border-color: var(--ours); box-shadow: 0 0 0 3px var(--ours-soft), var(--shadow); }
.card .tag { font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.card.ours .tag { color: var(--ours-ink); }
.card ul { padding-left: 18px; margin: 10px 0 0; color: var(--muted); font-size: .95rem; }
.card li { margin-bottom: 4px; }
.yes { color: #3d8f6b; font-weight: 700; }
.no { color: #b3261e; font-weight: 700; }
@media (max-width: 860px) { .three { grid-template-columns: 1fr; } }

/* method */
.method { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; margin-top: 26px; }
.steps { counter-reset: s; }
.step { position: relative; padding-left: 46px; margin-bottom: 22px; }
.step::before { counter-increment: s; content: counter(s); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--ours); color: #fff; font-weight: 800; display: grid; place-items: center; font-size: .92rem; }
.step p { margin: 4px 0 0; color: var(--muted); font-size: .96rem; }
.formula { font-family: "JetBrains Mono", monospace; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; display: inline-block; margin-top: 8px; font-size: .9rem; color: var(--ink); }
.peaks { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; color: var(--muted); padding: 6px 14px; border-radius: 999px; font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.peaks svg { width: 100%; height: auto; margin-top: 12px; }
.peaks .note { font-size: .9rem; color: var(--muted); min-height: 3em; margin-top: 8px; }
@media (max-width: 860px) { .method { grid-template-columns: 1fr; } }

/* explorer */
.explorer { margin-top: 26px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.ex-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.ex-head .group { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ex-head .lbl { font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.ex-body { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.ex-media { padding: 18px; border-right: 1px solid var(--line); min-width: 0; }
.ex-text { padding: 18px; min-width: 0; display: flex; flex-direction: column; }
@media (max-width: 900px) { .ex-body { grid-template-columns: 1fr; } .ex-media { border-right: 0; border-bottom: 1px solid var(--line); } }
.qbox { font-weight: 600; margin-bottom: 4px; }
.opts { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.opt { font-size: .82rem; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.opt.ans { border-color: #3d8f6b; color: #3d8f6b; font-weight: 700; }
.opt.pred { box-shadow: inset 0 0 0 1.5px var(--ink); color: var(--ink); }
.player { width: 100%; border-radius: 8px; background: #000; margin-top: 10px; max-height: 250px; }
audio.player { background: transparent; height: 40px; }
.track-wrap { position: relative; margin-top: 12px; }
.track-row { display: grid; grid-template-columns: 74px 1fr; align-items: center; gap: 8px; margin-top: 6px; }
.track-row .rl { font-size: .72rem; color: var(--muted); text-align: right; line-height: 1.2; }
.track { position: relative; height: 30px; background: var(--surface-2); border-radius: 5px; }
.track.frames { height: auto; aspect-ratio: auto; display: flex; overflow: hidden; border-radius: 5px; background: #000; }
.track.frames img { flex: 1 1 0; min-width: 0; height: 46px; object-fit: cover; opacity: .9; }
.track.wave svg { width: 100%; height: 56px; display: block; }
.track.wave { height: 56px; background: transparent; }
.track.ev { height: 12px; background: transparent; }
.ev-seg { position: absolute; top: 0; bottom: 0; background: var(--sand); border-radius: 3px; }
.cell { position: absolute; top: 0; bottom: 0; border-radius: 3px; cursor: pointer; transition: background .15s; }
.cell.lab { box-shadow: inset 0 0 0 2.5px var(--ours); }
.cell:hover { outline: 2px solid var(--ink); outline-offset: -1px; z-index: 2; }
.playhead { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--ink); pointer-events: none; display: none; z-index: 3; }
.axis { position: relative; height: 16px; font-size: .7rem; color: var(--muted); }
.axis span { position: absolute; transform: translateX(-50%); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: .8rem; color: var(--muted); margin-top: 10px; align-items: center; }
.legend i { display: inline-block; width: 14px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 5px; }
.legend .grad { width: 46px; background: linear-gradient(90deg, var(--heat-0), #BFDFD2, #7BC0CD, #4198AC); border: 1px solid var(--line); }
.legend .labbox { box-shadow: inset 0 0 0 2.5px var(--ours); background: var(--surface-2); }
.legend .evbox { background: var(--sand); }

/* document quotes */
.quotes-img { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 12px; }
.quotes-txt { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
@media (max-width: 600px) { .quotes-img { grid-template-columns: repeat(3, 1fr); } .quotes-txt { grid-template-columns: 1fr; } }
.quote { position: relative; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); overflow: hidden; cursor: default; transition: box-shadow .15s, opacity .15s; }
.quote.lab { box-shadow: 0 0 0 2.5px var(--ours); border-color: var(--ours); }
.quote .qh { display: flex; justify-content: space-between; align-items: center; font-size: .72rem; font-weight: 700; padding: 4px 7px; color: var(--muted); }
.quote .gold { color: var(--sand-ink); background: color-mix(in srgb, var(--sand) 45%, transparent); border-radius: 4px; padding: 0 5px; }
.quote .mass { height: 5px; background: var(--surface-2); }
.quote .mass b { display: block; height: 100%; background: var(--teal); transition: width .2s; }
.quote.lab .mass b { background: var(--ours); }
.quote img { width: 100%; height: 84px; object-fit: contain; background: #fff; border-top: 1px solid var(--line); }
.quote .qt { font-size: .76rem; line-height: 1.4; padding: 2px 8px 0; margin-bottom: 8px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.quote:hover .qt { -webkit-line-clamp: unset; }
.quote.dim { opacity: .55; }

/* sentences */
.sents { display: flex; flex-direction: column; gap: 6px; overflow-y: auto; max-height: 470px; padding-right: 4px; margin-top: 8px; }
.sent { border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px; cursor: pointer; font-size: .92rem; background: var(--surface); transition: border-color .12s, background .12s; }
.sent:hover { border-color: var(--sky); }
.sent.on { border-color: var(--ours); background: color-mix(in srgb, var(--ours-soft) 55%, var(--surface)); }
.sent.whole { font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.chip { font-size: .72rem; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--ours-soft); color: var(--ours-ink); font-family: "JetBrains Mono", monospace; }
.chip.none { background: var(--surface-2); color: var(--muted); font-family: inherit; }
.verdict { margin-top: 12px; font-size: .88rem; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); color: var(--muted); }
.verdict b { color: var(--ink); }
.cause { margin-top: 10px; font-size: .88rem; }
.cause .bars { display: grid; grid-template-columns: 136px 1fr 52px; gap: 4px 8px; align-items: center; margin-top: 6px; }
.cause .bar { height: 12px; border-radius: 3px; }
.cause .num { font-family: "JetBrains Mono", monospace; font-size: .78rem; text-align: right; }

/* results */
.fig { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-top: 22px; }
.fig img { background: #fff; border-radius: 6px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.two > * { min-width: 0; }
@media (max-width: 860px) { .two { grid-template-columns: 1fr; } }
.tbl-wrap { overflow-x: auto; margin-top: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; font-size: .88rem; }
th, td { padding: 8px 10px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
th:first-child, td:first-child { text-align: left; }
thead th { font-size: .78rem; color: var(--muted); font-weight: 700; }
thead tr:first-child th { text-transform: uppercase; letter-spacing: .06em; color: var(--ink); }
tr.grp td { background: var(--surface-2); font-style: italic; color: var(--muted); text-align: left; font-size: .82rem; }
tr.ot td:first-child { font-weight: 700; }
tr.ot td { background: color-mix(in srgb, var(--ours-soft) 40%, transparent); }
td.fwd { color: var(--muted); }
td.zero { color: var(--ours-ink); font-weight: 800; }
td.best { font-weight: 800; }
.tbl-note { font-size: .8rem; color: var(--muted); padding: 10px 12px; }
.findings { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 22px; }
.finding { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--ours); border-radius: 10px; padding: 14px 16px; }
.finding p { margin: 4px 0 0; color: var(--muted); font-size: .94rem; }
@media (max-width: 860px) { .findings { grid-template-columns: 1fr; } }

/* code */
pre.code { background: var(--code-bg); color: var(--code-ink); border-radius: 12px; padding: 16px 18px; overflow-x: auto; font-size: .85rem; line-height: 1.55; margin: 12px 0 0; }
pre.code .c { color: #8fa3ab; }
pre.code .k { color: #f3a87f; }
pre.code .s { color: #a7d7c5; }
.bib { position: relative; }
.copy { position: absolute; right: 10px; top: 10px; border: 1px solid #3b464c; background: #2a3236; color: #cfd6d9; border-radius: 6px; font-size: .78rem; padding: 4px 9px; cursor: pointer; }
footer { padding: 36px 0 50px; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); }
