/* Thème (couleurs, tailles, conteneur) */
:root {
    --bg: #0B0A0A;        /* fond global */
    --surface: #121214;   /* surfaces secondaires */
    --text: #FFFFFF;      /* texte principal */
    --muted: #CFCFCF;     /* texte atténué */
    --accent: #802392;    /* accent principal */
    --accent-2: #990A4F;  /* accent secondaire */
    
    /* Large écrans: container fluide */
    --container: clamp(1100px, 82vw, 1440px);
    --header-pad: max(24px, calc((100vw - var(--container)) / 2));
}

/* Défilement doux natif */
html {
    scroll-behavior: smooth;
}

/* Base typographique + fond à motif de points */
body {
    font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    margin: 0;
    padding-top: 70px; /* réserve l’espace pour la navbar fixe */
    background:
        radial-gradient(circle at 1px 1px, rgba(255,255,255,0.06) 1px, transparent 1px) 0 0 / 26px 26px,
        var(--bg);
    color: var(--text);
}

/* Header fixe en grille (logo | nav | action) */
header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;

    position: fixed;
    top: 0;
    width: 100%;
    height: 70px;
    padding-block: 0;
    padding-inline: var(--header-pad);
    column-gap: 24px;

    /* Effet vitre (transparence + blur) sur la navbar */
    background-color: rgba(11, 10, 10, 0.28);
    backdrop-filter: blur(10px) saturate(120%);
    -webkit-backdrop-filter: blur(10px) saturate(120%);
    border-bottom: 1px solid rgba(255,255,255,0.12);
    
    box-shadow: none;
    z-index: 1000;
    box-sizing: border-box;
}

/* Fallback si backdrop-filter indisponible */
@supports not ((backdrop-filter: blur(10px)) or (-webkit-backdrop-filter: blur(10px))) {
    header { background-color: rgba(11,10,10,0.85); }
}

/* Logo */
.logo {
    grid-column: 1 / 2;
    font-size: 1.5em;
    font-weight: bold;
    color: var(--text);
}

/* Navigation centrée via la grille */
nav {
    grid-column: 2 / 3;
    justify-self: center;
}

/* Liste de navigation */
nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 24px;
}

/* Liens de navigation (texte + icône) */
nav ul li a {
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    transition: color 0.2s ease;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Icônes MDI dans la nav */
nav ul li a .mdi {
    font-size: 20px;
    line-height: 1;
    color: currentColor;
}

/* Soulignement dégradé sur hover/focus/actif */
nav ul li a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -8px;
    height: 2px;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transition: width 0.2s ease;
}

nav ul li a:hover,
nav ul li a:focus {
    color: var(--accent);
}

nav ul li a:hover::after,
nav ul li a:focus::after,
nav ul li a.active::after {
    width: 100%;
}

/* Bouton langue (EN) */
.nav-lang {
    grid-column: 3 / 4;
    justify-self: end;

    display: inline-flex;
    align-items: center;
    gap: 8px;

    text-decoration: none;
    color: var(--text);
    font-weight: 600;

    border: 1px solid var(--text);
    padding: 6px 10px;
    border-radius: 8px;
    background: transparent;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;

    font-family: inherit;
    cursor: pointer;
}

/* Hover/focus du bouton langue */
.nav-lang:hover,
.nav-lang:focus {
    background: rgba(255,255,255,0.08);
    color: var(--text);
    border-color: var(--text);
    transform: translateY(-1px);
}

/* Drapeau rond dans le bouton langue (Flag Icons) */
.nav-lang .fi {
    width: 20px;
    height: 20px;
    display: inline-block;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    line-height: 1;
    flex-shrink: 0;
    box-shadow: 0 0 0 1px var(--text) inset;
    font-size: 1rem;
}

/* Accentuation du drapeau au survol du bouton */
.nav-lang:hover .fi,
.nav-lang:focus .fi {
    box-shadow: 0 0 0 1px var(--text) inset, 0 0 0 2px rgba(255,255,255,0.15);
}

