/* ---------------------------------------------------------------
   Guava — project page
   Color theme inspired by the guava fruit:
     green  #2e7d52  -> deep tropical green (links, accents)
     pink   #c94f76  -> guava-flesh pink    (warm accent)
     gray!11         -> #f4f5f7             (subtle surfaces)
   Layout mirrors the academic project-page style (top sticky nav,
   centered single column, sans-serif, image- and video-dense).
--------------------------------------------------------------- */

:root {
  --ink: #14161a;
  --ink-soft: #3a3f47;
  --ink-mute: #6b7280;
  --rule: #dce8e2;
  --surface: #f2f7f4;
  --surface-2: #e8f0ec;
  --bg: #ffffff;

  --accent: #2e7d52;        /* guava green */
  --accent-soft: #b8d9c8;
  --accent-tint: #e8f0e6;

  --warm: #c94f76;          /* guava flesh pink */
  --warm-soft: #fceef3;

  --sans:  "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --col: 920px;              /* main content column */
  --col-wide: 1100px;        /* wider for hero / nav */
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 120ms ease;
}
a:hover { border-bottom-color: var(--accent); }

/* ---------- top bar ---------- */
.topbar {
  border-bottom: 1px solid var(--rule);
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(180%) blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-inner {
  max-width: var(--col-wide);
  margin: 0 auto;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
  letter-spacing: -0.01em;
  border-bottom: none;
}
.brand-mark {
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 3px;
}
.topnav { display: flex; gap: 26px; flex-wrap: wrap; }
.topnav a {
  font-size: 14px;
  color: var(--ink-soft);
  font-weight: 500;
  border-bottom: none;
  position: relative;
  padding: 4px 0;
}
.topnav a:hover { color: var(--accent); }
.topnav a.active {
  color: var(--accent);
  font-weight: 600;
}
.topnav a.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

/* ---------- hero ---------- */
.hero {
  max-width: var(--col-wide);
  margin: 0 auto;
  padding: 72px 32px 48px;
  text-align: center;
}
.hero .eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0 0 18px;
}
.title-icon {
  display: inline-block;
  width: 0.85em;
  height: 0.85em;
  vertical-align: middle;
  margin-right: 0.2em;
  margin-bottom: 0.1em;
  border: none;
  border-radius: 0;
  background: none;
}

.hero .title {
  font-weight: 800;
  font-size: clamp(32px, 4.4vw, 52px);
  line-height: 1.1;
  letter-spacing: -0.022em;
  color: var(--ink);
  margin: 0 0 28px;
  max-width: 920px;
  margin-left: auto;
  margin-right: auto;
}
.authors {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 22px;
  font-size: 17px;
  color: var(--ink);
  margin: 0 0 8px;
}
.author { white-space: nowrap; }
.author a {
  color: var(--ink);
  border-bottom: 1px solid transparent;
  transition: color 120ms ease, border-color 120ms ease;
}
.author a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.author sup { font-size: 0.7em; color: var(--ink-mute); margin-left: 2px; }
.affiliations {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 20px;
  font-size: 14.5px;
  color: var(--ink-mute);
  margin: 0 0 28px;
}
.affiliations sup { font-size: 0.85em; margin-right: 2px; }
.affiliations:has(+ .contribution) { margin-bottom: 6px; }

.contribution {
  font-size: 13px;
  color: var(--ink-mute);
  margin: 0 0 28px;
  text-align: center;
}
.contribution sup { font-size: 0.85em; margin-right: 2px; color: var(--ink-mute); }

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 0 0 48px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  transition: background 120ms ease, color 120ms ease, transform 120ms ease;
}
.btn:hover {
  background: #2a2e36;
  color: #fff;
  transform: translateY(-1px);
  border-bottom-color: var(--ink);
}
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  border-bottom-color: var(--accent);
}
.btn-primary:hover {
  background: #235f3e;
  border-bottom-color: #235f3e;
}
.btn[aria-disabled="true"] {
  opacity: 0.55;
  pointer-events: none;
}
.btn-ico {
  display: inline-grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  background: rgba(255,255,255,0.18);
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0;
}

.hero-figure { margin-top: 16px; }

/* ---------- text + side image ---------- */
.text-media-row {
  display: flex;
  gap: 28px;
  align-items: flex-start;
}
.text-media-row p {
  flex: 1 1 0;
  margin: 0;
}
.text-media-row .media {
  flex: 0 0 38%;
  margin: 0;
}

