/* Space-time, portal 2, the Afro EDM valley and Trib3's door. Two sticky
   stages, each holding for 1.2 screens (A: through the portal, B: into the
   door). B overlaps A by one screen so it pins the moment A lets go, and the
   one canvas moves across. Everything else runs on its own clock. */

#spacetime { background: #030207; }
#spacetime .st-run { position: relative; height: 220vh; }
#spacetime .st-run--b { margin-top: -100vh; }
#spacetime .st-stage { position: sticky; top: 0; height: 100vh; overflow: hidden; }
#spacetime .st-run--a .st-stage { z-index: 2; }
#spacetime .st-run--b .st-stage { z-index: 1; }
#spacetime .st-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

/* their line, the room's sign */
#spacetime .st-sign {
  position: absolute; left: var(--pad); bottom: clamp(36px, 9vh, 100px); margin: 0; max-width: 9ch; text-transform: uppercase;
  font-family: var(--display); font-weight: 900; font-size: clamp(36px, 5.6vw, 96px); line-height: 0.94; letter-spacing: -0.015em; word-spacing: 0.08em;
  color: transparent; pointer-events: none;
}
/* the line is drawn in the warp's light (spacetime-sign.js) where these words lie */
#spacetime .st-sign span { display: inline-block; }

/* the valley's title, set like the tables room's: pinned in the stage with the
   canvas, on a soft pool of shade with no edge, rising in when the valley settles */
#spacetime .st-policy { position: absolute; z-index: 1; inset: 0; pointer-events: none; will-change: opacity, transform; }
#spacetime .st-policy__shade {
  position: absolute; inset: -10%;
  background: radial-gradient(ellipse 46% 44% at 26% 76%, rgba(6,3,9,0.7) 0%, rgba(6,3,9,0.52) 34%, rgba(6,3,9,0.2) 66%, rgba(6,3,9,0) 100%);
  opacity: 0; transition: opacity 0.9s cubic-bezier(.2,.7,.2,1);
}
#spacetime.is-valley .st-policy__shade { opacity: 1; }
#spacetime .st-policy__copy {
  position: absolute; left: var(--pad); bottom: clamp(48px, 11vh, 120px);
  display: flex; flex-direction: column; align-items: flex-start; max-width: min(46vw, 640px);
}
#spacetime .st-policy__name {
  margin: 0; font-family: var(--display); font-weight: 900; font-stretch: 125%; text-transform: uppercase;
  font-size: clamp(56px, 7vw, 120px); line-height: 0.88; letter-spacing: -0.03em; color: var(--ink);
}
#spacetime .st-policy__sounds {
  margin: clamp(14px, 2.2vh, 24px) 0 0; font-family: var(--display); font-weight: 700; font-stretch: 125%;
  font-size: clamp(16px, 1.45vw, 22px); line-height: 1.35; letter-spacing: 0.01em; color: var(--flame);
}
#spacetime .st-policy__sounds span { white-space: nowrap; }
#spacetime .st-policy__copy > * { opacity: 0; transform: translateY(18px); transition: opacity 0.9s cubic-bezier(.2,.7,.2,1), transform 0.9s cubic-bezier(.2,.7,.2,1); }
#spacetime.is-valley .st-policy__copy > * { opacity: 1; transform: none; }
#spacetime.is-valley .st-policy__copy > :nth-child(2) { transition-delay: 0.12s; }

@media (max-width: 759px) {
  #spacetime .st-policy__shade { background: radial-gradient(ellipse 72% 30% at 40% 14%, rgba(6,3,9,0.64) 0%, rgba(6,3,9,0.48) 38%, rgba(6,3,9,0.16) 70%, rgba(6,3,9,0) 100%); }
  #spacetime .st-policy__copy { left: 20px; right: 20px; top: 56px; bottom: auto; max-width: none; }
  #spacetime .st-policy__name { font-size: min(14.5vw, 76px); }
  #spacetime .st-policy__sounds { font-size: 15px; margin-top: 12px; text-wrap: balance; }
  #spacetime .st-sign { top: clamp(64px, 10vh, 110px); bottom: auto; font-size: clamp(42px, 12.6vw, 64px); }
}

@media (prefers-reduced-motion: reduce) {
  #spacetime .st-run { height: 200vh; }
  #spacetime .st-policy__copy > *, #spacetime .st-policy__shade { transition: none; }
}
