/**
 * RENALYTICA CINEMATIC ENTRANCE GATEWAY STYLES
 * Option B: Quantum Data Vortex & Hyper-Drive Reveal
 * 60-30-10 Chromatic Matrix: Obsidian Navy (#070A10), Momentum Orange (#FF5C00), Crisp White (#FFFFFF)
 */

/* 1. Body Scroll Lock when Entrance Stage is Active */
body.entrance-locked {
  overflow: hidden !important;
  height: 100vh !important;
  touch-action: none;
}

/* 2. Magnetic Cursor (Desktop) */
.gateway-cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 8px;
  height: 8px;
  background-color: #FF5C00;
  border-radius: 50%;
  pointer-events: none;
  z-index: 100003;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 14px rgba(255, 92, 0, 0.9);
  transition: width 0.25s ease, height 0.25s ease, opacity 0.3s ease;
}

.gateway-cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  width: 44px;
  height: 44px;
  border: 1.5px solid rgba(255, 92, 0, 0.55);
  border-radius: 50%;
  pointer-events: none;
  z-index: 100002;
  transform: translate(-50%, -50%);
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              height 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.3s ease,
              background-color 0.3s ease,
              opacity 0.3s ease;
}

body.gateway-hovering .gateway-cursor-dot {
  width: 0px;
  height: 0px;
  opacity: 0;
}

body.gateway-hovering .gateway-cursor-ring {
  width: 72px;
  height: 72px;
  background-color: rgba(255, 92, 0, 0.12);
  border-color: #FF5C00;
  box-shadow: 0 0 30px rgba(255, 92, 0, 0.5);
  backdrop-filter: blur(2px);
}

@media (hover: none) or (pointer: coarse) {
  .gateway-cursor-dot,
  .gateway-cursor-ring {
    display: none !important;
  }
}

/* 3. Fullscreen Entrance Stage */
#entrance-stage {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 99999;
  background: radial-gradient(circle at 50% 45%, #101b2b 0%, #070A10 65%, #030508 100%);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #F8FAFC;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              transform 1s cubic-bezier(0.4, 0, 0.2, 1);
}

#entrance-stage.stage-fading {
  opacity: 0;
  transform: scale(1.2);
  pointer-events: none;
}

#entrance-stage.stage-hidden {
  display: none !important;
}

/* 4. Canvas for Quantum Data Vortex Engine */
#vortex-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

/* 5. Cybernetic Grid & Noise Overlay */
.gateway-grid {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 60px 60px;
  background-position: center center;
  pointer-events: none;
  z-index: 5;
  opacity: 0.7;
}

.gateway-ambient-halo {
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(600px, 90vw);
  height: min(600px, 90vw);
  background: radial-gradient(circle, rgba(255, 92, 0, 0.24) 0%, rgba(255, 128, 0, 0.08) 45%, transparent 72%);
  border-radius: 50%;
  filter: blur(48px);
  pointer-events: none;
  z-index: 6;
  animation: gatewayBreathingHalo 4.5s ease-in-out infinite alternate;
}

@keyframes gatewayBreathingHalo {
  0% { transform: translate(-50%, -50%) scale(0.9); opacity: 0.65; }
  100% { transform: translate(-50%, -50%) scale(1.18); opacity: 0.95; }
}

/* 6. Centered Entrance Content Container */
.gateway-content {
  position: relative;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  user-select: none;
}

/* 7. Interactive Cardiac Heartbeat Logo Epicenter (The Portal Button) */
.gateway-logo-wrapper {
  position: relative;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  background: transparent;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  outline: none;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), filter 0.4s ease;
  will-change: transform;
  -webkit-tap-highlight-color: transparent;
}

.gateway-logo-wrapper:hover {
  transform: scale(1.06);
}

.gateway-logo-wrapper:active {
  transform: scale(0.95);
  transition-duration: 0.12s;
}

.gateway-logo-wrapper:focus-visible {
  outline: 2px solid rgba(255, 92, 0, 0.85);
  outline-offset: 12px;
}

/* Concentric Expanding Heartbeat Radar Waves */
.gateway-radar-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 92, 0, 0.7);
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.6);
  opacity: 0;
  animation: cardiacRadarPulse 2.8s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
}

.gateway-radar-ring.ring-2 {
  animation-delay: 0.85s;
}

.gateway-radar-ring.ring-3 {
  animation-delay: 1.7s;
  border-color: rgba(255, 255, 255, 0.6);
}

.gateway-logo-wrapper:hover .gateway-radar-ring {
  border-color: rgba(255, 92, 0, 0.95);
  filter: drop-shadow(0 0 12px rgba(255, 92, 0, 0.75));
}

