/* =========================================
   1. RESET ET BASE
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', Helvetica, Arial, sans-serif;
    background-color: #ffffff;
    color: #111;
    overflow-x: hidden;
}

/* =========================================
   2. HEADER (BANDEAU HAUT)
   ========================================= */
#top-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: #ffffff;
    display: flex;
    justify-content: space-between; 
    align-items: center;
    z-index: 1000;
    padding: 0 40px; 
}

/* --- LOGO GAUCHE (A+W) --- */
.logo {
    position: relative;
    font-size: 1.2rem;
    font-weight: 500;
    letter-spacing: 2px;
    color: #000;
    cursor: pointer;
    transition: color 0.3s ease;
}

.logo:hover {
    color: transparent;
}

.logo::after {
    content: "ABOUT"; 
    position: absolute;
    top: 50%;
    left: 0; 
    transform: translateY(-50%); 
    color: #000;
    font-weight: 600;
    font-size: 0.9rem;
    width: 100%;
    text-align: left;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

.logo:hover::after {
    opacity: 1;
    visibility: visible;
}

/* --- CONTACT DROITE --- */
.contact-btn {
    position: relative;
    font-size: 0.9rem; 
    font-weight: 600;  
    letter-spacing: 2px;
    color: #000;
    cursor: pointer;
    transition: color 0.3s ease;
}

.contact-btn:hover {
    color: transparent;
}

.contact-btn::after {
    content: "GET IN TOUCH"; 
    position: absolute;
    top: 50%;
    right: 0; 
    transform: translateY(-50%); 
    color: #000;
    font-weight: 600;
    font-size: 0.9rem; 
    width: 200px;
    text-align: right;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

.contact-btn:hover::after {
    opacity: 1;
    visibility: visible;
}


/* =========================================
   3. SECTION HERO (VIDÉO D'ACCUEIL)
   ========================================= */
#hero {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.video-container iframe {
    width: 100vw;
    height: 56.25vw; 
    min-height: 100vh;
    min-width: 177.77vh; 
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: #fff;
    z-index: 10;
    opacity: 0.8;
}

.scroll-indicator span {
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 2px;
    display: block;
    margin-bottom: 10px;
}

.arrow {
    width: 15px;
    height: 15px;
    border-bottom: 2px solid #fff;
    border-right: 2px solid #fff;
    transform: rotate(45deg);
    margin: 0 auto;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0) rotate(45deg);}
    40% {transform: translateY(-10px) rotate(45deg);}
    60% {transform: translateY(-5px) rotate(45deg);}
}



/* =========================================
   4. GALERIE (MASONRY JS)
   ========================================= */
#gallery {
    width: calc(100% - 10px); 
    margin: 0 auto;
    display: block; 
    box-sizing: border-box;
    padding-top: 5px; 
}

#gallery::after {
    content: '';
    display: block;
    clear: both;
}

.masonry-item {
    width: 33.333%; 
    float: left;
    padding: 5px; 
    box-sizing: border-box;
    margin-bottom: 0; 
}

/* CLASSE POUR MASQUER LES ITEMS (LOAD MORE) */
.masonry-item.hidden-load {
    display: none;
}

.thumb-link {
    display: block;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    cursor: pointer;
    background: #000; 
}

.thumb-link img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.6s ease;
}

.thumb-video-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    overflow: hidden;
    transition: transform 0.6s ease;
}

.video-placeholder {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    object-fit: cover;
    z-index: 1;
}

.thumb-video-wrapper iframe {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 2;
    background: transparent;
}

.thumb-link::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 3;
}

.thumb-link::after {
    content: '+';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 5rem;
    font-weight: 100;
    color: #fff;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 4;
    line-height: 0;
    padding-bottom: 8px;
}

.thumb-link:hover::before { opacity: 1; }
.thumb-link:hover::after { opacity: 1; }
.thumb-link:hover img { transform: scale(1.03); }
.thumb-link:hover .thumb-video-wrapper { transform: scale(1.03); }

@media (max-width: 900px) {
    .masonry-item { width: 50%; }
}

@media (max-width: 600px) {
    .masonry-item { width: 100%; }
}

