:root {
    --couleur-principale: #6200ea; /* Un violet moderne */
    --couleur-principale-hover: #3700b3; /* Variante plus foncée pour le survol */
    --couleur-secondaire: #03dac6; /* Un turquoise pour les accents */
    --couleur-fond: #f5f5f5; /* Un fond clair pour un contraste agréable */
    --couleur-texte: #333333; /* Un texte sombre pour une bonne lisibilité */
    --couleur-texte-secondaire: #666; /* Un gris pour les textes moins importants */
    --couleur-carte: #ffffff; /* Blanc pour les cartes */
    --ombre-carte: 0 4px 15px rgba(0, 0, 0, 0.1);
    --ombre-carte-hover: 0 15px 30px rgba(0, 0, 0, 0.15); /* Ombre plus prononcée au survol */
    --couleur-bordure: #ccc; /* Couleur pour les bordures légères */
}

/* Ajout du thème sombre */
body.dark-mode {
    --couleur-principale: #bb86fc;
    --couleur-principale-hover: #9f63e4; /* Variante plus foncée pour le survol en sombre */
    --couleur-fond: #121212;
    --couleur-texte: #e0e0e0;
    --couleur-texte-secondaire: #aaa;
    --couleur-carte: #1e1e1e;
    --ombre-carte: 0 4px 15px rgba(0, 0, 0, 0.3);
    --ombre-carte-hover: 0 15px 30px rgba(0, 0, 0, 0.4);
    --couleur-bordure: #444;
}

html {
    scroll-behavior: smooth; /* Comportement de défilement plus approprié sur <html> */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--couleur-fond);
    color: var(--couleur-texte);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

/* =============================== Sections et Titres =============================== */
.section {
    padding: 100px 20px;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

h1, h2, h3, h4 {
    color: var(--couleur-principale);
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

h3 {
    margin-bottom: 15px;
    font-size: 1.5rem;
}

h4 {
    font-size: 1.1rem;
    margin-top: 15px;
    margin-bottom: 5px;
    color: var(--couleur-texte);
}

.project-title {
    text-align: center;
}

.section-subtitle {
    font-size: 1.2rem;
    color: var(--couleur-texte-secondaire); /* Utilisation d'une variable */
    margin-bottom: 60px;
    text-align: center;
   
}

ul {
    list-style-position: inside;
    padding-left: 0;
}

/* =============================== Barre de navigation =============================== */
nav {
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: background-color 0.3s ease;
}

body.dark-mode nav {
    background-color: rgba(18, 18, 18, 0.8);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 70px;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--couleur-principale);
    text-decoration: none;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 30px; /* Utiliser gap est plus moderne que margin-left */
}

.nav-links a {
    text-decoration: none;
    color: var(--couleur-texte);
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--couleur-principale);
}

/* AJOUT : Conteneur pour les boutons */
.nav-controls {
    display: flex;
    align-items: center;
    gap: 15px; /* Espace entre le bouton de thème et le menu hamburger */
}

/* ==================== Bouton Hamburger ==================== */
.nav-toggle {
    display: none;
    position: relative;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1001;
}

.nav-toggle .bar {
    display: block;
    position: absolute;
    width: 100%;
    height: 3px;
    background-color: var(--couleur-texte);
    border-radius: 3px;
    transition: all 0.3s ease-in-out;
}

.bar:nth-child(1) { top: 0; }
.bar:nth-child(2) { top: 50%; transform: translateY(-50%); }
.bar:nth-child(3) { bottom: 0; }

.nav-toggle.toggled .bar:nth-child(1) { top: 50%; transform: translateY(-50%) rotate(45deg); }
.nav-toggle.toggled .bar:nth-child(2) { opacity: 0; }
.nav-toggle.toggled .bar:nth-child(3) { bottom: 50%; transform: translateY(50%) rotate(-45deg); }


/* =============================== Section Accueil (Hero) =============================== */
#accueil {
    display: flex;
    min-height: 100vh;
    align-items: center;
}

.hero-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    width: 100%;
}

.hero-text h1 { font-size: 3.5rem; }
.hero-text p { font-size: 1.5rem; color: rgb(170, 0, 255); margin: 20px 0; font-weight: 900; }

