/* 
  RWA & CO. Premium Animated Preloader Style
  Luxury dark theme with gold accents, cinematic slow zoom, and a pulsing radial glow
*/

#rwa-svg-preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 999999;
  background-color: transparent; /* Seamless transparent overlay */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  opacity: 1;
  visibility: visible;
  transition: opacity 2.5s cubic-bezier(0.25, 1, 0.5, 1), visibility 2.5s ease;
  will-change: opacity, visibility;
  pointer-events: auto; /* captures pointer events to block interaction with page below */
}

/* Force body overflow to hidden and set dark background on homepage */
body.splash-active,
body.intro-complete {
  background-color: #0d0d0d !important;
}

body.splash-active {
  overflow: hidden !important;
  height: 100vh !important;
}

/* Make site content visible during preloader but non-interactive */
body.splash-active #site {
  opacity: 1 !important;
  transform: scale(1) !important;
  pointer-events: none !important;
}

/* Ambient dark vignette to make the gold logo pop against the website content */
.preloader-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 120vh;
  height: 120vh;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(12, 11, 9, 0.9) 0%, rgba(12, 11, 9, 0.6) 30%, rgba(12, 11, 9, 0) 70%);
  z-index: 1;
  pointer-events: none;
  animation: pulseGlow 4s ease-in-out infinite alternate;
  will-change: transform, opacity;
}

/* Full page SVG Container with slow cinematic zoom */
#rwa-svg-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  animation: cinematicZoom 10s cubic-bezier(0.1, 0.8, 0.2, 1) forwards;
  will-change: transform;
}

#rwa-svg-frame {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Cover full page without changing ratios of moving objects */
  opacity: 0;
  transition: opacity 0.05s ease;
  pointer-events: none;
}

#rwa-svg-frame.active {
  opacity: 1;
}

/* Elegant Bottom Progress Bar & Text */
.preloader-progress-wrap {
  position: absolute;
  bottom: 8%;
  left: 50%;
  transform: translateX(-50%);
  width: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  z-index: 3;
}

.preloader-progress-track {
  width: 100%;
  height: 2px;
  background-color: rgba(197, 168, 128, 0.15);
  border-radius: 2px;
  overflow: hidden;
}

.preloader-progress-bar {
  width: 0%;
  height: 100%;
  background-color: #c5a880; /* Gold */
  transition: width 0.1s cubic-bezier(0.1, 0.8, 0.2, 1);
  will-change: width;
}

.preloader-progress-text {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 11px;
  color: #c5a880;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-weight: 300;
  opacity: 0.8;
  animation: pulseText 2s ease-in-out infinite alternate;
}

/* Skip Button: Elegant Gold Border */
.skip-btn {
  position: absolute;
  bottom: 40px;
  right: 40px;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 11px;
  letter-spacing: 2px;
  color: #c5a880;
  background: transparent;
  border: 1px solid rgba(197, 168, 128, 0.3);
  padding: 8px 20px;
  border-radius: 0;
  cursor: pointer;
  z-index: 10;
  opacity: 0;
  animation: fadeInSkip 1s ease forwards;
  animation-delay: 2s; /* Fades in after animation starts */
  transition: all 0.3s ease;
  text-transform: uppercase;
}

.skip-btn:hover {
  background: #c5a880;
  color: #0c0b09;
  border-color: #c5a880;
  letter-spacing: 3px;
}

/* Live site container scale-in transition */
#site {
  transition: opacity 1.2s cubic-bezier(0.25, 1, 0.5, 1), transform 1.2s cubic-bezier(0.25, 1, 0.5, 1) !important;
}

/* Hide floating elements during splash screen */
body.splash-active .whatsapp-floating-btn,
body.splash-active #back-to-top {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

/* Smooth fade-in for floating elements once splash is complete */
.whatsapp-floating-btn,
#back-to-top {
  transition: opacity 0.8s ease, visibility 0.8s ease, transform 0.4s ease !important;
}

/* Animations */
@keyframes pulseGlow {
  0% {
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0.8;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 1;
  }
}

@keyframes cinematicZoom {
  0% {
    transform: scale(0.95);
  }
  100% {
    transform: scale(1.03);
  }
}

@keyframes pulseText {
  0% {
    opacity: 0.6;
  }
  100% {
    opacity: 1;
  }
}

@keyframes fadeInSkip {
  0% {
    opacity: 0;
    transform: translateY(5px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Respect user motion preferences */
@media (prefers-reduced-motion: reduce) {
  #rwa-svg-preloader {
    display: none !important;
  }
  body.splash-active {
    overflow: auto !important;
    height: auto !important;
  }
}
