/* --- RESET & VARIABLES --- */
:root {
    /* Palette Sombre (Défaut) */
    --bg-body: #050505;
    --bg-surface: #0f0f0f;
    --bg-surface-2: #1a1a1a;
    --text-main: #ffffff;
    --text-muted: #a1a1aa;
    --primary: #6ee7b7; /* Ton vert menthe */
    --primary-glow: rgba(110, 231, 183, 0.4);
    --accent: #3b82f6;
    --border: rgba(255, 255, 255, 0.1);
    
    /* Dimensions */
    --container-width: 1200px;
    --header-height: 80px;
    --radius: 12px;
    
    /* Fonts */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

/* Thème Clair (via classe .light-theme sur body) */
body.light-theme {
    --bg-body: #f3f4f6;
    --bg-surface: #ffffff;
    --bg-surface-2: #e5e7eb;
    --text-main: #111827;
    --text-muted: #4b5563;
    --primary: #059669;
    --primary-glow: rgba(5, 150, 105, 0.2);
    --border: rgba(0, 0, 0, 0.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
}

/* --- TYPOGRAPHY --- */
h1, h2, h3 { font-family: var(--font-heading); font-weight: 700; line-height: 1.1; }
.section-title { font-size: clamp(2rem, 5vw, 3rem); margin-bottom: 1rem; }
.section-subtitle { color: var(--text-muted); font-size: 1.1rem; margin-bottom: 3rem; }

/* --- BUTTONS --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}
.btn-primary {
    background: var(--primary);
    color: #000;
    box-shadow: 0 0 20px var(--primary-glow);
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 0 30px var(--primary-glow); }

.btn-outline {
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-main);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

/* --- HEADER --- */
.site-header {
    position: fixed;
    top: 0;
    width: 100%;
    height: var(--header-height);
    background: rgba(5, 5, 5, 0.7);
    backdrop-filter: blur(10px);
    z-index: 100;
    border-bottom: 1px solid var(--border);
}
.header-inner {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.brand { font-family: var(--font-heading); font-size: 1.5rem; font-weight: 900; }
.dot { color: var(--primary); }

.nav-list { display: flex; gap: 2rem; }
.nav-link { font-size: 0.9rem; font-weight: 500; color: var(--text-muted); position: relative; }
.nav-link:hover, .nav-link.active { color: var(--text-main); }
.nav-link::after {
    content: ''; position: absolute; left: 0; bottom: -5px; width: 0; height: 2px;
    background: var(--primary); transition: width 0.3s;
}
.nav-link:hover::after { width: 100%; }

.header-actions { display: flex; gap: 1rem; align-items: center; }
#theme-toggle { background: none; border: none; color: var(--text-main); font-size: 1.2rem; cursor: pointer; }

.language-selector {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.9rem;
    transition: all 0.3s;
}

.language-selector:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.language-selector option {
    background: var(--bg-surface);
    color: var(--text-main);
}

/* --- HERO SECTION --- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: var(--header-height);
    position: relative;
    overflow: hidden;
}
.hero-container {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 4rem;
    align-items: center;
}
.hero-subtitle {
    color: var(--primary);
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}
.hero-title {
    font-size: clamp(3rem, 6vw, 5rem);
    margin-bottom: 1.5rem;
}
.hero-description {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 500px;
    margin-bottom: 2rem;
}
.hero-visual { position: relative; height: 400px; width: 100%; }

/* Cercle lumineux décoratif */
.gradient-orb {
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
    opacity: 0.2;
    filter: blur(60px);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: pulse 6s infinite alternate;
}

/* Cartes flottantes (Glassmorphism) */
.glass-card {
    position: absolute;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    top: 30%; left: 10%;
    animation: float 6s ease-in-out infinite;
}
.glass-card i { color: var(--primary); font-size: 1.5rem; }
.card-label { display: block; font-size: 0.8rem; color: var(--text-muted); }
.glass-card-secondary { top: 65%; right: 0; animation-delay: 1.5s; }

/* --- MARQUEE TECH --- */
.tech-marquee {
    background: var(--bg-surface);
    padding: 2.5rem 0;
    overflow: hidden;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.tech-marquee .track { display: inline-block; animation: marquee 30s linear infinite; }
.tech-marquee span {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 900;
    color: transparent;
    -webkit-text-stroke: 1px var(--primary);
    margin: 0 2rem;
    text-transform: uppercase;
    transition: color 0.3s;
}

/* --- SERVICES --- */
.section { padding: 6rem 0; }
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}
.service-card {
    background: var(--bg-surface);
    padding: 2.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: transform 0.3s, border-color 0.3s;
}
.service-card:hover { transform: translateY(-5px); border-color: var(--primary); }
.icon-box {
    width: 50px; height: 50px;
    background: rgba(110, 231, 183, 0.1);
    color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    border-radius: 12px;
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
}
.service-card h3 { margin-bottom: 1rem; font-size: 1.3rem; }
.service-card p { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 1.5rem; }
.service-list li {
    display: flex; align-items: center; gap: 0.8rem;
    color: var(--text-main); font-size: 0.9rem; margin-bottom: 0.5rem;
}
.service-list i { color: var(--primary); font-size: 0.8rem; }

/* --- PROJECTS --- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}
.project-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.4s;
    cursor: pointer;
}
.project-card:hover { transform: translateY(-10px); border-color: var(--primary); }
.project-card a { display: block; width: 100%; height: 100%; }
.card-image { position: relative; height: 250px; overflow: hidden; }
.card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.project-card:hover .card-image img { transform: scale(1.1); }
.overlay {
    position: absolute; inset: 0; background: rgba(0,0,0,0.6);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.3s;
}
.project-card:hover .overlay { opacity: 1; }
.btn-icon {
    width: 50px; height: 50px; background: white; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: black; font-size: 1.2rem;
}

.card-content { padding: 1.5rem; }
.card-tags { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.tag {
    font-size: 0.75rem; padding: 0.3rem 0.8rem; border-radius: 20px;
    background: rgba(110, 231, 183, 0.1); color: var(--primary);
    font-weight: 600;
}
.card-content h3 a { font-size: 1.5rem; margin-bottom: 0.5rem; display:block; }
.card-content h3 a:hover { color: var(--primary); }
.card-content p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1rem; }
.click-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 600;
    transition: all 0.3s;
}
.click-indicator i { transition: transform 0.3s; }
.project-card:hover .click-indicator { transform: translateX(5px); }
.project-card:hover .click-indicator i { transform: translateX(3px); }

/* --- ABOUT --- */
.about-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; }
.img-wrapper { position: relative; }
.img-wrapper::before {
    content:''; position:absolute; top: 20px; left: 20px; width: 100%; height: 100%;
    border: 2px solid var(--primary); border-radius: var(--radius); z-index: -1;
}
.img-wrapper img { border-radius: var(--radius); width: 100%; border: 1px solid var(--border); }
.stats-grid { display: flex; gap: 3rem; margin-top: 2rem; }
.stat-number { display: block; font-size: 2.5rem; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 0.9rem; color: var(--text-muted); }

/* --- TIMELINE --- */
.timeline { border-left: 2px solid var(--border); margin-top: 2rem; padding-left: 2rem; }
.timeline-item { position: relative; padding-bottom: 3rem; }
.timeline-item::before {
    content:''; position:absolute; left: -37px; top: 5px;
    width: 12px; height: 12px; background: var(--bg-body);
    border: 2px solid var(--primary); border-radius: 50%;
}
.timeline-item .date { display: block; font-size: 0.85rem; color: var(--primary); margin-bottom: 0.3rem; font-weight: 600; }
.timeline-item h4 { margin-bottom: 0.5rem; }
.timeline-item p { color: var(--text-muted); font-size: 0.95rem; }



/* --- CONTACT --- */
.contact-wrapper {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 3rem;
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 3rem;
}
.social-links { display: flex; gap: 1rem; margin-top: 2rem; }
.social-links a {
    width: 40px; height: 40px; border: 1px solid var(--border);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.social-links a:hover { background: var(--primary); color: #000; border-color: var(--primary); }

/* Formulaire moderne (Input style Material) */
.form-group { position: relative; margin-bottom: 1.5rem; }
.modern-form input, .modern-form textarea {
    width: 100%; padding: 1rem; background: transparent;
    border: 1px solid var(--border); border-radius: 8px;
    color: var(--text-main); outline: none; font-family: inherit;
}
.modern-form label {
    position: absolute; left: 1rem; top: 1rem; color: var(--text-muted);
    transition: 0.3s; pointer-events: none; background: var(--bg-surface); padding: 0 5px;
}
.modern-form input:focus, .modern-form input:not(:placeholder-shown) { border-color: var(--primary); }
.modern-form input:focus ~ label,
.modern-form input:not(:placeholder-shown) ~ label,
.modern-form textarea:focus ~ label,
.modern-form textarea:not(:placeholder-shown) ~ label{
    top: -10px; font-size: 0.8rem; color: var(--primary);
}

#formStatus {
    margin-top: 1rem;
    font-weight: 600;
    text-align: center;
}

/* --- FOOTER --- */
.site-footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    padding: 4rem 0 2rem;
    font-size: 0.95rem;
    color: var(--text-muted);
}
.footer-grid {
    display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 3rem;
    margin-bottom: 3rem;
}
.footer-brand .brand { margin-bottom: 1rem; display: block; color: var(--text-main); }
.footer-links h4 { color: var(--text-main); margin-bottom: 1.5rem; font-size: 1.1rem; }
.footer-links ul li { margin-bottom: 0.8rem; }
.footer-links a:hover { color: var(--primary); padding-left: 5px; }

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 2rem;
    display: flex; justify-content: space-between; align-items: center;
}
.back-top { font-size: 0.85rem; font-weight: 600; }

/* --- ANIMATIONS --- */
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-20px); } }
@keyframes pulse { 0% { transform: translate(-50%, -50%) scale(1); opacity: 0.2; } 100% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.4; } }
@keyframes marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* Classes utilitaires d'animation (gérées par JS) */
.reveal-text, .reveal-scroll { opacity: 0; transform: translateY(30px); transition: 0.8s cubic-bezier(0.215, 0.610, 0.355, 1); }
.reveal-active { opacity: 1; transform: translateY(0); }

