/* =========================================
   1. VARIABLES & THEMES
   ========================================= */
:root {
    /* --- THÈME DARK (Défaut) --- */
    --bg-body: #0f172a;       /* Bleu nuit profond */
    --bg-card: #1e293b;       /* Gris bleuté */
    --bg-card-hover: #2d3b55; /* Plus clair au survol */
    
    --text-main: #f1f5f9;     /* Blanc cassé */
    --text-muted: #94a3b8;    /* Gris clair */
    
    --accent: #3b82f6;        /* Bleu électrique */
    --accent-glow: rgba(59, 130, 246, 0.4);
    
    --success: #22c55e;       /* Vert status */
    --success-bg: rgba(34, 197, 94, 0.1);
    
    --border: rgba(255, 255, 255, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    
    --tag-bg: rgba(59, 130, 246, 0.15);
    
    --font-main: 'Inter', sans-serif;
    --font-mono: 'Courier New', Courier, monospace;
}

[data-theme="light"] {
    /* --- THÈME LIGHT --- */
    --bg-body: #f1f5f9;       /* Gris très clair */
    --bg-card: #ffffff;       /* Blanc pur */
    --bg-card-hover: #f8fafc;
    
    --text-main: #0f172a;     /* Bleu nuit très foncé */
    --text-muted: #64748b;    /* Gris moyen */
    
    --accent: #2563eb;        /* Bleu plus fort pour contraste */
    --accent-glow: rgba(37, 99, 235, 0.2);
    
    --border: rgba(0, 0, 0, 0.1);
    --shadow: 0 4px 15px -3px rgba(0, 0, 0, 0.05);
    
    --tag-bg: rgba(37, 99, 235, 0.1);
}

/* =========================================
   2. RESET & BASES
   ========================================= */
* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-main);
    background-color: var(--bg-body);
    color: var(--text-main);
    transition: background-color 0.3s ease, color 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    overflow-x: hidden; /* Empêche la scrollbar horizontale pendant l'animation */
}

a { text-decoration: none; color: inherit; }
ul, li { list-style: none; padding: 0; margin: 0; }

/* =========================================
   3. HEADER DU SITE
   ========================================= */
