/* ==========================================================================
   Movimiento: entradas, hero cinematográfico y microinteracciones
   Todo se desactiva con prefers-reduced-motion.
   ========================================================================== */

@keyframes ken-burns {
  from { transform: scale(1.09); }
  to { transform: scale(1); }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scroll-line {
  0% { transform: translateY(-100%); }
  55% { transform: translateY(0); }
  100% { transform: translateY(100%); }
}

/* Hero */

.hero__image,
.detail-hero__image {
  transform-origin: 50% 60%;
  animation: ken-burns 16s cubic-bezier(0.2, 0.6, 0.2, 1) both;
}

.hero__content > *,
.detail-hero__text > *,
.detail-hero__actions {
  animation: rise-in 1.1s var(--ease) both;
}

.hero__content > :nth-child(1),
.detail-hero__text > :nth-child(1) { animation-delay: 0.25s; }
.hero__content > :nth-child(2),
.detail-hero__text > :nth-child(2) { animation-delay: 0.4s; }
.hero__content > :nth-child(3),
.detail-hero__text > :nth-child(3) { animation-delay: 0.55s; }
.hero__content > :nth-child(4),
.detail-hero__text > :nth-child(4) { animation-delay: 0.7s; }
.detail-hero__actions { animation-delay: 0.85s; }

.hero__caption {
  animation: fade-in 1.2s var(--ease) 1.1s both;
}

.hero__scroll span {
  animation: scroll-line 2.4s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

/* Aparición al hacer scroll: solo para lo que está debajo del primer pantallazo */

.reveal-pending {
  transform: translateY(32px);
}

.reveal-pending.is-revealed {
  transform: none;
  transition: transform 1.2s var(--ease);
  transition-delay: var(--reveal-delay, 0s);
}

/* Microinteracciones de tarjetas */

.property-card__image {
  transition: transform 1.4s var(--ease);
}

.property-card__hover {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.property-card__arrow {
  transition: background-color 0.5s var(--ease), color 0.5s var(--ease), border-color 0.5s var(--ease), transform 0.5s var(--ease);
}

.property-card__cta .arrow {
  transition: transform 0.45s var(--ease);
}

.property-card__link:hover .property-card__image,
.property-card__link:focus-visible .property-card__image {
  transform: scale(1.04);
}

.property-card__link:hover .property-card__media::after,
.property-card__link:focus-visible .property-card__media::after {
  opacity: 1;
}

.property-card__link:hover .property-card__hover,
.property-card__link:focus-visible .property-card__hover {
  opacity: 1;
  transform: none;
}

.property-card__link:hover .property-card__arrow,
.property-card__link:focus-visible .property-card__arrow {
  background: var(--off-white);
  border-color: var(--off-white);
  color: var(--ink);
  transform: translateX(4px);
}

.property-card__link:hover .property-card__cta .arrow,
.property-card__link:focus-visible .property-card__cta .arrow {
  transform: translateX(6px);
}

@media (hover: none) {
  .property-card__hover {
    opacity: 1;
    transform: none;
  }
}

.gallery__button img {
  transition: transform 1.2s var(--ease), opacity 0.6s var(--ease);
}

.gallery__button:hover img {
  transform: scale(1.025);
}

.lightbox__image {
  animation: fade-in 0.45s var(--ease) both;
}

.map-card__pin {
  transition: box-shadow 0.6s var(--ease);
}

.map-card:hover .map-card__pin {
  box-shadow: 0 0 0 0.7rem rgba(28, 26, 22, 0.12), 0 0 0 1.8rem rgba(179, 151, 103, 0.22);
}

/* Movimiento reducido */

@media (prefers-reduced-motion: reduce) {
  .hero__image,
  .detail-hero__image,
  .hero__content > *,
  .detail-hero__text > *,
  .detail-hero__actions,
  .hero__caption,
  .lightbox__image {
    animation: none;
  }

  .hero__scroll span {
    animation: none;
    transform: none;
  }

  .reveal-pending {
    transform: none;
  }

  .property-card__link:hover .property-card__image,
  .gallery__button:hover img {
    transform: none;
  }
}
