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

:root {
    /* --- THÈME SOMBRE (DÉFAUT) --- */
    --bg-void: #030712;
    --bg-card: rgba(17, 24, 39, 0.7);
    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    --accent-indigo: #6366f1;
    --accent-cyan: #06b6d4;
    --glass-border: 1px solid rgba(255, 255, 255, 0.08);
    --grid-line: rgba(255, 255, 255, 0.03);
    --input-bg: rgba(255, 255, 255, 0.05);
    --nav-bg: rgba(17, 24, 39, 0.85);
    --shadow-color: rgba(0, 0, 0, 0.3);
    
    /* Dégradé pour les images manquantes (Mode Dark) */
    --placeholder-bg: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
}

[data-theme="light"] {
    /* --- THÈME CLAIR --- */
    --bg-void: #f9fafb; /* Gris très clair */
    --bg-card: #ffffff;
    --text-primary: #111827; /* Noir adouci */
    --text-secondary: #4b5563; /* Gris moyen */
    --accent-indigo: #4f46e5;
    --accent-cyan: #0891b2; /* Cyan plus foncé */
    --glass-border: 1px solid rgba(0, 0, 0, 0.08);
    --grid-line: rgba(0, 0, 0, 0.04);
    --input-bg: rgba(0, 0, 0, 0.04);
    --nav-bg: rgba(255, 255, 255, 0.9);
    --shadow-color: rgba(0, 0, 0, 0.08);

    /* Dégradé Mode Light */
    --placeholder-bg: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
}

html { scroll-behavior: smooth; background-color: var(--bg-void); transition: background-color 0.3s ease; }
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: transparent; 
    color: var(--text-primary);
    font-family: 'Space Grotesk', sans-serif;
    overflow-x: hidden;
    transition: color 0.3s ease;
    background-image: 
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 50px 50px;
    min-height: 100vh;
    position: relative;
    z-index: 0;
}

body::before {
    content: ''; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1; pointer-events: none;
    background: radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.15), transparent 25%),
                radial-gradient(circle at 85% 30%, rgba(6, 182, 212, 0.15), transparent 25%);
    filter: blur(60px); opacity: 0.8; animation: aurora 10s ease-in-out infinite alternate;
}
[data-theme="light"] body::before { opacity: 0.5; filter: blur(80px); }
@keyframes aurora { 0% { transform: scale(1); } 100% { transform: scale(1.2); } }

h1, h2, h3 { font-family: 'Space Grotesk', sans-serif; font-weight: 700; letter-spacing: -0.02em; }
code, .mono { font-family: 'JetBrains Mono', monospace; }
a { text-decoration: none; color: inherit; }

/* NAVBAR (SMART HIDE) */
nav {
    position: fixed; 
    top: 20px; 
    left: 50%; 
    transform: translateX(-50%);
    width: 90%; 
    max-width: 1000px; 
    z-index: 1000;
    padding: 0.8rem 1.5rem; 
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    background: var(--nav-bg); 
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: var(--glass-border); 
    border-radius: 100px; 
    box-shadow: 0 4px 30px var(--shadow-color);
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), background 0.3s;
}

nav.nav-hidden {
    transform: translateX(-50%) translateY(-200%);
}

.nav-left { display: flex; align-items: center; gap: 1rem; }
.nav-brand { font-size: 1.1rem; font-weight: 700; letter-spacing: 1px; color: var(--text-primary); white-space: nowrap;}
.nav-links { display: flex; gap: 2rem; align-items: center;}
.nav-links a { color: var(--text-secondary); font-size: 0.9rem; transition: 0.3s; font-weight: 500; }
.nav-links a:hover, .nav-links a.active-link { color: var(--accent-cyan); }
.nav-cta {
    background: linear-gradient(135deg, var(--accent-indigo), var(--accent-cyan));
    padding: 8px 20px; border-radius: 50px; color: white !important; 
    font-weight: 600; font-size: 0.9rem; white-space: nowrap;
}

/* --- GESTION DES ICÔNES THÈME --- */
.theme-toggle { background: none; border: none; cursor: pointer; color: var(--text-secondary); padding: 5px; display: flex; align-items: center; justify-content: center; transition: 0.3s; }
.icon-sun, .icon-moon { width: 22px; height: 22px; transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1); }
.icon-moon { display: none; } .icon-sun { display: block; }
[data-theme="light"] .icon-sun { display: none; } [data-theme="light"] .icon-moon { display: block; }
.theme-toggle:hover .icon-sun, .mobile-theme-switch:active .icon-sun { filter: drop-shadow(0 0 5px var(--accent-cyan)); }

