/**
 * Premium Animation System — Mikal Germany
 * Purposeful motion: hero choreography, scroll reveals, micro-interactions
 *
 * Easing: ease-out-quart (0.25, 1, 0.5, 1) — smooth, refined
 * Durations: 100-150ms feedback, 200-300ms state, 500-800ms entrance
 */

/* ═══════════════════════════════════════════════════════════════
   CSS CUSTOM PROPERTIES
   ═══════════════════════════════════════════════════════════════ */
:root {
    --anim-ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
    --anim-ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --anim-ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
    --anim-duration-fast: 200ms;
    --anim-duration-normal: 350ms;
    --anim-duration-slow: 600ms;
    --anim-duration-entrance: 800ms;
}

/* ═══════════════════════════════════════════════════════════════
   ENHANCED SCROLL REVEAL SYSTEM
   ═══════════════════════════════════════════════════════════════ */

/* Base reveal — hidden until triggered (only when JS is enabled to avoid SEO impact) */
.js-enabled .reveal-up,
.js-enabled .reveal-down,
.js-enabled .reveal-left,
.js-enabled .reveal-right,
.js-enabled .reveal-scale,
.js-enabled .reveal-fade {
    opacity: 0;
    will-change: transform, opacity;
    transition: opacity var(--anim-duration-entrance) var(--anim-ease-out-expo),
                transform var(--anim-duration-entrance) var(--anim-ease-out-expo);
}

/* Directions (only when JS is enabled) */
.js-enabled .reveal-up    { transform: translateY(40px); }
.js-enabled .reveal-down  { transform: translateY(-40px); }
.js-enabled .reveal-left  { transform: translateX(40px); }
.js-enabled .reveal-right { transform: translateX(-40px); }
.js-enabled .reveal-scale { transform: scale(0.92); }
.js-enabled .reveal-fade  { transform: none; }

/* Revealed state */
.reveal-up.is-visible,
.reveal-down.is-visible,
.reveal-left.is-visible,
.reveal-right.is-visible,
.reveal-scale.is-visible,
.reveal-fade.is-visible {
    opacity: 1;
    transform: none;
}

/* Stagger delays — via data-stagger attribute */
[data-stagger="1"] { transition-delay: 80ms; }
[data-stagger="2"] { transition-delay: 160ms; }
[data-stagger="3"] { transition-delay: 240ms; }
[data-stagger="4"] { transition-delay: 320ms; }
[data-stagger="5"] { transition-delay: 400ms; }
[data-stagger="6"] { transition-delay: 480ms; }
[data-stagger="7"] { transition-delay: 560ms; }
[data-stagger="8"] { transition-delay: 640ms; }

/* ═══════════════════════════════════════════════════════════════
   HERO ENTRANCE CHOREOGRAPHY
   ═══════════════════════════════════════════════════════════════ */

/* Hero elements — orchestrated page-load sequence */
.hero-choreo {
    opacity: 0;
    transform: translateY(24px);
    animation: heroChoreoIn 0.9s var(--anim-ease-out-expo) forwards;
}

.hero-choreo[data-hero-step="1"] { animation-delay: 0.15s; }
.hero-choreo[data-hero-step="2"] { animation-delay: 0.3s; }
.hero-choreo[data-hero-step="3"] { animation-delay: 0.45s; }
.hero-choreo[data-hero-step="4"] { animation-delay: 0.6s; }
.hero-choreo[data-hero-step="5"] { animation-delay: 0.75s; }
.hero-choreo[data-hero-step="6"] { animation-delay: 0.9s; }

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

/* Hero image — dramatic entrance */
.hero-image-choreo {
    opacity: 0;
    transform: scale(0.94) translateY(20px);
    animation: heroImageIn 1.1s var(--anim-ease-out-expo) 0.2s forwards;
}

