.valley-intro {
  --valley-ease: cubic-bezier(.36,.06,.18,1);
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  isolation: isolate;
  background: #080812 url('night-valley.webp') center / cover;
  color: #f5efe2;
}

.valley-intro::backdrop { background: transparent; }

.valley-scene, .valley-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.valley-skip {
  position: absolute;
  top: max(18px, env(safe-area-inset-top));
  right: max(22px, env(safe-area-inset-right));
  z-index: 1;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid #f5efe2;
  border-radius: 100px;
  color: #f5efe2;
  background: #100a1de8;
  font-size: 12px;
}

.valley-intro[data-closing] { pointer-events: none; }
.valley-intro[data-closing="skip"] { animation: valley-skip 300ms ease both; }
.valley-intro[data-closing="enter"] { animation: valley-handoff 1000ms linear both; }

.valley-intro[data-closing="enter"] .valley-scene {
  transform-origin: 50% 65%;
  animation: valley-approach 1000ms var(--valley-ease) both;
}

.valley-intro[data-closing="enter"]::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 66%, #c3a8e7, transparent 64%),
    linear-gradient(150deg, #674c94, var(--bg, #f6f5f9) 85%);
  animation: valley-mist 1000ms ease-in-out both;
}

@keyframes valley-skip { to { opacity: 0; } }
@keyframes valley-approach { to { transform: scale(1.20); } }
@keyframes valley-mist {
  0%, 16% { opacity: 0; }
  66%, 100% { opacity: .88; }
}
@keyframes valley-handoff {
  0%, 22% { opacity: 1; }
  55% { opacity: .60; }
  100% { opacity: 0; }
}

html:has(.valley-intro[open][data-closing="enter"]) #home :is(.intro, .reel, .top, .foot, .index) {
  animation: valley-home-reveal 820ms ease-out 120ms both;
}
@keyframes valley-home-reveal {
  from { opacity: 0; translate: 0 18px; }
  to { opacity: 1; translate: 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  .valley-intro, .valley-intro .valley-scene, .valley-intro::after {
    animation: none !important;
  }
}
