:root {
  --cinema-ease: cubic-bezier(.16, 1, .3, 1);
}

.hero {
  isolation: isolate;
}

.hero-cinema {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.hero-cinema__aperture,
.hero-cinema__beam,
.hero-cinema__scan,
.hero-cinema__frame {
  position: absolute;
  pointer-events: none;
}

.hero-cinema__aperture {
  inset: -18%;
  opacity: .54;
  background:
    conic-gradient(from 192deg at 74% 42%, transparent 0 22deg, rgba(255,255,255,.09) 26deg, rgba(230,25,25,.2) 31deg, transparent 39deg 360deg);
  mix-blend-mode: screen;
  transform-origin: 74% 42%;
}

.hero-cinema__beam {
  width: min(46vw, 760px);
  height: 150%;
  right: 2%;
  top: -28%;
  opacity: .22;
  background: linear-gradient(90deg, transparent, rgba(236,236,234,.28) 48%, rgba(230,25,25,.18) 52%, transparent);
  filter: blur(18px);
  mix-blend-mode: screen;
  transform: rotate(15deg) translate3d(38%, 0, 0);
}

.hero-cinema__scan {
  inset: 0;
  opacity: .28;
  background: linear-gradient(180deg, transparent 0 48%, rgba(255,255,255,.14) 49.5%, rgba(230,25,25,.25) 50%, transparent 52%);
  mix-blend-mode: screen;
  transform: translate3d(0, -72%, 0);
}

.hero-cinema__frame {
  inset: 18px;
  border: 1px solid rgba(236,236,234,.1);
  border-top-color: rgba(236,236,234,.24);
  opacity: .72;
  clip-path: polygon(0 0, 16% 0, 16% 1px, 84% 1px, 84% 0, 100% 0, 100% 100%, 84% 100%, 84% calc(100% - 1px), 16% calc(100% - 1px), 16% 100%, 0 100%);
}

.hero-heading-line {
  display: block;
  width: fit-content;
  transform-origin: 0 100%;
}

.hero-heading-line:last-child {
  position: relative;
}

.hero-heading-line:last-child::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: .02em;
  height: .055em;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  animation: heroLineCharge 680ms var(--cinema-ease) 1500ms forwards;
  box-shadow: 0 0 22px rgba(230,25,25,.62);
}

.cinematic-motion .hero-logo-plate,
.cinematic-motion .system-strip span,
.cinematic-motion h1,
.cinematic-motion .hero .lead,
.cinematic-motion .hero-actions,
.cinematic-motion .hero-launches {
  animation: none !important;
}

.cinematic-motion .boot-sequence,
.cinematic-motion .boot-core img,
.cinematic-motion .boot-core strong {
  animation: none !important;
}

.cinematic-motion .hero::before {
  animation-duration: 8.8s;
  animation-delay: 2.4s;
}

.menu-toggle {
  position: relative;
  z-index: 2;
  cursor: pointer;
}

.menu-toggle span {
  transition: transform 220ms var(--cinema-ease), opacity 140ms ease-out;
  transform-origin: center;
}

.menu-toggle[aria-expanded="true"] span:first-child {
  transform: translateY(3.5px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span:last-child {
  transform: translateY(-3.5px) rotate(-45deg);
}

@keyframes heroLineCharge {
  to { transform: scaleX(1); }
}

@media (min-width: 861px) and (max-height: 950px) {
  .hero {
    min-height: 100dvh;
  }

  .hero-logo-plate {
    width: 104px;
    margin-bottom: 14px;
  }

  .hero-kicker {
    margin-bottom: 14px;
    padding-block: 7px;
  }

  .hero h1 {
    font-size: clamp(4rem, 6.1vw, 5.8rem);
    line-height: .84;
  }

  .hero .lead {
    margin-top: 14px;
    font-size: 1rem;
    line-height: 1.48;
  }

  .hero-actions {
    margin-top: 16px;
  }

  .hero-launches {
    margin-top: 14px;
  }

  .hero-machine {
    min-height: 460px;
  }
}

@media (max-width: 860px) {
  .site-header,
  html.am-ambient-ready body > .site-header {
    z-index: 140;
  }

  .site-header .nav {
    position: relative;
    z-index: 141;
  }

  .nav-links,
  .nav-links.is-open {
    position: absolute;
    z-index: 142;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    width: 100%;
    max-height: min(70dvh, 520px);
    overflow-y: auto;
    overscroll-behavior: contain;
    transform-origin: top right;
  }

  .nav-links.is-open {
    display: grid;
  }

  .nav-links a,
  .nav-links .store-link {
    min-height: 46px;
  }

  body.nav-open::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 130;
    opacity: 1;
    background: rgba(2,3,4,.64);
    backdrop-filter: blur(5px);
    pointer-events: none;
  }

  .hero-cinema__frame {
    inset: 8px;
  }

  .hero-cinema__beam {
    width: 74vw;
    right: -20%;
    opacity: .16;
  }

  .hero-cinema__aperture {
    inset: -8% -55%;
    opacity: .34;
  }
}

@media (max-width: 560px) {
  .nav-links,
  .nav-links.is-open {
    grid-template-columns: 1fr;
    gap: 2px;
    padding: 8px;
  }

  .nav-links a,
  .nav-links .store-link {
    justify-content: flex-start;
    padding-inline: 16px;
  }

  .hero-heading-line {
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-cinema__aperture,
  .hero-cinema__beam,
  .hero-cinema__scan,
  .hero-heading-line,
  .hero-heading-line::after {
    animation: none !important;
    transform: none !important;
  }
}
