/* ==========================================================================
   VARIABLES & CONFIGURATION DE BASE
   ========================================================================== */
:root {
    --font-primary: 'Poppins', sans-serif;
    --font-heading: 'Montserrat', sans-serif;
    
    /* Palette Claire (Par défaut) */
    --blue-tech: #007bdd;
    --blue-tech-hover: #00569d;
    --orange: #ff6b35;
    --orange-hover: #e04e1b;
    --bg-body: #f8f9fa;
    --bg-card: #ffffff;
    --bg-nav: rgba(255, 255, 255, 0.9);
    --text-main: #2c3e50;
    --text-muted: #6c757d;
    --border-color: #e9ecef;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    --radius: 12px;
}

[data-theme="dark"] {
    /* Palette Sombre */
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --bg-nav: rgba(15, 23, 42, 0.9);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-body);
    color: var(--text-main);
    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: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

section { padding: 90px 0; }

/* Titres Globaux */
.section-title {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 40px;
    position: relative;
    display: inline-block;
}

.section-title-center {
    text-align: center;
    margin-bottom: 50px;
}

.section-title-center p { color: var(--text-muted); }

/* Boutons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--blue-tech);
    color: #fff !important;
    padding: 12px 28px;
    border-radius: 30px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,123,221,0.2);
}
.btn:hover { background: var(--blue-tech-hover); transform: translateY(-2px); }
.btn-outline {
    background: transparent;
    color: var(--text-main) !important;
    border: 2px solid var(--blue-tech);
    box-shadow: none;
}
.btn-outline:hover { background: var(--blue-tech); color: #fff !important; }
.btn-orange { background: var(--orange); box-shadow: 0 4px 15px rgba(255,107,53,0.2); }
.btn-orange:hover { background: var(--orange-hover); }

/* ==========================================================================
   NAVBAR
   ========================================================================== */
.navbar {
    position: fixed;
    top: 0; left: 0; width: 100%;
    background: var(--bg-nav);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: 0.3s;
}
.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 75px;
}
.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem; font-weight: 700;
}
.logo span { color: var(--blue-tech); }
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a:hover { color: var(--blue-tech); }
.theme-toggle {
    background: transparent; border: none;
    color: var(--text-main); cursor: pointer; font-size: 1.2rem;
}

/* Hamburger */
.hamburger { display: none; background: transparent; border: none; cursor: pointer; }
.hamburger span {
    display: block; width: 25px; height: 3px;
    background: var(--text-main); margin: 5px 0; transition: 0.3s;
}

/* ==========================================================================
   HERO
   ========================================================================== */
#hero {
    position: relative; min-height: 100vh;
    display: flex; align-items: center;
    padding-top: 100px; overflow: hidden;
}
#particleCanvas {
    position: absolute; top:0; left:0; width:100%; height:100%; z-index: 1; pointer-events: none;
}
.hero-content {
    position: relative; z-index: 2;
    display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 40px; align-items: center;
}
.badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(0,123,221,0.1); color: var(--blue-tech);
    padding: 6px 16px; border-radius: 20px; font-size: 0.85rem; font-weight: 600; margin-bottom: 20px;
}
.hero-text h1 { font-family: var(--font-heading); font-size: 3.5rem; font-weight: 700; line-height: 1.2; }
.hero-text h1 span { color: var(--blue-tech); }
.subtitle { font-size: 1.2rem; color: var(--text-muted); margin: 15px 0; }
.slogan { font-style: italic; border-left: 3px solid var(--orange); padding-left: 15px; margin: 20px 0; color: var(--text-muted); }
.hero-buttons { display: flex; flex-wrap: wrap; gap: 15px; margin-top: 30px; }
.cv-btn { border-color: var(--orange); color: var(--orange) !important; }
.cv-btn:hover { background: var(--orange); color: #fff !important; }

.photo-frame {
    position: relative; width: 320px; height: 320px; margin: 0 auto;
}
.photo-frame img {
    width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
    border: 6px solid var(--bg-card); box-shadow: var(--shadow);
}
.photo-frame::before {
    content: ''; position: absolute; top:-10px; left:-10px; right:-10px; bottom:-10px;
    border: 2px dashed var(--blue-tech); border-radius: 50%; animation: spin 20s linear infinite; z-index: -1;
}
@keyframes spin { 100% { transform: rotate(30deg); } }

/* ==========================================================================
   QUI SUIS JE / ABOUT
   ========================================================================== */
.about-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; }
.lead { font-size: 1.15rem; font-weight: 500; margin-bottom: 20px; }
.about-highlights { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; margin-top: 25px; }
.about-highlights span { display: flex; align-items: center; gap: 10px; font-size: 0.95rem; }
.about-highlights i { color: var(--blue-tech); }
.vision-card { background: var(--bg-card); padding: 35px; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border-color); }
.vision-card h4 { font-family: var(--font-heading); margin-bottom: 15px; font-size: 1.25rem; }
.vision-target { margin-top: 20px; font-weight: 500; }
.vision-target i { color: var(--orange); }