/* --- SCROLL INFINI (TRIGGER) --- */
/* Zone invisible en bas de page pour détecter le scroll */
#scroll-sentinel {
    width: 100%;
    height: 100px; /* Zone assez large pour anticiper */
    clear: both;
    pointer-events: none;
    opacity: 0;
}


/* =========================================
   5. OVERLAY CONTACT (GET IN TOUCH)
   ========================================= */
#contact-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    z-index: 2000;
    backdrop-filter: blur(5px);
}

#contact-overlay.active {
    opacity: 1;
    visibility: visible;
}

.contact-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0;
    background-color: #000;
    padding: 40px 60px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1); 
}

.contact-separator {
    color: #fff;
    font-size: 2rem; 
    font-weight: 100;
    margin: 10px 0;
    user-select: none;
    opacity: 0.8;
    line-height: 1;
}

.contact-content a {
    color: #fff;
    font-size: 1.1rem;
    text-decoration: none;
    font-weight: 300;
    letter-spacing: 1.5px;
    position: relative;
    transition: color 0.3s ease, transform 0.3s ease;
    line-height: normal;
}

.contact-content a:hover {
    color: #aaa;
    transform: scale(1.05);
}

/* =========================================
   6. OVERLAY ABOUT (NOUVEAU A+W)
   ========================================= */
#about-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    z-index: 2000;
    backdrop-filter: blur(5px);
}

#about-overlay.active {
    opacity: 1;
    visibility: visible;
}

.about-content {
    width: 640px;
    height: 380px;
    background-color: #000;
    display: flex;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1); 
}

.about-img {
    width: 50%;
    height: 100%;
    overflow: hidden;
}

.about-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.about-text {
    width: 50%;
    height: 100%;
    padding: 40px;
    display: flex;
    align-items: center;
    color: #fff;
}

.about-text p {
    font-size: 0.95rem;
    line-height: 1.6;
    font-weight: 300;
    letter-spacing: 0.5px;
    text-align: left;
}

/* Responsive pour About */
@media (max-width: 700px) {
    .about-content {
        width: 90%;
        height: auto;
        flex-direction: column;
    }
    .about-img, .about-text {
        width: 100%;
    }
    .about-img {
        height: 250px;
    }
    .about-text {
        padding: 30px;
    }
}


/* =========================================
   7. OVERLAY PROJET (CARROUSEL)
   ========================================= */
#project-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
    z-index: 3000;
    display: flex;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

#project-overlay.active {
    opacity: 1;
    visibility: visible;
}

.close-project {
    position: absolute;
    top: 15px; 
    right: 30px;
    font-size: 3rem;
    color: #000;
    cursor: pointer;
    font-weight: 100;
    z-index: 3003;
    line-height: 1;
    transition: transform 0.3s;
}

.close-project:hover {
    transform: rotate(90deg);
}

#project-info-toggle {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3005;
    cursor: pointer;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: translateY(-50%) rotate(180deg); 
    padding: 30px 15px; 
    font-size: 0.9rem;
    letter-spacing: 3px;
    font-weight: 500;
    color: #000;
    background-color: #e6e6e6; 
    border-radius: 0; 
    transition: left 0.5s ease-in-out, background-color 0.3s;
}

#project-info-toggle:hover {
    background-color: #d1d1d1;
}

#project-overlay.info-visible #project-info-toggle {
    left: 450px;
}

.carousel-next-arrow {
    position: fixed; 
    right: 0; 
    top: 50%;
    transform: translateY(-50%);
    width: 50px; 
    height: 120px; 
    background-color: #e6e6e6;
    border-radius: 0; 
    z-index: 3004;
    cursor: pointer;
    display: none; 
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s;
}

.carousel-next-arrow:hover {
    background-color: #d1d1d1;
}

.carousel-next-arrow::after {
    content: '';
    width: 15px;
    height: 15px;
    border-top: 2px solid #000;
    border-right: 2px solid #000;
    transform: rotate(45deg); 
    margin-right: 5px; 
}

#carousel-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0;
    gap: 0;
    scroll-behavior: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
}

#carousel-content.video-mode {
    cursor: default;
}

#carousel-content.active-drag {
    cursor: grabbing;
    scroll-behavior: auto; 
}

#carousel-content::-webkit-scrollbar {
    display: none;
}

