: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;
}

.video-section {
  padding-bottom: 1.5rem;
  padding-top: 0.5rem;
}

.teaser-video {
  aspect-ratio: 16 / 9;
  background: #0b0e14;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(10, 14, 20, 0.18);
  display: block;
  height: auto;
  width: 100%;
}

.video-section .media-caption {
  margin-top: 0.75rem;
}

.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;
  }
}

/* ---------- MoPort additions ---------- */
:root {
  --id-color: #14807d;
  --ood-color: #c85f1c;
  --skeleton-bg: #14181d;
}

.publication-title {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
}

.title-icon {
  height: 2.6em;
  width: auto;
}

.title-icon + span {
  max-width: 820px;
}

.figure-image {
  border-radius: 9px;
  display: block;
  height: auto;
  margin: 0 auto;
  max-width: 100%;
}

.is-narrow-figure {
  max-width: 720px;
}

.section-lead {
  color: var(--page-muted);
  margin: -0.6rem auto 1.4rem;
  text-align: center;
}

.subsection-title {
  font-family: "Google Sans", "Noto Sans", sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
  margin: 2.4rem 0 0.9rem;
  text-align: center;
}

.subsection-title:first-of-type {
  margin-top: 0;
}

/* Demo: the observation window sits in the middle; the evaluation cameras surround it. */
.demo {
  margin: 0 auto;
  max-width: 1024px;
}

.demo-grid {
  align-items: start;
  display: grid;
  gap: 1.6rem;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
  margin-top: 0.6rem;
}

.demo-label {
  color: var(--page-muted);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
}

.window-panel .demo-label {
  color: var(--card-color, var(--page-muted));
}

.demo[hidden] {
  display: none;
}

.demo-tabs {
  display: flex;
  gap: 0.4rem;
  justify-content: center;
  margin-bottom: 0.4rem;
}

.demo-tab {
  background: #ffffff;
  border: 1px solid var(--page-border);
  border-radius: 999px;
  color: var(--page-fg);
  cursor: pointer;
  font: inherit;
  font-size: 0.92rem;
  padding: 0.3rem 1.05rem;
}

.demo-tab[aria-selected="true"] {
  background: var(--page-button);
  border-color: var(--page-button);
  color: #ffffff;
}

.demo-tab:focus-visible,
.camera-chip:focus-visible,
.demo-play:focus-visible {
  outline: 3px solid rgba(32, 156, 238, 0.45);
  outline-offset: 2px;
}

.orbit-layer {
  display: block;
  height: auto;
  width: 100%;
}

.orbit-camera,
.orbit-hit {
  cursor: pointer;
}

.orbit-camera:focus {
  outline: none;
}

.orbit-camera:focus-visible .camera-hit {
  stroke: #209cee;
  stroke-width: 3;
}

.orbit-camera:hover polygon {
  filter: brightness(1.06);
}

.wipe {
  aspect-ratio: 1 / 1;
  background: #dfe3e6;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  cursor: ew-resize;
  overflow: hidden;
  position: relative;
  touch-action: pan-y;
  user-select: none;
  width: 100%;
}

.wipe-video,
.wipe-skeleton {
  display: block;
  height: 100%;
  left: 0;
  position: absolute;
  top: 0;
  width: 100%;
}

.wipe-video {
  object-fit: cover;
}

.wipe-video[hidden] {
  display: none;
}

.wipe-skeleton {
  clip-path: inset(0 0 0 var(--split));
}

.wipe-tag {
  background: rgba(20, 24, 29, 0.72);
  border-radius: 999px;
  color: #ffffff;
  font-size: 0.74rem;
  max-width: 46%;
  overflow: hidden;
  padding: 0.12rem 0.55rem;
  pointer-events: none;
  position: absolute;
  text-overflow: ellipsis;
  top: 0.55rem;
  white-space: nowrap;
}

.wipe-tag-left {
  left: 0.55rem;
}

.wipe-tag-right {
  right: 0.55rem;
}

.wipe-handle {
  background: #ffffff;
  bottom: 0;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
  left: var(--split);
  pointer-events: none;
  position: absolute;
  top: 0;
  transform: translateX(-1px);
  width: 2px;
}

