/* ------------------------------------------------------------------
   UMA project page
   GLOBAL TYPOGRAPHY & LAYOUT
   (template adapted from https://github.com/relic-locoman/relic-locoman.github.io)
   ------------------------------------------------------------------*/
@import url("https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700&family=Roboto+Mono:wght@300;400;700&display=swap");

html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  width: 100%;
}
body {
  background: #fdfaf4;
  /* font-family: 'Playfair Display', serif; */
  font-family: "Avenir Next", "Inter", "Helvetica Neue", Arial, sans-serif;
  color: #1b1b1b;
}

/* ------------------------------------------------------------------
   HERO  (always fills viewport – no white bars)
   ------------------------------------------------------------------*/
header.full-page-image { height: 100vh; width: 100%; position: relative; overflow: hidden; }
header.full-page-image .overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,.28); z-index: -1; }
header.full-page-image .bottom-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 40%;
  background: linear-gradient(to top, rgba(0,0,0,.8), transparent);
  z-index: 1;
  display: flex;
  align-items: flex-end;
  padding-bottom: 40px;
}
header.full-page-image .bottom-overlay h1 {
  margin: 0;
  color: white;
  font-size: clamp(26px, 4vw, 44px);
  line-height: 1.2;
}
#bg-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1s ease;
  z-index: -1;
}

/* ------------------------------------------------------------------
   MAIN ARTICLE BLOCKS
   ------------------------------------------------------------------*/
.main-content { max-width: 1000px; margin: 0 auto; padding: 0 24px; box-sizing: border-box; }
.main-content, .hero-text, .sub-hero-text, .authors, .quick-links, .section, .figure-caption, .bibtex-code { position: relative; z-index: 2; }
.hero-text { font-size: 60px; font-weight: 700; letter-spacing: -1px; line-height: 1.1; margin: 0 0 10px; }
.sub-hero-text {
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 600;
  line-height: 1.2;
  margin: 60px 0 30px;
  text-align: center;
}

