/**
 * Flynia Animations
 * Subtle, premium scroll and hover animations
 * @package Flynia
 */

/* ============================================================
   SCROLL REVEAL BASE STATES
   ============================================================ */
.fade-in-up,
.fade-in-left,
.fade-in-right,
.stagger-children > * {
  opacity: 0;
  will-change: opacity, transform;
  transition:
    opacity 0.65s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.65s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in-up {
  transform: translateY(28px);
}

.fade-in-left {
  transform: translateX(-28px);
}

.fade-in-right {
  transform: translateX(28px);
}

.stagger-children > * {
  transform: translateY(20px);
}

/* Animated (visible) state */
.fade-in-up.animated,
.fade-in-left.animated,
.fade-in-right.animated,
.stagger-children > *.animated {
  opacity: 1;
  transform: translate(0, 0);
}

/* Stagger delays for children */
.stagger-children > *:nth-child(1)  { transition-delay: 0.00s; }
.stagger-children > *:nth-child(2)  { transition-delay: 0.08s; }
.stagger-children > *:nth-child(3)  { transition-delay: 0.16s; }
.stagger-children > *:nth-child(4)  { transition-delay: 0.24s; }
.stagger-children > *:nth-child(5)  { transition-delay: 0.32s; }
.stagger-children > *:nth-child(6)  { transition-delay: 0.40s; }
.stagger-children > *:nth-child(7)  { transition-delay: 0.48s; }
.stagger-children > *:nth-child(8)  { transition-delay: 0.56s; }

/* ============================================================
   HERO PAN ANIMATION
   (defined in style.css, reinforced here)
   ============================================================ */
@keyframes heroPan {
  from { transform: scale(1.00); }
  to   { transform: scale(1.08); }
}

/* ============================================================
   BUTTON PULSE (for primary CTAs only)
   ============================================================ */
@keyframes buttonPulse {
  0%   { box-shadow: 0 0 0 0 rgba(244, 122, 32, 0.45); }
  70%  { box-shadow: 0 0 0 12px rgba(244, 122, 32, 0); }
  100% { box-shadow: 0 0 0 0 rgba(244, 122, 32, 0); }
}

.btn--primary.pulse {
  animation: buttonPulse 2s ease-in-out infinite;
}

/* ============================================================
   CARD IMAGE ZOOM
   (handled in style.css via .card:hover .card__image img)
   Extra polish on focus-visible for accessibility
   ============================================================ */
.card:focus-within .card__image img {
  transform: scale(1.04);
}

/* ============================================================
   SERVICE CARD ICON SPIN
   ============================================================ */
@keyframes iconSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.service-card:hover .service-card__icon svg {
  /* subtle rotation on hover — use with care */
  /* animation: iconSpin 0.5s ease; */
}

/* ============================================================
   SHIMMER LOADING (skeleton screens - future use)
   ============================================================ */
@keyframes shimmer {
  0%   { background-position: -1000px 0; }
  100% { background-position: 1000px 0; }
}

.skeleton {
  background: linear-gradient(
    90deg,
    #f0f0f0 25%,
    #e0e0e0 50%,
    #f0f0f0 75%
  );
  background-size: 1000px 100%;
  animation: shimmer 1.8s infinite linear;
  border-radius: 4px;
}

/* ============================================================
   SCROLL BOUNCE (hero scroll indicator)
   ============================================================ */
@keyframes scrollBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(6px); }
}

/* ============================================================
   PARTNERS TRACK SCROLL
   ============================================================ */
@keyframes partnerScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ============================================================
   FLOAT (for decorative elements)
   ============================================================ */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-10px); }
}

.float-animation {
  animation: float 5s ease-in-out infinite;
}

/* ============================================================
   LINK UNDERLINE SLIDE
   ============================================================ */
.link-underline {
  position: relative;
  display: inline-block;
}
.link-underline::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-orange);
  border-radius: 9999px;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.link-underline:hover::after { width: 100%; }

/* ============================================================
   RESPECT PREFERS-REDUCED-MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .fade-in-up,
  .fade-in-left,
  .fade-in-right,
  .stagger-children > * {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .hero__bg { animation: none !important; }
  .partners-track { animation: none !important; }
}
