/* --- VARIABLES --- */
:root {
    /* MODE NORMAL (RECTO) */
    --bg-color: #0a0a0a;
    --text-color: #ededed;
    --text-muted: #888888;
    --accent: #ffffff;
    --grid-color: rgba(255, 255, 255, 0.05);
    --font-main: 'Inter', sans-serif;
    --container-width: 1200px;
    --radius: 0px;
}

/* --- MODE ALTERNATIF (VERSO : LIGHT & CREATIVE) --- */
body.alternate-view {
    /* Thème CLAIR */
    --bg-color: #f4f4f0; /* Blanc cassé très doux */
    --text-color: #1a1a1a; /* Noir presque pur */
    --text-muted: #555555;
    --accent: #ff4757; /* Une couleur punchy pour le créatif (ex: rouge/rose) */
    --grid-color: rgba(0, 0, 0, 0.05); /* Grille noire très légère */
    --radius: 20px; /* On arrondit tout en mode créatif */
}

/* En mode alternatif, on change la police des titres pour du style */
body.alternate-view h1, 
body.alternate-view h2,
body.alternate-view .logo {
    font-weight: 900;
    letter-spacing: -1px;
}

/* --- FONDS & PARALLAX (Visibles uniquement en mode Alternatif) --- */
.creative-backgrounds {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: -5; /* Derrière le contenu */
    pointer-events: none;
    opacity: 0; transition: opacity 0.5s;
}
body.alternate-view .creative-backgrounds { opacity: 1; }

/* Formes abstraites pour le fond fictif */
.bg-shape {
    position: absolute; border-radius: 50%; filter: blur(60px); opacity: 0.6;
}
.bg-shape-1 { top: -10%; left: -10%; width: 50vw; height: 50vw; background: #ff9ff3; animation: floatShape 20s infinite alternate; }
.bg-shape-2 { bottom: -10%; right: -10%; width: 40vw; height: 40vw; background: #54a0ff; animation: floatShape 15s infinite alternate-reverse; }

@keyframes floatShape { from { transform: translate(0,0); } to { transform: translate(50px, 50px); } }

/* --- ÉLÉMENTS PARALLAX (Images flottantes) --- */
.parallax-container {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1; pointer-events: none;
    opacity: 0; transition: opacity 0.5s;
}
body.alternate-view .parallax-container { opacity: 1; }

.parallax-item {
    position: absolute;
    will-change: transform;
    /* Ombre portée pour donner de la profondeur */
    box-shadow: 0 20px 50px rgba(0,0,0,0.1); 
    border-radius: 15px;
    object-fit: cover;
}

/* --- CONTENEUR 3D --- */
#canvas-container-3d {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: -2; /* Devant le fond, derrière le texte */
    pointer-events: none; /* Laisse passer les clics */
    opacity: 0; transition: opacity 1s;
}
body.alternate-view #canvas-container-3d { opacity: 1; }

/* Pour Spline ou Three.js canvas */
#canvas-container-3d canvas, 
#canvas-container-3d iframe {
    width: 100%; height: 100%; border: none;
}

/* --- RESET & BASE --- */
* { margin: 0; padding: 0; box-sizing: border-box; cursor: none; }
html { scroll-behavior: smooth; }

body { 
    font-family: var(--font-main); 
    background-color: var(--bg-color); 
    color: var(--text-color); 
    line-height: 1.6; 
    min-height: 100vh;
    overflow-x: hidden; 
    overflow-y: auto;
    position: relative;
    transition: background-color 0.5s, color 0.5s; /* Transition douce des couleurs */
}

a { text-decoration: none; color: inherit; cursor: none; }
ul { list-style: none; }

/* --- BACKGROUND ANIMÉ (SHAPES) --- */
.background-shapes {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: -1; pointer-events: none; overflow: hidden;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px); 
    opacity: 0.5;
    will-change: transform; 
    /* On force l'accélération matérielle */
    transform: translate3d(0,0,0);
}

/* Positions de départ */
.shape-1 { top: -10%; left: -10%; width: 50vw; height: 50vw; }
.shape-2 { bottom: -20%; right: -10%; width: 60vw; height: 60vw; }
.shape-3 { top: 40%; left: 30%; width: 30vw; height: 30vw; }

/* ANIMATION MODE DEV (Blanc) */
.shape { 
    background: rgba(255, 255, 255, 0.1); 
    animation: moveBlobDev 15s infinite alternate ease-in-out;
}
.shape-2 { animation-duration: 20s; animation-delay: -5s; }
.shape-3 { animation-duration: 18s; animation-delay: -8s; }

/* ANIMATION MODE CRÉA (Couleurs) */
body.alternate-view .shape-1 { background: #a29bfe; animation: moveBlobCrea1 15s infinite alternate; }
body.alternate-view .shape-2 { background: #74b9ff; animation: moveBlobCrea2 20s infinite alternate; }
body.alternate-view .shape-3 { background: #fab1a0; animation: moveBlobCrea3 18s infinite alternate; }

/* Keyframes avec grandes amplitudes */
@keyframes moveBlobDev {
    0% { transform: translate3d(0, 0, 0) scale(1); }
    100% { transform: translate3d(150px, 100px, 0) scale(1.2); }
}
@keyframes moveBlobCrea1 {
    0% { transform: translate3d(0, 0, 0) rotate(0deg); }
    100% { transform: translate3d(200px, 100px, 0) rotate(45deg); }
}
@keyframes moveBlobCrea2 {
    0% { transform: translate3d(0, 0, 0) scale(1); }
    100% { transform: translate3d(-150px, -100px, 0) scale(1.1); }
}
@keyframes moveBlobCrea3 {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(100px, -150px, 0); }
}


/* --- 2. TRANSITION DAMIER (GRID WAVE) --- */
#transition-grid {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: 100000; /* Devant tout */
    pointer-events: none;
    display: flex; flex-wrap: wrap;
}

.grid-cell {
    position: relative;
    width: 10vw; /* 10 colonnes */
    height: 10vh; /* 10 lignes */
    background: #0a0a0a; /* Couleur par défaut (Vers le noir) */
    transform: scale(0); /* Invisible au début */
    transition: transform 0.4s ease-in-out;
}

/* Quand on active la grille */
#transition-grid.active .grid-cell {
    transform: scale(1.05); /* S'agrandit pour couvrir l'écran (1.05 pour éviter les petits espaces) */
}

/* Couleur des cases selon la direction */
/* Si on va vers le mode Créa (body n'a PAS encore alternate-view au début de l'anim), les cases sont blanches */
body:not(.alternate-view) #transition-grid .grid-cell { background: #f4f4f0; }

/* Si on va vers le mode Dev (body A alternate-view au début), les cases sont noires */
body.alternate-view #transition-grid .grid-cell { background: #0a0a0a; }


