/* ==========================================================================
   1. VARIABLES & RESET
   ========================================================================== */
:root {
    --marine: #16213e;
    --grey: #8b9bb4;
    --cream: #FFFEF9;
    --bg: #0a0a1f;
    --neon-green: #39ff14;
    --glass: rgba(22, 33, 62, 0.6);
    --border-light: rgba(255, 254, 249, 0.1);
    --font-primary: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: "SF Mono", Monaco, "Cascadia Code", "Courier New", monospace;
}

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

html { 
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-primary);
    background: var(--bg);
    color: var(--cream);
    line-height: 1.5;
    overflow-x: hidden;
    position: relative;
}

a { 
    color: inherit; 
    text-decoration: none; 
    transition: color 0.3s;
}

/* Optimisations de performance */
img {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.expertise-card,
.timeline-item,
.exploration-card,
.project-item {
    will-change: transform;
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* ==========================================================================
   2. EFFETS SPÉCIAUX (Starfield) - VERSION OPTIMISÉE
   ========================================================================== */
.starfield {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 0; opacity: 0.4;
    will-change: transform;
}
.starfield::before, .starfield::after {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-image: 
        radial-gradient(1px 1px at 20% 30%, white, transparent),
        radial-gradient(1px 1px at 60% 70%, white, transparent),
        radial-gradient(2px 2px at 50% 50%, white, transparent),
        radial-gradient(1px 1px at 80% 10%, white, transparent),
        radial-gradient(1px 1px at 30% 80%, rgba(57, 255, 20, 0.3), transparent);
    background-size: 200% 200%, 250% 250%, 300% 300%, 200% 200%, 280% 280%;
    animation: float-stars 200s linear infinite;
}
.starfield::after {
    background-image: 
        radial-gradient(1px 1px at 40% 20%, white, transparent),
        radial-gradient(1px 1px at 70% 60%, white, transparent),
        radial-gradient(1px 1px at 55% 85%, white, transparent);
    background-size: 280% 280%, 200% 200%, 300% 300%;
    animation: float-stars 250s linear infinite reverse; opacity: 0.3;
}
@keyframes float-stars {
    0% { background-position: 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%; }
    100% { background-position: 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%; }
}

/* ==========================================================================
   3. HEADER & NAVIGATION
   ========================================================================== */
header {
    padding: 3rem 4rem;
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid rgba(255, 254, 249, 0.1);
    position: relative; z-index: 1001;
    background: rgba(10, 10, 31, 0.8); backdrop-filter: blur(10px);
}

/* Navigation (Structure pour cv.html) */
.nav {
    position: sticky;
    top: 0;
    background: rgba(10, 10, 31, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 254, 249, 0.1);
    z-index: 1000;
    transition: transform 0.3s ease;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo img,
.logo-img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.nav-menu {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: var(--grey);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.3s;
}

.nav-link:hover {
    color: var(--cream);
}

.nav-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.lang-switch {
    background: transparent;
    border: 1px solid rgba(255, 254, 249, 0.2);
    color: var(--grey);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    text-transform: uppercase;
    font-size: 0.85rem;
    transition: all 0.3s;
}

.lang-switch:hover {
    background: var(--neon-green);
    color: var(--bg);
    border-color: var(--neon-green);
}

.logo { width: 55px; height: 55px; border-radius: 50%; overflow: hidden; }
.logo img { width: 100%; height: 100%; object-fit: cover; }
.header-right { display: flex; align-items: center; gap: 1.5rem; }

.lang-btn {
    background: transparent; border: 1px solid rgba(255, 254, 249, 0.2);
    color: var(--grey); padding: 0.6rem 1rem; border-radius: 20px;
    cursor: pointer; text-transform: uppercase; transition: all 0.3s;
}
.lang-btn:hover { background: var(--neon-green); color: var(--bg); border-color: var(--neon-green); }

.cv-link-header {
    background: rgba(255, 254, 249, 0.05); border: 1px solid rgba(255, 254, 249, 0.2);
    color: var(--cream); padding: 0.8rem 1.5rem; border-radius: 20px;
    text-decoration: none; display: inline-flex; align-items: center; gap: 0.5rem; transition: all 0.3s;
}
.cv-link-header:hover { background: rgba(255, 254, 249, 0.1); border-color: var(--cream); color: var(--neon-green); border-color: var(--neon-green); }

/* TICKER */
.ticker-container {
    background: rgba(255, 254, 249, 0.03); border-bottom: 1px solid rgba(255, 254, 249, 0.1);
    overflow: hidden; padding: 1rem 0;
}
.ticker-wrapper { display: flex; animation: scroll 30s linear infinite; }
.ticker-item { white-space: nowrap; padding: 0 4rem; color: var(--grey); }
@keyframes scroll { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* ==========================================================================
   4. LAYOUT
   ========================================================================== */
main {
    padding: 6rem 4rem; max-width: 1400px; margin: 0 auto;
    position: relative; z-index: 10;
}
.intro h1 { font-size: 3rem; font-weight: 300; line-height: 1.4; max-width: 900px; color: var(--cream); }
.intro p { font-size: 1.1rem; color: var(--grey); margin-top: 2rem; max-width: 600px; }

/* CTAs */
.hero-cta { margin-top: 3rem; display: flex; gap: 1.5rem; flex-wrap: wrap; align-items: center; }
.cta-primary {
    background: linear-gradient(135deg, var(--neon-green), #2ecc71); color: var(--bg);
    padding: 1.2rem 2.5rem; border-radius: 30px; font-weight: 700;
    text-decoration: none; display: inline-flex; gap: 0.8rem;
    box-shadow: 0 0 30px rgba(57, 255, 20, 0.3); transition: transform 0.3s;
}
.cta-primary:hover { transform: translateY(-3px); }
.cta-secondary { color: var(--grey); text-decoration: none; border-bottom: 1px solid transparent; }
.cta-secondary:hover { color: var(--cream); border-bottom-color: var(--cream); }

/* LISTE DES PROJETS */
.projects { margin-top: 6rem; }
.project-item {
    padding: 4rem 0; border-bottom: 1px solid rgba(255, 254, 249, 0.08);
    transition: all 0.3s ease; text-decoration: none; display: block;
}
.project-item:hover {
    padding-left: 2rem; background: rgba(10, 10, 31, 0.5); border-color: rgba(255, 254, 249, 0.3);
}
.project-item:hover .project-title { color: var(--cream); }

.project-number { font-size: 0.85rem; color: var(--grey); margin-bottom: 1rem; font-family: monospace; }
.project-title { font-size: 4rem; font-weight: 300; color: rgba(255, 254, 249, 0.7); line-height: 1.1; transition: color 0.3s; }
.project-meta { display: flex; gap: 3rem; margin-top: 1.5rem; color: var(--grey); flex-wrap: wrap; }
.project-meta span { text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.1rem; }

/* Description */
.project-description {
    background: rgba(22, 33, 62, 0.5); color: var(--cream);
    padding: 1.5rem; margin-top: 2rem;
    border-left: 4px solid var(--neon-green);
    opacity: 0; max-height: 0; overflow: hidden; transition: all 0.4s ease;
}
.project-item:hover .project-description { opacity: 1; max-height: 300px; }

/* Badges */
.badge-complete { color: var(--neon-green) !important; border: 1px solid var(--neon-green); padding: 2px 8px; border-radius: 10px; }
.badge-dev { color: #ffc107 !important; border: 1px solid #ffc107; padding: 2px 8px; border-radius: 10px; }
.year-future { color: var(--neon-green) !important; font-weight: bold; }

/* CV Bridge */
.cv-bridge {
    margin: 8rem 0; padding: 4rem;
    background: linear-gradient(135deg, rgba(22, 33, 62, 0.3), rgba(57, 255, 20, 0.05));
    border: 1px solid rgba(57, 255, 20, 0.2); border-radius: 20px; text-align: center;
}
.btn-cv {
    background: rgba(57, 255, 20, 0.1); border: 2px solid var(--neon-green);
    color: var(--neon-green); padding: 1rem 2rem; border-radius: 30px;
    font-weight: 700; text-decoration: none; display: inline-block; margin-top: 2rem;
}

/* FOOTER */
footer {
    padding: 4rem; border-top: 1px solid rgba(255, 254, 249, 0.1);
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: 2rem;
    position: relative; z-index: 10;
}
.footer-links a { color: var(--grey); margin-left: 1.5rem; text-decoration: none; transition: color 0.3s; }
.footer-links a:hover { color: var(--cream); }

/* ==========================================================================
   5. MOBILE MENU
   ========================================================================== */
.mobile-menu-toggle {
    display: none;
}

@media (max-width: 768px) {
    header, main, footer { padding: 2rem; }
    .intro h1 { font-size: 2rem; }
    .project-title { font-size: 2.2rem; }
    .project-meta { gap: 1rem; flex-direction: column; }
    
    /* Bouton Burger */
    .mobile-menu-toggle {
        display: flex; flex-direction: column; justify-content: space-between;
        width: 30px; height: 20px; z-index: 2000;
        background: transparent; border: none; cursor: pointer;
    }
    .mobile-menu-toggle span { width: 100%; height: 2px; background-color: var(--cream); transition: all 0.3s ease; }
    
    /* Animation Croix */
    .mobile-menu-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 6px); }
    .mobile-menu-toggle.active span:nth-child(2) { opacity: 0; }
    .mobile-menu-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -6px); }

    /* Menu Mobile Overlay */
    .nav-menu {
        position: fixed; top: 0; left: 0; width: 100%; height: 100vh;
        background-color: var(--bg); display: flex; flex-direction: column;
        justify-content: center; align-items: center; gap: 2rem;
        transform: translateX(100%); transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1500;
    }
    .nav-menu.active { transform: translateX(0); }
    body.menu-open { overflow: hidden; }

    /* Force visibility des descriptions */
    .project-description {
        opacity: 1; max-height: none; margin-top: 1rem;
        background: transparent; padding: 0 0 0 1rem; border-left: 1px solid var(--neon-green);
    }
    .project-item:hover { padding-left: 0; }

    .nav-container {
        padding: 1rem;
    }

    .nav-menu {
        font-size: 1.2rem;
    }
}

/* Cacher le menu burger sur desktop et afficher le menu normalement */
@media (min-width: 769px) {
    .mobile-menu-toggle { 
        display: none !important; 
    }
    .nav-menu { 
        position: relative;
        transform: none;
        width: auto;
        height: auto;
        background: transparent;
        flex-direction: row;
        justify-content: flex-start;
    }
}
