:root {
  --page-bg: #ffffff;
  --page-fg: #1a1a1a;
  --page-muted: #5a5a5a;
  --page-link: #209cee;
  --page-button: #363636;
  --page-light: #f5f5f5;
  --page-border: #e5e5e5;
  --page-code: #f3f3f5;
  --page-width: 1024px;
  --prose-width: 900px;
}

html {
  background: var(--page-bg);
  color: var(--page-fg);
  scroll-behavior: smooth;
}

body {
  background: var(--page-bg);
  color: var(--page-fg);
  font-family: "Noto Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.65;
}

a {
  color: var(--page-link);
}

a:focus-visible,
.button:focus-visible {
  outline: 3px solid rgba(32, 156, 238, 0.35);
  outline-offset: 3px;
}

.container.is-max-desktop {
  max-width: var(--page-width) !important;
}

.prose {
  max-width: var(--prose-width) !important;
}

.publication-hero .hero-body {
  padding: 4rem 1.5rem 2.25rem;
}

.publication-title,
.section-title,
.teaser-caption {
  font-family: "Google Sans", "Noto Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.publication-title {
  color: var(--page-fg);
  font-size: clamp(2rem, 4vw, 2.5rem) !important;
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 1rem !important;
}

.publication-venue {
  color: var(--page-muted);
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 0.85rem;
}

.publication-authors {
  font-size: 1.08rem;
  line-height: 1.7;
}

.publication-author {
  display: inline-block;
  margin: 0 0.18rem;
}

.publication-affiliations {
  color: var(--page-muted);
  font-size: 0.96rem;
  margin-top: 0.35rem;
}

.publication-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: center;
  margin-top: 1.5rem;
}

.publication-links .button {
  background: var(--page-button);
  border: 0;
  color: #ffffff;
  transition: background 140ms ease, transform 140ms ease;
}

.publication-links .button:not(.is-disabled):hover {
  background: #4a4a4a;
  color: #ffffff;
  transform: translateY(-1px);
}

.publication-links .is-disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.section {
  padding: 3rem 1.5rem;
}

.section.is-light {
  background: var(--page-light);
}

.section-title {
  color: var(--page-fg);
  font-size: 1.75rem !important;
  font-weight: 600;
  margin-bottom: 1.5rem !important;
  text-align: center;
}

.publication-copy {
  color: var(--page-fg);
}

.publication-copy p {
  margin-bottom: 1rem;
}

.teaser-section {
  padding-top: 1rem;
}

.teaser-caption,
.media-caption {
  color: var(--page-muted);
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0.8rem auto 0;
  max-width: 820px;
  text-align: center;
}

.publication-media,
.publication-video,
.media-placeholder {
  border-radius: 9px;
  display: block;
  margin-left: auto;
  margin-right: auto;
  max-width: 100%;
  overflow: hidden;
  width: 100%;
}

img.publication-media {
  height: auto;
}

.publication-video {
  aspect-ratio: 16 / 9;
  background: #000000;
}

.publication-video video,
.publication-video iframe {
  border: 0;
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.media-placeholder {
  align-items: center;
  background: #eeeeef;
  border: 1px solid var(--page-border);
  color: #777777;
  display: flex;
  justify-content: center;
  min-height: 360px;
  padding: 2rem;
  text-align: center;
}

.media-placeholder.compact {
  min-height: 250px;
}

.method-placeholder {
  background: #ffffff;
}

.method-section .publication-copy {
  margin-top: 1.4rem;
}

.media-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.media-grid > :only-child {
  grid-column: 1 / -1;
}

.result-item {
  min-width: 0;
}

.bibtex {
  background: var(--page-code);
  border-radius: 8px;
  color: var(--page-fg);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.86rem;
  line-height: 1.5;
  overflow-x: auto;
  padding: 1.2rem;
  white-space: pre;
}

.project-footer {
  background: var(--page-bg);
  border-top: 1px solid var(--page-border);
  color: var(--page-muted);
  font-size: 0.88rem;
  padding: 2.2rem 1.5rem;
}

.template-credit {
  font-size: 0.82rem;
}

@media (min-width: 769px) {
  .publication-copy {
    text-align: justify;
  }
}

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

  .publication-hero .hero-body {
    padding: 2.8rem 1rem 1.5rem;
  }

  .section {
    padding: 2.35rem 1rem;
  }

  .media-placeholder {
    min-height: 260px;
  }
}