/* --- SUPPRESSION DE L'ANCIENNE ROTATION --- */
/* (Important : retire ou commente les anciennes animations de rotation dans style.css) */
/* .flip-card-container { ... ne touche pas à ça, c'est pour la petite carte */
/* Par contre, retire .animating-spin sur #world-container si tu l'as encore */
#world-container.animating-spin { animation: none !important; }
.navbar.animating-spin { animation: none !important; }

/* --- CONTENEUR GLOBAL & ANIMATION DE RETOURNEMENT --- */
#world-container {
    width: 100%;
    min-height: 100vh; 
    transform-origin: center 50vh; 
    will-change: transform;
}

/* Animation de rotation simple */
@keyframes spin-dimension {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(0.2); } /* On s'éloigne */
    100% { transform: rotate(360deg) scale(1); } /* On revient */
}

.animating-spin {
    animation: spin-dimension 1.5s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

/* --- FONDS --- */
.grid-background { 
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: -1; 
    background-image: linear-gradient(var(--grid-color) 1px, transparent 1px), linear-gradient(90deg, var(--grid-color) 1px, transparent 1px); 
    background-size: 50px 50px; pointer-events: none; 
}

/* --- CURSEUR --- */
.cursor-dot, .cursor-outline { position: fixed; top: 0; left: 0; transform: translate(-50%, -50%); border-radius: 50%; z-index: 9999; pointer-events: none; mix-blend-mode: difference;}
.cursor-dot { width: 8px; height: 8px; background-color: var(--accent); transition: background-color 0.3s; }
.cursor-outline { width: 40px; height: 40px; border: 1px solid var(--accent); transition: transform 0.1s, border-color 0.3s; }

/* --- NAVBAR --- */
.navbar { position: fixed; top: 0; width: 100%; height: 70px; background: rgba(5, 5, 10, 0.9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--grid-color); z-index: 5000; transition: transform 0.3s ease-in-out;}
.navbar.navbar-hidden { transform: translateY(-100%); }

.navbar.animating-spin {
    transform-origin: 50vw 50vh; 
    animation: spin-dimension 1.5s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

.nav-container { max-width: 1400px; margin: 0 auto; height: 100%; padding: 0 20px; display: flex; justify-content: space-between; align-items: center; }
.logo { font-weight: 800; font-size: 1.5rem; color: var(--text-color); transition: 0.3s; }

.desktop-menu { display: flex; gap: 30px; height: 100%; }
.desktop-menu li { height: 100%; display: flex; align-items: center; }
.desktop-menu a { font-size: 0.9rem; font-weight: 500; color: var(--text-muted); position: relative; height: 100%; display: flex; align-items: center; transition: color 0.3s; }
.desktop-menu a:hover, .desktop-menu a.active { color: var(--accent); }
.desktop-menu a::after { content: ''; position: absolute; bottom: 0; left: 0; width: 0%; height: 3px; background-color: var(--accent); transition: width 0.3s ease; }
.desktop-menu a.active::after { width: 100%; }
.nav-right { display: flex; align-items: center; gap: 15px; }

/* BOUTON TOGGLE */
.dimension-btn {
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.2); color: var(--text-color);
    padding: 6px 12px; border-radius: 4px; cursor: pointer;
    display: flex; align-items: center; gap: 8px; font-weight: bold;
    transition: 0.3s; font-family: inherit;
}
.dimension-btn:hover { background: rgba(255,255,255,0.1); border-color: var(--accent); color: var(--accent); }
.toggle-icon { font-size: 1.1rem; transition: transform 0.5s; }

/* WIDGET & HAMBURGER */
#live-users-widget { display: flex; align-items: center; gap: 10px; background: rgba(255, 255, 255, 0.05); padding: 0 12px; height: 36px; border-radius: 18px; border: 1px solid rgba(255, 255, 255, 0.1); }
#live-count { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
#user-bubbles { display: flex; flex-direction: row-reverse; align-items: center; }
.user-bubble { width: 24px; height: 24px; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 10px; font-weight: bold; border: 2px solid var(--bg-color); margin-left: -8px; color: white; text-transform: uppercase; }

.hamburger { display: none; flex-direction: column; justify-content: space-between; width: 30px; height: 20px; cursor: pointer; z-index: 5001; }
.hamburger span { width: 100%; height: 2px; background-color: var(--text-color); transition: 0.3s; }
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); background-color: var(--accent); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(8px, -8px); background-color: var(--accent); }

.mobile-menu-overlay { position: fixed; top: 70px; left: 0; width: 100%; height: 0; background: var(--bg-color); overflow: hidden; transition: height 0.4s ease; z-index: 4999; border-bottom: 1px solid var(--grid-color); display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 0; }
.mobile-menu-overlay.open { height: 100vh; padding-top: 40px; }
.mobile-link { font-size: 1.5rem; font-weight: 800; color: var(--text-muted); margin-bottom: 30px; transition: 0.3s; }

/* --- SECTIONS --- */
main { padding-top: 80px; position: relative; z-index: 10; width: 100%; }
.section { padding: 80px 5%; max-width: var(--container-width); margin: 0 auto; }
.section-title { font-size: 2rem; margin-bottom: 40px; border-left: 4px solid var(--accent); padding-left: 15px; color: var(--text-color); transition: 0.5s; }

.hero { min-height: 90vh; display: flex; align-items: center; justify-content: center; text-align: center; }
.hero-content { width: 100%; max-width: 900px; display: flex; flex-direction: column; align-items: center; }
.hero h1 { font-size: 3.5rem; font-weight: 800; margin-bottom: 20px; color: var(--text-color); transition: 0.5s; }
#hero-desc { margin-bottom: 40px; font-size: 1.2rem; color: var(--text-muted); }

