/* Two-stage foveated detection project page — academic / LSD-3D–inspired layout */

:root {
  --bg: #faf9f7;
  --surface: #ffffff;
  --text: #1a1a1a;
  --muted: #5c5c5c;
  --accent: #0d4f4f;
  --accent-hover: #0a3d3d;
  --border: #e2e0dc;
  --shadow: rgba(26, 26, 26, 0.06);
  --font-serif: "Inter", system-ui, sans-serif;
  --font-sans: "Inter", system-ui, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

h1,
h2,
h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.25;
}

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

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

.site-header {
  padding: 3rem 1.5rem 2.5rem;
  text-align: center;
  background: linear-gradient(180deg, #eef3f2 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
}

.site-header h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  letter-spacing: -0.02em;
}

.venue {
  margin: 0 0 1.25rem;
  font-size: 1rem;
  color: var(--muted);
}

.header-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 0.85rem;
  justify-content: center;
  font-weight: 600;
}

.header-links a,
.header-links__pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.45rem 1.15rem;
  border: 1px solid var(--border);
  border-radius: 9999px;
  background: var(--surface);
  box-shadow: 0 1px 3px var(--shadow);
  color: var(--accent);
  text-decoration: none;
  font-size: 0.98rem;
  line-height: 1.2;
  transition: border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.header-links__icon {
  flex-shrink: 0;
  display: block;
}

.header-links__icon--paper {
  color: var(--accent);
}

.header-links a:hover,
.header-links__pill:hover {
  text-decoration: none;
  border-color: var(--accent);
  color: var(--accent-hover);
  box-shadow: 0 2px 6px var(--shadow);
}

.header-links__pill:hover .header-links__icon--paper {
  color: var(--accent-hover);
}

.header-links__pill--arxiv:hover {
  color: #8b2323;
}

.header-links__pill--arxiv:hover .header-links__icon--arxiv path {
  fill: #8b2323;
}

.wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

/* Allow the results carousel to break out of the narrow column */
.wrap-wide {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Video triptych: slightly narrower than full bleed */
.video-carousel-wrap {
  max-width: min(920px, 100%);
  margin: 0 auto;
}

.wrap-wide h2 {
  margin: 0 0 1rem;
  font-size: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
}

.wrap-wide p {
  max-width: 900px;
}

.summary-section {
  margin-top: 2.25rem;
  margin-bottom: 0.5rem;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.summary-section p {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--muted);
}

section {
  margin-top: 3rem;
}

section h2 {
  margin: 0 0 1rem;
  font-size: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
}

.lead {
  font-size: 1.12rem;
  color: var(--muted);
}

.figure {
  margin: 1.5rem 0;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 24px var(--shadow);
}

/* Diagram figures: no white card — sit flush on page background */
.figure:has(.diagram-frame) {
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
}

.figure img,
.figure video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
}

/* PNGs with knocked-out white background: show page tint behind transparent pixels */
.figure .diagram-frame {
  background: var(--bg);
  border-radius: 0;
  overflow: hidden;
  line-height: 0;
}

.figure .diagram-frame img {
  border-radius: 0;
}

.figure figcaption {
  margin-top: 0.75rem;
  font-size: 0.95rem;
  color: var(--muted);
}

/* Results: LSD-3D–style triptych — side clips smaller & offset, no controls (see JS: muted autoplay) */
.video-carousel {
  margin: 0 0 1.5rem;
  padding: 0.5rem 1rem 1rem;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}

.video-carousel__row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  max-width: 100%;
}

.video-carousel__arrow {
  flex: 0 0 auto;
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--accent);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.video-carousel__arrow:hover {
  border-color: var(--accent);
  background: rgba(13, 79, 79, 0.08);
}

.video-carousel__arrow-icon {
  display: block;
}

.video-carousel__stage {
  position: relative;
  width: 100%;
  flex: 1 1 auto;
  min-width: 0;
  aspect-ratio: 3848 / 2168;
}

.video-carousel__slot {
  position: absolute;
  border-radius: 6px;
  overflow: hidden;
  background: transparent;
  border: none;
  transition: transform 0.35s ease, opacity 0.3s ease;
}

/* Center slot: 72% width, centered */
.video-carousel__slot--main {
  left: 14%;
  right: 14%;
  top: 0;
  bottom: 0;
  z-index: 3;
  box-shadow: none;
}

.video-carousel__main-inner {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
}

/* Magnified region on the main frame (matches manifest zoom box) */
.video-carousel__region {
  position: absolute;
  z-index: 2;
  pointer-events: none;
  box-sizing: border-box;
}

