:root {
  --bg: #ffffff;
  --surface: #f6f7f9;
  --ink: #15171b;
  --ink-2: #414652;
  --muted: #737985;
  --line: #e7e9ee;
  --line-strong: #cdd1d9;
  --accent: #1464c8;
  --accent-soft: #e8f0fb;

  --sans: "IBM Plex Sans", "Helvetica Neue", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --text-w: 760px;
  --nav-h: 56px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1013;
    --surface: #16191e;
    --ink: #e8eaee;
    --ink-2: #b4b9c3;
    --muted: #858b97;
    --line: #23272e;
    --line-strong: #3a404a;
    --accent: #75a8f5;
    --accent-soft: #15243a;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

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

::selection {
  background: var(--accent-soft);
  color: var(--ink);
}

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

p {
  margin: 0;
}

p + p {
  margin-top: 1.1em;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color .15s ease, text-decoration-color .15s ease;
}

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

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.text,
.wide {
  max-width: calc(var(--text-w) + 64px);
  margin-left: auto;
  margin-right: auto;
  padding-left: 32px;
  padding-right: 32px;
}

/* ---------- Top navigation ---------- */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.site-nav-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: var(--nav-h);
}

.site-nav-back .short {
  display: none;
}

.site-nav-back {
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav ul {
  display: flex;
  gap: 4px;
  margin: 0 0 0 auto;
  padding: 0;
  list-style: none;
}

.site-nav ul a {
  display: block;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--ink-2);
  text-decoration: none;
  white-space: nowrap;
}

.site-nav ul a:hover {
  color: var(--ink);
  background: var(--line);
}

/* ---------- Hero ---------- */

.hero {
  padding-top: 88px;
  padding-bottom: 48px;
}

.venue {
  margin-bottom: 20px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.hero h1 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.hero h1 .name {
  display: block;
  font-size: clamp(44px, 7vw, 64px);
  line-height: 1;
}

.hero h1 .sub {
  display: block;
  margin-top: 18px;
  font-size: clamp(20px, 2.6vw, 25px);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.012em;
  color: var(--ink-2);
}

.authors {
  margin-top: 32px;
  font-size: 17px;
  font-weight: 500;
}

.affil {
  margin-top: 2px;
  font-size: 15px;
  color: var(--muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

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

.btn.primary {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--bg);
}

.btn.primary:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.btn svg {
  width: 15px;
  height: 15px;
}

/* ---------- Media ---------- */

.figure {
  margin: 0;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.figure img,
.figure video {
  width: 100%;
}

.loop-video {
  cursor: pointer;
}

.zoom {
  display: block;
  cursor: zoom-in;
}

.teaser {
  padding-bottom: 24px;
}

.media-stack > * + * {
  margin-top: 20px;
}

.scroll-hint {
  display: none;
}

/* ---------- Sections ---------- */

.section {
  padding-top: 72px;
  padding-bottom: 8px;
  scroll-margin-top: var(--nav-h);
}

.section h2 {
  margin: 0 0 20px;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.015em;
}

.section .lead {
  margin-bottom: 20px;
  color: var(--ink-2);
}

.section .figure-wrap {
  margin: 32px auto;
}

/* Method steps */

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 0 0 32px;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  padding: 18px 18px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  font-size: 15.5px;
  font-weight: 500;
  line-height: 1.5;
  counter-increment: step;
}

.steps li::before {
  content: counter(step, decimal-leading-zero);
  display: block;
  margin-bottom: 10px;
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--accent);
}

/* References */

.refs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.refs a {
  display: inline-block;
  padding: 5px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 14.5px;
  text-decoration: none;
}

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

/* BibTeX */

.bibtex {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.bibtex pre {
  margin: 0;
  padding: 20px 22px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--ink-2);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.bibtex .btn {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 5px 12px;
  font-size: 12.5px;
  background: var(--bg);
}

/* ---------- Footer ---------- */

.site-footer {
  margin-top: 96px;
  padding-top: 32px;
  padding-bottom: 56px;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--muted);
}

.site-footer p + p {
  margin-top: 6px;
}

/* ---------- Small screens ---------- */

@media (max-width: 760px) {
  body {
    font-size: 16px;
  }

  .text,
  .wide {
    padding-left: 16px;
    padding-right: 16px;
  }

  .site-nav-inner {
    gap: 12px;
  }

  .site-nav ul a {
    padding: 6px 7px;
  }

  .hero {
    padding-top: 48px;
    padding-bottom: 32px;
  }

  .figure {
    padding: 8px;
    border-radius: 12px;
  }

  .section {
    padding-top: 56px;
  }

  .section h2 {
    font-size: 22px;
  }

  .steps {
    grid-template-columns: 1fr;
  }

  .bibtex pre {
    padding: 52px 16px 18px;
    font-size: 12.5px;
  }

  /* Wide comparison videos stay legible by scrolling sideways. */
  .scroll-x {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .scroll-x > video {
    width: 720px;
    max-width: none;
  }

  .scroll-hint {
    display: block;
    margin-top: 8px;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--muted);
  }
}

@media (max-width: 420px) {
  .site-nav-back .full {
    display: none;
  }

  .site-nav-back .short {
    display: inline;
  }
}