/* --- FLIP CARD --- */
.flip-card-container { background-color: transparent; width: 100%; max-width: 700px; height: 280px; perspective: 1000px; cursor: pointer; margin-top: 20px; }
.flip-card-inner { position: relative; width: 100%; height: 100%; text-align: left; transition: transform 0.8s; transform-style: preserve-3d; }
.flip-card-container.flipped .flip-card-inner { transform: rotateY(180deg); }
.flip-card-front, .flip-card-back { position: absolute; width: 100%; height: 100%; -webkit-backface-visibility: hidden; backface-visibility: hidden; border-radius: var(--radius); border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.03); overflow: hidden; }
.flip-card-front { display: flex; align-items: center; }
.card-img { width: 35%; height: 100%; background-size: cover; background-position: center; border-right: 1px solid rgba(255,255,255,0.1); }
.card-content { width: 65%; padding: 25px; display: flex; flex-direction: column; justify-content: center; }
.card-content h3 { font-size: 1.5rem; margin-bottom: 10px; color: var(--accent); }
.hint-text { margin-top: 15px; font-size: 0.8rem; color: var(--text-muted); opacity: 0.7; }
.flip-card-back { background: rgba(10,10,10,0.95); color: var(--text-color); transform: rotateY(180deg); padding: 30px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.flip-card-back h3 { margin-bottom: 15px; color: var(--accent); }

/* --- SKILLS & SERVICES --- */
.skills-grid { display: grid; gap: 20px; grid-template-columns: 1fr; }
.skill-card { background: rgba(255,255,255,0.03); padding: 25px; border-radius: var(--radius); border: 1px solid rgba(255,255,255,0.1); transition: 0.3s; }
.skill-card h3 { color: var(--text-color); margin-bottom: 10px; }
.tags span { background: rgba(255,255,255,0.1); padding: 5px 10px; border-radius: 4px; font-size: 0.85rem; color: var(--text-color); }

.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 30px; }
.service-card { background: rgba(255, 255, 255, 0.03); padding: 30px; border-radius: var(--radius); border: 1px solid rgba(255, 255, 255, 0.1); transition: 0.3s; text-align: center; }
.service-card:hover { transform: translateY(-5px); border-color: var(--accent); }
.serv-icon { font-size: 3rem; margin-bottom: 20px; }
.service-card h3 { margin-bottom: 15px; color: var(--accent); font-size: 1.3rem; }
.service-card p { color: var(--text-muted); font-size: 0.95rem; }

/* --- PROJETS --- */
.horizontal-scroll-section { position: relative; width: 100%; }
.sticky-wrapper { position: sticky; top: 0; height: 100vh; width: 100vw; overflow: hidden; background: transparent; }
.project-overlay-ui { position: absolute; top: 80px; left: 3%; z-index: 20; pointer-events: none; }
.overlay-title { font-size: 1rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 2px; }
.project-counter { color: var(--accent); font-weight: bold; }

.horizontal-track { display: flex; height: 100%; width: max-content; will-change: transform; }
.project-panel { width: 100vw; height: 100vh; flex-shrink: 0; position: relative; display: flex; align-items: center; justify-content: center; padding-top: 70px; }
.fullscreen-card { width: 100%; height: 100%; display: flex; background: var(--bg-color); transition: background-color 0.5s; }

.fs-info { flex: 1; border-right: 1px solid rgba(255,255,255,0.1); display: flex; flex-direction: column; justify-content: center; padding: 0 5%; background: rgba(10,10,10,0.8); z-index: 5; backdrop-filter: blur(5px); }
.fs-info h3 { font-size: 3rem; margin-bottom: 20px; line-height: 1; color: var(--text-color); }
.fs-desc { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 30px; line-height: 1.5; }
.tags-small { margin-bottom: 30px; display: flex; flex-wrap: wrap; gap: 10px; }
.tags-small span { font-size: 0.85rem; color: var(--text-color); background: rgba(255,255,255,0.1); padding: 5px 15px; border-radius: 20px; }
.links { display: flex; gap: 15px; }
.btn-primary { background: var(--accent); color: #000; padding: 12px 24px; font-weight: bold; border-radius: var(--radius); }
.btn-secondary { border: 1px solid var(--text-muted); color: var(--text-color); padding: 12px 24px; font-weight: bold; border-radius: var(--radius); }

.fs-visual { flex: 1.5; position: relative; overflow: hidden; background: #000; }
.carousel-container { width: 100%; height: 100%; position: relative; }
.carousel-track { display: flex; width: 100%; height: 100%; transition: transform 0.5s ease-in-out; }
.carousel-slide { min-width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; }
.carousel-slide img { width: 100%; height: 100%; object-fit: cover; }
.carousel-btn { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,0.5); color: white; border: 1px solid rgba(255,255,255,0.2); width: 40px; height: 40px; border-radius: 50%; cursor: pointer; z-index: 100; display: flex; align-items: center; justify-content: center; transition: 0.3s; }
.carousel-btn:hover { background: var(--accent); color: #000; }
.prev-btn { left: 20px; } .next-btn { right: 20px; }
.carousel-dots-indicator { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; gap: 5px; z-index: 100; }
.c-dot { width: 6px; height: 6px; background: rgba(255,255,255,0.5); border-radius: 50%; transition: 0.3s; }
.c-dot.active { background: var(--accent); transform: scale(1.2); }
.project-dots { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; z-index: 100; background: rgba(0,0,0,0.5); padding: 10px 15px; border-radius: 30px; backdrop-filter: blur(5px); }
.main-dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,0.3); transition: 0.3s; }
.main-dot.active { background: var(--accent); transform: scale(1.3); }

/* --- GALERIE CREATIVE --- */
.creative-only { display: none; }
/* Affiché uniquement si on est en mode Verso */
body.alternate-view .creative-only { display: block; }

.masonry-grid { column-count: 3; column-gap: 20px; }
.masonry-item { margin-bottom: 20px; break-inside: avoid; border-radius: var(--radius); overflow: hidden; border: 1px solid rgba(255,255,255,0.1); transition: 0.3s; }
.masonry-item:hover { transform: scale(1.02); }
.masonry-item img { width: 100%; height: auto; display: block; filter: grayscale(100%); transition: 0.5s; }
.masonry-item:hover img { filter: grayscale(0%); }
.gallery-controls { text-align: center; margin-top: 30px; width: 100%; }
#toggle-gallery-btn { background: transparent; color: var(--text-muted); border: 1px solid var(--text-muted); transition: 0.3s; font-size: 0.9rem; padding: 10px 25px; }
#toggle-gallery-btn:hover { color: var(--accent); border-color: var(--accent); cursor: pointer; }

/* --- CTA BANNER --- */
.cta-banner { width: 100%; padding: 60px 20px; background: linear-gradient(90deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.05) 50%, rgba(255,255,255,0.03) 100%); border-top: 1px solid var(--grid-color); border-bottom: 1px solid var(--grid-color); text-align: center; margin: 40px 0; }
.cta-content h3 { font-size: 2rem; margin-bottom: 10px; color: var(--text-color); }
.cta-content p { color: var(--text-muted); margin-bottom: 30px; font-size: 1.1rem; }

