/* ============================================
   DURI CRACKERS — Animations
   ============================================ */

/* ---------- Keyframes ---------- */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
}

@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-5deg); }
    50% { transform: rotate(0deg); }
    75% { transform: rotate(5deg); }
}

@keyframes float-around {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(30px, -30px) rotate(90deg);
    }
    50% {
        transform: translate(0, -60px) rotate(180deg);
    }
    75% {
        transform: translate(-30px, -30px) rotate(270deg);
    }
    100% {
        transform: translate(0, 0) rotate(360deg);
    }
}

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

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.85);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

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

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

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

/* ---------- Scroll Animation Classes ---------- */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

/* Staggered animation delays for grid children */
.about-grid .about-card:nth-child(1).animated { transition-delay: 0s; }
.about-grid .about-card:nth-child(2).animated { transition-delay: 0.1s; }
.about-grid .about-card:nth-child(3).animated { transition-delay: 0.2s; }
.about-grid .about-card:nth-child(4).animated { transition-delay: 0.3s; }

.features-grid .feature-card:nth-child(1).animated { transition-delay: 0s; }
.features-grid .feature-card:nth-child(2).animated { transition-delay: 0.1s; }
.features-grid .feature-card:nth-child(3).animated { transition-delay: 0.2s; }
.features-grid .feature-card:nth-child(4).animated { transition-delay: 0.3s; }

.business-grid .biz-card:nth-child(1).animated { transition-delay: 0s; }
.business-grid .biz-card:nth-child(2).animated { transition-delay: 0.1s; }
.business-grid .biz-card:nth-child(3).animated { transition-delay: 0.2s; }
.business-grid .biz-card:nth-child(4).animated { transition-delay: 0.3s; }

.process-step:nth-child(2).animated { transition-delay: 0s; }
.process-step:nth-child(3).animated { transition-delay: 0.15s; }
.process-step:nth-child(4).animated { transition-delay: 0.3s; }
.process-step:nth-child(5).animated { transition-delay: 0.45s; }
.process-step:nth-child(6).animated { transition-delay: 0.6s; }

/* ---------- Hover micro-animations ---------- */
.nav-logo:hover .logo-icon {
    animation: wiggle 0.5s ease-in-out;
}

.variant-card:hover .variant-emoji {
    animation: bounceIn 0.6s ease;
}

.roadmap-item:hover .roadmap-icon {
    animation: pulse 0.5s ease;
}

.biz-card:hover .biz-icon {
    animation: pulse 0.5s ease;
}

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

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

    .float-item {
        display: none;
    }
}

/* ---------- Hero Auto Slide (Perbaikan Persegi) ---------- */
.hero-image-wrapper {
    width: 100%;
    max-width: 500px; /* Sesuaikan dengan style.css Anda */
    aspect-ratio: 1 / 1; /* MEMAKSA BENTUK PERSEGI */
    overflow: hidden;
    border-radius: var(--radius-xl);
    position: relative;
}

.hero-slider-inner {
    display: flex;
    width: 200%; 
    height: 100%;
    animation: heroAutoSlide 8s infinite ease-in-out;
}

.hero-slide-img {
    width: 50%; /* Mengisi setengah dari 200% */
    height: 100%;
    /* KUNCI UTAMA: Gambar akan dipotong (crop) otomatis agar pas di kotak persegi 
       tanpa merusak rasio (tidak gepeng) */
    object-fit: cover; 
    flex-shrink: 0;
}

@keyframes heroAutoSlide {
    0%, 45% { transform: translateX(0); }      /* Gambar 1 diam */
    50%, 95% { transform: translateX(-50%); }  /* Gambar 2 diam */
    100% { transform: translateX(0); }         /* Kembali ke Gambar 1 */
}