/* ---------- section structure ---------- */
.section {
  max-width: var(--col);
  margin: 0 auto;
  padding: 56px 32px;
  scroll-margin-top: 80px;
}
.section + .section { padding-top: 24px; }

.section-title {
  font-weight: 700;
  font-size: clamp(24px, 2.8vw, 32px);
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0 0 22px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
  position: relative;
}
.section-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 48px;
  height: 2px;
  background: var(--accent);
}
.section-lead {
  font-size: 17.5px;
  line-height: 1.7;
  color: var(--ink);
  margin: 0 0 28px;
}
.section p {
  font-size: 16.5px;
  line-height: 1.7;
  color: var(--ink);
  margin: 0 0 16px;
}
.section em { font-style: italic; }
.section strong { font-weight: 700; }

.sub-title {
  font-weight: 600;
  font-size: 24px;
  color: var(--ink);
  letter-spacing: -0.01em;
  margin: 40px 0 14px;
}

/* ---------- overview lede ---------- */
.lede {
  background: none;
  border: none;
  padding: 0;
}
.lede p { margin: 0; font-size: 17px; line-height: 1.7; }
.lede strong { font-weight: 700; color: var(--ink); }
.lede mark {
  background: transparent;
  font-weight: 600;
  font-style: normal;
  padding: 0;
}

/* lede highlight colors */
.hi-green  { color: var(--accent); }
.hi-pink   { color: var(--warm); }
.hi-orange { color: #e8720c; }

/* ---------- media (figures, images, videos, tables) ---------- */
.media {
  margin: 28px 0;
}
.media img,
.media video {
  display: block;
  width: 100%;
  height: auto;
  border: none;
  border-radius: 8px;
  background: #fff;
}
.media video { aspect-ratio: 16 / 9; object-fit: cover; }
.media figcaption {
  font-size: 16px;
  color: var(--ink-mute);
  margin-top: 12px;
  line-height: 1.55;
  text-align: left;
}
.media figcaption strong { color: var(--ink); font-weight: 600; }
.media code {
  font-family: var(--mono);
  font-size: 12.5px;
  background: var(--surface);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--ink);
}

/* Side-by-side rows (images or videos). */
.media-row {
  display: grid;
  gap: 22px;
  margin: 28px 0;
  align-items: start;
}
.media-row.two { grid-template-columns: 1fr 1fr; }
.media-row.three { grid-template-columns: repeat(3, 1fr); }
.media-row .media { margin: 0; }
.media-row.two .media img,
.media-row.two .media video {
  height: 240px;
  object-fit: contain;
  padding: 10px;
}

/* Dedicated video grids (for the qualitative rollouts, etc.). */
.video-grid {
  display: grid;
  gap: 14px;
  margin: 28px 0;
}
.video-grid.two   { grid-template-columns: repeat(2, 1fr); }
.video-grid.three { grid-template-columns: repeat(3, 1fr); }
.video-grid.four  { grid-template-columns: repeat(4, 1fr); }
.video-grid .media { margin: 0; }
.video-grid .media video,
.video-grid .media img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 6px;
}
.video-grid .media figcaption {
  text-align: center;
  font-size: 15px;
  margin-top: 8px;
}

/* Video comparison (labeled columns, e.g. GT / Ours / Baseline). */
.video-compare {
  display: grid;
  gap: 14px;
  margin: 28px 0;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
}
.video-compare .media video {
  object-fit: contain;
  aspect-ratio: auto;
  height: auto;
}
.video-compare .media figcaption {
  text-align: center;
  font-weight: 400;
  color: var(--ink-mute);
  font-size: 15px;
}

@media (max-width: 760px) {
  .media-row.two,
  .media-row.three,
  .video-grid.two,
  .video-grid.three,
  .video-grid.four,
  .video-compare {
    grid-template-columns: 1fr;
    grid-auto-flow: row;
  }
}

