/* PERFORMANCE OPTIMIZATIONS */

/* 1. Hardware Acceleration Hints */
.fade-in-up,
.service-card,
.project-card,
.iot-card,
.hero-visual,
.hero-content,
.dev-philosophy,
.contact-card,
.contact-form-col,
.n8n-image {
    will-change: transform, opacity;
    transform: translateZ(0);
    /* Promote to compositor layer */
    backface-visibility: hidden;
    perspective: 1000px;
}

/* 2. Containment (Isolate layout recalculations) */
.hero-section,
.about,
.services,
.portfolio,
.contact,
.footer {
    contain: layout paint style;
    content-visibility: auto;
    /* Browser skips rendering off-screen content */
    contain-intrinsic-size: 800px;
    /* Placeholder height to prevent scroll jank */
}

/* 3. Mobile Performance & Usability */
@media (hover: none) and (pointer: coarse) {

    /* Disable custom cursor on touch devices to save CPU/Battery */
    .cursor-glow,
    .cursor-halo {
        display: none !important;
        animation: none !important;
    }

    /* Disable hover-dependent animations on scroll (optional, but good for perf) */
    .service-card:hover,
    .project-card:hover {
        transform: none !important;
    }
}

/* 4. Reduce Animation Load on Low Power Mode */
@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;
    }
}