/* Branch page entry + media placeholders */

body.branch-home.is-loading {
  overflow: hidden;
}

.page-loader {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-content: center;
  background: #0a0a0a;
  transition: opacity .45s ease, visibility .45s ease;
}

.page-loader.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.scene-mark {
  width: min(148px, 42vw);
  height: auto;
  overflow: visible;
  animation: mark-breathe 4s ease-in-out infinite;
}

.scene-mark .wave {
  animation: wave-rise 4s cubic-bezier(.4, 0, .2, 1) infinite;
}

.scene-mark .wave-b { animation-delay: -1.34s; }
.scene-mark .wave-c { animation-delay: -2.67s; }

.scene-mark .mark-stroke {
  animation: mark-glow 4s cubic-bezier(.4, 0, .2, 1) infinite;
  filter: blur(2px);
}

@keyframes wave-rise {
  0% { transform: translateY(120px); }
  45% { transform: translateY(-150px); }
  55% { transform: translateY(-150px); }
  100% { transform: translateY(120px); }
}

@keyframes mark-glow {
  0%, 100% { stroke-opacity: .55; }
  45%, 55% { stroke-opacity: 0; }
}

@keyframes mark-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.035); }
}

/* Image placeholders */
.media-frame {
  position: relative;
  display: block;
  overflow: hidden;
  background: #17191e;
}

.media-frame > picture,
.media-frame > img {
  display: block;
  width: 100%;
  height: 100%;
}

.media-shimmer {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(100deg, transparent 20%, rgb(61 218 204 / 10%) 45%, transparent 70%),
    linear-gradient(180deg, #1a1d24, #12141a 55%, #1a1d24);
  background-size: 200% 100%, 100% 100%;
  animation: mediaShimmer 1.25s linear infinite;
  pointer-events: none;
  transition: opacity .35s ease;
}

.media-frame.is-loaded .media-shimmer {
  opacity: 0;
}

.media-img {
  opacity: 0;
  transform: scale(1.02);
  transition: opacity .4s ease, transform .45s ease;
}

.media-frame.is-loaded .media-img {
  opacity: 1;
  transform: none;
}

@keyframes mediaShimmer {
  0% { background-position: 100% 0, 0 0; }
  100% { background-position: -100% 0, 0 0; }
}

.hero-backdrop .media-frame {
  width: 100%;
  max-width: none;
  height: auto;
  overflow: hidden;
  background: #17191e;
  border-radius: 12px;
}

.hero-backdrop .media-frame > picture,
.hero-backdrop .media-img {
  width: 100%;
  height: auto;
  max-width: none;
}

.hero--overlay .hero-art.media-img,
.hero--overlay .media-frame .hero-art {
  display: block;
  width: 100%;
  height: auto;
  max-width: none;
  max-height: none;
  object-fit: cover;
}

.hero-film-rail .media-frame {
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 480 / 686;
  border: 2px solid transparent;
  box-shadow: none;
  transition: border-color .2s ease;
}

.hero-film-rail .media-frame .rail-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: auto;
  border-radius: 0;
  outline: none;
  box-shadow: none;
}

.hero-film-rail > button.active .media-frame {
  outline: none;
  border-color: var(--teal-text);
  box-shadow: none;
}

.hero-film-rail > button.active .media-frame .rail-img {
  box-shadow: none;
}

.film-row-poster .media-frame {
  border-radius: 10px;
  aspect-ratio: 480 / 686;
}

.film-row-poster .media-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: auto;
}

@media (max-width: 760px) {
  .hero-film-rail .media-frame { aspect-ratio: 16 / 9; }
  .hero-film-rail .media-frame .rail-img {
    object-fit: contain;
    background: #000;
  }

  .hero--overlay .hero-art.media-img,
  .hero--overlay .media-frame .hero-art {
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: cover;
  }
}

@media (min-width: 761px) {
  .hero-backdrop .media-frame {
    aspect-ratio: 3 / 1;
  }

  .hero-backdrop .media-frame > picture,
  .hero-backdrop .media-img,
  .hero--overlay .hero-art.media-img,
  .hero--overlay .media-frame .hero-art {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-height: none;
    object-fit: cover;
    object-position: center center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scene-mark,
  .scene-mark .wave,
  .scene-mark .mark-stroke,
  .media-shimmer {
    animation: none;
  }

  .media-img,
  .page-loader {
    transition: none;
  }
}