/* --- CONTACT --- */
.contact-container { display: grid; grid-template-columns: 1fr 1.2fr; gap: 60px; align-items: start; }
.contact-text { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 30px; line-height: 1.6; }
.social-links { display: flex; gap: 20px; }
.social-btn { width: 50px; height: 50px; border-radius: 50%; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1); display: flex; justify-content: center; align-items: center; color: var(--text-color); transition: 0.3s; }
.social-btn svg { width: 24px; height: 24px; }
.social-btn:hover { background: var(--accent); color: #000; transform: translateY(-5px); }

.contact-form-wrapper { background: rgba(255, 255, 255, 0.02); padding: 40px; border-radius: var(--radius); border: 1px solid rgba(255, 255, 255, 0.05); backdrop-filter: blur(10px); transition: 0.3s; }
.input-group { margin-bottom: 25px; }
.input-group label { display: block; margin-bottom: 8px; font-weight: 500; font-size: 0.9rem; color: var(--text-muted); }
input, textarea { width: 100%; padding: 15px; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--grid-color); border-radius: 4px; color: var(--text-color); font-family: inherit; font-size: 1rem; transition: 0.3s; resize: none; }
input:focus, textarea:focus { outline: none; border-color: var(--accent); background: rgba(0, 0, 0, 0.5); }
.full-width { width: 100%; }
#form-status { margin-top: 15px; font-size: 0.9rem; text-align: center; font-weight: bold; }
.direct-contact-wrapper { display: flex; flex-direction: column; gap: 15px; margin-top: 20px; }
.contact-item { display: flex; align-items: center; background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.05); padding: 12px 20px; border-radius: 8px; transition: 0.3s; }
.contact-item.clickable { cursor: pointer; }
.contact-item.clickable:hover { background: rgba(255, 255, 255, 0.08); border-color: var(--accent); }
.icon-box { font-size: 1.5rem; margin-right: 15px; }
.contact-details { display: flex; flex-direction: column; flex-grow: 1; }
.contact-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.contact-value { font-size: 1rem; color: var(--text-color); font-weight: 600; }
.copy-feedback { font-size: 0.8rem; color: var(--text-muted); opacity: 0.5; transition: 0.3s; }
.contact-item:hover .copy-feedback { opacity: 1; color: var(--accent); }

/* --- RESPONSIVE --- */
@media (min-width: 768px) {
    .skills-grid { grid-template-columns: repeat(3, 1fr); }
    .desktop-menu { display: flex; } .hamburger { display: none; }
    .hero h1 { font-size: 5rem; }
}
@media (max-width: 1024px) {
    .fullscreen-card { flex-direction: column-reverse; }
    .fs-info { flex: 0 0 auto; height: 40%; border-right: none; border-top: 1px solid var(--grid-color); padding: 20px; }
    .fs-visual { flex: 1; height: 60%; }
    .project-overlay-ui { top: 75px; left: 20px; }
    .fs-info h3 { font-size: 1.8rem; }
}
@media (max-width: 768px) {
    .desktop-menu { display: none; } .hamburger { display: flex; }
    .cursor-dot, .cursor-outline { display: none; } * { cursor: auto; }
    .fs-desc { display: none; } .fs-info { justify-content: flex-start; padding-top: 30px; }
    .masonry-grid { column-count: 1; }
}

/* --- MODALE --- */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0, 0, 0, 0.95); z-index: 999999; display: flex; justify-content: center; align-items: center; opacity: 0; pointer-events: none; transition: opacity 0.3s ease; backdrop-filter: blur(5px); }
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.modal-ext-nav { position: absolute; top: 50%; transform: translateY(-50%); background: transparent; border: 1px solid rgba(255,255,255,0.1); color: var(--text-muted); font-size: 3rem; padding: 20px; cursor: pointer; transition: 0.3s; border-radius: 50%; width: 80px; height: 80px; display: flex; justify-content: center; align-items: center; z-index: 1000000; }
.modal-ext-nav:hover { color: var(--accent); border-color: var(--accent); background: rgba(255,255,255,0.05); }
.prev-proj { left: 30px; } .next-proj { right: 30px; }
.modal-container { width: 85%; max-width: 1400px; height: 85vh; background: var(--bg-color); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: var(--radius); position: relative; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 0 50px rgba(0,0,0,0.8); }
#close-modal-btn { position: absolute; top: 20px; right: 20px; background: transparent; border: none; color: var(--text-color); font-size: 2rem; cursor: pointer; z-index: 20; transition: 0.3s; }
#close-modal-btn:hover { color: var(--accent); transform: rotate(90deg); }
.modal-top-content { flex: 1; padding: 40px 60px; display: flex; flex-direction: column; overflow: hidden; border-bottom: 1px solid rgba(255,255,255,0.1); }
.modal-header { margin-bottom: 20px; }
#modal-title { font-size: 2.5rem; color: var(--accent); margin-bottom: 10px; font-family: var(--font-main); }
.modal-tags { display: flex; flex-wrap: wrap; gap: 10px; }
.modal-tags span { background: rgba(255,255,255,0.1); padding: 5px 12px; border-radius: 15px; font-size: 0.85rem; color: var(--text-color); }
.modal-body-scroll { overflow-y: auto; padding-right: 15px; flex-grow: 1; }
.modal-body-scroll::-webkit-scrollbar { width: 6px; }
.modal-body-scroll::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }
#modal-desc { font-size: 1.1rem; line-height: 1.8; color: var(--text-muted); white-space: pre-line; margin-bottom: 30px; }
.modal-actions { display: flex; gap: 15px; margin-top: auto; }
.modal-bottom-visual { height: 45%; background: #000; position: relative; width: 100%; }
.modal-carousel { width: 100%; height: 100%; position: relative; }
.modal-carousel-track { display: flex; height: 100%; transition: transform 0.4s ease-in-out; }
.modal-slide { min-width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: #050505; }
.modal-slide img { width: 100%; height: 100%; object-fit: contain; }
.modal-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,0.5); color: white; border: 1px solid rgba(255,255,255,0.2); width: 50px; height: 50px; border-radius: 50%; font-size: 1.5rem; cursor: pointer; transition: 0.3s; display: flex; align-items: center; justify-content: center; }
.modal-nav:hover { background: var(--accent); color: #000; }
.modal-nav.prev { left: 20px; } .modal-nav.next { right: 20px; }
.modal-dots { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; }
.m-dot { width: 8px; height: 8px; background: rgba(255,255,255,0.3); border-radius: 50%; transition: 0.3s; }
.m-dot.active { background: var(--accent); transform: scale(1.3); }

footer { text-align: center; padding: 40px; color: var(--text-muted); border-top: 1px solid var(--grid-color); width: 100%; }
.section-spacer { height: 20vh; width: 100%; }

/* --- VARIABLES --- */
:root {
    /* MODE DEV (Dark) */
    --bg-color: #050505;
    --text-color: #e0e0e0;
    --text-muted: #888;
    --accent: #fff;
    --grid-color: rgba(255, 255, 255, 0.03);
    --font-main: 'Inter', sans-serif;
    --container-width: 1200px;
    --radius: 0px;
}

/* MODE CRÉA (Light) */
body.alternate-view {
    --bg-color: #f0f0f0;
    --text-color: #111;
    --text-muted: #444;
    --accent: #ff3b30; /* Rouge vif Apple/Design */
    --grid-color: rgba(0, 0, 0, 0.03);
    --radius: 16px;
}

body.alternate-view h1, body.alternate-view h2, body.alternate-view .logo {
    font-weight: 900; letter-spacing: -1px;
}

/* --- RESET & BASE --- */
* { margin: 0; padding: 0; box-sizing: border-box; cursor: none; }
html { scroll-behavior: smooth; }
body { 
    font-family: var(--font-main); background-color: var(--bg-color); color: var(--text-color); 
    line-height: 1.6; min-height: 100vh; overflow-x: hidden; overflow-y: auto; position: relative;
}
a { text-decoration: none; color: inherit; cursor: none; }
ul { list-style: none; }

/* --- BACKGROUND ANIMÉ (LES FORMES QUI BOUGENT ENFIN) --- */
.background-shapes {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: -1; pointer-events: none; overflow: hidden;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    /* Optimisation GPU */
    will-change: transform; 
}

/* Positions de base */
.shape-1 { top: -10%; left: -10%; width: 50vw; height: 50vw; }
.shape-2 { bottom: -20%; right: -10%; width: 60vw; height: 60vw; }
.shape-3 { top: 40%; left: 30%; width: 30vw; height: 30vw; }

/* ANIMATION MODE DEV (Blanc Fantomatique) */
.shape { 
    background: rgba(255, 255, 255, 0.08); 
    animation: floatGhost 20s infinite alternate ease-in-out;
}
.shape-2 { animation-delay: -5s; animation-duration: 25s; }
.shape-3 { animation-delay: -10s; animation-duration: 30s; }

/* ANIMATION MODE CRÉA (Couleurs Vivantes) */
body.alternate-view .shape {
    opacity: 0.6; mix-blend-mode: multiply;
}
body.alternate-view .shape-1 { background: #a29bfe; animation: floatColor1 20s infinite alternate; }
body.alternate-view .shape-2 { background: #74b9ff; animation: floatColor2 25s infinite alternate; }
body.alternate-view .shape-3 { background: #fab1a0; animation: floatColor3 18s infinite alternate; }

/* KEYFRAMES : Mouvements amples */
@keyframes floatGhost {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 80px) scale(1.1); }
}
@keyframes floatColor1 {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(100px, 50px) rotate(20deg); }
}
@keyframes floatColor2 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-80px, -50px) scale(1.15); }
}
@keyframes floatColor3 {
    0% { transform: translate(0, 0); }
    100% { transform: translate(40px, -60px); }
}

