@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;700&display=swap");

*, ::after, ::before { box-sizing: border-box; }

html { font-family: sans-serif; line-height: 1.15; scroll-behavior: smooth; overflow-x: visible; }

/* --- BODY GLOBAL --- */
body { 
    margin: 0; font-family: "Manrope", sans-serif; font-size: 1rem; font-weight: 400; line-height: 1.5; 
    color: #400601; background-color: #D9D9D9; 
    text-align: left; overflow-x: clip; position: relative; 
    cursor: url('images/cursor-scroll.svg') 0 0, auto;
    transition: background-color 1s ease-in-out, color 1s ease-in-out; 
}

/* SUPPRESSION MAIN (POINTER) */
a, button, .project-block, .contact-link, .project-link, .accordion-header, .back-button, .btn-live, .btn-contact { cursor: none !important; }

/* --- MODE SOMBRE (ACCUEIL) --- */
body.dark-mode { background-color: #080908 !important; color: #ffffff !important; }
body.dark-mode h1, body.dark-mode h2, body.dark-mode h3, body.dark-mode p, body.dark-mode a, body.dark-mode span, body.dark-mode .project-title, body.dark-mode .project-desc, body.dark-mode .bio-text, body.dark-mode .contact-link, body.dark-mode .mobile-project-title { color: #ffffff !important; transition: color 1s ease-in-out; }
body.dark-mode .btn { border-color: #ffffff; color: #ffffff; }
body.dark-mode .contact-divider { background-color: #ffffff; opacity: 0.3; }
body.dark-mode #scrollToTopBtn { border: 1px solid #ffffff; }
body.dark-mode .contact-link:hover { color: #ef8611 !important; transition: color 0.2s ease; }

/* TYPO & UI */
h1, h2, h3, h4, h5, h6 { margin-top: 0; margin-bottom: .5rem; }
h2, .h2 { font-family: "PolySans Slim", sans-serif; letter-spacing: -2px; font-weight: normal; margin-bottom: 0; transition: color 0.25s ease-out; font-size: 14vw; line-height: 1.1; margin-top: 25px; }
@media (min-width: 1024px) { h2, .h2 { font-size: 6.8vw; line-height: 1.1; white-space: nowrap; margin-top: 0; letter-spacing: -1px; } }

.btn { border: 1px solid #400601; padding: 6px 15px 8px; color: #400601; line-height: 1; text-decoration: none; display: inline-block; transition: all 0.25s ease-in-out; border-radius: 5vw; font-size: 5vw; }
@media (min-width: 1024px) { .btn { padding: 6px 24px 8px; border-radius: 1.5vw; font-size: 1.5vw; } }
.btn:hover { border-color: #fff; background-color: #fff; color: #ef8611 !important; text-decoration: none; }

#scrollToTopBtn { position: fixed; bottom: 20px; right: 20px; font-size: 3rem; padding: 10px 20px; border-radius: 50%; background-color: #ef8611; color: #fff; text-decoration: none; opacity: 0; visibility: hidden; transition: all 0.25s ease; z-index: 100; border: 1px solid transparent;}
#scrollToTopBtn.visible { opacity: 1; visibility: visible; }
#scrollToTopBtn:hover { background-color: #fff; color: #ef8611; }

/* --- CURSEUR CUSTOM --- */
#custom-cursor { 
    position: fixed; pointer-events: none; width: 65px; height: 65px; 
    z-index: 99999; opacity: 0; transition: opacity 0.2s ease; 
    display: flex; align-items: center; justify-content: center;
    mix-blend-mode: difference;
}
#custom-cursor svg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: block; transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1); }
#cursor-default { opacity: 1; transform: scale(1); }
#cursor-hover { opacity: 0; transform: scale(0.5); filter: drop-shadow(0 0 8px #ef8611); }
#custom-cursor.hover-active #cursor-default { opacity: 0; transform: scale(0.5); }
#custom-cursor.hover-active #cursor-hover { opacity: 1; transform: scale(1); }

/* --- RIPPLE --- */
#click-ripple {
    position: fixed; top: 0; left: 0; width: 40px; height: 40px;
    border-radius: 50%; background-color: #ef8611; 
    transform: translate(-50%, -50%) scale(0); opacity: 1; 
    pointer-events: none; z-index: 99998; will-change: transform, opacity;
}
#click-ripple.is-active {
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.1s ease-out 0.3s;
    transform: translate(-50%, -50%) scale(1); opacity: 0;
}

a:hover, button:hover, .project-block:hover, .contact-link:hover, .project-link:hover, .accordion-header:hover, .back-button:hover, .btn-live:hover, .btn-contact:hover {
    cursor: url('images/cursor-hover.svg') 16 16, none !important;
}

/* --- LAYOUT ACCUEIL --- */
.spacer { height: 10vw; }
.spacer3 { height: 300px; }
.module { position: relative; padding-left: 30px; padding-right: 50px; width: 100%; }
@media (min-width: 1024px) { .module { padding-left: 9.3vw; padding-right: 9.3vw; } }

.fullscreen-image { background-image: url('images/photo2.png'); background-position: center; background-size: cover; background-repeat: no-repeat; height: 100vh; width: 100%; position: relative; }
.overlay-text { font-weight: 800; position: absolute; bottom: 10%; left: 50%; transform: translateX(-50%); font-size: calc(10vw + 30px); color: #ef8611; text-align: center; letter-spacing: calc(1vw + 5px); z-index: 10; white-space: nowrap; display: flex; gap: 30px; }
@media (max-width: 768px) { .overlay-text { flex-direction: column; gap: 0; bottom: 20%; line-height: 1.1; } }

.title-wrapper { position: relative; display: inline-block; }
.module1 h2 { position: relative; z-index: 2; margin-bottom: 40px; }
#orange-animation { position: absolute; bottom: 0; left: -1.5vw; width: 36vw; z-index: 3; pointer-events: none; overflow: visible; opacity: 1; }
@media (min-width: 1024px) {
    .module1 { display: grid; grid-template-columns: 60% 35%; justify-content: space-between; align-items: start; min-height: 147vh; padding-top: 10vh; overflow: visible !important; }
    .left-col-module1.sticky-col { position: -webkit-sticky; position: sticky; top: 50vh; -webkit-transform: translateY(-50%) translateZ(0); transform: translateY(-50%) translateZ(0); height: auto; z-index: 2; }
    .module1 h2 { font-size: 6.8vw; line-height: 1.1; }
    .module1 .btn { margin-top: 20px; position: relative; }
    .module1 .right-col.scrolling-col { margin-top: 60vh; position: relative; padding-bottom: 10vh; z-index: 4; }
    #intro-text { font-size: 2em; line-height: 1.3; color: #ffffff; font-weight: 500; text-align: left; transition: all 0.3s ease-out; -webkit-transition: all 0.3s ease-out; will-change: color; -webkit-transform: translate3d(0,0,0); transform: translate3d(0,0,0); }
    #intro-text.scroll-active { color: #ef8611 !important; -webkit-text-fill-color: #ef8611 !important; }
}
#orange-circle, #orange-arrow { stroke-dasharray: 5000; stroke-dashoffset: 5000; }
@media (max-width: 1023px) {
    .spacer3 { height: 100px !important; }
    .module1 { display: block; margin-top: 50px; padding-bottom: 150px; }
    .title-wrapper { width: 100%; }
    .module1 h2 { font-size: 11vw; position: relative; z-index: 2; margin-bottom: 20px; line-height: 1.2; }
    #orange-animation { position: absolute; bottom: 10px; right: 30%; width: 70%; height: auto; z-index: 3; pointer-events: none; left: auto; top: auto; }
    #intro-text { font-size: 1.4rem; color: #ffffff; margin-top: 40px; transition: color 0.5s ease; }
    #intro-text.scroll-active { color: #ef8611 !important; }
    .module1 .right-col p { font-size: 1.2rem; margin-top: 20px; }
}

.projects-container { padding-top: 0; padding-bottom: 100px; background-color: transparent; }
.mobile-project-title { display: none; }
.mobile-progress-container { display: none; }
@media (min-width: 1024px) {
    .projects-container { display: grid; grid-template-columns: 25% 70%; justify-content: space-between; align-items: start; min-height: 200vh; }
    .projects-nav-col { position: relative; height: 100%; }
    .projects-nav-sticky { position: -webkit-sticky; position: sticky; top: 10vh; min-height: 80vh; }
    #project-main-title { font-size: 6.8vw; color: #400601; margin-bottom: 40px; white-space: nowrap; transform-origin: left top; transition: color 1s ease; }
    .nav-wrapper { position: absolute; top: 13vw; left: 0; display: flex; flex-direction: row; height: 440px; }
    .nav-tree-svg { width: 30px; height: 100%; margin-right: 25px; flex-shrink: 0; position: relative; }
    .nav-tree-svg svg { width: 100%; height: 100%; position: absolute; top: 0; left: 0; display: block; overflow: visible; }
    #svg-base { z-index: 1; }
    #svg-active { z-index: 2; overflow: visible; }
    .cls-orange { opacity: 0; transition: opacity 0.1s; } 
    .projects-menu { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; justify-content: space-between; height: 100%; padding-top: 0; padding-bottom: 0; position: relative; }
    .menu-item { position: absolute; left: 0; line-height: 1; transform: translateY(-50%); display: inline-block; }
    .menu-item:nth-child(1) { top: 0%; } .menu-item:nth-child(2) { top: 20.4%; } .menu-item:nth-child(3) { top: 40.2%; } .menu-item:nth-child(4) { top: 60.1%; } .menu-item:nth-child(5) { top: 80.0%; } .menu-item:nth-child(6) { top: 100%; }
    .project-link { text-decoration: none; font-size: 1.5rem; color: #400601; font-weight: 500; transition: transform 0.3s ease, color 1s ease; white-space: nowrap; position: relative; padding-bottom: 2px; }
    .link-hover { position: absolute; bottom: -5px; left: 0; width: 100%; height: 8px; pointer-events: none; overflow: visible; }
    .link-hover path { fill: none; stroke: #400601; stroke-width: 2px; stroke-linecap: round; stroke-dasharray: 101; stroke-dashoffset: 101; transition: stroke-dashoffset 0.3s ease-out, stroke 1s ease; }
    body.dark-mode .link-hover path { stroke: #ffffff; }
    .menu-item:hover .link-hover path { stroke-dashoffset: 0; }
    .menu-item:has(.project-link.active) .link-hover path { stroke-dashoffset: 101 !important; }
    .link-underline { position: absolute; bottom: -5px; left: 0; width: 100%; height: 8px; pointer-events: none; overflow: visible; opacity: 0; } 
    .link-underline path { fill: none; stroke: #ef8611; stroke-width: 2px; stroke-linecap: round; }
    .project-link.active { color: #ef8611 !important; font-weight: 800; }
    
    .projects-content-col { 
        display: flex; flex-direction: column; 
        gap: 15vh; 
        margin-top: 40vh; /* Images de l'accueil décalées */
    }
    
    .project-block { scroll-margin-top: 30vh; transition: transform 0.4s ease; cursor: pointer; }
    /* NOUVELLE CLASSE POUR LE LIEN CARTE */
    .project-card-link {
        display: block;
        text-decoration: none;
        color: inherit;
        width: 100%;
    }
    
    .project-image-wrapper { border: 4px solid #400601; border-radius: 20px; overflow: hidden; margin-bottom: 20px; height: 400px; width: 100%; transition: all 0.4s ease, border-color 1s ease; }
    body.dark-mode .project-image-wrapper { border-color: #ffffff; }
    .project-image-wrapper img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform 0.5s ease; }
    .project-title { font-size: 2.5rem; font-weight: 500; color: #400601; margin-bottom: 10px; transition: color 0.3s ease; }
    .project-desc { font-size: 1.2rem; color: #400601; transition: color 1s ease; }
    .project-block:hover { transform: translateY(-5px); }
    .project-block:hover .project-image-wrapper { border-color: #ef8611 !important; }
    .project-block:hover .project-image-wrapper img { transform: scale(1.05); }
    .project-block:hover .project-title { color: #ef8611 !important; }
}
@media (max-width: 1023px) {
    .projects-nav-col { display: none; }
    .mobile-project-title { display: block; font-family: "PolySans Slim", sans-serif; font-weight: normal; letter-spacing: -2px; font-size: 11vw; white-space: nowrap; text-align: left; color: #400601; margin-top: 25px; margin-bottom: 40px; }
    .mobile-progress-container { display: block; position: -webkit-sticky; position: sticky; top: 20px; z-index: 50; width: 100%; height: 14px; border: 1px solid #400601; border-radius: 99px; padding: 2px; background-color: rgba(255, 255, 255, 0.5); backdrop-filter: blur(5px); margin-bottom: 40px; }
    body.dark-mode .mobile-progress-container { border-color: #ffffff; background-color: rgba(0, 0, 0, 0.5); }
    .mobile-progress-bar { height: 100%; background-color: #ef8611; border-radius: 99px; width: 0%; }
    .projects-content-col { display: flex; flex-direction: column; gap: 50px; }
    .project-block { text-align: left; }
    .project-image-wrapper { border: 2px solid #400601; border-radius: 10px; height: 250px; width: 100%; margin-bottom: 15px; overflow: hidden; }
    .project-image-wrapper img { width: 100%; height: 100%; object-fit: cover; display: block; }
    .project-title { font-size: 1.8rem; margin-top: 10px; font-weight: 600; }
}

/* VIDEO REVEAL */
.passion-container { display: flex; align-items: center; justify-content: space-between; text-align: left; width: 100%; padding: 0 9.3vw; margin-top: 0; }
.bio-text-col { flex: 0 0 45%; margin-right: 50px; }

/* TRANSITIONS VIDÉO ET CANVAS */
.bio-video-col { 
    flex: 1; opacity: 0; 
    transition: opacity 0.3s ease; 
    position: relative; user-select: none; display: flex; justify-content: flex-end; margin-top: -160px; 
    height: auto; border-radius: 20px 0 0 20px; overflow: hidden;
}
body.dark-mode .bio-video-col { 
    opacity: 1; 
    transition: opacity 2s ease 1.2s; 
}

/* Dégradé bas */
.bio-video-col::after {
    content: ''; position: absolute; bottom: 0; left: 0; width: 100%; height: 30%; 
    background: linear-gradient(to bottom, transparent, #080908);
    z-index: 3; pointer-events: none; border-radius: 0 0 0 20px; 
}

/* Important: on retire display:none, on gère par l'opacité */
#video-front { 
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; 
    object-fit: cover; opacity: 0; z-index: -5; pointer-events: none; 
}

#video-back { position: relative; width: 100%; height: auto; display: block; z-index: 1; }
#video-canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 2; cursor: crosshair; }

.bio-text { font-size: 1.5rem; line-height: 1.6; margin-bottom: 2rem; color: #400601; font-weight: 300; transition: color 1s ease; }
.bio-text strong { font-weight: 700; color: inherit !important; }
@media (max-width: 1023px) { .passion-container { flex-direction: column; padding: 0 20px; margin-top: 40px; } .bio-video-col { display: none; } .bio-text-col { width: 100%; margin-right: 0; } }

#contactLinks { text-align: center; padding: 20px; }
.contact-item { font-size: 2vw; padding: 10px 0; }
.contact-link { text-decoration: none; color: #400601 !important; transition: color 1s ease; cursor: pointer; }
.contact-divider { width: 83%; height: 3px; background-color: #400601; margin: 10px auto; border-radius: 10px; transition: background-color 1s ease; }
@media screen and (max-width: 768px) { .contact-link { font-size: 40px; } .contact-item { font-size: 1.5rem; } }
.spacer-bottom-gallery2 { height: 150px; }

/* =========================================
   STYLE PAGE PROJET (CORRECTIF LIGNES & DESIGN)
   ========================================= */

.project-page { 
    background-color: #D9D9D9; 
    color: #400601; 
    overflow-x: hidden; 
}

/* Bouton Retour */
.back-button {
    position: fixed; top: 30px; right: 30px; z-index: 100;
    font-size: 1rem; text-decoration: none;
    color: #400601; border: 1px solid #400601;
    padding: 8px 24px; border-radius: 50px;
    background: rgba(217, 217, 217, 0.8); backdrop-filter: blur(5px);
    transition: all 0.3s ease; font-weight: 600;
}
.back-button:hover { background: #400601; color: #ef8611; border-color: #400601; }

.project-layout { display: flex; width: 100%; min-height: 100vh; }

/* --- SIDEBAR GAUCHE (STICKY) --- */
.project-sidebar {
    width: 35%; height: 100vh; 
    position: -webkit-sticky; position: sticky; top: 0;
    padding: 60px 40px; 
    display: flex; flex-direction: column; justify-content: center;
    border-right: 1px solid rgba(64, 6, 1, 0.1);
    background-color: #D9D9D9; 
    z-index: 50; 
    
    /* --- CORRECTION ULTIME DU GHOSTING --- */
    isolation: isolate;
    transform: translate3d(0,0,0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    perspective: 1000px;
}

/* TITRE PROJET EN ORANGE */
.p-title { 
    font-family: "PolySans Slim", sans-serif; 
    font-size: 3.5vw; line-height: 1; margin-bottom: 10px; 
    color: #ef8611; /* Orange */
}

.p-subtitle { font-size: 1.2rem; font-weight: 400; color: #400601; opacity: 0.7; margin-bottom: 30px; letter-spacing: 1px; text-transform: uppercase; }

.p-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 50px; }

/* --- STYLE DES BADGES (TAGS) --- */
.tag {
    font-size: 0.8rem;
    padding: 8px 16px; 
    border-radius: 50px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
    border: 1px solid transparent; 
    transition: all 0.3s ease;
}

/* Premier tag : Fond Orange, Texte Blanc */
.tag:nth-child(1) {
    background-color: #ef8611; 
    color: #ffffff; 
    border-color: #ef8611;
}

/* Autres tags : Fond Blanc, Texte Orange, Bordure Orange */
.tag:not(:nth-child(1)) {
    background-color: #ffffff; 
    color: #ef8611; 
    border: 1px solid #ef8611; 
}

/* ACCORDÉON */
.accordion { border-top: 1px solid rgba(64, 6, 1, 0.2); width: 100%; }

.accordion-item { 
    border-bottom: 1px solid rgba(64, 6, 1, 0.2); 
    overflow: hidden; 
    /* Anti-Ghosting items */
    transform: translate3d(0,0,0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.accordion-header { 
    padding: 20px 0; cursor: pointer; font-weight: 700; font-size: 1.1rem; 
    display: flex; align-items: center; color: #400601;
    transition: color 0.3s ease; 
    pointer-events: auto; 
}
.accordion-header:hover { color: #ef8611; }

.acc-icon { margin-right: 15px; font-weight: 400; font-size: 1.2rem; display: inline-block; width: 20px; }

/* CORPS DE L'ACCORDÉON */
.accordion-body { 
    max-height: 0; 
    overflow: hidden; 
    /* Visibility hidden quand fermé = PLUS DE TRACES */
    visibility: hidden; 
    opacity: 0; 
    transition: max-height 0.5s ease-out, opacity 0.5s ease, visibility 0.5s;
    will-change: max-height; 
}
.accordion-body p { padding-bottom: 20px; font-size: 0.95rem; line-height: 1.6; color: #400601; margin: 0; }

/* ÉTAT ACTIF */
.accordion-item.active .accordion-body { 
    opacity: 1; 
    visibility: visible;
    transition: max-height 0.5s ease-out, opacity 0.5s ease;
}

/* BOUTON CONTACT (Sidebar) - STYLE TYPE MODULE 1 */
.sidebar-footer { margin-top: 40px; }
.btn-contact {
    display: inline-block;
    background-color: transparent; 
    color: #400601 !important;     
    text-decoration: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: 1px solid #400601;     
    width: 100%;
    text-align: center;
}

/* HOVER MODIFIÉ : BLANC, TEXTE ORANGE, LUEUR */
.btn-contact:hover {
    background-color: #ffffff;
    color: #ef8611 !important;
    border-color: #ffffff; 
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.6); 
}

/* =========================================
   GALERIE DROITE (CORRECTIF FLUX & VIDÉO)
   ========================================= */

   .project-gallery { 
    width: 65%; 
    padding: 60px;
    padding-top: 110px; /* Espace équilibré */
    
    /* C'est ici que ça corrige le "côte à côte" */
    display: flex; 
    flex-direction: column; /* Force l'empilement vertical */
    gap: 30px; 
    
    background-color: #D9D9D9; 
}

/* BLOCS GÉNÉRAUX */
.gallery-block, .gallery-item {
    width: 100%; 
    border-radius: 12px; 
    overflow: hidden;
    border: 1px solid rgba(64, 6, 1, 0.1);
    -webkit-mask-image: -webkit-radial-gradient(white, black); /* Fix bords arrondis */
    background-color: #000; /* Fond noir en attendant le chargement */
    position: relative;
}

/* GESTION IMAGES ET VIDÉOS */
.gallery-block img, .gallery-item img, 
.gallery-block video, .gallery-item video { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    display: block; 
    transition: none;
}

/* PAS DE ZOOM AU SURVOL */
.gallery-block:hover img, .gallery-item:hover img,
.gallery-block:hover video, .gallery-item:hover video { 
    transform: none; 
}

/* --- GRILLES (GRID) --- */
.gallery-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; /* 50% 50% */
    gap: 30px; 
    width: 100%; /* Force la largeur totale */
}

/* Bento Classique (Grand à gauche) */
.bento-asym { 
    grid-template-columns: 2fr 1fr; 
}

/* Bento Inversé (Grand à droite) */
.bento-asym-reverse { 
    grid-template-columns: 1fr 2fr; 
}

/* HAUTEURS FIXES POUR BENTO */
.big-bento { height: 500px; }
.small-bento { height: 500px; }

/* Blocks simple hauteur auto ou fixe si besoin */
.gallery-item { min-height: 300px; } 

.reveal-img { 
    opacity: 1; 
    transform: translateY(0); 
    transition: all 0.8s ease-out; 
}

@media (max-width: 1024px) {
    .project-layout { flex-direction: column; }
    .project-sidebar { width: 100%; height: auto; position: relative; padding: 40px 20px; border-right: none; border-bottom: 1px solid rgba(64, 6, 1, 0.2); transform: none; }
    .project-gallery { width: 100%; padding: 20px; }
    
    /* Sur mobile, on casse les grilles en une seule colonne */
    .gallery-grid, .bento-asym, .bento-asym-reverse { 
        grid-template-columns: 1fr; 
        gap: 20px; 
    }
    .big-bento, .small-bento { height: auto; min-height: 250px; }
    .p-title { font-size: 12vw; }
}