/* ── Splash screen styles ── */
#splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: #ffffff;
  transition:
    opacity 0.4s ease,
    visibility 0.4s ease;
}

/* Class-based dark theme (only when html explicitly has the .dark class) */
html.dark #splash {
  background: #09090b;
}
html.dark #splash .splash-title {
  color: #fafafa;
}
html.dark #splash .splash-sub {
  color: #a1a1aa;
}

#splash.splash-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Logo / wordmark */
.splash-logo {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  animation: splash-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.splash-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.splash-title {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #09090b;
  animation: splash-fade-up 0.5s 0.1s ease both;
}

/* Animated loading bar */
.splash-bar-track {
  width: 140px;
  height: 3px;
  border-radius: 99px;
  background: #e4e4e7;
  overflow: hidden;
  animation: splash-fade-up 0.5s 0.2s ease both;
}

html.dark .splash-bar-track {
  background: #27272a;
}

.splash-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  animation: splash-bar 1.6s ease-in-out infinite;
}

.splash-sub {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 12px;
  color: #71717a;
  letter-spacing: 0.02em;
  animation: splash-fade-up 0.5s 0.25s ease both;
}

/* Keyframes */
@keyframes splash-pop {
  from {
    opacity: 0;
    transform: scale(0.7);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes splash-fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes splash-bar {
  0% {
    width: 0%;
    margin-left: 0%;
  }
  50% {
    width: 60%;
    margin-left: 20%;
  }
  100% {
    width: 0%;
    margin-left: 100%;
  }
}
