/* ============================================
   MERENDELS.COM - Animations
   ============================================ */

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

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

@keyframes float-orb-3 {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    33% { transform: translate(-45%, -55%) scale(1.08); }
    66% { transform: translate(-55%, -45%) scale(0.95); }
}

@keyframes scroll-bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(8px); }
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.3); }
    50% { box-shadow: 0 0 20px 4px rgba(79, 70, 229, 0.15); }
}

/* --- Hero Orb Animations --- */
.hero__orb--1 {
    animation: float-orb-1 15s ease-in-out infinite;
}

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

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

/* --- Scroll Indicator --- */
.hero__scroll-indicator {
    animation: scroll-bounce 2s ease-in-out infinite;
}

/* --- Scroll Animations --- */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition:
        opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: var(--delay, 0s);
}

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

/* --- Card Hover Glow --- */
.service-card:hover {
    animation: pulse-glow 2s ease-in-out infinite;
}

/* --- Button Hover --- */
.btn--primary::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, var(--primary-end), var(--primary-start));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.btn--primary {
    position: relative;
    z-index: 1;
}

.btn--primary:hover::after {
    opacity: 1;
}

/* --- Navbar transition --- */
.navbar__link {
    transition: color 0.2s ease;
}

/* --- Team Avatar Hover --- */
.team-card__avatar {
    transition: transform 0.3s ease;
}

.team-card:hover .team-card__avatar {
    transform: scale(1.05);
}

/* --- Portfolio Image Scale --- */
.portfolio-card {
    overflow: hidden;
}

/* --- Form Focus Glow --- */
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* --- Stagger utility for grids --- */
.services__grid .service-card:nth-child(1) { --delay: 0s; }
.services__grid .service-card:nth-child(2) { --delay: 0.1s; }
.services__grid .service-card:nth-child(3) { --delay: 0.2s; }
.services__grid .service-card:nth-child(4) { --delay: 0.3s; }
.services__grid .service-card:nth-child(5) { --delay: 0.4s; }
.services__grid .service-card:nth-child(6) { --delay: 0.5s; }

/* ============================================
   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;
        transition: none;
    }

    .hero__orb--1,
    .hero__orb--2,
    .hero__orb--3 {
        animation: none;
    }

    .hero__scroll-indicator {
        animation: none;
    }

    html {
        scroll-behavior: auto;
    }
}