@media (max-width: 640px) {
  .publication-title {
    font-size: 1.8rem !important;
  }

  .publication-venue {
    font-size: 1.15rem;
  }

  .publication-links {
    gap: 0.45rem;
  }

  .publication-links .button {
    font-size: 0.88rem;
  }

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

  .media-grid > :only-child {
    grid-column: auto;
  }

  .media-caption,
  .teaser-caption {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .publication-links .button {
    transition: none;
  }
}

/* ---------------- figures and results ---------------- */
.method-figure {
  background: #ffffff;
  padding: 0.6rem;
}

.results-figure {
  margin-top: 2.2rem;
}

.table-wrap {
  overflow-x: auto;
}

.results-table {
  background: transparent;
  font-size: 0.82rem;
  margin: 0 auto;
  min-width: 860px;
}

.results-table th,
.results-table td {
  padding: 0.28rem 0.42rem !important;
  text-align: right !important;
  white-space: nowrap;
}

.results-table thead th {
  border-bottom-width: 1px !important;
  color: var(--page-fg);
  text-align: center !important;
}

.results-table tbody th {
  text-align: left !important;
}

.results-table tr.is-ours {
  background: #eaf4fc;
}

/* ---------------- interactive demos ---------------- */
.demo-title {
  font-family: "Google Sans", "Noto Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  margin: 2.4rem 0 0.4rem;
}

.demo-title:first-of-type {
  margin-top: 0.5rem;
}

.demo-lead {
  color: var(--page-muted);
  margin-bottom: 1rem;
  max-width: var(--prose-width);
}

.sweep-demo {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: 2fr 1fr;
}

.sweep-compare,
.sweep-locator {
  aspect-ratio: 480 / 380;
  background: #101317;
  border-radius: 9px;
  overflow: hidden;
  position: relative;
}

.sweep-locator {
  aspect-ratio: 240 / 380;
}

.sweep-compare {
  cursor: ew-resize;
  touch-action: none;
}

.sweep-compare canvas,
.sweep-locator canvas {
  display: block;
  height: 100%;
  left: 0;
  position: absolute;
  top: 0;
  width: 100%;
}

.sweep-compare canvas + canvas {
  clip-path: inset(0 0 0 var(--split));
}

.sweep-handle {
  background: #ffffff;
  bottom: 0;
  left: var(--split);
  position: absolute;
  top: 0;
  transform: translateX(-1px);
  width: 2px;
}

.sweep-handle span {
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  height: 26px;
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 26px;
}

.sweep-handle span::before {
  color: #363636;
  content: "\2194";
  font-size: 15px;
  left: 50%;
  line-height: 1;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -55%);
}

.sweep-tag {
  background: rgba(0, 0, 0, 0.55);
  border-radius: 4px;
  color: #ffffff;
  font-size: 0.78rem;
  padding: 0.12rem 0.45rem;
  pointer-events: none;
  position: absolute;
  top: 0.55rem;
}

.tag-short {
  display: none;
}

.sweep-tag.is-left {
  left: 0.55rem;
}

.sweep-tag.is-right {
  right: 0.55rem;
}

.demo-controls {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.2rem;
  margin-top: 0.8rem;
}

.demo-range {
  align-items: center;
  color: var(--page-muted);
  display: flex;
  flex: 1 1 200px;
  font-size: 0.9rem;
  gap: 0.6rem;
}

.demo-range.is-wide {
  flex: 3 1 320px;
}

.range-end {
  white-space: nowrap;
}

.demo-check {
  color: var(--page-muted);
  font-size: 0.9rem;
}

.demo-controls .button {
  background: var(--page-button);
  border: 0;
  color: #ffffff;
}

.demo-controls .button:hover {
  background: #4a4a4a;
  color: #ffffff;
}

input[type="range"] {
  accent-color: #363636;
  flex: 1;
  min-width: 0;
}

.explorer-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.7rem;
}

.explorer-tabs .button {
  border-color: var(--page-border);
}

.explorer-tabs .button.is-active {
  background: var(--page-button);
  border-color: var(--page-button);
  color: #ffffff;
}

.explorer-view {
  aspect-ratio: 16 / 9;
  border: 1px solid var(--page-border);
  border-radius: 9px;
  overflow: hidden;
  position: relative;
}

.explorer-view canvas {
  cursor: grab;
  display: block;
  height: 100%;
  width: 100%;
}

.explorer-legend {
  background: rgba(255, 255, 255, 0.86);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  font-size: 0.8rem;
  gap: 0.15rem;
  left: 0.7rem;
  padding: 0.45rem 0.6rem;
  pointer-events: none;
  position: absolute;
  top: 0.7rem;
}

.legend-case {
  font-weight: 600;
}

.legend-item {
  align-items: center;
  display: flex;
  gap: 0.4rem;
}

.legend-metric {
  color: var(--page-muted);
}

.dot {
  border-radius: 50%;
  display: inline-block;
  height: 0.7rem;
  width: 0.7rem;
}

.legend-bar {
  background: linear-gradient(90deg, #000004, #4a0c6b, #a52c60, #ed6925, #fcffa4);
  border-radius: 2px;
  display: inline-block;
  height: 0.6rem;
  width: 3rem;
}

.explorer-fallback {
  color: var(--page-muted);
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
}

@media (max-width: 768px) {
  .sweep-demo {
    gap: 0.35rem;            /* keep raw/overlay and the portrait locator side by side, equal height */
  }

  .sweep-tag {
    font-size: 0.68rem;
  }

  .tag-long {
    display: none;
  }

  .tag-short {
    display: inline;
  }

  .explorer-view {
    aspect-ratio: 4 / 3;
  }
}

/* ---------------- explanatory text ---------------- */
.subsection-title {
  font-family: "Google Sans", "Noto Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1.12rem !important;
  font-weight: 600 !important;
  margin: 1.4rem 0 0.4rem !important;
}

.demo-intro {
  color: var(--page-muted);
  margin: -0.6rem auto 0.4rem;
  max-width: var(--prose-width);
  text-align: center;
}

.results-copy {
  margin-top: 1rem;
}

.ablation-table {
  min-width: 520px;
}

.ablation-table tbody th {
  font-weight: 400;
}

.results-table tr.is-oracle {
  color: var(--page-muted);
  font-style: italic;
}

/* Paper tables: mean with ± std below, method groups, dataset subtitles; narrow single-column figures */
.results-table .std {
  display: block;
  font-size: 0.7em;
  line-height: 1.1;
  color: #6b7280;
  white-space: nowrap;
}
.results-table tr.group-start th,
.results-table tr.group-start td {
  border-top: 1.5px solid #cfd6dc;
}
.results-table .col-sub {
  font-weight: 400;
  font-size: 0.85em;
  color: #6b7280;
}
.publication-media.narrow-figure {
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
  display: block;
}
.publication-affiliations.publication-corresponding {
  font-size: 0.9em;
  margin-top: 0.25rem;
}