/* --- MOBILE --- */
.nav-toggle { display: none; background: none; border: none; flex-direction: column; gap: 6px; cursor: pointer; padding: 0; }
.nav-toggle span { width: 25px; height: 2.5px; background: var(--text-main); transition: 0.3s; }

@media (max-width: 900px) {
    .nav-toggle { display: flex; z-index: 101; }
    .nav {
        position: fixed; top: var(--header-height); right: -100%; width: 100%; max-width: 300px; height: calc(100vh - var(--header-height));
        background: var(--bg-surface); padding: 2rem;
        transition: right 0.4s ease; box-shadow: -10px 0 30px rgba(0,0,0,0.5);
        border-left: 1px solid var(--border);
        overflow-y: auto;
    }
    .nav.active { right: 0; }
    .nav-list { flex-direction: column; gap: 0; }
    .nav-list li { border-bottom: 1px solid var(--border); }
    .nav-list li:last-child { border-bottom: none; }
    .nav-link { display: block; padding: 1.2rem 0; font-size: 1.1rem; color: var(--text-muted); }
    .nav-link:hover, .nav-link.active { color: var(--text-main); }
    .nav-link::after { display: none; }
    
    .hero-container, .about-layout, .contact-wrapper { grid-template-columns: 1fr; text-align: center; }
    .hero-visual { display: none; } /* Simplification mobile */
    .contact-wrapper { padding: 1.5rem; }
    .modern-form label { background: var(--bg-surface); } /* Fix pour mobile */
    
    /* Animation hamburger */
    .nav-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(8px, 8px); }
    .nav-toggle.active span:nth-child(2) { opacity: 0; }
    .nav-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(7px, -7px); }
}

