.hero-film,
.hero-film-art,
.hero-film video,
.hero-film-blending::after {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-film {
  overflow: hidden;
  isolation: isolate;
}

.hero-film-art {
  background: #21140e url('assets/hero-intro/poster.webp') center / cover no-repeat;
  opacity: min(1, calc(var(--film-opacity, 1) / .45));
}

.hero-film-blending .hero-film-art {
  mask-image: radial-gradient(ellipse 85% 80% at 50% 76%, transparent var(--film-mask-inner, -75%), #000 var(--film-mask-outer, -26%));
}

.hero-intro-playing .hero-film-art { background-image: url('assets/hero-intro/seal.webp'); }

.hero-film video {
  display: block;
  object-fit: cover;
}

.hero-film-blending video {
  transform-origin: 50% 72%;
  transform: translateY(var(--film-lift, 0%)) scale(var(--film-zoom, 1));
}

.hero-film-blending::after {
  content: '';
  opacity: var(--film-glow, 0);
  background: radial-gradient(ellipse at 50% 76%, #ffa343, transparent 63%);
  mix-blend-mode: screen;
}

.hero-film[hidden],
.hero-film video[hidden],
.hero-film-controls[hidden],
.hero-film-start[hidden],
.hero-epilogue[hidden],
.hero-film-logo { display: none; }

.hero-cinema .crater-opening {
  justify-content: center;
  align-items: start;
  padding-top: max(86px, 13svh);
  text-align: center;
}

.hero-cinema .crater-opening::before {
  inset: 0;
  width: 100%;
  height: 54%;
  opacity: calc(1 - var(--hero-exit, 0));
  background: radial-gradient(ellipse at 50% 26%, rgb(19 12 9 / 59%), transparent 72%);
}

.hero-cinema .hero-film-logo {
  display: block;
  width: clamp(30px, 4.4svh, 44px);
  height: auto;
  margin: 0 auto 6px;
  filter: drop-shadow(0 3px 6px #140604);
}

.hero-cinema .crater-product {
  margin-bottom: 11px;
  font-size: 11px;
}

.hero-cinema .crater-copy {
  opacity: calc(1 - var(--hero-exit, 0));
  transform: translateY(calc(-26px * var(--hero-exit, 0)));
}

.hero-cinema.hero-copy-revealed .crater-copy-content {
  transition: opacity 550ms ease;
}

.hero-cinema .crater-copy h1 {
  font-size: clamp(28px, min(6.2vw, 9.7svh), 104px);
  text-shadow: 0 4px 22px rgb(20 10 5 / 56%);
}

.hero-cinema .crater-copy h1 br { display: none; }
.hero-cinema .crater-intro { margin: 16px auto 12px; max-width: 58ch; text-wrap: balance; }
.hero-cinema .crater-actions { justify-content: center; }

.hero-cinema-pending .crater-copy,
.hero-intro-playing:not(.hero-copy-revealed) .crater-copy-content {
  opacity: 0;
}

.hero-cinema-pending .crater-copy,
.hero-intro-playing .redx-header { visibility: hidden; }

.hero-epilogue {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: calc(1 - var(--hero-exit, 0));
  pointer-events: none;
}

.hero-epilogue p {
  width: 100%;
  padding: .85em 16px;
  color: #ffe5bd;
  background: radial-gradient(ellipse at center, rgb(19 10 7 / 86%) 0%, rgb(19 10 7 / 47%) 43%, transparent 72%);
  font: 500 clamp(28px, 5.2vw, 72px)/1.08 Georgia, serif;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-shadow: 0 2px 18px #160903, 0 1px 5px #160903;
  animation: hero-epilogue-reveal 2850ms both;
}

@keyframes hero-epilogue-reveal {
  0% { opacity: 0; transform: translateY(7px); }
  16%, 72% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-5px); }
}

.hero-film-controls {
  position: absolute;
  inset: auto var(--crater-gutter) max(24px, calc(env(safe-area-inset-bottom) + 12px));
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  pointer-events: none;
}

.hero-film-controls button {
  pointer-events: auto;
  appearance: none;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid #e8b78968;
  border-radius: 5px;
  background: rgb(26 15 12 / 86%);
  color: #fff0df;
  font: 600 13px/1 var(--font-body);
}

.hero-film-controls button:hover { border-color: #ffd3a8; background: #301a11; }
.hero-film-controls button span { margin-left: 3px; color: #ffd09d; }

.hero-film-controls:has(.hero-film-start:not([hidden])) {
  inset: 50% var(--crater-gutter) auto;
  transform: translateY(-50%);
  flex-wrap: nowrap;
  justify-content: center;
}

.hero-film-controls:has(.hero-film-start:not([hidden])) button {
  min-height: 50px;
  padding-inline: 16px;
  white-space: nowrap;
}

.hero-film-controls .hero-film-start {
  border-color: #e9ad77;
  box-shadow: 0 4px 24px #140903ac;
}

.hero-film-controls .hero-film-start span { margin: 0 5px 0 0; }

.hero-film-controls:has(.hero-film-start:not([hidden])) .hero-film-progress { display: none; }

.hero-film-progress {
  flex-basis: 100%;
  height: 2px;
  background: #e8b78945;
}

.hero-film-progress::before {
  content: '';
  display: block;
  height: 100%;
  background: #ffd09d;
  transform: scaleX(var(--intro-progress, 0));
  transform-origin: left;
}

@media (max-width: 720px) {
  .hero-cinema .crater-opening { padding-top: max(77px, 11svh); }
  .hero-cinema .crater-copy h1 { font-size: clamp(27px, 7.8vw, 56px); }
  .hero-cinema .crater-intro { max-width: 32ch; font-size: 15px; }
  .hero-cinema .crater-actions { gap: 4px 12px; }
  .hero-cinema .crater-actions a { font-size: 13px; }
  .hero-film-art, .hero-film-loop { background-position: 28% center; object-position: 28% center; }
  .hero-intro-playing .hero-film-art, .hero-film-intro { background-position: center; object-position: center; }
}

@media (max-height: 580px) and (orientation: landscape) {
  .hero-cinema .crater-opening { min-height: 0; padding-top: 77px; }
  .hero-cinema .crater-intro { margin-block: 8px; }
}