/* SECTIONS */
.section { padding: 6rem 2rem; max-width: 1200px; margin: 0 auto; }
.hero { height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; position: relative; padding: 0 20px; }

/* BADGE */
.badge { 
    background: rgba(6, 182, 212, 0.1); 
    border: 1px solid var(--accent-cyan); 
    color: var(--accent-cyan); 
    padding: 5px 12px; border-radius: 4px; font-size: 0.75rem; 
    font-family: 'JetBrains Mono', monospace; font-weight: 700;
    margin-bottom: 2rem; display: inline-block; letter-spacing: 1px;
    text-transform: uppercase; box-shadow: 0 0 10px rgba(6, 182, 212, 0.15);
}

.hero h1 { font-size: 4.5rem; line-height: 1.1; margin-bottom: 1.5rem; color: var(--text-primary); text-shadow: 0 0 40px rgba(6, 182, 212, 0.35); text-transform: uppercase; }
[data-theme="light"] .hero h1 { text-shadow: 0 0 40px rgba(6, 182, 212, 0.2); }
.gradient-text { color: var(--accent-cyan); }
.hero p { font-size: 1.1rem; color: var(--text-secondary); max-width: 650px; margin-bottom: 3rem; line-height: 1.6; }
.mouse-scroll { position: absolute; bottom: 40px; width: 24px; height: 40px; border: 2px solid var(--text-secondary); border-radius: 20px; display: flex; justify-content: center; opacity: 0.5; }
.mouse-wheel { width: 4px; height: 8px; background: var(--text-primary); border-radius: 2px; margin-top: 6px; animation: scrollAnim 2s infinite; }

/* TECH STACK (Option 1 - Transparent) */
.tech-stack-strip {
    background: transparent; 
    padding: 1.5rem 0; 
    border-top: 1px dashed var(--glass-border);
    border-bottom: 1px dashed var(--glass-border);
    margin-bottom: 4rem;
    position: relative;
    text-align: center;
}
.tech-stack-strip::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: var(--bg-void); opacity: 0.3; z-index: -1; }
.tech-stack-strip p {
    font-size: 0.7rem; letter-spacing: 4px; color: var(--text-secondary);
    margin-bottom: 1rem; font-weight: 700; text-transform: uppercase;
    font-family: 'JetBrains Mono', monospace; opacity: 0.6;
}
.tech-logos {
    display: flex; justify-content: center; gap: 3rem; flex-wrap: wrap;
    font-family: 'JetBrains Mono', monospace; font-weight: 500;
    color: var(--text-primary); font-size: 0.85rem;
}
.tech-logos span { transition: color 0.3s ease, transform 0.3s ease; cursor: default; }
.tech-logos span:hover { color: var(--accent-cyan); transform: translateY(-2px); text-shadow: 0 0 10px rgba(6, 182, 212, 0.4); }
@media (max-width: 768px) { .tech-logos { gap: 1.5rem; padding: 0 20px; font-size: 0.75rem; } }

/* SERVICES & BLOG CARDS */
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; }
.card { background: var(--bg-card); border: var(--glass-border); padding: 2.5rem; border-radius: 16px; transition: all 0.4s; position: relative; overflow: hidden; backdrop-filter: blur(10px); box-shadow: 0 4px 6px var(--shadow-color); }
.card:hover { transform: translateY(-5px); border-color: var(--accent-cyan); }
.card-icon { font-size: 2.5rem; margin-bottom: 1.5rem; display: block; filter: sepia(100%) hue-rotate(150deg) saturate(400%) brightness(1.1); }
[data-theme="light"] .card-icon { filter: sepia(100%) hue-rotate(150deg) saturate(600%) brightness(0.9); }
.card h3 { font-size: 1.4rem; margin-bottom: 1rem; color: var(--text-primary); text-transform: uppercase; letter-spacing: 1px; }
.card p { color: var(--text-secondary); line-height: 1.6; font-size: 0.95rem; }

.blog-container { max-width: 1200px; margin: 0 auto; padding-bottom: 4rem; }
.blog-header { text-align: center; margin-bottom: 3rem; }
.blog-header h1 { font-size: 3.5rem; margin-bottom: 1rem; color: var(--text-primary); line-height: 1.1;}
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 2rem; margin-top: 2rem; }
.article-card { background: var(--bg-card); border: var(--glass-border); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; transition: transform 0.3s ease; backdrop-filter: blur(10px); height: 100%; box-shadow: 0 2px 10px var(--shadow-color); }
.article-card:hover { transform: translateY(-5px); border-color: var(--accent-cyan); }
.card-img-wrapper { height: 200px; width: 100%; position: relative; overflow: hidden; background: var(--placeholder-bg); }
.card-img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.article-card:hover .card-img { transform: scale(1.05); }