.video-carousel__region[hidden] {
  display: none !important;
}

.video-carousel__region-frame {
  position: absolute;
  inset: 0;
  border-radius: 5px;
  background: rgba(255, 236, 200, 0.06);
  box-shadow:
    inset 0 0 0 1.5px rgba(255, 214, 160, 0.65),
    0 0 0 1px rgba(0, 0, 0, 0.45),
    0 0 22px rgba(255, 190, 120, 0.2);
}

/* Picture-in-picture zoom (upper right of main clip) */
.video-carousel__pip {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: min(44%, 340px);
  min-width: 140px;
  pointer-events: none;
  filter: drop-shadow(0 10px 28px rgba(0, 0, 0, 0.5));
}

.video-carousel__pip[hidden] {
  display: none !important;
}

.video-carousel__pip-head {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.3rem;
}

.video-carousel__pip-label {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 250, 240, 0.95);
  background: linear-gradient(145deg, rgba(22, 38, 42, 0.94), rgba(13, 79, 79, 0.9));
  border: 1px solid rgba(255, 210, 175, 0.38);
  border-radius: 999px;
  padding: 0.22rem 0.6rem;
}

.video-carousel__pip-viewport {
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid rgba(255, 220, 195, 0.42);
  background: #070707;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(13, 79, 79, 0.3);
  line-height: 0;
}

.video-carousel__pip-canvas {
  display: block;
  width: 100%;
  height: auto;
}

/* Side slots: 30% width, vertically centered, tucked behind main */
.video-carousel__slot--prev,
.video-carousel__slot--next {
  width: 30%;
  top: 12%;
  bottom: 12%;
  z-index: 1;
  opacity: 1;
}

/* Side previews: muted vs center — grayscale + dim (film is paused in JS) */
.video-carousel__slot--prev .video-carousel__film,
.video-carousel__slot--next .video-carousel__film {
  filter: grayscale(55%) brightness(0.72) contrast(0.95);
  transition: filter 0.35s ease;
}

.video-carousel__slot--prev:hover .video-carousel__film,
.video-carousel__slot--next:hover .video-carousel__film {
  filter: grayscale(35%) brightness(0.82) contrast(0.98);
}

.video-carousel__slot--prev {
  left: 0;
}

.video-carousel__slot--next {
  right: 0;
}

.video-carousel--single .video-carousel__slot--prev,
.video-carousel--single .video-carousel__slot--next {
  display: none;
}

.video-carousel--single .video-carousel__slot--main {
  left: 0;
  right: 0;
}

.video-carousel__film {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  background: #0a0a0a;
}

.video-carousel__slot--main .video-carousel__film--main {
  position: relative;
  z-index: 1;
}

/* Full-size click targets on side panels */
.video-carousel__hit {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  z-index: 2;
}

.video-carousel__hit:hover {
  background: rgba(13, 79, 79, 0.06);
}

/* Pagination dots (inspired by carousel indicators on project pages) */
.video-carousel__dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.video-carousel__dots[hidden] {
  display: none !important;
}

.video-carousel__dot {
  width: 11px;
  height: 11px;
  padding: 0;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
  flex-shrink: 0;
}

.video-carousel__dot:hover {
  border-color: var(--accent-hover);
  background: rgba(13, 79, 79, 0.2);
}

.video-carousel__dot--active {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.12);
}

.video-carousel__dot:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.video-carousel__caption {
  margin: 1rem auto 0;
  max-width: 900px;
  font-size: 0.95rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.55;
}

.video-carousel__status {
  margin: 0.75rem 0 0;
  font-size: 0.88rem;
  color: var(--muted);
  text-align: center;
}

.video-carousel__status[hidden] {
  display: none !important;
}

.video-carousel__hint {
  margin: 0.5rem 0 0;
  font-size: 0.88rem;
  color: var(--muted);
}

/* Baseline comparison carousel — same column width as main .wrap / Results */
.compare-carousel-section {
  margin-top: 2.5rem;
  padding-bottom: 0.5rem;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  box-sizing: border-box;
}

.compare-carousel-section__title {
  margin: 0 0 0.75rem;
  font-size: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
}

.compare-carousel-section__lead {
  margin: 0 0 1.25rem;
  font-size: 0.98rem;
  color: var(--muted);
  line-height: 1.55;
}

