/* =========================================================
   SPLASH — experiência de entrada premium da Syncron
   Reaproveita os tokens de cor/easing já existentes em
   styles/root.css (--bg, --text, --muted, --primary, --accent,
   --easing) — nenhuma cor nova é inventada aqui. Usada tanto como
   overlay dentro de index.html (primeira visita da sessão) quanto
   como página standalone em splash.html.
========================================================= */

.splash-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;

  background: var(--bg);
  overflow: hidden;

  opacity: 1;
  visibility: visible;
  transition:
    opacity 0.6s var(--easing),
    visibility 0.6s var(--easing);
}

.splash-overlay.is-leaving {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Grid tecnológico sutil */
.splash-grid {
  position: absolute;
  inset: -1px;
  pointer-events: none;

  background-image:
    linear-gradient(rgba(94, 234, 212, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(94, 234, 212, 0.06) 1px, transparent 1px);
  background-size: 48px 48px;

  -webkit-mask-image: radial-gradient(circle at 50% 45%, #000 0%, transparent 70%);
  mask-image: radial-gradient(circle at 50% 45%, #000 0%, transparent 70%);

  animation: splash-grid-drift 18s linear infinite;
}

@keyframes splash-grid-drift {
  from {
    background-position: 0 0, 0 0;
  }
  to {
    background-position: 48px 96px, 48px 96px;
  }
}

/* Orb energética central */
.splash-orb {
  position: relative;
  width: 132px;
  height: 132px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.splash-orb-glow {
  position: absolute;
  inset: -40px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--primary) 35%, transparent), transparent 70%);
  filter: blur(6px);
  animation: splash-orb-pulse 2.4s var(--easing) infinite;
}

.splash-orb-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  animation: splash-orb-ring-spin 6s linear infinite;
}

.splash-orb-ring::before {
  content: "";
  position: absolute;
  top: -2px;
  left: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px 2px var(--accent);
  transform: translateX(-50%);
}

.splash-orb-core {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 0 40px 6px color-mix(in srgb, var(--accent) 45%, transparent);
  animation: splash-orb-pulse 2.4s var(--easing) infinite;
}

@keyframes splash-orb-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.85;
  }
  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}

@keyframes splash-orb-ring-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Logo + wordmark */
.splash-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;

  opacity: 0;
  transform: translateY(10px);
  animation: splash-fade-up 0.8s var(--easing) 0.35s forwards;
}

.splash-logo img {
  width: 46px;
  height: auto;
  filter: drop-shadow(0 0 16px color-mix(in srgb, var(--accent) 55%, transparent));
}

.splash-logo-text {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text);
  text-shadow: var(--hero-text-shadow, none);
}

/* Barra de progresso discreta */
.splash-progress {
  width: 200px;
  height: 3px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text) 12%, transparent);
  overflow: hidden;

  opacity: 0;
  animation: splash-fade-up 0.8s var(--easing) 0.5s forwards;
}

.splash-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.splash-overlay.is-playing .splash-progress-fill {
  animation: splash-progress-fill 2s var(--easing) 0.5s forwards;
}

@keyframes splash-progress-fill {
  from {
    width: 0%;
  }
  to {
    width: 100%;
  }
}

.splash-hint {
  position: absolute;
  bottom: 36px;

  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.03em;

  opacity: 0;
  animation: splash-fade-up 0.6s var(--easing) 1.4s forwards;
}

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

@media (prefers-reduced-motion: reduce) {
  .splash-grid,
  .splash-orb-glow,
  .splash-orb-core,
  .splash-orb-ring,
  .splash-logo,
  .splash-progress,
  .splash-hint {
    animation: none !important;
  }

  .splash-logo,
  .splash-progress,
  .splash-hint {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 480px) {
  .splash-orb {
    width: 104px;
    height: 104px;
  }

  .splash-orb-core {
    width: 52px;
    height: 52px;
  }

  .splash-logo-text {
    font-size: 1.2rem;
  }

  .splash-progress {
    width: 160px;
  }
}
