/*
  motion.css (2026-09-06)
  Capa de movimiento del sitio: fade-in de pagina, zoom sutil del header de
  ficha de proyecto, animacion de entrada de textos del hero, y skeleton
  shimmer generico para imagenes mientras cargan. Respeta
  prefers-reduced-motion en su totalidad.
*/

/* ---------- Fade-in general de la pagina al cargar ---------- */
body {
  animation: pageFadeIn 0.5s ease both;
}

@keyframes pageFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---------- Skeleton shimmer generico para imagenes cargando ---------- */
img.is-loading {
  background: linear-gradient(90deg, #eee 25%, #f5f5f5 37%, #eee 63%);
  background-size: 400% 100%;
  animation: skeletonShimmer 1.4s ease infinite;
}

@keyframes skeletonShimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* ---------- Zoom sutil del header de la ficha de proyecto (solo imagen) ---------- */
#piHero .pi-hero__img {
  transform: scale(1);
  animation: piHeroZoom 16s ease-in-out infinite alternate;
  will-change: transform;
}

@keyframes piHeroZoom {
  from { transform: scale(1); }
  to { transform: scale(1.08); }
}

/* ---------- Entrada de textos del header de la ficha de proyecto ---------- */
#piHero .pi-hero__logo,
#piHero .pi-hero__ubicacion,
#piHero .pi-hero__visita,
#piHero .pi-hero__btn-container-btn {
  animation: piHeroTextIn 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

#piHero .pi-hero__logo { animation-delay: 0.1s; }
#piHero .pi-hero__ubicacion { animation-delay: 0.25s; }
#piHero .pi-hero__visita { animation-delay: 0.4s; }
#piHero .pi-hero__btn-container-btn { animation-delay: 0.55s; }

@keyframes piHeroTextIn {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Direccion del header y de la franja de contacto como ancla ---------- */
.pi-hero__ubicacion-link,
.pi-contacto__dato-link {
  text-decoration: none;
  color: inherit;
  transition: opacity 0.2s ease;
}

.pi-hero__ubicacion-link:hover,
.pi-contacto__dato-link:hover {
  opacity: 0.8;
  color: inherit;
}

/* ---------- Reduced motion: todo colapsa a estado final, sin animacion ---------- */
@media (prefers-reduced-motion: reduce) {
  body {
    animation: none;
  }

  img.is-loading {
    animation: none;
    background: none;
  }

  #piHero .pi-hero__img {
    animation: none;
    transform: none;
  }

  #piHero .pi-hero__logo,
  #piHero .pi-hero__ubicacion,
  #piHero .pi-hero__visita,
  #piHero .pi-hero__btn-container-btn {
    animation: none;
    opacity: 1;
    transform: none;
  }
}