/* CONTACT */
.contact-wrapper { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: start; background: linear-gradient(180deg, rgba(0,0,0,0) 0%, var(--bg-card) 100%); padding: 3rem; border-radius: 24px; border: var(--glass-border); }
.contact-info h2 { font-size: 3rem; margin-bottom: 1rem; line-height: 1.1; color: var(--text-primary); }
.form-box { display: flex; flex-direction: column; gap: 1.5rem; }
.modern-input { width: 100%; background: var(--input-bg) !important; border: 1px solid var(--glass-border); padding: 1.2rem; color: var(--text-primary) !important; border-radius: 8px; font-family: 'Space Grotesk'; font-size: 1rem; transition: 0.3s; }
.modern-input:focus { background: var(--bg-card) !important; border-color: var(--accent-cyan); outline: none; }
.btn-submit { background: var(--text-primary); color: var(--bg-void); border: 1px solid var(--text-primary); padding: 1.2rem; border-radius: 8px; font-weight: 700; cursor: pointer; font-size: 1rem; transition: 0.3s; display: flex; justify-content: space-between; align-items: center; font-family: 'Space Grotesk', sans-serif; text-transform: uppercase; }
.btn-submit:hover { background: var(--accent-cyan); color: white; border-color: var(--accent-cyan); }
footer { text-align: center; padding: 4rem 0; color: var(--text-secondary); font-size: 0.9rem; border-top: 1px solid var(--grid-line); margin-top: 4rem; }
@keyframes scrollAnim { 0% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(15px); } }

