/* Splash de la primera visita de la sesion (src/splash.ts): las piezas del Templo entran como rayos
   desde los bordes, estalla la luz, sube el nombre y el logo vuela a su sitio: la insignia del login
   o la marca del riel del visor. Va en un archivo enlazado en el <head> para verse desde el primer
   pintado. Sin html.splash-corre solo se pinta el fondo: el visor aun no sabe si hay sesion. */
.splash {
  position: fixed; inset: 0; z-index: 9999; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 26px; overflow: hidden; cursor: pointer; color: #e8f4f6; text-align: center;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  --vx: 0px; --vy: 0px; --ve: .3;
}
.splash-fondo { position: absolute; inset: 0; background: radial-gradient(circle at 50% 42%, #0a3a47, #020f14 76%); }
.sin-portada .splash, html:not(.con-splash) #splash { display: none; }
html:not(.splash-corre) .splash > :not(.splash-fondo) { visibility: hidden; }
.splash[hidden] { display: none; }

.splash-nucleo { position: relative; z-index: 3; width: 150px; height: 150px; }
.splash-logo { position: relative; z-index: 3; display: block; width: 100%; height: 100%; overflow: visible; }
.splash-pieza { transform-box: fill-box; transform-origin: center; }
.splash-brillo { position: absolute; left: 50%; top: 50%; z-index: 1; width: 80vmin; height: 80vmin; margin: -40vmin; border-radius: 50%; background: radial-gradient(circle, #62c7d666, transparent 62%); opacity: 0; }
.splash-rayo { position: absolute; left: 0; right: 0; top: 50%; z-index: 2; height: 3px; margin-top: -1.5px; background: linear-gradient(90deg, transparent, #62c7d6 30%, #f2feff 50%, #62c7d6 70%, transparent); opacity: 0; }
.splash-onda { position: absolute; left: 50%; top: 50%; z-index: 2; width: 12px; height: 12px; margin: -6px; border-radius: 50%; box-shadow: 0 0 0 .6px #62c7d6; opacity: 0; }
.splash-chispa { position: absolute; left: 50%; top: 50%; z-index: 2; width: 6px; height: 6px; margin: -3px; border-radius: 50%; background: #a6eaf1; box-shadow: 0 0 10px #62c7d6; opacity: 0; }

.splash-texto { position: relative; z-index: 3; display: grid; justify-items: center; }
.splash-nombre { display: inline-flex; overflow: hidden; margin: 0; font-size: clamp(38px, 6.6vw, 78px); font-weight: 700; line-height: 1.08; letter-spacing: .05em; }
.splash-nombre span { display: inline-block; }
.splash-sub { margin: 12px 0 0; font-size: 13px; font-weight: 700; letter-spacing: .32em; color: #62c7d6; }
.splash .version { display: inline-flex; align-items: stretch; margin-top: 16px; overflow: hidden; border: 1px solid #17596a; border-radius: 999px; background: #0a3a45; }
.splash .version b { padding: 5px 11px; background: #62c7d6; color: #04222a; font: 700 12px 'JetBrains Mono', ui-monospace, monospace; letter-spacing: .04em; }
.splash .version span { padding: 5px 12px 5px 10px; color: #8fb1b9; font-size: 12px; font-weight: 500; }
.splash .estado:empty, .splash .error-pista:empty { display: none; }
.splash .estado { margin-top: 18px; color: #fb7185; font-size: 11.5px; font-weight: 600; letter-spacing: .13em; }
.splash .error-pista { max-width: 340px; margin: 14px 0 0; color: #8fb1b9; font-size: 12.5px; line-height: 1.55; }
.splash .reintentar { margin-top: 16px; padding: 10px 24px; border: 0; border-radius: 999px; cursor: pointer; background: #62c7d6; color: #04222a; font: 700 12px system-ui, sans-serif; letter-spacing: .08em; }
.splash .reintentar:hover { background: #a6eaf1; }
.splash-pie { position: absolute; z-index: 3; left: 16px; right: 16px; bottom: 22px; color: #8fb1b9; font-size: 12px; font-weight: 500; }

/* Primera parte: dura lo que duran las animaciones y se queda hasta que la pagina este lista. */
.splash-corre .splash-pieza { animation: splash-entra .5s var(--d) both cubic-bezier(.2, .9, .2, 1); }
.splash-corre .splash-logo { animation: splash-brilla .7s 1.75s both; }
.splash-corre .splash-brillo { animation: splash-resplandor 1.6s 1s both ease-out; }
.splash-corre .splash-rayo { animation: splash-destello .9s 1.05s both cubic-bezier(.1, .7, .3, 1); }
.splash-corre .splash-onda { animation: splash-expande 1s 1.05s both cubic-bezier(.1, .7, .3, 1); }
.splash-corre .splash-chispa { animation: splash-chispa .9s 1.05s both cubic-bezier(.1, .8, .3, 1); }
.splash-corre .splash-nombre span { animation: splash-letra .55s var(--l) both cubic-bezier(.2, .8, .2, 1); }
.splash-corre .splash-sub { animation: splash-sub .9s 1.6s both ease-out; }
.splash-corre .splash .version { animation: splash-aparece .5s 1.9s both; }
.splash-corre .splash-pie { animation: splash-aparece .5s 1.9s both; }

/* Segunda parte (.splash-vuela): el logo vuela y se aclara lo que espera detras. */
.splash-vuela .splash-fondo { animation: splash-apaga .55s both; }
.splash-vuela .splash-brillo, .splash-vuela .splash-texto, .splash-vuela .splash-pie { animation: splash-apaga .3s both; }
.splash-vuela .splash-logo { animation: splash-vuelo .7s both cubic-bezier(.7, 0, .2, 1), splash-apaga .15s .65s both; }
/* Saltado con clic o Escape: todo se apaga sin vuelo. */
.splash-saltar .splash { animation: splash-apaga .35s both; }
.splash-saltar .splash-logo { animation: none; }
/* La API no contesto: la portada se queda con el aviso (src/entrada.ts, mostrarErrorArranque). */
.splash.error { cursor: default; }

@keyframes splash-entra { from { transform: translate(var(--dx), var(--dy)) scale(1.5); opacity: 0; } 60% { opacity: 1; } }
@keyframes splash-brilla { 45% { filter: brightness(1.45) drop-shadow(0 0 8px #a6eaf1); } }
@keyframes splash-resplandor { 0% { opacity: 0; transform: scale(.3); } 25% { opacity: 1; } 100% { opacity: .4; transform: scale(1); } }
@keyframes splash-destello { 0% { opacity: 0; transform: scaleX(0); } 20% { opacity: 1; } 100% { opacity: 0; transform: scaleX(1); } }
@keyframes splash-expande { 0% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(90); } }
@keyframes splash-chispa { 0% { opacity: 1; transform: rotate(var(--a)) translateX(0); } 100% { opacity: 0; transform: rotate(var(--a)) translateX(var(--r)); } }
@keyframes splash-letra { from { transform: translateY(110%); } }
@keyframes splash-sub { from { opacity: 0; letter-spacing: .8em; } }
@keyframes splash-aparece { from { opacity: 0; } }
@keyframes splash-vuelo { to { transform: translate(var(--vx), var(--vy)) scale(var(--ve)); } }
@keyframes splash-apaga { to { opacity: 0; visibility: hidden; } }

@media (max-width: 600px) { .splash-nucleo { width: 112px; height: 112px; } .splash-sub { font-size: 10px; letter-spacing: .22em; } }
