/* --- 1. CONFIGURATION & VARIABLES --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Space+Grotesk:wght@400;600;700&display=swap');

/* --- TYPO LOGO IMPORTANTE --- */
@font-face {
    font-family: 'AestheticMonoline';
    src: url('assets/AestheticMonoline.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    /* --- THEME DARK (Défaut) --- */
    --bg-color: #0F1115;      
    --text-color: #Eaeaea;    
    --text-muted: rgba(234, 234, 234, 0.6);
    --accent: #52B788; /* Vert Menthe */
    --secondary-accent: #7D4FFE; /* Violet */
    
    /* GLASSMORPHISM */
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.1);
    --nav-glass: rgba(15, 17, 21, 0.85);
    
    /* WINDOWS PROJETS */
    --window-glass: rgba(255, 255, 255, 0.02);
    --window-border: rgba(255, 255, 255, 0.08);
    --window-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);

    /* ANIMATIONS & VITESSES */
    --fluid-ease: cubic-bezier(0.25, 1, 0.5, 1);
    --speed-marquee-row1: 45s; 
    --speed-marquee-row2: 40s; 
    --speed-photos: 25s; 
    
    /* TYPO & LAYOUT */
    --font-head: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    --h1-size: clamp(3rem, 7vw, 6rem); 
    --h2-size: clamp(1.8rem, 4vw, 3rem);
    
    --strip-height: 260px; 
}

[data-theme="light"] {
    --bg-color: #F5F5F7;
    --text-color: #111111;
    --text-muted: rgba(17, 17, 17, 0.6);
    --accent: #7D4FFE; 
    --secondary-accent: #52B788;
    --glass-bg: rgba(0, 0, 0, 0.03);
    --glass-border: rgba(0, 0, 0, 0.08);
    --nav-glass: rgba(245, 245, 247, 0.85);
    --window-glass: rgba(255, 255, 255, 0.6);
    --window-border: rgba(0, 0, 0, 0.05);
    --window-shadow: 0 8px 20px 0 rgba(0, 0, 0, 0.05);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    overflow-x: hidden;
    line-height: 1.6;
    width: 100%;
    transition: background-color 0.5s ease, color 0.5s ease;
}

/* --- 2. CANVAS & CURSEUR --- */
canvas#bg-canvas { position: fixed; top: 0; left: 0; width: 100%; height: 100vh; z-index: -1; pointer-events: none; }
.cursor {
    position: fixed; top: 0; left: 0; width: 10px; height: 10px;
    background: var(--accent); border-radius: 50%; pointer-events: none;
    z-index: 9999; transform: translate(-50%, -50%);
    mix-blend-mode: exclusion; transition: width 0.3s, height 0.3s;
}
.cursor.hovered { width: 50px; height: 50px; opacity: 0.5; }

/* Désactivation du curseur custom sur écrans tactiles pour fluidité */
@media (hover: none) and (pointer: coarse) {
    .cursor { display: none !important; }
    * { cursor: auto !important; }
}

/* --- 3. NAVIGATION & LOGO --- */
.brand-logo {
    position: fixed; 
    top: 2rem; 
    left: 2rem;
    background: var(--nav-glass); 
    backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border); 
    padding: 0.5rem 1.5rem;
    border-radius: 50px; 
    z-index: 1000;
    text-decoration: none; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    transition: transform 0.3s ease;
}
.brand-logo:hover { transform: scale(1.05); }