/* Ajustements généraux de drapeaux */
.nav-lang .fi { font-size: 1rem; line-height: 1; border-radius: 50%; }
.flag { line-height: 1; font-size: 1rem; }

/* Sections plein écran centrées */
section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: transparent; /* hérite du fond global */
    scroll-margin-top: 70px; /* compense la navbar fixe */
    box-sizing: border-box;
}

/* Liens dans le contenu (hors nav) */
a { color: var(--accent); }
a:hover { opacity: 0.85; }

/* Focus visible (accessibilité) */
:focus-visible {
    outline: 2px solid var(--accent-2);
    outline-offset: 2px;
}

/* Utilitaires */
.text-accent { color: var(--accent); }
.bg-accent { background: var(--accent); color: var(--bg); }

.btn-accent {
    background: var(--accent);
    color: var(--bg);
    border: 1px solid var(--accent);
    padding: 8px 14px;
    border-radius: 6px;
    transition: background .2s ease, border-color .2s ease, transform .2s ease;
}
.btn-accent:hover {
    background: var(--accent-2);
    border-color: var(--accent-2);
    transform: translateY(-1px);
}

/* Accueil — Titres */
#accueil h1 {
    font-size: 72px;
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin: 0 0 6px;
}
#accueil h2 {
    margin: 4px 0 16px;
    font-size: 32px;
    font-weight: 600;
    line-height: 1.2;
}

/* Accueil — Paragraphe d’intro */
#accueil .infos {
    font-size: 24px;
    font-weight: 400;
    line-height: 32px;
    margin: 16px auto 28px;
    color: var(--muted);
    text-align: center;
    max-width: 860px;
}

/* Accueil — occupe exactement le viewport (moins le header) */
#accueil {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    text-align: center; /* Ajouté pour centrer le contenu flex */
    min-height: calc(100svh - 70px);              /* 70px = hauteur du header */
    padding-top: clamp(48px, 8vh, 120px);
    padding-bottom: clamp(72px, 12vh, 160px);
}

/* Accueil — CTA sur une même ligne */
#accueil .cta-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    flex-wrap: nowrap;             /* même ligne */
    margin: 10px 0 18px;
}
#accueil .cta-row > a { margin: 0; }

/* Style du 2e bouton CTA (contour) */
#accueil .cta-row > a:nth-of-type(2) {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    border: 1px solid var(--text);
    text-decoration: none;
    transition: background .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}
#accueil .cta-row > a:nth-of-type(2):hover,
#accueil .cta-row > a:nth-of-type(2):focus {
    background: rgba(255,255,255,0.08);
    border-color: var(--text);
    transform: translateY(-1px);
}

/* CTA "Voir mes expériences" en lien souligné blanc (sans contour) */
#accueil .cta-row > a.cta-link {
    display: inline; /* pas de look "bouton" */
    background: transparent !important;
    border: none !important;
    color: var(--text);
    padding: 0;
    border-radius: 0;
    text-decoration: underline;
    text-decoration-color: currentColor; /* blanc */
    text-underline-offset: 3px;
    text-decoration-thickness: 2px;
    transition: text-decoration-color .2s ease, transform .2s ease;
}
#accueil .cta-row > a.cta-link:hover,
#accueil .cta-row > a.cta-link:focus {
    color: var(--text); /* le texte reste blanc */
    text-decoration-color: var(--accent); /* soulignement violet */
    transform: translateY(-1px);
}

/* KPIs — Titre dans la carte */
#accueil .kpi h3 {
    font-size: 28px;
    font-weight: 700;
    line-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;     /* hauteur uniforme pour aligner */
    margin: 0 0 6px;
    color: var(--text);
}

/* KPIs (taille fluide) */
#accueil .kpi h3 { font-size: clamp(18px, 1.4vw, 32px); }

/* KPIs — Icône dans le H3 */
#accueil .kpi h3 .mdi {
    font-size: 24px;
    line-height: 1;
    color: white;
}

