/* ==============================================
   VANTAGE STUDIO — animations.css
   Scroll-triggered reveal animations
   and keyframe definitions
   ============================================== */


/* ==============================================
   1. REVEAL ANIMATIONS BASE STATES
   Elements start hidden; JS adds .is-visible
   to trigger the entrance transition
   ============================================== */

/* Shared base: hidden state for all reveal elements */
.reveal-up,
.reveal-left,
.reveal-right,
.reveal-fade {
  opacity: 0;
  transition:
    opacity   0.7s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity, transform;
}

/* Slide up from below */
.reveal-up {
  transform: translateY(28px);
}

/* Slide in from left */
.reveal-left {
  transform: translateX(-28px);
}

/* Slide in from right */
.reveal-right {
  transform: translateX(28px);
}

/* Pure fade */
.reveal-fade {
  transform: none;
}

/* ---- Visible state (class added by IntersectionObserver) ---- */
.reveal-up.is-visible,
.reveal-left.is-visible,
.reveal-right.is-visible,
.reveal-fade.is-visible {
  opacity: 1;
  transform: translate(0, 0);
}


/* ==============================================
   2. STAGGERED DELAY CLASSES
   Applied alongside reveal classes to stagger
   children when entering the viewport
   ============================================== */

.delay-1 { transition-delay: 0.08s; }
.delay-2 { transition-delay: 0.18s; }
.delay-3 { transition-delay: 0.28s; }
.delay-4 { transition-delay: 0.38s; }
.delay-5 { transition-delay: 0.48s; }


/* ==============================================
   3. PAGE LOAD ANIMATION
   Critical above-the-fold elements animate
   on load without waiting for scroll
   ============================================== */

/* Body fade-in on page load */
@keyframes page-load {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Applied to the hero content area immediately */
.hero-content {
  animation: page-load 0.9s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* Hero eyebrow: fast fade */
.hero-eyebrow {
  animation: page-load 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.1s both;
}

/* Hero headline: slight delay */
.hero-headline {
  animation: page-load 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.2s both;
}

/* Hero description */
.hero-description {
  animation: page-load 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.35s both;
}

/* CTA group */
.hero-cta-group {
  animation: page-load 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.45s both;
}

/* Stats */
.hero-stats {
  animation: page-load 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.55s both;
}

/* Hero visual from right */
@keyframes slide-from-right {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.hero-visual {
  animation: slide-from-right 1s cubic-bezier(0.4, 0, 0.2, 1) 0.4s both;
}

/*
  IMPORTANT: When elements have page-load animations,
  we DON'T also apply the scroll-reveal classes.
  Hero elements use page-load only.
  All sections below the fold use scroll-reveal.
*/


/* ==============================================
   4. NAVBAR SLIDE-IN ON LOAD
   ============================================== */

@keyframes nav-drop {
  from {
    opacity: 0;
    transform: translateY(-100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.navbar {
  animation: nav-drop 0.6s cubic-bezier(0.4, 0, 0.2, 1) both;
}


/* ==============================================
   5. SERVICE CARD — ICON HOVER ANIMATION
   Subtle icon pulse on card hover
   ============================================== */

@keyframes icon-bounce {
  0%, 100% { transform: scale(1); }
  40%       { transform: scale(1.15); }
  70%       { transform: scale(0.95); }
}

.service-card:hover .service-icon {
  animation: icon-bounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}


/* ==============================================
   6. HERO CARD HOVER — FLOAT EFFECT
   Cards gently float when hovered
   ============================================== */

.hero-card:hover {
  transform: translateY(-6px);
}


/* ==============================================
   7. BUTTON RIPPLE EFFECT
   Pseudo-element ripple on .btn click
   ============================================== */

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.12);
  border-radius: inherit;
  opacity: 0;
  transform: scale(0.85);
  transition:
    opacity   0.3s ease,
    transform 0.4s ease;
}

.btn:active::after {
  opacity: 1;
  transform: scale(1);
  transition: none;
}


/* ==============================================
   8. TESTIMONIAL CARD ENTRANCE
   Subtle scale+fade on scroll reveal
   ============================================== */

.testimonial-card {
  transition:
    transform    0.25s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.25s ease,
    box-shadow   0.25s ease,
    opacity      0.65s cubic-bezier(0.4, 0, 0.2, 1),
    scale        0.65s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Initial hidden state for testimonial cards */
.testimonial-card:not(.is-visible) {
  opacity: 0;
  scale: 0.96;
}

.testimonial-card.is-visible {
  opacity: 1;
  scale: 1;
}


/* ==============================================
   9. REASON CARD ENTRANCE (about section)
   ============================================== */

.reason-card {
  transition:
    border-color 0.25s ease,
    transform    0.25s cubic-bezier(0.4, 0, 0.2, 1),
    opacity      0.6s  cubic-bezier(0.4, 0, 0.2, 1);
}

.reason-card:not(.is-visible) {
  opacity: 0;
  transform: translateX(16px);
}

.reason-card.is-visible {
  opacity: 1;
  transform: translateX(0);
}


/* ==============================================
   10. CONTACT FORM WRAPPER ENTRANCE
   ============================================== */

.contact-form-wrapper {
  transition:
    opacity   0.7s cubic-bezier(0.4, 0, 0.2, 1) 0.15s,
    transform 0.7s cubic-bezier(0.4, 0, 0.2, 1) 0.15s;
}


/* ==============================================
   11. SECTION BG SUBTLE GRADIENT ANIMATION
   Very subtle moving gradient on hero
   ============================================== */

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


/* ==============================================
   12. METRIC BAR FILL ANIMATION
   (defined here for reference — keyframe used
    inline via style.css)
   ============================================== */
/* bar-grow keyframe is defined in style.css */


/* ==============================================
   13. FORM INPUT FOCUS ANIMATION
   Smooth label micro-animation
   ============================================== */

@keyframes label-rise {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.form-error:not(:empty) {
  animation: label-rise 0.2s ease both;
}

/* Form success message entrance */
.form-success:not([hidden]) {
  animation: label-rise 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}


/* ==============================================
   14. SCROLL INDICATOR
   Already defined in style.css as 'scroll-fade'
   Adding additional subtle bounce for the line
   ============================================== */

@keyframes line-grow {
  0%   { height: 0; opacity: 0; }
  100% { height: 32px; opacity: 1; }
}

.scroll-line {
  animation: line-grow 1s ease 1.5s both, scroll-fade 3s ease-in-out 1.5s infinite;
}


/* ==============================================
   15. REDUCED MOTION — ACCESSIBILITY
   Respect user's OS preference to reduce motion
   ============================================== */

@media (prefers-reduced-motion: reduce) {

  /* Disable all animations and transitions for users
     who prefer reduced motion */
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  /* Ensure reveal elements are visible immediately */
  .reveal-up,
  .reveal-left,
  .reveal-right,
  .reveal-fade {
    opacity: 1;
    transform: none;
  }

  .testimonial-card:not(.is-visible) {
    opacity: 1;
    scale: 1;
  }

  .reason-card:not(.is-visible) {
    opacity: 1;
    transform: none;
  }
}