@keyframes heroImageIn {
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Floating cards — delayed cascade */
.hero-float-card {
    opacity: 0;
    transform: translateY(16px) scale(0.95);
    animation: heroFloatCardIn 0.8s var(--anim-ease-out-expo) forwards;
}

.hero-float-card[data-float-delay="1"] { animation-delay: 0.8s; }
.hero-float-card[data-float-delay="2"] { animation-delay: 1.0s; }

@keyframes heroFloatCardIn {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ═══════════════════════════════════════════════════════════════
   HERO PARALLAX (applied via JS)
   ═══════════════════════════════════════════════════════════════ */
.hero-parallax-layer {
    will-change: transform;
    transition: transform 0.1s linear;
}

/* ═══════════════════════════════════════════════════════════════
   STATS BAR FLOAT
   ═══════════════════════════════════════════════════════════════ */
.hero-stats-bar {
    animation: statsBarFloat 0.7s var(--anim-ease-out-expo) 0.6s both;
}

@keyframes statsBarFloat {
    from {
        opacity: 0;
        transform: translateY(32px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ═══════════════════════════════════════════════════════════════
   ENHANCED CARD INTERACTIONS
   ═══════════════════════════════════════════════════════════════ */

/* Why-Us cards — enhanced hover */
.why-card {
    transition: transform 0.45s var(--anim-ease-out-expo),
                box-shadow 0.45s ease,
                border-color 0.45s ease;
}

.why-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 24px 64px rgba(10, 92, 24, 0.12);
    border-color: rgba(10, 92, 24, 0.12);
}

/* Service zigzag cards — enhanced hover */
.services-zigzag-card {
    transition: transform 0.45s var(--anim-ease-out-expo),
                box-shadow 0.45s ease,
                border-color 0.45s ease;
}

.services-zigzag-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 24px 64px rgba(10, 92, 24, 0.1);
}

/* Testimonial cards — enhanced hover */
.testi-card {
    transition: transform 0.4s var(--anim-ease-out-expo),
                box-shadow 0.4s ease;
}

.testi-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(10, 92, 24, 0.08);
}

/* Featured testimonial — subtle lift */
.testi-featured-inner {
    transition: transform 0.5s var(--anim-ease-out-expo),
                box-shadow 0.5s ease;
}

.testi-featured-inner:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(10, 92, 24, 0.08),
                0 32px 80px rgba(10, 92, 24, 0.06);
}

/* ═══════════════════════════════════════════════════════════════
   BUTTON MICRO-INTERACTIONS
   ═══════════════════════════════════════════════════════════════ */

/* Primary button — enhanced feedback */
.btn-primary,
.mikal-btn-primary,
.header-cta,
.mobile-menu-cta--primary {
    position: relative;
    overflow: hidden;
    transition: transform 0.25s var(--anim-ease-out-expo),
                box-shadow 0.3s ease;
}

.btn-primary::after,
.mikal-btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--ripple-x, 50%) var(--ripple-y, 50%), 
                rgba(255, 255, 255, 0.3) 0%, 
                transparent 60%);
    opacity: 0;
    transform: scale(0);
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none;
}

.btn-primary:active::after,
.mikal-btn-primary:active::after {
    opacity: 1;
    transform: scale(2.5);
    transition: opacity 0.1s ease, transform 0.1s ease;
}

/* Outline button — enhanced feedback */
.btn-outline,
.mikal-btn-dark {
    transition: transform 0.25s var(--anim-ease-out-expo),
                background-color 0.3s ease,
                border-color 0.3s ease,
                box-shadow 0.3s ease;
}

/* ═══════════════════════════════════════════════════════════════
   FLOATING ELEMENTS — NATURAL MOTION
   ═══════════════════════════════════════════════════════════════ */

/* Refined floating animation */
.floating-card,
.hero-floating-card {
    animation: naturalFloat 6s ease-in-out infinite;
}

@keyframes naturalFloat {
    0%, 100% { transform: translateY(0); }
    25% { transform: translateY(-6px); }
    75% { transform: translateY(4px); }
}

/* Services floating badges — varied timing */
.services-floating-badge {
    transition: transform 0.3s var(--anim-ease-out-expo);
}

.services-badge-1 {
    animation: badgeFloat1 7s ease-in-out infinite;
}

.services-badge-2 {
    animation: badgeFloat2 8s ease-in-out infinite;
}

@keyframes badgeFloat1 {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    33% { transform: translateY(-8px) rotate(1deg); }
    66% { transform: translateY(4px) rotate(-1deg); }
}

@keyframes badgeFloat2 {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    40% { transform: translateY(6px) rotate(-1deg); }
    70% { transform: translateY(-6px) rotate(1deg); }
}

