:root {
  color-scheme: light;
  --background: #fffafa;
  --text: #362d30;
  --muted: #706065;
  --accent: #a33243;
  --line: #ecdde0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background: var(--background);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: radial-gradient(ellipse 900px 480px at 50% 0, #fbeaec 0, transparent 100%);
}

main {
  width: min(100% - 48px, 1060px);
  margin-inline: auto;
}

.paper-header { padding-top: 70px; text-align: center; }

.project-name {
  margin: 0 0 22px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 750;
  letter-spacing: .2em;
}

h1 {
  max-width: 1000px;
  margin: 0 auto;
  color: #30242a;
  font-size: clamp(30px, 3.4vw, 44px);
  font-weight: 730;
  letter-spacing: -.035em;
  line-height: 1.2;
  text-wrap: balance;
}

h1 span { display: block; color: var(--accent); }

.venue {
  margin: 20px 0 0;
  color: var(--accent);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.5;
}

ul { padding: 0; list-style: none; }
sup { position: relative; top: -.05em; margin-left: 2px; font-size: .65em; line-height: 0; }

.authors {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 25px;
  max-width: 720px;
  margin: 30px auto 18px;
  font-size: 18px;
  font-weight: 550;
  line-height: 1.6;
}

.authors li { white-space: nowrap; }
.authors a { color: inherit; text-decoration: none; }
.authors a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
.authors sup { color: var(--accent); }

.affiliations {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 23px;
  max-width: 600px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.affiliations sup, .author-notes sup { margin: 0 3px 0 0; }

.author-notes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 16px;
  margin: 15px auto 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.resources {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 30px 0 0;
}

.resource {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: 54px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text);
  background: #fff;
  text-align: left;
  text-decoration: none;
}

.resource-icon { flex: 0 0 20px; width: 20px; height: 20px; }
.hugging-face { font-size: 21px; line-height: 20px; }
.resource-copy { display: flex; flex-direction: column; gap: 3px; }
.resource-title { font-size: 13px; font-weight: 650; white-space: nowrap; }
.resource-status { color: var(--muted); font-size: 11px; white-space: nowrap; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Linked resources have hover and keyboard focus states. */
a.resource:hover { border-color: var(--accent); }
a.resource:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }

.abstract {
  max-width: 800px;
  margin: 54px auto 0;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

h2 {
  margin: 0 0 20px;
  color: #30242a;
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -.025em;
  text-align: center;
}

.abstract p { margin: 0; font-size: 17px; line-height: 1.85; }

.work-in-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 800px;
  margin: 30px auto 68px;
  padding: 15px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: #f8f0f1;
}