.brand-logo span {
    font-family: 'AestheticMonoline', sans-serif !important;
    font-size: 1.8rem; 
    font-weight: normal !important;
    background: linear-gradient(45deg, var(--accent), var(--secondary-accent));
    background-size: 200% 200%;
    -webkit-background-clip: text; 
    background-clip: text;
    color: transparent; 
    animation: gradientShift 3s ease infinite;
    line-height: 1; 
    padding-top: 5px; 
    display: block;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

nav {
    position: fixed; 
    top: 2rem; 
    left: 50%; 
    transform: translateX(-50%);
    background: var(--nav-glass); 
    backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border); 
    padding: 0.8rem 2rem;
    border-radius: 50px; 
    z-index: 1000; 
    display: flex; 
    gap: 2rem; 
    align-items: center;
    justify-content: center;
    width: max-content; 
    max-width: 90%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.nav-link {
    color: var(--text-color); 
    text-decoration: none; 
    font-family: var(--font-head);
    font-size: 0.9rem; 
    text-transform: uppercase; 
    font-weight: 500; 
    opacity: 0.7; 
    transition: 0.3s;
    white-space: nowrap;
}
.nav-link.active, .nav-link:hover { opacity: 1; color: var(--accent); }

#theme-btn {
    background: transparent; 
    border: 1px solid var(--glass-border); 
    color: var(--text-color); 
    padding: 0.5rem 1rem; 
    border-radius: 20px;
    font-family: var(--font-head); 
    font-size: 0.7rem; 
    text-transform: uppercase;
    transition: 0.3s;
    white-space: nowrap;
}

/* --- 4. GLOBAL STYLES --- */
h1, h2, h3, h4 { text-align: center; font-family: var(--font-head); text-transform: uppercase; margin-bottom: 1.5rem; letter-spacing: -0.02em; }
.std-h1 { font-size: var(--h1-size); font-weight: 700; line-height: 1.1; }
.std-h2 { font-size: var(--h2-size); font-weight: 700; }
.accent { color: var(--accent); }

.outline { -webkit-text-stroke: 1px var(--text-color); color: transparent; opacity: 0.5; transition: all 0.4s ease; }
.outline:hover { color: var(--accent); -webkit-text-stroke: 0px; opacity: 1; text-shadow: 0 0 30px var(--accent); }
.interactive-text span { display: inline-block; transition: 0.2s; }
.interactive-text:hover span { color: var(--accent); transform: translateY(-3px); text-shadow: 0 0 10px var(--accent); }
.quote-hover span { transition: color 0.3s ease, transform 0.3s ease; display: inline-block; cursor: default; }
.quote-hover:hover span:hover { color: var(--accent); transform: scale(1.2); }

section { padding: 8rem 5%; width: 100%; max-width: 1600px; margin: 0 auto; }
.reveal { opacity: 0; transform: translateY(30px); transition: all 0.8s var(--fluid-ease); }
.reveal.active { opacity: 1; transform: translateY(0); }

.std-btn {
    display: inline-block; padding: 1rem 3rem; border: 1px solid var(--glass-border);
    background: var(--glass-bg); border-radius: 50px; color: var(--text-color);
    text-decoration: none; font-family: var(--font-head); text-transform: uppercase;
    font-size: 0.9rem; font-weight: 600; transition: 0.4s;
}
.std-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; transform: translateY(-2px); }

/* --- 5. COMPONENTS --- */
.marquee-wrapper {
    width: 100%; overflow: hidden; white-space: nowrap; position: relative;
    padding: 2rem 0; margin: 4rem 0; background: var(--glass-bg);
    border-top: 1px solid var(--glass-border); border-bottom: 1px solid var(--glass-border);
}
.marquee-track-1 { display: inline-block; animation: scrollText var(--speed-marquee-row1) linear infinite; }
.marquee-track-2 { display: inline-block; animation: scrollTextReverse var(--speed-marquee-row2) linear infinite; }
.marquee-item {
    font-family: var(--font-head); font-size: 3rem; font-weight: 700; margin-right: 4rem;
    color: transparent; -webkit-text-stroke: 1px var(--text-color);
}
.marquee-item.filled { color: var(--accent); -webkit-text-stroke: 0; }
@keyframes scrollText { 0% { transform: translateX(0); } 100% { transform: translateX(-100%); } }
@keyframes scrollTextReverse { 0% { transform: translateX(-100%); } 100% { transform: translateX(0); } }