/* KPIs — Sous-titre */
#accueil .kpi p {
    font-size: 12px;
    font-weight: 400;
    line-height: 16px;
    margin: 0;
    color: var(--muted);
}

/* KPIs — Grille sur une ligne (desktop) */
#accueil .kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    width: 100%;
    max-width: var(--container);
    margin: 28px auto 0;
}

/* KPIs — Carte (fond noir, bord blanc) */
#accueil .kpi {
    background: #060607;
    border: 1px solid var(--text);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

/* Flèche de scroll en bas de la section Accueil */
.scroll-down {
    position: absolute;
    left: 50%;
    bottom: 90px;
    z-index: 2;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    text-decoration: none;
    opacity: 0.9;
    transition: color .2s ease, opacity .2s ease, transform .2s ease;
    animation: scroll-bounce 1.6s ease-in-out infinite;
}
.scroll-down .mdi {
    font-size: 28px;
    line-height: 1;
}
.scroll-down:hover,
.scroll-down:focus {
    color: var(--accent);
    opacity: 1;
}

/* Flèche — sans bordure ni padding (pas de “boîte”) */
#accueil > a.scroll-down {
    border: none;
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}

/* Flèche toujours visible dans le viewport */
.scroll-down {
    bottom: clamp(24px, 6vh, 90px);
}

/* Animation de rebond vertical pour la flèche */
@keyframes scroll-bounce {
    0%, 100% { transform: translate(-50%, 0); }
    50%      { transform: translate(-50%, 6px); }
}

/* Badge “statut” en pilule avec point vert pulsant */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    border: 1px solid var(--text);
    border-radius: 999px;
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 600;
    background: transparent;
    
    /* remonte légèrement, adapté à la hauteur d’écran */
    transform: translateY(clamp(-24px, -6vh, -16px));
    margin-bottom: clamp(16px, 2vh, 32px); /* espace avec le titre */
}

/* Point vert animé au début du badge */
.badge::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 0 rgba(34,197,94,0.6);
    animation: badge-pulse 1.6s ease-in-out infinite;
}

/* Animation pulsante du point du badge */
@keyframes badge-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(34,197,94,0.6); }
    70%  { box-shadow: 0 0 0 8px rgba(34,197,94,0); }
    100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}

/* Typographies fluides */
#accueil h1 { font-size: clamp(42px, 5.5vw, 104px); }
#accueil h2 { font-size: clamp(22px, 2.5vw, 44px); }
#accueil .infos {
    font-size: clamp(18px, 1.6vw, 28px);
    line-height: clamp(26px, 2.2vw, 36px);
}

/* Bouton burger (masqué en desktop) */
.nav-toggle {
    grid-column: 3 / 4;
    justify-self: end;
    display: none;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid var(--text);
    background: transparent;
    color: var(--text);
    cursor: pointer;
    transition: background .2s ease, transform .2s ease;
}
.nav-toggle:hover,
.nav-toggle:focus { background: rgba(255,255,255,0.08); transform: translateY(-1px); }
.nav-toggle .mdi { font-size: 22px; line-height: 1; }


/*
==============================================
    SECTION RESPONSIVE (MEDIA QUERIES)
==============================================
*/

/* Bump supplémentaire en ≥1600px */
@media (min-width: 1600px) {
    :root { --container: clamp(1200px, 70vw, 1600px); }
    #accueil {
        padding-top: clamp(120px, 12vh, 220px);
        padding-bottom: clamp(200px, 16vh, 320px);
    }
}

/* Responsive — largeur ≤ 900px (grille KPIs en 2 colonnes) */
@media (max-width: 900px) {
    #accueil {
        min-height: 100vh;
        padding-top: 56px;
        padding-bottom: 88px;
    }
    #accueil .kpis { grid-template-columns: repeat(2, 1fr); gap: 20px; }
}

