:root {
  --ink: #0b1220;
  --soft: #475569;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #ffffff;
  --panel: #f8fafc;
  --accent: #0f766e;
  --accent-ink: #0f5f59;
  --best: #fee2e2;
  --second: #ffedd5;
  --max: min(1480px, 96vw);
  --font-display: "Newsreader", Georgia, serif;
  --font-body: "Sora", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

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

html {
  scroll-behavior: smooth;
}

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

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

a {
  color: var(--accent-ink);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent);
}

.wrap {
  width: var(--max);
  margin-inline: auto;
  padding-inline: clamp(1rem, 2.2vw, 2rem);
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.site-nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 3.5rem;
  gap: 1rem;
}

.brand {
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.15rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.92rem;
  font-weight: 500;
}

.nav-links a {
  color: var(--soft);
  text-decoration: none;
}

.nav-links a:hover {
  color: var(--ink);
}

.hero {
  padding: 2.8rem 0 2.6rem;
  text-align: center;
  border-bottom: 1px solid var(--line);
}

.logo-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1.5rem 2rem;
  margin: 0 0 2rem;
  width: 100%;
}

.logo-row .logo-mcr {
  justify-self: start;
}

.logo-row .logo-eccv {
  justify-self: center;
}

.logo-row .logo-uottawa {
  justify-self: end;
}

.logo-row img {
  height: 92px;
  width: auto;
  object-fit: contain;
}

.logo-row img.logo-eccv {
  height: 108px;
}

.logo-row img.logo-mcr {
  height: 88px;
}

.logo-row img.logo-uottawa {
  height: 92px;
}

.hero-brand {
  margin: 0 auto;
  max-width: 18ch;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  font-weight: 650;
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.hero-title {
  margin: 0.85rem auto 0;
  max-width: 52rem;
  color: var(--soft);
  font-family: var(--font-body);
  font-size: clamp(1.02rem, 1.55vw, 1.22rem);
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: -0.01em;
}

.subtitle {
  margin: 1rem auto 0;
  max-width: 46rem;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 400;
}

.authors {
  margin: 1.5rem auto 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem 1.5rem;
  font-size: 1.02rem;
  font-weight: 500;
}

.authors a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.authors a:hover {
  border-bottom-color: var(--accent);
  color: var(--accent-ink);
}

.affiliation {
  margin: 0.75rem auto 0;
  color: var(--muted);
  font-size: 0.96rem;
}

.actions {
  margin: 1.7rem auto 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.55rem;
  padding: 0.45rem 1.05rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
}

.btn:hover {
  border-color: #cbd5e1;
  color: var(--ink);
}

.btn-dark {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.btn-dark:hover {
  background: #1e293b;
  color: #fff;
}

.btn-soon {
  color: var(--muted);
  background: #f8fafc;
  cursor: default;
  pointer-events: none;
}

.btn-soon .tag {
  margin-left: 0.35rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.stats {
  margin: 2.1rem auto 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  text-align: left;
}

.stat {
  padding: 1.05rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.7rem;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.stat span {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.86rem;
}

section {
  padding: 3.25rem 0;
  border-bottom: 1px solid var(--line);
}

.section-head {
  margin-bottom: 1.35rem;
}

.section-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 2.3vw, 2rem);
  letter-spacing: -0.025em;
}

.section-head p {
  margin: 0.6rem 0 0;
  max-width: 62rem;
  color: var(--soft);
}

.abstract p {
  margin: 0;
  max-width: 72rem;
  font-size: 1.05rem;
}

.figure-wide {
  margin: 0;
}

.figure-wide .frame {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}

.figure-wide .frame.ratio-16x9 {
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  background: #f8fafc;
}

.figure-wide .frame.ratio-16x9 img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: #fff;
}

.figure-wide .frame.natural img {
  width: 100%;
  height: auto;
}

.figure-wide figcaption {
  margin-top: 0.9rem;
  color: var(--soft);
  font-size: 0.96rem;
}

.steps {
  margin-top: 1.4rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

.step {
  padding: 1.05rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.step .n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 999px;
  background: #ecfdf5;
  color: var(--accent-ink);
  font-size: 0.78rem;
  font-weight: 700;
}

.step h3 {
  margin: 0.55rem 0 0.3rem;
  font-size: 1.02rem;
  font-weight: 600;
}

.step p {
  margin: 0;
  color: var(--soft);
  font-size: 0.92rem;
}

.demo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
}

.demo-grid .full {
  grid-column: 1 / -1;
}

.media {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #000;
}

.media video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  object-fit: cover;
}

