@font-face {
    font-family: 'Bimbo Pro';
    src: url('font/bimbo/Bimbo%20Trial.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* Variables & Reset */
:root {
    --bg-color: #FAFAFA;
    --text-color: #000000;
    --accent-color: #FFA500;
    /* Orange/Ambre */
    --footer-text: #00008B;
    /* Dark Blue */
    --logo-blue: #0047AB;
    /* Bleu signature logo */
    --font-family: 'Courier New', Courier, monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-family);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Typography elements */
a {
    transition: color 0.3s ease;
}

/* Header & Nav */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5%;
    background-color: #f2f2f2;
    border-bottom: 1px solid #e0e0e0;
}

header .logo img {
    max-height: 90px;
    display: block;
}

.nav-container {
    display: flex;
    align-items: center;
    gap: 40px;
}

nav {
    display: flex;
    gap: 30px;
}

nav a {
    text-decoration: none;
    color: var(--text-color);
    font-size: 1.1rem;
    font-weight: normal;
}

nav a:hover,
nav a.active {
    color: var(--accent-color);
}

.btn-pill {
    background-color: var(--accent-color);
    color: white;
    text-decoration: none;
    padding: 10px 30px;
    border-radius: 50px;
    font-weight: normal;
    font-size: 1.1rem;
    transition: background-color 0.3s ease;
}

.btn-pill:hover {
    background-color: #e69500;
}

/* Language Switcher */
.lang-switcher {
    display: flex;
    background-color: transparent;
    border: 2px solid var(--accent-color);
    border-radius: 20px;
    margin-left: 20px;
    overflow: hidden;
}

.lang-btn {
    padding: 6px 15px;
    text-decoration: none;
    color: var(--accent-color);
    font-size: 0.95rem;
    font-weight: bold;
    transition: background-color 0.3s, color 0.3s;
}

.lang-btn.active {
    background-color: var(--accent-color);
    color: white;
    cursor: default;
    pointer-events: none;
}

.lang-btn:hover:not(.active) {
    background-color: #ffeed0;
}

/* Layout */
main {
    flex: 1;
    padding: 40px 10%;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.page-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 20px;
    /* Reduced space below title */
    color: var(--text-color);
}

/* Footer */
footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 30px 20px;
    margin-top: 50px;
    background-color: #f2f2f2;
    border-top: 1px solid #e0e0e0;
}

footer img {
    max-height: 50px;
    margin-bottom: 0;
    /* Changed since it is side by side */
}

footer p {
    color: var(--footer-text);
    font-size: 1rem;
    font-weight: normal;
}

