/* ULTIMATE CUMULATIVE LAYOUT SHIFT (CLS) FIXES - VERSION 3.0 */

/* 1. CRITICAL CONTAINER2 ELEMENT FIX - HIGHEST PRIORITY */
.container2 {
    contain: layout style paint;
    min-height: 100vh !important;
    position: relative;
    transform: translateZ(0); /* Force GPU layer */
    width: 100% !important;
    overflow: hidden !important;
}

/* Fix the main hero heading that's causing 0.565 shift */
.container2 h1 {
    font-display: swap;
    min-height: 120px !important;
    max-height: 120px !important;
    height: 120px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1.1 !important;
    font-size: clamp(48px, 8vw, 96px) !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative;
    z-index: 2;
    font-weight: 700;
    text-align: center;
    /* Reserve exact space to prevent reflow */
    box-sizing: border-box;
}

/* 2. MAIN TEXT STABILIZATION */
.main-text {
    min-height: 50px !important;
    height: 50px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-bottom: 20px !important;
    font-size: 18px !important;
    line-height: 1.3 !important;
    position: relative;
    z-index: 3;
}

/* 3. HERO IMAGE STRICT DIMENSIONS - 0.003 shift fix */
.home-girl-img {
    aspect-ratio: 445/560 !important;
    width: 445px !important;
    height: 560px !important;
    max-width: 445px !important;
    max-height: 560px !important;
    object-fit: cover !important;
    display: block !important;
    position: relative;
    z-index: 1;
}

/* Hero image container with reserved space */
.home-girl-img-main {
    min-height: 580px !important;
    height: 580px !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative;
    overflow: hidden;
}

/* 4. NAVIGATION CONTAINER FIX - 0.029 shift fix */
.hell {
    min-height: 60px !important;
    height: 60px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    position: relative;
    contain: layout style;
}

.top-navbar-title {
    display: flex !important;
    align-items: center !important;
    height: 60px !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.top-navbar-title li {
    height: 60px !important;
    display: flex !important;
    align-items: center !important;
    margin: 0 15px !important;
}

/* 5. FONT LOADING OPTIMIZATION - WEB FONT SHIFTS */
@font-face {
    font-family: 'DM Sans';
    font-display: swap;
    font-weight: 100 1000;
    src: local('DM Sans'), local('DMSans-Regular');
}

/* Fallback font metrics matching DM Sans */
body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    font-display: swap;
}

/* Size adjustments to match DM Sans fallbacks */
-apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui {
    font-size-adjust: 0.507;
    line-height-step: 0;
}

/* 6. DISABLE PROBLEMATIC ANIMATIONS CAUSING SHIFTS */
[data-aos] {
    pointer-events: auto !important;
    transform: none !important;
    opacity: 1 !important;
    transition: none !important;
}

[data-aos="fade-down"], 
[data-aos="fade-up"], 
[data-aos="fade-left"], 
[data-aos="fade-right"],
[data-aos="zoom-in"],
[data-aos="zoom-in-left"],
[data-aos="zoom-in-right"] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
}

/* 7. STABILIZE POSITIONED ELEMENTS */
.JessicaBiogi-main {
    position: absolute !important;
    width: 200px !important;
    height: 60px !important;
    top: 20px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    contain: layout style;
}

.worked-box {
    min-height: 100px !important;
    transform: translateZ(0);
    contain: layout style;
}

.arrow-main {
    position: absolute;
    transform: translateZ(0);
    contain: layout style paint;
}

/* 8. IMAGE LOADING OPTIMIZATIONS */
.brand-logos {
    aspect-ratio: 16/9 !important;
    width: 120px !important;
    height: auto !important;
    max-width: 120px !important;
    object-fit: contain !important;
    display: block !important;
}

.testimonial_client_img {
    aspect-ratio: 1/1 !important;
    width: 60px !important;
    height: 60px !important;
    object-fit: cover !important;
    border-radius: 50% !important;
}

/* 9. CRITICAL MEDIA QUERIES FOR CLS */
@media (max-width: 768px) {
    .container2 {
        min-height: 70vh !important;
    }
    
    .container2 h1 {
        min-height: 80px !important;
        height: 80px !important;
        font-size: clamp(32px, 10vw, 64px) !important;
    }
    
    .home-girl-img {
        width: 300px !important;
        height: 378px !important;
        max-width: 300px !important;
        max-height: 378px !important;
    }
    
    .home-girl-img-main {
        min-height: 400px !important;
        height: 400px !important;
    }
}

@media (max-width: 480px) {
    .container2 h1 {
        min-height: 60px !important;
        height: 60px !important;
        font-size: clamp(24px, 12vw, 48px) !important;
    }
    
    .main-text {
        min-height: 40px !important;
        height: 40px !important;
        font-size: 16px !important;
    }
}

/* 10. FORCE REFLOW PREVENTION */
.section-main {
    contain: layout style;
    min-height: 100vh;
}

.section-main-sub {
    contain: layout style;
    position: relative;
}

/* 11. PERFORMANCE OPTIMIZATIONS */
* {
    will-change: auto !important; /* Remove unnecessary will-change */
}

img {
    content-visibility: auto;
}

/* 12. STABILIZE CONTAINER DIMENSIONS */
.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding-left: 15px;
    padding-right: 15px;
    box-sizing: border-box;
}