.site-header {
    width: 95%;
    max-width: 1200px;
    padding: 30px 0 40px 0;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Logo "B-H.dev" */
.brand-logo {
    display: flex;
    flex-direction: column;
}

.logo-text {
    font-weight: 800;
    font-size: 1.4rem;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.highlight { color: var(--accent); }

/* Badge Statut "System Online" */
.status-badge {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
    display: flex;
    align-items: center;
    font-family: var(--font-mono);
}

.led-green {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--success);
    margin-right: 8px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* =========================================
   4. SWITCH DARK/LIGHT MODE
   ========================================= */
.theme-switch-wrapper { display: flex; align-items: center; }

.theme-switch {
    display: inline-block;
    height: 26px;
    position: relative;
    width: 50px;
}

.theme-switch input { display: none; }

.slider {
    background-color: #334155;
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
    border-radius: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 6px;
    font-size: 12px;
}

[data-theme="light"] .slider { background-color: #cbd5e1; }

.slider:before {
    background-color: #fff;
    bottom: 4px;
    content: "";
    height: 18px;
    left: 4px;
    position: absolute;
    transition: .4s;
    width: 18px;
    border-radius: 50%;
    z-index: 2;
}

input:checked + .slider:before { transform: translateX(24px); }

.sun-icon { color: #f59e0b; }
.moon-icon { color: #f1f5f9; }

/* =========================================
   5. LAYOUT PRINCIPAL (SPLIT SCREEN)
   ========================================= */
.main-layout {
    display: grid;
    /* 2 colonnes égales sur Desktop */
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    max-width: 1200px;
    width: 95%;
    padding-bottom: 40px;
}

/* --- SECTION GAUCHE : PROFIL --- */
.section-profile {
    display: flex;
    flex-direction: column;
}

/* Carte Profil (H1 + CV) */
.profile-card {
    height: 100%;
    min-height: 400px; /* Hauteur min pour l'équilibre visuel */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* --- Mise à jour du Titre Profil --- */

.profile-card h1 {
    margin: 0 0 10px 0;
    font-weight: 800;
    line-height: 1.2; /* Un peu plus d'espace entre les lignes */
}

/* Style pour "Médiateur Numérique" */
.role-human {
    font-size: 1.8rem; /* Un peu plus petit, plus sobre */
    color: var(--text-main);
    display: inline-block; /* Force le passage à la ligne proprement */
    margin-bottom: 0;
}

/* Style pour "Dev Fullstack & SysAdmin" */
.role-tech {
    font-size: 2.2rem; /* Plus gros, c'est le "coeur" technique */
    background: linear-gradient(120deg, var(--text-main), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent; /* Fallback : var(--accent) si besoin */
    display: inline-block;
}

/* Fallback Safari/Webkit si le gradient bug */
@supports not (-webkit-background-clip: text) {
    .role-tech { color: var(--accent); }
}


/* Astuce pour le gradient texte (compatible Webkit) */
@supports (-webkit-background-clip: text) {
    .profile-card h1 { color: transparent; }
}

.subtitle {
    font-size: 1.1rem;
    color: var(--accent);
    font-weight: 600;
    margin: 0 0 25px 0;
    font-family: var(--font-mono);
}

.desc {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 30px;
    max-width: 90%;
}

/* Tags Tech Stack */
.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: auto; /* Pousse vers le bas si espace */
    margin-bottom: 20px;
}

.tag {
    background: var(--tag-bg);
    color: var(--accent);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid transparent;
    transition: 0.2s;
}

.tag:hover {
    border-color: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
}

/* --- SECTION DROITE : PROJETS --- */
.section-projects {
    display: flex;
    flex-direction: column;
}

.section-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin: 0 0 15px 5px;
    opacity: 0.8;
    font-weight: 700;
}

/* Grille 2x2 des projets */
.projects-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    height: 100%; /* Prend toute la hauteur pour matcher le profil */
}

/* =========================================
   6. COMPOSANT CARTE (GÉNÉRIQUE)
   ========================================= */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 24px;
    position: relative; /* Pour stretched-link */
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); /* Transition plus naturelle */    
}

.profile-card:hover {
    transform: translateY(-6px) scale(1.05); /* Monte haut */
    box-shadow: 0 15px 30px rgba(0,0,0,0.3); /* Grosse ombre */
    border-color: var(--accent);
}

/* --- LAYOUT HEADER PROFIL CORRIGÉ --- */

/* 1. Le Conteneur Parent */
.profile-header-layout {
    display: flex;             /* Active le mode ligne */
    flex-direction: row;       /* Force l'alignement horizontal */
    justify-content: space-between; /* Ecarte les éléments au max */
    align-items: flex-start;       /* Centre verticalement (Texte vs Photo) */
    width: 100%;               /* S'assure qu'on prend toute la place */
    margin-bottom: 20px;
}

/* 2. Le Bloc Texte (Enfant 1) */
.profile-text-block {
    flex: 1;                   /* Prend tout l'espace disponible restant */
    padding-right: 15px;       /* Petite marge de sécurité avec la photo */
    min-width: 0;              /* Empêche les bugs de débordement flex */
}

/* Ajustement des titres pour que ça rentre bien */
.profile-text-block h1 {
    margin: 0 0 15px 0;
    line-height: 1.1;
}

/* 3. Le Bloc Photo (Enfant 2) */
.profile-avatar-block {
    position: relative; /* Indispensable pour utiliser z-index */
    z-index: 10;
    flex-shrink: 0;            /* INTERDIT à la photo de rétrécir */
    width: 128px;              /* Largeur fixe conteneur */
    height: 128px;             /* Hauteur fixe conteneur */    
}

/* L'image elle-même */
.avatar-link {
    display: block;      /* Prend le comportement d'un bloc */
    width: 100%;         /* Remplit tout le conteneur */
    height: 100%;
    text-decoration: none; /* Sécurité */
}

.avatar-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;         /* Remplissage propre */
    border-radius: 50%;        /* Rond parfait */
    border: 2px solid var(--accent); /* Bordure couleur thème */
    box-shadow: 0 0 15px rgba(0,0,0,0.3);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), 
                border-color 0.3s ease,
                box-shadow 0.3s ease;
}

