/* ─── Keyframes ─────────────────────────────────────────── */

@keyframes _splash-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes _splash-pulse {
  0%,
  100% {
    opacity: 0.88;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.03);
  }
}

/* Neon breathing — each ring inhales/exhales its glow independently */
@keyframes _splash-neon-breathe {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

/* Ambient halo pulse behind the whole spinner */
@keyframes _splash-halo-pulse {
  0%,
  100% {
    opacity: 0.4;
    transform: scale(1);
  }
  50% {
    opacity: 0.75;
    transform: scale(1.06);
  }
}

/* ─── Layout ────────────────────────────────────────────── */

#splashscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #101217;
  overflow: hidden;
}

/* ─── Loader wrapper ────────────────────────────────────── */

.splashscreen__loader {
  position: relative;
  width: 260px;
  height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/*
 * Ambient halo — large soft corona that pulses behind all rings.
 * Two layers: outer soft bloom + inner tighter glow.
 */
.splashscreen__loader::before {
  content: '';
  position: absolute;
  /* Stretched well beyond the rings for a wide, faded corona */
  inset: -120px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(30, 80, 200, 0.07) 0%,
    rgba(30, 80, 200, 0.04) 30%,
    rgba(20, 60, 160, 0.02) 55%,
    transparent 72%
  );
  pointer-events: none;
  animation: _splash-halo-pulse 2.8s ease-in-out infinite;
}

.splashscreen__loader::after {
  content: '';
  position: absolute;
  inset: -60px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(40, 100, 220, 0.05) 0%,
    rgba(40, 100, 220, 0.02) 45%,
    transparent 65%
  );
  pointer-events: none;
  animation: _splash-halo-pulse 2.8s ease-in-out infinite 1.4s;
}

/* ─── Logo ──────────────────────────────────────────────── */

.splashscreen__logo {
  width: 260px;
  height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
  animation: _splash-pulse 2.6s ease-in-out infinite;
}

.splashscreen__logo img {
  width: 68%;
  height: 68%;
  object-fit: contain;
  display: block;
}

/* ─── Neon rings ────────────────────────────────────────── */

.splashscreen__ring {
  position: absolute;
  inset: var(--r-inset);
  border-radius: 50%;
  -webkit-mask: radial-gradient(
    farthest-side,
    transparent calc(100% - var(--r-w)),
    #000 calc(100% - var(--r-w))
  );
  mask: radial-gradient(
    farthest-side,
    transparent calc(100% - var(--r-w)),
    #000 calc(100% - var(--r-w))
  );
  /*
   * 4-layer neon stack (innermost → outermost):
   *  1. white-hot core  — sub-pixel white at the arc tip
   *  2. color tight     — saturated tight glow  (3–6px)
   *  3. color mid bloom — mid-range spread      (12–18px)
   *  4. color far halo  — wide atmospheric bloom (30–50px)
   */
  filter:
    drop-shadow(0 0 1.5px #fff)
    drop-shadow(0 0 5px var(--r-color))
    drop-shadow(0 0 16px var(--r-color))
    drop-shadow(0 0 42px var(--r-glow));
  animation:
    _splash-spin var(--r-dur) linear infinite var(--r-dir, normal),
    _splash-neon-breathe var(--r-breathe-dur, 2.5s) ease-in-out infinite var(--r-breathe-delay, 0s);
  z-index: 1;
}
