:root {
  --text: #222222;
  --muted: #60656b;
  --link: #2767a8;
  --border: #dcdfe3;
  --light: #f6f7f8;
  --width: 1040px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 74px; }
body {
  margin: 0;
  color: var(--text);
  background: #ffffff;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.65;
}
img { display: block; max-width: 100%; height: auto; }
video { display: block; max-width: 100%; height: auto; background: #000000; }

/*
 * Reserve intrinsic space for every video so the page height is stable
 * before media loads. Without this, each <video> collapses to the default
 * 150px box until its metadata loads; the resulting reflow moves the
 * #citation target after a smooth-scroll has already started, so BibTeX /
 * Citation anchor links land in the wrong place. Ratios come from posters.
 */
.teaser-video-section video { aspect-ratio: 2064 / 1062; }
.five-up video,
.three-up video,
.two-up video { aspect-ratio: 1 / 1; }
.video-stack video { aspect-ratio: 5 / 1; }      /* camera examples: 2400x480 */
.depth-examples video { aspect-ratio: 4 / 1; }   /* depth examples: 1024x256 */
.hand-examples video { aspect-ratio: 3 / 1; }    /* hand examples: 2400x800 */
a { color: var(--link); text-underline-offset: 3px; }
.page-container { width: min(calc(100% - 40px), var(--width)); margin-inline: auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--border);
}
.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: min(calc(100% - 40px), var(--width));
  min-height: 58px;
  margin-inline: auto;
}
.brand { color: var(--text); font-size: 18px; font-weight: 700; text-decoration: none; }
nav { display: flex; gap: 26px; }
nav a { color: #3b3d40; font-size: 14px; text-decoration: none; }
nav a:hover { color: var(--link); }

.hero { padding-block: 70px 64px; text-align: center; }
h1 {
  max-width: 1000px;
  margin: 0 auto 25px;
  font-size: clamp(38px, 5.5vw, 60px);
  font-weight: 600;
  line-height: 1.14;
  letter-spacing: -0.025em;
}
.authors {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 3px 20px;
  margin-bottom: 9px;
  font-size: 16px;
}
.authors a { text-decoration: none; }
.authors a:hover { text-decoration: underline; }
.affiliations { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.venue { margin: 14px 0 22px; font-weight: 600; }
.link-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.project-link {
  display: inline-block;
  padding: 7px 14px;
  color: var(--link);
  background: white;
  border: 1px solid var(--link);
  border-radius: 3px;
  font-size: 14px;
  text-decoration: none;
}
.project-link.disabled { color: #6f7479; border-color: #aeb3b8; cursor: default; }

.teaser-video-section { padding-block: 0 70px; border-top: 0; }
.teaser-video-section .video-figure { margin-bottom: 0; }

.content-section {
  padding-block: 70px;
  border-top: 1px solid var(--border);
}
h2 {
  margin: 0 0 32px;
  color: var(--text);
  font-size: 32px;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
}
h3 {
  margin: 0 0 13px;
  color: var(--text);
  font-size: 23px;
  font-weight: 600;
  line-height: 1.3;
}
h4 {
  margin: 34px 0 18px;
  color: var(--text);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.35;
}
h5 {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}
figure { margin: 0 0 50px; }
figure > img { width: 100%; }
figure > video, .video-figure video { width: 100%; }
figcaption {
  max-width: 940px;
  margin: 13px auto 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  text-align: left;
}
.paper-text { max-width: 900px; margin-inline: auto; }
.paper-text p { margin: 0 0 18px; text-align: justify; }
.paper-text p:last-child { margin-bottom: 0; }
.method-text .method-step { margin-bottom: 10px; }
.method-substeps {
  max-width: 900px;
  margin: 0 auto 18px;
  padding-left: 24px;
}
.method-substeps li { margin-bottom: 8px; text-align: justify; }
.method-substeps li:last-child { margin-bottom: 0; }
#overview h2:not(:first-child) { margin-top: 60px; }

.section-introduction {
  max-width: 900px;
  margin: -12px auto 45px;
  color: var(--muted);
  text-align: center;
}
.experiment {
  max-width: 940px;
  margin: 0 auto;
  padding: 40px 0;
  border-top: 1px solid var(--border);
}
.experiment:first-of-type { border-top: 0; padding-top: 0; }
.experiment p { margin: 0 0 24px; text-align: justify; }
.experiment figure { margin: 28px 0 0; }
.video-comparison { margin-top: 30px; }
.body-examples { max-width: 100%; }
.body-example-group { margin-top: 34px; }
.body-example-group:first-child { margin-top: 0; }
.body-example {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.body-example:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.video-grid {
  display: grid;
  gap: 14px;
}
.video-grid video, .video-stack video, .video-card video {
  width: 100%;
  border: 1px solid var(--border);
}
.two-up { grid-template-columns: repeat(2, 1fr); }
.three-up { grid-template-columns: repeat(3, 1fr); }
.five-up {
  grid-template-columns: repeat(5, 1fr);
  align-items: start;
}
.video-card p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  text-align: center;
}
.video-stack {
  display: grid;
  gap: 14px;
}
.comparison-legend {
  margin: 0 0 12px !important;
  color: var(--muted);
  font-size: 14px;
  text-align: center !important;
}
.two-column-figure {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: center;
}
.two-column-figure img { width: 100%; }
.two-column-figure figcaption { grid-column: 1 / -1; width: 100%; margin-top: 0; }
.gaze-figure img { aspect-ratio: 1; object-fit: contain; }

.citation-block { position: relative; max-width: 850px; margin: 0 auto; }
.citation-intro { max-width: 850px; margin: 24px auto; }
.citation-block pre {
  overflow-x: auto;
  margin: 0;
  padding: 52px 24px 24px;
  background: var(--light);
  border: 1px solid var(--border);
  border-radius: 3px;
  font: 13px/1.7 "Courier New", monospace;
}
.copy-button {
  position: absolute;
  top: 11px;
  right: 11px;
  padding: 5px 9px;
  color: var(--link);
  background: white;
  border: 1px solid var(--link);
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
}
.copy-button:hover { color: white; background: var(--link); }

.site-footer { padding-block: 28px; color: var(--muted); background: var(--light); border-top: 1px solid var(--border); }
.site-footer .page-container { display: flex; justify-content: space-between; gap: 24px; }
.site-footer p { margin: 0; font-size: 12px; }

@media (max-width: 700px) {
  .page-container, .nav-container { width: min(calc(100% - 28px), var(--width)); }
  nav { gap: 14px; }
  nav a { font-size: 12px; }
  .hero { padding-block: 50px; }
  h1 { font-size: 38px; }
  .content-section { padding-block: 52px; }
  .teaser-video-section { padding-block: 0 52px; }
  h2 { font-size: 28px; }
  h3 { font-size: 21px; }
  h4 { font-size: 18px; }
  .paper-text p, .experiment p, .method-substeps li { text-align: left; }
  .two-column-figure { grid-template-columns: 1fr; }
  .two-column-figure figcaption { grid-column: 1; }
  .three-up { grid-template-columns: 1fr; }
  /* .two-up (hand overlay) intentionally stays side by side at all widths
     so the square videos never grow too large on narrow screens. */
  .five-up { grid-template-columns: repeat(2, 1fr); }
  .site-footer .page-container { flex-direction: column; gap: 3px; }
}

@media (max-width: 480px) {
  .brand { display: none; }
  .nav-container { justify-content: center; }
  nav { width: 100%; justify-content: space-between; }
  h1 { font-size: 33px; }
  .five-up { grid-template-columns: 1fr; }
}