.wipe-knob {
  align-items: center;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.28);
  color: var(--page-button);
  display: flex;
  font-size: 0.85rem;
  height: 32px;
  justify-content: center;
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
}

.camera-chips {
  display: none;
}

.camera-chip {
  background: #ffffff;
  border: 1px solid var(--page-border);
  border-left: 4px solid var(--chip-color);
  border-radius: 7px;
  color: var(--page-fg);
  cursor: pointer;
  font: inherit;
  line-height: 1.3;
  padding: 0.35rem 0.6rem;
  text-align: left;
}

.camera-chip strong {
  color: var(--chip-color);
  display: block;
  font-size: 0.86rem;
}

.camera-chip small {
  color: var(--page-muted);
  font-size: 0.76rem;
}

.camera-chip[aria-checked="true"] {
  background: color-mix(in srgb, var(--chip-color) 10%, #ffffff);
  border-color: var(--chip-color);
}

.demo-controls {
  align-items: center;
  display: flex;
  gap: 0.7rem;
  margin: 0.6rem 0 1rem;
}

.demo-play {
  background: var(--page-button);
  border: 0;
  border-radius: 50%;
  color: #ffffff;
  cursor: pointer;
  flex: none;
  height: 32px;
  width: 32px;
}

.demo-split {
  accent-color: var(--page-button);
  flex: 1;
}

.demo-captions {
  display: grid;
  gap: 0.7rem;
}

.caption-card {
  background: #ffffff;
  border: 1px solid var(--page-border);
  border-radius: 9px;
  padding: 0.65rem 0.95rem;
}

.caption-card.is-selected {
  border-color: var(--card-color, var(--id-color));
  box-shadow: inset 4px 0 0 var(--card-color, var(--id-color));
}

.caption-source {
  align-items: center;
  color: var(--page-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.8rem;
  font-weight: 600;
  gap: 0.35rem;
  margin-bottom: 0.15rem;
}

.caption-source img {
  height: 1.3em;
}

.caption-source span {
  font-weight: 400;
}

.caption-source .caption-view {
  color: var(--card-color, var(--id-color));
  font-weight: 600;
  margin-left: auto;
}

.caption-text {
  font-size: 1.02rem;
  line-height: 1.45;
  min-height: 1.45em;
}

.is-selected .caption-text {
  font-family: "Google Sans", "Noto Sans", sans-serif;
  font-size: 1.18rem;
}

.is-selected .caption-text::after {
  animation: caret 1s steps(1) infinite;
  color: var(--card-color, var(--id-color));
  content: "▍";
  margin-left: 1px;
}

.is-selected .caption-text.is-done::after {
  content: "";
}

@keyframes caret {
  50% { opacity: 0; }
}

.is-reference .caption-text {
  color: #3a3a3a;
}

.demo-note {
  margin-top: 1.4rem;
}

.result-columns {
  display: grid;
  gap: 1.75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 2.4rem;
}

.result-columns .subsection-title {
  margin-top: 0;
}

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

.results-table {
  background: transparent;
  font-size: 0.86rem;
  margin: 0 auto;
  width: 100%;
}

.results-table th,
.results-table td {
  text-align: right;
  white-space: nowrap;
}

.results-table th:first-child,
.results-table td:first-child,
.results-table td:nth-child(2):not(:last-child) {
  text-align: left;
}

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

.results-table tr.is-ours td {
  background: rgba(20, 128, 125, 0.08);
}

@media (max-width: 900px) {
  .result-columns {
    grid-template-columns: 1fr;
  }
}

/* Narrow screens: stack the columns; the sphere's labels would be too small, so cameras become a chip grid. */
@media (max-width: 760px) {
  .demo-grid {
    grid-template-columns: 1fr;
  }

  .orbit-layer {
    display: none;
  }

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

  .section-lead {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  .is-selected .caption-text::after {
    animation: none;
  }
}

.orbit-camera text {
  paint-order: stroke;
  stroke: #f5f5f5;
  stroke-linejoin: round;
  stroke-width: 5px;
}