.avatar-link img:hover {
    transform: scale(1.15) rotate(6deg); /* Zoom + Rotation */
    border-color: var(--accent);         /* La bordure prend la couleur du thème */
    box-shadow: 0 0 25px var(--tag-bg);  /* Glow externe */
    cursor: pointer;                     /* Change le curseur pour inviter au clic */
}

/* Animation SPÉCIFIQUE pour les tuiles Projets (Plus subtile & "Tech") */
.projects-grid .card:hover {
    /* 1. translateY(-3px) : La carte monte un peu */
    /* 2. scale(1.02) : La carte grossit de 2% (C'est subtil mais visible) */
    transform: translateY(-3px) scale(1.02) !important;
    
    background-color: var(--bg-card-hover);
    border-color: var(--accent);
    
    /* L'ombre grandit aussi pour simuler la 3D */
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2), 
                0 0 15px var(--tag-bg); /* Petit effet de halo coloré */
    
    z-index: 10; /* Assure que la carte passe au-dessus des autres si elle déborde */
}

/* Header interne de carte (Icon + Status) */
.card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.icon-box {
    font-size: 1.5rem;
    color: var(--accent);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); /* Effet rebond (bouncy) */
}

/* Quand on survole une carte projet, l'icône bouge */
.projects-grid .card:hover .icon-box {
    transform: scale(1.2) rotate(5deg); /* Zoom + légère rotation */
    color: var(--text-main); /* L'icône s'illumine (passe du bleu au blanc) */
}

/* Corps de la carte */
.card-body h3 {
    margin: 0 0 5px 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.card-body p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0;
    line-height: 1.4;
}

/* Status "UP" */
.service-status.online {
    background: var(--success-bg);
    color: var(--success);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 800;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

/* Lien Étendu (SEO & UX Friendly) */
.stretched-link::after {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1;
    cursor: pointer;
}

.btn-link {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* =========================================
   7. FOOTER
   ========================================= */
.site-footer {
    color: var(--text-muted);
    font-size: 0.8rem;
    padding: 20px;
    text-align: center;
    margin-top: 20px;
}

/* =========================================
   8. ANIMATIONS (GRANDE ENTRÉE)
   ========================================= */

/* Configuration de base */
.animate-entry {
    opacity: 0;
    animation-duration: 2.2s; /* Durée assez longue pour que le trajet soit fluide */
    /* Courbe "Smooth" : Départ rapide, arrivée tout en douceur */
    animation-timing-function: cubic-bezier(0.19, 1, 0.22, 1);
    animation-fill-mode: forwards;
}

/* --- KEYFRAMES (DÉFINITION DES MOUVEMENTS) --- */

/* Apparition simple (Header/Footer) */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: none; }
}

/* Le CV vient de LOIN à DROITE (Hors écran) */
@keyframes slideInFromRight {
    0% { 
        opacity: 0; 
        transform: translateX(100vw); /* Part de l'extérieur droit complet */
    }
    100% { 
        opacity: 1; 
        transform: none; 
    }
}

/* Les Projets viennent de LOIN à GAUCHE (Hors écran) */
@keyframes slideInFromLeft {
    0% { 
        opacity: 0; 
        transform: translateX(-100vw); /* Part de l'extérieur gauche complet */
    }
    100% { 
        opacity: 1; 
        transform: none; 
    }
}

