/* ===========================
   PERFORMANCE OPTIMIZATIONS
   =========================== */

/* Add will-change for animated elements */
.hero__background,
.hero__logo,
.hero__title,
.hero__subtitle {
    will-change: transform, opacity;
}

.logo-intro__item,
.stats__item,
.brand-grid__item,
.logo-construct__element {
    will-change: transform, opacity;
}

.journey__text h3,
.journey__text p,
.journey__text ul li,
.journey__image {
    will-change: transform, opacity;
}

.mockups__item,
.contact__form input,
.contact__form textarea,
.contact__form button,
.clients__logo,
.footer__col {
    will-change: transform, opacity;
}

/* Remove will-change after animations complete */
.animation-complete {
    will-change: auto !important;
}

/* Smooth hardware acceleration */
.hero__background,
.contact__image > div {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* 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;
    }
    
    .hero__background,
    .contact__image > div {
        animation: none !important;
    }
    
    .custom-cursor {
        display: none !important;
    }
}

/* Fix for iOS Safari smooth scrolling */
body {
    -webkit-overflow-scrolling: touch;
}

/* Optimize font rendering */
body {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-smooth: always;
}

/* GPU acceleration for transforms */
.btn,
.header,
.stats__item,
.brand-grid__item {
    transform: translateZ(0);
    will-change: transform;
}

.btn:hover,
.stats__item:hover,
.brand-grid__item:hover {
    will-change: transform;
}

/* Remove will-change after interaction */
.btn:not(:hover),
.stats__item:not(:hover),
.brand-grid__item:not(:hover) {
    will-change: auto;
}

/* Optimize scrollbar */
::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

/* Disable custom cursor on touch devices */
@media (hover: none) and (pointer: coarse) {
    .custom-cursor {
        display: none !important;
    }
}

/* Optimize transitions */
* {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Contain paint for better performance */
.section-padding {
    contain: layout style paint;
}

/* Force GPU acceleration for sections */
.hero,
.logo-intro,
.stats,
.brand-grid,
.logo-construct,
.journey,
.mockups,
.contact,
.clients {
    transform: translateZ(0);
    backface-visibility: hidden;
}