/* Responsive — petits écrans (≤ 600px) */
@media (max-width: 600px) {
    /* Typo manuelle plus petite (en fallback de clamp()) */
    #accueil h1 { font-size: 48px; }
    #accueil h2 { font-size: 24px; }
    #accueil .infos { font-size: 20px; line-height: 28px; max-width: 95%; }
    
    /* Remontée plus douce du badge */
    #accueil .badge {
        transform: translateY(-12px);
        margin-bottom: 18px;
    }
    
    /* Masque la flèche sur mobile */
    .scroll-down { display: none; }
    
    /* Motif de fond plus léger */
    body {
        background:
            radial-gradient(circle at 1px 1px, rgba(255,255,255,0.05) 1px, transparent 1px) 0 0 / 28px 28px,
            var(--bg);
    }
}

/* Responsive — largeur ≤ 520px (grille KPIs en 1 colonne) */
@media (max-width: 520px) {
    #accueil .kpis { grid-template-columns: 1fr; gap: 16px; }
}

/* Très petits écrans: autoriser le retour à la ligne pour éviter le débordement */
@media (max-width: 380px) {
    #accueil .cta-row { row-gap: 12px; }
}


/* -- Media queries basées sur la HAUTEUR -- */

/* Écrans peu hauts: compacter pour éviter le scroll initial */
@media (max-height: 800px) {
    #accueil {
        min-height: calc(100svh - 70px);
        padding-top: clamp(24px, 6vh, 72px);
        padding-bottom: clamp(40px, 8vh, 96px);
    }
    /* S'assure que la flèche est aussi masquée ici si l'écran est petit ET peu haut */
    @media (max-width: 600px) {
        .scroll-down { display: none; }
    }
    
    /* Gère la position de la flèche sur les écrans peu hauts MAIS larges */
    @media (min-width: 601px) {
        .scroll-down { bottom: clamp(16px, 5vh, 72px); }
    }
}

/* 1080p: remonter la flèche pour qu’elle reste bien visible */
@media (min-height: 900px) and (max-height: 1200px) {
    .scroll-down { bottom: clamp(72px, 8vh, 120px); }
}

/* 2K et + : encore un peu plus haut pour l’équilibre visuel */
@media (min-height: 1200px) {
    .scroll-down { bottom: clamp(88px, 7vh, 140px); }
}

/* Accessibilité — désactive l’animation si préférences “réduire les mouvements” */
@media (prefers-reduced-motion: reduce) {
    .badge::before { animation: none; }
    .scroll-down { animation: none; }
}


/* ===============================
   SECTION COMPÉTENCES (Style avec encapsulation et cartes)
   =============================== */

   #competences {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 100px 20px 60px;
    scroll-margin-top: 70px;
    background: transparent; /* S'assure que le fond reste transparent et utilise le body */
}

#competences h2 {
    width: 100%;
    text-align: center;
    color: var(--text);
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0 0 40px;
    letter-spacing: 1px;
}

#competences .skills-container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 20px;
    
    /* Le grand conteneur général des compétences */
    border-radius: 14px;
    background: rgba(17, 17, 20, 0.5); /* Fond semi-transparent pour le conteneur principal */
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);

    display: grid; /* On revient à la grille pour l'agencement principal */
    grid-template-columns: repeat(12, minmax(0, 1fr)); /* Votre grille initiale */
    gap: 20px;
    
}

/* Nouveau conteneur pour aligner les boîtes de catégories en ligne */
#competences .category-wrapper {
    display: flex;
    flex-direction: row;    /* aligne en ligne */
    flex-wrap: wrap;        /* retour à la ligne si besoin */
    gap: 15px;              /* espacement constant */
    align-items: flex-start;
    width: 100%;
}

/* Styles pour les grandes et moyennes boîtes principales (Science des données, Programmation, Transverses) */
#competences .large-box,
#competences .medium-box {
    border: 1px rgba(255,255,255,0.9);; /* Bordure des "cartes" principales */
    border-radius: 12px;
    padding: 20px;
    background: transparent !important;
    border: 1px solid #fff !important;
    display: flex; /* Utilisation de flexbox pour l'alignement interne */
    flex-direction: column; /* Les éléments s'empilent verticalement */
    gap: 15px; /* Espacement entre les sous-catégories */
    box-shadow: 0 2px 8px rgba(0,0,0,0.2); /* Légère ombre */
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

