#preloader {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #07070a;
  z-index: 99999;
  transition: opacity 0.8s cubic-bezier(0.77, 0, 0.175, 1), visibility 0.8s;
}

.reveal-on-scroll {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.75s ease, transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal-on-scroll {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

#preloader.loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-content {
  position: relative;
  text-align: center;
}

.loader-title {
  margin: 0;
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  letter-spacing: 5px;
  background: linear-gradient(135deg, #a855f7 0%, #00d2ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: pulseGlow 2s infinite alternate ease-in-out;
}

.loader-line {
  width: 0;
  height: 2px;
  margin: 1.2rem auto;
  border-radius: 2px;
  background: linear-gradient(90deg, #a855f7, #00d2ff);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.8);
  animation: fillLine 1.6s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

.loader-subtitle {
  margin: 0;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.65rem;
  letter-spacing: 4px;
  color: #94a3b8;
  text-transform: uppercase;
  opacity: 0;
  animation: fadeIn 1s 0.6s forwards;
}

@keyframes pulseGlow {
  0% { opacity: 0.7; filter: drop-shadow(0 0 5px rgba(168, 85, 247, 0.2)); }
  100% { opacity: 1; filter: drop-shadow(0 0 15px rgba(0, 210, 255, 0.6)); }
}

@keyframes fillLine {
  0% { width: 0; }
  100% { width: 140px; }
}

@keyframes fadeIn {
  to { opacity: 0.8; }
}