.media-cap {
  padding: 0.95rem 1.05rem 1.1rem;
  background: #fff;
  border-top: 1px solid var(--line);
}

.media-cap h3 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 600;
}

.media-cap p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.figures-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
}

.figures-grid .span-2 {
  grid-column: 1 / -1;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.metric {
  padding: 1.05rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.metric strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.7rem;
  letter-spacing: -0.03em;
}

.metric span {
  color: var(--muted);
  font-size: 0.88rem;
}

h3.table-title {
  margin: 1.6rem 0 0.7rem;
  font-size: 1.08rem;
  font-weight: 600;
}

.table-lead {
  margin: -0.25rem 0 0.75rem;
  color: var(--muted);
  font-size: 0.92rem;
  max-width: 58rem;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
  font-size: 0.93rem;
}

th,
td {
  padding: 0.72rem 0.85rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  background: #f8fafc;
  color: var(--soft);
  font-size: 0.74rem;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

tr.ours td {
  background: #f0fdfa;
  font-weight: 700;
}

.best {
  background: var(--best);
  font-weight: 700;
}

.second {
  background: var(--second);
}

.cite-box {
  position: relative;
  margin-top: 0.9rem;
  padding: 1.05rem 1.15rem;
  border-radius: 14px;
  border: 1px solid #1e293b;
  background: #0f172a;
  color: #e2e8f0;
}

.tabs {
  display: grid;
  gap: 1.1rem;
}

.tab-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
}

.tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--soft);
  min-height: 2.35rem;
  padding: 0.4rem 0.95rem;
  border-radius: 999px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.tab:hover {
  color: var(--ink);
}

.tab.is-active {
  background: var(--ink);
  color: #fff;
}

.tab-panel[hidden] {
  display: none !important;
}

.tab-panel {
  display: grid;
  gap: 1rem;
}

.table-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
}

.table-card > header {
  padding: 1rem 1.15rem 0.85rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fcfdfe, #f8fafc);
}

.table-card > header h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.table-card > header p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.table-card .table-wrap {
  border: 0;
  border-radius: 0;
}

.table-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.table-grid-2 .span-full {
  grid-column: 1 / -1;
}

.table-note {
  margin: 0;
  padding: 0.85rem 1.15rem 1.05rem;
  color: var(--muted);
  font-size: 0.88rem;
  border-top: 1px solid var(--line);
  background: #fbfdfe;
}

.table-config td:first-child {
  font-weight: 600;
  white-space: nowrap;
  color: var(--ink);
  width: 12rem;
}

.table-config td:last-child {
  white-space: normal;
}

.table-compact th,
.table-compact td {
  padding: 0.55rem 0.55rem;
  font-size: 0.84rem;
}

td.on,
span.on {
  color: #047857;
  font-weight: 700;
  text-align: center;
}

td.off,
span.off {
  color: #94a3b8;
  font-weight: 700;
  text-align: center;
}

@media (max-width: 980px) {
  .table-grid-2 {
    grid-template-columns: 1fr;
  }

  .tab-list {
    border-radius: 16px;
  }
}

.cite-box pre {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.copy-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  border: 0;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.footer {
  padding: 1.8rem 0 2.6rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
}

@media (max-width: 980px) {
  .stats,
  .steps,
  .metrics,
  .demo-grid,
  .figures-grid {
    grid-template-columns: 1fr;
  }

  .demo-grid .full,
  .figures-grid .span-2 {
    grid-column: auto;
  }

  .logo-row {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .logo-row .logo-mcr,
  .logo-row .logo-eccv,
  .logo-row .logo-uottawa {
    justify-self: center;
  }

  .logo-row img {
    height: 68px;
  }

  .logo-row img.logo-eccv {
    height: 80px;
  }

  .logo-row img.logo-mcr,
  .logo-row img.logo-uottawa {
    height: 68px;
  }
}

@media (max-width: 640px) {
  .nav-links {
    display: none;
  }
}
