/* ==========================================================================
   1. RESET & VARIABLES DE BASE
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Cabin', sans-serif;
}

html {
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
}

body {
    background-color: #181717; 
    /* Motif de points signature */
    background: radial-gradient(#ed6a6c 1px, #181717 1px);
    background-size: 30px 30px;
    background-attachment: fixed;
}

/* ==========================================================================
   2. COMPOSANTS FIXES (Header, Transition, Réseaux)
   ========================================================================== */

/* Transition de page */
.page-transition {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: #181717;
    z-index: 9999;
    pointer-events: none;
    transition: opacity 0.8s ease;
}

.page-transition.hidden {
    opacity: 0;
}

/* Barre de navigation */
header {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100px;
    display: flex;
    align-items: center;
    padding: 0 40px;
    z-index: 1001;
}

header .navig {
    flex: 0 1 auto;
    order: 1; 
    display: flex;
    font-size: 1.4em;
    font-weight: 500;
    border-radius: 50px;
    border: 3px solid #e5e4e4;
    background-color: #181717;
}

header .navig a {
    text-decoration: none;
    padding: 10px 30px;
    color: #e5e4e4;
    transition: all 0.2s;
}

header .navig a:hover, 
header .navig a.active {
    color: #ed6a6c;
    text-decoration: underline;
    background-color: #e5e4e4;
    border-radius: 50px;
}

header .logo {
    flex: 1; 
    display: flex;
    justify-content: flex-end;
    align-items: center;
    order: 3;
}

header .logo img {
    width: 15%;
}

header::after { 
    content: "";
    flex: 1;
    order: 2;
}

#burger-bouton { display: none; }

/* Réseaux Sociaux (Barre latérale) */
footer .reseaux {
    position: fixed;
    top: 4vh; left: 20px; 
    height: 92vh;
    display: grid;
    grid-template-rows: repeat(10, 1fr);
    z-index: 1000;
    justify-items: center;
    align-items: center; 
}

footer img {
    height: 40px;
    filter: invert(100%);
    transition: transform 0.2s, filter 0.3s;
}

footer img:hover {
    transform: scale(1.2);
    filter: brightness(1.2) invert(100%);
}

footer a:nth-child(1) { grid-row: 2; }
footer a:nth-child(2) { grid-row: 5; }
footer a:nth-child(3) { grid-row: 8; } 

/* ==========================================================================
   3. STRUCTURE DES SECTIONS & TITRES
   ========================================================================== */
section {
    min-height: 100vh; 
    display: flex;
    flex-direction: column;
    justify-content: center; 
    align-items: center;     
    color: #e5e4e4;
    scroll-snap-align: start;
    background-attachment: fixed;
}

h2 {
    font-size: 2.1em;
    background-color: #ed6a6c;
    color: #e5e4e4;
    padding: 15px 30px;
    border-radius: 50px;
    border: solid 3px #e5e4e4;
    text-align: center;
    text-transform: uppercase;
    transition: all 0.5s;
    margin-top: 100px;
    width: fit-content;
}

/* ==========================================================================
   4. GRILLES DE PROJETS (Stage, MMI, Perso)
   ========================================================================== */

/* Section Stage unique */
#stage {
    display: flex;
    justify-content: center;
    margin: 50px auto;
    width: 85%;
}

.stage {
    position: relative;
    flex: 0 1 800px;
    border-radius: 50px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.stage img {
    width: 100%; 
    height: 100%;
    object-fit: cover;
    display: block;
    border: none;   
    transition: transform 0.5s ease;
}

.stage:hover img {
    transform: scale(1.05);
}

.stage:hover img { transform: scale(1.05); }

/* Containers Projets */
.projets-container, .personnels {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    width: 85%;
    max-width: 1400px;
    margin: 50px auto;
    justify-content: center;
}

.projet-card {
    position: relative;
    flex: 0 1 calc(33.333% - 30px); 
    min-width: 300px;
    border-radius: 50px;
    border: 3px solid #ed6a6c;
    overflow: hidden;
    background-color: #181717;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.projet-card img {
    width: 100%;
    display: block;
    transition: transform 0.5s ease;
}

.projet-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(237, 106, 108, 0.2);
}

.projet-card:hover img { transform: scale(1.05); }

/* Spécificités MMI (Carrés) */
.projets-container .projet-card { aspect-ratio: 1 / 1; }
.projets-container .projet-card img { height: 100%; object-fit: cover; }

/* Spécificités Perso (Proportions libres) */
.personnels .projet-card { height: auto; align-self: flex-start; }
.personnels .projet-card img { height: auto; object-fit: contain; }

/* ==========================================================================
   5. OVERLAY & LIGHTBOX
   ========================================================================== */
.projet-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(24, 23, 23, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.projet-overlay h3 {
    color: #e5e4e4;
    font-size: 1.5em;
    text-transform: uppercase;
}

.projet-card:hover .projet-overlay, 
.stage:hover .projet-overlay { opacity: 1; }

.lightbox {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    justify-content: center;
    align-items: center;
}

.lightbox-content {
    max-width: 90%;
    max-height: 85vh;
    border-radius: 30px;
    border: 3px solid #ed6a6c;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
    animation: zoom 0.3s ease; 
}

@keyframes zoom {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.close-lightbox {
    position: absolute;
    top: 30px; right: 40px;
    color: white;
    font-size: 60px;
    cursor: pointer;
}

/* ==========================================================================
   6. RESPONSIVE DESIGN
   ========================================================================== */
@media screen and (max-width: 900px) {
    .burger-icone { display: flex; flex-direction: column; gap: 6px; cursor: pointer; z-index: 2000; order: 1; }
    .burger-icone span { display: block; width: 35px; height: 3px; background-color: #e5e4e4; border-radius: 5px; transition: 0.3s ease; }
    
    #burger-bouton:checked ~ .burger-icone span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
    #burger-bouton:checked ~ .burger-icone span:nth-child(2) { opacity: 0; }
    #burger-bouton:checked ~ .burger-icone span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

    header .navig {
        position: fixed; top: 0; right: -100%; width: 80%; height: 100vh;
        background-color: #181717; flex-direction: column; justify-content: center;
        align-items: center; gap: 40px; border-radius: 0; border-left: 3px solid #ed6a6c;
        transition: 0.5s ease; z-index: 1500;
    }

    #burger-bouton:checked ~ .navig { right: 0; }
    header .logo { order: 2; }
    header .logo img { width: 60px; }

    footer .reseaux {
        position: relative;
        height: auto; width: 100%;
        top: 0; left: 0;
        display: flex;
        flex-direction: row;
        justify-content: center;
        gap: 30px;
        padding: 40px 0;
        background-color: #181717;
    }
    
    footer { scroll-snap-align: end; }
    
    .projet-card { flex: 0 1 100%; }
}