/* ==========================================================================
   GIRO 2026 — Animations, Micro-interactions & Reduced Motion
   Inspirado en cruces, trayectorias e intersecciones urbanas
   ========================================================================== */

/* Animación sutil de pulso para el badge de estado */
@keyframes pulse-dot {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.35;
    transform: scale(0.8);
  }
}

/* Animaciones de líneas de cruce e intersección */
@keyframes intersection-x {
  0% {
    transform: scaleX(0);
    opacity: 0;
  }
  100% {
    transform: scaleX(1);
    opacity: 0.4;
  }
}

@keyframes intersection-y {
  0% {
    transform: scaleY(0);
    opacity: 0;
  }
  100% {
    transform: scaleY(1);
    opacity: 0.4;
  }
}

@keyframes float-gentle {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

/* ==========================================================================
   ANIMACIÓN DE ENTRADA PROGRESIVA (PROGRESSIVE ENHANCEMENT)
   Regla de oro de diseño web: Por defecto TODO el contenido SIEMPRE es visible (opacity: 1).
   Nunca ocultar contenido de forma estática en CSS si depende de JS para revelarse.
   ========================================================================== */
.animate-on-scroll {
  opacity: 1;
  transform: none;
  transition: opacity var(--duration-slow) var(--ease-editorial),
              transform var(--duration-slow) var(--ease-editorial);
}

/* Solo cuando JavaScript se inicializa correctamente y confirma soporte de animaciones,
   aplica la transición suave de entrada sin bloquear nunca el contenido */
html.js-enhanced .animate-on-scroll.will-animate:not(.is-visible) {
  opacity: 0;
  transform: translateY(22px);
  will-change: opacity, transform;
}

html.js-enhanced .animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Delays escalonados para grillas y listas */
.stagger-1 { transition-delay: 80ms; }
.stagger-2 { transition-delay: 160ms; }
.stagger-3 { transition-delay: 240ms; }
.stagger-4 { transition-delay: 320ms; }
.stagger-5 { transition-delay: 400ms; }

/* Micro-interacciones de marca */
.interactive-iso {
  transition: transform var(--duration-slow) var(--ease-editorial),
              filter var(--duration-normal) var(--ease-standard);
  cursor: pointer;
}

.interactive-iso:hover {
  transform: rotate(90deg) scale(1.04);
}

/* Efecto de línea de enlace */
.link-hover-effect {
  position: relative;
  display: inline-block;
}

.link-hover-effect::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: currentColor;
  transition: width var(--duration-normal) var(--ease-editorial);
}

.link-hover-effect:hover::after {
  width: 100%;
}

/* ==========================================================================
   ACCESIBILIDAD: PREFERS-REDUCED-MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .animate-on-scroll,
  html.js-enhanced .animate-on-scroll.will-animate {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .interactive-iso:hover {
    transform: none !important;
  }

  .edition-badge-dot {
    animation: none !important;
  }
}
