/* ─── Loading screen (shared by Pre-Loader + React LoadingScreen) ───────── *
 * Full-screen branded overlay displayed while the application initialises.
 * Uses design tokens (--background, --foreground, --brand, --font-display)
 * so it adapts to light / dark mode. The Pre-Loader sets those tokens on
 * #preloader before first paint; React relies on :root / .dark from index.css.
 * The exit transition is GPU-accelerated (opacity + transform).              */

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--background);
  overflow: hidden;
  opacity: 1;
  transform: scale(1);
  will-change: opacity, transform;
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.loading-overlay--exit {
  opacity: 0;
  transform: scale(1.015);
  pointer-events: none;
}

.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  animation: loading-enter 0.5s ease-out both;
}

.loading-logo {
  display: block;
  width: 56px;
  height: 56px;
  border-radius: 0.5rem;
  animation: loading-pulse 2.5s ease-in-out infinite;
}

.loading-brand {
  font-family: var(--font-display, "Lyon", Georgia, "Times New Roman", serif);
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--foreground);
  line-height: 1;
}

.loading-dots {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.25rem;
}

.loading-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brand);
  opacity: 0.4;
  animation: loading-dot-pulse 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.15s; }
.loading-dots span:nth-child(3) { animation-delay: 0.3s;  }

@keyframes loading-enter {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes loading-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.75; }
}

@keyframes loading-dot-pulse {
  0%, 100% { opacity: 0.3; transform: scale(0.85); }
  50%      { opacity: 1;   transform: scale(1.15); }
}
