html, body {
    overflow-x: hidden; /* Empêche le défilement horizontal */
}



/* Overlays de chargement (très probablement globaux) */
#loaderOverlay {
    z-index: 9999 !important;
}

#transitionOverlay {
    z-index: 9998 !important;
}


.projects-title-scroll {
    will-change: transform; /* Optimisation performance */
}

.project-overlay-text h3 {
    line-height: 1.2 !important; 
}


/* Styles spécifiques à la section LAB */
.lab {
    margin: 0; /* Si ce margin est spécifique au lab de la page d'accueil */
}

.gallery-wrap {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.gallery {
	position: relative;	
	flex: none;
}

.gallery__item {
	background-position: 50% 50%;
	background-size: cover;	
	flex: none;
	border-radius: 6px;
	position: relative;
	filter: brightness(1);
}

.caption {
	z-index: 101;
	font-weight: 400;
}

.gallery--row {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 2rem;
	--size-factor: 1.25;
	--item-height: 20vh;
}

.gallery--row .gallery__item {
	width: auto;
	aspect-ratio: 2 / 3;
}

.gallery--row .gallery__item--s {
	height: var(--item-height);
}

.gallery--row .gallery__item--m {
	height: calc(var(--size-factor) * var(--item-height));
}

.gallery--row .gallery__item--l {
	height: calc(var(--size-factor) * 2 * var(--item-height));
}

.gallery--row .gallery__item--xl {
	z-index: 100;
	height: calc(var(--size-factor) * 3 * var(--item-height));
}

.gallery--switch.gallery--row .gallery__item--m,
.gallery--switch.gallery--row .gallery__item--l {
	height: var(--item-height);
}

.gallery--row .caption {
	position: absolute;
	width: 100%;
	height: auto;
	bottom: -50vh;
	left: 0;
	padding: 4.5vw;
	opacity: 0;
}

.gallery--switch.gallery--row .caption {
	bottom: 0;
	top : 30%;
	opacity: 1;
}

.gallery--switch .gallery__item--center {
	height: 100vh;
	width: 100vw;
	aspect-ratio: auto;
	filter: brightness(0.5);
}



/* === SECTION LAB - RESPONSIVE MOBILE QUI FONCTIONNE === */

/* Ajustements pour tablettes (768px et moins) */
@media (max-width: 768px) {
    .gallery--row {
        gap: 1.5rem;
        --size-factor: 1.2;
        --item-height: 18vh;
    }
    
    
    .gallery--switch.gallery--row .gallery__button-container {
        top: 52%;
    }
}


/* Ajustements pour tablettes (640px et moins) */
@media (max-width: 640px) {
    .gallery--row {
        gap: 1.3rem;
        --size-factor: 1;
        --item-height: 20vh;
    }

}

/* Ajustements pour tablettes (480px et moins) */
@media (max-width: 480px) {
    .gallery--row {
        gap: 1.2rem;
        --size-factor: 0.7;
        --item-height: 25vh;
    }

}


/* Optimisation des performances pour l'animation du carrousel */
.scroll-carousel {
    will-change: transform; /* Optimisation des performances */
}

/* Version optimisée pour les performances */
@media (prefers-reduced-motion: no-preference) {
    .scroll-carousel {
        transition: none; /* Pas de transition CSS, on utilise JS */
    }
}

/* Fallback pour les utilisateurs qui préfèrent moins d'animations */
@media (prefers-reduced-motion: reduce) {
    .scroll-carousel {
        transform: rotate(-1.5deg) !important;
        transition: none !important;
    }
}


/* Position du bouton dans l'état normal */
.gallery--row .gallery__button-container {
    position: absolute;
    bottom: -50vh;
    left: 50%;
    transform: translateX(-50%);
    z-index: 102;
    opacity: 0;
    transition: none;
    pointer-events: none; /* OK pour l'état invisible */
}


/* Position du bouton dans l'état switch (même position que le titre) */
.gallery--switch.gallery--row .gallery__button-container {
    position: absolute;
    top: 55%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 150;
    opacity: 1;
    pointer-events: auto !important; /* ✅ IMPORTANT pour forcer l'interaction */
}


/* Style du bouton pour s'assurer qu'il s'anime bien */
.gallery__button-container a {
    background: transparent;
    border: 1px solid #FCF9F5;
    color: #FCF9F5;
    padding: 1.5rem 2.5rem;
    border-radius: 9999px;
    cursor: pointer !important; /* ✅ FORCER le cursor pointer */
    transition: background-color 0.3s ease, color 0.3s ease;
    backdrop-filter: blur(10px);
    text-decoration: none; /* Enlever le soulignement du lien */
    display: inline-block; /* Important pour les liens */
    pointer-events: auto !important; /* ✅ FORCER l'interaction sur le lien */
}

.gallery__button-container a:hover {
    background-color: #FCF9F5;
    color: #0E0301;
    cursor: pointer !important; /* ✅ FORCER le cursor au hover aussi */
}

/* Animation du bouton en synchronisation avec le titre */
.gallery--switch .gallery__button-container a {
    transform: scale(0.9);
    filter: brightness(1.2);
    pointer-events: auto !important; /* ✅ Assurer l'interaction dans tous les états */
    cursor: pointer !important;
}

/* ANIMATION DE LA SECTION ACCROCHE */

/* S'assurer que les GIFs restent bien inline (si utilisé globalement ou dans plusieurs sections) */
#accroche .inline-block { /* Cette règle est spécifique à #accroche, mais 'inline-block' est un utilitaire */
    display: inline-block !important;
    vertical-align: middle;
}


