/* ==== Gaussians on Fire — project page styles ==== */

/* Fonts follow the Nerfies template: Noto Sans for body, Google Sans for
   headings/authors. (Castoro is loaded by the template but left unused.) */
body {
  font-family: 'Noto Sans', sans-serif;
}

.publication-title {
  font-family: 'Google Sans', sans-serif;
}

.publication-authors {
  font-family: 'Google Sans', sans-serif;
}

.publication-authors,
.publication-venue {
  margin-top: 1rem;
}

.publication-authors .author-block {
  margin-right: 0.5rem;
  white-space: nowrap;
}

.publication-venue {
  color: #555;
  font-weight: bold;
}

.publication-links {
  margin-top: 1.5rem;
}

.publication-links .link-block {
  display: inline-block;
  margin: 0.25rem;
}

/* Actions that aren't available yet */
.button.is-coming-soon {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.coming-soon-note {
  margin-top: 0.75rem;
  color: #888;
  font-style: italic;
  font-size: 0.9rem;
}

.teaser {
  font-family: 'Google Sans', sans-serif;
  padding-top: 0;
}

.teaser .hero-body {
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.teaser-video {
  display: block;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  aspect-ratio: 16 / 9;          /* reserve space before the clip loads */
  background: #fff;
  border-radius: 8px;
}

/* Placeholder boxes for not-yet-added content. Remove as sections are filled. */
.placeholder-box {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  border: 2px dashed #c0c0c0;
  border-radius: 8px;
  color: #909090;
  font-style: italic;
  background: #fafafa;
}

/* Responsive 16:9 embed (e.g. Bunny Stream iframe) — mirrors .teaser-video. */
.video-embed {
  position: relative;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
}
.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.figure-block {
  margin: 0;
}
.figure-block img {
  display: block;
  width: 100%;
  max-width: 920px;
  height: auto;
  margin: 0 auto;
}

/* ==== Baseline comparison ==== */
.comparison-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem 2.5rem;
  margin: 0.5rem 0 1.75rem;
}

.comparison-controls .control-group {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.comparison-controls .control-label {
  font-family: 'Google Sans', sans-serif;
  font-weight: 600;
  color: #555;
}

.comparison-controls .buttons {
  margin-bottom: 0;
}
.comparison-controls .buttons .button {
  margin-bottom: 0;
}

.comparison-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.comparison-item {
  flex: 1 1 240px;
  max-width: 320px;
  margin: 0;
}

.comparison-item video {
  display: block;
  width: 100%;
  aspect-ratio: 360 / 640;          /* reserve space before the clip loads */
  background: #111;
  border-radius: 8px;
  border: 2px solid transparent;
  object-fit: cover;
}

.comparison-item figcaption {
  font-family: 'Google Sans', sans-serif;
  font-size: 0.9rem;
  margin-top: 0.45rem;
  color: #363636;
}

.comparison-item figcaption .venue {
  color: #888;
  font-size: 0.78em;
}

/* Highlight our method */
.comparison-item.is-ours video {
  border-color: #ff6a00;
  box-shadow: 0 0 0 1px #ff6a00, 0 4px 14px rgba(255, 106, 0, 0.28);
}

.comparison-item.is-ours figcaption {
  color: #ff6a00;
  font-weight: 700;
}

@media (max-width: 768px) {
  .comparison-item { flex-basis: 46%; }
}

/* ==== Dataset gallery (thumbnail wall + lightbox) ==== */
.dataset-intro-todo {
  color: #b06a00;
}

.dataset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 0.6rem;
  margin-top: 1rem;
}

.dataset-thumb {
  position: relative;
  display: block;
  padding: 0;
  margin: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: #111;
  aspect-ratio: 480 / 854;          /* portrait clips */
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.dataset-thumb video,
.dataset-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dataset-thumb:hover,
.dataset-thumb:focus-visible {
  transform: translateY(-2px);
  border-color: #ff6a00;
  box-shadow: 0 4px 14px rgba(255, 106, 0, 0.28);
  outline: none;
}

.dataset-thumb-label {
  position: absolute;
  left: 6px;
  bottom: 6px;
  z-index: 1;
  font-family: 'Google Sans', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  padding: 1px 7px;
  border-radius: 999px;
  pointer-events: none;
}

/* Lightbox overlay */
.dataset-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.9);
  padding: 1rem;
  /* Triptych width — shared so the nav arrows can track its edges exactly. */
  --trip-w: min(96vw, calc(72vh * 0.5625 * 3 + 1.2rem));
}
.dataset-lightbox[aria-hidden="true"] {
  display: none;
}