/* ==========================================================================
   COMPETENCES / SKILLS
   ========================================================================== */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 30px; }
.skill-card { background: var(--bg-card); padding: 30px; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border-color); }
.skill-card h4 { font-family: var(--font-heading); margin-bottom: 20px; display: flex; align-items: center; gap: 10px; font-size: 1.15rem; }
.skill-card h4 i { color: var(--blue-tech); }
.skill-item { margin-bottom: 15px; }
.skill-item span { display: flex; justify-content: space-between; font-size: 0.9rem; font-weight: 500; margin-bottom: 5px; }
.progress-bar { background: var(--border-color); height: 8px; border-radius: 4px; overflow: hidden; }
.progress-bar .fill { background: linear-gradient(90deg, var(--blue-tech), #00b4db); height: 100%; border-radius: 4px; width: 0; transition: width 1.5s cubic-bezier(0.1, 1, 0.1, 1); }

/* ==========================================================================
   SERVICES
   ========================================================================== */
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 30px; }
.service-card {
    background: var(--bg-card); border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow); border: 1px solid var(--border-color);
    display: flex; flex-direction: column; transition: 0.3s ease;
}
.service-card:hover { transform: translateY(-5px); box-shadow: 0 15px 35px rgba(0,0,0,0.1); }
.service-card img { width: 100%; height: 180px; object-fit: cover; }
.service-card h4 { font-family: var(--font-heading); margin: 20px 20px 10px 20px; font-size: 1.15rem; }
.service-card p { padding: 0 20px; color: var(--text-muted); font-size: 0.9rem; flex-grow: 1; margin-bottom: 20px; }
.btn-service {
    display: block; text-align: center; background: var(--blue-tech); color: #fff !important;
    padding: 12px; margin: 0 20px 20px 20px; border-radius: 8px; font-weight: 500; font-size: 0.9rem;
}
.btn-service:hover { background: var(--blue-tech-hover); }

/* ==========================================================================
   PROJETS
   ========================================================================== */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 30px; }
