/* ── Loading screen ────────────────────────────────────────── */
#loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-deep);
  z-index: 100;
  gap: 24px;
  transition: opacity 0.6s ease;
}
#loading.fade-out { opacity: 0; }

#glyph {
  animation: breathe 3s ease-in-out infinite;
  animation-delay: 2s;
  animation-fill-mode: backwards;
}

.glyph-ring {
  fill: none;
  stroke: var(--stormlight);
  stroke-width: 2;
  stroke-dasharray: 251;
  stroke-dashoffset: 251;
  animation: drawStroke 1.5s ease-out forwards;
}
.glyph-ray {
  fill: none;
  stroke: var(--stormlight);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  animation: drawStroke 0.3s ease-out forwards;
}
.glyph-dot {
  fill: var(--stormlight);
  opacity: 0;
  animation: fadeIn 0.3s ease-out forwards;
}
.glyph-inner {
  fill: none;
  stroke: var(--stormlight);
  stroke-width: 1;
  stroke-dasharray: 113;
  stroke-dashoffset: 113;
  opacity: 0.4;
  animation: drawStroke 1s ease-out forwards;
  animation-delay: 0.8s;
}

#loading-text {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--stormlight);
  opacity: 0;
  animation: fadeIn 0.5s ease-out forwards;
  animation-delay: 1.7s;
  letter-spacing: 1px;
}

@keyframes drawStroke {
  to { stroke-dashoffset: 0; }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes breathe {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(200, 223, 255, 0.15)); }
  50% { filter: drop-shadow(0 0 20px rgba(200, 223, 255, 0.4)); }
}

/* ── Particle canvas ───────────────────────────────────────── */
#particles {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  filter: blur(1.5px);
}