.hero-socials { margin-bottom: 30px; }
.hero-socials a { color: var(--couleur-texte); font-size: 2rem; margin-right: 20px; transition: color 0.3s ease; }
.hero-socials a:hover { color: var(--couleur-principale); }

.hero-image img {
    width: 200px;
    height: 220px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid var(--couleur-principale);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* ==================== Section À Propos (CV) ==================== */
.cv-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); /* Responsive */
    gap: 30px;
    text-align: left;
}

.cv-section {
    background: var(--couleur-carte);
    padding: 30px;
    border-radius: 8px;
    box-shadow: var(--ombre-carte);
}

.cv-section ul {
    list-style: none;
    padding: 0;
}

.cv-section ul li {
    margin-bottom: 8px;
}

/* ==================== Section Projets ==================== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 40px;
}

.project-card {
    background: var(--couleur-carte);
    border-radius: 8px;
    box-shadow: var(--ombre-carte);
    overflow: hidden;
    text-align: left;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column; /* Pour que le bouton reste en bas */
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--ombre-carte-hover);
}

.project-card .project-description {
    padding: 0 25px;
    flex-grow: 1; /* Pousse le reste vers le bas */
}

.project-card .project-description ul {
    list-style: disc;
    list-style-position: inside;
}

.project-card h3 { padding: 20px 25px 10px 25px; }
.project-tags { padding: 20px 25px; }
.project-links { padding: 0 25px 25px 25px; }

.project-tags span {
    display: inline-block;
    background: var(--couleur-fond);
    color: var(--couleur-texte-secondaire);
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    margin-right: 5px;
    margin-bottom: 5px;
}

.link-figma {
    color: var(--couleur-principale);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
}
.link-figma:hover {
    color: var(--couleur-principale-hover);
}

/* ==================== Boutons ==================== */
.btn, .btn-secondary {
    display: inline-block;
    padding: 12px 24px;
    border: 2px solid transparent;
    border-radius: 5px;
    text-decoration: none;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.3s ease;
}
.btn { background-color: var(--couleur-principale); color: #fff; }
.btn:hover { background-color: var(--couleur-principale-hover); transform: translateY(-2px); }

.btn-secondary { background-color: transparent; color: var(--couleur-principale); border-color: var(--couleur-principale); }
.btn-secondary:hover { background-color: var(--couleur-principale); color: #fff; }

/* ==================== Section Contact & Footer ==================== */
.contact-info p { font-size: 1.2rem; margin-bottom: 15px; }
.contact-info i { color: var(--couleur-principale); margin-right: 15px; width: 20px; text-align: center; }
.contact-info a { text-decoration: none; color: var(--couleur-texte); }

footer {
    text-align: center;
    padding: 20px;
    background: var(--couleur-carte);
    color: var(--couleur-texte-secondaire);
    border-top: 1px solid var(--couleur-bordure);
}

#theme-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--couleur-texte);
    transition: color 0.3s ease, transform 0.3s ease;
}
#theme-toggle:hover { color: var(--couleur-principale); transform: scale(1.1); }

/* ================== Animations au défilement ================== */
.hidden { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease-out, transform 0.6s ease-out; }
.show { opacity: 1; transform: translateY(0); }

/* =============================== Responsive Design =============================== */
@media (max-width: 992px) {
    .hero-container { flex-direction: column-reverse; text-align: center; }
    .hero-text { margin-top: 40px; }
    .hero-image img { width: 280px; height: 280px; }
}

@media (max-width: 768px) {
    .section { padding: 80px 20px; }
    h1, .hero-text h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }

    .nav-links {
        display: none; /* Masquer le menu desktop */
        position: fixed;
        top: 70px; /* Commence sous la barre de nav */
        right: 0;
        width: 100%;
        height: calc(100vh - 70px);
        background-color: var(--couleur-fond);
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding-top: 40px;
        gap: 25px;
        transition: transform 0.3s ease-in-out;
        transform: translateX(100%); /* Masqué à droite */
    }
    .nav-links.nav-active {
        display: flex; /* Le JS le fera réapparaître */
        transform: translateX(0); /* Le JS le fera glisser en place */
    }
    .nav-toggle { display: block; }
    .hero-image img { width: 220px; height: 220px; }
}