/* ===================== PAGE LOADER ===================== */
@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@400;500;600;700&display=swap');

.page-loader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  background: linear-gradient(135deg, #14110c 0%, #1c1812 100%);
  display: grid;
  place-items: center;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.6s ease-out, visibility 0.6s ease-out;
  pointer-events: none;
}

.page-loader.loaded {
  opacity: 0;
  visibility: hidden;
}

.loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

/* Animated logo */
.loader-logo {
  font-family: 'Caveat', cursive;
  font-size: 54px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #fff;
  opacity: 0;
  animation: logoFade 0.8s ease-out forwards;
}

.loader-logo b {
  color: #e0a23c;
  font-weight: 400;
}

@keyframes logoFade {
  0% {
    opacity: 0;
    transform: scale(0.92) translateY(12px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Animated loading bar with gradient */
.loader-bar-container {
  width: 140px;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.loader-bar {
  height: 100%;
  background: linear-gradient(90deg, #e0a23c 0%, #b9772a 50%, #e0a23c 100%);
  background-size: 200% 100%;
  border-radius: 2px;
  animation: barFill 2.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
  box-shadow: 0 0 12px rgba(224, 162, 60, 0.6);
}

@keyframes barFill {
  0% {
    width: 0%;
  }
  85% {
    width: 90%;
  }
  100% {
    width: 100%;
  }
}

/* Floating particles behind logo */
.loader-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: #e0a23c;
  border-radius: 50%;
  opacity: 0;
  box-shadow: 0 0 8px #e0a23c;
}

.particle:nth-child(1) {
  left: 20%;
  top: 30%;
  animation: float 3s ease-in-out infinite;
}

.particle:nth-child(2) {
  left: 80%;
  top: 25%;
  animation: float 3.5s ease-in-out infinite 0.5s;
}

.particle:nth-child(3) {
  left: 15%;
  top: 70%;
  animation: float 3.8s ease-in-out infinite 1s;
}

.particle:nth-child(4) {
  left: 85%;
  top: 75%;
  animation: float 4s ease-in-out infinite 0.3s;
}

.particle:nth-child(5) {
  left: 50%;
  top: 15%;
  animation: float 3.2s ease-in-out infinite 0.8s;
}

@keyframes float {
  0%, 100% {
    opacity: 0;
    transform: translateY(0) translateX(0);
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-40px) translateX(20px);
  }
}

/* Glow effect behind loader */
.loader-glow {
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(224, 162, 60, 0.2) 0%, rgba(224, 162, 60, 0) 70%);
  filter: blur(40px);
  animation: glowPulse 3s ease-in-out infinite;
  pointer-events: none;
}

@keyframes glowPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.4;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.8;
  }
}

/* Content fade-in after loader */
@media (prefers-reduced-motion: no-preference) {
  body.page-loaded {
    animation: contentFadeIn 0.8s ease-out 0.4s both;
  }
}

@keyframes contentFadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

/* Smooth scroll reveal for sections */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(40px);
}

.reveal-on-scroll.revealed {
  animation: revealSection 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

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

/* Stagger effect for grids */
.reveal-on-scroll.stagger {
  animation-delay: calc(var(--index) * 0.08s);
}