#competences .large-box:hover,
#competences .medium-box:hover {
    transform: translateY(-3px); /* Effet de survol */
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

#competences .large-box {
    grid-column: 1 / -1; /* Prend toute la largeur sur la première ligne */
}

#competences .medium-box {
    grid-column: span 6;  /* 2 colonnes de medium-box par ligne sur 12 colonnes */
}

/* Medium box: 2 skills par ligne */
#competences .medium-box .category-wrapper {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
}

/* En-tête des boîtes principales (ex: "Science des données") */
#competences .main-card-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 15px; /* Espace sous le titre principal de la carte */
    padding-bottom: 15px; /* Ligne de séparation */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#competences .main-card-header .mdi {
    font-size: 3rem; /* Grosse icône */
    color: var(--text); /* Icône colorée avec votre accent */
    margin-bottom: 10px;
}

#competences .main-card-header h3 {
    color: var(--text);
    font-size: 1.6rem;
    font-weight: 600;
    margin: 0;
}


/* Styles pour chaque sous-catégorie (skill-category-box) */
#competences .skill-category-box {
    border: 1px solid #fff !important;
    border-radius: 10px;
    padding: 15px;
    background: transparent !important;
    transition: box-shadow 0.2s ease-in-out;

    /* --- AJOUTS --- */
    flex-grow: 1;        /* grandit pour occuper l’espace */
    flex-shrink: 1;      /* peut rétrécir */
    flex-basis: 280px;   /* largeur de base */
    min-width: 250px;    /* largeur mini avant retour à la ligne */
    text-align: center; /* Centrer le contenu dans chaque skill box */
}

#competences .skill-category-box:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.2); /* Légère ombre au survol */
}

/* En-tête de chaque sous-catégorie (ex: "Langages informatiques") */
#competences .category-header {
    display: flex;
    align-items: center; /* Icône et texte sur la même ligne */
    gap: 10px;
    margin-bottom: 15px; /* Espace sous le titre de la sous-catégorie */
    justify-content: center; /* centre icône + titre */
}

#competences .category-header .mdi {
    font-size: 1.8rem; /* Icône un peu plus petite */
    color: var(--muted); /* Couleur discrète pour les icônes de sous-catégories */
    line-height: 1;
}

#competences .category-header h4 {
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
}


/* Conteneur des tags de compétences */
#competences .skills-list {
    list-style: none; /* Supprime les puces du <ul> */
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px; /* Espace entre les tags */
    justify-content: center; /* centre les tags */
}

/* Style des tags individuels (pilules) */
#competences .skill-tag {
    display: inline-flex;
    align-items: center;
    padding: 7px 14px;
    border: 1px solid var(--text); /* Bordure avec couleur d'accent */
    border-radius: 20px;
    color: var(--text); /* Texte avec couleur d'accent */
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    gap: 8px;                 /* espace entre icône et texte */
}

#competences .skill-tag .mdi,
#competences .skill-tag iconify-icon {
    font-size: 1rem;
    width: 1em;
    height: 1em;
    line-height: 1;
}

#competences .skill-tag:hover {
    background-color: var(--accent); /* Fond plein au survol */
    color: var(--bg); /* Texte de couleur de fond au survol */
    border-color: var(--accent);
    cursor: default;
}


/* Responsive */
@media (max-width: 900px) {
    #competences .medium-box {
        grid-column: 1 / -1; /* Les boîtes moyennes prennent toute la largeur sur les petits écrans */
    }
    #competences .skills-container {
        gap: 16px;
        padding: 16px;
    }
}

