:root {
  --bg: #ffffff;
  --bg-alt: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f1f2f5;
  --border: #e2e4e9;
  --text: #1a1d23;
  --text-dim: #5b6270;
  --accent: #8c1515;       /* academic deep red, USC cardinal-leaning */
  --accent-dark: #6e1010;
  --link: #1a56db;
  --radius: 6px;
  --max-width: 980px;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Noto Sans", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "Source Code Pro", "Courier New", monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

code, pre { font-family: var(--mono); }

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

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 13px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--text);
  font-family: var(--serif);
}
.brand:hover { text-decoration: none; }
.brand img { width: 24px; height: 24px; border-radius: 4px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  color: var(--text-dim);
  font-size: 0.88rem;
  font-weight: 500;
}
.nav-links a:hover { color: var(--accent); text-decoration: none; }

.nav-cta {
  border: 1px solid var(--border);
  padding: 6px 13px;
  border-radius: 999px;
  color: var(--text) !important;
}
.nav-cta:hover { border-color: var(--accent); color: var(--accent) !important; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.3rem;
  cursor: pointer;
}

/* Hero */
.hero {
  padding: 56px 24px 0;
  text-align: center;
}

.hero-inner {
  max-width: 860px;
  margin: 0 auto;
}

.venue-line {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  margin: 0 0 18px;
}

.hero h1 {
  font-family: var(--serif);
  font-size: clamp(1.7rem, 3.4vw, 2.35rem);
  font-weight: 600;
  line-height: 1.32;
  margin: 0 0 28px;
  color: var(--text);
  letter-spacing: -0.005em;
}

.authors {
  font-size: 1.02rem;
  margin: 0 auto 8px;
  max-width: 700px;
}
.authors sup { color: var(--text-dim); font-size: 0.7rem; }

.affiliations {
  color: var(--text-dim);
  font-size: 0.92rem;
  margin: 0 0 4px;
}
.affiliations sup { font-size: 0.7rem; }

.equal-note {
  color: var(--text-dim);
  font-size: 0.8rem;
  font-style: italic;
  margin: 0 0 28px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 20px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.86rem;
  background: var(--text);
  color: #fff;
  border: 1px solid transparent;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  filter: brightness(0.92);
}
.btn-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn-paper  { background: #8c1515; }
.btn-code   { background: #24292f; }
.btn-pypi   { background: #006dad; }
.btn-wacv   { background: #1f6f54; }
.btn-bibtex { background: #5b4b8a; }

.prior-work-note {
  text-align: center;
  font-size: 0.86rem;
  color: var(--text-dim);
  margin: 0 0 36px;
}

.tldr {
  margin: 0 auto 56px;
  padding: 22px 26px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  text-align: left;
}
.tldr p {
  margin: 0;
  font-size: 0.98rem;
  color: #2b2f37;
  line-height: 1.7;
}
.tldr strong { color: var(--accent); }

hr.rule {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0;
}

/* Sections */
.section { padding: 56px 0; border-top: 1px solid var(--border); }
.section.alt { background: var(--bg-alt); }

.section h2 {
  font-family: var(--serif);
  font-size: clamp(1.3rem, 2.4vw, 1.6rem);
  font-weight: 600;
  margin: 0 0 18px;
  letter-spacing: -0.005em;
  color: var(--text);
}

.section-lede {
  color: var(--text-dim);
  font-size: 1rem;
  margin: 0 0 32px;
}

.abstract-text {
  font-family: var(--serif);
  font-size: 1.06rem;
  color: #2b2f37;
  margin: 0 0 40px;
  line-height: 1.75;
}
.abstract-text strong { color: var(--accent); font-weight: 600; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.stat-card {
  background: var(--surface);
  padding: 22px 16px;
  text-align: center;
}

.stat-num {
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 600;
  color: var(--accent);
}

.stat-label {
  color: var(--text-dim);
  font-size: 0.82rem;
  margin-top: 6px;
}

/* Figures */
.figure {
  margin: 0 0 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}
.figure img {
  max-width: 100%;
  border-radius: 3px;
  display: block;
  margin: 0 auto;
}
.figure figcaption {
  color: var(--text-dim);
  font-size: 0.86rem;
  margin-top: 14px;
  text-align: left;
}

.subhead {
  font-family: var(--serif);
  font-size: 1.08rem;
  font-weight: 600;
  margin: 32px 0 14px;
  color: var(--text);
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  white-space: nowrap;
}

.data-table th, .data-table td {
  padding: 9px 13px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: var(--bg-alt);
}

.data-table td:first-child, .data-table th:first-child {
  text-align: left;
  position: sticky;
  left: 0;
  background: inherit;
}

.data-table tr:last-child td { border-bottom: none; }

.highlight-row td {
  background: #faf2f2;
  color: var(--text);
  font-weight: 500;
}

.table-note {
  color: var(--text-dim);
  font-size: 0.82rem;
  margin: 14px 0 0;
}

/* Speed comparison chart */
.speed-chart {
  margin-top: 22px;
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.speed-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.speed-row:last-of-type { margin-bottom: 4px; }

.speed-label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
  text-align: right;
}

.speed-bars {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.speed-bar {
  height: 20px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  min-width: fit-content;
  white-space: nowrap;
  padding: 0 8px;
  transition: width 0.3s ease;
}
.speed-bar span {
  font-size: 0.72rem;
  font-weight: 600;
  color: #fff;
}

.speed-bar-cpu { background: #9aa4b8; }
.speed-bar-gpu { background: #6b7585; }
.speed-bar-highlight.speed-bar-cpu { background: #b3554e; }
.speed-bar-highlight.speed-bar-gpu { background: #8c1515; }

.speed-legend {
  display: flex;
  gap: 18px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-dim);
}
.legend-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 5px;
}
.legend-cpu { background: #9aa4b8; }
.legend-gpu { background: #6b7585; }

.new-tag {
  display: inline-block;
  font-size: 0.66rem;
  background: var(--accent);
  color: #fff;
  padding: 3px 9px;
  border-radius: 999px;
  vertical-align: middle;
  margin-left: 8px;
  font-weight: 600;
  font-family: var(--sans);
}

/* Code blocks */
.code-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.code-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.citation-block { margin-bottom: 18px; }

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-dim);
  font-family: var(--sans);
  font-weight: 600;
}

.copy-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: 4px;
  padding: 3px 9px;
  font-size: 0.74rem;
  cursor: pointer;
  transition: all 0.15s ease;
}
.copy-btn:hover { color: var(--accent); border-color: var(--accent); }
.copy-btn.copied { color: var(--accent); border-color: var(--accent); }

.code-block pre {
  margin: 0;
  padding: 15px;
  overflow-x: auto;
  font-size: 0.82rem;
  line-height: 1.55;
  color: #2b2f37;
  background: var(--surface);
}

.more-usage {
  color: var(--text-dim);
  margin-top: 26px;
  font-size: 0.93rem;
}

/* Footer */
.footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 36px 0;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}
.footer p {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin: 0 0 10px;
}
.footer .ack {
  font-size: 0.76rem;
  max-width: 560px;
  line-height: 1.6;
}
.footer-links {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 0.88rem;
  white-space: nowrap;
}

/* Responsive */
@media (max-width: 860px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .code-tabs { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 24px;
    gap: 14px;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-cta { align-self: flex-start; }
  .footer-inner { flex-direction: column; }
}
