/**
 * DevcomKempen - Professional Scroll Animations
 * Subtle, modern animations for a web dev company
 */

/* ==========================================================================
   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 !important;
        transform: none !important;
    }
}

/* ==========================================================================
   Keyframe Animations
   ========================================================================== */

/* Fade in while rising */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade in while descending */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Simple fade in */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Subtle floating for decorative elements */
@keyframes floatSoft {
    0%, 100% {
        transform: translateY(0) translateX(0);
    }
    25% {
        transform: translateY(-8px) translateX(4px);
    }
    50% {
        transform: translateY(-4px) translateX(-4px);
    }
    75% {
        transform: translateY(-10px) translateX(2px);
    }
}

/* Subtle pulse for accent elements */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.2;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.25;
    }
}

/* ==========================================================================
   Scroll-Triggered Animation Base
   ========================================================================== */

/* Base state for scroll-triggered elements - hidden */
.animate-on-scroll {
    opacity: 0;
}

/* Fade Up - starts below */
.animate-fade-up {
    transform: translateY(24px);
}

/* Fade Down - starts above */
.animate-fade-down {
    transform: translateY(-24px);
}

/* Fade In - no transform, just opacity */
.animate-fade-in {
    transform: none;
}

/* When element becomes visible */
.animate-on-scroll.is-visible {
    animation-duration: 0.6s;
    animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
    animation-fill-mode: forwards;
}

.animate-fade-up.is-visible {
    animation-name: fadeInUp;
}

.animate-fade-down.is-visible {
    animation-name: fadeInDown;
}

.animate-fade-in.is-visible {
    animation-name: fadeIn;
}

/* ==========================================================================
   Stagger Delays for Child Elements
   ========================================================================== */

.animate-delay-100 { animation-delay: 0.1s; }
.animate-delay-200 { animation-delay: 0.2s; }
.animate-delay-300 { animation-delay: 0.3s; }
.animate-delay-400 { animation-delay: 0.4s; }
.animate-delay-500 { animation-delay: 0.5s; }

/* ==========================================================================
   Continuous Floating Animation
   ========================================================================== */

.animate-float {
    animation: floatSoft 8s ease-in-out infinite;
}

.animate-float-slow {
    animation: floatSoft 12s ease-in-out infinite;
}

.animate-float-reverse {
    animation: floatSoft 10s ease-in-out infinite reverse;
}

/* ==========================================================================
   Enhanced Hover Effects
   ========================================================================== */

/* Icon rotation on hover for service cards */
.icon-hover-rotate {
    transition: transform 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}

.group:hover .icon-hover-rotate {
    transform: rotate(8deg) scale(1.05);
}

/* Button glow on hover */
.btn-glow {
    position: relative;
    transition: all 0.3s ease;
}

.btn-glow::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.4), rgba(239, 68, 68, 0.3));
    opacity: 0;
    z-index: -1;
    filter: blur(8px);
    transition: opacity 0.3s ease;
}

.btn-glow:hover::before {
    opacity: 1;
}

/* Footer link underline animation */
.link-underline {
    position: relative;
}

.link-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: currentColor;
    transition: width 0.3s ease;
}

.link-underline:hover::after {
    width: 100%;
}

/* Project card image brightness on hover */
.img-hover-bright {
    transition: transform 0.7s ease, filter 0.3s ease;
}

.group:hover .img-hover-bright {
    filter: brightness(1.05);
}