@media (max-width: 600px) {
    #competences h2 {
        font-size: 1.8rem;
        margin-bottom: 30px;
    }
    #competences .large-box,
    #competences .medium-box {
        padding: 15px;
        gap: 10px;
    }
    #competences .main-card-header .mdi {
        font-size: 2.5rem;
        margin-bottom: 8px;
    }
    #competences .main-card-header h3 {
        font-size: 1.4rem;
    }
    #competences .skill-category-box {
        padding: 10px;
    }
    #competences .category-header {
        margin-bottom: 10px;
        gap: 8px;
    }
    #competences .category-header .mdi {
        font-size: 1.5rem;
    }
    #competences .category-header h4 {
        font-size: 1rem;
    }
    #competences .skill-tag {
        font-size: 0.85rem;
        padding: 6px 12px;
    }
    #competences .skills-list {
        gap: 8px;
    }
    #competences .medium-box .category-wrapper {
        grid-template-columns: 1fr;
    }
}

/* ===============================
   SECTION FORMATION (Timeline alternée, points centrés)
   =============================== */
#formation {
    width: 100%;
    padding: 80px 20px;
    scroll-margin-top: 70px;
}

#formation h2 {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto 28px;
    text-align: center;
}

#formation .formation-container {
    position: relative;
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0; /* centré */
    display: flex;
    flex-direction: column;
    gap: 24px;
    --tl-gap: 30px;           /* espace texte interne côté ligne */
    --tl-sep: 20px;           /* espace entre la carte et la ligne */
}

/* Ligne verticale au centre */
#formation .formation-container::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 6px; 
    background: rgba(255,255,255,0.5);
    transform: translateX(-50%);
}

/* Cartes */
#formation .formation-item {
    position: relative;
    width: calc(50% - var(--tl-sep)); /* évite tout débordement avec la marge */
    box-sizing: border-box;
    border: 1px solid #fff !important;
    background: transparent !important;
    border-radius: 10px;
    padding: 14px 16px;
    text-align: left; /* toujours à gauche */
}

/* Impairs à gauche */
#formation .formation-item:nth-child(odd) {
    left: 0;
    padding-right: var(--tl-gap);
    text-align: left; /* au lieu de right */
    margin-right: var(--tl-sep);      /* écarte de la ligne */
}
/* Pairs à droite */
#formation .formation-item:nth-child(even) {
    left: 50%;
    padding-left: var(--tl-gap);
    margin-left: var(--tl-sep);       /* écarte de la ligne */
}

/* Point blanc (commun) */
#formation .formation-item::before {
    content: "";
    position: absolute;
    top: 18px;
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.12);
    z-index: 1;
}

/* Centre exact sur la ligne */
#formation .formation-item:nth-child(odd)::before {
    left: calc(100% + var(--tl-sep));
    transform: translateX(-50%); /* centre pile sur la ligne */
}
#formation .formation-item:nth-child(even)::before {
    left: calc(0% - var(--tl-sep));
    transform: translateX(-50%); /* centre pile sur la ligne */
}

/* Typographies */
#formation .formation-item h3 {
    margin: 0 0 6px;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
}
#formation .formation-institution,
#formation .formation-lieu,
#formation .formation-date {
    display: flex;           /* icône + texte sur une ligne */
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 0.95rem;
    margin: 4px 0 0 0;
}

#formation .formation-item .mdi {
    font-size: 1rem;
    line-height: 1;
    color: var(--muted);
}

/* supprime les compensations latérales devenues inutiles */
#formation .formation-item:nth-child(odd) .formation-institution,
#formation .formation-item:nth-child(odd) .formation-lieu,
#formation .formation-item:nth-child(odd) .formation-date {
    margin-left: 0;
    margin-right: 0;
}

/* Mobile: repasse en timeline à gauche */
@media (max-width: 600px) {
    #formation { padding: 60px 16px; }

    #formation .formation-container {
        --tl-x: 18px;
        --tl-gap: 20px;
        padding-left: calc(var(--tl-x) + var(--tl-gap));
        gap: 18px;
    }
    #formation .formation-container::before {
        left: var(--tl-x);
        transform: none;
    }
    #formation .formation-item,
    #formation .formation-item:nth-child(odd),
    #formation .formation-item:nth-child(even) {
        width: 100%;
        left: 0;
        padding: 12px 14px;
        text-align: left;
        margin: 0; /* reset de la séparation en mobile */
    }
    #formation .formation-item::before,
    #formation .formation-item:nth-child(odd)::before,
    #formation .formation-item:nth-child(even)::before {
        left: calc(-1 * var(--tl-gap));
        top: 16px;
        width: 10px;
        height: 10px;
        transform: translateX(-50%);
    }
}