.project-card { background: var(--bg-card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--border-color); }
.project-card img { width: 100%; height: 180px; object-fit: cover; }
.project-info { padding: 25px; }
.project-info h4 { font-family: var(--font-heading); margin-bottom: 10px; }
.project-info p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 15px; }
.project-tech { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.project-tech span { background: var(--border-color); padding: 4px 10px; border-radius: 4px; font-size: 0.75rem; font-weight: 500; }
.project-actions { display: flex; gap: 10px; }
.btn-outline-sm { border: 1px solid var(--blue-tech); padding: 6px 16px; font-size: 0.85rem; border-radius: 4px; }
.btn-outline-sm:hover { background: var(--blue-tech); color: #fff !important; }

/* ==========================================================================
   PARCOURS / TIMELINE
   ========================================================================== */
.timeline { position: relative; max-width: 800px; margin: 40px auto 0 auto; padding-left: 30px; border-left: 2px solid var(--blue-tech); }
.timeline-item { position: relative; margin-bottom: 40px; background: var(--bg-card); padding: 25px; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border-color); }
.timeline-dot { position: absolute; left: -37px; top: 28px; width: 12px; height: 12px; background: var(--blue-tech); border-radius: 50%; border: 4px solid var(--bg-body); }
.timeline-item .date { font-weight: 700; color: var(--orange); font-size: 0.9rem; margin-bottom: 5px; }
.timeline-item h4 { font-family: var(--font-heading); margin-bottom: 8px; }

/* ==========================================================================
   CERTIFICATIONS
   ========================================================================== */
.cert-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
.cert-card { background: var(--bg-card); text-align: center; padding: 30px 20px; border-radius: var(--radius); border: 1px solid var(--border-color); box-shadow: var(--shadow); }
.cert-card i { font-size: 2rem; color: var(--orange); margin-bottom: 15px; }
.cert-card h4 { font-family: var(--font-heading); font-size: 1rem; margin-bottom: 5px; }
.cert-card p { color: var(--text-muted); font-size: 0.85rem; }

/* ==========================================================================
   STATS & TESTIMONIALS
   ========================================================================== */
#stats { background: linear-gradient(135deg, var(--blue-tech), #00569d); color: #fff; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 30px; text-align: center; }
.stat-item .number { font-size: 3rem; font-weight: 700; font-family: var(--font-heading); margin-bottom: 5px; }
.stat-item p { font-size: 1rem; opacity: 0.9; }

.testimonial-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 30px; }
.testimonial-item { background: var(--bg-card); padding: 30px; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border-color); position: relative; }
.testimonial-item i { font-size: 1.8rem; color: var(--orange); opacity: 0.3; margin-bottom: 15px; display: block; }
.testimonial-item p { font-style: italic; font-size: 0.95rem; margin-bottom: 15px; }
.testimonial-item h5 { font-family: var(--font-heading); color: var(--blue-tech); }

/* ==========================================================================
   CONTACT
   ========================================================================== */
.contact-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 40px; }
.contact-form { display: flex; flex-direction: column; gap: 15px; }
.contact-form input, .contact-form textarea {
    font-family: var(--font-primary); background: var(--bg-card); color: var(--text-main);
    border: 1px solid var(--border-color); padding: 14px; border-radius: 8px; font-size: 0.95rem; outline: none;
}
.contact-form input:focus, .contact-form textarea:focus { border-color: var(--blue-tech); }
.contact-form textarea { height: 150px; resize: none; }
.contact-info { background: var(--bg-card); padding: 35px; border-radius: var(--radius); border: 1px solid var(--border-color); box-shadow: var(--shadow); }
.contact-info h4 { font-family: var(--font-heading); margin-bottom: 20px; }
.contact-info p { display: flex; align-items: center; gap: 15px; margin-bottom: 15px; }
.contact-info i { color: var(--blue-tech); width: 20px; }
.social-links { display: flex; gap: 15px; margin-top: 25px; font-size: 1.5rem; }
.social-links a:hover { color: var(--blue-tech); transform: scale(1.1); }

/* ==========================================================================
   FOOTER
   ========================================================================== */
footer { background: #0f172a; color: #94a3b8; padding: 60px 0 30px 0; border-top: 1px solid #1e293b; font-size: 0.9rem; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 40px; align-items: center; }
footer h3, footer h4 { color: #fff; font-family: var(--font-heading); margin-bottom: 15px; }
footer ul li { margin-bottom: 10px; }
.footer-socials { display: flex; gap: 15px; margin-top: 15px; font-size: 1.2rem; }
.footer-socials a:hover { color: #fff; }

/* ==========================================================================
   ANIMATIONS DISCRETES AU SCROLL
   ========================================================================== */
.fade-section { opacity: 0; transform: translateY(30px); transition: opacity 0.8s ease, transform 0.8s ease; }
.fade-section.visible { opacity: 1; transform: translateY(0); }