/* ============================================================
   animations.css — BitBox360 Landing Page
   Scroll reveal, hover effects, transitions
   ============================================================ */

/* ============================================================
   SCROLL REVEAL — .reveal elements
   JS in animations.js adds .visible class on scroll
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.65s cubic-bezier(.16,1,.3,1),
    transform 0.65s cubic-bezier(.16,1,.3,1);
  will-change: opacity, transform;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delay for grid children */
.servicios__grid .card:nth-child(1).reveal { transition-delay: 0ms; }
.servicios__grid .card:nth-child(2).reveal { transition-delay: 120ms; }
.servicios__grid .card:nth-child(3).reveal { transition-delay: 240ms; }

/* Hero stagger */
.hero__content .reveal:nth-child(1) { transition-delay: 200ms; }
.hero__content .reveal:nth-child(2) { transition-delay: 360ms; }
.hero__content .reveal:nth-child(3) { transition-delay: 480ms; }
.hero__content .reveal:nth-child(4) { transition-delay: 600ms; }
.hero__content .reveal:nth-child(5) { transition-delay: 720ms; }

/* Section header */
.section-header.reveal { transition-delay: 100ms; }

/* Why us stagger */
.whyus__text.reveal { transition-delay: 0ms; }
.whyus__visual.reveal { transition-delay: 200ms; }

/* CTA */
.contacto__content.reveal { transition-delay: 0ms; }
.contacto__deco.reveal    { transition-delay: 200ms; }


/* ============================================================
   NAVBAR SCROLL EFFECT — handled by navigation.js
   ============================================================ */
.navbar {
  transition:
    background 300ms cubic-bezier(.4,0,.2,1),
    box-shadow 300ms cubic-bezier(.4,0,.2,1),
    backdrop-filter 300ms cubic-bezier(.4,0,.2,1);
}


/* ============================================================
   HOVER GLOW — card icon on hover
   ============================================================ */
.card:hover .card__icon-wrap {
  box-shadow: 0 0 0 4px rgba(44,62,80,.06);
}

.card--featured:hover .card__icon-wrap {
  box-shadow: 0 0 0 4px rgba(255,255,255,.08);
}


/* ============================================================
   HERO TEXT SHIMMER — subtle animation on accent
   ============================================================ */
.hero__title-accent {
  animation: gradientShift 6s ease infinite;
  background-size: 200% 200%;
}

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


/* ============================================================
   BUTTON RIPPLE
   ============================================================ */
.btn {
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(255,255,255,.18) 0%, transparent 70%);
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
  border-radius: inherit;
}

.btn:active::after {
  opacity: 1;
  transform: scale(1.5);
  transition: opacity 0s, transform 0s;
}


/* ============================================================
   FLOATING CARD ENTRANCE
   ============================================================ */
.whyus__floating-card {
  animation-play-state: paused;
}

.whyus__visual.visible .whyus__floating-card {
  animation-play-state: running;
}


/* ============================================================
   PAGE FADE IN
   ============================================================ */
body {
  animation: pageFadeIn 0.3s ease forwards;
  animation-play-state: paused;
}

body.loaded {
  animation-play-state: running;
}

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


/* ============================================================
   DECORATIVE RING PAUSE ON REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .reveal {
    transition: none;
    opacity: 1;
    transform: none;
  }

  .hero__title-accent {
    animation: none;
  }

  .hero__bg-orb {
    animation: none;
  }

  .hero__scroll-dot {
    animation: none;
  }

  .hero__badge-dot {
    animation: none;
    box-shadow: 0 0 6px #5af0a0;
  }

  .contacto__deco-ring {
    animation: none;
  }

  .whyus__floating-card {
    animation: none;
  }

  .loader__bar-fill {
    animation: none;
    width: 100%;
  }
}