/* --- ATTRIBUTION --- */

.site-header.animate-entry,
.site-footer.animate-entry {
    animation-name: fadeInUp;
}

/* Profil (CV) -> Vient de droite */
.section-profile.animate-entry {
    animation-name: slideInFromLeft;
}

/* Projets -> Viennent de gauche */
.section-title.animate-entry,
.projects-grid .card.animate-entry {
    animation-name: slideInFromRight;
}

/* --- CHORÉGRAPHIE (DÉLAIS) --- */

/* 1. Le Header apparaît tout de suite */
.site-header.animate-entry { animation-delay: 0s; }

/* 2. Le CV commence son trajet (Le "Boss" arrive en premier) */
.section-profile.animate-entry { animation-delay: 0.2s }

/* 3. Les Projets attendent que le CV soit bien avancé pour démarrer */
/* Le titre des projets */
.section-title.animate-entry   { animation-delay: 0.8s; }

/* Les cartes projets arrivent une par une */
.projects-grid .card:nth-child(1) { animation-delay: 1s; } /* Nextcloud */
.projects-grid .card:nth-child(2) { animation-delay: 1.2s; } /* Vault */
.projects-grid .card:nth-child(3) { animation-delay: 1.4s; } /* MC */
.projects-grid .card:nth-child(4) { animation-delay: 1.6s; } /* Loop / Repair */
.projects-grid .card:nth-child(5) { animation-delay: 1.8s; } /* Réparations */
.projects-grid .card:nth-child(6) { animation-delay: 2s; } /* Arcade */

/* 4. Le footer termine */
.site-footer.animate-entry { animation-delay: 2s; }

/* =========================================
   9. RESPONSIVE
   ========================================= */
@media (max-width: 900px) {
    .main-layout {
        grid-template-columns: 1fr; /* Passage en 1 colonne */
        gap: 40px;
    }
    
    .profile-card {
        min-height: auto;
    }
    
    /* Sur tablette, on garde la grille projets en 2 colonnes si possible */
    .projects-grid {
        min-height: auto;
    }
}

@media (max-width: 600px) {
    .profile-card h1 { font-size: 2rem; }
    
    /* Sur mobile pur, les projets s'empilent aussi */
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .card-top { margin-bottom: 10px; }
    .card { min-height: 160px; }
    .role-human { font-size: 1.4rem; }
    .role-tech { font-size: 1.6rem; }

}
/* --- STATUS BADGES --- */

/* Base commune */
.service-status {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

/* 1. État ONLINE (Vert) */
.service-status.online {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
    border-color: rgba(34, 197, 94, 0.3);
    box-shadow: 0 0 5px rgba(34, 197, 94, 0.2);
}

/* 2. État OFFLINE (Rouge) */
.service-status.offline {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}

/* 3. État CHECKING (Gris pulsant ou Orange) */
.service-status.checking {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-muted);
    border-color: rgba(148, 163, 184, 0.2);
    animation: pulse-gray 1.5s infinite;
}

@keyframes pulse-gray {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

/* =========================================
   EFFET RIPPLE (CLICK VAGUELETTE)
   ========================================= */

/* L'élément qui crée la vague */
.ripple {
    position: absolute;
    border-radius: 50%; /* Cercle parfait */
    background-color: rgba(255, 255, 255, 0.4); /* Blanc semi-transparent */
    transform: scale(0); /* Au départ, il est invisible (taille 0) */
    animation: ripple-animation 0.6s linear;
    pointer-events: none; /* Important : le clic doit traverser la vague */
}

@keyframes ripple-animation {
    to {
        transform: scale(4); /* Il grandit 4x la taille */
        opacity: 0;          /* Et disparaît en fondu */
    }
}

/* Styles modale (ajoutez à style.css) */
#lightbox-img {
    max-width: 90%; 
    max-height: 70%; 
    border-radius: 12px; 
    box-shadow: 0 20px 60px rgba(0,0,0,0.8);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); /* Animation fluide */
    object-fit: contain; /* Garde les proportions */
}
#mainPhoto.zoomed {
    cursor: grab !important;
    user-select: none;
}
#mainPhoto.zoomed:active {
    cursor: grabbing !important;
}

