/* ========================================
   ULTRA-LIGHTWEIGHT PERFORMANCE FIX
   Final polish for 60fps scrolling
   ======================================== */

/* GPU Acceleration - Use transform ONLY (fastest property) */
.project-card,
[data-aos],
.animate-element {
    will-change: transform, opacity;
    transform: translate3d(0, 0, 0);
    transition: transform 0.2s ease-out, opacity 0.2s ease-out; /* Short transitions */
}

/* Remove will-change after animation (prevents memory leaks) */
.project-card.aos-animate,
[data-aos].aos-animate {
    will-change: auto;
}

/* CRITICAL: Ultra-light shadows (expensive rendering reduced) */
.project-card {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important; /* Minimal shadow */
}

.project-card:hover {
    transform: translateY(-4px) translate3d(0, 0, 0); /* GPU-accelerated */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12) !important; /* Still light */
}

/* Prevent hover effects on touch devices (prevents lag on mobile) */
@media (hover: none) and (pointer: coarse) {
    .project-card:hover {
        transform: none !important;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
    }
}

/* Optimize all images */
img {
    display: block;
    max-width: 100%;
    height: auto;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Smooth scroll behavior (native browser feature) */
html {
    scroll-behavior: smooth;
}

/* CRITICAL: Contain paint operations (prevents propagation) */
.project-card,
.section,
.container {
    contain: layout paint;
}

/* Mobile-specific optimizations */
@media (max-width: 768px) {
    /* Disable all hover effects on mobile */
    .project-card:hover,
    .project-card:active {
        transform: none !important;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
    }
    
    /* Faster animations on mobile */
    [data-aos],
    .project-card {
        transition-duration: 0.15s !important;
    }
    
    /* Disable expensive effects */
    * {
        text-shadow: none !important;
        backdrop-filter: none !important;
        filter: none !important;
    }
}

/* Accessibility + Performance: Reduce motion */
@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;
    }
}

/* CRITICAL: Intersection Observer optimization (if using custom scroll animations) */
[data-scroll-observe] {
    content-visibility: auto;
    contain-intrinsic-size: 500px;
}
