body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  margin: 0;
  padding: 0 16px 80px;
}

h1 {
  text-align: center;
  margin-top: 32px;
}

/* ---- Paper header ---- */
.paper-header {
  max-width: 920px;
  margin: 0 auto;
  text-align: center;
}

.paper-header h1 {
  font-size: 1.9rem;
  line-height: 1.25;
}

.paper-header .venue {
  text-align: center;
  color: #444;
  font-size: 1.3rem;
  font-weight: 600;
  margin: 8px 0;
}

.paper-header .status {
  text-align: center;
  color: #a00;
  font-style: italic;
  margin: 4px 0 24px;
}

.abstract {
  max-width: 820px;
  margin: 24px auto 8px;
  padding: 16px 24px;
  background: #f6f6f6;
  border-radius: 8px;
}

.abstract h2 {
  margin-top: 0;
  font-size: 1.1rem;
}

.abstract p {
  text-align: justify;
  hyphens: auto;
  line-height: 1.55;
  margin-bottom: 0;
}

/* ---- Experiment sections ---- */
.experiment {
  max-width: 960px;
  margin: 56px auto 0;
}

.experiment-title {
  text-align: left;
  font-size: 1.5rem;
  margin-bottom: 14px;
}

.experiment-desc {
  text-align: left;
  color: #444;
  font-size: 1rem;
  line-height: 1.6;
  max-width: 960px;
  margin: 0 auto 28px;
}

/* ---- "Drag the slider" interaction hint ---- */
.drag-hint {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 960px;
  margin: 0 auto 28px;
  padding: 12px 18px;
  background: #eef4ff;
  border: 1px solid #c7d8f5;
  border-left: 4px solid #3a6ff0;
  border-radius: 8px;
  color: #1f2d4d;
  font-size: 1rem;
  line-height: 1.5;
}

.drag-hint strong {
  font-weight: 700;
}

.drag-hint-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #3a6ff0;
  color: #fff;
  font-size: 1.15rem;
  line-height: 1;
  animation: drag-hint-nudge 1.6s ease-in-out infinite;
}

@keyframes drag-hint-nudge {
  0%, 100% { transform: translateX(-3px); }
  50%      { transform: translateX(3px); }
}

@media (prefers-reduced-motion: reduce) {
  .drag-hint-icon { animation: none; }
}

.colormap-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  max-width: 960px;
  margin: 0 auto 32px;
}

.colormap-legend .colormap-label {
  color: #555;
  font-size: 0.9rem;
}

.colormap-legend .colormap-bar {
  width: 240px;
  height: 14px;
  border-radius: 7px;
  background: linear-gradient(to right,
    #440154, #482878, #3e4a89, #31688e, #26828e,
    #1f9e89, #35b779, #6ece58, #b5de2b, #fde725);
}

.viridis-word {
  font-style: italic;
  font-weight: 600;
  background: linear-gradient(to right,
    #440154, #482878, #3e4a89, #31688e, #26828e,
    #1f9e89, #35b779, #6ece58, #b5de2b, #fde725);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.result-video {
  display: block;
  width: 100%;
  margin: 0 auto;
  border-radius: 8px;
}

.video-caption {
  text-align: center;
  color: #555;
  font-size: 0.95rem;
  margin: 8px auto 24px;
}

/* ---- Video comparison slider ---- */
.video-compare-container {
  width: 63%;
  max-width: 960px;
  margin: 0 auto 8px;
  position: relative;
  display: block;
  line-height: 0;
}

/* Row of comparison widgets sharing a single caption. */
.compare-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: center;
  margin: 0 auto 8px;
}

.compare-row .video-compare-container {
  width: auto;
  max-width: none;
  flex: 1 1 0;
  margin: 0;
}

/* The two source videos are hidden; they are only used as pixel
   sources that get drawn onto the canvas. */
.video-compare-container video {
  position: absolute;
  height: 0;
  width: 0;
  visibility: hidden;
}

.videoMerge {
  position: relative;
  top: 0;
  left: 0;
  z-index: 10;
  width: 100%;
  display: block;
  margin: 0 auto;
  background-size: cover;
  cursor: ew-resize;
}

/* ---- Overlay playback controls for the comparison canvas ---- */
.video-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 14px 10px;
  line-height: normal;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0));
  opacity: 0;
  transition: opacity 0.2s ease;
}

/* Reveal the bar on hover (and keep it visible while scrubbing). */
.video-compare-container:hover .video-controls,
.video-controls:focus-within {
  opacity: 1;
}

.vc-btn {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  font-size: 0.8rem;
  line-height: 1;
  cursor: pointer;
}

.vc-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.vc-seek {
  flex: 1 1 auto;
  min-width: 0;   /* allow the bar to shrink to fit narrow widths */
  height: 4px;
  cursor: pointer;
  accent-color: #fff;
}

.vc-time {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
  color: #fff;
  font-size: 0.85rem;
  text-align: right;
}

/* ---- Mobile: stack each comparison row so videos are full-width ---- */
@media (max-width: 700px) {
  .compare-row {
    flex-direction: column;
    gap: 16px;
  }

  /* No hover on touch screens, so keep the controls visible. */
  .video-controls {
    opacity: 1;
  }
}