/* === Page 1: Accueil === */
.home-main {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.typewriter-title {
    font-size: 4rem;
    text-align: center;
    margin-top: 40px;
    margin-bottom: 20px;
}

.typewriter-subtext {
    font-size: 1.15rem; /* Taille réduite pour plus de subtilité */
    text-align: center;
    margin-bottom: 80px;
    color: #444;
}

.content-wrapper {
    display: flex;
    justify-content: space-between;
    width: 100%;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap;
}

.card {
    border: 3px solid var(--accent-color);
    background-color: transparent;
    padding: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    min-width: 350px;
}

.card p {
    color: var(--footer-text);
    font-size: 1.8rem;
    letter-spacing: 2px;
}

.btn-primary {
    background-color: var(--accent-color);
    color: white;
    text-decoration: none;
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: bold;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-primary:hover {
    background-color: #e69500;
}

/* Polaroids (Accueil) */
.polaroid-container {
    position: relative;
    width: 400px;
    height: 400px;
    margin-right: 50px;
}

.polaroid {
    position: absolute;
    width: 260px;
    height: 320px;
    background-color: white;
    padding: 15px 15px 60px 15px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #eaeaea;
}

.polaroid-1 {
    z-index: 1;
    transform: rotate(-8deg);
    top: 20px;
    left: 0;
}

.polaroid-2 {
    z-index: 2;
    transform: rotate(12deg);
    top: 60px;
    left: 100px;
}

.polaroid-img-placeholder {
    width: 100%;
    height: 100%;
    background-color: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    font-weight: bold;
}

/* === Page 2: Projets (Masonry) === */

/* Filter Bubbles */
.filter-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 50px;
    /* Increased gap again */
}

.filter-btn {
    background-color: transparent;
    border: 1px solid transparent;
    /* Invisible border to avoid jumping */
    color: var(--text-color);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: normal;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.filter-btn:hover,
.filter-btn.active {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

.masonry-gallery {
    display: flex;
    gap: 35px;
    /* Écartement entre les 3 colonnes HTML */
    align-items: flex-start;
}

.masonry-column {
    display: flex;
    flex-direction: column;
    flex: 1;
    /* Chaque colonne prend la même largeur d'1/3 de l'écran */
    gap: 40px;
    /* Grand écart vertical pour laisser respirer l'animation polaroïd qui prend 60px */
}

.gallery-item {
    display: block;
    width: 100%;
    position: relative;
    /* Protège le contexte d'empilement */
}

/* Base card container */
.project-polaroid {
    display: block;
    text-decoration: none;
    position: relative;
    z-index: 1;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* Douce fluidité */
}

/* Base image (Statique dans son cadre) */
.project-polaroid img {
    width: 100%;
    display: block;
    border-radius: 0;
    /* Images brutes pointues */
    position: relative;
    z-index: 2;
    /* L'image sera peinte sur le fond blanc virtuel */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    /* L'ombre portée très douce de base pour détacher la photo ! */
}

/* Cadre Polaroïd dessiné artificiellement au survol */
.project-polaroid::before {
    content: "";
    position: absolute;
    top: -15px;
    /* Déborde autour de l'image de tous les côtés */
    left: -15px;
    right: -15px;
    bottom: -60px;
    /* Grand espace en bas polaroid */
    background-color: white;
    border-radius: 8px;
    /* Le cadre est doucement arrondi, pas les images ! */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    opacity: 0;
    /* Invisible par défaut */
    z-index: 0;
    /* Se glisse absolument derrière l'image */
    transition: opacity 0.3s ease;
    pointer-events: none;
}

/* Texte par-dessus le cadre en bas */
.polaroid-text {
    display: flex;
    position: absolute;
    bottom: -60px;
    /* Centré dans la marge basse définie au-dessus */
    left: 0;
    right: 0;
    height: 60px;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-family: 'Bimbo Pro', 'Bimbo', cursive;
    font-size: 1.4rem;
    /* Pas trop gros ! */
    color: var(--text-color);
    opacity: 0;
    /* Invisible par défaut */
    z-index: 5;
    /* Au-dessus de la bordure blanche */
    transition: opacity 0.3s ease;
    pointer-events: none;
}

/* Application du survol: Révélation pure en fondu avec fort accent physique dynamique */
.project-polaroid:hover {
    z-index: 50;
    /* S'assure que le fondu apparaît par-dessus les images voisines ! */
    transform: translateY(-6px) rotate(-1.5deg);
    /* Soulèvement et rotation propres */
}

.project-polaroid:hover::before {
    opacity: 1;
    /* Le cadre blanc apparaît ! */
}

.project-polaroid:hover .polaroid-text {
    opacity: 1;
    /* Le nom du projet apparaît ! */
}



.gallery-item p {
    text-align: center;
    margin-top: 15px;
    font-size: 1.2rem;
    font-weight: bold;
}

.gallery-img.tall {
    height: 400px;
}

.gallery-img.medium {
    height: 300px;
}

.gallery-img.short {
    height: 200px;
}

@media (max-width: 900px) {
    .masonry-gallery {
        flex-direction: column;
        /* Empile les 3 colonnes les unes sous les autres sur mobile */
    }
}

/* === Page 3: Qui suis-je === */
.about-container {
    display: flex;
    gap: 60px;
    /* Espace restitué pour créer une belle marge entre photos et texte */
    align-items: flex-start;
    /* Fixé en haut pour descendre le texte manuellement de manière sûre */
    margin-top: 20px;
    /* Remonté pour être plus collé au titre global */
}

.about-photo-stack {
    flex: 1;
    min-width: 290px;
    max-width: 310px;
    /* Largeur max plus fine car on serre les photos entre elles */
    height: 520px;
    position: relative;
    cursor: pointer;
    margin-left: -30px;
    /* Réduit l'écart avec le bord de gauche (rapproche de la bordure du bloc) */
}

.about-img-placeholder {
    width: 290px;
    /* Photos maintenues agrandies */
    height: 420px;
    background-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    overflow: hidden;
    position: absolute;
    top: 50%;
    left: 50%;
    margin-top: -210px;
    margin-left: -145px;
    transition: transform 0.4s ease, opacity 0.4s ease;
}

/* Tas un peu moins déconstruit (Tighter Pile) pour bien dégager le texte à droite */
.about-photo-stack .stack-1 {
    transform: rotate(-10deg) translate(-15px, 15px);
    z-index: 1;
}

.about-photo-stack .stack-2 {
    transform: rotate(8deg) translate(12px, -8px);
    z-index: 2;
}

.about-photo-stack .stack-3 {
    transform: rotate(-5deg) translate(-8px, -15px);
    z-index: 3;
}

.about-photo-stack .stack-4 {
    transform: rotate(5deg) translate(8px, 8px);
    z-index: 4;
}

.about-photo-stack .stack-5 {
    transform: rotate(-3deg) translate(-4px, 8px);
    z-index: 5;
}

.about-photo-stack .stack-6 {
    transform: rotate(2deg) translate(2px, -2px);
    z-index: 6;
}

/* Nouveau système : Slideshow CSS mis à jour pour 6 photos (2.5s par photo -> 15s total) */
@keyframes auto-slideshow {

    0%,
    13.33% {
        opacity: 1;
        z-index: 10;
        transform: rotate(0deg) scale(1.05) translateY(0);
        box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    }

    16.66%,
    96.66% {
        opacity: 0;
        z-index: 1;
        transform: rotate(6deg) scale(0.95) translateY(35px);
        /* Glisse vers le bas */
    }

    100% {
        opacity: 1;
        z-index: 10;
        transform: rotate(0deg) scale(1.05) translateY(0);
        box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    }
}

.about-photo-stack:hover .about-img-placeholder {
    /* 9 secondes car il y a 6 photos (1.5s x 6 = 9s) - rythme beaucoup plus soutenu ! */
    animation: auto-slideshow 9s infinite;
}

/* Calcul mathématique parfait en synchronisation négative pour 6 modules ! */
.about-photo-stack:hover .stack-6 {
    animation-delay: 0s;
}

.about-photo-stack:hover .stack-5 {
    animation-delay: -7.5s;
}

.about-photo-stack:hover .stack-4 {
    animation-delay: -6s;
}

.about-photo-stack:hover .stack-3 {
    animation-delay: -4.5s;
}

.about-photo-stack:hover .stack-2 {
    animation-delay: -3s;
}

.about-photo-stack:hover .stack-1 {
    animation-delay: -1.5s;
}

.about-img-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.about-page-title {
    font-size: 2.5rem;
    color: var(--text-color);
    text-align: left;
    /* Remis à gauche selon la demande */
    margin-bottom: 20px;
    margin-top: 40px;
    /* Baisse le texte d'un cran ("un peu") vis-à-vis du sommet, sans risquer de déborder des 520px des photos */
}

.about-text {
    flex: 2;
    font-size: 1.05rem;
    /* Police légèrement diminuée */
    line-height: 1.7;
    margin-left: 0;
    /* Suppression du décalage négatif pour aérer */
}

.about-text p {
    margin-bottom: 20px;
}

/* === Interactive Portfolio Game Section === */
#portfolio-game-section {
    margin: 80px auto -30px auto; /* Marge basse adoucie pour que le footer ne colle pas trop aux éléments du jeu tout en évitant le grand écart 16/9 original */
    width: 100%;
    max-width: 1100px;
    padding: 0 20px;
}

.game-board {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: transparent;
    border: none;
    box-shadow: none;
}

.game-text-panel {
    position: absolute;
    bottom: 90px;
    /* Remonté un peu plus haut */
    left: 20px;
    width: auto;
    max-width: 350px;
    background-color: transparent;
    padding: 0;
    box-shadow: none;
    z-index: 10;
}

.game-title {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.8rem;
    color: #222;
    margin-bottom: 14px;
    /* Un peu d'air en dessous de la ligne */
    border-bottom: 1px solid #777;
    /* Trait rendu beaucoup plus fin (1px) */
    display: inline-block;
    padding-bottom: 8px;
    /* On écarte le texte du trait souligné */
    font-weight: bold;
}

.game-desc {
    font-size: 0.95rem;
    line-height: 1.4;
    color: var(--accent-color);
    /* Petite phrase passée en orange */
    font-family: 'Courier New', Courier, monospace;
    font-weight: normal;
}

.click-badge {
    display: inline-block;
    border: 1.5px solid var(--accent-color);
    /* Contour orange affirmé */
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    /* Contour circulaire asymétrique (comme les images trouvées) */
    color: var(--accent-color);
    padding: 3px 10px;
    /* Plus d'espace autour du mot */
    margin: 0 4px;
    /* Un peu d'air de chaque côté */
    vertical-align: middle;
    /* Alignement parfaitement centré avec la phrase */
}

.game-item {
    position: absolute;
    /* Plus de couleur de fond (background-color), la box disparaît ! Seul le PNG est visible. */
    border-radius: 0;
    cursor: pointer;
    transition: transform 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: none;
    border: none;
}

.game-item:hover:not(.game-answered) {
    transform: scale(1.05);
    /* L'image (le PNG seul) grossit au survol, sans cadre gris. */
}

.game-item-img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Gère parfaitement les proportions des PNG sans les écraser */
    pointer-events: none; /* Le conteneur parent gère le clic, l'image devient "immatérielle" au curseur */
    display: block;
    transform: scale(2.0); /* ✅ AGRANDISSEMENT GLOBAL MASSIF POUR TOUTES LES IMAGES */
}

.game-number {
    position: absolute;
    top: -5px;
    left: -20px;
    /* Position en haut à gauche de l'objet, comme sur l'image */
    background-color: transparent;
    color: #444;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: normal;
    font-size: 0.8rem;
    border: 1px solid #999;
    /* Fin cercle style fil de fer */
    box-shadow: none;
    z-index: 5;
    pointer-events: none;
}

/* JavaScript Game Feedback States */
.game-answered {
    cursor: default;
    pointer-events: none;
    /* Rend inactif */
}

.game-correct {
    background-color: transparent !important;
    border: none !important;
}

.game-correct::after {
    /* Style encerclé minimaliste à la main bleu signature */
    content: '';
    position: absolute;
    top: -15px;
    left: -15px;
    right: -15px;
    bottom: -15px;
    border: 2px solid var(--logo-blue);
    /* Bleu du logo Prénom */
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    /* Imparfait, style organique au feutre */
    pointer-events: none;
    animation: hand-drawn-circle 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Modificateur pour les éléments qui exigent un contour affiné horizontalement (ex: lunettes dans une boîte haute) */
.horizontal-contour.game-correct::after {
    top: 15%;    /* Force le contour à descendre (ignore le vide transparent en haut de l'image) */
    bottom: 35%; /* Pousse le bas encore plus bas pour suivre les lunettes */
    left: -25px; /* Allonge le cercle sur les côtés */
    right: -25px; /* Allonge le cercle sur les côtés */
    border-radius: 50% 50% 45% 55% / 60% 40% 55% 45%; /* Lisse la forme plus horizontalement */
}

.game-incorrect {
    background-color: transparent !important;
    border: none !important;
    opacity: 0.3;
    /* S'estompe simplement et discrètement */
    filter: grayscale(100%);
    animation: portfolio-game-shake 0.4s;
}

@keyframes hand-drawn-circle {
    0% {
        transform: scale(0.6) rotate(-10deg);
        opacity: 0;
    }

    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

@keyframes portfolio-game-shake {
    0% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-3px);
    }

    50% {
        transform: translateX(3px);
    }

    75% {
        transform: translateX(-3px);
    }

    100% {
        transform: translateX(0);
    }
}

@media (max-width: 900px) {
    .game-board {
        aspect-ratio: auto;
        min-height: 500px;
    }

    .game-text-panel {
        width: calc(100% - 40px);
        max-width: none;
        bottom: 10px;
        left: 20px;
        padding: 15px;
        z-index: 20;
    }
}

/* === Page 4: Contact === */
.contact-container {
    max-width: 700px;
    margin: 0 auto;
    background-color: white;
    padding: 50px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.03);
    border: 1px solid #f0f0f0;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-group label {
    font-size: 1.1rem;
    font-weight: bold;
}

