/* =========================================
   VARIABLES & CONFIGURATION
   ========================================= */
:root {
    --bg-color: #000000;
    --card-bg: #1c1c1e;
    --text-main: #f5f5f7;
    --text-muted: #87878a;
    --accent: #2997ff; /* Bleu Apple */
    --hover-bg: #2c2c2e;
    --font-stack: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --navbar-height: 80px; /* On stocke la hauteur pour l'utiliser partout */
}

/* --- LE SECRET DU SCROLL PARFAIT --- */
html {
    scroll-behavior: smooth; /* Active le défilement fluide natif */
}

/* Ceci empêche la barre fixe de cacher le haut des sections */
section, header, #experience, #competences, #formation {
    scroll-margin-top: 100px; /* 80px de menu + 20px d'espace */
}

/* =========================================
   RESET & BASES
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-stack);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

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

/* =========================================
   NAVIGATION (Glassmorphism)
   ========================================= */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    height: var(--navbar-height);
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1000;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.nav-logo { font-weight: 700; font-size: 1.2rem; letter-spacing: -0.5px; }
.nav-links a { margin-left: 30px; color: var(--text-muted); font-size: 0.9rem; font-weight: 500; }
.nav-links a:hover { color: var(--text-main); }

/* --- STYLE DU BOUTON BURGER (Caché sur PC par défaut) --- */
.menu-toggle {
    display: none; 
    flex-direction: column;
    cursor: pointer;
    gap: 6px;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--text-main);
    border-radius: 2px;
    transition: 0.3s;
}

/* =========================================
   HERO SECTION
   ========================================= */
.hero {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 20px;
    animation: fadeIn 1.5s ease-out;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: -2px;
    margin-bottom: 20px;
    background: linear-gradient(180deg, #fff, #b4b4b4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    user-select: none; /* Empêche de sélectionner le texte */
    cursor: default;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 600px;
    margin-bottom: 40px;
}

/* =========================================
   BOUTONS
   ========================================= */
.btn-cta {
    display: inline-block;
    padding: 12px 30px;
    background-color: var(--text-main);
    color: var(--bg-color);
    border-radius: 30px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    border: none;
    cursor: pointer;
}

.btn-cta:hover { 
    transform: scale(1.05); 
    box-shadow: 0 0 20px rgba(255,255,255,0.3); 
}

.btn-photo-link {
    margin-top: 20px;
    display: inline-block;
    color: var(--accent);
    font-size: 0.9rem;
    cursor: pointer;
}
.btn-photo-link:hover { text-decoration: underline; }

/* =========================================
   LAYOUTS & GRIDS
   ========================================= */
section {
    padding: 50px 10%;
    max-width: 1400px;
    margin: 0 auto;
}

section h2 {
    font-size: 2.5rem;
    margin-bottom: 50px;
    letter-spacing: -1px;
}

/* Grid Classique (Expériences) */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.card {
    background-color: var(--card-bg);
    padding: 40px;
    border-radius: 20px;
    transition: transform 0.3s ease, background-color 0.3s;
    cursor: default;
}

.card:hover {
    transform: translateY(-5px);
    background-color: var(--hover-bg);
}

.card h3 { font-size: 1.5rem; margin-bottom: 10px; }
.card .date { font-size: 0.85rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 20px; display: block; }
.card ul li { color: var(--text-muted); margin-bottom: 8px; font-size: 0.95rem; padding-left: 15px; position: relative; }
.card ul li::before { content: "•"; position: absolute; left: 0; color: var(--accent); }

/* Bento Grid (Compétences) */
/* Bento Grid (Compétences) */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.bento-item {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    
    /* --- AJOUT DE L'ANIMATION (Comme pour .card) --- */
    transition: transform 0.3s ease, background-color 0.3s;
    cursor: default; /* Pour montrer que c'est un élément interactif */
}

/* --- L'EFFET AU SURVOL --- */
.bento-item:hover {
    transform: translateY(-5px);       /* L'élément remonte un peu */
    background-color: var(--hover-bg); /* La couleur change légèrement */
}

.bento-item h4 { color: var(--text-main); margin-bottom: 15px; font-size: 1.2rem; }
.bento-item ul li { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 5px; }

/* Styles page Contact & CV (Centrage spécifique) */
.contact-wrapper, .cv-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    padding-top: 100px; /* Espace pour la navbar */
    animation: fadeIn 1s ease-out;
    min-height: 100vh;
}
.contact-title {
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: -1.5px;
    margin-bottom: 20px;
    background: linear-gradient(180deg, #fff, #888);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* =========================================
   MODAL
   ========================================= */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    backdrop-filter: blur(10px);
}
.modal-content {
    margin: 5% auto;
    display: block;
    max-width: 80%;
    max-height: 80vh;
    border-radius: 10px;
}
.close {
    position: absolute;
    top: 30px;
    right: 40px;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
}

/* =========================================
   ANIMATIONS & MOBILE (MEDIA QUERIES)
   ========================================= */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- VERSION MOBILE (< 768px) --- */
@media (max-width: 768px) {
    
    /* 1. Ajustement des titres trop gros sur mobile */
    .hero h1, .contact-title {
        font-size: 2.2rem !important;
    }
    
    /* 2. Afficher le bouton burger */
    .menu-toggle {
        display: flex;
    }

    /* 3. Transformer le menu en liste déroulante animée */
    .nav-links {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: var(--navbar-height); /* Utilise la variable définie en haut */
        left: 0;
        width: 100%;
        background: rgba(0, 0, 0, 0.95); /* Fond presque noir */
        backdrop-filter: blur(20px);
        padding: 20px 0;
        gap: 25px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        
        /* Animation : Caché vers le haut par défaut */
        transform: translateY(-200%); 
        transition: transform 0.4s ease;
        z-index: 999;
    }

    /* Classe ajoutée par JS pour faire descendre le menu */
    .nav-links.active {
        transform: translateY(0);
    }

    .nav-links a {
        margin-left: 0;
        font-size: 1.2rem;
        display: block;
        width: 100%;
        text-align: center;
        padding: 10px 0; /* Zone de clic plus grande */
    }

    /* 4. Ajustements Grilles (Une seule colonne) */
    .bento-grid { grid-template-columns: 1fr; } 
    .bento-item { grid-column: span 1 !important; }
    
    .navbar { padding: 0 20px; }
}