/**
 * Alphamoto — site-wide animation set
 * Scroll reveal, stagger, hover micro-interactions, reduced-motion safe
 */

:root {
    --am-duration: 0.65s;
    --am-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --am-distance: 32px;
    --am-stagger-step: 80ms;
}

/* Progressive enhancement: content visible without JS */
.am-js .am-animate:not(.am-visible) {
    opacity: 0;
    will-change: opacity, transform;
}

.am-js .am-animate.am-fade-up:not(.am-visible) {
    transform: translate3d(0, var(--am-distance), 0);
}

.am-js .am-animate.am-fade-down:not(.am-visible) {
    transform: translate3d(0, calc(var(--am-distance) * -1), 0);
}

.am-js .am-animate.am-fade-left:not(.am-visible) {
    transform: translate3d(var(--am-distance), 0, 0);
}

.am-js .am-animate.am-fade-right:not(.am-visible) {
    transform: translate3d(calc(var(--am-distance) * -1), 0, 0);
}

.am-js .am-animate.am-zoom-in:not(.am-visible) {
    transform: scale(0.92);
}

.am-js .am-animate.am-zoom-out:not(.am-visible) {
    transform: scale(1.06);
}

.am-animate {
    transition:
        opacity var(--am-duration) var(--am-ease),
        transform var(--am-duration) var(--am-ease);
}

.am-animate.am-visible {
    opacity: 1;
    transform: none;
}

/* Page enter */
.am-page-enter {
    animation: amPageEnter 0.5s var(--am-ease) both;
}

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

/* Hero / above-fold load animations */
.am-onload.am-animate {
    transition-delay: var(--am-delay, 0ms);
}

/* Hover lift — cards & tiles */
.am-hover-lift {
    transition:
        transform 0.32s var(--am-ease),
        box-shadow 0.32s ease,
        border-color 0.25s ease;
}

.am-hover-lift:hover {
    transform: translateY(-5px);
}

/* Button press */
.primary__btn,
.ip-card__btn,
.about-cta__btn {
    transition:
        transform 0.2s ease,
        box-shadow 0.25s ease,
        background-color 0.25s ease,
        color 0.25s ease;
}

.primary__btn:active,
.ip-card__btn:active,
.about-cta__btn:active {
    transform: translateY(1px) scale(0.98);
}

/* Animated underline links */
.am-link {
    position: relative;
    text-decoration: none;
}

.am-link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 100%;
    height: 2px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s var(--am-ease);
}

.am-link:hover::after {
    transform: scaleX(1);
}

/* Footer & nav subtle fade */
.footer-v2 .footer__widget,
.footer-v2 .newsletter__area {
    transition: transform 0.3s ease;
}

/* Scroll-to-top pulse when active */
#scroll__top.active {
    animation: amScrollPulse 2s ease-in-out infinite;
}

@keyframes amScrollPulse {
    0%, 100% { box-shadow: 0 4px 16px rgba(37, 153, 212, 0.35); }
    50%      { box-shadow: 0 6px 24px rgba(37, 153, 212, 0.55); }
}

/* Shipping bar icons */
.shipping__items {
    transition: transform 0.3s ease;
}

.shipping__items:hover {
    transform: translateY(-3px);
}

/* Breadcrumb subtle reveal */
.breadcrumb__content {
    transition: opacity 0.5s ease, transform 0.5s var(--am-ease);
}

/* Client cards — unified with am-visible */
.am-js .client__card:not(.am-visible) {
    opacity: 0;
    transform: translateY(24px);
}

.client__card.am-visible,
.client__card.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Counter pop when visible */
.am-counter.am-visible {
    animation: amCounterPop 0.5s var(--am-ease);
}

@keyframes amCounterPop {
    0%   { transform: scale(0.85); opacity: 0.5; }
    60%  { transform: scale(1.04); }
    100% { transform: scale(1); opacity: 1; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .am-js .am-animate:not(.am-visible) {
        opacity: 1;
        transform: none;
    }

    .am-animate,
    .am-hover-lift,
    .primary__btn,
    .ip-card__btn,
    .about-cta__btn,
    .shipping__items,
    #scroll__top.active {
        transition: none !important;
        animation: none !important;
    }

    .am-page-enter {
        animation: none;
    }
}
