/* ========================================
   RootReef - Splash / Intro Screen
   ======================================== */

/* Splash Overlay */
.splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0a1a2e 0%, #0d2b3e 40%, #0a6e78 100%);
  overflow: hidden;
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.splash.done {
  opacity: 0;
  transform: scale(1.05);
  pointer-events: none;
}

/* Animated background particles */
.splash::before,
.splash::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  opacity: 0.08;
  animation: splashFloat 6s ease-in-out infinite;
}
.splash::before {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--color-accent, #2dd4bf), transparent 70%);
  top: -15%;
  right: -10%;
  animation-delay: 0s;
}
.splash::after {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #0a6e78, transparent 70%);
  bottom: -10%;
  left: -10%;
  animation-delay: 3s;
}

@keyframes splashFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(20px, -20px) scale(1.05); }
}

/* Center content */
.splash-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 1;
}

/* Logo row: logo + text side by side */
.splash-logo-row {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 40px;
}

/* Logo image */
.splash-logo {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  object-fit: cover;
  opacity: 0;
  transform: translateX(-80px) scale(0.5);
  animation: logoSlideIn 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s forwards;
  filter: drop-shadow(0 8px 32px rgba(45, 212, 191, 0.3));
}

@keyframes logoSlideIn {
  0% {
    opacity: 0;
    transform: translateX(-80px) scale(0.5);
  }
  60% {
    opacity: 1;
    transform: translateX(8px) scale(1.05);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

/* Brand text */
.splash-text {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 3rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
  opacity: 0;
  transform: translateX(30px);
  animation: textSlideIn 0.7s cubic-bezier(0.25, 1, 0.5, 1) 0.8s forwards;
}

@keyframes textSlideIn {
  0% {
    opacity: 0;
    transform: translateX(30px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Gradient accent on "Reef" */
.splash-text .accent {
  background: linear-gradient(135deg, #2dd4bf, #5eead4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Loading bar */
.splash-loader {
  width: 200px;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  opacity: 0;
  animation: loaderFadeIn 0.4s ease 1.2s forwards;
}

@keyframes loaderFadeIn {
  to { opacity: 1; }
}

.splash-loader-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #2dd4bf, #0a6e78);
  border-radius: 4px;
  animation: loaderFill 1.4s cubic-bezier(0.4, 0, 0.2, 1) 1.3s forwards;
}

@keyframes loaderFill {
  0% { width: 0; }
  100% { width: 100%; }
}

/* Tagline */
.splash-tagline {
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 20px;
  opacity: 0;
  animation: taglineFade 0.6s ease 1.5s forwards;
}

@keyframes taglineFade {
  to { opacity: 1; }
}

/* Body locked when splash is visible */
body.splash-active {
  overflow: hidden;
}

/* Responsive */
@media (max-width: 480px) {
  .splash-logo {
    width: 56px;
    height: 56px;
    border-radius: 12px;
  }
  .splash-text {
    font-size: 2rem;
  }
  .splash-logo-row {
    gap: 14px;
    margin-bottom: 28px;
  }
  .splash-loader {
    width: 150px;
  }
}