/* Nested under Results: align with .wrap column, avoid double horizontal padding */
.compare-carousel-section--in-results {
  margin-top: 0.5rem;
  margin-left: 0;
  margin-right: 0;
  padding-left: 0;
  padding-right: 0;
  max-width: none;
}

#results .compare-carousel-section__title {
  font-size: 1.22rem;
  margin-top: 0;
}

.compare-carousel {
  width: 100%;
  max-width: 100%;
  margin: 0;
}

.compare-carousel__row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
}

.compare-carousel__arrow {
  flex: 0 0 auto;
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--accent);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.compare-carousel__arrow:hover {
  border-color: var(--accent);
  background: rgba(13, 79, 79, 0.08);
}

.compare-carousel__viewport {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 20px var(--shadow);
}

.compare-carousel__track {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  transition: transform 0.35s ease;
}

.compare-carousel__slide {
  flex: 0 0 100%;
  width: 100%;
  min-width: 0;
}

.compare-carousel__toolbar {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 0.65rem;
}

.compare-carousel__scene-select {
  flex: 0 1 auto;
  width: 100%;
  max-width: min(22rem, 100%);
  padding: 0.4rem 0.65rem;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 1px 2px var(--shadow);
}

.compare-carousel__scene-select:hover {
  border-color: var(--accent);
}

.compare-carousel__scene-select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.compare-carousel__slide figure.compare {
  margin: 0;
}

.compare-carousel__slide-caption {
  margin: 0.65rem 0 0;
  font-size: 0.95rem;
  color: var(--muted);
  text-align: center;
}

.compare {
  --compare-ratio: 0.5;
  display: block;
}

.compare__frame {
  position: relative;
  width: 100%;
  aspect-ratio: 3848 / 2168;
  background: #0a0a0a;
  overflow: hidden;
  touch-action: none;
  cursor: ew-resize;
  user-select: none;
  -webkit-user-select: none;
}

.compare__baseline {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.compare__clip {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 1;
  overflow: hidden;
  width: calc(var(--compare-ratio) * 100%);
  pointer-events: none;
}

.compare__ours {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: var(--compare-w, 100%);
  max-width: none;
  object-fit: cover;
  object-position: left center;
  display: block;
  pointer-events: none;
}

.compare__handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--compare-ratio) * 100%);
  z-index: 2;
  width: 3px;
  margin-left: -1.5px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.compare__knob {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2.25rem;
  height: 2.25rem;
  margin: -1.125rem 0 0 -1.125rem;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--accent);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.compare__badge {
  position: absolute;
  top: 0.5rem;
  z-index: 4;
  max-width: calc(50% - 1.25rem);
  padding: 0.35rem 0.6rem;
  font-size: clamp(0.65rem, 2.1vw, 0.8125rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.01em;
  color: var(--text);
  background: rgba(255, 255, 255, 0.88);
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  pointer-events: none;
}

.compare__badge--ours {
  left: 0.5rem;
  text-align: left;
}

.compare__badge--baseline {
  right: 0.5rem;
  text-align: right;
}

.compare-carousel__dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin: 1rem 0 0;
  padding: 0;
}

.compare-carousel__dot {
  width: 11px;
  height: 11px;
  padding: 0;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
  flex-shrink: 0;
}

.compare-carousel__dot:hover {
  background: rgba(13, 79, 79, 0.2);
}

.compare-carousel__dot--active {
  background: var(--accent);
  transform: scale(1.12);
}

.compare-carousel__dot:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.two-col {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 700px) {
  .two-col {
    grid-template-columns: 1fr 1fr;
  }
}

/* Interactive foveation demo */
.demo-panel {
  margin: 1.5rem 0;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 24px var(--shadow);
}

.demo-panel h3 {
  margin: 0 0 0.75rem;
  font-size: 1.2rem;
}

.demo-canvas-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
  overflow: auto;
}

#fove-canvas {
  display: block;
  max-width: 100%;
  height: auto;
  cursor: crosshair;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.demo-controls {
  display: grid;
  gap: 1rem;
}

@media (min-width: 480px) {
  .demo-controls {
    grid-template-columns: 1fr 1fr;
  }
}

.control {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.control label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
}

.control input[type="range"] {
  width: 100%;
}

.control .value {
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
  color: var(--text);
}

.demo-hint {
  margin: 1rem 0 0;
  font-size: 0.92rem;
  color: var(--muted);
}

pre.bibtex {
  margin: 1rem 0 0;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  font-size: 0.82rem;
  line-height: 1.5;
  background: #f0eeeb;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.site-footer {
  margin-top: 3rem;
  padding: 2rem 1.5rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
}