.accroche-line {
    overflow: hidden;
    line-height: 1.3 !important;
}

.accroche-text {
    display: inline-block;
     transform: translateY(0);
    transition: none;
}

/* État caché pour l'animation */
.accroche-text.hidden {
    transform: translateY(100%);
    opacity: 0;
}

/* Custom animations pour des effets plus fins */
@keyframes slideUpAccroche {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideDownAccroche {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(100%);
        opacity: 0;
    }
}

.accroche-slide-up {
    animation: slideUpAccroche 0.8s cubic-bezier(0.215, 0.61, 0.355, 1) both;
}

.accroche-slide-down {
    animation: slideDownAccroche 0.6s cubic-bezier(0.215, 0.61, 0.355, 1) both;
}

/* Classes utilitaires spécifiques à la page d'accueil */
.translate-y-full {
    transform: translateY(100%) !important;
}





/* === DEMO HORIZONTAL SCROLL - SANS CONFLIT === */

.demo-horizontal-pin {
    height: 100vh;
    overflow: hidden;
    position: relative;
    background: #FCF9F5;
}

.demo-horizontal-track {
    display: flex;
    height: 100vh;
    width: 500vw; /* 5 éléments */
    will-change: transform;
    transition: none; /* Pas de transition CSS pour éviter les conflits */
}

.demo-item {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    text-align: center;
    overflow: hidden; /* CRUCIAL : masque ce qui dépasse */
    transition: transform 0.3s ease;
}



/* Container fixe pour l'image */
.demo-item .image-container {
    width: 70% !important;
    height: 70vh !important; /* Hauteur fixe au lieu de 60vh */
    margin: 0 auto !important;
    overflow: hidden !important;
    border-radius: 16px 16px 0 0; 
    position: relative !important;
}

/* Image qui prend toute la place du container */
.demo-item .image-container img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 0 !important;
    margin: 0 !important;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
    transform: scale(1) !important;
    display: block !important;
}

/* Zoom au hover */
.image-container:hover img  {
    transform: scale(1.15) !important;
}



/* === FIX CONFLITS ANIMATIONS === */

/* S'assurer que la section demo a assez d'espace */
#horizontalDemo {
    z-index: 10;
    position: relative;
}

/* S'assurer que la section LAB est bien séparée */
#lab {
   margin-top: 20vh; /* Espace tampon avant LAB */
    z-index: 5;
    position: relative;
}

/* Éviter les chevauchements */
.demo-horizontal-pin {
    z-index: 15;
}

.gallery-wrap {
    z-index: 5;
}


/* ✅ FORCER L'ANIMATION FOOTER SUR LA HOME */
body.home-page-loaded #main-footer,
body.home-page-loading #main-footer {
    /* S'assurer que l'animation footer fonctionne */
    margin: 0;
    border-radius: 0;
    transition: none;
    will-change: margin, border-radius, transform;
}



/* === CARDS PROJETS - GROS VISUEL === */
.demo-item.cursor-pointer {
    padding: 0 !important;
    width: 85vw !important;
    max-width: 600px !important;
    justify-content: flex-start !important;
    align-items: stretch !important;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .demo-item.cursor-pointer {
        width: 90vw !important;
        max-width: 500px !important;
    }
    
    .demo-item.cursor-pointer h3 {
        font-size: 2rem !important;
    }
    
    .demo-item.cursor-pointer p {
        font-size: 1rem !important;
    }
}

@media (max-width: 480px) {
    .demo-item.cursor-pointer {
        width: 95vw !important;
    }
    
    .demo-item.cursor-pointer .p-8 {
        padding: 1.5rem !important;
    }
}


/* === AJUSTEMENTS SIMPLES MOBILE - IMAGE CONTAINER ET TEXTE === */

/* Mobile (768px et moins) */
@media (max-width: 768px) {
    /* Image container plus large */
    .demo-item .image-container {
        width: 85% !important; /* Plus large que 70% */
    }
    
    /* Plus de padding pour le texte p */
    .demo-item p {
        padding-left: 2rem !important;
        padding-right: 2rem !important;
    }
}






#a-propos::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #FED9B7;
    opacity: 0;
    transition: opacity 1.5s ease-out;
    z-index: 1;
}

#a-propos.visible::before {
    opacity: 1;
}