.status-dot { flex: 0 0 6px; width: 6px; height: 6px; border-radius: 50%; background: #b97883; }
.work-in-progress p { margin: 0; font-size: 13px; line-height: 1.6; }

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 20px;
  max-width: 1060px;
  margin: 0 auto;
  padding: 22px 0 28px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

footer span:first-child { color: var(--accent); font-weight: 700; letter-spacing: .12em; }

@media (max-width: 1108px) { footer { margin-inline: 24px; } }

@media (max-width: 600px) {
  main { width: calc(100% - 36px); }
  .paper-header { padding-top: 42px; }
  .project-name { margin-bottom: 18px; }
  h1 { font-size: clamp(27px, 6.7vw, 36px); line-height: 1.25; }
  h1 span { margin-top: 5px; }
  .authors { gap: 8px 17px; margin-top: 25px; font-size: 16px; }
  .affiliations { gap: 4px 14px; font-size: 13px; }
  .author-notes { gap: 4px 12px; margin-top: 14px; }
  .author-notes li:first-child { flex-basis: 100%; }
  .resources { gap: 8px; margin-top: 25px; }
  .resource { gap: 6px; min-height: 50px; padding: 8px; }
  .abstract { margin-top: 37px; padding-top: 28px; }
  h2 { font-size: 24px; margin-bottom: 16px; }
  .abstract p { font-size: 16px; line-height: 1.8; }
  .work-in-progress { margin: 26px auto 42px; padding: 13px 14px; }
  footer { margin-inline: 18px; padding-top: 18px; }
}

@media print {
  body { background: #fff; }
  main { width: 100%; }
  .paper-header { padding-top: 0; }
  .abstract { margin-top: 30px; }
  .work-in-progress { margin-bottom: 25px; }
  footer { margin-inline: 0; }
}

/* Research content */
html { scroll-padding-top: 24px; }
a { color: var(--accent); }
a:focus-visible, button:focus-visible, summary:focus-visible, [tabindex="0"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
button { font: inherit; }
img { display: block; max-width: 100%; height: auto; }
.skip-link { position: fixed; top: 12px; left: 12px; z-index: 20; padding: 12px; background: #fff; transform: translateY(-180%); }
.skip-link:focus { transform: none; }
.section-nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px 28px; margin-top: 27px; font-size: 13px; }
.section-nav a { color: var(--muted); text-decoration: none; text-underline-offset: 5px; }
.section-nav a:hover { color: var(--accent); text-decoration: underline; }

.overview { margin-top: 62px; }
.overview h2 { font-size: clamp(24px, 3vw, 30px); line-height: 1.35; letter-spacing: -.025em; }
.overview h2 span { color: var(--accent); }
.section-lead { max-width: 790px; margin: 0 auto 30px; color: var(--muted); font-size: 17px; line-height: 1.8; text-align: center; }
.paper-figure { margin: 30px 0 0; }
.figure-link { position: relative; display: block; padding: 12px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: zoom-in; }
.figure-link img { width: 100%; }
.enlarge-label { display: block; margin: 10px 4px 0; color: var(--muted); font-size: 12px; text-align: right; }
.figure-link:hover { border-color: var(--accent); }
figcaption { max-width: 840px; margin: 15px auto 0; color: var(--muted); font-size: 13px; line-height: 1.7; text-align: center; }

.abstract { margin-top: 55px; padding-top: 35px; }
.research-section { margin-top: 66px; padding-top: 44px; border-top: 1px solid var(--line); }
.research-section h2 { margin-bottom: 18px; font-size: 30px; line-height: 1.25; }
.eyebrow { margin: 0 0 12px; color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .12em; text-align: center; text-transform: uppercase; }
h3 { margin: 0; color: #30242a; font-size: 19px; font-weight: 650; line-height: 1.4; }
.body-copy { max-width: 840px; margin: 14px 0 24px; font-size: 16px; line-height: 1.8; }
.method-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; margin: 34px 0 30px; padding: 0; list-style: none; }
.method-steps li { padding-top: 17px; border-top: 2px solid var(--line); }
.step-number { display: block; margin-bottom: 12px; color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .1em; }
.method-steps p, .variant-grid p { margin: 9px 0 0; color: var(--muted); font-size: 14px; line-height: 1.8; }
.variant-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; padding: 23px 26px; background: #f8f0f1; border-radius: 10px; }
.variant-grid h3 { font-size: 16px; }
.variant-tag { display: inline-block; margin-right: 7px; color: var(--accent); font-size: 12px; }
.research-note { max-width: 840px; margin: 26px auto 36px; padding: 16px 20px; border-left: 3px solid var(--accent); background: #f8f0f1; font-size: 14px; line-height: 1.8; }
.research-note strong { font-weight: 650; }
.subsection-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 20px; margin-top: 38px; }
.source-note { color: var(--muted); font-size: 12px; line-height: 1.6; }
.chart-figure { min-width: 0; margin: 0; padding: 20px 16px 17px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.chart-figure img { width: 100%; }
.chart-figure h3 { margin: 0 0 14px; font-size: 17px; text-align: center; }
.chart-figure figcaption { margin-top: 6px; font-size: 12px; }
.global-chart { max-width: 680px; margin-inline: auto; }
.data-details { margin-top: 22px; border-block: 1px solid var(--line); }
summary { padding: 17px 6px; color: var(--accent); font-size: 14px; font-weight: 550; cursor: pointer; }
.detail-intro { margin: 0 6px 18px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.table-scroll { max-width: 100%; overflow-x: auto; margin: 18px 0 22px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
caption { padding: 13px 16px; color: var(--muted); font-size: 12px; line-height: 1.5; text-align: left; }
th, td { padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; text-align: right; }
thead th { background: #f8f0f1; color: var(--muted); font-size: 12px; font-weight: 550; }
th:first-child { text-align: left; }
tbody th { font-weight: 500; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
.group-start th, .group-start td { border-top: 2px solid #d7bcc1; }
.ours-row { color: var(--accent); background: #fcf5f6; }
.ours-row th, .ours-row td { font-weight: 650; }
.category-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.category-card { min-width: 0; padding: 23px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.category-card .eyebrow { text-align: left; }
.category-card h4 { margin: 0; font-size: 20px; font-weight: 650; }
.target-change { margin: 9px 0 20px; color: var(--muted); font-size: 13px; }
.category-card th, .category-card td { padding: 12px 9px; }
.category-card th:first-child { padding-left: 0; }
.category-card thead th { background: #fff; }
.metric-emphasis th, .metric-emphasis td { color: var(--accent); font-weight: 700; }
.section-footnote { max-width: 900px; margin: 20px auto 0; color: var(--muted); font-size: 13px; line-height: 1.8; }
.result-highlights { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin: 30px 0 34px; text-align: center; }
.result-highlights > div { padding: 24px 15px; border-block: 1px solid var(--line); }
.highlight-value { display: block; color: var(--accent); font-size: clamp(25px, 3.5vw, 36px); font-weight: 700; letter-spacing: -.04em; }
.highlight-value span { font-size: .65em; font-weight: 500; }
.result-highlights p { margin: 12px 0 8px; font-size: 15px; font-weight: 600; }
.highlight-detail { display: block; color: var(--muted); font-size: 12px; line-height: 1.8; }
.benchmark-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.reward-comparison { max-width: 840px; margin: 34px auto 0; }
.gain-row { color: var(--accent); }
.citation-section { max-width: 800px; margin-inline: auto; text-align: center; }
.bibtex-toolbar { display: flex; justify-content: flex-end; margin-top: 20px; }
.copy-bibtex { padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--accent); background: #fff; font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; }
.copy-bibtex:hover { border-color: var(--accent); background: #f8f0f1; }
.copy-bibtex:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.bibtex-block { margin: 12px 0 0; padding: 22px; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--text); font-size: 13px; line-height: 1.75; text-align: left; white-space: pre-wrap; overflow-wrap: anywhere; }
.citation-section .work-in-progress { margin: 30px 0 60px; text-align: left; }
footer a { text-decoration: none; }

/* Progressive figure viewer: figure links work without JavaScript. */
.figure-viewer { width: min(1440px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 32px); margin: auto; padding: 18px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); background: #fff; }
.figure-viewer::backdrop { background: rgb(38 27 31 / 75%); }
.viewer-header, .viewer-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.viewer-header h2 { margin: 0; font-size: 18px; text-align: left; }
.viewer-header button, .zoom-controls button { min-height: 36px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 6px; color: var(--text); background: #fff; cursor: pointer; }
.viewer-header button { flex-shrink: 0; }
.viewer-header button:hover, .zoom-controls button:hover { background: #f8f0f1; }
.zoom-controls button:disabled { opacity: .45; cursor: default; }
.viewer-toolbar { margin: 14px 0; }
.viewer-toolbar p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.zoom-controls { display: flex; align-items: center; gap: 7px; flex-shrink: 0; }
#zoom-level { min-width: 42px; font-size: 12px; text-align: center; }
.viewer-viewport { max-height: calc(100dvh - 170px); overflow: auto; background: #fff; overscroll-behavior: contain; }
.viewer-viewport img { max-width: none; height: auto; margin-inline: auto; }
body.figure-open { overflow: hidden; }

@media (max-width: 760px) {
  .method-steps { gap: 18px; }
  .method-steps h3 { font-size: 16px; }
  .benchmark-grid { grid-template-columns: 1fr; max-width: 560px; margin-inline: auto; }
  .category-grid { gap: 14px; }
  .category-card { padding: 17px 12px; }
  .category-card th, .category-card td { padding: 10px 5px; font-size: 12px; }
}

@media (max-width: 600px) {
  .section-nav { gap: 10px 20px; font-size: 12px; }
  .overview { margin-top: 42px; }
  .overview h2 { font-size: 24px; }
  .section-lead { font-size: 15px; line-height: 1.8; margin-bottom: 22px; }
  .figure-link { padding: 6px; border-radius: 8px; }
  .enlarge-label { margin-top: 8px; font-size: 11px; }
  figcaption { font-size: 12px; text-align: left; }
  .research-section { margin-top: 46px; padding-top: 32px; }
  .research-section h2 { font-size: 25px; }
  .abstract { margin-top: 38px; padding-top: 28px; }
  .method-steps { grid-template-columns: 1fr; gap: 17px; margin-top: 25px; }
  .method-steps li { position: relative; padding: 15px 0 0 39px; }
  .step-number { position: absolute; left: 0; top: 18px; }
  .method-steps h3 { font-size: 17px; }
  .method-steps p { margin-top: 6px; }
  .variant-grid { grid-template-columns: 1fr; gap: 23px; padding: 20px; }
  .research-note { padding: 13px 15px; font-size: 13px; }
  .body-copy { font-size: 15px; }
  h3 { font-size: 18px; }
  .chart-figure { padding: 16px 8px 13px; }
  .chart-figure figcaption { text-align: center; }
  summary { font-size: 13px; line-height: 1.6; }
  th, td { padding: 11px 12px; }
  .category-grid { grid-template-columns: 1fr; }
  .category-card { padding: 20px; }
  .category-card th, .category-card td { font-size: 13px; }
  .result-highlights { grid-template-columns: 1fr; gap: 0; margin-top: 24px; }
  .result-highlights > div + div { border-top: 0; }
  .highlight-value { font-size: 32px; }
  .citation-section .work-in-progress { margin-bottom: 42px; }
  .figure-viewer { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); padding: 12px; }
  .viewer-header h2 { font-size: 15px; }
  .viewer-toolbar { flex-direction: column; align-items: flex-start; }
  .viewer-viewport { max-height: calc(100dvh - 210px); }
}

@media print {
  .section-nav, .enlarge-label, .skip-link, .figure-viewer, .copy-bibtex, footer a { display: none; }
  .research-section { margin-top: 30px; padding-top: 25px; }
  .figure-link, .category-card { break-inside: avoid; }
  .table-scroll { overflow: visible; }
}
