/* ============================================
   LinkAPI Landing Page — Scroll Animations
   ============================================ */

/* --- Keyframes --- */
@keyframes float-slow {

    0%,
    100% {
        transform: translate(0, 0);
    }

    25% {
        transform: translate(-20px, 15px);
    }

    50% {
        transform: translate(10px, -20px);
    }

    75% {
        transform: translate(15px, 10px);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-12px);
    }
}

@keyframes pulse-dot {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.5);
    }
}

@keyframes scroll-wheel {
    0% {
        transform: translateY(0);
        opacity: 1;
    }

    100% {
        transform: translateY(8px);
        opacity: 0;
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

@keyframes gradient-shift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

@keyframes count-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Scroll Animation Base States --- */
.animate-on-scroll {
    opacity: 0;
    transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
    will-change: opacity, transform;
}

/* Fade Up */
.animate-on-scroll[data-animation="fade-up"] {
    transform: translateY(40px);
}

/* Fade Down */
.animate-on-scroll[data-animation="fade-down"] {
    transform: translateY(-40px);
}

/* Fade Right */
.animate-on-scroll[data-animation="fade-right"] {
    transform: translateX(-50px);
}

/* Fade Left */
.animate-on-scroll[data-animation="fade-left"] {
    transform: translateX(50px);
}

/* Zoom In */
.animate-on-scroll[data-animation="zoom-in"] {
    transform: scale(0.9);
}

/* Zoom Out */
.animate-on-scroll[data-animation="zoom-out"] {
    transform: scale(1.1);
}

/* Flip Up */
.animate-on-scroll[data-animation="flip-up"] {
    transform: perspective(600px) rotateX(15deg);
}

/* --- Active State (visible) --- */
.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0) translateX(0) scale(1) rotateX(0);
}

/* --- Staggered Delays --- */
.animate-on-scroll[data-delay="100"] {
    transition-delay: 100ms;
}

.animate-on-scroll[data-delay="150"] {
    transition-delay: 150ms;
}

.animate-on-scroll[data-delay="200"] {
    transition-delay: 200ms;
}

.animate-on-scroll[data-delay="250"] {
    transition-delay: 250ms;
}

.animate-on-scroll[data-delay="300"] {
    transition-delay: 300ms;
}

.animate-on-scroll[data-delay="400"] {
    transition-delay: 400ms;
}

.animate-on-scroll[data-delay="450"] {
    transition-delay: 450ms;
}

.animate-on-scroll[data-delay="500"] {
    transition-delay: 500ms;
}

.animate-on-scroll[data-delay="600"] {
    transition-delay: 600ms;
}

/* --- Parallax subtle effect on hero shapes --- */
.hero__shape {
    transition: transform 0.3s ease-out;
}

/* --- Navbar logo hover effect --- */
.navbar__logo:hover .navbar__logo-icon {
    animation: float 1s ease-in-out;
}

/* --- Button ripple effect --- */
.btn {
    position: relative;
    overflow: hidden;
}

.btn .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    animation: ripple-effect 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple-effect {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* --- Service card hover glow trail --- */
.service-card::before {
    content: '';
    position: absolute;
    inset: -1px;
    background: linear-gradient(135deg, transparent 40%, var(--primary-300) 50%, transparent 60%);
    border-radius: inherit;
    opacity: 0;
    z-index: -1;
    transition: opacity var(--transition-slower);
}

.service-card:hover::before {
    opacity: 0.5;
}

/* --- Step number pulsing on visible --- */
.step.visible .step__number {
    animation: pulse-ring 2s ease-out 0.5s;
}

@keyframes pulse-ring {
    0% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
    }

    100% {
        box-shadow: 0 0 0 20px rgba(99, 102, 241, 0);
    }
}

/* --- Metric counter animation --- */
.metric.visible .metric__number {
    animation: count-up 0.5s var(--ease) forwards;
}

/* --- Smooth gradient background animation --- */
.text-gradient {
    background-size: 200% auto;
    animation: gradient-shift 3s ease-in-out infinite;
}

/* --- Reduce motion for accessibility --- */
@media (prefers-reduced-motion: reduce) {
    .animate-on-scroll {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .hero__shape,
    .hero__float-card,
    .hero__scroll-wheel,
    .hero__badge-dot,
    .text-gradient {
        animation: none;
    }
}