/* ---------- principles ---------- */
.principles {
  list-style: none;
  counter-reset: principles;
  padding: 0;
  margin: 12px 0 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.principles > li {
  counter-increment: principles;
  padding: 20px 20px 22px;
  background: #fff;
  border: 2.5px solid;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
}
.principles > li:nth-child(1) { border-color: var(--accent); }
.principles > li:nth-child(2) { border-color: #e8720c; }
.principles > li:nth-child(3) { border-color: var(--warm); }

.principles > li::before {
  content: counter(principles);
  font-weight: 700;
  font-size: 13px;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  line-height: 1;
  margin-bottom: 14px;
}
.principles > li:nth-child(1)::before { color: var(--accent); border: 2.5px solid var(--accent); }
.principles > li:nth-child(2)::before { color: #e8720c; border: 2.5px solid #e8720c; }
.principles > li:nth-child(3)::before { color: var(--warm); border: 2.5px solid var(--warm); }
.principles .p-title {
  font-weight: 700;
  font-size: 16px;
  line-height: 1.3;
  margin: 0 0 6px;
}
.principles > li:nth-child(1) .p-title { color: var(--accent); }
.principles > li:nth-child(2) .p-title { color: #e8720c; }
.principles > li:nth-child(3) .p-title { color: var(--warm); }
.principles p { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--ink-soft); }

@media (max-width: 760px) {
  .principles { grid-template-columns: 1fr; }
}

/* ---------- callout (mirrors LaTeX takeawaybox) ---------- */
.callout {
  background: var(--warm-soft);
  border: 1px solid var(--ink);
  border-radius: 10px;
  padding: 20px 24px;
  margin: 28px 0 0;
}
.kicker {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0 0 8px;
}
.callout .kicker { color: var(--warm); }
.callout p { margin: 0; font-size: 16px; }

/* ---------- data table ---------- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: #fff;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.data-table caption {
  caption-side: bottom;
  text-align: left;
  padding: 12px 18px 0;
  font-size: 13px;
  color: var(--ink-mute);
  line-height: 1.55;
}
.data-table caption strong { color: var(--ink); font-weight: 600; }
.data-table thead th {
  font-weight: 600;
  text-align: right;
  padding: 14px 16px;
  border-bottom: 2px solid var(--ink);
  color: var(--ink);
  background: #fff;
  white-space: nowrap;
}
.data-table thead th:first-child { text-align: left; }
.data-table thead th.ours { color: var(--accent); }
.data-table tbody td,
.data-table tbody th[scope="row"] {
  padding: 11px 16px;
  text-align: right;
  border-bottom: 1px solid var(--rule);
}
.data-table tbody th[scope="row"] {
  text-align: left;
  font-weight: 500;
  color: var(--ink);
}
.data-table tbody td.ours {
  background: var(--accent-tint);
  color: var(--accent);
}
.data-table tbody td strong,
.data-table tfoot td strong { font-weight: 700; }
.data-table tfoot th,
.data-table tfoot td {
  padding: 13px 16px;
  border-top: 2px solid var(--ink);
  font-weight: 600;
  text-align: right;
}
.data-table tfoot th { text-align: left; }
.data-table tfoot td.ours { background: var(--accent-tint); color: var(--accent); }

/* ---------- citations & references ---------- */
sup { font-size: 0.72em; line-height: 0; vertical-align: super; }
a.cite {
  border-bottom: none;
  padding: 0 1px;
  font-weight: 600;
  color: var(--accent);
}
a.cite:hover { text-decoration: underline; }

.reflist {
  list-style: decimal;
  padding-left: 28px;
  margin: 0;
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.6;
}
.reflist li { margin: 0 0 14px; padding-left: 4px; scroll-margin-top: 90px; }
.reflist li::marker { color: var(--ink-mute); font-variant-numeric: tabular-nums; }
.reflist em { color: var(--ink); font-style: italic; }
.ref-link {
  display: inline-block;
  margin-left: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-tint);
  padding: 1px 8px;
  border-radius: 3px;
  border-bottom: none;
}
.ref-link:hover { background: var(--accent-soft); }

/* ---------- placeholder card ---------- */
.placeholder {
  background: var(--surface);
  border: 1px dashed #c8ccd4;
  border-radius: 8px;
  padding: 22px 24px;
  color: var(--ink-soft);
}
.placeholder .kicker { margin-bottom: 8px; }
.placeholder p { margin: 0; font-size: 16px; }

/* ---------- bibtex code block ---------- */
.bibtex-block {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 20px 22px;
  margin: 0;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink);
  white-space: pre;
}
.bibtex-block code {
  font: inherit;
  background: none;
  padding: 0;
  border-radius: 0;
}

/* ---------- footer ---------- */
.footer {
  border-top: 1px solid var(--rule);
  padding: 32px 32px 48px;
  text-align: center;
  color: var(--ink-mute);
  font-size: 13px;
}
.footer p { margin: 0; }

/* ---------- responsive ---------- */
@media (max-width: 720px) {
  .hero { padding: 56px 22px 36px; }
  .section { padding: 40px 22px; }
  .topbar-inner { padding: 12px 22px; }
  .topnav { gap: 16px; }
}