.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); align-items: center; justify-content: center; }
.modal-content { max-width: 90%; max-height: 90%; background: var(--bg-card); border-radius: 20px; padding: 30px; position: relative; text-align: center; }
.close { position: absolute; right: 20px; top: 15px; font-size: 2rem; color: var(--text-muted); cursor: pointer; }
.gallery-nav { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.gallery-thumbs { display: flex; gap: 10px; overflow-x: auto; max-width: 500px; }
.gallery-thumbs img { width: 60px; height: 60px; object-fit: cover; border-radius: 8px; cursor: pointer; border: 2px solid transparent; }
.gallery-thumbs img.active { border-color: var(--accent); }
.main-photo img { max-width: 100%; max-height: 400px; border-radius: 12px; }
.main-photo p { margin-top: 15px; color: var(--text-muted); font-style: italic; }
.nav-btn { background: var(--accent); color: white; border: none; padding: 10px; border-radius: 50%; cursor: pointer; }
@media (max-width: 600px) { .modal-content { padding: 20px; } .gallery-thumbs img { width: 50px; height: 50px; } }

/* =========================================
   OVERLAY PARCOURS (TIMELINE)
   ========================================= */

/* 1. Le conteneur principal (fixe) */
.overlay-container {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center; /* Centre la modale */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s;
    padding: 20px;
}

/* État ouvert */
.overlay-container.is-open {
    opacity: 1;
    visibility: visible;
}

/* Fond sombre flouté */
.overlay-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.85); /* --bg-body avec transparence */
    backdrop-filter: blur(8px);
    z-index: 1;
}

/* 2. La "Tuile" Contenu - AVEC SNAP SCROLL */
/* Le conteneur avec SNAP activé */
.overlay-content {
    position: relative;
    z-index: 2;
    background: var(--bg-card);
    width: 100%;
    max-width: 750px;
    max-height: 85vh;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border);
    overflow-y: scroll;
    padding: 30px;
    
    /* SNAP SCROLL */
    scroll-snap-type: y mandatory;
    scroll-padding-top: 20px;
    scroll-behavior: smooth;
    
    /* ← SCROLLBAR INVISIBLE (PROPRE) */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    
    /* Animation d'entrée */
    transform: translateY(30px) scale(0.95);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Scrollbar Chrome/Safari invisible */
.overlay-content::-webkit-scrollbar {
    display: none;
}

/* SNAP SUR CHAQUE ÉTAPE */
/* Les étapes scrollent normalement avec espace adapté */
/* Chaque étape est un point de snap */
.timeline-step {
    position: relative;
    width: 100%;
    max-width: 650px;
    margin: 0 auto 30vh; /* ← Réduit à 30vh (espace entre tuiles) */
    opacity: 0.1;
    transform: scale(0.9) translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
    
    /* ← POINT DE SNAP */
    scroll-snap-align: center; /* Centre la tuile dans la modale */
    scroll-snap-stop: always; /* Force l'arrêt sur chaque tuile */
}

/* Quand une étape est active */
.timeline-step.active {
    opacity: 1 !important;
    transform: scale(1) translateY(0) !important;
    pointer-events: auto;
}

/* Première étape : snap en haut */
.timeline-step:first-child {
    scroll-snap-align: start; /* Colle en haut */
}

/* Dernière étape */
.timeline-step:last-child {
    margin-bottom: 30vh;
    scroll-snap-align: center;
}
/* Bouton fermer */
.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s;
    z-index: 10;
}
.close-btn:hover { color: var(--accent); }

