:root {
  --ink: #1d1d1f;
  --muted: #6b6b70;
  --line: #e4e4e8;
  --soft: #f6f6f8;
  --accent: #2c5f9e;
  --ref: #d1495b;
  --ours: #2a9d4b;
  --rt-base: #787878;
  --rt-ours: #288c3c;
  --width: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: #fff;
  font: 17px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

img, video { display: block; max-width: 100%; }

a { color: var(--accent); }

code {
  padding: 1px 5px;
  font: 0.88em/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--soft);
  border-radius: 4px;
}

.hero {
  max-width: var(--width);
  margin: 0 auto;
  padding: 64px 24px 28px;
  text-align: center;
}

.hero h1 {
  margin: 0 0 22px;
  font-size: clamp(30px, 4.6vw, 46px);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.authors, .affiliations {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 24px;
  margin: 0;
}

.authors { font-size: 19px; }

.authors .break { flex-basis: 100%; height: 0; }

.authors a { color: var(--accent); text-decoration: none; }

.authors a:hover { text-decoration: underline; }

.affiliations { margin-top: 8px; color: var(--muted); }

.note { margin: 6px 0 0; color: var(--muted); font-size: 15px; }

.links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 26px;
}

.button {
  padding: 9px 22px;
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  background: var(--ink);
  border-radius: 999px;
  transition: background 0.15s;
}

.button:hover { background: #45454a; }

.button.disabled, .button.disabled:hover { color: #8e8e93; background: #e9e9ed; cursor: default; }

main section {
  max-width: var(--width);
  margin: 0 auto;
  padding: 36px 24px;
}

main section + section { border-top: 1px solid var(--line); }

h2 {
  margin: 0 0 18px;
  font-size: 28px;
  letter-spacing: -0.01em;
  text-align: center;
}

h3 { margin: 0 0 8px; font-size: 19px; }

#video { padding-top: 8px; }

#video video {
  width: 100%;
  background: #000;
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

#abstract p { text-align: justify; hyphens: auto; }

figure { margin: 0; }

figure.wide { margin: 8px 0 24px; }

figure.wide img { width: 100%; }

figure.wide figcaption, .small {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.55;
}

.center { text-align: center; }

.muted { color: var(--muted); }

.cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 8px 0 18px;
}

.card {
  padding: 20px 22px;
  background: var(--soft);
  border-radius: 10px;
}

.card p { margin: 0; font-size: 16px; }

.table-wrap { overflow-x: auto; margin: 20px 0 28px; }

table.scores {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

table.scores caption {
  caption-side: bottom;
  padding-top: 10px;
  color: var(--muted);
  font-size: 14.5px;
  text-align: left;
}

table.scores th, table.scores td {
  padding: 9px 12px;
  text-align: center;
  white-space: nowrap;
}

table.scores th:first-child, table.scores td:first-child { text-align: left; }

table.scores thead th { border-bottom: 2px solid var(--ink); }

table.scores tbody tr { border-bottom: 1px solid var(--line); }

table.scores tbody tr.group { border-top: 2px solid var(--line); }

table.scores tbody tr:last-child { border-bottom: 2px solid var(--ink); }

table.scores td:nth-child(2) { color: var(--muted); }

table.scores.compact td:nth-child(2) { color: inherit; }

table.scores .best { font-weight: 700; color: var(--ours); }

table.scores .sd { color: var(--muted); font-size: 0.85em; }

table.scores .best .sd { font-weight: 400; }

.ref { color: var(--ref); }

.ours { color: var(--ours); }

.bev { display: grid; gap: 18px; margin: 20px 0 6px; }

.bev-row {
  display: grid;
  grid-template-columns: 30px 1fr 1fr;
  gap: 14px;
  align-items: start;
}

.bev-name {
  align-self: center;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-weight: 600;
  white-space: nowrap;
  text-align: center;
}

.bev-name small { color: var(--muted); font-weight: 400; }

.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }

.pair img { width: 100%; border-radius: 3px; }

.bev figcaption {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2px 16px;
  margin-top: 6px;
  font-size: 13.5px;
}

.retrieval-wrap { margin-bottom: 8px; }

.rt {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px 4px;
  min-width: 860px;
}

.rt-head {
  padding-bottom: 4px;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  border-bottom: 1px solid var(--line);
}

.rt-head.base { color: var(--rt-base); }

.rt-head.ours { color: var(--rt-ours); }

.rt-cell img { width: 100%; border: 1.5px solid currentColor; }

.rt-cell img + img { margin-top: 2px; }

.rt-cell figcaption { margin-top: 3px; font-size: 13px; text-align: center; }

.rt-cell.query { color: var(--ink); }

.rt-cell.base { color: var(--rt-base); }

.rt-cell.ours { color: var(--rt-ours); }

.rt .query, .rt-head:first-child { margin-right: 10px; }

.rt .sep { margin-left: 10px; }

.bibtex { position: relative; }

.bibtex pre {
  margin: 0;
  padding: 20px 22px;
  overflow-x: auto;
  font: 14px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--soft);
  border-radius: 10px;
}

.copy {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 12px;
  color: var(--ink);
  font: 600 13px/1.4 inherit;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
}

footer {
  padding: 28px 24px 40px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  border-top: 1px solid var(--line);
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  .hero { padding-top: 40px; }
  #abstract p { text-align: left; }
  .cards { grid-template-columns: 1fr; }
  .bev-row { grid-template-columns: 1fr; gap: 10px; }
  .bev-name { writing-mode: horizontal-tb; transform: none; text-align: left; }
}
