/* Splash de marcación de la web: logo del ojo que parpadea.
   Se carga después de styles.css y solo afecta a la página de la nube. */

.stage-icon { width: 150px; height: 100px; margin-bottom: 8px; }

/* El ojo parpadea: se aplana verticalmente y vuelve a abrirse */
.stage-icon .eye {
  transform-box: view-box;
  transform-origin: 32px 20px;
}
.stage-icon .eye-shape { fill: var(--stage); }

/* Cargando: el ojo parpadea despacio mientras el servidor responde */
.is-loading .eye { animation: eye-blink 1.6s ease-in-out infinite; }

/* Entrada y salida: parpadeo de 1,2 s al inicio; luego el texto queda fijo */
.is-entry .eye,
.is-exit .eye { animation: eye-blink 1.2s ease-in-out 0.1s 1 both; }

/* Error: el ojo rojo se sacude; el contenedor no se mueve para no repetir el efecto */
.is-error .eye { animation: eye-shake 0.55s ease-in-out 0.1s 1 both; }
.is-error .stage-icon { animation: none; }

/* La barra dura lo mismo que el splash (2,5 s) */
.is-entry .stage-bar span,
.is-exit .stage-bar span,
.is-error .stage-bar span { animation: fill-bar 2.5s linear forwards; }

/* Parpadeo natural: cierre rápido, pausa breve y apertura más lenta */
@keyframes eye-blink {
  0% { transform: scaleY(1); animation-timing-function: ease-in; }
  9% { transform: scaleY(0.05); animation-timing-function: ease-out; }
  14% { transform: scaleY(0.05); animation-timing-function: ease-in-out; }
  32% { transform: scaleY(1); }
  100% { transform: scaleY(1); }
}

@keyframes eye-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(3px); }
}

@media (prefers-reduced-motion: reduce) {
  .punch-stage .eye { animation: none !important; }
  .is-entry .stage-bar span, .is-exit .stage-bar span, .is-error .stage-bar span { transform: scaleX(1); }
}

/* Logo de cabecera: parpadeo natural cada cinco segundos, con la misma curva
   que la marcación (cierre 0,1 s, pausa 0,1 s, apertura 0,2 s) y un parpadeo doble. */
.logo .eye {
  transform-box: view-box;
  transform-origin: 32px 20px;
  animation: eye-blink-loop 5s linear infinite;
}
@keyframes eye-blink-loop {
  0%, 57% { transform: scaleY(1); animation-timing-function: ease-in; }
  59% { transform: scaleY(0.05); animation-timing-function: ease-out; }
  61% { transform: scaleY(0.05); animation-timing-function: ease-in-out; }
  65% { transform: scaleY(1); animation-timing-function: ease-in; }
  70% { transform: scaleY(1); }
  71.5% { transform: scaleY(0.05); animation-timing-function: ease-out; }
  73.5% { transform: scaleY(0.05); animation-timing-function: ease-in-out; }
  77.5% { transform: scaleY(1); }
  100% { transform: scaleY(1); }
}
@media (prefers-reduced-motion: reduce) {
  .logo .eye { animation: none; }
}