/* ===============================
   SECTION EXPÉRIENCE
   =============================== */
#experience {
    width: 100%;
    padding: 80px 20px;
    scroll-margin-top: 70px;
}
#experience h2 {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto 28px;
    text-align: center;
}
#experience .experience-container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
#experience .experience-item {
    border: 1px solid #fff !important;
    background: transparent !important;
    border-radius: 10px;
    padding: 16px;
}
#experience .exp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}
#experience .experience-item h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
}
#experience .date-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;            /* plus compact */
    border: 1px solid #fff;
    border-radius: 8px;           /* plus carré (ex: 4px ou 0 pour angles vifs) */
    background: transparent;
    color: var(--text);
    font-weight: 600;
    white-space: nowrap;
}
#experience .date-badge .mdi {
    font-size: 1rem;
    line-height: 1;
    color: var(--muted);
}

#experience .experience-role {
    display: inline-block;
    margin-bottom: 6px;
    color: var(--muted);
}

/* Titre "Missions" avec picto */
#experience .missions-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 0 8px;
    font-size: 1.05rem;
    color: var(--text);
}
#experience .missions-title .mdi {
    font-size: 1.1rem;
    color: var(--muted);
    line-height: 1;
}

/* Liste des missions avec le même logo par ligne */
#experience .missions-list {
    list-style: none;
    margin: 0 0 24px; /* plus d'espace sous les missions */
    padding: 0;
    display: grid;
    gap: 8px;
}
#experience .missions-list li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: var(--muted);
}
#experience .missions-list li .mdi {
    font-size: 1rem;
    color: var(--muted);
    line-height: 1;
    margin-top: 2px; /* aligne avec le texte multi-lignes */
    flex-shrink: 0;
}

/* Compétences en une ligne, chaque compétence en bulle/tag */
#experience .skills-used {
    list-style: none;
    margin: 16px 0 0; /* espace au-dessus des compétences */
    padding: 0;
    display: flex;
    flex-wrap: wrap; /* garde sur une ligne si possible, puis retour */
    gap: 10px;
}
#experience .skills-used li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border: 1px solid var(--text);
    border-radius: 999px;
    color: var(--text);
    line-height: 1;
}
#experience .skills-used li .mdi,
#experience .skills-used li iconify-icon {
    font-size: 1rem;
    line-height: 1;
}


/* ===============================
   SECTION PROJETS — CARROUSEL
   =============================== */
   #projets {
    width: 100%;
    padding: 80px 20px;
    scroll-margin-top: 70px;
}
#projets h2 {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto 28px;
    text-align: center;
}

#projets .projects-carousel {
    position: relative;
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
}

#projets .carousel-viewport {
    overflow: hidden;
    width: 100%;
}

#projets .carousel-track {
    display: flex;
    gap: 20px;                 /* espace entre cartes */
    will-change: transform;
    transform: translateX(0);
    transition: transform .35s ease;
    padding: 4px;              /* petit pad pour focus/ombre */
    margin: 0;
}

#projets .carousel-item {
    list-style: none;
    flex: 0 0 calc(50% - 10px); /* 2 cartes par vue (gap total = 20px) */
    display: flex;                 /* permet de centrer la carte dans l’item */
}

#projets .projet-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #060607;
    border: 1px solid #fff;
    border-radius: 12px;
    padding: 16px;
    box-sizing: border-box;
    width: 92%;                    /* carte plus étroite que sa colonne */
    margin-inline: auto;           /* centrage horizontal */
}

@media (min-width: 1200px) {
    #projets .projet-card { width: 88%; }  /* un peu plus étroit sur grands écrans */
}

