:root {
  --ink: #18212b;
  --muted: #5b6672;
  --faint: #f5f7f9;
  --line: #d9dee4;
  --line-dark: #aeb7c1;
  --accent: #174a73;
  --accent-dark: #103650;
  --accent-soft: #eef4f8;
  --white: #ffffff;
  --container: 1120px;
  --reading: 820px;
  --header-height: 58px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + 20px); }
body {
  margin: 0;
  color: var(--ink);
  background: var(--white);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, textarea { font: inherit; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-dark); }
img { display: block; max-width: 100%; height: auto; }
figure { margin: 0; }
button { color: inherit; }

.container { width: min(calc(100% - 40px), var(--container)); margin-inline: auto; }
.reading-width { width: min(calc(100% - 40px), var(--reading)); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 100; padding: 8px 12px; background: var(--ink); color: white; transform: translateY(-150%); }
.skip-link:focus { transform: none; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: var(--header-height);
  background: rgba(255,255,255,.97);
  border-bottom: 1px solid var(--line);
}
.header-inner { min-height: var(--header-height); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.site-name { color: var(--ink); font-size: 14px; font-weight: 650; text-decoration: none; letter-spacing: .01em; }
.site-nav { display: flex; align-items: center; gap: 24px; }
.site-nav a { color: #3e4852; font-size: 14px; text-decoration: none; }
.site-nav a:hover { color: var(--accent); }
.nav-toggle { display: none; width: 42px; height: 38px; padding: 8px; border: 1px solid var(--line); background: white; }
.nav-toggle span:not(.sr-only) { display: block; width: 20px; height: 1px; margin: 4px auto; background: var(--ink); }

.paper-header { padding: 70px 0 46px; text-align: center; }
.paper-header-inner { max-width: 1000px; }
.venue { margin: 0 0 14px; color: var(--accent); font-size: 14px; font-weight: 650; letter-spacing: .025em; }
h1, h2, h3 { margin-top: 0; color: #111820; line-height: 1.22; }
h1 { max-width: 980px; margin: 0 auto 24px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(38px, 5.8vw, 67px); font-weight: 500; letter-spacing: -.025em; }
h2 { margin-bottom: 18px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(29px, 3.6vw, 42px); font-weight: 500; letter-spacing: -.018em; }
h3 { margin-bottom: 9px; font-size: 19px; font-weight: 650; }
p { margin: 0 0 16px; }
.authors { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 28px; margin: 0 0 8px; font-size: 18px; }
.authors a { color: var(--accent); text-decoration: none; }
.authors a:hover { text-decoration: underline; }
sup { font-size: .65em; line-height: 0; }
.affiliations { color: var(--muted); font-size: 14px; }
.paper-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; margin-top: 24px; }
.paper-links.left { justify-content: flex-start; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 17px;
  border: 1px solid var(--line-dark);
  border-radius: 3px;
  color: var(--ink);
  background: white;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}
.button:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.button.primary { border-color: var(--accent); color: white; background: var(--accent); }
.button.primary:hover { border-color: var(--accent-dark); color: white; background: var(--accent-dark); }

.lead-figure { margin-bottom: 36px; }
.scientific-figure { border: 1px solid var(--line); background: white; }
.figure-button { display: block; width: 100%; padding: 0; border: 0; background: white; cursor: zoom-in; }
.figure-button:focus-visible { outline: 3px solid #80acd0; outline-offset: 2px; }
.lead-figure .figure-button { padding: 24px 34px; }
.scientific-figure figcaption { padding: 12px 15px 13px; border-top: 1px solid var(--line); color: #4b5661; font-size: 13.5px; line-height: 1.5; }
.large-figure { margin-top: 34px; }
.large-figure .figure-button { padding: 24px 26px; }

.section { padding: 72px 0; content-visibility: auto; contain-intrinsic-size: auto 1200px; }
.section.ruled { background: var(--faint); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-heading { max-width: 1200px; margin-bottom: 34px; }
.section-heading > p:last-child { color: var(--muted); font-size: 17px; }
.section-label { margin: 0 0 8px; color: var(--accent); font-size: 12px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.abstract-text { color: #26313c; font-family: Georgia, "Times New Roman", serif; font-size: 18px; line-height: 1.75; }
.keywords { margin-top: 20px; color: var(--muted); font-size: 14px; }

.contribution-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 0; padding: 0; list-style: none; border: 1px solid var(--line); background: white; }
.contribution-list li { display: grid; grid-template-columns: 34px 1fr; gap: 10px; padding: 24px; border-right: 1px solid var(--line); }
.contribution-list li:last-child { border-right: 0; }
.contribution-list span { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--accent); color: var(--accent); font-weight: 700; font-size: 13px; }
.contribution-list p { margin: 0; color: #3b4650; font-size: 15px; }

.method-summary, .protocol-grid { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; border: 1px solid var(--line); }
.method-summary > div, .protocol-grid > div { padding: 17px 19px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.method-summary > div:nth-child(3n), .protocol-grid > div:nth-child(3n) { border-right: 0; }
.method-summary > div:nth-last-child(-n+3), .protocol-grid > div:nth-last-child(-n+3) { border-bottom: 0; }
dt { margin-bottom: 4px; color: var(--muted); font-size: 12px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
dd { margin: 0; font-size: 15px; font-weight: 550; line-height: 1.45; }
.method-columns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 38px; }
.method-columns article { padding-top: 18px; border-top: 2px solid var(--line-dark); }
.method-columns p { margin: 0; color: var(--muted); font-size: 15px; }
.objective-block { display: grid; grid-template-columns: .8fr 1.7fr; gap: 50px; margin-top: 48px; padding: 30px; border: 1px solid var(--line); background: var(--faint); }
.equations p { color: #404b55; font-size: 15px; }
.equations .equation { overflow-x: auto; margin-bottom: 20px; padding: 15px 18px; border-left: 3px solid var(--accent); background: white; color: #101821; font-family: Georgia, "Times New Roman", serif; font-size: 18px; white-space: nowrap; }
.equations .equation span { font-style: italic; }
.small-note { margin-bottom: 0 !important; color: var(--muted) !important; font-size: 13px !important; }

.tabs { display: inline-flex; margin-bottom: 16px; border: 1px solid var(--line-dark); background: white; }
.tabs button { min-height: 40px; padding: 8px 16px; border: 0; border-right: 1px solid var(--line-dark); background: white; color: #4c5761; font-size: 14px; font-weight: 600; cursor: pointer; }
.tabs button:last-child { border-right: 0; }
.tabs button[aria-selected="true"] { color: white; background: var(--accent); }
.tabs button:focus-visible { outline: 3px solid #80acd0; outline-offset: 2px; }
.tab-panel .figure-button { padding: 18px; }
.tab-panel[hidden] { display: none; }

.table-section { margin-top: 54px; }
.table-section.compact { margin-top: 62px; }
.table-heading { display: flex; align-items: end; justify-content: space-between; gap: 32px; margin-bottom: 14px; }
.table-heading h3 { margin-bottom: 0; font-family: Georgia, "Times New Roman", serif; font-size: 25px; font-weight: 500; }
.table-heading > p { max-width: 610px; margin: 0; color: var(--muted); font-size: 13px; text-align: right; }
.table-scroll { overflow-x: auto; border: 1px solid var(--line-dark); background: white; }
.table-scroll:focus-visible { outline: 3px solid #80acd0; outline-offset: 2px; }
.results-table { width: 100%; min-width: 920px; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.results-table th, .results-table td { padding: 8px 10px; border-right: 1px solid #e4e7eb; border-bottom: 1px solid #e4e7eb; text-align: right; white-space: nowrap; }
.results-table th:last-child, .results-table td:last-child { border-right: 0; }
.results-table thead th { background: #eef1f4; color: #27333d; font-weight: 700; text-align: center; }
.results-table thead tr:first-child th { border-bottom-color: var(--line-dark); }
.results-table tbody th { text-align: left; font-weight: 650; }
.results-table tbody tr:last-child th, .results-table tbody tr:last-child td { border-bottom: 0; }
.results-table .group-start > * { border-top: 1.5px solid var(--line-dark); }
.results-table tbody tr:first-child > * { border-top: 0; }
.results-table .ours > * { background: #f4f8fb; }
.interpretation { margin: 13px 0 0; color: var(--muted); font-size: 14px; }
.generalization-tables { display: grid; grid-template-columns: 1.5fr .8fr; gap: 18px; }
.compact-table { min-width: 520px; }
.compact-table caption { padding: 10px 12px; border-bottom: 1px solid var(--line-dark); color: var(--ink); font-weight: 700; text-align: left; }

.analysis-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.analysis-grid .scientific-figure .figure-button { display: grid; place-items: center; min-height: 270px; padding: 16px; }
.analysis-grid img { max-height: 310px; object-fit: contain; }
.limitations { margin-top: 50px; padding-top: 34px; border-top: 1px solid var(--line-dark); }
.limitations ul { max-width: 1120px; margin: 0 0 28px; padding-left: 21px; color: #3c4751; }
.limitations li { margin: 8px 0; }
.failure-figure { max-width: 820px; }
.failure-figure .figure-button { padding: 12px; }

.resources-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 64px; align-items: start; }
.bibtex-card { border: 1px solid var(--line-dark); background: #fafbfc; }
.bibtex-header { display: flex; justify-content: space-between; align-items: center; padding: 9px 12px; border-bottom: 1px solid var(--line); color: #3e4953; font-size: 13px; font-weight: 700; }
.bibtex-header button { padding: 4px 9px; border: 1px solid var(--line-dark); background: white; color: var(--accent); font-size: 12px; cursor: pointer; }
.bibtex-card pre { overflow-x: auto; margin: 0; padding: 17px; color: #26323d; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 12.5px; line-height: 1.55; }
.acknowledgements { padding: 42px 0; border-top: 1px solid var(--line); background: var(--faint); }
.acknowledgements h2 { margin-bottom: 10px; font-size: 25px; }
.acknowledgements p { color: var(--muted); font-size: 14px; }
.site-footer { border-top: 1px solid var(--line); }
.footer-inner { display: flex; justify-content: space-between; gap: 20px; padding: 23px 0; color: var(--muted); font-size: 13px; }
.footer-inner p { margin: 0; }

.lightbox { width: min(96vw, 1300px); max-height: 92vh; padding: 0; border: 1px solid var(--line-dark); background: white; }
.lightbox::backdrop { background: rgba(19,28,36,.78); }
.lightbox figure { display: flex; flex-direction: column; max-height: 90vh; }
.lightbox img { width: 100%; max-height: calc(90vh - 72px); object-fit: contain; padding: 18px; background: white; }
.lightbox figcaption { padding: 12px 55px 13px 16px; border-top: 1px solid var(--line); color: #4d5862; font-size: 13px; }
.lightbox-close { position: absolute; right: 9px; bottom: 8px; z-index: 2; width: 34px; height: 34px; padding: 0; border: 1px solid var(--line-dark); background: white; font-size: 23px; line-height: 1; cursor: pointer; }
.toast { position: fixed; left: 50%; bottom: 22px; z-index: 60; padding: 9px 14px; border: 1px solid #263440; background: #263440; color: white; font-size: 13px; opacity: 0; transform: translate(-50%, 10px); pointer-events: none; transition: opacity .16s ease, transform .16s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 900px) {
  .contribution-list { grid-template-columns: 1fr; }
  .contribution-list li { border-right: 0; border-bottom: 1px solid var(--line); }
  .contribution-list li:last-child { border-bottom: 0; }
  .method-summary, .protocol-grid { grid-template-columns: repeat(2, 1fr); }
  .method-summary > div:nth-child(3n), .protocol-grid > div:nth-child(3n) { border-right: 1px solid var(--line); }
  .method-summary > div:nth-child(2n), .protocol-grid > div:nth-child(2n) { border-right: 0; }
  .method-summary > div:nth-last-child(-n+3), .protocol-grid > div:nth-last-child(-n+3) { border-bottom: 1px solid var(--line); }
  .method-summary > div:nth-last-child(-n+2), .protocol-grid > div:nth-last-child(-n+2) { border-bottom: 0; }
  .method-columns { grid-template-columns: 1fr; gap: 20px; }
  .objective-block { grid-template-columns: 1fr; gap: 10px; }
  .generalization-tables, .resources-grid { grid-template-columns: 1fr; }
  .resources-grid { gap: 35px; }
}

@media (max-width: 720px) {
  :root { --header-height: 54px; }
  .container, .reading-width { width: min(calc(100% - 28px), var(--container)); }
  .site-name { max-width: 70%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .nav-toggle { display: block; }
  .site-nav { position: absolute; top: 54px; left: 14px; right: 14px; display: none; gap: 0; padding: 7px; border: 1px solid var(--line-dark); background: white; }
  .site-nav.open { display: grid; }
  .site-nav a { padding: 10px 11px; border-bottom: 1px solid var(--line); }
  .site-nav a:last-child { border-bottom: 0; }
  .paper-header { padding: 52px 0 36px; }
  h1 { font-size: clamp(36px, 11vw, 54px); }
  .authors { gap: 8px 18px; font-size: 16px; }
  .lead-figure .figure-button, .large-figure .figure-button { padding: 12px; }
  .section { padding: 56px 0; }
  .method-summary, .protocol-grid { grid-template-columns: 1fr; }
  .method-summary > div, .protocol-grid > div, .method-summary > div:nth-child(3n), .protocol-grid > div:nth-child(3n), .method-summary > div:nth-child(2n), .protocol-grid > div:nth-child(2n) { border-right: 0; border-bottom: 1px solid var(--line); }
  .method-summary > div:last-child, .protocol-grid > div:last-child { border-bottom: 0; }
  .objective-block { padding: 22px; }
  .tabs { display: grid; grid-template-columns: 1fr; width: 100%; }
  .tabs button { border-right: 0; border-bottom: 1px solid var(--line-dark); }
  .tabs button:last-child { border-bottom: 0; }
  .tab-panel .figure-button { padding: 8px; }
  .table-heading { align-items: start; flex-direction: column; gap: 8px; }
  .table-heading > p { text-align: left; }
  .analysis-grid { grid-template-columns: 1fr; }
  .analysis-grid .scientific-figure .figure-button { min-height: 0; }
  .footer-inner { flex-direction: column; gap: 5px; }
}

@media (max-width: 450px) {
  .paper-links .button { width: 100%; }
  .paper-links.left .button { width: auto; }
  .abstract-text { font-size: 17px; }
  .equations .equation { font-size: 16px; }
}

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