.form-group input,
.form-group textarea {
    padding: 15px;
    font-family: var(--font-family);
    font-size: 1rem;
    border: 2px solid #e0e0e0;
    background-color: #fafafa;
    border-radius: 4px;
    outline: none;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--accent-color);
}

.form-group textarea {
    min-height: 180px;
    resize: vertical;
}

.btn-submit {
    background-color: var(--accent-color);
    color: white;
    font-family: var(--font-family);
    font-size: 1.2rem;
    font-weight: bold;
    padding: 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: 10px;
}

.btn-submit:hover {
    background-color: #e69500;
}

/* Toutes les animations de survol (transform, ombre) ont été totalement retirées pour une galerie rigoureusement propre et statique. */

/* Responsive adjustments */
@media (max-width: 1024px) {
    .content-wrapper {
        justify-content: center;
        flex-direction: column;
    }

    .polaroid-container {
        margin-top: 50px;
        margin-right: 0;
    }

    .about-container {
        flex-direction: column;
    }

    .project-content {
        flex-direction: column;
    }

    .project-gallery-grid .grid-images {
        flex-direction: column;
    }
}

/* Removed legacy pseudo-element hacks to fix disappearing rendering bugs */

/* === Project Detail Page Template === */
.project-detail-page {
    max-width: 1200px;
}

