/* ═══════════════════════════════════════════════════════════════════
   STM TRAVEL — CINEMATIC WEBGL PORTAL CSS
   ═══════════════════════════════════════════════════════════════════ */

/* Prevent scroll while portal is active */
body.portal-active {
  overflow: hidden;
  height: 100vh;
}

#cinematic-portal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background-color: #000000;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  /* Hardware acceleration */
  transform: translateZ(0);
  will-change: opacity, transform;
  transition: opacity 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Fading out the entire portal container when done */
#cinematic-portal.portal-finished {
  opacity: 0;
  pointer-events: none;
}

/* WebGL Canvas */
#portal-webgl-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  outline: none;
  opacity: 0; /* Hidden until Three.js boots */
  transition: opacity 0.8s ease;
  pointer-events: none;
}

#portal-webgl-canvas.webgl-ready {
  opacity: 1;
}

/* Seamless Transition Flash (The Sunlight) */
#portal-flash-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, #ffffff 0%, rgba(255,230,180,0.8) 40%, rgba(0,0,0,0) 100%);
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: screen;
  z-index: 10;
  will-change: opacity;
}

/* Tiny spark fallback (while downloading Three.js/GSAP) */
#portal-spark {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #c9a44a;
  box-shadow: 0 0 15px 4px rgba(201,164,74,0.8),
              0 0 30px 10px rgba(0,201,184,0.4);
  animation: sparkPulse 1.5s ease-in-out infinite;
  transition: opacity 0.3s ease;
}

#portal-spark.hidden {
  opacity: 0;
}

@keyframes sparkPulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50%       { transform: scale(1.5); opacity: 1; }
}

/* Luxury Loading Messages */
#portal-message {
  position: absolute;
  bottom: 8%;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  opacity: 0;
  transition: opacity 0.6s ease;
  text-align: center;
  z-index: 5;
}

#portal-message.msg-visible {
  opacity: 1;
}