/* Services icon circle — subtle breathing */
.services-icon-circle {
    animation: iconBreathe 4s ease-in-out infinite;
}

@keyframes iconBreathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

/* ═══════════════════════════════════════════════════════════════
   SECTION TRANSITIONS — SMOOTH FLOW
   ═══════════════════════════════════════════════════════════════ */

/* Section divider lines — animated reveal */
.section-divider {
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--clr-primary, #0a5c18), transparent);
    margin: 0 auto;
    transition: width 1s var(--anim-ease-out-expo);
}

.section-divider.is-visible {
    width: 120px;
}

/* ═══════════════════════════════════════════════════════════════
   PROCESS TIMELINE — ENHANCED
   ═══════════════════════════════════════════════════════════════ */

/* Process marker — pulse on scroll */
.process-marker-icon {
    transition: transform 0.4s var(--anim-ease-out-expo),
                box-shadow 0.4s ease;
}

.process-step:hover .process-marker-icon {
    transform: scale(1.12);
    box-shadow: 0 8px 32px rgba(10, 92, 24, 0.5),
                0 0 0 4px rgba(136, 217, 130, 0.15);
}

/* Process card — slide on hover */
.process-card {
    transition: transform 0.4s var(--anim-ease-out-expo),
                background 0.3s ease,
                border-color 0.3s ease;
}

.process-step:hover .process-card {
    transform: translateX(8px);
}

@media (min-width: 1024px) {
    .process-step:hover .process-card {
        transform: translateY(-4px);
    }
}

/* ═══════════════════════════════════════════════════════════════
   FAQ — SMOOTH EXPAND
   ═══════════════════════════════════════════════════════════════ */
.mikal-faq-item {
    transition: transform 0.3s var(--anim-ease-out-expo),
                box-shadow 0.3s ease;
}

.mikal-faq-item:hover {
    transform: translateY(-2px);
}

/* FAQ icon rotation */
.mikal-faq-icon {
    transition: transform 0.35s var(--anim-ease-out-expo),
                color 0.25s ease;
}

.mikal-faq-item[open] .mikal-faq-icon {
    transform: rotate(180deg);
}

/* ═══════════════════════════════════════════════════════════════
   CTA BANNER — ENTRANCE
   ═══════════════════════════════════════════════════════════════ */
.mikal-final-cta {
    transition: transform 0.5s var(--anim-ease-out-expo),
                box-shadow 0.5s ease;
}

/* ═══════════════════════════════════════════════════════════════
   FLOATING WHATSAPP — SUBTLE PULSE
   ═══════════════════════════════════════════════════════════════ */
.floating-whatsapp {
    animation: whatsappPulse 3s ease-in-out infinite;
}

@keyframes whatsappPulse {
    0%, 100% { box-shadow: 0 20px 40px -20px rgba(18, 27, 21, 0.95); }
    50% { box-shadow: 0 20px 40px -20px rgba(18, 27, 21, 0.95),
                      0 0 0 8px rgba(45, 214, 107, 0.15); }
}

.floating-whatsapp:hover {
    animation: none;
    transform: translateY(-4px) scale(1.04);
}

/* ═══════════════════════════════════════════════════════════════
   TRUST STRIP — STAGGERED ENTRANCE
   ═══════════════════════════════════════════════════════════════ */
.why-trust-item,
.stats-trust-item,
.testi-trust-stat {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.5s var(--anim-ease-out-expo),
                transform 0.5s var(--anim-ease-out-expo);
}

.trust-stagger-1 { transition-delay: 0.1s; }
.trust-stagger-2 { transition-delay: 0.2s; }
.trust-stagger-3 { transition-delay: 0.3s; }
.trust-stagger-4 { transition-delay: 0.4s; }

.trust-revealed .why-trust-item,
.trust-revealed .stats-trust-item,
.trust-revealed .testi-trust-stat {
    opacity: 1;
    transform: translateY(0);
}

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

    .reveal-up,
    .reveal-down,
    .reveal-left,
    .reveal-right,
    .reveal-scale,
    .reveal-fade,
    .hero-choreo,
    .hero-image-choreo,
    .hero-float-card,
    .hero-stats-bar,
    .why-trust-item,
    .stats-trust-item,
    .testi-trust-stat {
        opacity: 1 !important;
        transform: none !important;
    }
}
