/* --- CONFIGURATION --- */
:root {
    --bg-dark: #0f0505;
    --bg-gradient-start: #2c0005; 
    --bg-gradient-end: #5a0015;   
    --accent-pink: #ff4d6d;
    --text-white: #ffffff;
    --text-gray: #cccccc;
    
    /* Pour la carte d'infos blanche */
    --card-bg: #ffffff;
    --card-text: #333333;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Montserrat', sans-serif;
    color: var(--text-white);
    background: radial-gradient(circle at top center, var(--bg-gradient-end), var(--bg-dark) 70%);
    background-color: var(--bg-dark);
    line-height: 1.6;
    padding-bottom: 50px;
}

/* --- BOUTON RETOUR --- */
.back-button {
    position: absolute;
    top: 30px;
    left: 30px;
    color: var(--text-white);
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: color 0.3s;
    z-index: 10;
}
.back-button:hover { color: var(--accent-pink); }

/* --- HERO SECTION --- */
.project-hero {
    height: 60vh; /* Prend 60% de la hauteur de l'écran */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    /* Image de fond optionnelle, assombrie */
    background: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)), url('https://via.placeholder.com/1920x1080'); 
    background-size: cover;
    background-position: center;
}

.project-tag {
    display: inline-block;
    background-color: var(--accent-pink);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.project-tagline {
    font-size: 1.2rem;
    color: var(--text-gray);
    max-width: 600px;
    margin: 0 auto;
}

/* --- CONTENEUR PRINCIPAL --- */
.case-study {
    max-width: 900px; /* Largeur de lecture confortable */
    margin: -50px auto 0; /* Remonte légèrement sur le Hero */
    padding: 0 20px;
    position: relative;
}

/* --- CARTE INFOS (Style "Expériences" blanc) --- */
.info-card {
    background-color: var(--card-bg);
    color: var(--card-text);
    border-radius: 15px;
    padding: 30px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    margin-bottom: 60px;
}

.info-item {
    flex: 1;
    min-width: 150px;
}

.info-item h3 {
    font-size: 0.9rem;
    color: var(--accent-pink);
    margin-bottom: 5px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-item p, .info-item a {
    font-weight: 600;
    font-size: 1rem;
    color: #222;
    text-decoration: none;
}

.info-item a:hover { text-decoration: underline; }

/* --- CONTENU TEXTE --- */
.content-block {
    margin-bottom: 60px;
}

.content-block h2 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: var(--accent-pink); /* Titres en rose/rouge */
}

.content-block p {
    font-size: 1.1rem;
    color: #ddd;
    margin-bottom: 20px;
}

/* --- GALERIE MOODBOARD --- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.gallery-item img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    transition: transform 0.3s;
}

.gallery-item img:hover {
    transform: scale(1.02);
}

/* --- VIDEO --- */
.video-container {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 15px;
    overflow: hidden;
    margin-top: 20px;
}

.fake-video {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #666;
    background: #111;
}

.fake-video i { font-size: 3rem; margin-bottom: 10px; }

iframe { width: 100%; height: 100%; border: none; }

/* --- FOOTER --- */
footer {
    text-align: center;
    font-size: 0.9rem;
    color: #666;
    margin-top: 50px;
}
footer a { color: var(--text-gray); }

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .project-hero { height: 50vh; }
    .hero-content h1 { font-size: 2.5rem; }
    .info-card { flex-direction: column; }
    .back-button { top: 20px; left: 20px; background: rgba(0,0,0,0.5); padding: 5px 10px; border-radius: 5px;}
}

/* --- SECTION RENDU FINAL --- */

.final-render {
    text-align: center;
    margin-bottom: 100px;
}

/* --- LE LAPTOP (CSS PUR) --- */
.laptop-wrapper {
    max-width: 800px;
    margin: 40px auto 60px;
    position: relative;
}

/* L'écran (La partie noire autour de l'image) */
.laptop-screen {
    background-color: #111;
    border-radius: 12px 12px 0 0;
    padding: 3%; /* Bordure noire de l'écran */
    box-shadow: 0 0 0 2px #333; /* Contour gris subtil */
    position: relative;
}

