   :root {

    --primary-color: #374151;    
    --secondary-color: #374151;  
    --text-color: #111827;       
    --background-color: #F3F4F6; 
    --accent-color: #374151;     
    --white: #FFFFFF;            
    
    --header-height: 70px;
    --max-width: 1200px;
}

/*  Le style de base */ 
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
}

/* le header */
.header {
    background-color: var(--white);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000; /* pour que l'en tete reste au dessus des autres éléments */
}

.header-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 1.5rem;
    color: var(--primary-color);
}

/* la barre de navigation */
nav {
    display: flex;
    gap: 1rem;
}

nav a {
    text-decoration: none;
    color: var(--text-color);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

nav a:hover, nav a.active {
    background-color: var(--primary-color);
    color: var(--white);
}

/* la main page la ou se trouve mon contenu principal */

main {
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
}

section {
    padding: 4rem 2rem;
    max-width: var(--max-width);
    margin: 0 auto;
}

/* ma bannière d'accueil */
.hero {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    text-align: center;
    padding: 6rem 2rem;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

/* boutons prêt à l'activation */

.cta-buttons {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn {
    padding: 0.8rem 1.5rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn.primary {
    background-color: var(--white);
    color: var(--primary-color);
}

.btn.secondary {
    background-color: transparent;
    border: 2px solid var(--white);
    color: var(--white);
}

/* la grille des projets */

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* la présentation des projets */

.project-card {
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

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

.project-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.project-info {
    padding: 1.5rem;
}

/* les tags & étiquettes */

.project-tags {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.tag {
    background-color: var(--background-color);
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.875rem;
}

/* Mes projets */

.project-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: none;
    background: var(--white);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn.active {
    background-color: var(--primary-color);
    color: var(--white);
}

/* Mes compétences */

.skills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.skill-tag {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
}

/* Contact */

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: var(--primary-color);
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.contact-link:hover {
    background-color: rgba(55, 65, 81, 0.1);
}

/* Mon footer */

footer {
    background-color: var(--white);
    padding: 2rem;
    text-align: center;
    box-shadow: 0 -2px 4px rgba(0,0,0,0.1);
}

.footer-content {
    max-width: var(--max-width);
    margin: 0 auto;
}

.social-links {
    margin: 1rem 0;
}

.social-links a {
    color: var(--primary-color);
    text-decoration: none;
}

/* Mes animations */

.animate-text {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

.delay-1 {
    animation-delay: 0.2s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .hero h2 {
        font-size: 2rem;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }

/* Footer en bas */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1 0 auto;
}

footer {
    flex-shrink: 0;
    background-color: var(--white);
    padding: 2rem;
    text-align: center;
    box-shadow: 0 -2px 4px rgba(0,0,0,0.1);
}

}

section {
    min-height: 100vh; /* chaque section prend toute la hauteur visible */
    padding: 6rem 2rem;
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center; /* centrage vertical du contenu */
}

.about-text {
    max-width: 1000px;
    margin: 0 auto;
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-color);
}

/* Barre de chargement */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    display: grid;
    place-items: center;
    z-index: 9999;
    transition: opacity 0.5s;
}

body.night-mode #loader {
    background: #121212;
}

.loader-content {
    text-align: center;
    width: 200px;
}

.loader-text {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 20px;
    font-weight: bold;
}

body.night-mode .loader-text {
    color: white;
}

.loader-bar {
    height: 3px;
    background: rgba(55, 65, 81, 0.2);
    border-radius: 3px;
    overflow: hidden;
}

body.night-mode .loader-bar {
    background: rgba(255, 255, 255, 0.2);
}

.loader-progress {
    height: 100%;
    width: 0;
    background: var(--primary-color);
    transition: width 0.1s;
}

body.night-mode .loader-progress {
    background: white;
}

/* Night Mode */
body.night-mode {
    --primary-color: #ffffff !important; /* Force le blanc */
    --background-color: #121212;
    --text-color: #ffffff;
    --white: #1e1e1e;
}

body.night-mode .header,
body.night-mode footer,
body.night-mode .project-card {
    background: #1e1e1e !important;
    border-color: #333 !important;
}

body.night-mode .btn.primary {
    background: white !important;
    color: #121212 !important;
}

/* Bouton toggle */
#night-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: #121212;
    border: none;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    z-index: 1000;
    display: grid;
    place-items: center;
}

body.night-mode #night-toggle {
    background: white;
    color: #121212;
}

/* Bouton Night Mode*/
#night-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2); /* Blanc très transparent */
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    z-index: 1000;
    display: grid;
    place-items: center;
    transition: all 0.3s;
}

/* Mode Jour */
body:not(.night-mode) #night-toggle {
    background: rgba(55, 65, 81, 0.2); /* Bleu très transparent */
    border: 1px solid rgba(55, 65, 81, 0.3);
    color: var(--primary-color);
}

/* Hover */
#night-toggle:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.3);
}

/* Correction Night Mode */
body.night-mode {
    background: #121212 !important; /* Fond noir uni */
    --primary-color: #ffffff !important; /* Texte blanc */
    --background-color: #121212 !important;
    --white: #1e1e1e !important; /* Cartes gris foncé */
}

/* Espace entre les cartes */
.project-card {
    margin-bottom: 10px !important; /* Espace constant */
}

/* Suppression du dégradé bleu */
.hero {
    background: var(--primary-color) !important;
}

/* Bouton toggle discret */
#night-toggle {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

/* Correction pour le bouton Accueil en mode nuit */
body.night-mode .btn.primary {
    background: #1e1e1e !important;  /* Fond noir comme le footer */
    color: #ffffff !important;       /* Texte blanc */
}

body.night-mode .btn.primary:hover {
    background: #333333 !important;  /* Fond gris foncé au survol */
    color: #ffffff !important;       /* Texte reste blanc */
}