@keyframes cardiacRadarPulse {
  0% {
    transform: translate(-50%, -50%) scale(0.6);
    opacity: 0.95;
  }
  40% {
    opacity: 0.7;
  }
  100% {
    transform: translate(-50%, -50%) scale(3);
    opacity: 0;
  }
}

/* The Heartbeat Pulsating Emblem */
.gateway-heartbeat-logo {
  position: relative;
  width: 195px;
  max-width: 55vw;
  height: auto;
  display: block;
  z-index: 2;
  animation: cardiacHeartbeat 2.8s ease-in-out infinite;
  transform-origin: center center;
  will-change: transform, filter;
  filter: drop-shadow(0 0 25px rgba(255, 92, 0, 0.5)) drop-shadow(0 0 45px rgba(255, 92, 0, 0.25));
  transition: filter 0.35s ease;
}

.gateway-logo-wrapper:hover .gateway-heartbeat-logo {
  filter: drop-shadow(0 0 35px rgba(255, 92, 0, 0.95)) drop-shadow(0 0 65px rgba(255, 255, 255, 0.6));
}

/* Specular Light Sweep Overlay across the logo */
.gateway-logo-sheen {
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    105deg,
    transparent 0%,
    rgba(255, 255, 255, 0.05) 30%,
    rgba(255, 255, 255, 0.75) 50%,
    rgba(255, 255, 255, 0.05) 70%,
    transparent 100%
  );
  transform: skewX(-20deg);
  pointer-events: none;
  z-index: 3;
  animation: logoSpecularSheen 3.6s ease-in-out infinite;
}

@keyframes logoSpecularSheen {
  0% { left: -100%; opacity: 0; }
  25% { opacity: 0.85; }
  50% { left: 180%; opacity: 0; }
  100% { left: 180%; opacity: 0; }
}

/* Double-Beat Cardiac Rhythm (Lub-Dub scale & radiance) */
@keyframes cardiacHeartbeat {
  0% {
    transform: scale(1);
    filter: drop-shadow(0 0 20px rgba(255, 92, 0, 0.45)) drop-shadow(0 0 40px rgba(255, 92, 0, 0.2));
  }
  10% {
    /* Lub */
    transform: scale(1.07);
    filter: drop-shadow(0 0 40px rgba(255, 92, 0, 0.9)) drop-shadow(0 0 65px rgba(255, 255, 255, 0.45));
  }
  20% {
    transform: scale(1.01);
    filter: drop-shadow(0 0 24px rgba(255, 92, 0, 0.55));
  }
  30% {
    /* Dub (Stronger pulse) */
    transform: scale(1.12);
    filter: drop-shadow(0 0 55px rgba(255, 92, 0, 1)) drop-shadow(0 0 85px rgba(255, 255, 255, 0.65));
  }
  50% {
    transform: scale(1);
    filter: drop-shadow(0 0 20px rgba(255, 92, 0, 0.45));
  }
  100% {
    transform: scale(1);
    filter: drop-shadow(0 0 20px rgba(255, 92, 0, 0.45));
  }
}

/* ==============================================================================
   8. WIDGET & COOKIE BANNER ISOLATION (Strict Lockdown during Entrance Gateway)
   ============================================================================== */
body.entrance-locked .renalytica-cookie-banner,
body.entrance-locked cookie-consent,
body.entrance-locked multi-channel-chat,
body.entrance-locked #renalytica-chat-root,
body.entrance-locked .chat-launcher-btn,
body.entrance-locked .chat-card-popup,
body.entrance-locked [class*="elfsight"],
body.entrance-locked [id*="elfsight"],
body.entrance-locked div[style*="z-index: 214748364"],
body.entrance-locked iframe[title*="chat" i],
body.entrance-locked iframe[title*="cookie" i] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(150%) scale(0.8) !important;
}

/* 9. Hyper-Drive Shockwave Light Burst Overlay */
#hyperdrive-shockwave {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 100000;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.2);
  background: radial-gradient(
    circle at center,
    #FFFFFF 0%,
    rgba(255, 255, 255, 0.95) 15%,
    rgba(255, 128, 0, 0.9) 45%,
    rgba(255, 92, 0, 0.7) 65%,
    rgba(7, 10, 16, 0.95) 85%,
    #070A10 100%
  );
  transition: opacity 0.5s cubic-bezier(0.1, 0.9, 0.2, 1),
              transform 0.85s cubic-bezier(0.1, 0.9, 0.2, 1);
}

#hyperdrive-shockwave.active {
  opacity: 1;
  transform: scale(3.5);
}
