:root {
    --primary: #6366f1;
    --bg: #0f172a;
    --card-bg: #1e293b;
    --text: #f8fafc;
    --text-dim: #94a3b8;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    scroll-behavior: smooth;
}

/* Navbar */
nav {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px 10%; background: rgba(15, 23, 42, 0.9);
    position: fixed; width: 100%; top: 0; z-index: 1000;
    backdrop-filter: blur(10px);
}

.logo { font-size: 1.5rem; font-weight: bold; }
.logo span { color: var(--primary); }

.nav-links { display: flex; list-style: none; }
.nav-links li { margin-left: 30px; }
.nav-links a { text-decoration: none; color: var(--text); font-weight: 500; transition: 0.3s; }
.nav-links a:hover { color: var(--primary); }

/* Hero Section */
.hero {
    height: 100vh; display: flex; align-items: center; justify-content: center;
    text-align: center; padding: 0 20px;
}

.highlight { color: var(--primary); }
h1 { font-size: 3.5rem; margin-bottom: 10px; }
.btn {
    display: inline-block; margin-top: 30px; padding: 12px 30px;
    background: var(--primary); color: white; text-decoration: none;
    border-radius: 8px; transition: 0.3s;
}
.btn:hover { transform: translateY(-3px); box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3); }

/* Projects Grid */
.container { padding: 100px 10% 50px; }
.section-title { margin-bottom: 40px; font-size: 2rem; border-left: 5px solid var(--primary); padding-left: 15px; }

.projects-grid {
    display: grid;
    /* On définit une taille min de 300px et max de 1fr. 
       Le 'max-width' sur les cartes fera le reste pour le 2 par 2 */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    justify-content: center; /* Centre les cartes si elles ne prennent pas toute la largeur */
}

.project-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
    transition: 0.3s;
    border: 1px solid rgba(255,255,255,0.05);
    
    /* On ajoute une largeur maximale pour éviter l'étirement excessif */
    width: 100%;
    max-width: 500px; 
    justify-self: center; /* Centre la carte dans sa cellule de grille */
}

/* Force l'affichage 2 par 2 à partir d'une certaine largeur (ex: tablette/PC) */
@media screen and (min-width: 1024px) {
    .projects-grid {
        /* Force exactement 2 colonnes de même taille */
        grid-template-columns: repeat(2, 1fr); 
        /* On augmente un peu la max-width pour profiter de l'espace */
        max-width: 1100px;
        margin: 0 auto; /* Centre toute la section de projets */
    }
}

.project-card:hover { transform: translateY(-10px); }

.project-img { height: 200px; background-size: cover; background-position: center; }

.project-info { padding: 20px; }
.project-info h3 { margin-bottom: 10px; }
.project-info p { color: var(--text-dim); font-size: 0.9rem; margin-bottom: 15px; }

.tags span {
    background: rgba(99, 102, 241, 0.1); color: var(--primary);
    padding: 5px 12px; border-radius: 20px; font-size: 0.75rem; margin-right: 5px;
}

.project-link { display: block; margin-top: 15px; color: var(--primary); text-decoration: none; font-weight: bold; }

/* Responsive Burger */
.burger { display: none; cursor: pointer; }
.burger div { width: 25px; height: 3px; background: var(--text); margin: 5px; transition: 0.3s; }

@media screen and (max-width: 768px) {
    .nav-links {
        position: absolute; right: 0; height: 92vh; top: 8vh; background: var(--bg);
        flex-direction: column; width: 100%; transform: translateX(100%); transition: 0.5s;
    }
    .nav-links li { margin: 20px 0; text-align: center; }
    .nav-active { transform: translateX(0); }
    .burger { display: block; }
}

.profile-pic {
    width: 150px;           /* Taille de la photo */
    height: 150px;
    border-radius: 50%;     /* Rend la photo parfaitement ronde */
    object-fit: cover;      /* Évite que l'image ne soit déformée */
    border: 3px solid var(--primary); /* Ajoute un cercle de la couleur du thème */
    margin-bottom: 20px;    /* Espace entre la photo et le texte "Salut..." */
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.2); /* Petit effet de lueur */
}

/* Optionnel : centre tout le contenu du hero si ce n'est pas déjà fait */
.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}






/* Section Parcours Scolaire */
.education-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.education-card {
    display: flex;
    align-items: center;
    background: var(--card-bg);
    padding: 25px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: 0.3s;
}

.education-card:hover {
    border-color: var(--primary);
    transform: translateX(5px);
}

.edu-icon {
    font-size: 2rem;
    margin-right: 20px;
    background: rgba(99, 102, 241, 0.1);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: var(--primary);
}

.icon-tag { font-weight: bold; font-family: monospace; }

.edu-info h3 { font-size: 1.2rem; margin-bottom: 5px; }
.edu-date { color: var(--primary); font-weight: bold; font-size: 0.9rem; margin-bottom: 5px; }
.edu-info p { color: var(--text-dim); font-size: 0.9rem; }

@media screen and (max-width: 480px) {
    .education-card { flex-direction: column; text-align: center; }
    .edu-icon { margin-right: 0; margin-bottom: 15px; }
}

/* Section Compétences */
.skills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: flex-start;
}

.skill-tag {
    background-color: #1e1e1e; /* Fond sombre identique à l'image */
    color: #ffffff;
    padding: 12px 25px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    min-width: 160px; /* Assure une certaine uniformité */
}

.skill-tag:hover {
    background-color: #2a2a2a;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Adaptation mobile */
@media screen and (max-width: 600px) {
    .skills-grid {
        justify-content: center;
    }
    .skill-tag {
        width: 100%; /* Les tags prennent toute la largeur sur petit téléphone */
        justify-content: center;
    }
}

.skill-category {
    width: 100%; /* Force le titre à prendre toute la largeur */
    color: var(--primary); /* Utilise la couleur violette de ton thème */
    font-weight: bold;
    font-size: 1.2rem;
    margin-top: 20px;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
}

/* Optionnel : ajoute une petite ligne discrète après le texte de la catégorie */
.skill-category::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin-left: 15px;
}

/* On ajuste un peu la grille pour que les titres ne soient pas serrés */
.skills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}




/* Section Contact */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.contact-card {
    display: flex;
    align-items: center;
    background: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: 0.3s ease;
}

.contact-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    background: rgba(99, 102, 241, 0.05);
}

.contact-icon {
    font-size: 1.8rem;
    margin-right: 15px;
    background: rgba(255, 255, 255, 0.05);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

.contact-info h3 {
    font-size: 1rem;
    margin-bottom: 2px;
    color: var(--primary);
}

.contact-info p {
    font-size: 0.9rem;
    color: var(--text-dim);
    word-break: break-all; /* Évite que l'email dépasse sur mobile */
}