/* ==========================================================================
   Loading overlay — elegant connection animation
   ========================================================================== */

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 1;
  transition: opacity 600ms ease-out;
}

.loading-overlay.loaded {
  opacity: 0;
  pointer-events: none;
}

.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-8);
}

/* Animated orb with concentric rings */
.loading-orb {
  position: relative;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.orb-ring {
  position: absolute;
  border: 2px solid var(--accent);
  border-radius: 50%;
  opacity: 0;
  animation: pulse-ring 3s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.orb-ring:nth-child(1) {
  width: 40px;
  height: 40px;
  animation-delay: 0s;
}

.orb-ring:nth-child(2) {
  width: 60px;
  height: 60px;
  animation-delay: 1s;
}

.orb-ring:nth-child(3) {
  width: 80px;
  height: 80px;
  animation-delay: 2s;
}

@keyframes pulse-ring {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }
  50% {
    opacity: 0.6;
  }
  100% {
    opacity: 0;
    transform: scale(1.5);
  }
}

/* Loading text */
.loading-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}

.loading-text .brand-name {
  font-family: var(--font-mono);
  font-size: var(--text-3xl);
  font-weight: var(--weight-medium);
  letter-spacing: 0.15em;
  color: var(--ink);
}

.loading-status {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--ink-muted);
  animation: fade-pulse 2s ease-in-out infinite;
}

@keyframes fade-pulse {
  0%, 100% {
    opacity: 0.4;
  }
  50% {
    opacity: 1;
  }
}

/* Alternative: dots animation */
.loading-status::after {
  content: '';
  animation: dots 1.5s steps(4) infinite;
}

@keyframes dots {
  0%, 20% {
    content: '';
  }
  40% {
    content: '.';
  }
  60% {
    content: '..';
  }
  80%, 100% {
    content: '...';
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .loading-overlay {
    transition: opacity 200ms linear;
  }
  
  .orb-ring {
    animation: none;
    opacity: 0.3;
  }
  
  .orb-ring:nth-child(1) {
    opacity: 0.5;
  }
  
  .loading-status {
    animation: none;
    opacity: 0.7;
  }
  
  .loading-status::after {
    animation: none;
    content: '...';
  }
}