/* 3. La Timeline */
/* Header (visible au début, scroll normalement) */
/* Header (VISIBLE dès le début) */
.parcours-header { 
    text-align: center; 
    margin-bottom: 40px;
    padding: 0;
    opacity: 1 !important; /* ← FORCE la visibilité */
    visibility: visible !important;
}

.parcours-header h2 { 
    font-size: 1.8rem; 
    margin: 0 0 10px 0; 
    color: #f1f5f9; 
    font-family: 'Courier New', monospace;
}

.parcours-header .subtitle {
    color: #58a6ff;
    font-size: 0.95rem;
}
.timeline {
    position: relative;
    padding-left: 20px;
    border-left: 2px solid var(--border);
    margin-left: 10px;
}

/* Point sur la ligne */
.timeline-step::before {
    content: '';
    position: absolute;
    left: -27px; /* Ajustement pour centrer sur la ligne */
    top: 5px;
    width: 12px;
    height: 12px;
    background: var(--bg-card);
    border: 2px solid var(--accent);
    border-radius: 50%;
    z-index: 2;
    transition: background 0.3s, box-shadow 0.3s;
}

.timeline-step:hover::before {
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
}

.timeline-step:last-child {
    margin-bottom: 50px;
}

.step-date {
    font-family: var(--font-mono);
    color: var(--accent);
    font-size: 0.9rem;
    margin-bottom: 5px;
    font-weight: 600;
}

.step-content h3 { margin: 0 0 8px 0; font-size: 1.2rem; color: var(--text-main); }
.step-content p { margin: 0 0 10px 0; color: var(--text-muted); line-height: 1.6; }

.special-step .step-content {
    background: var(--tag-bg);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

/* Bouton téléchargement final */
.parcours-footer { text-align: center; margin-top: 50px; }
.btn-download {
    display: inline-block;
    padding: 12px 24px;
    background: var(--accent);
    color: white;
    border-radius: 50px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
}
.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--accent-glow);
}

/* 4. Animations au scroll (Classe utilitaire) */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================
   THÈME TERMINAL POUR LA MODALE
   ========================================= */
.terminal-theme {
    background: #0d1117 !important;
    border: 1px solid #30363d !important;
}

.terminal-badge {
    display: inline-block;
    background: #161b22;
    color: #58a6ff;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    border: 1px solid #30363d;
    margin-bottom: 15px;
    font-family: monospace;
}

/* --- LA TIMELINE (VERSION SIMPLE ET ROBUSTE) --- */
.timeline-wrapper {
    position: relative;
    padding: 20px 0 20px 50px; /* Espace à gauche pour la ligne */
}

/* La ligne verticale de fond */
.timeline-line {
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #30363d;
}

/* La barre de progression (s'illumine au scroll) */
.timeline-progress {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 0%; /* Modifié par JS */
    background: var(--accent);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.6);
    transition: height 0.1s linear;
}

/* Le marqueur (rond) sur la ligne */
.step-marker {
    position: absolute;
    left: -38px; /* Aligné avec la ligne */
    top: 5px;
    width: 36px;
    height: 36px;
    background: #0d1117;
    border: 2px solid #30363d;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 1rem;
    z-index: 2;
    transition: all 0.4s ease;
}

/* Quand l'étape devient visible */
.timeline-step.is-visible .step-marker {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
    transform: scale(1.15);
}

/* --- LA CARTE DE CONTENU --- */
.step-card {
    background: #161b22;
    border: 1px solid #30363d;
    padding: 18px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.step-card:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Header de la carte */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: #8b949e;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #30363d;
    font-family: 'Courier New', monospace;
}

.cmd { 
    color: #22c55e; 
    font-weight: 600;
}

.date {
    color: #58a6ff;
    font-weight: 600;
}

.step-card h3 {
    margin: 0 0 10px 0;
    font-size: 1.15rem;
    color: #f1f5f9;
    font-family: 'Courier New', monospace;
}

