*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    background-color: #050505;
    color: #ffffff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* ESPACE DE SÉCURITÉ : 130px pour que le titre ne touche jamais la navbar */
    padding-top: 130px; 
    overflow-x: hidden;
    background-image: radial-gradient(circle at 50% 0%, #1a1500 0%, #050505 60%);
    background-attachment: scroll;
}

::selection {
    background: #d4af37;
    color: #000000;
}

::-webkit-scrollbar { width: 12px; }
::-webkit-scrollbar-track { background: #050505; }
::-webkit-scrollbar-thumb {
    background: #aa8c2c;
    border-radius: 6px;
    border: 3px solid #050505;
}
::-webkit-scrollbar-thumb:hover { background: #d4af37; }

/* ========================================= */
/* BARRE DE NAVIGATION (DESKTOP)             */
/* ========================================= */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 90px;
    background: rgba(5, 5, 5, 0.98);
    border-bottom: 1px solid rgba(212, 175, 55, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 25px;
    z-index: 2000;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
}

.nav-brand {
    display: flex;
    align-items: center;
    margin-right: 10px;
    z-index: 2001;
}

.nav-logo-img {
    height: 48px;
    width: auto;
    object-fit: contain;
    margin-right: 15px;
    filter: drop-shadow(0 0 5px rgba(212, 175, 55, 0.3));
    transition: transform 0.3s;
}

.navbar:hover .nav-logo-img { transform: scale(1.05); }

/* Éléments masqués sur Desktop, affichés sur Mobile */
.nav-toggle { display: none; }
.nav-burger { 
    display: none; 
    flex-direction: column; 
    justify-content: space-between; 
    width: 30px; 
    height: 21px; 
    cursor: pointer; 
    z-index: 2002; 
}
.nav-burger span { 
    display: block; 
    height: 3px; 
    width: 100%; 
    background-color: #d4af37; 
    border-radius: 3px; 
    transition: all 0.3s ease; 
}

.nav-links {
    display: flex;
    flex: 1;
    justify-content: center;
    gap: 2vw;
    margin: 0 10px; 
}

.nav-links a {
    text-decoration: none;
    color: #a3a3a3;
    font-size: clamp(0.7rem, 1vw + 0.3rem, 0.85rem);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 5px 0; 
    position: relative;
    transition: all 0.3s ease;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #d4af37;
    transition: width 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.8);
}

.nav-links a:hover, .nav-links a.active {
    color: #ffffff;
    text-shadow: 0 0 15px rgba(212, 175, 55, 0.6);
}

.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

/* LE BOUTON CV */
.btn-cv, .btn-cv-desktop {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 37px;
    padding: 0 25px;
    min-width: 125px;
    gap: 8px;
    margin: 0 0 0 auto; 
    background: linear-gradient(135deg, #d4af37 0%, #aa8c2c 100%);
    color: #000000 !important;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
    border-radius: 4px;
    border: 1px solid #f9e5a0;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.btn-cv:hover, .btn-cv-desktop:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(212, 175, 55, 0.4);
    background: linear-gradient(135deg, #fff7cc 0%, #d4af37 100%);
}

.btn-cv::before, .btn-cv-desktop::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: 0.6s;
}

.btn-cv:hover::before, .btn-cv-desktop:hover::before { left: 100%; }

/* Bouton pour le menu mobile (masqué sur PC) */
.btn-cv-mobile { 
    display: none; 
    margin-top: 20px; 
    padding: 12px 30px; 
    border: 1px solid #d4af37; 
    color: #d4af37 !important; 
    text-decoration: none; 
    text-transform: uppercase; 
    font-weight: 600; 
    font-size: 0.9rem; 
    letter-spacing: 1px; 
    text-align: center; 
}


/* ========================================= */
/* TITRES ET CONTENEURS                      */
/* ========================================= */
.main-container {
    width: 90%;
    max-width: 1280px;
    margin: 0 auto 100px auto;
    position: relative;
    z-index: 1;
}

.page-title {
    text-align: center;
    margin-bottom: 50px;
    font-family: 'Playfair Display', serif;
    /* TAILLE FLUIDE : le titre ne se coupera plus en deux sur téléphone */
    font-size: clamp(2rem, 6vw, 4.5rem); 
    font-weight: 400;
    font-style: italic;
    line-height: 1.2;
    background: linear-gradient(to right, #ffffff 20%, #f0d78c 50%, #ffffff 80%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.5));
    animation: fadeDown 1s ease-out;
}

@keyframes fadeDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========================================= */
/* ONGLETS (TECHNIQUES / HUMAINES)           */
/* ========================================= */
input[name="main-view"] { display: none; }

.slider-controls {
    display: flex;
    width: 100%;
    max-width: 400px;
    margin: 0 auto 60px auto;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 50px;
    padding: 6px;
    position: relative;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
}

.slider-label {
    flex: 1;
    text-align: center;
    padding: 12px 0;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #a3a3a3;
    z-index: 2;
    transition: color 0.4s ease;
    user-select: none;
}

.slider-highlight {
    position: absolute;
    top: 6px; left: 6px;
    width: calc(50% - 6px); height: calc(100% - 12px);
    background: linear-gradient(135deg, #d4af37 0%, #aa8c2c 100%);
    border-radius: 40px;
    z-index: 1;
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
}

#view-tech:checked ~ .slider-controls .slider-label[for="view-tech"],
#view-human:checked ~ .slider-controls .slider-label[for="view-human"] { color: #000000; }
#view-human:checked ~ .slider-controls .slider-highlight { transform: translateX(100%); }

.views-container { position: relative; min-height: 800px; }

.view-section {
    position: absolute; top: 0; left: 0; width: 100%;
    opacity: 0; visibility: hidden;
    transform: translateY(50px) scale(0.98);
    transition: all 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

#view-tech:checked ~ .views-container .tech-view,
#view-human:checked ~ .views-container .human-view {
    opacity: 1; visibility: visible;
    transform: translateY(0) scale(1);
    z-index: 10;
}

/* ========================================= */
/* BOX COMPETENCES ET SIDEBAR                */
/* ========================================= */
.skills-wrapper {
    display: flex;
    background-color: #0a0a0a;
    border: 1px solid rgba(212, 175, 55, 0.3);
    min-height: 650px;
    border-radius: 16px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    position: relative;
}

.skills-wrapper::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 2px;
    background: linear-gradient(90deg, transparent, #d4af37, transparent);
}

.skills-wrapper input[type="radio"] { display: none; }

.skills-sidebar {
    width: 320px;
    background-color: #080808;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex; flex-direction: column;
    padding: 40px 0; flex-shrink: 0;
}

.tab-label {
    padding: 25px 35px;
    cursor: pointer;
    color: #a3a3a3;
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    transition: all 0.4s ease;
    border-left: 3px solid transparent;
    display: flex; align-items: center;
}

.tab-label:hover { color: #ffffff; background-color: rgba(255, 255, 255, 0.02); padding-left: 45px; }

#tab-reseaux:checked ~ .skills-sidebar label[for="tab-reseaux"],
#tab-prog:checked ~ .skills-sidebar label[for="tab-prog"],
#tab-web:checked ~ .skills-sidebar label[for="tab-web"],
#tab-langues:checked ~ .skills-sidebar label[for="tab-langues"] {
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.1), transparent);
    color: #d4af37; border-left-color: #d4af37; font-style: italic; padding-left: 45px;
}

.skills-display {
    flex: 1; padding: 60px;
    background: radial-gradient(circle at 100% 0%, rgba(212, 175, 55, 0.05), transparent 40%);
}

.content { display: none; }

#tab-reseaux:checked ~ .skills-display .content-reseaux,
#tab-prog:checked ~ .skills-display .content-prog,
#tab-web:checked ~ .skills-display .content-web,
#tab-langues:checked ~ .skills-display .content-langues { display: block; }

.skills-display h2 {
    color: #d4af37;
    font-family: 'Playfair Display', serif;
    /* TAILLE FLUIDE POUR LE TITRE DES ONGLETS */
    font-size: clamp(1.6rem, 4vw, 2.8rem);
    margin-top: 0; margin-bottom: 30px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    padding-bottom: 15px; display: inline-block;
}

.skill-list {
    list-style: none; padding: 0;
    display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 30px;
}

.skill-list li {
    background: rgba(255, 255, 255, 0.02);
    padding: 30px; border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 4px; color: #a3a3a3; transition: all 0.3s ease;
    display: flex; flex-direction: column; justify-content: space-between; height: 100%;
}

.skill-list li:hover {
    border-color: #d4af37; transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.04); box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.skill-list strong {
    display: block; margin-bottom: 15px; color: #ffffff;
    font-family: 'Playfair Display', serif; font-size: 1.3rem;
}

.btn-see-more {
    background: transparent; border: 1px solid #d4af37; color: #d4af37;
    font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
    padding: 10px 20px; border-radius: 2px; cursor: pointer; transition: all 0.3s ease;
    align-self: flex-start; margin-top: auto;
}

.btn-see-more:hover { background: #d4af37; color: #000000; box-shadow: 0 0 15px rgba(212, 175, 55, 0.4); }

/* ========================================= */
/* BARRES DE LANGUES ET SOFT SKILLS          */
/* ========================================= */
.language-item { margin-bottom: 40px; }
.lang-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.lang-name { font-size: 1.2rem; color: #ffffff; font-weight: 500; }
.btn-see-more-sm { background: none; border: none; color: #d4af37; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; cursor: pointer; opacity: 0.8; transition: 0.3s; }
.btn-see-more-sm:hover { opacity: 1; letter-spacing: 1px; }

.progress-bar { width: 100%; height: 4px; background: rgba(255, 255, 255, 0.1); border-radius: 2px; }
.fill { height: 100%; background: linear-gradient(135deg, #d4af37 0%, #aa8c2c 100%); box-shadow: 0 0 10px rgba(212, 175, 55, 0.4); position: relative; overflow: hidden; }

.human-skills-container {
    background-color: #0a0a0a; border: 1px solid rgba(212, 175, 55, 0.3); padding: 80px 60px;
    border-radius: 16px; box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6); position: relative; overflow: hidden;
}

.human-skills-container h2 { color: #d4af37; font-family: 'Playfair Display', serif; font-size: clamp(2rem, 4vw, 3rem); margin-top: 0; margin-bottom: 20px; }
.human-skills-container > p { color: #a3a3a3; font-size: 1.1rem; margin-bottom: 60px; max-width: 600px; }

.soft-skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 40px; align-items: stretch; }
.soft-skill-card {
    background: rgba(255, 255, 255, 0.02); padding: 40px; border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px; transition: all 0.4s ease; position: relative; display: flex; flex-direction: column; justify-content: space-between; height: 100%;
}
.soft-skill-card:hover { background: rgba(212, 175, 55, 0.03); border-color: #d4af37; transform: translateY(-10px); box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6); }
.soft-skill-card h3 { color: #ffffff; font-family: 'Playfair Display', serif; font-size: 1.8rem; margin-top: 0; margin-bottom: 25px; }
.soft-skill-card p { color: #a3a3a3; font-size: 1.05rem; line-height: 1.8; margin-bottom: 40px; flex-grow: 1; }

.btn-see-more-card {
    background: rgba(212, 175, 55, 0.1); border: 1px solid transparent; color: #d4af37;
    font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px;
    padding: 16px; width: 100%; border-radius: 4px; cursor: pointer; transition: all 0.3s ease; text-align: center; margin-top: auto;
}
.btn-see-more-card:hover { background: #d4af37; color: #000000; box-shadow: 0 0 20px rgba(212, 175, 55, 0.3); }

/* ========================================= */
/* FENETRES MODALES                          */
/* ========================================= */
.modal-toggle { display: none; }
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.95); z-index: -9999; opacity: 0; visibility: hidden;
    transition: opacity 0.4s ease; display: flex; justify-content: center; align-items: center;
}
.modal-toggle:checked + .modal-overlay { opacity: 1; visibility: visible; z-index: 99999; }
.modal-content {
    background: #0f0f0f; border: 1px solid #d4af37; width: 90%; max-width: 700px;
    padding: 50px; border-radius: 8px; position: relative; box-shadow: 0 0 60px rgba(0, 0, 0, 0.8);
    transform: translateY(20px) scale(0.95); transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.modal-toggle:checked + .modal-overlay .modal-content { transform: translateY(0) scale(1); }
.close-modal { position: absolute; top: 20px; right: 30px; color: #a3a3a3; font-size: 2.5rem; line-height: 1; cursor: pointer; transition: 0.3s; }
.close-modal:hover { color: #d4af37; transform: rotate(90deg); }
.modal-close-area { position: absolute; top: 0; left: 0; width: 100%; height: 100%; cursor: default; }

.modal-content h3 { color: #d4af37; font-family: 'Playfair Display', serif; font-size: clamp(1.8rem, 4vw, 2.5rem); margin-top: 0; padding-bottom: 20px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); margin-bottom: 30px; }
.modal-body p { color: #ffffff; font-size: 1.1rem; line-height: 1.8; margin-bottom: 20px; }
.modal-body strong { color: #d4af37; font-weight: 600; }

.site-footer { text-align: center; padding: 20px; background-color: #050505; color: #d4af37; font-size: 0.9rem; border-top: 1px solid rgba(212, 175, 55, 0.2); }

/* ========================================= */
/* EFFETS MAGIQUES (JS)                      */
/* ========================================= */
#network-particles { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: -1; pointer-events: none; }
.ripple { position: absolute; border-radius: 50%; transform: scale(0); animation: ripple-effect 0.6s linear; background-color: rgba(255, 255, 255, 0.4); pointer-events: none; }
@keyframes ripple-effect { to { transform: scale(4); opacity: 0; } }
.skill-list li, .soft-skill-card, .language-item { opacity: 0; }

/* ========================================= */
/* LE VRAI RESPONSIVE MOBILE (CORRIGÉ)       */
/* ========================================= */

@media (max-width: 900px) {
    /* Sécurité pour le titre */
    body { padding-top: 100px; }
    
    /* Transformation de la Navbar en menu Hamburger */
    .navbar { 
        height: 70px; 
        padding: 0 20px; 
        flex-direction: row; /* FORCE la ligne au lieu de la colonne */
        justify-content: space-between; 
        background: #050505; 
    }
    .nav-logo-img { height: 35px; margin: 0; }
    
    /* On cache le bouton de CV ordinateur et on affiche le Hamburger */
    .btn-cv, .btn-cv-desktop { display: none !important; }
    .nav-burger { display: flex; }

    /* Le menu de liens qui glisse depuis la droite */
    .nav-links {
        position: fixed;
        top: 0; right: 0;
        width: 75%; height: 100vh;
        background-color: #050505;
        border-left: 1px solid #d4af37;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 30px;
        margin: 0;
        transform: translateX(100%);
        transition: transform 0.4s ease-in-out;
        z-index: 2000;
        box-shadow: -5px 0 15px rgba(0,0,0,0.8);
    }

    .nav-toggle:checked ~ .nav-links { transform: translateX(0); }
    .nav-toggle:checked ~ .nav-burger span:nth-child(1) { transform: rotate(45deg) translate(5px, 6px); }
    .nav-toggle:checked ~ .nav-burger span:nth-child(2) { opacity: 0; }
    .nav-toggle:checked ~ .nav-burger span:nth-child(3) { transform: rotate(-45deg) translate(5px, -6px); }
    
    .nav-links a { font-size: 1.2rem; color: #f0f0f0; }
    
    /* On affiche le bouton de CV version mobile DANS le menu hamburger */
    .nav-links .btn-cv-mobile { display: block; }

    /* Adaptation du Slider Techniques / Humaines */
    .slider-controls { width: 90%; margin: 20px auto 40px auto; }

    /* Adaptation des Onglets Réseaux, Prog... qui deviennent scrollables à l'horizontale */
    .skills-wrapper { flex-direction: column; min-height: auto; }
    .skills-sidebar {
        width: 100%; flex-direction: row; overflow-x: auto;
        padding: 0; border-right: none; border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        background: rgba(0, 0, 0, 0.3); scrollbar-width: none;
    }
    .skills-sidebar::-webkit-scrollbar { display: none; }
    
    .tab-label {
        padding: 15px 20px; white-space: nowrap; font-size: 0.9rem;
        border-left: none; border-bottom: 3px solid transparent; flex-shrink: 0;
    }
    .tab-label:hover { padding-left: 20px; } /* Annule le décalage hover de l'ordi */

    #tab-reseaux:checked ~ .skills-sidebar label[for="tab-reseaux"],
    #tab-prog:checked ~ .skills-sidebar label[for="tab-prog"],
    #tab-web:checked ~ .skills-sidebar label[for="tab-web"],
    #tab-langues:checked ~ .skills-sidebar label[for="tab-langues"] {
        border-left: none; border-bottom-color: #d4af37;
        padding-left: 20px; background: rgba(212, 175, 55, 0.05);
    }
    
    /* Espacements divers réduits pour mobile */
    .skills-display { padding: 30px 20px; }
    
    /* CORRECTION : Le titre de la catégorie peut se mettre sur plusieurs lignes */
    .skills-display h2 { 
        font-size: 1.6rem; 
        line-height: 1.3; 
        white-space: normal; /* Autorise le retour à la ligne */
        word-wrap: break-word;
    }

    .skill-list { grid-template-columns: 1fr; }
    .human-skills-container { padding: 40px 20px; }
    .soft-skills-grid { grid-template-columns: 1fr; }
    .soft-skill-card { min-height: auto; }
    .modal-content { padding: 30px 20px; width: 95%; }
    .close-modal { top: 10px; right: 15px; font-size: 2.2rem; }
}
