:root {
  --accent: #6a2cc2;
  --accent-soft: #f0e9fb;
  --accent-dark: #4c1d95;
  --ink: #1f2330;
  --muted: #5b6270;
  --line: #e6e8ee;
  --bg: #ffffff;
  --bg-soft: #fafbfc;
  --maxw: 900px;
  --radius: 12px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

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

/* ---------- Nav ---------- */
.topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-brand {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--accent-dark);
  letter-spacing: -0.02em;
}
.nav-brand:hover { text-decoration: none; }
.nav-links {
  list-style: none;
  display: flex;
  gap: 22px;
  margin: 0;
  padding: 0;
}
.nav-links a {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.94rem;
}
.nav-links a:hover { color: var(--accent); text-decoration: none; }
.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.3rem;
  color: var(--ink);
  cursor: pointer;
}

/* ---------- Container ---------- */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

section { padding: 44px 0; border-top: 1px solid var(--line); }
section:first-of-type { border-top: none; }

h2 {
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
}
h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 26px 0 8px;
  color: var(--accent-dark);
}

/* ---------- Header ---------- */
.paper-header {
  text-align: center;
  padding: 52px 0 40px;
  border-top: none;
}
.venue {
  display: inline-block;
  margin: 0 0 14px;
  padding: 4px 14px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.title {
  font-family: "Newsreader", Georgia, serif;
  font-size: 2.35rem;
  line-height: 1.18;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 auto 22px;
  max-width: 760px;
}
.authors {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 16px;
  margin-bottom: 12px;
  font-size: 1.02rem;
}
.author a { color: var(--ink); font-weight: 500; }
.author a:hover { color: var(--accent); }
.author sup { color: var(--accent); font-weight: 600; }
.affiliations {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 18px;
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 12px;
}
.affiliations sup { color: var(--accent); }
.corresponding {
  color: var(--muted);
  font-size: 0.92rem;
}
.footnote-line {
  color: #98a0ae;
  font-size: 0.82rem;
  font-style: italic;
  margin: 6px 0 0;
}

/* ---------- Buttons ---------- */
.buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 26px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--ink);
  color: #fff;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover {
  text-decoration: none;
  background: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(106, 44, 194, 0.25);
}
.btn i { font-size: 1rem; }

/* ---------- Figures ---------- */
figure { margin: 0; }
figure img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #fff;
}
figcaption {
  margin-top: 12px;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.55;
  text-align: left;
}
.teaser { border-top: none; padding-top: 8px; }
.method-figure { margin-bottom: 8px; }
.method-figure img { padding: 8px; }

/* ---------- Abstract ---------- */
.abstract-text {
  font-size: 1.05rem;
  color: #2a2f3c;
  margin: 0;
}

/* ---------- Cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.card {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 20px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 26px rgba(31, 35, 48, 0.08);
}
.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  margin-bottom: 14px;
}
.card h3 { margin: 0 0 8px; color: var(--ink); font-size: 1.05rem; }
.card p { margin: 0; font-size: 0.95rem; color: var(--muted); }

/* ---------- Method prose ---------- */
.method-prose p { color: #2a2f3c; }

/* ---------- Tables ---------- */
.table-caption {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 4px 0 14px;
}
.table-wrap { overflow-x: auto; margin-bottom: 10px; }
.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
  min-width: 560px;
}
.results-table th,
.results-table td {
  padding: 10px 12px;
  text-align: center;
  border-bottom: 1px solid var(--line);
}
.results-table thead th {
  background: var(--accent-dark);
  color: #fff;
  font-weight: 600;
  font-size: 0.86rem;
  border-bottom: none;
}
.results-table thead th:first-child { border-top-left-radius: 8px; }
.results-table thead th:last-child { border-top-right-radius: 8px; }
.results-table .left { text-align: left; }
.results-table tbody tr:nth-child(even) { background: var(--bg-soft); }
.results-table tbody tr:hover { background: var(--accent-soft); }
.results-table tr.group-sep td { border-top: 2px solid #d3d7e0; }
.results-table tr.ours {
  background: var(--accent-soft) !important;
  font-weight: 600;
}
.results-table tr.ours td.left { color: var(--accent-dark); }
.results-table u { text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Stat row (ParA-Bench) ---------- */
.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 20px 0;
}
.stat {
  text-align: center;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 18px;
}
.stat-num {
  font-family: "Newsreader", serif;
  font-size: 2.4rem;
  font-weight: 600;
  color: var(--accent);
  line-height: 1;
}
.stat-label {
  font-weight: 600;
  margin: 8px 0 6px;
  color: var(--ink);
}
.stat p { margin: 0; font-size: 0.88rem; color: var(--muted); }

/* ---------- BibTeX ---------- */
.bibtex-wrap { position: relative; }
.bibtex-wrap pre {
  background: #1c2030;
  color: #e6e8ee;
  padding: 22px;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 0.86rem;
  line-height: 1.6;
  margin: 0;
}
.bibtex-wrap code { font-family: "SF Mono", "Menlo", "Consolas", monospace; }
.copy-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
}
.copy-btn:hover { background: var(--accent); border-color: var(--accent); }

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  padding: 36px 20px 48px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  margin-top: 20px;
}
.site-footer p { margin: 4px 0; }
.footer-sub { font-size: 0.82rem; color: #98a0ae; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  body { font-size: 16px; }
  .title { font-size: 1.7rem; }
  .cards, .stat-row { grid-template-columns: 1fr; }
  .nav-links {
    display: none;
    position: absolute;
    top: 58px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: #fff;
    border-bottom: 1px solid var(--line);
    padding: 8px 20px 14px;
  }
  .nav-links.open { display: flex; }
  .nav-links li { padding: 8px 0; border-bottom: 1px solid var(--line); }
  .nav-toggle { display: block; }
}
