/* ===========================================================================
   NexMVD - splash.css
   Pantalla de bienvenida animada (logo NexMVD) que se muestra ~5s antes
   de entrar al sitio. Pensado para sumarse junto a /css/style.css.
=========================================================================== */

/* Evita el desborde horizontal (por las animaciones reveal-left/right que
   arrancan corridas) que en algunos celulares desplazaba el splash hacia
   la derecha en vez de quedar centrado. */
html, body {
  overflow-x: hidden;
  max-width: 100%;
}

#nx-splash {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  max-width: 100%;
  height: 100vh;   /* fallback para navegadores viejos */
  height: 100dvh;  /* alto real visible, ignora la barra de direcciones dinámica */
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-sizing: border-box;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
           env(safe-area-inset-bottom) env(safe-area-inset-left);
  background: radial-gradient(circle at 50% 40%, #0d2440 0%, #081527 65%, #050d1a 100%);
  transition: opacity .6s ease, visibility .6s ease;
}

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

#nx-splash .nx-splash-logo {
  width: 130px;
  max-width: 40vw;
  opacity: 0;
  filter: drop-shadow(0 0 28px rgba(31, 208, 214, .55));
  animation: nxLogoIn 1s ease forwards, nxLogoFloat 3s ease-in-out 1s infinite;
}

#nx-splash .nx-splash-brand {
  margin-top: 1.6rem;
  font-family: 'Michroma', 'Inter', sans-serif;
  letter-spacing: 5px;
  font-size: 1.5rem;
  color: #ffffff;
  opacity: 0;
  transform: translateY(10px);
  animation: nxTextIn .8s ease forwards .9s;
}

#nx-splash .nx-splash-sub {
  margin-top: .4rem;
  font-size: .8rem;
  letter-spacing: 2px;
  color: #7f9ab8;
  opacity: 0;
  animation: nxTextIn .8s ease forwards 1.15s;
}

#nx-splash .nx-splash-bar {
  width: 160px;
  height: 3px;
  margin-top: 1.6rem;
  border-radius: 3px;
  background: rgba(255, 255, 255, .12);
  overflow: hidden;
}

#nx-splash .nx-splash-bar::after {
  content: "";
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 3px;
  background: linear-gradient(90deg, #1a5f9e, #1fd0d6);
  animation: nxBarFill 4s ease forwards .4s;
}

@keyframes nxLogoIn {
  from { opacity: 0; transform: scale(.55) rotate(-18deg); }
  to   { opacity: 1; transform: scale(1) rotate(0deg); }
}

@keyframes nxLogoFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

@keyframes nxTextIn {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes nxBarFill {
  to { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  #nx-splash .nx-splash-logo,
  #nx-splash .nx-splash-brand,
  #nx-splash .nx-splash-sub,
  #nx-splash .nx-splash-bar::after {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    width: 100% !important;
  }
}
