/* Reveal complete decoded scenes, never partially received image rows. */
.ocean-scene > .scene-image,
.doorway-scene > .doorway-image {
  opacity: 0;
  transition: opacity 180ms ease;
}

.ocean-scene > .scene-image.scene-image-ready,
.doorway-scene > .doorway-image.scene-image-ready {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .ocean-scene > .scene-image,
  .doorway-scene > .doorway-image {
    transition: none;
  }
}

/* Keep the selected frontal view intact on phones and short landscape screens. */
.gallery-scene { min-height: 0; height: 100svh; height: 100dvh; }
.gallery-top { top: max(26px, env(safe-area-inset-top)); }
.gallery-caption { bottom: max(20px, calc(env(safe-area-inset-bottom) + 12px)); }
@media (max-width: 760px), (max-height: 500px) {
  .gallery-image { object-fit: contain; object-position: center; }
  .gallery-top { left: max(18px, env(safe-area-inset-left)); right: max(18px, env(safe-area-inset-right)); gap: 10px; }
  .gallery-brand span { max-width: 170px; white-space: normal; line-height: 1.5; }
  .gallery-nav { width: max-content; max-width: calc(100vw - 32px); box-sizing: border-box; gap: clamp(12px, 4vw, 24px); padding: 16px; }
  .gallery-nav a { font-size: 12px; }
  .gallery-caption { left: 18px; right: 18px; font-size: 8px; letter-spacing: 0; }
}
@media (max-height: 500px) {
  .gallery-top { top: max(12px, env(safe-area-inset-top)); }
  .gallery-heading { top: 21%; }
  .gallery-heading h1 { font-size: 25px; margin: 10px 0; }
  .gallery-nav { bottom: max(40px, calc(env(safe-area-inset-bottom) + 32px)); padding: 12px 22px; }
  .gallery-caption { bottom: max(10px, env(safe-area-inset-bottom)); }
}