.step-card p {
    margin: 0 0 12px 0;
    color: #8b949e;
    line-height: 1.6;
    font-size: 0.9rem;
}

/* Liste des détails techniques */
.tech-details {
    list-style: none;
    padding: 0;
    margin: 12px 0;
    font-size: 0.85rem;
    color: #c9d1d9;
}

.tech-details li {
    margin-bottom: 6px;
    padding-left: 20px;
    position: relative;
}

.tech-details li i {
    position: absolute;
    left: 0;
    color: var(--accent);
}

/* Tags inline */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.tags .tag {
    background: rgba(59, 130, 246, 0.15);
    color: #58a6ff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    border: 1px solid rgba(59, 130, 246, 0.3);
    font-family: monospace;
}

/* Entreprises */
.companies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0;
    font-size: 0.85rem;
}

.companies span {
    background: #21262d;
    padding: 4px 8px;
    border-radius: 4px;
    color: #58a6ff;
    border: 1px solid #30363d;
}

.desc-small {
    font-size: 0.85rem !important;
    margin-top: 8px;
}

/* Footer de la modale */
.parcours-footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #30363d;
}

.terminal-btn {
    display: inline-block;
    padding: 12px 24px;
    background: var(--accent);
    color: #0d1117;
    border-radius: 6px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
    text-transform: uppercase;
}

.terminal-btn:hover {
    background: #58a6ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}


/* =========================================
   TIMELINE PARCOURS - CROSSFADE CONTROLLED BY SCROLL
   ========================================= */

/* Terminal theme */
.terminal-theme {
    background: #0d1117 !important;
    border: 1px solid #30363d !important;
}

.terminal-badge {
    display: inline-block;
    background: #161b22;
    color: #58a6ff;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    border: 1px solid #30363d;
    margin-bottom: 15px;
    font-family: monospace;
}

/* Le conteneur de la timeline */
.timeline-wrapper {
    position: relative;
    width: 100%;
}

/* La carte elle-même */
.step-card {
    background: #161b22;
    border: 1px solid #30363d;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.step-card:hover {
    border-color: #58a6ff;
    box-shadow: 0 10px 40px rgba(88, 166, 255, 0.2);
}

/* Header de carte */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: #8b949e;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #30363d;
    font-family: 'Courier New', monospace;
}

.cmd { 
    color: #22c55e; 
    font-weight: 600;
}

.date {
    color: #58a6ff;
    font-weight: 600;
}

/* ASCII Art - ALIGNEMENT CORRIGÉ */
.ascii-art {
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 15px;
    margin: 15px 0;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 10px;
    line-height: 1.2;
    color: #58a6ff;
    white-space: pre; /* Préserve les espaces */
    text-align: left;
}

.step-card h3 {
    margin: 15px 0 10px 0;
    font-size: 1.2rem;
    color: #f1f5f9;
    font-family: 'Courier New', monospace;
}

.step-card p {
    margin: 0 0 15px 0;
    color: #8b949e;
    line-height: 1.6;
    font-size: 0.9rem;
}

/* Footer de la modale */
.parcours-footer {
    text-align: center;
    margin-top: 50px;
    padding: 30px 20px;
}

.terminal-btn {
    display: inline-block;
    padding: 12px 24px;
    background: #58a6ff;
    color: #0d1117;
    border-radius: 6px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
    text-transform: uppercase;
}

.terminal-btn:hover {
    background: #79c0ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(88, 166, 255, 0.4);
}

/* Marqueur (caché) */
.step-marker {
    display: none;
}

/* Responsive */
@media (max-width: 768px) {
    .timeline-step {
        width: 95%;
    }
    
    .step-card {
        padding: 20px;
    }
    
    .ascii-art {
        font-size: 9px;
    }
    
    .parcours-header h2 {
        font-size: 1.5rem;
    }
    
    .overlay-content {
        padding: 20px;
    }
}