.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; margin-top: 4rem; align-items: stretch; }
.service-card {
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    border-radius: 12px; padding: 3rem 2rem; text-align: center;
    transition: all 0.4s ease; position: relative; overflow: hidden;
    cursor: pointer; height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center;
}
.service-card:hover { border-color: var(--accent); transform: translateY(-5px); }
.service-bg {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--accent); opacity: 0; transition: 0.5s; z-index: 0;
}
.service-card:hover .service-bg { opacity: 0.05; }
.service-header {
    font-family: var(--font-head); font-size: 1.5rem; font-weight: 700;
    color: var(--accent); margin-bottom: 1rem; z-index: 1; transition: 0.3s;
}
.service-body { font-size: 1rem; opacity: 0; transform: translateY(20px); transition: 0.4s; z-index: 1; max-height: 0; }
.service-card:hover .service-body, .service-card.active .service-body { opacity: 0.9; transform: translateY(0); max-height: 200px; }
.service-card:hover .service-header { transform: translateY(-10px); color: var(--text-color); }

/* --- 6. PROJETS & GALLERY --- */
.project-header-center { text-align: center; margin-bottom: 2rem; display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.project-header-center h3 { font-size: 3rem; margin-bottom: 0; line-height: 1; }
.project-meta { font-size: 1rem; opacity: 0.7; letter-spacing: 2px; color: var(--accent); font-family: var(--font-body); }

.glass-window {
    background: var(--window-glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--window-border); box-shadow: var(--window-shadow);
    border-radius: 16px; padding: 2rem 0; margin: 0 auto 5rem auto;
    max-width: 90%; overflow: hidden; transition: 0.5s ease;
}
.glass-window:hover { border-color: var(--accent); box-shadow: 0 10px 50px rgba(0,0,0,0.2); }
.project-wrapper { display: flex; flex-direction: column; gap: 1.5rem; }
.photo-marquee-wrapper { 
    width: 100%; display: flex; overflow: hidden; padding: 10px 0; 
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%);
}
.photo-marquee-track { display: flex; gap: 1.5rem; width: max-content; align-items: center; }
.animate-scroll { animation: scrollUniform var(--speed-photos) linear infinite; }
.animate-scroll.reverse { animation: scrollReverseUniform var(--speed-photos) linear infinite; }
.photo-marquee-track:hover { animation-play-state: paused; }
@keyframes scrollUniform { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
@keyframes scrollReverseUniform { 0% { transform: translateX(-50%); } 100% { transform: translateX(0); } }

.gallery-img-container { height: var(--strip-height); flex-shrink: 0; overflow: hidden; border-radius: 6px; background: #000; transition: transform 0.3s ease; }
.gallery-img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(0%); transition: transform 0.5s ease, filter 0.5s ease; transform: scale(1); cursor: pointer; }
.gallery-img-container:hover { transform: scale(1.05); z-index: 10; box-shadow: 0 10px 30px rgba(0,0,0,0.5); border: 1px solid var(--accent); }
.gallery-img-container:hover .gallery-img { transform: scale(1.1); }
.size-portrait { width: 180px; } .size-landscape { width: 340px; } .size-square { width: 260px; }

/* --- 7. LIGHTBOX IMAGE & MAP MODAL --- */
.lightbox, .map-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.95); z-index: 99999;
    display: none; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.3s ease;
}
.lightbox.active, .map-modal.active { display: flex; opacity: 1; }
.lightbox img { max-width: 90%; max-height: 90%; border-radius: 8px; border: 2px solid var(--accent); box-shadow: 0 0 50px rgba(82, 183, 136, 0.2); }
.lightbox-close, .map-modal-close {
    position: absolute; top: 30px; right: 40px;
    font-size: 3rem; color: #fff; cursor: pointer; transition: 0.3s; z-index: 100000;
}
.lightbox-close:hover, .map-modal-close:hover { color: var(--accent); transform: rotate(90deg); }

.map-modal-container {
    width: 80%; height: 80%;
    border-radius: 12px; border: 2px solid var(--accent);
    overflow: hidden; box-shadow: 0 0 60px rgba(82, 183, 136, 0.15);
}
#modal-map { width: 100%; height: 100%; background: #111; }

