/* ═══════════════════════════════════════════════════
   HOTEL LA SIESTA — ANIMATIONS CSS
   Keyframes, Scroll Reveal, Micro-interactions
═══════════════════════════════════════════════════ */

/* ─── Keyframes ─── */
@keyframes scrollLine {
  0%   { transform: scaleY(0); transform-origin: top; opacity: 1; }
  50%  { transform: scaleY(1); transform-origin: top; opacity: 1; }
  51%  { transform: scaleY(1); transform-origin: bottom; opacity: 1; }
  100% { transform: scaleY(0); transform-origin: bottom; opacity: 0; }
}

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

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

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes heroReveal {
  0%   { opacity: 0; transform: translateY(30px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes lineGrow {
  from { width: 0; }
  to   { width: 3rem; }
}

/* ─── Scroll Reveal Base ─── */
.reveal-up {
  opacity: 0;
  transform: translateY(50px);
  transition:
    opacity 0.9s var(--ease-out),
    transform 0.9s var(--ease-out);
}

.reveal-up.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delays for child elements */
.reveal-up:nth-child(2) { transition-delay: 0.1s; }
.reveal-up:nth-child(3) { transition-delay: 0.2s; }
.reveal-up:nth-child(4) { transition-delay: 0.3s; }

/* Room cards stagger */
.rooms__grid .room-card:nth-child(1) { transition-delay: 0s; }
.rooms__grid .room-card:nth-child(2) { transition-delay: 0.12s; }
.rooms__grid .room-card:nth-child(3) { transition-delay: 0.24s; }

/* Gallery items stagger */
.gallery-playa__item:nth-child(1) .reveal-img { transition-delay: 0s; }
.gallery-playa__item:nth-child(2) .reveal-img { transition-delay: 0.1s; }
.gallery-playa__item:nth-child(3) .reveal-img { transition-delay: 0.2s; }

/* Testimonial stagger */
.testimonials__grid .testimonial-card:nth-child(1) { transition-delay: 0s; }
.testimonials__grid .testimonial-card:nth-child(2) { transition-delay: 0.15s; }
.testimonials__grid .testimonial-card:nth-child(3) { transition-delay: 0.3s; }

/* Pool grid stagger */
.pool-grid__item:nth-child(1) { transition-delay: 0s; }
.pool-grid__item:nth-child(2) { transition-delay: 0.1s; }
.pool-grid__item:nth-child(3) { transition-delay: 0.2s; }

/* ─── Hero Content Animation ─── */
.hero__content .hero__eyebrow {
  animation: heroReveal 1s var(--ease-out) 0.3s both;
}

.hero__content .hero__title {
  animation: heroReveal 1s var(--ease-out) 0.55s both;
}

.hero__content .hero__subtitle {
  animation: heroReveal 1s var(--ease-out) 0.75s both;
}

.hero__content .hero__actions {
  animation: heroReveal 1s var(--ease-out) 0.95s both;
}

.hero__scroll-indicator {
  animation: fadeIn 1.5s ease 1.5s both;
}

/* ─── Image Hover Shimmer ─── */
.img-stack__main::after,
.room-card__image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(255,255,255,0.06) 50%,
    transparent 60%
  );
  background-size: 200% 100%;
  background-position: 200% 0;
  transition: background-position 0.6s ease;
  pointer-events: none;
}

.img-stack__main:hover::after,
.room-card:hover .room-card__image::after {
  background-position: -200% 0;
}

/* ─── Nav Animation ─── */
.nav {
  animation: fadeIn 0.8s ease both;
}

/* ─── Two Worlds Hover Text Lift ─── */
.two-worlds__content .h2 {
  transition: transform 0.5s var(--ease-out);
}

.two-worlds__card:hover .two-worlds__content .h2 {
  transform: translateY(-5px);
}

.two-worlds__content .btn {
  transform: translateY(8px);
  opacity: 0;
  transition: transform 0.5s var(--ease-out) 0.05s, opacity 0.5s var(--ease-out) 0.05s;
}

.two-worlds__card:hover .two-worlds__content .btn {
  transform: translateY(0);
  opacity: 1;
}

/* ─── Stat Number Counter Animation ─── */
.stat__number {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

.stat__number.counted {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Bar Feature Hover ─── */
.bar-feature .bar-feature__icon {
  transition: transform 0.3s var(--ease-out);
}

.bar-feature:hover .bar-feature__icon {
  transform: scale(1.2) rotate(-5deg);
}

/* ─── Testimonial Card Entrance ─── */
.testimonial-card {
  position: relative;
  overflow: hidden;
}

.testimonial-card::before {
  content: '"';
  position: absolute;
  top: -0.5rem;
  left: 1.5rem;
  font-family: var(--font-serif);
  font-size: 6rem;
  color: var(--sand);
  opacity: 0.12;
  line-height: 1;
  pointer-events: none;
}

/* ─── Gallery Nav Button Pulse ─── */
.gallery-nav-btn:active {
  transform: scale(0.95);
}

/* ─── Scroll Progress Indicator ─── */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(to right, var(--sand), var(--gold));
  z-index: 2000;
  transition: width 0.1s linear;
}

/* ─── Image loading blur-up effect ─── */
img {
  transition: filter 0.6s ease;
}

img.loading {
  filter: blur(10px);
}

img.loaded {
  filter: blur(0);
}

/* ─── Prefers reduced motion ─── */
@media (prefers-reduced-motion: reduce) {
  .reveal-up {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .hero__content .hero__eyebrow,
  .hero__content .hero__title,
  .hero__content .hero__subtitle,
  .hero__content .hero__actions,
  .hero__scroll-indicator {
    animation: none;
    opacity: 1;
  }

  .parallax-img {
    inset: 0;
  }

  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
