/* Homepage-only hand-off. The original header and other pages stay independent. */
.home-header-page {
  --header-offset: 0px;
}

/* Preserve exactly the height previously supplied by .header[hidden] ~ .film-hero. */
.home-header-page .film-hero {
  min-height: max(650px, 100svh);
}

.home-header.header {
  --card: #151a23;
  --text: #e8edf5;
  --muted: #a2adbd;
  --line: #303742;
  --header-fill: rgba(9, 12, 17, .88);
  --header-border: rgba(255, 255, 255, .1);
  position: fixed;
  inset: 0 0 auto;
  z-index: 1000;
  width: 100%;
  background: var(--header-fill);
  border-bottom: 1px solid var(--header-border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .15);
  opacity: var(--home-header-reveal, 0);
  visibility: hidden;
  pointer-events: none;
  transition: none;
}

.home-header.is-visible {
  visibility: visible;
}

.home-header[data-header-active] {
  pointer-events: auto;
}

.home-header-page .home-header .header-row {
  min-height: 56px;
  padding-block: 6px;
  transition: none;
}

.home-header-page .home-header .logo {
  width: auto;
  height: 40px;
  max-height: none;
  transition: none;
}

.home-header[data-logo-flying] .logo,
.home-header-page .film-hero__return-logo[data-header-logo-away] {
  visibility: hidden;
}

.home-header-logo {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1001;
  display: block;
  max-width: none;
  height: auto;
  pointer-events: none;
  transform-origin: top left;
  will-change: transform;
}

.home-header-logo[hidden] {
  display: none;
}

.home-nav-skip {
  position: fixed;
  top: 10px;
  left: 16px;
  z-index: 1100;
  padding: 10px 16px;
  border: 1px solid #df353b;
  border-radius: 8px;
  background: #090c11;
  color: #fff;
  font-weight: 700;
  transform: translateY(calc(-100% - 20px));
}

.home-nav-skip:focus {
  transform: none;
}

/* Hand-inked red cue that hands the hero off to the page content. */
.film-hero__scroll-cue {
  position: absolute;
  right: clamp(18px, 3.2vw, 52px);
  bottom: clamp(20px, 3.5vh, 36px);
  z-index: 12;
  display: block;
  width: clamp(48px, 4.2vw, 60px);
  aspect-ratio: 296 / 671;
  opacity: 0;
  visibility: hidden;
}

.film-hero__scroll-cue img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: filter .2s ease;
}

.film-hero[data-hero-settled] .film-hero__scroll-cue {
  animation: film-scroll-cue-reveal .45s ease-out both;
}

.film-hero[data-hero-settled] .film-hero__scroll-cue img {
  animation: film-scroll-cue-bob 1.8s ease-in-out .45s infinite;
}

.film-hero__scroll-cue:hover img,
.film-hero__scroll-cue:focus-visible img {
  filter: brightness(1.16);
}

.film-hero__scroll-cue:focus-visible {
  outline: 2px solid #ff5360;
  outline-offset: 5px;
}

@keyframes film-scroll-cue-reveal {
  from {
    opacity: 0;
    visibility: hidden;
  }

  to {
    opacity: 1;
    visibility: visible;
  }
}

@keyframes film-scroll-cue-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(7px); }
}

@media (max-width: 768px) {
  .home-header .main-nav__panel {
    max-height: calc(100dvh - 80px);
    overflow-y: auto;
    overscroll-behavior: contain;
    /* Visibility must switch immediately so the existing menu can focus a link. */
    transition: opacity .2s ease, transform .2s ease;
  }
}

@media (max-width: 425px) {
  .home-header-page .home-header .header-row {
    min-height: 52px;
    gap: 12px;
  }

  .home-header-page .home-header .logo {
    height: 34px;
  }

  .film-hero__scroll-cue {
    right: 16px;
    bottom: 16px;
    width: 46px;
  }
}

@media (max-width: 360px) {
  .home-header-page .home-header .logo {
    height: 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-header *,
  .home-header *::before,
  .home-header *::after {
    transition: none !important;
    animation: none !important;
  }

  .film-hero[data-hero-settled] .film-hero__scroll-cue {
    opacity: 1;
    visibility: visible;
    animation: none;
  }

  .film-hero__scroll-cue img {
    animation: none;
  }
}