/* --- 8. FOOTER & UTILITAIRES --- */
footer { margin-top: 6rem; border-top: 1px solid var(--glass-border); padding: 5rem 0; text-align: center; background: var(--bg-color); }
.footer-container { max-width: 1200px; margin: 0 auto; padding: 0 5%; }
.footer-cta { font-size: var(--h2-size); font-family: var(--font-head); margin-bottom: 3rem; }
.footer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; max-width: 1000px; margin: 0 auto; justify-items: center; text-align: center; }
.footer-item { display: flex; flex-direction: column; align-items: center; }
.footer-item h4 { color: var(--accent); font-size: 0.9rem; margin-bottom: 1rem; }
.footer-item a, .footer-item p { display: block; color: var(--text-muted); text-decoration: none; font-size: 0.9rem; margin-bottom: 0.5rem; }
.footer-item a:hover { color: var(--text-color); }
.footer-copyright { margin-top: 4rem; opacity: 0.5; font-size: 0.8rem; }

.side-menu { position: fixed; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 1.5rem; background: var(--nav-glass); backdrop-filter: blur(15px); padding: 1.5rem 0.8rem; border-radius: 50px; border: 1px solid var(--glass-border); z-index: 900; transition: all 0.3s ease; }
.side-menu.left { left: 2rem; }
.side-menu.right { right: 2rem; }
.side-menu a { color: var(--text-muted); font-size: 1.2rem; transition: 0.3s; display: flex; justify-content: center; align-items: center; width: 24px; height: 24px; text-decoration: none; }
.side-menu a:hover { color: var(--accent); transform: scale(1.2); }

/* STYLES SPÉCIFIQUES PAGES ABOUT/CONTACT */
.split-layout { display: grid; grid-template-columns: 35% 60%; gap: 5%; padding: 8rem 5%; max-width: 1400px; margin: 0 auto; align-items: start; }
.visual-container { position: sticky; top: 8rem; width: 100%; max-width: 400px; margin: 0 auto; z-index: 10;}
.visual-container img { width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--glass-border); }
.arsenal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 1rem; margin-bottom: 2.5rem; }
.tech-card { background: var(--glass-bg); border: 1px solid var(--glass-border); padding: 0.5rem; border-radius: 8px; text-align: center; transition: 0.3s; display: flex; flex-direction: column; align-items: center; justify-content: center; height: 120px; width: 100%; }
.tech-card:hover { border-color: var(--accent); background: rgba(125, 79, 254, 0.05); transform: translateY(-3px); }
.tech-icon { font-size: 2rem; color: var(--text-color); margin-bottom: 0.5rem; }
.text-icon-box { border: 1px solid var(--text-muted); width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 50%; font-weight: 700; margin-bottom: 0.5rem; font-size: 1rem; }
.tech-name { font-size: 0.75rem; font-family: var(--font-head); font-weight: 600; }
.process-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 3rem; }
.process-card { border: 1px solid var(--glass-border); padding: 3rem 2rem; background: var(--glass-bg); transition: 0.4s; text-align: center; border-radius: 8px; }
.process-card:hover { border-color: var(--accent); transform: translateY(-10px); }

.contact-container { background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 12px; padding: 2rem; max-width: 1200px; margin: 0 auto; width: 100%; }
.contact-grid-wrapper { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.form-side { display: flex; flex-direction: column; text-align: left; }
.form-side label { font-size: 0.8rem; text-transform: uppercase; margin-bottom: 0.5rem; display: block; opacity: 0.7; font-family: var(--font-head); }
.form-side input, .form-side textarea { width: 100%; background: var(--glass-bg); border: 1px solid var(--glass-border); padding: 1rem; margin-bottom: 1.5rem; color: var(--text-color); font-family: var(--font-body); border-radius: 6px; font-size: 1rem; transition: 0.3s; }
.form-side textarea { min-height: 150px; resize: vertical; }
.form-side input:focus, .form-side textarea:focus { outline: none; border-color: var(--accent); background: rgba(255,255,255,0.05); }
.map-side { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--glass-border); min-height: 400px; }
#map { width: 100%; height: 100%; z-index: 1; background: #111; }
.map-overlay-info { position: absolute; bottom: 20px; left: 20px; z-index: 500; background: rgba(0,0,0,0.8); backdrop-filter: blur(5px); padding: 0.5rem 1rem; border-radius: 20px; border: 1px solid var(--accent); color: var(--text-color); font-size: 0.8rem; font-family: var(--font-head); display: flex; align-items: center; gap: 8px; }
.blink { width: 8px; height: 8px; background: var(--accent); border-radius: 50%; animation: blinker 2s infinite; display: block; }
@keyframes blinker { 50% { opacity: 0; } }

