:root {
  --ink: #202831;
  --ink-2: #59636f;
  --ink-3: #737e8a;
  --line: #e2e6ea;
  --bg: #fff;
  --bg-soft: #f7f8fa;
  --accent: #2859a0;
  --ours: #f0f5fc;
  --radius: 8px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; }
a { color: var(--accent); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
button, input { font: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
::selection { background: #dce9fa; color: var(--ink); }
p { margin: 0 0 18px; }
.muted { color: var(--ink-2); }
.wrap { width: 100%; max-width: 1000px; margin-inline: auto; padding-inline: 28px; }
/* Keep the paper title within the same reading width as the page. */
header.wrap { padding-top: 84px; text-align: center; }
h1 {
  margin: 0 0 28px;
  font-size: clamp(26px, 3.8vw, 36px);
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: -.03em;
  text-wrap: balance;
}
.title-av { color: #801f6c; }
@supports (background-clip: text) or (-webkit-background-clip: text) {
  .title-av {
    /* Allow the V to extend beyond its advance width under tight letter spacing. */
    padding-inline-end: .08em;
    margin-inline-end: -.08em;
    background-image: linear-gradient(90deg, #61136e 5%, #bf3952 50%, #ed6925 95%);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
  }
}
@media (forced-colors: active) {
  .title-av { background-image: none; color: CanvasText; -webkit-text-fill-color: CanvasText; }
}
.authors { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 22px; margin: 0 0 10px; font-size: 16px; }
.authors span { white-space: nowrap; }
.authors a { color: var(--ink); }
.affil { margin: 0 0 4px; color: var(--ink-2); font-size: 14px; }
.contact { margin: 0 0 24px; color: var(--ink-2); font-size: 13px; }
.contact a { color: inherit; }
.contact a:hover { color: var(--accent); }
.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 16px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 19px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  transition: background .15s ease, border-color .15s ease;
}
.btn:hover { background: var(--bg-soft); border-color: #bdc6d1; text-decoration: none; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-primary:hover { background: #354355; border-color: #354355; }
.btn svg { width: 16px; height: 16px; flex: none; }
.also { margin: 0; font-size: 12px; color: var(--ink-2); }
.also a { color: inherit; text-decoration: underline; text-decoration-color: #b8c2cf; }
.also a:hover { color: var(--accent); }

/* Consistent reading rhythm and a quiet highlight for the abstract. */
main.wrap { padding-bottom: 88px; }
section { margin-top: 76px; scroll-margin-top: 32px; }
h2 {
  margin: 0 0 18px;
  font-size: 27px;
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: -.025em;
  text-wrap: balance;
}
section > p { color: var(--ink-2); }
#attention { margin-top: 44px; }
#attention .attention-figure { margin-top: 0; }
#abstract { margin-top: 56px; }
#teaser { margin-top: 40px; scroll-margin-top: 32px; }
.abstract-box {
  width: 100%;
  margin-inline: auto;
  padding: 24px 32px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #f8f8f7;
  font-family: Georgia, "Times New Roman", serif;
}
.abstract-box h2 {
  margin-bottom: 12px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0;
  text-align: left;
}
.abstract-box p {
  margin: 0;
  color: #353a40;
  font-size: 16px;
  line-height: 1.75;
  text-align: justify;
  hyphens: auto;
}

figure { margin: 28px 0 0; }
figure img { display: block; width: 100%; height: auto; border-radius: var(--radius); }
figure svg { display: block; width: 100%; height: auto; }
.framed img { border: 1px solid var(--line); background: #fff; padding: 10px; }
figcaption {
  max-width: 680px;
  margin: 18px auto 0;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.7;
  text-align: center;
  text-wrap: balance;
}
figcaption b { color: var(--ink); font-weight: 600; }
.zoomable { cursor: zoom-in; }
.method-figure { margin-top: 0; }
.method-figure figcaption { max-width: none; margin-inline: 16px; }
.ablation-figure figcaption { max-width: none; margin-inline: 0; text-wrap: wrap; }
.ma-timeline { padding: 12px 24px 8px; background: var(--bg-soft); }
.ma-marks button { min-height: 28px; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px; margin-top: 56px; }
.card { padding-top: 22px; border-top: 2px solid var(--line); }
.card h3 { margin: 0 0 10px; font-size: 15px; font-weight: 650; line-height: 1.4; letter-spacing: -.01em; }
.card p { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.75; }
.ablation-figure { margin-top: 64px; }
.two-up { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.three-up { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.narrow { max-width: 620px; margin-inline: auto; }
.narrower { max-width: 460px; margin-inline: auto; }
.attention-figure { font-family: inherit; }
.attention-grid { margin-left: 10px; margin-right: 10px; }
.attention-figure figcaption, #pca figcaption { max-width: 900px; }
#embedding figcaption { width: calc(100% - 32px); max-width: 868px; text-wrap: wrap; }
.attention-sound { width: 36px; height: 36px; }

/* Tables retain the paper's grouping, with lighter rules and more breathing room. */
.table-scroll { overflow-x: auto; margin-top: 24px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.5; }
caption { text-align: left; font-weight: 600; padding-bottom: 12px; }
th, td { padding: 10px 12px; text-align: left; white-space: nowrap; }
th { color: var(--ink-2); font-size: 13px; font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.ours { background: var(--ours); }
tr.sep { border-top: 1px solid var(--line); }
.paper-table { font-size: 13px; }
.paper-table th, .paper-table td { padding: 10px 12px; }
.paper-table[data-result-table="frozen"] :is(th, td),
.paper-table[data-result-table="finetuned"] :is(th, td) { text-align: center; }
.paper-table th.method-column,
.paper-table th[scope="row"] { text-align: left; }
.paper-table thead { background: var(--bg-soft); border-top: 1px solid #aeb8c4; border-bottom: 1px solid var(--line); }
.paper-table thead th { font-size: 12px; font-weight: 600; }
.paper-table tbody tr + tr { border-top: 1px solid #edf0f3; }
.paper-table tbody + tbody { border-top: 1px solid #b9c4d1; }
.paper-table tbody:last-child { border-bottom: 1px solid #b9c4d1; }
.paper-table .table-citation { font-size: 11px; }
.paper-table .encoder-group { padding-inline: 8px; }
.paper-table .ours th[scope="row"] { font-weight: 600; }
.paper-table .ours + .ours { border-top-color: #e1e9f5; }
.paper-caption { font-size: 13px; line-height: 1.75; }
.tablenote { margin-top: 12px; color: var(--ink-2); font-size: 13px; }
.best { font-weight: 700; }

.bib-box { position: relative; margin-top: 20px; }
pre.bibtex {
  margin: 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  background: var(--bg-soft);
  color: #465363;
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.85;
  tab-size: 2;
}
.copy-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  min-height: 34px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--bg);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.copy-btn:hover { color: var(--ink); border-color: #bdc6d1; }

#lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 3vh 3vw;
  background: rgba(12, 16, 22, .9);
  cursor: zoom-out;
}
#lightbox.open { display: flex; }
#lightbox img { max-width: 100%; max-height: 100%; border-radius: 6px; background: #fff; }

@media (max-width: 720px) {
  .wrap { padding-inline: 22px; }
  header.wrap { padding-top: 52px; }
  #teaser { margin-top: 32px; }
  .cards { grid-template-columns: 1fr; gap: 28px; margin-top: 40px; }
  .card { padding-top: 18px; }
  .card p { font-size: 15px; }
  .ablation-figure { margin-top: 48px; }
  .two-up, .three-up { grid-template-columns: 1fr; }
  section { margin-top: 56px; }
  h2 { font-size: 25px; }
  .abstract-box { padding: 20px 18px; }
  .abstract-box p { font-size: 15px; text-align: left; hyphens: none; }
  figcaption, .method-figure figcaption, #embedding figcaption {
    width: 100%;
    max-width: none;
    margin-inline: 0;
    text-align: justify;
    text-align-last: left;
    text-wrap: wrap;
    hyphens: auto;
  }
  .paper-table th, .paper-table td { padding: 9px 10px; }
}

@media (max-width: 640px) {
  .ma-timeline { padding: 10px 16px; }
}

@media (max-width: 540px) {
  .authors { display: grid; grid-template-columns: repeat(2, max-content); gap: 4px 22px; font-size: 14px; }
}

@media (max-width: 420px) {
  .wrap { padding-inline: 20px; }
  header.wrap { padding-top: 40px; }
  h1 { margin-bottom: 24px; }
  .authors { line-height: 1.85; }
  .affil { font-size: 13px; }
  .contact { font-size: 11.5px; }
  .also { max-width: 280px; margin-inline: auto; }
  .btn { padding-inline: 16px; }
  #attention { margin-top: 32px; }
  pre.bibtex { padding: 20px; }
  .copy-btn { top: 10px; right: 10px; min-height: 28px; padding: 3px 10px; }
}

@media (max-width: 360px) {
  .links { gap: 8px; }
  .btn { gap: 6px; padding-inline: 12px; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}
