:root {
    --bg-color: #0f1115;
    --surface-color: #1a1d24;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --accent-color: #00e5ff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-image: linear-gradient(rgba(15, 17, 21, 0.85), rgba(15, 17, 21, 0.95)), url('assets/images/hero-bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    padding-top: 2rem;
    padding-bottom: 2rem;
    flex: 1;
}

.accent {
    color: var(--accent-color);
}

.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    background: transparent;
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
    border-radius: 4px;
    text-decoration: none;
    font-family: 'Fira Code', monospace;
    transition: all 0.3s ease;
}

.btn-arrow {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 60px;
    height: 60px;
    margin-top: 1rem;
    border: 2px solid var(--accent-color);
    border-radius: 12px;
    color: var(--accent-color);
    background: rgba(0, 229, 255, 0.05);
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.2);
}

.btn-arrow:hover {
    background: var(--accent-color);
    color: var(--bg-color);
    box-shadow: 0 0 25px rgba(0, 229, 255, 0.6);
    transform: translateY(5px);
}

header {
    padding: 3rem 5%;
}

header::after {
    content: '';
    display: block;
    width: 60%;
    height: 2px;
    background-color: var(--accent-color);
    margin: 2rem auto 0 auto;
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.4), 0 0 5px rgba(0, 229, 255, 0.8);
    border-radius: 5px;
}

nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.logo {
    font-family: 'Fira Code', monospace;
    font-size: 2.2rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--text-primary);
}

.logo span {
    color: var(--accent-color);
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2.5rem;
}

nav a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.1rem;
    transition: color 0.3s ease;
    font-weight: 500;
}

nav a:hover {
    color: var(--accent-color);
}

nav a.active {
    color: var(--accent-color);
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 5px;
}

#hero {
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 10%;
    text-align: center;
}

#hero h1 {
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 1rem;
}

#hero p {
    color: var(--text-secondary);
    font-size: 1.2rem;
    max-width: 600px;
    margin-bottom: 2rem;
}

.profile-pic {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    border: 3px solid var(--accent-color);
    object-fit: cover;
    margin-right: 0;
    margin-bottom: 2rem;
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.3);
}

#about {
    padding: 5rem 10%;
    max-width: 1400px;
    margin: 0 auto;
}

#about h2 {
    font-size: 2rem;
    margin-bottom: 3rem;
    text-align: center;
}

.about-content {
    display: flex;
    flex-direction: column;
    gap: 4rem;
    align-items: center;
}

.about-text {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
}

.about-text p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    text-align: justify;
    line-height: 1.8;
}

.skills-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.skill-group h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.5rem;
}

.bubbles {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.bubble {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    font-family: 'Fira Code', monospace;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    cursor: default;
    transition: all 0.3s ease;
}

.bubble:hover, .bubble-active {
    color: var(--bg-color);
    background: var(--accent-color);
    border-color: var(--accent-color);
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.6);
    transform: translateY(-3px);
}

/* Animation d'apparition des étoiles pour les langues */
.lang-bubble .stars {
    display: inline-block;
    max-width: 0; /* Caché par défaut */
    opacity: 0;
    overflow: hidden;
    white-space: nowrap; /* Empêche les étoiles de passer à la ligne */
    transition: all 0.4s ease; /* Animation fluide */
    vertical-align: bottom;
}

/* Au survol ou au toucher, on déploie les étoiles */
.lang-bubble:hover .stars, 
.lang-bubble.bubble-active .stars {
    max-width: 70px; /* Laisse assez de place pour les 5 étoiles */
    opacity: 1;
    margin-left: 5px;
}

/* Empile les bulles de langues verticalement pour éviter les sauts */
.lang-container {
    flex-direction: column; /* Place les éléments de haut en bas */
    align-items: flex-start; /* Empêche les bulles de prendre toute la largeur de la colonne */
}

/* La petite phrase indicative pour les langues */
.click-hint {
    font-size: 0.75rem; /* Texte tout petit */
    color: var(--text-secondary); /* Gris discret */
    font-style: italic; /* Italique pour le côté "note" */
    margin-top: 0.8rem; /* Petit espace avec les bulles au-dessus */
    opacity: 0.8; /* Légèrement transparent */
}

#experience {
    padding: 5rem 10%;
}

#experience h2 {
    font-size: 2rem;
    margin-bottom: 3rem;
    border-left: 4px solid var(--accent-color);
    padding-left: 1rem;
}

.timeline {
    display: grid;
    gap: 2rem;
}

.card {
    background: var(--surface-color);
    padding: 2rem;
    border-radius: 8px;
    border-left: 1px solid transparent;
    transition: all 0.4s ease;
}

.card:hover {
    border-left: 4px solid var(--accent-color);
    transform: translateX(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.card-header > div {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.card-header h3 {
    font-size: 1.3rem;
    color: var(--text-primary);
}

.date {
    font-family: 'Fira Code', monospace;
    color: var(--accent-color);
    font-size: 0.85rem;
}

.card h4 {
    color: var(--text-secondary);
    font-weight: 400;
    margin-bottom: 1rem;
}

.company-logo {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: contain;
    background: #fff;
    padding: 2px;
}

#projets h2 {
    font-size: 2rem;
    margin-bottom: 3rem;
    text-align: center;
    border-left: none;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.project-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.4s ease;
}

.project-img.logo-contain {
    object-fit: contain;
    padding: 1rem;
    background-color: #ffffff;
}

.card:hover .project-img {
    transform: scale(1.03);
}

.clickable-card {
    cursor: pointer;
}

.btn-read-more {
    display: inline-block;
    margin-top: 1rem;
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    color: var(--accent-color);
    font-weight: 600;
    transition: opacity 0.3s;
}

.clickable-card:hover .btn-read-more {
    opacity: 0.8;
}

.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 17, 21, 0.85);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    opacity: 1;
}

