/* Performance Optimizations for Smooth Scrolling */

/* Reduce animation intensity for better performance */
@media (prefers-reduced-motion: no-preference) {

    /* Optimize keyframe animations */
    @keyframes float {

        0%,
        100% {
            transform: translateY(0);
        }

        50% {
            transform: translateY(-8px);
            /* Further reduced from -10px */
        }
    }

    @keyframes slideIn {
        from {
            transform: translateX(-30px);
            /* Further reduced from -50px */
            opacity: 0;
        }

        to {
            transform: translateX(0);
            opacity: 1;
        }
    }

    @keyframes slideUp {
        from {
            transform: translateY(20px);
            /* Further reduced from 30px */
            opacity: 0;
        }

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

    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(15px);
            /* Reduced from 20px */
        }

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

/* Optimize transitions for better performance */
* {
    /* Use transform and opacity for animations instead of layout properties */
    will-change: auto;
}

/* Optimize specific elements */
.hero-image {
    animation-duration: 5s;
    /* Slower animation */
    will-change: transform;
}

.hero-content {
    animation-duration: 0.5s;
    /* Faster animation */
    will-change: transform, opacity;
}

.about-image,
.about-content {
    animation-duration: 0.5s;
    /* Faster animation */
    will-change: transform, opacity;
}

/* Reduce hover effects intensity */
.social-btn:hover,
.stat-item:hover,
.skill-item:hover {
    transform: translateY(-3px);
    /* Reduced from -5px */
}

/* Optimize scroll performance */
.skills-section,
.projects-section,
.contact-section {
    /* Use transform3d to force hardware acceleration */
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Reduce animation delays */
.skill-item.animate-in {
    animation-delay: 0.05s;
    /* Reduced staggered delays */
}

/* Optimize background animations */
#bg-canvas {
    /* Reduce GPU usage */
    will-change: auto;
}

/* Smooth scrolling optimization */
html {
    scroll-behavior: smooth;
}

/* Reduce motion for users who prefer it */
@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;
    }
}

/* Performance optimizations for mobile */
@media (max-width: 768px) {

    /* Disable some animations on mobile for better performance */
    .hero-image {
        animation: none;
    }

    .float-animation {
        animation: none;
    }

    /* Reduce transition durations on mobile */
    * {
        transition-duration: 0.15s !important;
    }
}

/* Optimize for low-end devices */
@media (max-width: 480px) {

    /* Disable most animations on very small screens */
    .hero-image,
    .about-image,
    .skill-item,
    .project-card {
        animation: none !important;
        transition: none !important;
    }
}