/* MOBILE */
.burger-menu { display: none; cursor: pointer; color: var(--text-primary); }
.mobile-menu-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100vh; z-index: 2000; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 2rem; transform: translateY(-100%); transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1); background: rgba(3, 7, 18, 0.98); backdrop-filter: blur(15px); }
[data-theme="light"] .mobile-menu-overlay { background: rgba(243, 244, 246, 0.98); }
.mobile-menu-overlay.active { transform: translateY(0); }
.mobile-menu-overlay a { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); text-transform: uppercase; letter-spacing: 2px; }
.mobile-close { position: absolute; top: 25px; right: 25px; font-size: 2rem; cursor: pointer; color: var(--text-secondary); padding: 10px; }
.mobile-theme-switch { display: flex; align-items: center; gap: 10px; margin-top: 2rem; border: 1px solid var(--glass-border); padding: 10px 20px; border-radius: 30px; cursor: pointer;}
.mobile-theme-switch svg { width: 24px; height: 24px; }
@media (max-width: 900px) {
    nav { top: 10px; width: 95%; padding: 0.8rem 1.2rem; justify-content: space-between; }
    .nav-links, .nav-left .theme-toggle { display: none !important; }
    .burger-menu { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin-right: 10px; }
    .nav-brand { font-size: 1.1rem; }
    .blog-grid, .services-grid, .contact-wrapper, .profile-grid { grid-template-columns: 1fr !important; } /* Modif ici */
    .section { padding: 4rem 1.2rem; }
    .hero h1 { font-size: 2.8rem; }
}
.cursor { display: inline-block; width: 12px; height: 1em; background-color: var(--accent-cyan); vertical-align: text-bottom; margin-left: 5px; animation: blinkCursor 1s infinite step-end; }
@keyframes blinkCursor { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* TERMINAL CACHÉ */
#terminal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100vh; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(5px); z-index: 9999; display: flex; justify-content: center; align-items: center; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
#terminal-overlay.open { opacity: 1; pointer-events: all; }
.terminal-window { width: 800px; max-width: 95%; height: 500px; background: #0c0c0c; border: 1px solid #333; border-radius: 8px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8); display: flex; flex-direction: column; overflow: hidden; font-family: 'JetBrains Mono', monospace; }
.terminal-header { background: #1f1f1f; padding: 10px 15px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid #333; }
.terminal-btn { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.close { background: #ff5f56; } .minimize { background: #ffbd2e; } .expand { background: #27c93f; }
.terminal-title { color: #999; font-size: 0.8rem; margin-left: auto; margin-right: auto; }
.terminal-body { padding: 20px; flex-grow: 1; overflow-y: auto; color: #fff; font-size: 0.9rem; scrollbar-width: thin; scrollbar-color: #333 #0c0c0c; }
.prompt-wrap { margin-top: 10px; }
.prompt-top { color: var(--accent-cyan); font-weight: bold; display: block; line-height: 1.4; }
.input-line { display: flex; align-items: center; width: 100%; }
.prompt-bottom { color: var(--accent-cyan); font-weight: bold; margin-right: 8px; white-space: nowrap; }
#term-input { background: transparent; border: none; color: #fff; font-family: 'JetBrains Mono', monospace; font-size: 0.9rem; flex-grow: 1; outline: none; caret-color: #27c93f; padding: 0; margin: 0; }
.output-line { margin-bottom: 5px; line-height: 1.4; }
.success { color: #27c93f; } .error { color: #ff5f56; } .info { color: var(--accent-cyan); } .warning { color: #ffbd2e; }

/* =========================================================
   NOUVEAU STYLE : PROFILE & IDENTITY RECORD
   ========================================================= */
.profile-hero {
    margin-top: 80px;
    padding: 6rem 2rem;
    display: flex;
    justify-content: center;
}

.profile-container {
    max-width: 900px;
    width: 100%;
}

.id-card {
    background: var(--bg-card);
    border: var(--glass-border);
    border-radius: 20px;
    padding: 3rem;
    display: flex;
    gap: 3rem;
    align-items: center;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px var(--shadow-color);
    position: relative;
    overflow: hidden;
}

.id-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 5px; height: 100%;
    background: var(--accent-cyan);
}

.id-photo {
    position: relative;
    width: 180px;
    height: 180px;
    flex-shrink: 0;
}

.id-photo img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent-cyan);
    padding: 5px;
}

.status-indicator {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    background: #22c55e;
    border: 4px solid var(--bg-card);
    border-radius: 50%;
}

.id-details h1 { font-size: 2.5rem; line-height: 1.1; margin-bottom: 5px; }
.id-label { font-family: 'JetBrains Mono'; font-size: 0.75rem; color: var(--accent-cyan); letter-spacing: 2px; margin-bottom: 10px; }
.id-role { font-size: 1.1rem; color: var(--text-secondary); margin-bottom: 1.5rem; }
.id-stats { display: flex; gap: 2rem; margin-bottom: 1.5rem; border-top: 1px dashed var(--glass-border); border-bottom: 1px dashed var(--glass-border); padding: 15px 0; }
.stat-val { display: block; font-weight: 700; font-size: 1.3rem; color: var(--text-primary); }
.stat-lbl { font-size: 0.7rem; color: var(--text-secondary); letter-spacing: 1px; }
.id-bio { font-size: 1rem; line-height: 1.6; color: var(--text-secondary); }

/* GRID LAYOUT POUR LE RESTE DE LA PAGE PROFIL */
.profile-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 4rem;
}

/* TIMELINE */
.timeline {
    border-left: 2px solid var(--glass-border);
    padding-left: 2rem;
    position: relative;
}

.timeline-item {
    position: relative;
    margin-bottom: 3rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -2.6rem;
    top: 5px;
    width: 16px;
    height: 16px;
    background: var(--bg-void);
    border: 2px solid var(--accent-cyan);
    border-radius: 50%;
}

.tl-date {
    font-family: 'JetBrains Mono';
    font-size: 0.8rem;
    color: var(--accent-cyan);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.tl-content h3 { font-size: 1.2rem; margin-bottom: 0.5rem; }
.tl-content p { color: var(--text-secondary); font-size: 0.95rem; line-height: 1.5; }

/* SKILLS & CERTIF */
.cert-box { display: flex; flex-direction: column; gap: 1rem; }
.cert-item {
    background: var(--input-bg);
    border: var(--glass-border);
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: 0.3s;
}
.cert-item:hover { border-color: var(--accent-cyan); transform: translateX(5px); }
.cert-icon { font-size: 1.5rem; }
.cert-item h4 { font-size: 0.95rem; margin-bottom: 2px; }
.cert-item p { font-size: 0.8rem; color: var(--text-secondary); }

.quote-box {
    margin-top: 2rem;
    border-left: 3px solid var(--accent-indigo);
    padding-left: 1.5rem;
    font-style: italic;
    color: var(--text-secondary);
    line-height: 1.6;
}

.cta-banner {
    background: var(--bg-card);
    border: var(--glass-border);
    padding: 2rem;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

@media (max-width: 900px) {
    .id-card { flex-direction: column; text-align: center; gap: 1.5rem; padding: 2rem; }
    .id-stats { justify-content: center; }
    .id-card::before { width: 100%; height: 5px; top: 0; left: 0; }
    .profile-grid { grid-template-columns: 1fr; }
}