:root {
  color-scheme: light;
  --bg: #f6f8f7;
  --surface: #ffffff;
  --surface-muted: #e9efed;
  --ink: #1c2321;
  --muted: #5d6763;
  --line: #d4ddda;
  --accent: #0e7c86;
  --accent-strong: #9a4f24;
  --accent-soft: #d9eef0;
  --rose-soft: #f2deda;
  --green-soft: #e1ecd7;
  --shadow: 0 14px 34px rgba(24, 31, 29, 0.12);
  --max: 1120px;
  --narrow: 840px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: 0;
}

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

a {
  color: inherit;
}

button {
  font: inherit;
}

.container {
  width: min(calc(100% - 32px), var(--max));
  margin: 0 auto;
}

.container.narrow {
  width: min(calc(100% - 32px), var(--narrow));
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(28, 35, 33, 0.1);
  background: rgba(246, 248, 247, 0.92);
  backdrop-filter: blur(16px);
}

.nav-wrap {
  width: min(calc(100% - 32px), var(--max));
  min-height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  font-weight: 800;
  text-decoration: none;
  color: var(--ink);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-links a {
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 650;
  padding: 8px 10px;
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a.active {
  background: var(--accent-soft);
  color: #084d54;
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  margin: 5px 0;
  background: var(--ink);
}

.hero {
  padding: 86px 0 52px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(246, 248, 247, 0.92)),
    var(--bg);
}

.hero-inner {
  text-align: center;
}

.hero-institution {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 18px;
}

.institution-logos {
  --institution-logo-height: 42px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

.institution-logo {
  display: block;
  height: var(--institution-logo-height);
  width: auto;
  object-fit: contain;
}

.logo-hku {
  max-width: 44px;
}

.logo-hkust {
  max-width: 32px;
}

.logo-cmu {
  max-width: 218px;
}

.logo-lightspeed {
  max-width: 190px;
}

.venue {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  margin: 0;
  border: 1px solid rgba(14, 124, 134, 0.26);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.62);
  color: #095a62;
  font-size: 0.86rem;
  font-weight: 800;
  padding: 4px 12px;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 1120px;
  margin: 0 auto 22px;
  font-size: clamp(1.9rem, 3.2vw, 3.0rem);
  line-height: 1.08;
  font-weight: 850;
}

h2 {
  margin: 0 0 18px;
  font-size: clamp(1.9rem, 4vw, 3rem);
  line-height: 1.08;
}

h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  line-height: 1.22;
}

.authors {
  max-width: 900px;
  margin: 0 auto 10px;
  color: #26302d;
  font-weight: 700;
}

.authors span {
  display: inline-block;
}

.authors a {
  color: inherit;
  text-decoration-color: rgba(14, 124, 134, 0.46);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

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

.authors strong {
  font-weight: 850;
}

.equal-mark {
  margin-left: 1px;
  color: var(--accent-strong);
  font-size: 0.72em;
  font-weight: 850;
  line-height: 0;
  position: relative;
  top: -0.22em;
}

.author-note {
  margin: -2px auto 10px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
}

.author-note sup {
  color: var(--accent-strong);
  font-weight: 850;
}

.authors span:not(:last-child)::after {
  content: "·";
  color: var(--muted);
  margin: 0 8px;
}

.affiliations {
  max-width: 940px;
  margin: 0 auto;
  color: var(--muted);
}

.resource-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 28px;
}

.resource-link,
.copy-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  padding: 8px 16px;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.resource-link:hover,
.copy-button:hover {
  border-color: rgba(14, 124, 134, 0.45);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.resource-link.primary {
  border-color: #0b6c75;
  background: var(--accent);
  color: #ffffff;
}

.media-band {
  padding: 34px 0 8px;
}

.hero-figure,
.image-panel,
.video-shell {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-figure img {
  width: 100%;
  aspect-ratio: 2200 / 1159;
  object-fit: contain;
  background: #ffffff;
}

figcaption {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.95rem;
  padding: 14px 18px;
}

.section {
  padding: 76px 0;
}

.section-muted {
  background: var(--surface-muted);
  border-block: 1px solid var(--line);
}

.section-kicker {
  margin: 0 0 12px;
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 850;
  text-transform: uppercase;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.feature-card,
.metric-card {
  min-height: 188px;
  border: 1px solid rgba(28, 35, 33, 0.1);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px;
}

.feature-card:nth-child(2) {
  background: var(--accent-soft);
}

.feature-card:nth-child(3) {
  background: var(--green-soft);
}

.feature-card:nth-child(4) {
  background: var(--rose-soft);
}

.feature-index {
  display: block;
  margin-bottom: 28px;
  color: var(--accent-strong);
  font-size: 0.8rem;
  font-weight: 850;
}

.feature-card p,
.metric-card p {
  margin: 0;
  color: var(--muted);
}

.method-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.8fr);
  gap: 18px;
  align-items: start;
  margin-top: 28px;
}

.image-panel img {
  width: 100%;
  min-height: 210px;
  object-fit: contain;
  background: #ffffff;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 28px 0;
}

.metric-card {
  min-height: 128px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.metric-value {
  color: #084d54;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 850;
  line-height: 1;
}

.metric-label {
  color: var(--muted);
  font-weight: 750;
}

.result-stack {
  display: grid;
  gap: 18px;
}

.table-wrap {
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  text-align: left;
}

caption {
  caption-side: top;
  color: var(--muted);
  font-weight: 800;
  padding: 14px 18px;
  text-align: left;
}

th,
td {
  border-top: 1px solid var(--line);
  padding: 13px 18px;
}

th {
  background: #f9f8f4;
  color: #34413d;
  font-size: 0.88rem;
  text-transform: uppercase;
}

.ours td {
  background: var(--accent-soft);
  color: #053f45;
  font-weight: 850;
}

.video-shell {
  margin-top: 26px;
  background: #111816;
}

.video-shell video {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
}

.section-heading-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.copy-button {
  cursor: pointer;
}

.bibtex-block {
  margin: 24px 0 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #17211f;
  color: #ecf5ef;
  font-size: 0.92rem;
  line-height: 1.5;
  overflow-x: auto;
  padding: 20px;
}

.acknowledgements {
  padding-top: 52px;
}

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding: 26px 0;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 900px) {
  .nav-toggle {
    display: block;
  }

  .nav-links {
    position: absolute;
    top: 64px;
    left: 16px;
    right: 16px;
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    padding: 10px;
    box-shadow: var(--shadow);
  }

  .nav-links.open {
    display: grid;
  }

  .hero {
    padding-top: 58px;
  }

  .feature-grid,
  .metric-grid,
  .method-grid {
    grid-template-columns: 1fr;
  }

  .feature-card,
  .metric-card {
    min-height: 0;
  }
}

@media (max-width: 560px) {
  .container,
  .container.narrow,
  .nav-wrap {
    width: min(calc(100% - 24px), var(--max));
  }

  .section {
    padding: 56px 0;
  }

  .hero {
    padding-bottom: 40px;
  }

  .hero-institution {
    flex-direction: column;
    gap: 10px;
  }

  .institution-logos {
    gap: 10px;
  }

  .resource-row {
    align-items: stretch;
    flex-direction: column;
  }

  .resource-link {
    width: 100%;
  }

  .section-heading-row {
    align-items: start;
    flex-direction: column;
  }

  .bibtex-block {
    font-size: 0.82rem;
  }
}
