/* ============================================================
   IXWEB — Animations & Micro-interactions
   Respects prefers-reduced-motion
   ============================================================ */

/* ── Animate on Scroll (AOS-like) ── */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s var(--ease-out),
                transform 0.7s var(--ease-out);
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered delays for children */
.animate-on-scroll:nth-child(2) { transition-delay: 0.1s; }
.animate-on-scroll:nth-child(3) { transition-delay: 0.2s; }
.animate-on-scroll:nth-child(4) { transition-delay: 0.3s; }
.animate-on-scroll:nth-child(5) { transition-delay: 0.4s; }
.animate-on-scroll:nth-child(6) { transition-delay: 0.5s; }


/* ── Hero Orbs Animation ── */
.hero__orb--1 {
    animation: orb-float-1 12s ease-in-out infinite;
}

.hero__orb--2 {
    animation: orb-float-2 15s ease-in-out infinite;
}

.hero__orb--3 {
    animation: orb-float-3 10s ease-in-out infinite;
}

@keyframes orb-float-1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(-40px, 30px) scale(1.05); }
    50% { transform: translate(20px, -20px) scale(0.95); }
    75% { transform: translate(-20px, -40px) scale(1.02); }
}

@keyframes orb-float-2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(50px, -30px) scale(1.08); }
    66% { transform: translate(-30px, 40px) scale(0.92); }
}

@keyframes orb-float-3 {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.3; }
    50% { transform: translate(calc(-50% + 30px), calc(-50% - 20px)) scale(1.1); opacity: 0.5; }
}


/* ── Floating Badges ── */
.floating-badge {
    animation: float-badge 4s ease-in-out infinite;
    animation-delay: var(--delay, 0s);
}

@keyframes float-badge {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-12px); }
}


/* ── Hero Mockup Shimmer ── */
.hero__mockup-content .mockup-block {
    position: relative;
    overflow: hidden;
}

.hero__mockup-content .mockup-block::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: shimmer 3s ease-in-out infinite;
}

.hero__mockup-content .mockup-block:nth-child(2)::after { animation-delay: 0.3s; }
.hero__mockup-content .mockup-block:nth-child(3)::after { animation-delay: 0.6s; }

@keyframes shimmer {
    0% { left: -100%; }
    50%, 100% { left: 200%; }
}


/* ── Stat Counter Animation ── */
.stat-item__number {
    transition: all 0.3s ease;
}


/* ── Service Card Tilt effect (enhanced by JS) ── */
.service-card {
    will-change: transform;
    transform-style: preserve-3d;
}

.service-card__icon,
.service-card__title {
    transform: translateZ(20px);
}


/* ── Case Card Hover Effects ── */
.case-card__image .case-card__mockup-mini {
    transition: transform var(--duration-normal) var(--ease-out);
}

.case-card:hover .case-card__mockup-mini {
    transform: scale(1.05);
}


/* ── Process Step Connector Animation ── */
.process__line {
    background: linear-gradient(to bottom, var(--accent) var(--progress, 0%), var(--gray-200) var(--progress, 0%));
    transition: --progress 0.5s ease;
}


/* ── FAQ Accordion Animation ── */
.faq-item__answer {
    transition: max-height 0.4s var(--ease-out);
}


/* ── Button Hover Shine ── */
.btn--primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.5s ease;
}

.btn--primary:hover::before {
    left: 100%;
}


/* ── Smooth Section Transitions ── */
section {
    position: relative;
}


/* ── Logos pause on hover ── */
.social-proof__logos:hover .logos-track {
    animation-play-state: paused;
}


/* ── Pricing Card Glow on Hover ── */
.pricing-card::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    border-radius: var(--radius-xl);
    background: var(--gradient-main);
    opacity: 0;
    z-index: -1;
    transition: opacity var(--duration-normal) ease;
}

.pricing-card:hover::before {
    opacity: 0.15;
}


/* ── Guarantee Item Pulse ── */
.guarantee-item:hover .guarantee-item__icon {
    animation: icon-bounce 0.5s var(--ease-spring);
}

@keyframes icon-bounce {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}


/* ── Contact Form Focus Glow ── */
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    animation: input-glow 0.3s ease;
}

@keyframes input-glow {
    0% { box-shadow: 0 0 0 0 rgba(108, 99, 255, 0.3); }
    100% { box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.1); }
}


/* ── Thank You Check Mark Animation ── */
.thank-you__icon svg circle {
    stroke-dasharray: 188.5;
    stroke-dashoffset: 188.5;
    animation: draw-circle 0.8s ease-out forwards;
}

.thank-you__icon svg path {
    stroke-dasharray: 40;
    stroke-dashoffset: 40;
    animation: draw-check 0.5s ease-out 0.6s forwards;
}

@keyframes draw-circle {
    to { stroke-dashoffset: 0; }
}

@keyframes draw-check {
    to { stroke-dashoffset: 0; }
}


/* ── Particle Animation (for hero particles) ── */
.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(108, 99, 255, 0.5);
    pointer-events: none;
    animation: particle-float linear infinite;
}

@keyframes particle-float {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(50px);
        opacity: 0;
    }
}


/* ── Magnetic Button Effect (enhanced by JS) ── */
.btn--primary {
    transition: all var(--duration-normal) var(--ease-out),
                transform 0.2s ease;
}


/* ── Header transition ── */
.header {
    transition: background var(--duration-normal) ease,
                box-shadow var(--duration-normal) ease,
                backdrop-filter var(--duration-normal) ease,
                transform var(--duration-normal) ease;
}

.header.hidden {
    transform: translateY(-100%);
}


/* ═══════════════════════════════════════
   REDUCED MOTION — Accessibility
   ═══════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .animate-on-scroll {
        opacity: 1;
        transform: none;
    }

    .hero__orb {
        animation: none;
    }

    .floating-badge {
        animation: none;
    }

    .logos-track {
        animation: none;
    }

    .scroll-mouse__wheel {
        animation: none;
    }

    .particle {
        display: none;
    }

    .cursor-glow {
        display: none;
    }

    .mockup-block::after {
        animation: none !important;
        display: none;
    }
}
