/* ==========================================================================
   ACD-GS project page — dependency-free stylesheet
   ========================================================================== */

:root {
  --bg: #ffffff;
  --bg-alt: #f6f8fc;
  --text: #131720;
  --muted: #5a6472;
  --accent: #2457d6;
  --accent-2: #e4572e;
  --accent-soft: #eaf0ff;
  --border: #e4e8f0;
  --ours-bg: #fff5ef;
  --radius: 16px;
  --shadow: 0 12px 34px rgba(16, 26, 54, .10);
  --maxw: 1140px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
          Arial, "Noto Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible { outline: 3px solid rgba(36, 87, 214, .45); outline-offset: 2px; border-radius: 4px; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 26px; }
.container.narrow { max-width: 880px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 0 0 10px 0;
}
.skip-link:focus { left: 0; }

/* ------------------------------ nav ---------------------------------- */

.nav {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, box-shadow .25s ease;
}
.nav.scrolled { border-color: var(--border); box-shadow: 0 6px 22px rgba(16, 26, 54, .06); }

.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 10px 26px;
  display: flex; align-items: center; gap: 22px;
}

.brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 800; letter-spacing: -.01em; font-size: 1.02rem; color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand-mark { width: 24px; height: 24px; color: var(--accent); }

.nav-links { display: flex; gap: 20px; margin-left: auto; }
.nav-links a { color: var(--muted); font-size: .92rem; font-weight: 600; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-links a.active { color: var(--accent); }

.nav-actions { display: flex; gap: 8px; align-items: center; }

/* ----------------------------- buttons -------------------------------- */

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px;
  font-size: .92rem; font-weight: 650; line-height: 1;
  border: 1px solid var(--border); background: #fff; color: var(--text);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: 0 8px 20px rgba(16, 26, 54, .10); }
.btn svg { flex: none; }
.btn-sm { padding: 7px 13px; font-size: .85rem; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #1d4ac0; }
.btn-dark { background: #171b23; border-color: #171b23; color: #fff; }
.btn-dark:hover { background: #000; }
.btn-ghost { color: var(--text); }
.is-tbd { opacity: 1; pointer-events: none; cursor: not-allowed; }

/* ------------------------------ hero ---------------------------------- */

.hero {
  padding: 58px 0 70px;
  background:
    radial-gradient(1100px 380px at 12% -12%, #e7eeff 0%, rgba(231, 238, 255, 0) 62%),
    radial-gradient(900px 360px at 88% -8%, #ffe9df 0%, rgba(255, 233, 223, 0) 58%),
    #fff;
  text-align: center;
}

.venue {
  display: inline-block; margin: 0 0 20px;
  padding: 6px 16px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid #d6e1ff;
  font-size: .85rem; font-weight: 700; letter-spacing: .04em;
}

.hero h1 {
  margin: 0 auto 22px;
  max-width: 1020px;
  font-size: clamp(1.75rem, 3.6vw, 2.6rem);
  line-height: 1.18; letter-spacing: -.02em; font-weight: 800;
  text-wrap: balance;
}

.authors { margin: 0 auto 8px; max-width: 900px; font-size: 1.06rem; }
.authors .author { color: var(--text); font-weight: 650; margin: 0 7px; display: inline-block; }
.authors .author:hover { color: var(--accent); text-decoration: none; }
.authors sup { color: var(--accent); font-weight: 700; }

.affil { margin: 0 auto; color: var(--muted); font-size: .93rem; line-height: 1.75; }
.affil sup { color: var(--accent); font-weight: 700; }
.author-note { margin: 6px 0 26px; color: var(--muted); font-size: .82rem; }
.author-note sup { color: var(--accent); font-weight: 700; }

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 40px; }

.hero-media { margin: 0 auto; max-width: 1040px; }
.hero-media img {
  width: 100%; height: auto;
  border-radius: var(--radius); border: 1px solid var(--border);
  box-shadow: var(--shadow); background: #fff;
}
.media-note { max-width: 780px; margin: 16px auto 0; color: var(--muted); font-size: .88rem; }

/* ---------------------------- sections -------------------------------- */

.section { padding: 74px 0; }
.section.alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

section[id], footer { scroll-margin-top: 80px; }

.kicker {
  margin: 0 0 8px; text-align: center;
  color: var(--accent); text-transform: uppercase;
  font-size: .78rem; font-weight: 800; letter-spacing: .14em;
}
.section-title {
  margin: 0 auto 18px; max-width: 880px; text-align: center;
  font-size: clamp(1.35rem, 2.6vw, 1.85rem);
  line-height: 1.25; letter-spacing: -.015em;
}
.lead { max-width: 840px; margin: 0 auto 30px; text-align: center; color: var(--muted); font-size: 1.01rem; }

.subtitle { margin: 44px 0 12px; font-size: 1.1rem; letter-spacing: -.01em; }
.section .subtitle:first-of-type { margin-top: 0; }

.abstract-text {
  margin: 0; font-size: 1.02rem; color: #2a313d; text-align: justify;
  hyphens: auto;
}
.abstract-text strong { color: var(--text); }

/* ------------------------------ stats --------------------------------- */

.stats {
  display: grid; grid-template-columns: repeat(4, minmax(180px, 1fr));
  overflow-x: auto;
  gap: 16px; margin-top: 38px; text-align: left;
}
.stat {
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  padding: 18px 18px 16px;
  box-shadow: 0 6px 18px rgba(16, 26, 54, .05);
}
.stat-value { display: block; font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; color: var(--accent); line-height: 1.15; }
.stat-label { display: block; margin-top: 6px; color: var(--muted); font-size: .85rem; line-height: 1.5; }
.stats-note { margin: 14px 0 0; text-align: center; color: var(--muted); font-size: .8rem; }

/* ----------------------------- figures -------------------------------- */

.figure { margin: 0; }
.figure img {
  width: 100%; height: auto; border-radius: 14px;
  border: 1px solid var(--border); background: #fff;
}
.figure figcaption { margin-top: 10px; color: var(--muted); font-size: .87rem; }
.figure.small img { box-shadow: 0 6px 18px rgba(16, 26, 54, .06); }

.zoomable { cursor: zoom-in; }
.zoomable:hover img { border-color: #c9d4ea; }

/* ------------------------------ cards --------------------------------- */

.cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 26px; margin-top: 44px;
}
.card {
  position: relative; background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 30px 24px 20px;
  box-shadow: 0 8px 24px rgba(16, 26, 54, .05);
  min-width: 0;
}
.card h3 { margin: 0 0 12px; font-size: 1.02rem; line-height: 1.35; letter-spacing: -.01em; }
.card p { margin: 0 0 12px; color: #39404d; font-size: .92rem; }
.card-num {
  position: absolute; top: -16px; left: 22px;
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: #fff; font-weight: 800; font-size: .95rem;
  box-shadow: 0 6px 14px rgba(36, 87, 214, .35);
}
.formula {
  font-family: var(--mono); font-size: .8rem; color: #1d2733;
  background: #f3f6fc; border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; margin: 0 0 12px; overflow-x: auto; white-space: nowrap;
}

/* ------------------------------ demos --------------------------------- */

.demos { display: grid; gap: 30px; margin-top: 36px; }

.media-frame {
  position: relative; display: block; aspect-ratio: var(--ar, 1.7778);
  background: #eef1f7; border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.media-frame img.media-poster {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
  transition: transform .35s ease;
}
a.media-frame:hover .media-poster { transform: scale(1.015); }

.play-badge {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px; border-radius: 999px;
  background: rgba(17, 24, 39, .72); color: #fff;
  font-size: .84rem; font-weight: 650; letter-spacing: .01em;
  backdrop-filter: blur(6px);
  white-space: nowrap;
}
a.media-frame:not(.is-tbd):hover .play-badge { background: var(--accent); }

.media-card figcaption { margin-top: 12px; color: var(--muted); font-size: .9rem; }
.media-card figcaption strong { color: var(--text); }

/* ------------------------------ tables -------------------------------- */

.table-wrap {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border); border-radius: 14px; background: #fff;
  box-shadow: 0 8px 24px rgba(16, 26, 54, .05);
}
.data-table { width: 100%; border-collapse: collapse; font-size: .89rem; white-space: nowrap; }
.data-table th, .data-table td { padding: 10px 14px; text-align: right; font-variant-numeric: tabular-nums; }
.data-table thead th {
  font-size: .8rem; letter-spacing: .01em; color: #3a4351;
  background: #f8fafd; border-bottom: 1px solid var(--border);
}
.data-table thead tr + tr th { border-top: 1px solid var(--border); }
.data-table th.th-method, .data-table td.th-method { text-align: left; font-weight: 650; }
.data-table tbody tr + tr td { border-top: 1px solid #eef1f6; }
.data-table tbody tr:hover td { background: #f8fafd; }
.data-table tr.ours td { background: var(--ours-bg); }
.data-table tr.ours:hover td { background: #ffece1; }
.data-table td.best { color: var(--accent-2); font-weight: 750; }
.data-table.compact th, .data-table.compact td { padding: 8px 9px; font-size: .84rem; }

.table-note { margin: 10px 0 0; color: var(--muted); font-size: .83rem; }

.two-col {
  display: grid; grid-template-columns: 1.1fr .9fr;
  gap: 30px; align-items: start; margin-top: 30px;
}
.two-col > * { min-width: 0; }
.two-col.figures { grid-template-columns: 1fr 1fr; }
.figures-stacked { display: grid; grid-template-columns: minmax(0, 1fr); gap: 30px; margin-top: 30px; }
.figures-stacked figcaption { text-align: center; }
/* Match column widths to the source aspect ratios so the images align in height. */
.two-col.figures-equal-height { grid-template-columns: 1.702222fr 2.079723fr; }

/* ------------------------------ bibtex -------------------------------- */

.bibtex-box {
  position: relative; margin-top: 8px;
  background: #10151f; border-radius: 14px; overflow: hidden;
  box-shadow: var(--shadow);
}
.bibtex-box pre {
  margin: 0; padding: 22px 22px;
  color: #e7edf6; font-family: var(--mono); font-size: .84rem; line-height: 1.6;
  overflow-x: auto;
}
.copy-btn {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: 9px; cursor: pointer;
  background: rgba(255, 255, 255, .1); color: #dfe7f5;
  border: 1px solid rgba(255, 255, 255, .18);
  font-size: .8rem; font-weight: 650; font-family: var(--font);
  transition: background .15s ease;
}
.copy-btn:hover { background: rgba(255, 255, 255, .2); }
.copy-btn.copied { background: #1f7a4d; border-color: #2b9a63; color: #fff; }

/* ------------------------------ footer -------------------------------- */

.footer {
  background: #fafbfd; border-top: 1px solid var(--border);
  padding: 42px 0 34px; text-align: center; color: var(--muted); font-size: .86rem;
}
.foot-links { margin: 0 0 8px; font-weight: 650; }
.foot-contact { margin: 0 0 14px; }
.ack { max-width: 820px; margin: 0 auto 18px; font-size: .8rem; line-height: 1.7; }
.copyright { margin: 0; font-size: .78rem; color: #8a93a2; }

/* ----------------------------- lightbox ------------------------------- */

.lightbox {
  border: none; padding: 18px; background: transparent;
  max-width: min(96vw, 1400px); max-height: 96vh;
  overflow: visible;
}
.lightbox::backdrop { background: rgba(9, 13, 22, .86); backdrop-filter: blur(4px); }
.lightbox img {
  max-width: 100%; max-height: 82vh; margin: 0 auto;
  border-radius: 10px; box-shadow: 0 24px 70px rgba(0, 0, 0, .5);
  background: #fff;
}
.lightbox p { margin: 12px auto 0; max-width: 900px; color: #c9d2e0; font-size: .85rem; text-align: center; }
.lb-close {
  position: fixed; top: 16px; right: 20px;
  width: 42px; height: 42px; border-radius: 50%; cursor: pointer;
  background: rgba(255, 255, 255, .12); color: #fff; border: 1px solid rgba(255, 255, 255, .25);
  font-size: 1.5rem; line-height: 1;
}
.lb-close:hover { background: rgba(255, 255, 255, .25); }

/* --------------------------- reveal animation ------------------------- */

.reveal { opacity: 0; transform: translateY(16px); transition: opacity .65s ease, transform .65s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .media-frame img.media-poster { transition: none; }
}

/* ---------------------------- responsive ------------------------------ */

@media (max-width: 1020px) {
  .nav-links { display: none; }
  .nav-actions { margin-left: auto; }
  .two-col, .two-col.figures { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .hero { padding: 40px 0 52px; }
  .section { padding: 54px 0; }
  .br-lg { display: none; }
  .authors { font-size: .98rem; }
  .authors .author { margin: 0 5px; }
  .btn { padding: 9px 15px; font-size: .87rem; }
  .hero-media img { border-radius: 12px; }
  .container { padding: 0 18px; }
  .nav-inner { padding: 9px 18px; gap: 12px; }
  .data-table th, .data-table td { padding: 9px 11px; }
}