/* --- PROJECT PAGES STYLES --- */
.project-hero {
    background: var(--bg-body);
    padding: 4rem 0;
    margin-bottom: 0.5rem;
}

.project-hero-content {
    display: block;
}

.project-hero-image {
    max-width: 350px;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--primary-glow);
}

.project-hero-image img {
    width: 100%;
    display: block;
}

.project-header {
    margin-bottom: 2rem;
}

.project-header h1 {
    margin-bottom: 1rem;
    color: #ffffff;
}

.project-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    margin-bottom: 4rem;
}

.project-content h3 {
    color: var(--text-main);
    font-size: 1.3rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.project-content h3::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 20px;
    background: var(--primary);
    border-radius: 2px;
}

.project-content ul {
    list-style: none;
    padding-left: 0;
}

.project-content ul li {
    color: var(--text-muted);
    padding-left: 1.5rem;
    position: relative;
    margin-bottom: 0.8rem;
    line-height: 1.6;
}

.project-content ul li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: bold;
}

.info-box {
    background: var(--bg-surface);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    height: fit-content;
    position: sticky;
    top: 120px;
}

.info-box h4 {
    color: var(--text-main);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-box h4::before {
    content: '◆';
    color: var(--primary);
}

.info-item {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.info-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.info-item strong {
    color: var(--primary);
}

.info-item span {
    color: var(--text-muted);
    display: block;
    margin-top: 0.3rem;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.gallery img {
    border-radius: 12px;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid var(--border);
    width: 100%;
    height: auto;
    cursor: pointer;
}

.gallery img:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(110, 231, 183, 0.2);
}

/* Lightbox Interactive */
.lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    justify-content: center;
    align-items: center;
    flex-direction: column;
    overflow: hidden;
}

.lightbox.active {
    display: flex;
}

/* Image dans la lightbox */
.lightbox-img {
    max-width: 90vw;
    max-height: 80vh;
    border-radius: 4px;
    box-shadow: 0 0 30px rgba(0,0,0,0.8);
    touch-action: none;
    transform-origin: center center;
    cursor: grab;
}

.lightbox-img:active {
    cursor: grabbing;
}

/* Bouton fermer */
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    transition: 0.3s;
}

.lightbox-close:hover {
    color: var(--primary);
}

/* Boutons navigation */
.arrow {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 20px;
    margin-top: -50px;
    color: white;
    font-weight: bold;
    font-size: 40px;
    transition: 0.3s;
    user-select: none;
    background: rgba(0,0,0,0.3);
    border: none;
    z-index: 1001;
    border-radius: 5px;
}

.arrow:hover { 
    background-color: rgba(255, 255, 255, 0.2); 
}

.next { 
    right: 20px; 
}

.prev { 
    left: 20px; 
}

#caption {
    position: absolute;
    bottom: 20px;
    color: #ccc;
    font-size: 16px;
    z-index: 1001;
    pointer-events: none;
}

@media (max-width: 900px) {
    .project-hero {
        padding: 2rem 0;
        margin-bottom: 2rem;
    }
    
    .project-hero-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .project-hero-image {
        max-width: 100%;
    }
    
    .project-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .info-box {
        position: static;
    }
    
    .gallery {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .project-header h1 {
        font-size: 2rem !important;
    }
}