/* CUSTOM LEAFLET DARK */
.leaflet-layer, .leaflet-control-zoom-in, .leaflet-control-zoom-out, .leaflet-control-attribution { filter: invert(100%) hue-rotate(180deg) brightness(95%) contrast(90%); }
.leaflet-marker-icon { filter: invert(100%) hue-rotate(180deg) drop-shadow(0 0 5px var(--accent)); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: #0F1115; color: #fff; border: 1px solid var(--accent); font-family: var(--font-head); }

/* --- 9. REFONTE RESPONSIVE GLOBALE --- */

@media (max-width: 1100px) {
    /* Logo centré en haut */
    .brand-logo { 
        position: relative; 
        top: auto; 
        left: auto;
        margin: 1.5rem auto;
        width: fit-content;
    } 
    
    .side-menu { display: none; }
    
    /* Correction de l'image collante sur la page À Propos */
    .visual-container { 
        position: relative !important; 
        top: 0 !important; 
        margin: 0 auto 3rem auto !important; 
        max-width: 300px; 
    }
    
    .split-layout { grid-template-columns: 1fr; gap: 3rem; padding-top: 2rem; }
    .contact-grid-wrapper { grid-template-columns: 1fr; }
    .map-side { min-height: 300px; }
    .footer-grid { grid-template-columns: 1fr; }
    
    /* Navigation en bas type "App" */
    nav { 
        width: 92%; max-width: 450px;
        justify-content: space-between; 
        padding: 0.8rem 1.2rem; 
        bottom: 1.5rem; 
        top: auto; 
        left: 50%;
        transform: translateX(-50%);
        border-radius: 50px;
        gap: 0.8rem;
        flex-wrap: wrap; 
    }
    
    .nav-link { font-size: 0.75rem; }
    #theme-btn { padding: 0.4rem 0.8rem; font-size: 0.65rem; }
    .glass-window { max-width: 100%; margin-bottom: 3rem; }
    .map-modal-container { width: 95%; height: 60%; }
    .marquee-item { font-size: 2rem; margin-right: 2rem; }
    :root { --strip-height: 180px; }
    .tech-card { height: 100px; }
}

@media (max-width: 768px) {
    :root {
        --h1-size: clamp(2.2rem, 8vw, 3.5rem);
        --h2-size: clamp(1.4rem, 6vw, 2rem);
        --strip-height: 140px; 
    }
    
    section { padding: 4rem 1rem !important; }
    .split-layout { padding: 4rem 1rem !important; }
    .std-h1 { line-height: 1.2; }
    .marquee-item { font-size: 1.5rem; margin-right: 1.5rem; }
    
    .size-portrait { width: 120px; } 
    .size-landscape { width: 220px; } 
    .size-square { width: 150px; }
    .photo-marquee-track { gap: 1rem; }
    .glass-window { padding: 1.5rem 0; }

    .project-header-center h3 { font-size: 2rem; }
    .project-meta { font-size: 0.85rem; }

    .contact-container { padding: 1.5rem; }
    .form-side input, .form-side textarea { padding: 0.8rem; }
    .map-side { min-height: 250px; }

    .quote-hover { font-size: 1.4rem !important; }
    img[src*="MatteoCapron.JPG"] { width: 200px !important; height: 200px !important; }

    footer { padding: 3rem 0; margin-top: 3rem; }
    .footer-cta { font-size: 1.5rem; margin-bottom: 2rem; }
    
    .lightbox img { max-width: 95%; }
    .map-modal-container { height: 70%; }
    
    /* Barre de navigation encore plus fine pour petit téléphone */
    nav { padding: 0.6rem 0.8rem; gap: 0.5rem; width: 96%; }
    .nav-link { font-size: 0.7rem; }
    #theme-btn { font-size: 0.6rem; padding: 0.3rem 0.6rem; }
}