@media (max-width: 900px) {
    #projets .projet-card { width: 100%; } /* pleine largeur en mobile (1 carte par vue) */
}

/* Titre, date et séparateur */
#projets .projet-card h3 {
    margin: 0;
    font-size: 1.25rem;
}
#projets .projet-date {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border: 1px solid #fff;
    border-radius: 8px;
    color: var(--text);
    width: fit-content;
}
#projets .projet-date .mdi { color: var(--muted); }
#projets .projet-sep {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.6);
    margin: 6px 0 2px;
}

/* Sous-titres avec picto */
#projets .projet-subtitle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0;
    font-size: 1rem;
}
#projets .projet-subtitle .mdi { color: var(--muted); }

/* Liste des fonctionnalités en colonne */
#projets .projet-features {
    list-style: none;
    padding: 0;
    margin: 0 0 8px 0;
    display: grid;
    gap: 8px;
}
#projets .projet-features li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: var(--muted);
}
#projets .projet-features li .mdi {
    font-size: 1rem;
    color: var(--muted);
    line-height: 1;
    margin-top: 2px;
}

/* Technologies en ligne avec bulles (comme expériences) */
#projets .projet-technologies {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
#projets .projet-technologies li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border: 1px solid var(--text);
    border-radius: 999px;
    color: var(--text);
    line-height: 1;
}
#projets .projet-technologies li .mdi,
#projets .projet-technologies li iconify-icon {
    font-size: 1rem;
    line-height: 1;
}

/* Flèches */
#projets .carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 40px;
    width: 40px;
    border: 1px solid #fff;
    border-radius: 50%;
    background: rgba(0,0,0,0.4);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    transition: background .2s ease, transform .2s ease, opacity .2s ease;
}
#projets .carousel-arrow:hover { background: rgba(255,255,255,0.12); transform: translateY(-50%) scale(1.03); }
#projets .carousel-arrow:disabled { opacity: 0.4; cursor: default; }
#projets .carousel-arrow.prev { left: -4px; }
#projets .carousel-arrow.next { right: -4px; }
#projets .carousel-arrow .mdi { font-size: 22px; }

/* Responsive: 1 carte par vue en mobile */
@media (max-width: 900px) {
    #projets .carousel-item { flex-basis: 100%; }
    #projets .carousel-arrow.prev { left: 6px; }
    #projets .carousel-arrow.next { right: 6px; }
}

#projets .projet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
#projets .projet-header h3 {
    margin: 0;
    flex: 1;               /* le titre prend l'espace dispo */
}
#projets .projet-date {
    flex-shrink: 0;        /* la date reste collée à droite */
}

/* ===============================
   FOOTER
   =============================== */
.site-footer {
    width: 100%;
    padding: 24px 20px;
    border-top: 1px solid rgba(255,255,255,0.12);
    background: transparent;
    box-sizing: border-box;
}

.site-footer .footer-container {
    max-width: var(--container);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.site-footer .footer-col--left {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-style: normal; /* <address> sans italique */
}

.site-footer .footer-col--left a,
.site-footer .footer-col--left span {
    color: var(--muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    line-height: 1.2;
}
.site-footer .footer-col--left a:hover { color: var(--text); }
.site-footer .footer-col--left .mdi { font-size: 18px; color: var(--muted); }

.site-footer .footer-col--center p {
    margin: 0;
    color: var(--muted);
    text-align: center;
    white-space: nowrap;
}

.site-footer .footer-col--right { display: flex; align-items: center; }

.site-footer .btn-linkedin {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid var(--text);
    border-radius: 999px;
    color: var(--text);
    text-decoration: none;
    background: transparent;
    transition: background .2s ease, transform .2s ease;
}
.site-footer .btn-linkedin:hover {
    background: rgba(255,255,255,0.08);
    transform: translateY(-1px);
}
.site-footer .btn-linkedin .mdi { font-size: 20px; line-height: 1; }

/* Responsive */
@media (max-width: 700px) {
    .site-footer .footer-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .site-footer .footer-col--center p { white-space: normal; }
}