/* VARIABLES ET THEMES */
:root {
    --bg: #fcfcf9;
    --text: #121212;
    --serif: 'Cormorant Garamond', serif;
    --sans: 'Inter', sans-serif;
}

[data-theme="dark"] {
    --bg: #121212;
    --text: #fcfcf9;
}

* { margin:0; padding:0; box-sizing: border-box; }

body { 
    background: var(--bg); 
    color: var(--text); 
    font-family: var(--sans); 
    overflow-x: hidden; 
    transition: background 0.3s, color 0.3s;
}

/* CURSEUR PERSONNALISÉ */
#custom-cursor {
    position: fixed;
    width: 20px;
    height: 20px;
    background: var(--text);
    border-radius: 50%;
    pointer-events: none;
    z-index: 100000;
    mix-blend-mode: difference;
    transition: transform 0.1s ease-out;
}

body, a, .project-card, .arrow-btn, .burger, .logo, .close-btn, .theme-toggle { 
    cursor: none; 
}

/* HEADER ET LOGO */
.header { 
    position: fixed; 
    width:100%; 
    padding: 2.5rem 5%; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    z-index: 9000; 
}

.logo img { height: 60px; width: auto; transition: filter 0.3s; }
[data-theme="dark"] .logo img { filter: invert(1); }

.theme-toggle {
    background: none; border: 1px solid var(--text); color: var(--text);
    padding: 8px 15px; font-weight: 600; font-size: 0.7rem; letter-spacing: 1px;
    margin-right: 20px; transition: 0.3s;
}

/* BURGER ET CORRECTIF VISIBILITÉ */
.burger { width: 35px; height: 12px; display: flex; flex-direction: column; justify-content: space-between; z-index: 9001; }
.b-line { width: 100%; height: 1px; background: var(--text); transition: 0.3s; }

/* LE BURGER DEVIENT BLANC SUR LE MENU NOIR */
.nav-open .b-line { background: #ffffff !important; }

/* NAVIGATION OVERLAY */
.nav-overlay { 
    position: fixed; 
    inset:0; 
    background: #121212; 
    z-index: 8500; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    transform: translateX(100%); 
}

.nav-links { list-style: none; text-align: center; }
.nav-links a { 
    color: white; font-family: var(--serif); font-size: clamp(3rem, 10vw, 5rem); 
    text-decoration: none; display: block; margin: 1.5rem 0; transition: 0.3s;
}
.nav-links a:hover { opacity: 0.5; }

.curtain { position: fixed; inset:0; background: #121212; transform: translateY(100%); z-index: 9999; pointer-events: none; }

/* ETATS DES PAGES */
.page { display: none; padding: 180px 5% 80px; height: 100vh; overflow-y: auto; }
.page.active { display: block; }

/* GRILLE ACCUEIL */
.hero h1 { font-family: var(--serif); font-size: clamp(3rem, 10vw, 8rem); font-weight: 300; line-height: 0.9; margin-bottom: 5rem; }
.hero h1 i { font-style: italic; }
.projects-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; }
.img-container { width:100%; aspect-ratio: 4/5; overflow: hidden; background: #eee; }
.img-container img { width:100%; height:100%; object-fit: cover; transition: transform 1.2s cubic-bezier(0.7, 0, 0.3, 1); }
.project-card:hover img { transform: scale(1.05); }

.project-meta { margin-top: 1.5rem; }
.project-meta span { font-size: 0.7rem; letter-spacing: 2px; opacity: 0.5; text-transform: uppercase; }
.project-meta h3 { font-family: var(--serif); font-size: 2.5rem; font-weight: 400; }

/* DETAIL PROJET ET CAROUSEL */
.detail-header { display: flex; flex-direction: column; gap: 1.5rem; margin-bottom: 3rem; }
.detail-top-row { width: 100%; display: flex; justify-content: space-between; align-items: flex-end; }
.detail-header h2 { font-family: var(--serif); font-size: 4.5rem; font-weight: 400; }

.project-description { max-width: 600px; }
.project-description p { font-size: 0.9rem; line-height: 1.6; font-weight: 300; opacity: 0.8; }

.close-btn { 
    font-family: var(--sans); 
    font-weight: 600; 
    font-size: 0.8rem; 
    letter-spacing: 2px; 
    border: 1px solid var(--text); 
    padding: 10px 25px; 
    transition: 0.3s; 
    z-index: 100;
    
    /* AJOUTS ICI POUR ÉVITER L'ÉTIREMENT */
    align-self: flex-end; /* S'aligne en bas sans s'étirer */
    width: fit-content;   /* Prend juste la place de son texte */
    white-space: nowrap;  /* Empêche le texte de revenir à la ligne */
}

.close-btn:hover { 
    background-color: var(--text); 
    color: var(--bg); 
}

.carousel { position: relative; height: 75vh; width: 100%; overflow: hidden; margin-top: 2rem; }
.carousel-track { display: flex; height: 100%; will-change: transform; }
.slide { min-width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; }
.slide img, .carousel-media { max-height: 100%; max-width: 90%; object-fit: contain; }

.carousel-nav { position: absolute; inset: 0; display: flex; justify-content: space-between; align-items: center; pointer-events: none; padding: 0 20px; }
.arrow-btn { 
    pointer-events: auto; width: 60px; height: 60px; border-radius: 50%; border: 1px solid var(--text);
    display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.1); backdrop-filter: blur(5px);
}
.arrow-btn span { font-size: 0.6rem; font-weight: 600; color: var(--text); }
.arrow-btn:hover { background: var(--text); }
.arrow-btn:hover span { color: var(--bg); }

/* CV ET CONTACT */
.cv-wrapper { width: 100%; display: flex; justify-content: center; padding-bottom: 100px; }
.cv-full-img { width: 100%; max-width: 1000px; height: auto; }
.contact-wrap { text-align: center; padding: 10vh 0; }
.contact-wrap h2 { font-family: var(--serif); font-size: clamp(3rem, 8vw, 8rem); }
.social-links { margin-top: 20px; font-weight: 600; }
.social-links a { text-decoration: none; color: var(--text); margin: 0 10px; transition: 0.3s; }
.social-links a:hover { opacity: 0.5; }

/* MOBILE */
@media (max-width: 768px) {
    #custom-cursor { display: none; }
    body, a, .project-card, .burger, .logo { cursor: auto !important; }
    .projects-grid { grid-template-columns: 1fr; gap: 2rem; }
    .hero h1 { font-size: 3.5rem; }
}