.info-slide {
    position: fixed;
    left: 0;
    top: 0;
    height: 100%;
    width: 450px;
    max-width: 80vw;
    background: #ffffff;
    box-shadow: 10px 0 30px rgba(0,0,0,0.1);
    color: #000;
    padding: 80px 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    z-index: 3002;
    transform: translateX(-100%); 
    transition: transform 0.5s ease-in-out;
}

#project-overlay.info-visible .info-slide {
    transform: translateX(0);
}

.info-slide h3 {
    font-weight: 400;
    font-size: 1.8rem;
    margin-bottom: 25px;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-bottom: 1px solid rgba(0,0,0,0.2);
    padding-bottom: 15px;
    line-height: 1.2;
}

.credits p {
    font-weight: 300;
    font-size: 0.95rem;
    line-height: 1.8;
    color: #333;
}

.video-slide {
    flex: 0 0 100vw; 
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.video-slide iframe {
    width: 85%;
    height: 85%;
    max-width: 1600px;
    aspect-ratio: 16 / 9;
    box-shadow: 0 0 50px rgba(0,0,0,0.1); 
    pointer-events: none; 
}

#carousel-content:not(.active-drag) .video-slide iframe {
    pointer-events: auto;
}

.image-slide {
    height: 85vh;
    flex-shrink: 0;
    padding-right: 15px;
    display: flex;
    align-items: center;
    user-select: none;
    -webkit-user-drag: none;
}

.info-slide + .image-slide {
    padding-left: 100px;
}

.image-slide img {
    height: 100%;
    width: auto;
    object-fit: contain;
    box-shadow: 0 0 30px rgba(0,0,0,0.1); 
    pointer-events: none; 
}

/* =========================================
   8. RESPONSIVE MOBILE
   ========================================= */
@media (max-width: 900px) {
    #gallery { column-count: 2; }
    
    #top-bar { padding: 0 20px; } /* Ajustement header mobile */
}

@media (max-width: 600px) {
    #gallery { column-count: 1; }

    #carousel-content {
        flex-direction: column;
        overflow-y: auto;
        padding-top: 60px;
        min-height: 100%; 
    }

    #carousel-content.video-mode {
        justify-content: center; 
        padding-top: 0;          
    }

    #project-info-toggle {
        left: 20px;
        top: auto;
        bottom: 20px;
        transform: none;
        writing-mode: horizontal-tb;
        padding: 10px 20px;
    }
    
    #project-overlay.info-visible #project-info-toggle {
        left: 20px;
    }

    .carousel-next-arrow {
        display: none !important;
    }

    .info-slide {
        width: 100%;
        max-width: 100%;
        padding: 80px 30px;
    }

    .video-slide, .image-slide {
        width: 100%;
        flex: none;
        height: auto;
        padding: 0;
        margin-bottom: 20px;
        justify-content: center;
    }
    
    #carousel-content.video-mode .video-slide {
        margin-bottom: 0;
    }
    
    .video-slide iframe {
        width: 100%;
        height: auto;
        aspect-ratio: 16/9;
    }
    
    .image-slide img {
        width: 100%;
        height: auto;
        max-height: 60vh;
    }
    
    .info-slide + .image-slide { 
        padding-left: 0; 
    }
    
    .contact-content a { font-size: 1.2rem; }
}


/* AJOUT : ICÔNE PLAY SUR IPAD/MOBILE */
body.static-mode .thumb-video-wrapper::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 50px; height: 50px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.1); 
    backdrop-filter: blur(2px);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M8 6.82v10.36c0 .79.87 1.27 1.54.84l8.14-5.18c.62-.39.62-1.29 0-1.69L9.54 5.98C8.87 5.55 8 6.03 8 6.82z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 55% center; 
    background-size: 50%;
    z-index: 5;
    pointer-events: none;
    transition: transform 0.3s ease, background-color 0.3s;
}

body.static-mode .thumb-link:active .thumb-video-wrapper::after {
    transform: translate(-50%, -50%) scale(0.9);
    background-color: rgba(0, 0, 0, 0.3);
}

@media (hover: none) {
    .thumb-link:hover::after { opacity: 0 !important; }
    .thumb-link:hover::before { opacity: 0 !important; }
    .thumb-link:hover img, 
    .thumb-link:hover .thumb-video-wrapper { transform: none !important; }
}