body.app-cinematic-pending {
  overflow: hidden;
  background: #020205;
}

body.app-cinematic-pending > .system-gate {
  visibility: hidden;
  opacity: 0;
  transform: translate3d(0, 28px, 0) scale(0.985);
}

body.app-cinematic-handoff > .system-gate {
  visibility: visible;
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  transition:
    opacity 1.35s ease 180ms,
    transform 1.55s cubic-bezier(.18, .72, .24, 1) 120ms;
}

.app-opening-cinematic {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: grid;
  overflow: hidden;
  place-items: center;
  min-height: 100vh;
  min-height: 100svh;
  background:
    radial-gradient(circle at 50% 46%, rgba(118, 82, 42, 0.1), transparent 48%),
    #010103;
  color: #efe3c7;
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  transform-origin: 50% 52%;
}

.app-opening-cinematic[hidden] {
  display: none;
}

.app-opening-cinematic__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: 50% 50%;
  background: #010103;
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  transform-origin: 50% 48%;
}

.app-opening-cinematic__veil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.2), transparent 18%, transparent 74%, rgba(0, 0, 0, 0.5)),
    radial-gradient(circle at 50% 48%, transparent 48%, rgba(2, 1, 5, 0.44) 100%);
}

.app-opening-cinematic__status {
  position: absolute;
  right: 20px;
  bottom: calc(22px + env(safe-area-inset-bottom));
  left: 20px;
  margin: 0;
  color: rgba(235, 220, 188, 0.7);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  text-align: center;
  text-shadow: 0 0 12px rgba(229, 197, 128, 0.22);
  transition: opacity 500ms ease;
}

.app-opening-cinematic__skip {
  position: absolute;
  top: calc(18px + env(safe-area-inset-top));
  right: 18px;
  z-index: 2;
  min-width: 72px;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid rgba(229, 198, 128, 0.42);
  border-radius: 999px;
  background: rgba(5, 4, 9, 0.58);
  color: rgba(244, 229, 194, 0.88);
  font: 600 0.68rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.18em;
  opacity: 0;
  animation: app-opening-skip-arrive 600ms ease 1.2s 1 forwards;
  -webkit-tap-highlight-color: transparent;
}

.app-opening-cinematic__skip:focus-visible {
  outline: 2px solid #82e9e4;
  outline-offset: 3px;
}

.app-opening-cinematic--handoff {
  opacity: 0;
  transform: translate3d(0, -1.6%, 0) scale(1.025);
  transition:
    opacity 1.45s ease 120ms,
    transform 1.6s cubic-bezier(.18, .68, .22, 1);
}

.app-opening-cinematic--handoff .app-opening-cinematic__video {
  opacity: 0;
  transform: translate3d(0, -1.8%, 0) scale(1.045);
  transition:
    opacity 1.25s ease,
    transform 1.6s cubic-bezier(.18, .68, .22, 1);
}

.app-opening-cinematic--handoff .app-opening-cinematic__skip,
.app-opening-cinematic--handoff .app-opening-cinematic__status {
  opacity: 0;
  transition: opacity 320ms ease;
}

@keyframes app-opening-skip-arrive {
  to { opacity: 0.82; }
}

@media (min-width: 900px) {
  .app-opening-cinematic__video {
    width: min(100%, 920px);
    left: 50%;
    transform: translate3d(-50%, 0, 0);
  }

  .app-opening-cinematic--handoff .app-opening-cinematic__video {
    transform: translate3d(-50%, -1.8%, 0) scale(1.045);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.app-cinematic-handoff > .system-gate,
  .app-opening-cinematic,
  .app-opening-cinematic__video,
  .app-opening-cinematic__status,
  .app-opening-cinematic__skip {
    animation: none !important;
    transition: none !important;
  }
}