/* --- GRID TRANSITION (DAMIER) --- */
#transition-grid {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: 99999; pointer-events: none;
    display: flex; flex-wrap: wrap;
}
.grid-cell {
    position: relative;
    width: 10vw; height: 10vh;
    transform: scale(0); /* Caché par défaut */
    opacity: 1;
    /* Transition fluide pour l'apparition/disparition */
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

/* --- INTERACTIVITÉ : TILT 3D (Ajouté via JS) --- */
.tilt-card {
    transition: transform 0.1s; /* Très rapide pour suivre la souris */
    will-change: transform;
    transform-style: preserve-3d;
}
.tilt-content {
    transform: translateZ(20px); /* Effet de profondeur du texte */
}

/* --- INTERACTIVITÉ : FADE IN SCROLL --- */
.fade-in-section {
    opacity: 0; transform: translateY(30px); transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.fade-in-section.is-visible { opacity: 1; transform: translateY(0); }


/* --- NAVBAR --- */
.navbar { position: fixed; top: 0; width: 100%; height: 70px; background: rgba(5, 5, 5, 0.8); backdrop-filter: blur(12px); border-bottom: 1px solid var(--grid-color); z-index: 5000; transition: 0.3s; }
.navbar.navbar-hidden { transform: translateY(-100%); }
body.alternate-view .navbar { background: rgba(255, 255, 255, 0.9); border-bottom: 1px solid rgba(0,0,0,0.05); }

.nav-container { max-width: 1400px; margin: 0 auto; height: 100%; padding: 0 20px; display: flex; justify-content: space-between; align-items: center; }
.logo { font-weight: 800; font-size: 1.5rem; color: var(--text-color); }
.desktop-menu { display: flex; gap: 30px; height: 100%; }
.desktop-menu li { height: 100%; display: flex; align-items: center; }
.desktop-menu a { font-size: 0.9rem; font-weight: 500; color: var(--text-muted); position: relative; height: 100%; display: flex; align-items: center; transition: color 0.3s; }
.desktop-menu a:hover, .desktop-menu a.active { color: var(--accent); }
body.alternate-view .desktop-menu a:hover { color: #000; } 
body.alternate-view .desktop-menu a::after { background-color: var(--accent); }

.nav-right { display: flex; align-items: center; gap: 15px; }
.dimension-btn { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.2); color: var(--text-color); padding: 8px 16px; border-radius: 4px; cursor: pointer; display: flex; align-items: center; gap: 8px; font-weight: bold; transition: 0.3s; font-family: inherit; }
body.alternate-view .dimension-btn { background: #fff; border-color: #ddd; color: #000; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
body.alternate-view .dimension-btn:hover { border-color: var(--accent); color: var(--accent); }

/* --- HERO & FLIP CARD --- */
main { padding-top: 80px; position: relative; z-index: 10; width: 100%; }
.section { padding: 100px 5%; max-width: var(--container-width); margin: 0 auto; }
.section-title { font-size: 2.5rem; margin-bottom: 50px; color: var(--text-color); transition: 0.5s; position: relative; display: inline-block; }
body.alternate-view .section-title { color: #000; }
.section-title::after { content: ''; position: absolute; bottom: -10px; left: 0; width: 60px; height: 4px; background: var(--accent); transition: 0.3s; }

.hero-content { text-align: center; display: flex; flex-direction: column; align-items: center; }
.hero h1 { font-size: 4rem; font-weight: 800; margin-bottom: 20px; color: var(--text-color); transition: 0.5s; line-height: 1.1; }
body.alternate-view .hero h1 { color: #000; }
#hero-desc { margin-bottom: 40px; font-size: 1.2rem; color: var(--text-muted); max-width: 600px; }

.flip-card-container { width: 100%; max-width: 600px; height: 300px; perspective: 1000px; cursor: pointer; margin-top: 30px; }
.flip-card-inner { width: 100%; height: 100%; transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275); transform-style: preserve-3d; }
.flip-card-container.flipped .flip-card-inner { transform: rotateY(180deg); }
.flip-card-front, .flip-card-back { position: absolute; width: 100%; height: 100%; -webkit-backface-visibility: hidden; backface-visibility: hidden; border-radius: var(--radius); border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.02); overflow: hidden; }
body.alternate-view .flip-card-front, body.alternate-view .flip-card-back { background: #fff; border: 1px solid rgba(0,0,0,0.05); box-shadow: 0 20px 40px rgba(0,0,0,0.05); }

.flip-card-front { display: flex; align-items: center; }
.card-img { width: 40%; height: 100%; background-size: cover; background-position: center; border-right: 1px solid rgba(255,255,255,0.1); }
.card-content { width: 60%; padding: 30px; display: flex; flex-direction: column; justify-content: center; text-align: left; }
.card-content h3 { font-size: 1.8rem; margin-bottom: 10px; color: var(--accent); }

.flip-card-back { transform: rotateY(180deg); background: #000; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 40px; }
body.alternate-view .flip-card-back { background: #fff; color: #000; }

/* --- COMPÉTENCES & SERVICES (TILT CARDS) --- */
.skills-grid, .services-grid { display: grid; gap: 30px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.skill-card, .service-card { 
    background: rgba(255,255,255,0.03); padding: 30px; 
    border-radius: var(--radius); border: 1px solid rgba(255,255,255,0.05); 
    transition: border-color 0.3s; 
}
.skill-card:hover, .service-card:hover { border-color: var(--accent); }

body.alternate-view .skill-card, body.alternate-view .service-card { 
    background: #fff; border: 1px solid rgba(0,0,0,0.05); box-shadow: 0 10px 30px rgba(0,0,0,0.05); 
}

.tags span { display: inline-block; background: rgba(255,255,255,0.1); padding: 6px 12px; border-radius: 4px; font-size: 0.85rem; color: var(--text-color); margin: 3px; }
body.alternate-view .tags span { background: #f5f5f7; color: #333; }

/* --- LABO CRÉATIF (Masonry + Saturation + Boutons) --- */
.creative-only { display: none; }
body.alternate-view .creative-only { display: block; }

.creative-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 40px; flex-wrap: wrap; gap: 20px;}
.creative-filters { display: flex; gap: 10px; }
.filter-btn {
    background: transparent; border: 1px solid rgba(0,0,0,0.1); padding: 8px 16px; border-radius: 20px; font-size: 0.9rem; cursor: pointer; transition: 0.3s; color: var(--text-muted);
}
.filter-btn:hover, .filter-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.masonry-grid { column-count: 3; column-gap: 20px; }
.masonry-item { margin-bottom: 20px; break-inside: avoid; border-radius: var(--radius); overflow: hidden; position: relative; }

.masonry-item img { 
    width: 100%; height: auto; display: block; 
    filter: grayscale(100%) contrast(1.1); /* Noir et blanc par défaut */
    transition: filter 0.5s ease, transform 0.5s ease; 
}
.masonry-item:hover img { 
    filter: grayscale(0%) saturate(1.2); /* Couleur et saturation boostée au survol */
    transform: scale(1.03); 
}

/* --- PROJETS HORIZONTAUX --- */
.horizontal-scroll-section { position: relative; width: 100%; }
.sticky-wrapper { position: sticky; top: 0; height: 100vh; width: 100vw; overflow: hidden; }
.project-panel { width: 100vw; height: 100vh; flex-shrink: 0; display: flex; align-items: center; justify-content: center; padding-top: 70px; }

.fullscreen-card { width: 100%; height: 100%; display: flex; background: var(--bg-color); }
body.alternate-view .fullscreen-card { background: #fff; }

.fs-info { flex: 1; padding: 0 6%; display: flex; flex-direction: column; justify-content: center; border-right: 1px solid rgba(255,255,255,0.1); background: rgba(10,10,10,0.9); backdrop-filter: blur(10px); }
body.alternate-view .fs-info { background: #fff; border-right: 1px solid #eee; }

.fs-info h3 { font-size: 3.5rem; margin-bottom: 20px; color: var(--text-color); line-height: 1; }
body.alternate-view .fs-info h3 { color: #000; }
.fs-desc { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 40px; }

.fs-visual { flex: 1.5; background: #000; position: relative; overflow: hidden; }
body.alternate-view .fs-visual { background: #f5f5f7; }

.carousel-slide img { width: 100%; height: 100%; object-fit: cover; }
.carousel-btn { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,0.1); width: 50px; height: 50px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; border: 1px solid rgba(255,255,255,0.2); transition: 0.3s; color: #fff; }
.carousel-btn:hover { background: var(--accent); color: #000; border-color: var(--accent); }
body.alternate-view .carousel-btn { background: rgba(0,0,0,0.05); color: #000; border-color: transparent; }
body.alternate-view .carousel-btn:hover { background: var(--accent); color: #fff; }
.prev-btn { left: 30px; } .next-btn { right: 30px; }

/* --- CONTACT --- */
.contact-container { display: grid; grid-template-columns: 1fr 1.5fr; gap: 60px; }
.contact-form-wrapper { background: rgba(255,255,255,0.03); padding: 50px; border-radius: var(--radius); border: 1px solid rgba(255,255,255,0.05); }
body.alternate-view .contact-form-wrapper { background: #fff; border: 1px solid rgba(0,0,0,0.05); box-shadow: 0 20px 60px rgba(0,0,0,0.05); }

input, textarea { width: 100%; padding: 18px; background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; color: #fff; font-size: 1rem; margin-bottom: 10px; transition: 0.3s; }
body.alternate-view input, body.alternate-view textarea { background: #f9f9f9; border-color: #eee; color: #000; }
input:focus, textarea:focus { border-color: var(--accent); background: rgba(0,0,0,0.5); outline: none; }
body.alternate-view input:focus, body.alternate-view textarea:focus { background: #fff; }

.btn-primary { background: var(--accent); color: #000; padding: 15px 30px; border: none; font-weight: bold; border-radius: 8px; cursor: pointer; transition: 0.3s; }
body.alternate-view .btn-primary { color: #fff; box-shadow: 0 4px 15px rgba(255, 59, 48, 0.3); }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 10px 20px rgba(255,255,255,0.2); }
body.alternate-view .btn-primary:hover { box-shadow: 0 10px 20px rgba(255, 59, 48, 0.4); }

/* --- FOOTER --- */
footer { text-align: center; padding: 50px; border-top: 1px solid rgba(255,255,255,0.05); color: var(--text-muted); }
body.alternate-view footer { border-top-color: rgba(0,0,0,0.05); }

/* --- RESPONSIVE --- */
@media (max-width: 1024px) {
    .fullscreen-card { flex-direction: column-reverse; }
    .fs-info { height: auto; padding: 40px 20px; border-top: 1px solid rgba(255,255,255,0.1); }
    .masonry-grid { column-count: 2; }
}
@media (max-width: 768px) {
    .hero h1 { font-size: 3rem; }
    .contact-container { grid-template-columns: 1fr; }
    .masonry-grid { column-count: 1; }
    .desktop-menu { display: none; } .hamburger { display: flex; }
}

/* --- CORRECTION BUG SOURIS (Z-INDEX SUPÉRIEUR À LA MODALE) --- */
.cursor-dot, .cursor-outline { 
    position: fixed; top: 0; left: 0; 
    transform: translate(-50%, -50%); 
    border-radius: 50%; 
    z-index: 100000000 !important; /* Doit être > 999999 (Modale) */
    pointer-events: none; 
    mix-blend-mode: difference;
}

/* --- NOUVEAU DESIGN CARDS (GLOW EFFECT) --- */
/* On prépare les cartes pour recevoir les variables --x et --y du JS */
.skill-card, .service-card, .flip-card-container {
    position: relative;
    overflow: hidden; /* Important pour contenir la lueur */
    background: rgba(255, 255, 255, 0.03); 
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

/* Le "Spotlight" qui suit la souris */
.skill-card::before, .service-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(
        800px circle at var(--x) var(--y), 
        rgba(255, 255, 255, 0.15), 
        transparent 40%
    );
    z-index: 0;
    opacity: 0; /* Invisible par défaut */
    transition: opacity 0.5s;
    pointer-events: none;
}

/* Au survol, on affiche la lueur */
.skill-card:hover::before, .service-card:hover::before {
    opacity: 1;
}

/* Adaptation Mode Créa (Fond clair) */
body.alternate-view .skill-card::before, 
body.alternate-view .service-card::before {
    background: radial-gradient(
        600px circle at var(--x) var(--y), 
        rgba(255, 59, 48, 0.15), /* Lueur rouge légère */
        transparent 40%
    );
}

/* On garde le contenu au-dessus de la lueur */
.skill-card h3, .skill-card .tags, .service-card * {
    position: relative;
    z-index: 1;
}

/* Suppression de l'ancien style Tilt si présent */
.tilt-card { transform: none !important; }

/* --- HERO CARD (NOUVEAU STYLE SLIDING) --- */
.hero-card-container {
    width: 100%; max-width: 700px; height: 280px;
    margin: 30px auto 0;
    display: flex;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    /* Pas de flottement ici, c'est fixe */
    transition: border-color 0.3s, box-shadow 0.3s;
}
.hero-card-container:hover { border-color: var(--accent); }

/* Mode Créa */
body.alternate-view .hero-card-container {
    background: #fff;
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

/* Image Fixe (Gauche) */
.hero-card-visual {
    width: 35%; height: 100%;
    background-size: cover; background-position: center;
    border-right: 1px solid rgba(255,255,255,0.1);
}
body.alternate-view .hero-card-visual { border-right: 1px solid rgba(0,0,0,0.05); }

/* Conteneur Texte (Droite) */
.hero-card-content {
    width: 65%; height: 100%;
    position: relative;
    overflow: hidden; /* Cache le texte qui dépasse */
}

/* --- CORRECTION SLIDER HERO (5 SLIDES) --- */

/* La bande qui contient les 5 slides (Hauteur totale = 500%) */
.content-track {
    width: 100%; 
    height: 500%; /* 5 slides x 100% = 500% */
    display: flex; 
    flex-direction: column;
    /* La transition est gérée ici */
    transition: transform 0.6s cubic-bezier(0.65, 0, 0.35, 1);
}

/* Les Slides individuels */
.content-slide {
    width: 100%; 
    height: 20%; /* 100% / 5 slides = 20% */
    padding: 20px 25px; /* Padding ajusté pour gagner de la place */
    box-sizing: border-box;
    
    /* Flexbox pour l'alignement */
    display: flex; 
    flex-direction: column; 
    
    /* IMPORTANT : On aligne tout en HAUT (flex-start) pour ne jamais couper le titre */
    justify-content: flex-start; /* Plus de 'center' qui coupe le haut */
    align-items: flex-start;
    text-align: left;

    /* GESTION DU SCROLL SI TROP DE TEXTE */
    overflow-y: auto; 
    overflow-x: hidden;
    
    /* Scrollbar fine */
    scrollbar-width: thin;
    scrollbar-color: var(--text-muted) transparent;
}

/* On retire les marges auto qui causaient le bug d'affichage */
.content-slide > :first-child {
    margin-top: 0; 
}
.content-slide > :last-child {
    margin-bottom: 0;
}

/* Espacement entre les éléments */
.content-slide h3 {
    margin-top: 10px; /* Un peu d'espace au dessus du titre */
    margin-bottom: 10px;
    flex-shrink: 0; /* Empêche le titre d'être écrasé */
}

.content-slide p {
    margin-bottom: 15px;
    flex-shrink: 0;
}

/* Le petit texte "Presque fini" reste en bas si possible, sinon il suit le flux */
.content-slide .hint-text {
    margin-top: auto; 
    padding-top: 10px;
    font-size: 0.75rem;
    align-self: flex-start;
}
.hint-text { font-size: 0.8rem; color: var(--text-muted); opacity: 0.7; }
body.alternate-view .content-slide p { color: #333; }

/* --- SCROLLBAR PERSONNALISÉE POUR LES SLIDES --- */

/* La barre en elle-même (très fine) */
.content-slide::-webkit-scrollbar {
    width: 4px;
}

/* Le fond de la barre (transparent) */
.content-slide::-webkit-scrollbar-track {
    background: transparent;
}

/* Le curseur (la partie qui bouge) */
.content-slide::-webkit-scrollbar-thumb {
    background-color: var(--text-muted);
    border-radius: 10px;
}

/* Au survol, on la rend plus visible */
.content-slide:hover::-webkit-scrollbar-thumb {
    background-color: var(--accent);
}

/* Adaptation Mode Clair */
body.alternate-view .content-slide::-webkit-scrollbar-thumb {
    background-color: rgba(0,0,0,0.2);
}
body.alternate-view .content-slide:hover::-webkit-scrollbar-thumb {
    background-color: var(--accent);
}

/* Responsive */
@media (max-width: 768px) {
    /* On augmente la hauteur min pour que le texte rentre sur mobile */
    .hero-card-container { 
        height: auto; 
        min-height: 500px; /* Augmenté de 450 à 500px pour le confort */
    }
    
    .hero-card-visual { height: 200px; }
    
    /* La zone de texte prend la place restante */
    .hero-card-content { height: 300px; } 
}

@media screen and (max-width: 768px) {

    /* 1. FORCER LA NAVBAR À RESTER FIXE ET VISIBLE */
    .navbar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 70px !important;
        /* Z-Index extrême pour être sûr qu'elle est devant tout */
        z-index: 2147483647 !important; 
        /* Annule l'animation JS qui la cache */
        transform: none !important; 
        opacity: 1 !important;
        visibility: visible !important;
        /* Fond opaque obligatoire pour ne pas voir le texte défiler dessous */
        background-color: var(--bg-color) !important;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        display: flex !important;
        align-items: center !important;
    }

    /* 2. FORCER LE CONTENU DE LA NAVBAR */
    .nav-container {
        width: 100% !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    /* 3. HAMBURGER & LOGO TOUJOURS VISIBLES */
    .nav-left {
        display: flex !important;
        align-items: center !important;
        gap: 15px !important;
        z-index: 2147483647 !important;
    }
    
    .hamburger {
        display: flex !important;
        flex-direction: column;
        justify-content: space-between;
        width: 30px; 
        height: 20px;
        cursor: pointer;
        pointer-events: auto !important; /* Assure le clic */
    }
    
    .hamburger span {
        background-color: var(--text-color) !important; /* Force la couleur visible */
        display: block !important;
        width: 100%; 
        height: 2px;
    }

    /* 4. LE MENU QUI S'OUVRE (Le fond blanc/noir) */
    .mobile-menu-overlay {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 0; /* JS changera ça en 100vh */
        /* Juste en dessous de la navbar */
        z-index: 2147483646 !important; 
        background-color: var(--bg-color) !important;
        padding-top: 80px !important;
        display: flex !important;
        flex-direction: column !important;
    }
    
    /* Quand le menu est ouvert (Classe ajoutée par JS) */
    .mobile-menu-overlay.open {
        height: 100vh !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    /* 5. CACHER LE DESKTOP MENU & BOUTON POPUP */
    .desktop-menu, .desktop-only, .desktop-only-btn {
        display: none !important;
    }
}

/* --- PATCH MENU MOBILE VISIBLE --- */
@media screen and (max-width: 768px) {
    
    /* 1. S'assurer que le menu a un fond opaque */
    .mobile-menu-overlay {
        background-color: var(--bg-color) !important; /* Force la couleur */
        opacity: 1 !important;
        z-index: 5500 !important; /* Devant le contenu, sous la navbar */
        display: flex !important;
    }

    /* 2. Quand il est ouvert, on force la hauteur */
    .mobile-menu-overlay.open {
        height: 100vh !important;
        top: 0 !important;
        padding-top: 80px !important; /* Espace pour la navbar */
    }

    /* 3. S'assurer que les liens sont visibles */
    .mobile-link {
        color: var(--text-color) !important;
        font-size: 2rem !important;
        display: block !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }

    /* 4. Forcer la navbar à rester au-dessus */
    .navbar {
        z-index: 6000 !important;
        background-color: var(--bg-color) !important;
    }
}

/* --- HERO CARD AJUSTEMENTS MULTI-SLIDES --- */

/* 1. La piste qui contient les 5 slides */
.content-track {
    width: 100%; 
    height: 500%; /* 5 slides = 500% de hauteur */
    display: flex; 
    flex-direction: column;
    /* L'animation est gérée par le JS maintenant, on garde juste la transition */
    transition: transform 0.5s cubic-bezier(0.65, 0, 0.35, 1);
}

/* 2. Chaque slide individuel */
.content-slide {
    width: 100%; 
    height: 20%; /* 100% divisé par 5 slides = 20% */
    padding: 30px;
    display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
    text-align: left;
    /* On s'assure que le contenu ne déborde pas */
    box-sizing: border-box;
}

/* IMPORTANT : SUPPRIME L'ANCIENNE RÈGLE ".hero-card-container.active-slide .content-track" */
/* On ne l'utilise plus car le JS va calculer la position exacte */

/* --- STYLE DES INDICATEURS (POINTS) --- */
.hero-dots {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 10;
}

.h-dot {
    width: 6px;
    height: 6px;
    background-color: var(--text-muted);
    border-radius: 50%;
    transition: 0.3s;
    opacity: 0.5;
}

/* Point actif */
.h-dot.active {
    background-color: var(--accent);
    transform: scale(1.5);
    opacity: 1;
}

/* Adaptation Mode Clair (Automatique via tes variables, mais au cas où) */
body.alternate-view .h-dot {
    background-color: #ccc;
}
body.alternate-view .h-dot.active {
    background-color: var(--accent);
}


/* ============================================================
   BASCULE STRICTE COMPÉTENCES (DEV vs CRÉA)
   ============================================================ */

/* 1. État par défaut (Mode Dev / Sombre) */
#skills-dev {
    display: grid !important; /* On affiche le Dev */
}

#skills-crea {
    display: none !important; /* On cache totalement le Créa */
}

/* 2. État Alternatif (Mode Créa / Clair) */
body.alternate-view #skills-dev {
    display: none !important; /* On cache totalement le Dev */
}

body.alternate-view #skills-crea {
    display: grid !important; /* On affiche le Créa */
    /* On force l'affichage en grille identique à l'autre */
    animation: fadeInSimple 0.4s ease-out; /* Petite transition douce */
}

/* Animation simple pour éviter que ça soit trop brutal */
@keyframes fadeInSimple {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}


/* ============================================================
   BASCULE SERVICES (DEV vs CRÉA)
   ============================================================ */

/* Par défaut (Mode Dev) */
#services-dev { display: grid !important; }
#services-crea { display: none !important; }

/* Mode Alternatif (Mode Créa) */
body.alternate-view #services-dev { display: none !important; }

body.alternate-view #services-crea { 
    display: grid !important; 
    animation: fadeOnly 0.4s ease-out;
}

/* ============================================================
   LIEN NAVBAR SPÉCIAL CRÉA
   ============================================================ */

/* 1. Par défaut (Mode Dev) : On cache le lien */
.nav-crea-only {
    display: none !important;
}

/* 2. Mode Créatif : On l'affiche */
body.alternate-view .nav-crea-only {
    display: block !important; /* Ou 'inline-block' selon ton layout */
    animation: fadeInNav 0.4s ease-out;
}

/* Conteneur pour centrer si besoin */
.contact-actions {
    margin-top: 20px;
    display: flex;
    gap: 15px;
    justify-content: flex-start; /* Ou center selon ton design */
}

/* Le bouton de base */
#btn-copy-email {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    cursor: pointer;
    min-width: 180px; /* Pour éviter que le bouton change de taille quand le texte change */
    justify-content: center;
}

/* État "Succès" (ajouté par le JS) */
#btn-copy-email.success {
    background-color: #2ecc71 !important; /* Vert validation */
    border-color: #2ecc71 !important;
    color: #fff !important;
    transform: scale(1.05);
}

/* Adaptation pour le mode Créatif (si besoin) */
body.alternate-view #btn-copy-email.success {
    background-color: #00b894 !important;
    border-color: #00b894 !important;
}