/* Splash Lunea Creativa · versión universal (sin framework)
   El logo no se redibuja: 4 capas PNG del logo original que encajan píxel a píxel.
   Solo se animan opacidad, desplazamiento y recorte. */

#lc-splash {
  --lc-azul: #17286f; /* azul-lunea: es exactamente el fondo del logo */
  --lc-rosa: #ffe5ed; /* rosa-luna */
  --lc-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --lc-ease-io: cubic-bezier(0.65, 0, 0.35, 1);
  --lc-ease-salida: cubic-bezier(0.76, 0, 0.24, 1);
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: grid;
  place-items: center;
  background: var(--lc-azul);
  overflow: hidden;
  will-change: transform;
  /* Seguro: si el JS no llegara a ejecutarse, el splash se quita solo */
  animation: lc-seguro 0.4s linear 11s forwards;
}

/* Ya visto en esta sesión, o sin JavaScript: no se muestra */
.lc-splash-visto #lc-splash { display: none; }

/* Bloqueo de scroll mientras está en pantalla */
html.lc-splash-activo,
html.lc-splash-activo body { overflow: hidden; }

#lc-splash .lc-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Caja del logo con la proporción nativa (1820 × 688): nunca se deforma */
#lc-splash .lc-logo {
  position: relative;
  width: min(600px, 78vw);
  aspect-ratio: 1820 / 688;
}

#lc-splash .lc-capa {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  display: block;
  user-select: none;
  pointer-events: none;
}

/* ── Fase 1 · cargando: solo el punto, centrado, con pulso ── */
#lc-splash .lc-capa--punto {
  transform: translate(-46.35%, -22.4%);
  animation: lc-aparece 0.4s ease both;
}
#lc-splash .lc-capa--creativa { clip-path: inset(0 100% 0 0); }
#lc-splash .lc-capa--lunea,
#lc-splash .lc-capa--claim { opacity: 0; }

#lc-splash .lc-halo {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5%;
  aspect-ratio: 1;
  translate: -50% -50%;
  box-sizing: border-box;
  border: 1.5px solid var(--lc-rosa);
  border-radius: 999px;
  opacity: 0;
  animation: lc-halo 1.2s var(--lc-ease-out) 0.3s infinite;
}

/* ── Fase 2 · listo: el punto escribe «creativa» y se queda como punto final ── */
#lc-splash:is([data-fase="listo"], [data-fase="saliendo"]) .lc-halo { animation: lc-desvanece 0.3s ease forwards; }
#lc-splash:is([data-fase="listo"], [data-fase="saliendo"]) .lc-capa--punto { animation: lc-escribe 1.4s both; }
#lc-splash:is([data-fase="listo"], [data-fase="saliendo"]) .lc-capa--creativa { animation: lc-revela 1.4s both; }
#lc-splash:is([data-fase="listo"], [data-fase="saliendo"]) .lc-capa--lunea { animation: lc-lunea 0.8s var(--lc-ease-out) 1.1s both; }
#lc-splash:is([data-fase="listo"], [data-fase="saliendo"]) .lc-capa--claim { animation: lc-claim 0.6s var(--lc-ease-out) 1.7s both; }

/* ── Fase 3 · saliendo: el panel azul sube ── */
#lc-splash[data-fase="saliendo"] { animation: lc-salida 0.9s var(--lc-ease-salida) forwards; }
#lc-splash[data-fase="saliendo"] .lc-logo { animation: lc-sale 0.6s var(--lc-ease-salida) forwards; }

/* ── Keyframes ── */
@keyframes lc-aparece { from { opacity: 0; } to { opacity: 1; } }
@keyframes lc-halo { from { transform: scale(1); opacity: 0.7; } to { transform: scale(3.2); opacity: 0; } }
@keyframes lc-desvanece { to { opacity: 0; } }
@keyframes lc-escribe {
  0% { transform: translate(-46.35%, -22.4%); animation-timing-function: var(--lc-ease-io); }
  28.5% { transform: translate(-91.35%, 0); animation-timing-function: var(--lc-ease-io); }
  100% { transform: translate(0, 0); }
}
@keyframes lc-revela {
  0% { clip-path: inset(0 97.5% 0 0); }
  28.5% { clip-path: inset(0 97.5% 0 0); animation-timing-function: var(--lc-ease-io); }
  100% { clip-path: inset(0 6.15% 0 0); }
}
@keyframes lc-lunea {
  from { opacity: 0; transform: translateY(10px); clip-path: polygon(0 0, 0% 0, -10% 100%, 0 100%); }
  to { opacity: 1; transform: none; clip-path: polygon(0 0, 65% 0, 55% 100%, 0 100%); }
}
@keyframes lc-claim { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
@keyframes lc-salida {
  0% { transform: none; border-radius: 0; }
  25% { border-radius: 0 0 40px 40px; }
  100% { transform: translateY(-100%); border-radius: 0 0 40px 40px; }
}
@keyframes lc-sale { to { transform: translateY(-80px); opacity: 0; } }
@keyframes lc-fundido { to { opacity: 0; } }
@keyframes lc-seguro { to { opacity: 0; visibility: hidden; pointer-events: none; } }

/* ── Movimiento reducido: logo completo y fundido, sin recorridos ── */
@media (prefers-reduced-motion: reduce) {
  #lc-splash .lc-halo,
  #lc-splash .lc-capa,
  #lc-splash .lc-logo { animation: none !important; }
  #lc-splash .lc-halo { display: none; }
  #lc-splash:is([data-fase="listo"], [data-fase="saliendo"]) .lc-capa {
    transform: none;
    clip-path: none;
    opacity: 1;
  }
  #lc-splash[data-fase="saliendo"] { animation: lc-fundido 0.4s linear forwards !important; }
}
