/* Homepage motion layer — animations only; no layout/color/font changes at rest */

@media (prefers-reduced-motion: reduce) {
  body.er-home-animations .page-shell main .er-reveal,
  body.er-home-animations .page-shell main .er-reveal.er-revealed {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
  }

  body.er-home-animations .page-shell main .credit-card,
  body.er-home-animations .page-shell main .dashboard-card,
  body.er-home-animations .page-shell main .chart-line,
  body.er-home-animations .page-shell main .refund-banner .amount {
    animation: none !important;
  }
}

@media (prefers-reduced-motion: no-preference) {
  body.er-home-animations .page-shell main .er-reveal {
    opacity: 0;
    transform: translate3d(0, 18px, 0);
    transition:
      opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
      transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: var(--er-delay, 0ms);
    will-change: opacity, transform;
  }

  body.er-home-animations .page-shell main .er-reveal.er-revealed {
    opacity: 1;
    transform: translate3d(0, 0, 0);
    will-change: auto;
  }

  /* Hero visual — gentle float after entrance */
  body.er-home-animations .page-shell main .hero-visual.er-revealed .dashboard-card {
    animation: er-home-float 6s ease-in-out 0.4s infinite;
  }

  body.er-home-animations .page-shell main .hero-visual.er-revealed .credit-card {
    animation: er-home-float 5.5s ease-in-out 0.9s infinite reverse;
  }

  @keyframes er-home-float {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(0, -8px, 0); }
  }

  /* Refund amount — soft pulse */
  body.er-home-animations .page-shell main .refund-banner.er-revealed .amount {
    animation: er-home-amount-pulse 3.5s ease-in-out 0.6s infinite;
  }

  @keyframes er-home-amount-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.82; }
  }

  /* Chart lines grow in when card scrolls into view */
  body.er-home-animations .page-shell main .chart-card.er-reveal:not(.er-revealed) .chart-line {
    opacity: 0;
    transform: scaleX(0);
  }

  body.er-home-animations .page-shell main .chart-card.er-revealed .chart-line.one {
    animation: er-home-chart-one 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  }

  body.er-home-animations .page-shell main .chart-card.er-revealed .chart-line.two {
    animation: er-home-chart-two 0.95s cubic-bezier(0.22, 1, 0.36, 1) 0.12s forwards;
  }

  @keyframes er-home-chart-one {
    from {
      opacity: 0;
      transform: scaleX(0) rotate(-22deg);
    }
    to {
      opacity: 1;
      transform: scaleX(1) rotate(-22deg);
    }
  }

  @keyframes er-home-chart-two {
    from {
      opacity: 0;
      transform: scaleX(0) rotate(-10deg);
    }
    to {
      opacity: 1;
      transform: scaleX(1) rotate(-10deg);
    }
  }

  /* Icon boxes — subtle hover tilt */
  body.er-home-animations .page-shell main .feature-item.er-revealed .icon-box {
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  }

  body.er-home-animations .page-shell main .feature-item.er-revealed:hover .icon-box {
    transform: rotate(-4deg) scale(1.05);
  }

  /* Button press feedback (main content only) */
  body.er-home-animations .page-shell main .btn:active,
  body.er-home-animations .page-shell main .pay-btn:active {
    transform: scale(0.97);
  }

  body.er-home-animations .page-shell main .hero-form input {
    transition:
      border-color 0.25s ease,
      box-shadow 0.25s ease,
      transform 0.2s ease;
  }

  body.er-home-animations .page-shell main .hero-form input:focus {
    transform: translate3d(0, -1px, 0);
  }

  /* Testimonial nav — micro-interaction */
  body.er-home-animations .page-shell main .testimonial-nav button {
    transition:
      background 0.2s ease,
      transform 0.2s ease,
      box-shadow 0.2s ease;
  }

  body.er-home-animations .page-shell main .testimonial-nav button:hover:not(:disabled) {
    transform: translate3d(0, -2px, 0);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
  }

  body.er-home-animations .page-shell main .testimonial-nav button:active:not(:disabled) {
    transform: scale(0.94);
  }

  /* Pricing arrow nudge on hover */
  body.er-home-animations .page-shell main .price-card.er-revealed .price-bottom span {
    display: inline-block;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  }

  body.er-home-animations .page-shell main .price-card.er-revealed:hover .price-bottom span {
    transform: translate3d(4px, -4px, 0);
  }

  /* Header scroll — smoother fixed transition on home */
  body.er-home-animations .tp-header {
    transition:
      box-shadow 0.35s ease,
      background-color 0.35s ease,
      transform 0.35s ease;
  }

  body.er-home-animations .tp-header.fixed {
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  }
}