.dataset-lb-body {
  text-align: center;
}

.dataset-triptych {
  position: relative;   /* anchors the buffering spinner overlay */
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  align-items: flex-start;
  /* Width is whichever is smaller: the viewport, or the width three 72vh-tall
     portrait clips need — so the triptych never overflows in either axis. */
  width: var(--trip-w);
  margin: 0 auto;
}

.dataset-triptych figure {
  position: relative;   /* anchors the per-view loading placeholder */
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
}

.dataset-triptych video {
  display: block;
  width: 100%;
  aspect-ratio: 480 / 854;
  object-fit: cover;
  background: #000;
  border-radius: 6px;
  transition: opacity 0.2s ease;
}

/* Buffering state (class toggled from index.js): the videos are fully hidden
   behind placeholder tiles until all three are playing, then everything
   crossfades at once — no per-view popping as frames trickle in. */
.dataset-lightbox.is-loading .dataset-triptych video {
  opacity: 0;
}

/* Placeholder tile matching the video box (same width/aspect/radius). */
.dataset-triptych figure::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  aspect-ratio: 480 / 854;
  border-radius: 6px;
  background: #161616;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.dataset-lightbox.is-loading .dataset-triptych figure::before {
  opacity: 1;
  animation: dataset-lb-pulse 1.4s ease-in-out infinite;
}
@keyframes dataset-lb-pulse {
  0%, 100% { background: #161616; }
  50% { background: #262626; }
}

.dataset-lb-loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s;
}
.dataset-lightbox.is-loading .dataset-lb-loader {
  opacity: 1;
  visibility: visible;
}
.dataset-lb-loader::after {
  content: "";
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: rgba(255, 106, 0, 0.9);
  animation: dataset-lb-spin 0.8s linear infinite;
}
@keyframes dataset-lb-spin {
  to { transform: rotate(360deg); }
}

.dataset-triptych figcaption {
  font-family: 'Google Sans', sans-serif;
  font-size: 0.8rem;
  color: #cfcfcf;
  margin-top: 0.35rem;
}

.dataset-lb-caption {
  font-family: 'Google Sans', sans-serif;
  color: #fff;
  margin-top: 0.9rem;
  font-size: 0.95rem;
}

.dataset-lb-close,
.dataset-lb-nav {
  position: absolute;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: none;
  cursor: pointer;
  border-radius: 999px;
  line-height: 1;
  transition: background 0.15s ease;
}
.dataset-lb-close:hover,
.dataset-lb-nav:hover {
  background: rgba(255, 106, 0, 0.85);
}

.dataset-lb-close {
  top: 1rem;
  right: 1.25rem;
  width: 2.4rem;
  height: 2.4rem;
  font-size: 1.6rem;
}

.dataset-lb-nav {
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;                       /* sit above the triptych videos */
  width: 2.8rem;
  height: 2.8rem;
  font-size: 1.3rem;
  background: rgba(0, 0, 0, 0.5);   /* readable when overlaid on a bright clip */
}
/* Anchor the arrows to the triptych's edges, tucked fully inside with a margin,
   so they never straddle the border no matter how wide the triptych is. */
.dataset-lb-nav.is-prev { left: calc((100vw - var(--trip-w)) / 2 + 0.75rem); }
.dataset-lb-nav.is-next { right: calc((100vw - var(--trip-w)) / 2 + 0.75rem); }

@media (max-width: 600px) {
  .dataset-lb-nav { width: 2.2rem; height: 2.2rem; font-size: 1rem; }
  .dataset-triptych figcaption { font-size: 0.7rem; }
}

.footer {
  padding-top: 2rem;
  padding-bottom: 2rem;
}
