/* Premium first-visit splash screen */

:root {
  --splash-bg: #05111f;
  --splash-surface: rgba(7, 20, 37, 0.72);
  --splash-border: rgba(255, 255, 255, 0.16);
  --splash-text: #f8fbff;
  --splash-muted: rgba(248, 251, 255, 0.76);
  --splash-accent: #8fdcff;
  --splash-accent-2: #8b7dff;
  --splash-accent-3: #59f1c4;
}

body.splash-active {
  overflow: hidden;
}

#splash-screen {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at top left, rgba(104, 185, 255, 0.22), transparent 30%),
    radial-gradient(circle at bottom right, rgba(139, 125, 255, 0.25), transparent 35%),
    linear-gradient(135deg, var(--splash-bg) 0%, #081a30 45%, #030914 100%);
  color: var(--splash-text);
  overflow: hidden;
  isolation: isolate;
  opacity: 1;
  transition: opacity 800ms ease, filter 800ms ease, transform 800ms ease;
  transform: scale(1);
}

#splash-screen.is-exiting {
  opacity: 0;
  filter: blur(20px);
  transform: scale(0.985);
  pointer-events: none;
}

.splash-backdrop {
  position: absolute;
  inset: -20%;
  pointer-events: none;
}

.splash-backdrop::before,
.splash-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.78;
  animation: auroraShift 16s ease-in-out infinite alternate;
}

.splash-backdrop::before {
  background: radial-gradient(circle, rgba(120, 209, 255, 0.32) 0%, transparent 45%);
  transform: translate(-10%, -10%);
}

.splash-backdrop::after {
  background: radial-gradient(circle, rgba(139, 125, 255, 0.24) 0%, transparent 50%);
  animation-duration: 18s;
  transform: translate(10%, 10%);
}

.splash-orb {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  filter: blur(14px);
  opacity: 0.9;
  animation: floatDrift 12s ease-in-out infinite;
  will-change: transform, opacity;
}

.splash-orb.orb-a {
  width: 260px;
  height: 260px;
  top: 8%;
  right: 10%;
  background: radial-gradient(circle, rgba(143, 220, 255, 0.28), transparent 70%);
}

.splash-orb.orb-b {
  width: 220px;
  height: 220px;
  left: 6%;
  bottom: 12%;
  background: radial-gradient(circle, rgba(89, 241, 196, 0.26), transparent 70%);
  animation-duration: 14s;
}

.splash-orb.orb-c {
  width: 120px;
  height: 120px;
  bottom: 24%;
  right: 24%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.18), transparent 68%);
  animation-duration: 10s;
}

.splash-content {
  position: relative;
  z-index: 1;
  width: min(92vw, 720px);
  min-height: 460px;
  border: 1px solid var(--splash-border);
  border-radius: 36px;
  padding: 48px 40px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
  backdrop-filter: blur(26px);
  -webkit-backdrop-filter: blur(26px);
  box-shadow: 0 24px 90px rgba(5, 17, 31, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transform: translateY(0);
  animation: cardIn 1.05s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.splash-logo-wrap {
  width: min(180px, 42vw);
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  margin-bottom: 26px;
  animation: logoReveal 1.1s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.splash-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 18px 40px rgba(94, 173, 255, 0.24));
  animation: logoFloat 3.4s ease-in-out infinite;
}

.splash-name {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.12em;
  margin-bottom: 12px;
  font-size: clamp(2rem, 4.2vw, 3.2rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  font-family: "Inter", "Segoe UI", sans-serif;
  color: var(--splash-text);
}

.splash-letter {
  display: inline-block;
  opacity: 0;
  transform: translateY(16px) scale(0.96);
  animation: letterReveal 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.splash-subtitle {
  margin-bottom: 22px;
  font-size: clamp(1rem, 1.45vw, 1.16rem);
  color: var(--splash-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(18px);
  animation: subtitleReveal 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) 0.4s forwards;
}

.splash-loader {
  width: min(280px, 66vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  opacity: 0;
  animation: loaderReveal 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) 0.7s forwards;
}

.splash-progress-ring {
  --progress: 0%;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(from 180deg, var(--splash-accent-3) 0 var(--progress), rgba(255, 255, 255, 0.12) var(--progress) 100%);
  position: relative;
  box-shadow: inset 0 0 0 8px rgba(255, 255, 255, 0.06);
}

.splash-progress-ring::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: rgba(7, 20, 37, 0.85);
}

.splash-progress-text {
  position: relative;
  z-index: 1;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--splash-text);
}

.splash-loader-line {
  width: 0;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--splash-accent), var(--splash-accent-2), var(--splash-accent-3));
  box-shadow: 0 0 24px rgba(89, 241, 196, 0.25);
  transition: width 120ms linear;
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes logoReveal {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.72);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes logoFloat {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes letterReveal {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes subtitleReveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes loaderReveal {
  to {
    opacity: 1;
  }
}

@keyframes auroraShift {
  from {
    transform: rotate(0deg) scale(1);
  }
  to {
    transform: rotate(18deg) scale(1.08);
  }
}

@keyframes floatDrift {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 0.7;
  }
  50% {
    transform: translate3d(0, -18px, 0) scale(1.05);
    opacity: 0.95;
  }
}

@media (max-width: 768px) {
  #splash-screen {
    padding: 18px;
  }

  .splash-content {
    min-height: 380px;
    padding: 36px 22px 30px;
    border-radius: 28px;
  }

  .splash-logo-wrap {
    width: min(160px, 42vw);
    margin-bottom: 22px;
  }
}

@media (max-width: 480px) {
  .splash-content {
    min-height: 340px;
    padding: 30px 18px 24px;
  }

  .splash-subtitle {
    font-size: 0.9rem;
    letter-spacing: 0.06em;
  }
}

@media (prefers-reduced-motion: reduce) {
  #splash-screen,
  .splash-content,
  .splash-logo,
  .splash-letter,
  .splash-subtitle,
  .splash-loader {
    animation: none !important;
    transition: none !important;
  }

  .splash-letter {
    opacity: 1;
    transform: none;
  }

  .splash-subtitle,
  .splash-loader {
    opacity: 1;
    transform: none;
  }

  .splash-orb,
  .splash-backdrop::before,
  .splash-backdrop::after {
    animation: none !important;
  }
}