/* AUTHORS */
.authors { font-family: "Avenir Next","Inter", "Helvetica Neue", Arial, sans-serif; font-size: 16px; color: #333; line-height: 1.6; margin: 0 0 20px; text-align: center; }
.authors .affiliation { font-weight: 600; font-size: 16px; color: #111; }
.authors .equal-contribution { font-size: 14px; color: #555; }
.authors a { color: inherit; text-decoration: none; }
.authors a:hover { text-decoration: underline; }

/* TAGLINES / SUBTITLES */
/* .tagline { font-family: "Avenir Next","Inter", "Helvetica Neue", Arial, sans-serif; font-size: 24px; background: #000; color: #fff; display: inline-block; padding: 8px 16px; margin: 40px 0 0px; } */
.tagline { font-family: "Avenir Next","Inter", "Helvetica Neue", Arial, sans-serif; font-size: 24px; font-weight: 600; color: #000; text-align: center}
.section-subtitle { font-family: "Avenir Next","Inter", "Helvetica Neue", Arial, sans-serif; font-size: 20px; background: #000; color: #fff; display: table; padding: 6px 14px; margin: 30px 0 10px; }

/* QUICK LINKS */
.quick-links { text-align: center; margin: 10px 0 30px; }
.quick-links a { font-family: "Avenir Next","Inter", "Helvetica Neue", Arial, sans-serif; font-size: 18px; font-weight: bold; color: #333; margin: 0 36px; text-decoration: none; }
.quick-links a:hover { text-decoration: underline; color: #000; }

/* IMAGE DEFAULTS */
img { width: 100%; box-shadow: 0 4px 12px rgba(0,0,0,.15); border-radius: 15px; box-sizing: border-box; }

/* OVERVIEW VIDEO */
.main-video-container { margin: 20px 0; text-align: center; }
.main-video-container video { width: 100%; max-width: 1000px; border-radius: 15px; box-shadow: 0 4px 12px rgba(0,0,0,.15); }

/* FIGURES */
figure { margin: 20px 0 10px; }
figure img { display: block; }
figure video { display: block; width: 100%; box-shadow: 0 4px 12px rgba(0,0,0,.15); border-radius: 15px; box-sizing: border-box; }
.figure-row { display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-start; justify-content: center; margin: 20px 0; }
.figure-row > figure { flex: 1 1 0; min-width: 320px; margin: 0; }
.figure-narrow { max-width: 720px; margin-left: auto; margin-right: auto; }
.figure-chart { max-width: 560px; margin-left: auto; margin-right: auto; }
/* Floated charts with text wrapping around them */
.figure-float-left, .figure-float-right { width: min(440px, 100%); margin-top: 4px; margin-bottom: 10px; }
.figure-float-sm { width: min(340px, 100%); }
.figure-float-left { float: left; margin-right: 28px; }
.figure-float-right { float: right; margin-left: 28px; }
.clear { clear: both; }
@media (max-width: 760px) {
  .figure-float-left, .figure-float-right { float: none; margin: 20px auto; }
}
.figure-row > figure.figure-chart { flex: 0 1 560px; min-width: 280px; }

.figure-caption {
  font-family: "Avenir Next","Inter", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  color: #555;
  text-align: left;
  margin-top: 10px;
  margin-bottom: 36px;
  padding: 0 4px;
}

/* RESULT TABLES (matching the paper) */
.result-table-wrap { max-width: 460px; margin: 20px auto 10px; text-align: center; }
.result-table { width: 100%; border-collapse: collapse; font-family: "Avenir Next","Inter", "Helvetica Neue", Arial, sans-serif; font-size: 15px; }
.result-table th, .result-table td { padding: 8px 14px; text-align: center; border: 1px solid #000; }
.result-table th:first-child, .result-table td:first-child { text-align: left; }
.result-table thead th { background: #000; color: #fff; }
.result-table tbody tr.is-ours { font-weight: 700; background: #f0ece0; }

/* VIDEO GALLERY (grid within the text column; at most 3 videos per row) */
.video-gallery-section { margin: 30px 0 40px; }
.video-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; padding: 0 0 10px; }
.video-grid .gallery-video { width: 100%; height: auto; }
.gallery-video { border-radius: 15px; box-shadow: 0 4px 12px rgba(0,0,0,.15); background: #fdfaf4; }
@media (max-width: 1000px) {
  .video-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .video-grid { grid-template-columns: 1fr; }
}

/* Per-video item with its own caption (caption wraps to the video's width) */
.video-item { display: flex; flex-direction: column; }
.video-item .item-caption { font-family: "Avenir Next","Inter", "Helvetica Neue", Arial, sans-serif; font-size: 13px; color: #555; margin: 8px 4px 0; line-height: 1.5; width: 0; min-width: calc(100% - 8px); }

/* Centered side-by-side layout for two-item video sections (no horizontal scroll) */
.video-row { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; margin: 0; padding: 0 0 10px; }
.video-row .video-item { flex: 1 1 0; min-width: 280px; }
.video-row .gallery-video { width: 100%; height: auto; }

/* Task-conditioning: "how it works" diagram on the left, rollout video on the right */
.conditioning-row { display: flex; gap: 32px; align-items: center; justify-content: center; margin: 12px 0 40px; }
.conditioning-row .cond-diagram { flex: 1 1 0; min-width: 0; margin: 0; }
.conditioning-row .cond-diagram img { width: 100%; height: auto; box-shadow: none; border-radius: 0; }
.conditioning-row .cond-diagram figcaption { font-family: "Avenir Next","Inter", "Helvetica Neue", Arial, sans-serif; font-size: 13px; color: #555; margin-top: 10px; line-height: 1.5; text-align: center; }
.conditioning-row .cond-video { flex: 1.25 1 0; min-width: 0; }
.conditioning-row .cond-video .gallery-video { width: 100%; height: auto; }

/* Result summary: use-case explainer video paired with quantitative evidence */
.result-summary-row {
  display: grid;
  grid-template-columns: minmax(320px, 1.05fr) minmax(280px, 0.95fr);
  gap: 28px;
  align-items: start;
  margin: 16px 0 24px;
}
.result-summary-row .usecase-video {
  min-width: 0;
  max-width: 640px;
}
.result-summary-row .figure-chart,
.result-summary-row .result-table-wrap {
  width: 100%;
  min-width: 0;
  max-width: 560px;
  margin: 0 auto;
}
.result-summary-row .result-table-wrap {
  max-width: 460px;
}
.result-summary-row .usecase-demo {
  width: 100%;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
}
.result-summary-row .figure-caption {
  margin-bottom: 0;
}
/* Stack only on genuinely small screens */
@media (max-width: 600px) {
  .conditioning-row { flex-direction: column; gap: 16px; }
}
@media (max-width: 860px) {
  .result-summary-row {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .result-summary-row .usecase-video,
  .result-summary-row .figure-chart,
  .result-summary-row .result-table-wrap {
    max-width: 100%;
  }
}

.section { font-size: 16px; line-height: 1.7; margin: 0 0 40px; text-align: left; }

/* FOOTER */
.footer { font-size: 14px; font-family: "Avenir Next","Inter", "Helvetica Neue", Arial, sans-serif; color: #666; margin: 80px 0 0; border-top: 1px solid #ccc; padding: 30px; text-align: center; }
.footer a { color: inherit; }

/* BIBTEX BOX */
.bibtex-code { background: rgba(80,80,80,.8); color: #f1f1f1; padding: 20px; border-radius: 8px; max-width: 1280px; margin: 20px auto 0; font-size: 14px; box-sizing: border-box; }
.bibtex-title { font-family: 'Courier New', Courier, monospace; font-weight: 700; font-size: 1.15em; margin: 0 0 10px; color: #f1f1f1; }
.bibtex-code pre { white-space: pre-wrap; overflow-wrap: break-word; margin: 0; }
.bibtex-code code { font-family: 'Courier New', Courier, monospace; overflow-wrap: break-word; }

/* Scroll indicator arrow */
.scroll-indicator {
  position: absolute;
  bottom: 30px;
  right: 30px;
  z-index: 10;
  color: white;
  font-size: 64px;
  animation: bounce 2s infinite;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}
.scroll-indicator:hover { opacity: 1; }

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
  60% { transform: translateY(-5px); }
}

@media (max-width: 700px) {
  .section { font-size: 17px; }
  .quick-links a { margin: 0 14px; }
}