.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: var(--accent-color);
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
}

.project-hero {
    width: 100%;
    margin-bottom: 50px;
}

.project-hero img {
    width: 100%;
    max-height: 600px;
    /* Limits huge vertical images */
    object-fit: contain;
    background-color: transparent;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.project-content {
    display: flex;
    gap: 50px;
    margin-bottom: 60px;
    align-items: flex-start;
}

.project-description {
    flex: 2;
}

.project-description h2,
.project-sidebar h2,
.project-gallery-grid h2 {
    color: var(--logo-blue);
    margin-bottom: 25px;
    font-size: 1.8rem;
    font-family: var(--font-family);
    font-weight: bold;
}

.project-description p {
    font-size: 1.15rem;
    line-height: 1.8;
    margin-bottom: 20px;
    color: #333;
}

.project-sidebar {
    flex: 1;
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    border: 1px solid #eee;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.tools-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tool-badge {
    background-color: #fcfcfc;
    color: var(--text-color);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.95rem;
    border: 1px solid var(--logo-blue);
    transition: background-color 0.2s;
    cursor: default;
}

.tool-badge:hover {
    background-color: #f0f4f8;
}

.project-gallery-grid .grid-images {
    display: flex;
    gap: 20px;
    justify-content: space-between;
}

.grid-placeholder {
    flex: 1;
    height: 300px;
    background-color: #fafafa;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #888;
    border: 2px dashed #ccc;
    font-weight: bold;
}

/* =========================================================
   Mobile-First & Navigation Burger Responsive (Glassmorphism) 
   ========================================================= */

/* Tailles tactiles 44x44px minimales (UX Mobile Actuel) */
a, button, .filter-btn, .lang-btn, .project-card, .btn-primary, .burger-menu {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Police dynamique (Fluide entre Mobile et Desktop via clamp) */
html {
    font-size: clamp(14px, 2vw, 17px); 
}
h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
}
h2 {
    font-size: clamp(2rem, 5vw, 3rem);
}

/* Base du bouton Burger (Caché sur Desktop) */
.burger-menu {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1000;
    padding: 10px;
}

.burger-menu span {
    display: block;
    width: 26px;
    height: 3px;
    background-color: var(--logo-blue);
    border-radius: 3px;
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55),
                opacity 0.3s ease, background-color 0.3s;
}