.modal-content {
    background-color: var(--surface-color);
    padding: 2.5rem;
    border-radius: 8px;
    max-width: 650px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    border: 1px solid var(--accent-color);
    box-shadow: 0 0 30px rgba(0, 229, 255, 0.15);
    transform: translateY(-30px);
    transition: transform 0.3s ease;
    color: var(--text-secondary);
}

.modal-content::-webkit-scrollbar {
    display: none;
}
.modal-content {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.modal.show .modal-content {
    transform: translateY(0);
}

.modal-content h3 {
    color: var(--text-primary);
    font-size: 1.6rem;
    margin-bottom: 1rem;
    padding-right: 2rem;
}

.modal-img {
    width: 100%;
    max-height: 250px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.modal-img.logo-contain {
    object-fit: contain;
    padding: 1rem;
    background: white;
}

.close-btn {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    color: var(--text-secondary);
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
}

.close-btn:hover {
    color: var(--accent-color);
}

.modal-links {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

#contact {
    padding: 5rem 10%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#contact h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    text-align: center;
    border-left: none;
}

.contact-intro {
    color: var(--text-secondary);
    max-width: 600px;
    margin-bottom: 3rem;
    text-align: center;
}

.contact-card {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.contact-card h3 {
    text-align: center;
}

.contact-card ul {
    list-style: none;
    margin-top: 1rem;
    padding: 0;
    text-align: center;
}

.contact-card ul li {
    margin-bottom: 0.8rem;
    color: var(--text-secondary);
}

.contact-card ul li strong {
    color: var(--text-primary);
    font-weight: 500;
}

.contact-card a {
    color: var(--accent-color);
    text-decoration: none;
    transition: opacity 0.3s;
}

.contact-card a:hover {
    opacity: 0.8;
}

footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.fade-in {
    animation: fadeIn 1s ease-in forwards;
}

.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1s ease-out forwards;
}

.delay-1 {
    animation-delay: 0.2s;
}

.delay-2 {
    animation-delay: 0.5s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================== */
/* RESPONSIVE (Tablettes & Mobiles)           */
/* ========================================== */

/* On cache le burger sur PC par défaut (à mettre juste au-dessus du @media) */
.burger-menu {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    z-index: 100;
}

.burger-menu span {
    width: 30px;
    height: 3px;
    background-color: var(--accent-color);
    transition: all 0.3s ease;
    border-radius: 2px;
}

@media (max-width: 768px) {
    #hero, #about, #experience, #projets, #contact {
        padding: 3rem 5%;
    }

    header {
        padding: 1.5rem 5%;
        position: relative;
        z-index: 1000; /* Force le header et le menu à passer AU-DESSUS de la photo */
    }

    /* On cache la ligne néon qui casse l'affichage sur mobile */
    header::after {
        display: none; 
    }

    nav {
        flex-direction: row; 
        justify-content: space-between;
        align-items: center; /* Aligne parfaitement le logo et la croix */
        width: 100%;
    }

    .logo {
        font-size: 1.3rem;
        text-align: left;
        line-height: 1.3;
    }

    /* On affiche l'icône burger */
    .burger-menu {
        display: flex;
    }

    /* Le menu de navigation réparé */
    nav ul {
        display: none; 
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--bg-color); /* Fond noir 100% opaque pour cacher la photo derrière */
        flex-direction: column;
        padding: 2rem 0;
        box-shadow: 0 15px 30px rgba(0, 0, 0, 0.8); /* Ombre plus forte */
        border-bottom: 2px solid var(--accent-color);
        z-index: 999;
        text-align: center;
        gap: 2rem; /* Espace bien les liens pour les gros doigts */
    }

    nav ul.show {
        display: flex;
        animation: fadeIn 0.3s ease; 
    }

    /* Animation de l'icône Burger en croix */
    .burger-menu.active span:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }
    .burger-menu.active span:nth-child(2) {
        opacity: 0;
    }
    .burger-menu.active span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }

    /* Le reste du responsive (Textes, Grilles) */
    #hero h1 { font-size: 2.2rem; }
    h2 { font-size: 1.8rem !important; margin-bottom: 2rem !important; }
    
    .profile-pic { width: 180px; height: 180px; margin-bottom: 1.5rem; }
    
    .project-grid { grid-template-columns: 1fr; }
    .skills-grid { grid-template-columns: 1fr 1fr; }
    
    .card-header { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
    .date { align-self: flex-start; margin-top: 0.2rem; }
    
    .modal-content { padding: 1.5rem; width: 95%; }
    .modal-content h3 { font-size: 1.3rem; }
    .close-btn { top: 1rem; right: 1.5rem; }
}

/* ========================================== */
/* RESPONSIVE (Petits téléphones)             */
/* ========================================== */
@media (max-width: 480px) {
    .logo { font-size: 1.2rem; }
    #hero h1, .hero-content h1 { font-size: 1.8rem; line-height: 1.2; margin-top: 1rem; }
    #hero p { font-size: 1rem; }
    .skills-grid { grid-template-columns: 1fr; }
    .modal-links { flex-direction: column; }
    .modal-links .btn { width: 100%; text-align: center; }
}