/* loader.css — branded "ZAVEDYA" splash screen shown while the app boots.
   Rewritten to avoid background-clip/text-fill tricks (inconsistent across
   browsers/filters) in favor of plain color + text-shadow glow, guaranteeing
   the animation is always visible. */

.app-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #020617;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.app-loader.app-loader-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.app-loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  position: relative;
}

.app-loader-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 280px;
  height: 280px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(99, 102, 241, 0.25) 0%, transparent 70%);
  animation: appLoaderGlowPulse 2s ease-in-out infinite;
  pointer-events: none;
}

.app-loader-ring {
  width: 48px;
  height: 48px;
  border-radius: 9999px;
  border: 3px solid rgba(99, 102, 241, 0.2);
  border-top-color: var(--color-accent-400, #818cf8);
  border-right-color: var(--color-accent-500, #6366f1);
  animation: appLoaderSpin 0.8s linear infinite;
  position: relative;
  z-index: 1;
}

.app-loader-brand {
  display: flex;
  gap: 0.12em;
  font-family: 'Space Grotesk', ui-sans-serif, system-ui;
  font-weight: 800;
  font-size: clamp(1.75rem, 6vw, 2.75rem);
  letter-spacing: 0.06em;
  position: relative;
  z-index: 1;
}

.app-loader-letter {
  display: inline-block;
  color: #ffffff;
  opacity: 0;
  transform: translateY(28px) scale(0.6);
  animation: appLoaderLetterIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.app-loader-letter.is-lit {
  animation: appLoaderLetterIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
             appLoaderLetterGlow 1.6s ease-in-out 0.1s infinite;
}

.app-loader-sub {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: #64748b;
  opacity: 0;
  animation: appLoaderFadeIn 0.6s ease 0.85s forwards;
  position: relative;
  z-index: 1;
}

.app-loader-bar {
  width: 140px;
  height: 3px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.15);
  overflow: hidden;
  position: relative;
  z-index: 1;
}
.app-loader-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  width: 40%;
  background: linear-gradient(90deg, transparent, var(--color-accent-400, #818cf8), transparent);
  animation: appLoaderBarSweep 1.1s ease-in-out infinite;
}

@keyframes appLoaderSpin {
  to { transform: rotate(360deg); }
}

@keyframes appLoaderLetterIn {
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes appLoaderLetterGlow {
  0%, 100% { text-shadow: 0 0 0 rgba(129, 140, 248, 0); }
  50% { text-shadow: 0 0 18px rgba(129, 140, 248, 0.85), 0 0 4px rgba(255,255,255,0.6); }
}

@keyframes appLoaderGlowPulse {
  0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 0.9; transform: translate(-50%, -50%) scale(1.15); }
}

@keyframes appLoaderFadeIn {
  to { opacity: 1; }
}

@keyframes appLoaderBarSweep {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}

@media (prefers-reduced-motion: reduce) {
  .app-loader-ring, .app-loader-letter, .app-loader-bar::after, .app-loader-glow { animation: none; opacity: 1; transform: none; }
}
