/* =========================================================
   AGF Motion System — scroll reveals + micro-interactions
   ========================================================= */

.agf-reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.agf-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* JS-enabled pending state for home sections */
html.agf-js .agf-motion-pending:not(.is-visible) {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

html.agf-js .agf-motion-pending.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.agf-reveal--left {
  transform: translateX(32px);
}

.agf-reveal--left.is-visible {
  transform: translateX(0);
}

.agf-reveal--right {
  transform: translateX(-32px);
}

.agf-reveal--right.is-visible {
  transform: translateX(0);
}

.agf-reveal--scale {
  transform: scale(0.94);
}

.agf-reveal--scale.is-visible {
  transform: scale(1);
}

.agf-reveal-stagger > * {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.agf-reveal-stagger.is-visible > *:nth-child(1) { transition-delay: 0.05s; }
.agf-reveal-stagger.is-visible > *:nth-child(2) { transition-delay: 0.1s; }
.agf-reveal-stagger.is-visible > *:nth-child(3) { transition-delay: 0.15s; }
.agf-reveal-stagger.is-visible > *:nth-child(4) { transition-delay: 0.2s; }
.agf-reveal-stagger.is-visible > *:nth-child(5) { transition-delay: 0.25s; }
.agf-reveal-stagger.is-visible > *:nth-child(6) { transition-delay: 0.3s; }

.agf-reveal-stagger.is-visible > * {
  opacity: 1;
  transform: translateY(0);
}

/* Hero entrance */
.agf-parallax-hero .agf-hero-card {
  animation: agfHeroCard 0.9s 0.15s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.agf-parallax-hero .agf-hero-showcase {
  animation: agfHeroShow 1s 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.agf-parallax-hero .agf-hero-scroll {
  animation: agfFadeUp 0.8s 0.9s both;
}

@keyframes agfHeroCard {
  from {
    opacity: 0;
    transform: translateY(36px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes agfHeroShow {
  from {
    opacity: 0;
    transform: translateX(-28px) rotate(-2deg);
  }
  to {
    opacity: 1;
    transform: translateX(0) rotate(0);
  }
}

@keyframes agfFadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Floating tech icons */
.agf-floating-shape {
  animation: agfFloat 6s ease-in-out infinite;
}

.agf-floating-shape--1 { animation-delay: 0s; }
.agf-floating-shape--2 { animation-delay: 0.4s; }
.agf-floating-shape--3 { animation-delay: 0.8s; }
.agf-floating-shape--4 { animation-delay: 1.2s; }
.agf-floating-shape--5 { animation-delay: 1.6s; }
.agf-floating-shape--6 { animation-delay: 2s; }

@keyframes agfFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-14px) rotate(6deg); }
}

/* Card magnetic hover polish */
.agf-highlight-card,
.agf-service-card,
.agf-feature-card,
.agf-adv-card,
.agf-kpi-card,
.agf-ws-card,
.portfolio-card {
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.35s ease,
    border-color 0.35s ease !important;
}

.agf-highlight-card:hover .agf-highlight-card__icon,
.agf-service-card:hover .agf-service-card__icon {
  transform: scale(1.08) rotate(-4deg);
}

.agf-highlight-card__icon,
.agf-service-card__icon,
.agf-feature-card__icon {
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

/* Home titles */
.agf-home-title h2 {
  position: relative;
  display: inline-block;
}

.agf-home-title h2::after {
  content: "";
  position: absolute;
  bottom: -8px;
  right: 50%;
  transform: translateX(50%) scaleX(0);
  width: 56px;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, transparent, #21C77A, transparent);
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.agf-home-title.is-visible h2::after,
.agf-reveal.is-visible .agf-home-title h2::after,
.agf-home-block.is-visible .agf-home-title h2::after {
  transform: translateX(50%) scaleX(1);
}

/* Plans section motion */
.arvino-plans-section .arvino-plans-content {
  animation: agfHeroCard 0.85s 0.1s both;
}

.arvino-plans-section .arvino-plans-visual {
  animation: agfHeroShow 0.95s 0.25s both;
}

.arvino-plans-glow-1 {
  animation: agfGlowDrift 10s ease-in-out infinite;
}

.arvino-plans-glow-2 {
  animation: agfGlowDrift 12s ease-in-out infinite reverse;
}

@keyframes agfGlowDrift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -20px) scale(1.08); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .agf-reveal,
  .agf-reveal-stagger > *,
  .agf-parallax-hero .agf-hero-card,
  .agf-parallax-hero .agf-hero-showcase,
  .agf-floating-shape,
  .arvino-plans-glow-1,
  .arvino-plans-glow-2,
  .agf-ux .menu_sticky,
  .agf-ux .agf-bottom-nav,
  .agf-ux .agf-bottom-nav__fab {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