/* Animation Originale du Burger -> Croix avec effet visuel dynamique */
.burger-menu.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
    background-color: var(--accent-color);
}
.burger-menu.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(20px); /* Glisse sur le côté avant de disparaître */
}
.burger-menu.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
    background-color: var(--accent-color);
}

/* === Bouton Global Universel : Scroll To Bottom === */
.scroll-bottom-btn {
    position: fixed;
    right: 30px;
    bottom: 30px;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background-color: var(--logo-blue); /* Couleur bleue de la DA (Logo) */
    color: #fff; /* Flèche Blanche très claire */
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0.8; /* Légère transparence pour se fondre dans le décor (Discret) */
}

.scroll-bottom-btn:hover {
    transform: translateY(5px); /* Animation intuitive pointant vers le bas */
    opacity: 1; /* Pleine visibilité au survol */
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* Réduction tactile de préservation pour petit écran */
@media (max-width: 600px) {
    .scroll-bottom-btn {
        right: 15px;
        bottom: 15px;
        width: 44px; /* Zone tactile minimum iOS */
        height: 44px;
        opacity: 0.6; /* Encore plus discret sur Mobile ! */
    }
}

/* Bloquer le scroll lors de l'ouverture du menu mobile */
body.no-scroll {
    overflow: hidden;
}

/* Breakpoint Mobile (Passage au Menu Burger et adaptation des grilles globales) */
@media (max-width: 900px) {
    header {
        justify-content: space-between;
        padding: 15px 20px;
        position: relative;
    }

    .burger-menu {
        display: flex;
    }

    /* Overlay Glassmorphism pour la Navigation Mobile */
    .nav-container {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(255, 255, 255, 0.75);
        backdrop-filter: blur(15px); /* Effet Verre Flouté premium */
        -webkit-backdrop-filter: blur(15px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 30px;
        z-index: 999;
        
        /* Effet Spring d'ouverture (panneau qui glisse et rebondit avec masque arrondi en bas) */
        transform: translateY(-100%);
        border-radius: 0 0 50% 50% / 0 0 15% 15%; 
        opacity: 0;
        visibility: hidden;
        transition: transform 0.7s cubic-bezier(0.68, -0.55, 0.265, 1.45),
                    opacity 0.5s, border-radius 0.7s, visibility 0.7s;
    }

    .nav-container.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
        border-radius: 0; /* Le masque élastique s'aplatit à l'arrivée */
    }

    .nav-container nav {
        flex-direction: column;
        text-align: center;
        width: 100%;
        gap: 15px;
    }

    .nav-container nav a {
        font-size: 2rem;
        font-weight: 700;
        margin: 15px 0;
        color: var(--text-color);
        /* Préparation Cascade Menu */
        opacity: 0;
        transform: translateY(30px);
        transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }
    
    .nav-container a:hover::after {
        width: 0; /* Évite les lignes soulignées massives sous les doigts sur mobile */
    }

    .nav-container .lang-switcher {
        margin-top: 20px;
        /* Préparation Cascade Menu */
        opacity: 0;
        transform: translateY(30px);
        transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    /* Animation Apparition Cascade lorsque '.active' est déclenché par le JS */
    .nav-container.active nav a:nth-child(1) { transition-delay: 0.3s; opacity: 1; transform: translateY(0); }
    .nav-container.active nav a:nth-child(2) { transition-delay: 0.4s; opacity: 1; transform: translateY(0); }
    .nav-container.active nav a:nth-child(3) { transition-delay: 0.5s; opacity: 1; transform: translateY(0); }
    .nav-container.active nav a:nth-child(4) { transition-delay: 0.6s; opacity: 1; transform: translateY(0); }
    .nav-container.active nav a:nth-child(5) { transition-delay: 0.7s; opacity: 1; transform: translateY(0); }
    .nav-container.active .lang-switcher { transition-delay: 0.8s; opacity: 1; transform: translateY(0); }

    /* Corrections structurelles pour le responsive global */
    .hero, .about-section, .contact-section {
        flex-direction: column;
        padding: 40px 20px;
        text-align: center;
    }

    .hero-content {
        max-width: 100%;
        margin-bottom: 40px;
        text-align: center;
    }

    .about-container {
        flex-direction: column;
        gap: 40px;
    }
    .project-grid {
        grid-template-columns: repeat(2, 1fr) !important; /* Retour à une grille Galerie sur 2 colonnes miniaturisées au lieu de grandes tuiles 100% */
        gap: 15px !important;
    }

    .project-img {
        height: 150px !important; /* Hauteur réduite pour que l'image complète soit vue d'un coup sur téléphone */
    }

    .hero-title br {
        display: none; /* Le texte coule naturellement selon la largeur d'écran */
    }

/* =========================================================
   Mobile Bug Fixes (Photos & Game Overflow) Strict
   ========================================================= */
    /* 1. Correction du bug des Photos / Images qui s'étirent ou débordent */
    img, .project-gallery img, .grid-images img {
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* Passage en colonne des conteneurs risquant l'éclatement sous la pression des grilles d'images */
    .grid-images, .split-content {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        gap: 20px !important;
    }

}

/* =========================================================
   REQUÊTE CRITIQUE - REFONTE TOTALE MOBILE STRICTE (< 600px)
   ========================================================= */
@media (max-width: 600px) {

    /* 1. EN-TÊTE CASSÉ (Séparation du logo et du menu) */
    header {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 15px 20px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    .logo {
        margin: 0 !important;
        flex: 0 0 auto !important;
    }
    .logo img {
        max-width: 180px !important;
    }
    .burger-menu {
        position: relative !important;
        margin: 0 !important;
        right: 0 !important;
        top: 0 !important;
    }

    /* 2. PILE DE POLAROIDS (Centrée avec Animation Automatique) */
    .about-photo-stack {
        display: block !important;
        position: relative !important;
        width: 100% !important;
        height: 480px !important;
        margin: 120px auto 10px auto !important; /* 120px DE MARGE HAUT POUR DÉGAGER LE HEADER ! */
        transform: scale(0.65) !important; /* Réduit drastiquement l'échelle pour l'écran */
        transform-origin: top center !important;
        overflow: visible !important;
    }
    
    .about-photo-stack .about-img-placeholder {
        position: absolute !important;
        display: block !important;
        top: 50% !important;
        left: 50% !important;
        margin-top: -210px !important; /* Exacte moitié de la hauteur */
        margin-left: -145px !important; /* Exacte moitié de sa largeur */
        flex: none !important;
        width: 290px !important;
        height: 420px !important;
        transform-origin: center bottom !important; /* Mouvement d'éventail naturel depuis la base */
        box-shadow: 0 10px 25px rgba(0,0,0,0.15) !important;
        border-radius: 12px !important;
    }

    /* Animation d'éventail autonome et fluide pour Mobile */
    @keyframes mobileFanOut1 {
        0%, 15% { transform: rotate(0deg) translateY(0); }
        45%, 55% { transform: rotate(-12deg) translateX(-20px) translateY(-10px); }
        85%, 100% { transform: rotate(0deg) translateY(0); }
    }
    @keyframes mobileFanOut2 {
        0%, 15% { transform: rotate(0deg) translateY(0); }
        45%, 55% { transform: rotate(12deg) translateX(20px) translateY(-10px); }
        85%, 100% { transform: rotate(0deg) translateY(0); }
    }
    @keyframes mobileFanOut3 {
        0%, 15% { transform: rotate(0deg) translateY(0); }
        45%, 55% { transform: rotate(2deg) translateY(-15px); }
        85%, 100% { transform: rotate(0deg) translateY(0); }
    }

    /* On dispatche l'animation automatique aux différents polaroids de la pile */
    .about-photo-stack .about-img-placeholder:nth-child(1) { animation: mobileFanOut1 6s infinite ease-in-out !important; z-index: 3 !important; }
    .about-photo-stack .about-img-placeholder:nth-child(2) { animation: mobileFanOut2 6s infinite ease-in-out !important; z-index: 2 !important; }
    .about-photo-stack .about-img-placeholder:nth-child(3) { animation: mobileFanOut3 6s infinite ease-in-out !important; z-index: 1 !important; }

    .about-text {
        margin-top: 100px !important; /* Décolle massivement le texte de la zone d'animation des photos */
    }

    /* Effet typographique ajusté et asymétrique pour Qui Suis-je */
    .about-text h1.about-page-title {
        font-size: 2.2rem !important; /* Réduction mobile */
        text-align: left !important;
        line-height: 1.2 !important;
        margin-bottom: 20px !important;
    }

    .about-text p {
        font-size: 1rem !important; /* Réduction mobile pour améliorer le pavé */
        line-height: 1.8 !important; /* Hauteur de ligne très aérée (respiration) */
    }

    .about-text p:first-of-type {
        text-align: left !important;
    }
    
    .about-text p:nth-of-type(2) {
        text-align: right !important;
    }

    /* 3. INTERFACE DU JEU - Espacement Aéré et Objets Flottants */
    #portfolio-game-section {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 20px !important;
        margin: 0 auto !important;
        overflow-x: hidden !important; 
        box-sizing: border-box;
    }

    /* L'annonce du jeu RE-SPI-RE intensément */
    .game-text-panel {
        position: relative !important;
        display: block !important;
        top: auto !important;
        left: auto !important;
        bottom: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 80px 0 100px 0 !important; /* TRES GÉNEREL : Énormes marges aérées en haut et en bas ! */
        text-align: center !important;
        transform: none !important;
        padding: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }
    .game-text-panel h2, .game-text-panel h3 {
        text-align: center !important;
    }

    /* Le plateau abstrait devient un vrai "Nuage d'Objets" */
    .game-board {
        min-width: 0 !important; 
        width: 100% !important;
        height: auto !important;
        aspect-ratio: auto !important;
        display: flex !important;
        flex-wrap: wrap !important; /* Retour à la ligne pour former un cluster central */
        justify-content: center !important; 
        align-items: center !important; 
        align-content: center !important;
        gap: 15px !important; /* Très condensé pour que les éléments se touchent presque */
        background: transparent !important;
        padding-bottom: 60px !important;
    }

    /* Les objets miniatures se logent naturellement dans l'amas */
    .game-item {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        width: 110px !important; /* TAILLE ULTRA-RÉDUITE POUR MOBILE */
        height: 110px !important;
        aspect-ratio: auto !important;
        background-color: transparent !important; /* Disparition totale des tuiles claires */
        border-radius: 0 !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        padding: 0 !important; 
        margin: 0 !important;
        box-sizing: border-box;
        box-shadow: none !important; /* Retrait de toute structure rigide */
    }

    /* ==== LAYOUT "NUAGE DÉCONSTRUIT" (Scattered Desk / Éparpillé) ==== */
    /* Utilisation agressive de "translate" et "rotate" pour bousculer les boîtes physiques */
    .game-item:nth-child(2) { transform: translate(-10px, -15px) rotate(-6deg) !important; z-index: 2 !important; }
    .game-item:nth-child(3) { transform: translate(15px, 5px) rotate(8deg) !important; z-index: 1 !important; }
    .game-item:nth-child(4) { transform: translate(3px, 20px) rotate(-3deg) !important; z-index: 3 !important; }
    .game-item:nth-child(5) { transform: translate(-18px, -8px) rotate(5deg) !important; z-index: 2 !important; }
    .game-item:nth-child(6) { transform: translate(12px, -20px) rotate(-7deg) !important; z-index: 1 !important; }
    .game-item:nth-child(7) { transform: translate(-8px, 18px) rotate(4deg) !important; z-index: 3 !important; }
    .game-item:nth-child(8) { transform: translate(22px, -12px) rotate(-2deg) !important; z-index: 2 !important; }
    .game-item:nth-child(9) { transform: translate(-15px, 8px) rotate(6deg) !important; z-index: 1 !important; }
    .game-item:nth-child(10) { transform: translate(-5px, -22px) rotate(-5deg) !important; z-index: 2 !important; }
    .game-item:nth-child(11) { transform: translate(18px, 12px) rotate(4deg) !important; z-index: 3 !important; }
    .game-item:nth-child(12) { transform: translate(-12px, 10px) rotate(-6deg) !important; z-index: 1 !important; }
    .game-item:nth-child(13) { transform: translate(8px, -5px) rotate(3deg) !important; z-index: 2 !important; }

    /* L'image flotte au centre de sa surface virtuelle */
    .game-item-img {
        position: relative !important;
        transform: none !important; /* Fin des zooms obligatoires */
        object-position: center !important; 
        width: 100% !important;
        height: 100% !important;
        object-fit: contain !important;
    }

    /* Le numéro s'échappe un peu par le haut gauche pour accentuer le côté léger et "flottant" */
    .game-number {
        top: -15px !important; 
        left: -15px !important;
        width: 32px !important;
        height: 32px !important;
        font-size: 0.95rem !important;
        background-color: #fff !important; 
        box-shadow: 0 4px 10px rgba(0,0,0,0.1) !important;
    }
}