/* La zone visible de l'image (Fenêtre) */
.laptop-screen {
    /* On définit une hauteur fixe pour simuler la fenêtre */
    height: 450px; 
    overflow-y: auto; /* Permet de scroller l'image à l'intérieur ! */
    overflow-x: hidden;
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: var(--accent-pink) #222;
}

/* Personnalisation de la barre de défilement (Chrome/Safari) */
.laptop-screen::-webkit-scrollbar {
    width: 8px;
}
.laptop-screen::-webkit-scrollbar-track {
    background: #222;
}
.laptop-screen::-webkit-scrollbar-thumb {
    background-color: var(--accent-pink);
    border-radius: 4px;
}

/* L'image à l'intérieur */
.laptop-screen img {
    display: block;
    width: 100%;
    height: auto;
}

/* La base du clavier (le bas du laptop) */
.laptop-base {
    background-color: #222; /* Gris foncé métallique */
    height: 25px;
    width: 110%; /* Plus large que l'écran */
    margin-left: -5%; /* Centrer la base */
    border-radius: 0 0 15px 15px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6); /* Ombre portée au sol */
}

/* Petite encoche pour ouvrir le laptop (détail purement esthétique) */
.laptop-base::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 8px;
    background-color: #333;
    border-radius: 0 0 5px 5px;
}

/* --- VERSION MOBILE --- */
.mobile-previews h3 {
    margin: 40px 0 20px;
    font-size: 1.5rem;
    color: var(--text-white);
}

.mobile-grid {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.mobile-frame {
    width: 200px; /* Taille réaliste mobile */
    border-radius: 20px;
    border: 8px solid #222; /* Bordure téléphone */
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    transition: transform 0.3s ease;
}

.mobile-frame:hover {
    transform: translateY(-10px);
}

ul {
    margin-left: 25px;
    font-size: 1.1rem;
    color: #ddd;
}


/* --- AJOUTS POUR LA GALERIE PHOTO CARRÉE --- */

/* La grille conteneur */
.photo-grid {
    display: grid;
    /* 3 colonnes de largeur égale */
    grid-template-columns: repeat(3, 1fr);
    gap: 20px; /* Espace entre les photos */
    margin-top: 30px;
}

/* L'élément contenant l'image */
.photo-item {
    position: relative;
    width: 100%;
    /* L'astuce moderne pour forcer un ratio carré parfait (1/1) */
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 12px;
    cursor: pointer; /* Change le curseur pour indiquer que c'est cliquable */
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

/* L'image elle-même */
.photo-item img {
    width: 100%;
    height: 100%;
    /* 'cover' assure que l'image remplit le carré sans être déformée, quitte à être un peu coupée sur les bords */
    object-fit: cover; 
    transition: transform 0.4s ease;
}

/* Effet de zoom au survol */
.photo-item:hover img {
    transform: scale(1.08);
}


/* --- STYLES DE LA MODALE (Affichage en grand) --- */

/* Le fond sombre qui couvre tout l'écran */
.modal {
    display: none; /* Caché par défaut */
    position: fixed; /* Reste fixe même si on scrolle */
    z-index: 1000; /* Au-dessus de tout le reste */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.9); /* Fond noir très opaque */
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* L'image en grand dans la modale */
.modal-content {
    margin: auto;
    display: block;
    max-width: 90%; /* Ne dépasse pas 90% de la largeur de l'écran */
    max-height: 85vh; /* Ne dépasse pas 85% de la hauteur de l'écran */
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0,0,0,0.8);
    animation: zoomIn 0.3s; /* Petit effet d'apparition */
}

/* La légende sous l'image */
#caption {
    margin: 15px auto;
    display: block;
    width: 80%;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    font-size: 1.1rem;
}

/* Le bouton de fermeture (X) */
.close-modal {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 1001;
}

.close-modal:hover,
.close-modal:focus {
    color: var(--accent-pink);
    text-decoration: none;
    cursor: pointer;
}

/* Animation d'ouverture */
@keyframes zoomIn {
    from {transform:scale(0.8); opacity: 0;}
    to {transform:scale(1); opacity: 1;}
}

/* Adaptation mobile pour la grille */
@media (max-width: 768px) {
    .photo-grid {
        /* Sur mobile, on passe à 2 colonnes pour que ce soit plus lisible */
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
     .close-modal {
        top: 10px;
        right: 20px;
        font-size: 30px;
    }
}