/* ============================================================
   FEUILLE DE STYLE : NANOTECHNOLOGIES
   THÈME : NEURAL / CYBERPUNK (CORRIGÉ & OPTIMISÉ)
============================================================ */

/* ==========================
   1. VARIABLES & RESET
========================== */
:root {
    --primary: #00ffff;       /* Cyan */
    --secondary: #ff00ff;     /* Magenta */
    --accent: #ffff00;        /* Jaune électrique */
    --bg-dark: #0a0a0a;       /* Noir profond */
    --bg-glass: rgba(20, 20, 20, 0.6); /* Verre sombre */
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0; /* Gris clair */
    --neon-qd-1: #00f3ff; /* Cyan néon original */
    --neon-qd-2: #9d00ff; /* Violet néon original */
    --qd-size: 200px;
    
    /* Polices */
    --font-title: 'Orbitron', sans-serif;
    --font-tech: 'Audiowide', sans-serif;
    --font-body: 'Exo 2', sans-serif;
    overflow-x: hidden;
}




html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.7;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    /* Empêche le rebond élastique sur iOS qui permet de voir le vide */
    touch-action: pan-y;
}

/* On force TOUS les conteneurs à ne jamais dépasser 100% */
* {
    max-width: 100%;
    box-sizing: border-box;
}

/* Grille de fond subtile */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 255, 255, 0.03) 2px,
        rgba(0, 255, 255, 0.03) 4px
    );
    pointer-events: none;
    z-index: -1;
}

/* Canvas background */
#neural-bg {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: -2;
    opacity: 0.4;
}

/* ==========================
   2. HEADER UNIFIÉ
========================== */
#unified-navbar {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    background: rgba(10, 10, 10, 0.95);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 255, 255, 0.2);
    z-index: 1000;
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
}

.back-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-family: var(--font-tech);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 8px 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    transition: all 0.3s ease;
}

.back-link:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: rgba(0, 255, 255, 0.1);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.2);
}

.course-anchors {
    display: flex;
    gap: 25px;
}

.course-anchors a {
    color: var(--text-secondary);
    text-decoration: none;
    font-family: var(--font-tech);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s;
    position: relative;
}

.course-anchors a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--secondary);
    transition: width 0.3s;
}

.course-anchors a:hover {
    color: var(--text-primary);
    text-shadow: 0 0 5px var(--primary);
}

.course-anchors a:hover::after {
    width: 100%;
}

.course-header {
    margin-top: 70px;
    padding-top: 40px;
    padding-bottom: 40px;
    text-align: center;
    position: relative;
    background: radial-gradient(circle at top center, rgba(0, 255, 255, 0.08), transparent 60%);
}

/* ==========================
   3. TITRES & TAGS (CORRIGÉ)
========================== */
.glitch {
    font-family: var(--font-title);
    font-size: 4rem;
    font-weight: 900;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 10px;
    position: relative;
    display: inline-block;
    text-shadow: 0 0 20px rgba(0, 255, 255, 0.6);
}

/* Ajout de l'animation manquante */
.glitch:hover {
    animation: text-glitch 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) both infinite;
    color: var(--text-primary);
}

@keyframes text-glitch {
    0% { transform: translate(0); text-shadow: -2px 0 var(--secondary), 2px 0 var(--accent); }
    25% { transform: translate(-2px, 2px); text-shadow: 2px 0 var(--secondary), -2px 0 var(--accent); }
    50% { transform: translate(2px, -2px); text-shadow: -2px 0 var(--secondary), 2px 0 var(--accent); }
    75% { transform: translate(-2px, -2px); text-shadow: 2px 0 var(--secondary), -2px 0 var(--accent); }
    100% { transform: translate(0); text-shadow: -2px 0 var(--secondary), 2px 0 var(--accent); }
}

.subtitle {
    font-family: var(--font-body);
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-top: 20px;
    font-weight: 300;
}

.tech-tag {
    display: inline-block;
    margin: 20px 10px 0 10px;
    padding: 8px 20px;
    border: 1px solid var(--primary);
    color: var(--primary);
    font-family: var(--font-tech);
    font-size: 0.8rem;
    border-radius: 50px;
    background: rgba(0, 255, 255, 0.05);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tech-tag:hover {
    background: var(--primary);
    color: #000;
    box-shadow: 0 0 20px var(--primary);
}

/* ==========================
   4. CONTENU & CARTES
========================== */
.content-block {
    max-width: 1000px;
    margin: 0 auto 100px auto;
    padding: 0 20px;
}

.section-title {
    font-family: var(--font-title);
    font-size: 2rem;
    color: var(--secondary);
    margin-bottom: 40px;
    text-transform: uppercase;
    letter-spacing: 3px;
    border-left: 5px solid var(--primary);
    padding-left: 20px;
    text-shadow: 0 0 15px rgba(255, 0, 255, 0.4);
}

.glass-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
    border: 1px solid rgba(0, 255, 255, 0.15);
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 255, 255, 0.1);
    border-color: rgba(0, 255, 255, 0.3);
}

.glass-card h3 {
    font-family: var(--font-title);
    color: var(--primary);
    font-size: 1.4rem;
    margin-bottom: 20px;
    text-transform: uppercase;
}

.glass-card p {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 1.05rem;
}

.glass-card strong { color: var(--text-primary); }
.glass-card em { color: var(--primary); font-style: normal; }

/* ==========================
   5. GRILLES & LISTES
========================== */
.comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 30px;
}

.highlight-box {
    background: rgba(255, 255, 255, 0.02);
    border-left: 4px solid var(--primary);
    padding: 20px;
    border-radius: 0 10px 10px 0;
    height: 100%;
}

.highlight-box h4 {
    font-family: var(--font-tech);
    margin-bottom: 10px;
    font-size: 1.1rem;
    text-transform: uppercase;
}

.cyber-divider {
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--secondary), transparent);
    width: 60%;
    margin: 40px auto;
    opacity: 0.7;
}

.glass-card ul {
    list-style: none;
    margin-left: 10px;
}

.glass-card ul li {
    margin-bottom: 15px;
    position: relative;
    padding-left: 20px;
    color: var(--text-secondary);
}

.glass-card ul li::before {
    content: '>';
    color: var(--accent);
    position: absolute;
    left: 0;
    font-weight: bold;
    font-family: var(--font-tech);
}

blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 20px;
    margin: 30px 0;
    font-style: italic;
    color: var(--text-primary);
    background: rgba(255, 255, 0, 0.05);
    padding: 20px;
    border-radius: 0 10px 10px 0;
}

/* ==========================
   6. IMAGES & MATHJAX (CORRIGÉ)
========================== */
/* Ciblage plus précis pour éviter de casser les icônes */
.content-block img, 
.glass-card img {
    max-width: 100%;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin: 20px 0;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

mjx-container {
    color: var(--primary) !important;
    font-size: 1.1rem !important;
}

/* ==========================
   7. BOUTONS
========================== */
.neural-btn {
    display: inline-block;
    padding: 15px 40px;
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    font-family: var(--font-tech);
    text-transform: uppercase;
    text-decoration: none;
    font-weight: bold;
    letter-spacing: 2px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
    cursor: pointer;
    z-index: 1;
}

.neural-btn::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: var(--primary);
    transition: left 0.3s;
    z-index: -1;
}

.neural-btn:hover::before { left: 0; }
.neural-btn:hover { color: #000; box-shadow: 0 0 30px var(--primary); }

.neural-btn-small {
    display: inline-block;
    padding: 10px 20px;
    border: 1px solid var(--secondary);
    color: var(--secondary);
    font-family: var(--font-tech);
    text-transform: uppercase;
    font-size: 0.8rem;
    text-decoration: none;
    transition: 0.3s;
}

.neural-btn-small:hover {
    background: var(--secondary);
    color: #000;
    box-shadow: 0 0 15px var(--secondary);
}

/* ==========================
   8. ANIMATIONS (VLS & NANOFILS)
========================== */
/* ==========================
   8. ANIMATIONS VLS AMÉLIORÉES
========================== */
.vls-container {
    display: flex;
    align-items: center;
    gap: 30px;
    padding: 30px !important; /* Un peu plus d'espace */
}

.nanowire-container {
    position: relative;
    width: 120px;
    height: 180px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 3px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: center;
    align-items: flex-end;
    overflow: hidden; /* Important : cache le fil qui dépasse */
    border-radius: 10px;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
}

/* Le Nanofil */
.nanowire {
    width: 24px;
    height: 100%; /* Prend toute la hauteur */
    background: linear-gradient(to right, #00a8cc, #00ffff, #00a8cc); /* Effet cylindrique */
    position: absolute;
    bottom: 0;
    /* L'astuce : on le fait démarrer "sous le sol" avec translateY */
    transform: translateY(100%); 
    animation: growWireSmooth 6s infinite ease-in-out;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.4);
}

/* La Gouttelette Catalyseur */
.droplet {
    position: absolute;
    bottom: 0; /* Position de départ */
    width: 36px;
    height: 36px;
    /* Un dégradé plus riche pour l'or */
    background: radial-gradient(circle at 30% 30%, #fff7cc, #ffd700, #b8860b);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #4a3c00;
    font-weight: 900;
    box-shadow: 0 0 20px #ffd700, inset 0 0 5px #fff;
    z-index: 2; /* Doit être au-dessus du fil */
    animation: moveAndPulseDroplet 6s infinite ease-in-out;
}

/* Animation combinée de la goutte : mouvement + pulsation */
@keyframes moveAndPulseDroplet {
    0% {
        transform: translateY(0) scale(1);
    }
    50% {
        /* Elle monte et grossit légèrement car elle absorbe des atomes */
        transform: translateY(-140px) scale(1.15);
        box-shadow: 0 0 30px #ffd700; /* Brille plus fort */
    }
    85% {
         transform: translateY(-140px) scale(1.15);
         opacity: 1;
    }
    100% {
        /* Disparition douce à la fin du cycle */
        transform: translateY(-140px) scale(1);
        opacity: 0;
    }
}

/* Animation fluide du fil */
@keyframes growWireSmooth {
    0% {
        transform: translateY(100%); /* Caché sous le sol */
    }
    50% {
        transform: translateY(40px); /* Pousse jusqu'en haut (ajusté selon la taille de la goutte) */
    }
    85% {
         transform: translateY(40px);
         opacity: 1;
    }
    100% {
        transform: translateY(40px);
        opacity: 0; /* Reset */
    }
}

/* ==========================
   9. BARRES DE PROGRESSION
========================== */
.progress-group { margin-bottom: 15px; }
.progress-group label { display: block; margin-bottom: 5px; color: var(--text-primary); }
.progress-bar {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    overflow: hidden;
}
.fill {
    height: 25px;
    background: var(--accent);
    color: #000;
    font-size: 0.8em;
    font-weight: bold;
    display: flex;
    align-items: center;
    padding-left: 10px;
    transition: width 1s ease-in-out;
    /* --- AJOUTEZ CES 3 LIGNES --- */
    white-space: nowrap;      /* Force le texte sur une seule ligne (Vital !) */
    min-width: fit-content;   /* La barre s'agrandira si le texte est trop long */
    padding-right: 10px;      /* Un peu d'espace à droite pour l'élégance */
}
.glitch-bar {
    background: linear-gradient(90deg, var(--accent), #fff);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0% { opacity: 0.8; }
    50% { opacity: 1; }
    100% { opacity: 0.8; }
}

/* ==========================
   10. GLOBAL RESPONSIVE (UNIFIÉ)
========================== */
/* Point de rupture unique à 900px pour éviter les conflits */
@media (max-width: 900px) {
    /* Header (Déplacé ici pour centraliser) */
    #unified-navbar {
        flex-direction: column;
        height: auto;
        padding: 15px;
        gap: 15px;
    }
    .course-anchors {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
        font-size: 0.7rem;
    }
    .course-header {
        margin-top: 120px;
    }
    
    /* Contenu */
    .glitch { font-size: 2.5rem; letter-spacing: 5px; }
    .comparison-grid { grid-template-columns: 1fr; }
    .section-title { font-size: 1.5rem; }
    .vls-container { flex-direction: column; text-align: center; }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 40px;
    }
    .social-links { justify-content: center; }
}


/* ==========================
   11. FOOTER (NETTOYÉ)
========================== */
#neural-footer {
    background: linear-gradient(to bottom, #050505, #000);
    border-top: 1px solid rgba(0, 255, 255, 0.3);
    position: relative;
    padding: 80px 20px 30px;
    margin-top: 100px;
    
    /* SUPPRIMEZ OU COMMENTEZ CETTE LIGNE : */
    /* overflow: hidden; */ 
    
    /* Pour être sûr que ça dépasse, on peut ajouter ceci (optionnel mais recommandé) : */
    overflow: visible;
}

#neural-footer::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), var(--secondary), transparent);
    box-shadow: 0 0 15px var(--primary);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

.footer-section h3 {
    font-family: var(--font-tech);
    /* color: #fff;  <-- SUPPRIMÉ (car le gradient remplace la couleur) */
    font-size: 1.2rem;
    margin-bottom: 25px;
    letter-spacing: 1px;
    text-transform: uppercase;

    /* AJOUT DU GRADIENT */
    background: linear-gradient(90deg, var(--primary), var(--secondary), #a75efa);
    background-size: 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    
    display: inline-block; /* Important pour que le gradient colle au texte */
}

.footer-links { list-style: none; padding: 0; }
.footer-links li { margin-bottom: 12px; }

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.3s;
    display: inline-block;
}

.footer-links a:hover {
    color: var(--primary);
    transform: translateX(5px);
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.4);
}

.contact-text {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.social-btn {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    position: relative;
    z-index: 5;
}

/* Réinitialisation propre des images dans les boutons */
.social-btn img {
    width: 20px;
    height: 20px;
    filter: grayscale(100%) brightness(200%);
    transition: 0.3s;
    border: none;
    box-shadow: none;
    margin: 0;
    border-radius: 0;
}

.social-btn:hover { transform: translateY(-3px); }
.social-btn:hover img { filter: none; }

.footer-bottom {
    text-align: center;
    margin-top: 50px;
    color: #555;
    font-size: 0.8rem;
}

.cyber-line {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    margin-bottom: 20px;
}

/* --- BOUTON RETOUR EN HAUT --- */
/* --- BOUTON RETOUR EN HAUT --- */
.back-to-top {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    
    /* --- CORRECTION ICI --- */
    /* On remplace "var(--bg-dark)" par une couleur opaque */
    background: #0a0a0a;  
    
    border: 1px solid var(--primary);
    color: var(--primary);
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    text-decoration: none;
    transition: 0.3s;
    font-weight: bold;
    z-index: 10;
}

.back-to-top i {
    transform: rotate(-45deg); /* Contre-rotation si vous avez une icône à l'intérieur */
}

.back-to-top:hover {
    background: var(--primary);
    color: #000;
    box-shadow: 0 0 15px var(--primary);
}

/* --- EFFETS DE SURVOL HARMONISÉS AVEC LES SKILLS --- */
/* (Code unique et définitif pour les boutons sociaux) */

/* GitHub -> Couleur Cyan (Maths) */
.social-btn.github:hover { 
    border-color: #00ffff; 
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.6); 
    background: rgba(0, 255, 255, 0.05);
}

/* LinkedIn -> Couleur Indigo (Informatique) */
.social-btn.linkedin:hover { 
    border-color: #6c69ff; 
    box-shadow: 0 0 20px rgba(108, 105, 255, 0.6); 
    background: rgba(108, 105, 255, 0.05);
}

/* Instagram -> Couleur Magenta (Physique) */
.social-btn.instagram:hover { 
    border-color: #e45ae9; 
    box-shadow: 0 0 20px rgba(228, 90, 233, 0.6); 
    background: rgba(228, 90, 233, 0.05);
}

/* YouTube -> Couleur Jaune/Orange (Ingénierie) */
.social-btn.youtube:hover { 
    border-color: #d69656; 
    box-shadow: 0 0 20px rgba(214, 150, 86, 0.6); 
    background: rgba(214, 150, 86, 0.05);
}
/* On augmente Instagram */
.social-btn.instagram img {
    width: 40px !important;  /* Était à 20px */
    height: 40px !important;
}

/* On augmente YouTube (souvent besoin d'être encore plus grand) */
.social-btn.youtube img {
    width: 40px !important;  /* Était à 20px */
    height: 40px !important;
}

/* --- CONTENEUR --- */
/* ============================================================
   ANIMATION DICHROÏQUE - MOBILE & DESKTOP (CORRIGÉ)
============================================================ */

/* --- CONTENEUR --- */
.dichroic-container {
    position: relative;
    height: 280px; /* Espace pour le mouvement */
    background: radial-gradient(circle, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.9) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    overflow: hidden;
    margin-top: 20px;
}

/* Ligne de sol décorative */
.dichroic-container::before {
    content: ''; position: absolute; top: 50%; left: 0; width: 100%; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent); z-index: 0;
}

/* --- SOURCE LUMINEUSE (Fixe) --- */
.light-source {
    position: absolute; top: 60%; left: 20px; transform: translateY(-50%); z-index: 5;
    background: rgba(20,20,20,0.9); padding: 6px 10px; border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.2); font-family: var(--font-tech); font-size: 0.75rem; color: #fff;
}

/* --- PARTICULE CENTRALE (Votre Design) --- */
.nano-gold-particle {
    width: 120px; height: 120px;
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    border-radius: 50%; z-index: 10; cursor: pointer; transition: all 0.5s ease;
    
    /* OR par défaut */
    background: radial-gradient(circle at 30% 30%, #fff7cc 0%, #ffd700 20%, #b8860b 60%, #5c3a00 100%);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.3), inset -10px -10px 20px rgba(0,0,0,0.5);
    border: 2px solid #ffd700;
}

.particle-core {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.5);
    width: 60%; height: 60%; border-radius: 50%; background: #fff; opacity: 0; transition: 0.6s;
}
.particle-glare {
    position: absolute; top: 15%; left: 15%; width: 25%; height: 25%; border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.9), transparent 70%); opacity: 1; transition: 0.4s;
}
.reflection-text, .transmission-text {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    font-size: 0.7rem; font-weight: bold; pointer-events: none; width: 100%; text-align: center;
}
.reflection-text { color: #3a2500; display: block; text-shadow: 0 1px 0 rgba(255,255,255,0.4); }
.transmission-text { color: #e0b0ff; display: none; text-shadow: 0 0 10px #e0b0ff; }

/* --- OBSERVATEUR (Mobile) --- */
.eye-observer {
    position: absolute; z-index: 6;
    background: #000; padding: 6px 10px; border-radius: 20px;
    font-family: var(--font-tech); font-size: 0.75rem; color: #fff;
    border: 1px solid var(--accent); box-shadow: 0 0 15px var(--accent);
    /* Transition fluide pour le mouvement */
    transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    
    /* POSITION 1 : GAUCHE (Réflexion) */
    top: 20%; left: 20%;
}

/* --- RAYONS LASER --- */
.ray { position: absolute; height: 4px; z-index: 1; border-radius: 2px; transition: all 0.4s ease; }

/* 1. Incident (Blanc Ivoire) */
.incident {
    left: 60px; top: 60%;
    width: calc(50% - 115px); /* S'arrête à la surface */
    background: #fffdf2; box-shadow: 0 0 8px rgba(255,255,255,0.8);
    transform-origin: right center; transform: translateY(-50%) rotate(-15deg);
}

/* 2. Réfléchi (Or) */
/* 2. Réfléchi (Or) - VERSION RENFORCÉE */
.reflected {
    left: calc(50% - 55px); top: 50%;
    width: 40%;
    
    /* NOUVEAU DÉGRADÉ : Plus riche. Part d'un doré intense (#ffbf00) vers le jaune néon, puis transparent */
    background: linear-gradient(to left, #ffbf00, var(--accent) 50%, transparent);
    
    /* NOUVEAU HALO : Double couche de lumière pour un effet "puissant" */
    box-shadow: 0 0 8px var(--accent), 0 0 25px rgba(255, 255, 0, 0.7);
    
    transform-origin: left center; transform: translateY(-50%) rotate(220deg);
    opacity: 1;
    z-index: 2; /* On le met un peu au-dessus pour qu'il brille bien */
}

/* 3. Transmis (Violet) */
.transmitted {
    left: calc(50% + 55px); top: 55%; /* Part de la surface droite */
    width: 0; opacity: 0;
    background: linear-gradient(90deg, var(--secondary), transparent);
    box-shadow: 0 0 15px var(--secondary);
    transform-origin: left center; transform: translateY(-50%) rotate(-15deg);
}

/* =================================================================
   LOGIQUE D'ACTIVATION (Mobile & Desktop)
   On applique la classe .active-mode sur le CONTENEUR parent
================================================================= */

/* 1. Changement Particule */
.dichroic-container.active-mode .nano-gold-particle,
.dichroic-container.hover-state .nano-gold-particle {
    background: radial-gradient(circle, rgba(138, 43, 226, 0.1), rgba(0, 0, 255, 0.05));
    border: 1px solid rgba(138, 43, 226, 0.8);
    box-shadow: 0 0 50px rgba(138, 43, 226, 0.6);
    backdrop-filter: blur(3px);
    transform: translate(-50%, -50%) scale(1.1);
}
.dichroic-container.active-mode .particle-core, .dichroic-container.hover-state .particle-core {
    opacity: 0.9; animation: corePulse 1.5s infinite alternate; background: radial-gradient(circle, #fff 0%, #e0b0ff 50%, transparent 100%);
}
.dichroic-container.active-mode .particle-glare, .dichroic-container.hover-state .particle-glare { opacity: 0; }
.dichroic-container.active-mode .reflection-text, .dichroic-container.hover-state .reflection-text { display: none; }
.dichroic-container.active-mode .transmission-text, .dichroic-container.hover-state .transmission-text { display: block; }

/* 2. Rayons (Switch) */
.dichroic-container.active-mode .reflected, .dichroic-container.hover-state .reflected { width: 0; opacity: 0; }
.dichroic-container.active-mode .transmitted, .dichroic-container.hover-state .transmitted { width: 35%; opacity: 1; }

/* 3. Observateur (Déplacement vers la droite) */
.dichroic-container.active-mode .eye-observer, 
.dichroic-container.hover-state .eye-observer {
    top: 50%; left: 80%; /* Arrive à droite, au bout du rayon violet */
    border-color: var(--secondary); box-shadow: 0 0 15px var(--secondary);
}

@keyframes corePulse {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0.6; }
    100% { transform: translate(-50%, -50%) scale(0.8); opacity: 1; box-shadow: 0 0 40px #e0b0ff; }
}

/* --- STYLE HUD POUR L'EXPLICATION --- */
#demo-explanation {
    font-family: var(--font-body); font-size: 0.9rem; color: var(--text-secondary);
    margin-top: 25px; padding: 20px; background: rgba(10, 10, 10, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1); border-left: 4px solid var(--accent); border-radius: 0 10px 10px 0;
    min-height: 140px; display: flex; flex-direction: column; justify-content: center; gap: 8px;
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
}
#demo-explanation.active-border { border-left-color: var(--secondary); box-shadow: 0 5px 20px rgba(138, 43, 226, 0.2); }
.hud-line { display: flex; align-items: baseline; gap: 15px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); padding-bottom: 6px; }
.hud-line:last-child { border-bottom: none; }
.hud-label { font-family: var(--font-tech); font-size: 0.75rem; color: rgba(255, 255, 255, 0.6); width: 110px; min-width: 110px; white-space: nowrap; text-align: right; letter-spacing: 1px; }
.hud-value { font-family: var(--font-tech); font-weight: bold; text-transform: uppercase; letter-spacing: 1px; }
.hud-desc { color: #e0e0e0; line-height: 1.4; }

/* --- ADAPTATION MOBILE (Responsive) --- */
@media (max-width: 768px) {
    .dichroic-container { height: 260px; }
    .light-source { left: 10px; font-size: 0.65rem; padding: 4px; }
    .eye-observer { font-size: 0.65rem; padding: 4px; }
    .nano-gold-particle { width: 100px; height: 100px; }
    
    /* Rayons plus courts sur mobile */
    .incident { left: 45px; width: calc(50% - 95px); } 
    .reflected { left: calc(50% - 45px); width: 35%; transform: rotate(230deg); } /* Angle pour viser le coin */
    
    /* Position Départ (Haut Gauche) */
    .eye-observer { top: 10%; left: 10%; } 
    
    /* État Activé Mobile */
    .dichroic-container.active-mode .eye-observer {
        top: 80%; left: 60%; /* Arrivée (Bas Droite) */
    }
    .dichroic-container.active-mode .transmitted {
        width: 30%; transform: rotate(45deg); /* Vise le bas droite */
    }
    
    /* HUD Mobile */
    .hud-line { flex-direction: column; gap: 2px; margin-bottom: 8px; }
    .hud-label { width: 100%; text-align: left; color: var(--primary); }
    #demo-explanation { min-height: auto; padding: 15px; }
}


/* --- STYLE TRANSISTORS (TON DESIGN ORIGINAL) --- */
.transistor-visuals {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin: 30px 0;
}

.transistor-card {
    background: rgba(255, 255, 255, 0.02);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid rgba(0, 255, 255, 0.1);
    /* On s'assure que le contenu ne déborde pas */
    display: flex;
    flex-direction: column;
    align-items: center;
}

.transistor-card svg {
    width: 100%;
    height: auto;
    /* On ajoute de l'espace interne en bas du SVG pour le texte */
    padding-bottom: 10px; 
    overflow: visible;
}

/* --- SOLUTION AU CHEVAUCHEMENT : DÉCALAGE DU TEXTE --- */
.transistor-card svg text {
    /* On force le texte à descendre de 5 pixels par rapport à sa position y="75" */
    transform: translateY(5px);
    font-family: var(--font-tech);
    fill: var(--text-secondary);
    font-weight: bold;
}

.transistor-card p {
    font-size: 0.8rem;
    margin-top: 15px; /* On augmente la marge pour séparer du titre du SVG */
    color: var(--text-secondary);
}

/* --- ADAPTATION MOBILE ET TABLETTE --- */
@media (max-width: 900px) {
    .transistor-visuals {
        grid-template-columns: 1fr; /* Empilement pour éviter l'écrasement horizontal */
        max-width: 320px;
        margin: 30px auto;
        gap: 25px;
    }

    .transistor-card svg {
        max-width: 200px; /* On limite la taille pour que le texte reste net */
    }
}

.neon-svg {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 0 5px var(--primary)); /* Effet néon global sur le SVG */
}

/* Responsive pour les transistors */
@media (max-width: 768px) {
    .transistor-visuals {
        grid-template-columns: 1fr;
    }
}

/* --- CONTENEUR GLOBAL --- */
.gap-simulator-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    font-family: var(--font-body);
}

@media (max-width: 768px) {
    .gap-simulator-container { grid-template-columns: 1fr; }
}

.gap-scene {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 10px;
    height: 300px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}

.scene-header {
    text-align: center;
    font-family: var(--font-tech);
    color: var(--text-primary);
    font-size: 0.9rem;
    margin-bottom: 5px;
}

/* --- BANDES D'ÉNERGIE --- */
.band {
    height: 30px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.6);
    text-transform: uppercase;
}
.conduction {
    border-bottom: 2px solid var(--primary); /* Cyan */
    background: linear-gradient(to bottom, rgba(0, 255, 255, 0.1), transparent);
}
.valence {
    border-top: 2px solid var(--secondary); /* Magenta */
    background: linear-gradient(to top, rgba(255, 0, 255, 0.1), transparent);
    z-index: 2; /* Pour que le trou soit visible */
}

/* --- ZONE D'ANIMATION CENTRALE --- */
.animation-stage {
    flex-grow: 1;
    position: relative;
}

/* --- ACTEURS (ÉLECTRON & TROU) --- */
.animation-stage .hole {
    position: absolute;
    bottom: 0; left: 50%;
    transform: translateX(-50%);
    width: 20px; height: 20px;
    border: 2px solid var(--secondary);
    border-radius: 50%;
    color: var(--secondary);
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: bold;
    box-shadow: 0 0 10px var(--secondary);
    z-index: 1;
}

/* --- CONFIGURATION DE L'ÉLECTRON (BASE) --- */
.animation-stage .electron-particle {
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 20px; height: 20px;
    background: var(--primary);
    border-radius: 50%;
    color: #000;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: bold;
    box-shadow: 0 0 15px var(--primary);
    z-index: 10;
    
    /* Animation : Saut Quantique Rapide */
    animation: quantumJump 4s infinite cubic-bezier(0.6, -0.28, 0.735, 0.045);
}

/* --- SCÉNARIO 1 : GAP DIRECT (LUMIÈRE) --- */

.photon-group {
    position: absolute;
    bottom: 10px; left: 50%;
    opacity: 0;
    transform: translate(-50%, 0) scale(0); /* Invisible au départ */
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
    
    /* Animation : Explosion synchronisée avec l'impact */
    animation: photonExplosion 4s infinite;
}

.photon-wave {
    width: 40px; height: 15px;
    filter: drop-shadow(0 0 5px yellow);
}

.photon-label {
    color: #ffff00;
    font-family: var(--font-tech);
    font-size: 12px;
    margin-top: 5px;
    text-shadow: 0 0 10px #ffff00;
}

/* --- KEYFRAMES GAP DIRECT --- */

/* L'électron tombe et meurt à l'impact */
@keyframes quantumJump {
    0%, 20% { 
        top: 0; 
        opacity: 1; 
        transform: translateX(-50%) scale(1);
    }
    35% { 
        /* Juste avant l'impact */
        top: 85%; 
        opacity: 1; 
        transform: translateX(-50%) scale(1);
    }
    36% { 
        /* IMPACT ! Disparition immédiate (transfert d'énergie) */
        top: 90%; 
        opacity: 0; 
        transform: translateX(-50%) scale(0.1);
    }
    100% { 
        top: 90%; 
        opacity: 0; 
    }
}

/* Le photon naît exactement à 36% (moment de la mort de l'électron) */
@keyframes photonExplosion {
    0%, 35% { 
        opacity: 0; 
        transform: translate(-50%, 0) scale(0);
    }
    36% { 
        /* FLASH INSTANTANÉ */
        opacity: 1; 
        transform: translate(-50%, 0) scale(1.5);
    }
    45% {
        /* Il commence à s'envoler */
        transform: translate(60px, -80px) scale(1) rotate(-15deg);
        opacity: 0.8;
    }
    65%, 100% { 
        /* Disparition au loin */
        transform: translate(120px, -150px) scale(0.5) rotate(-30deg);
        opacity: 0; 
    }
}

/* =========================================
   SCÉNARIO 2 : GAP INDIRECT (CORRIGÉ : NET & NERVEUX)
   ========================================= */
/* =========================================
   SCÉNARIO 2 : GAP INDIRECT (TIMING ESPACÉ & VIOLENT)
   ========================================= */

.electron-particle.indirect-path {
    animation: phononCrashSpaced 4s infinite linear;
    transform-origin: center center;
}

.phonon-vibration {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-secondary);
    font-size: 10px;
    opacity: 0;
    white-space: nowrap;
    /* Synchronisé parfaitement avec les chocs espacés */
    animation: textShockSpaced 4s infinite;
}

.heat-haze {
    position: absolute;
    bottom: 0; left: 0; right: 0; top: 50%;
    background: radial-gradient(circle at bottom center, rgba(255, 0, 0, 0.5), transparent 70%);
    display: flex; align-items: center; justify-content: center;
    color: #ff0000;
    font-family: var(--font-tech);
    font-weight: bold;
    font-size: 1.2rem;
    opacity: 0;
    text-shadow: 3px 3px 0px #800000;
    /* Déclenchement retardé pour coller à la fin de la chute */
    animation: heatFlashDelayed 4s infinite;
}

/* --- KEYFRAMES ESPACÉS --- */

/* --- 1. MOUVEMENT DE LA PARTICULE (Alignement Strict) --- */
@keyframes phononCrashSpaced {
    0% { top: 0; left: 50%; opacity: 1; transform: translateX(-50%) rotate(0deg); background: var(--primary); }
    
    /* --- APPROCHE MUR 1 (0% -> 14.9%) --- */
    /* Elle tombe vers la gauche */
    14.9% { top: 30%; left: 35%; transform: translateX(-50%) rotate(0deg); background: var(--primary); }

    /* --- IMPACT 1 (15% PILE) --- */
    15.0% { 
        top: 30%; left: 35%;
        transform: translate(-60%, -5px) rotate(-45deg) scale(1.3); /* Gros Flash */
        background: #fff; 
    }
    15.5% { transform: translate(-40%, 5px) rotate(45deg); background: #ff0000; }
    16.0% { transform: translate(-65%, 0px) rotate(-90deg); background: #fff; }
    17.0% { transform: translate(-50%, -10px) rotate(0deg); background: #fff; }
    
    20%   { transform: translateX(-50%) rotate(0deg); background: var(--primary); }

    /* --- TRANSITION (20% -> 49.9%) --- */
    /* Elle traverse vers la droite. Notez le 49.9% pour qu'elle arrive pile au moment du flash */
    49.9% { top: 60%; left: 65%; transform: translateX(-50%) rotate(0deg); background: var(--primary); }

    /* --- IMPACT 2 (50% PILE) --- */
    50.0% { 
        top: 60%; left: 65%;
        transform: translate(-30%, -10px) rotate(60deg) scale(1.5); /* Énorme Flash */
        background: #fff; 
    }
    50.5% { transform: translate(-70%, 10px) rotate(-60deg) scale(0.6); background: #ff0000; }
    51.0% { transform: translate(-40%, -5px) rotate(120deg) scale(1.3); background: #fff; }
    51.5% { transform: translate(-60%, 5px) rotate(-120deg) scale(0.8); background: #ff0000; }
    52.0% { transform: translate(-50%, 0) rotate(180deg) scale(1.1); background: #fff; }
    
    55%   { transform: translateX(-50%) scale(1) rotate(0deg); background: var(--primary); }

    /* --- CHUTE FINALE --- */
    69% { top: 90%; left: 50%; opacity: 1; transform: translateX(-50%); }
    70% { opacity: 0; }
    100% { opacity: 0; }
}

/* --- 2. APPARITION TEXTE (Synchro Parfaite) --- */
@keyframes textShockSpaced {
    /* --- DÉBUT --- */
    0%, 14.9% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
    
    /* --- CHOC 1 (15% PILE) --- */
    15.0% { 
        opacity: 1; 
        color: #fff; 
        transform: translate(-50%, -60%) scale(1.4); /* POP */
        text-shadow: 0 0 10px #fff;
    }
    16.0% { 
        color: #ff0000; 
        transform: translate(-50%, -50%) scale(1.1); 
        text-shadow: none;
    }
    
    /* Lecture calme jusqu'à 30% */
    30% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    35% { opacity: 0; transform: translate(-50%, -40%); }

    /* --- PAUSE --- */
    49.9% { opacity: 0; }

    /* --- CHOC 2 (50% PILE) --- */
    50.0% { 
        opacity: 1; 
        color: #fff; 
        transform: translate(-50%, -60%) scale(1.5); /* RE-POP */
        text-shadow: 0 0 10px #fff;
    }
    51.0% { 
        color: #ff0000; 
        transform: translate(-50%, -50%) scale(1.1); 
        text-shadow: none;
    }
    
    /* Lecture calme jusqu'à 65% */
    65% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    
    70% { opacity: 0; }
    100% { opacity: 0; }
}

@keyframes heatFlashDelayed {
    0%, 69% { opacity: 0; transform: scale(1) skewX(0deg); }
    
    /* La chaleur arrive à 70% (après la chute complète) */
    70% { opacity: 1; transform: scale(1.1) skewX(-20deg); }
    71% { transform: scale(1.1) skewX(20deg); }
    72% { transform: scale(1.1) skewX(-10deg); }
    75% { transform: scale(1) skewX(0deg); }
    
    85% { opacity: 0; }
    100% { opacity: 0; }
}

/* =========================================
   RESPONSIVE DESIGN (MOBILE & TABLETTE)
   ========================================= */

@media (max-width: 900px) {

    /* 1. ON EMPILE LES SIMULATEURS (Gap Simulator) */
    .gap-simulator-container {
        grid-template-columns: 1fr; /* Une seule colonne */
        gap: 40px; /* Plus d'espace entre les deux boîtes pour bien séparer */
    }

    /* On réduit un peu la hauteur sur mobile pour que ça rentre mieux dans l'écran */
    .gap-scene {
        height: 250px; 
    }

    /* On grossit un peu le texte des particules pour la lisibilité tactile */
    .electron-particle, .hole {
        width: 25px; height: 25px; /* Cibles plus grosses */
        font-size: 14px;
    }

    .phonon-vibration {
        font-size: 12px; /* Texte plus lisible */
    }

    /* 2. ON EMPILE LES TRANSISTORS (Section III) */
    .transistor-visuals {
        grid-template-columns: 1fr;
        max-width: 400px; /* Pour ne pas qu'ils soient trop larges sur tablette */
        margin: 0 auto;
    }
    
    .transistor-card {
        margin-bottom: 20px;
    }

    
    
    /* 4. AJUSTEMENT DES TITRES */
    .glitch {
        font-size: 2.5rem; /* Titre NANOTECH plus petit */
        letter-spacing: 5px;
    }
    
    .section-title {
        font-size: 1.5rem; /* Titres de section plus petits */
    }
}


/* --- PANNEAU LÉGENDE STYLE HUD --- */
.legend-panel {
    margin-top: 20px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 4px solid var(--primary); /* Bordure Cyan à gauche */
    border-radius: 0 10px 10px 0; /* Arrondi seulement à droite */
    padding: 20px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

/* Titre du panneau */
.legend-header {
    font-family: var(--font-tech);
    color: var(--primary);
    font-size: 0.8rem;
    letter-spacing: 2px;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Le petit triangle qui clignote */
.blink-symbol {
    animation: blinkText 1s infinite;
    font-size: 0.7rem;
}

@keyframes blinkText {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Grille 2 colonnes pour les items */
.legend-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Un élément de légende */
.legend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
}

/* Les icônes rondes ou stylisées */
.tech-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-family: var(--font-tech);
    font-size: 12px;
    font-weight: bold;
    flex-shrink: 0; /* Empêche l'icône de s'écraser */
}

/* Styles spécifiques aux icônes */
.tech-icon.electron {
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid var(--primary);
    color: var(--primary);
    box-shadow: 0 0 5px var(--primary);
}

.tech-icon.hole {
    background: rgba(255, 0, 255, 0.1);
    border: 1px solid var(--secondary);
    color: var(--secondary);
    box-shadow: 0 0 5px var(--secondary);
}

.tech-icon.photon {
    background: transparent;
    border: 1px dashed #ffff00;
    color: #ffff00;
    text-shadow: 0 0 5px #ffff00;
}

.tech-icon.phonon {
    background: transparent;
    border: 1px dotted #ff4444;
    color: #ff4444;
}

/* La petite note en bas */
.legend-note {
    margin-top: 15px;
    font-size: 0.8rem;
    color: #666;
    font-style: italic;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 10px;
}

.note-label {
    color: var(--primary);
    font-family: var(--font-tech);
    font-style: normal;
    margin-right: 5px;
}

/* RESPONSIVE : Sur mobile, on passe en 1 colonne */
@media (max-width: 600px) {
    .legend-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}
/* =========================================
   QUANTUM DOT INTERACTIF (HYPERCUBE)
   Version Finale Sans Erreurs
   ========================================= */

.qd-wrapper {
    position: relative;
    width: 300px;
    height: 300px;
    perspective: 1000px;
    margin: 20px auto;
    z-index: 10; 
    /* --- AJOUTER CECI --- */
    overflow: visible; /* Laisser la 3D respirer à l'intérieur */
    max-width: 100vw;  /* Mais interdire de dépasser du téléphone */
}

/* On force la section qui contient le cube à être hermétique */
#structures {
    overflow: hidden;
    width: 100%;
}

/* Trackers de souris */
.qd-tracker {
    position: absolute;
    z-index: 50;
    width: 33.33%;
    height: 33.33%;
}

/* La Scène */
.qd-scene {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: qd-float 4s ease-in-out infinite;
    pointer-events: none;
}

/* Interaction Hover */
.tr-1:hover ~ .qd-scene { transform: rotateX(20deg) rotateY(-20deg); }
.tr-2:hover ~ .qd-scene { transform: rotateX(20deg) rotateY(0deg); }
.tr-3:hover ~ .qd-scene { transform: rotateX(20deg) rotateY(20deg); }
.tr-4:hover ~ .qd-scene { transform: rotateX(0deg) rotateY(-20deg); }
.tr-5:hover ~ .qd-scene { transform: rotateX(0deg) rotateY(0deg) scale(1.1); }
.tr-6:hover ~ .qd-scene { transform: rotateX(0deg) rotateY(20deg); }
.tr-7:hover ~ .qd-scene { transform: rotateX(-20deg) rotateY(-20deg); }
.tr-8:hover ~ .qd-scene { transform: rotateX(-20deg) rotateY(0deg); }
.tr-9:hover ~ .qd-scene { transform: rotateX(-20deg) rotateY(20deg); }

/* --- CUBE EXTERNE (200px) --- */
.qd-cube {
    width: 160px;
    height: 160px;
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    transform-style: preserve-3d;
    animation: qd-spin 15s linear infinite;
}

.qd-face {
    position: absolute;
    width: 160px;
    height: 160px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.2);
    backface-visibility: visible;
    mix-blend-mode: screen;
}

/* Hachures Laser */
.qd-face::after {
    content: "";
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(0, 243, 255, 0.05) 10px,
        rgba(0, 243, 255, 0.05) 20px
    ); /* Parenthèse corrigée ici */
    animation: hachure-scroll 20s linear infinite;
}

/* Couleurs alternées */
.qd-face.front, .qd-face.right, .qd-face.top { border-color: var(--neon-qd-1); }
.qd-face.back, .qd-face.left, .qd-face.bottom { border-color: var(--neon-qd-2); }

/* 3. Ajuster la géométrie (La moitié de la nouvelle taille : 160/2 = 80px) */
/* C'est l'étape la plus importante pour que le cube reste fermé */
.qd-face.front  { transform: translateZ(80px); }
.qd-face.back   { transform: rotateY(180deg) translateZ(80px); }
.qd-face.right  { transform: rotateY(90deg) translateZ(80px); }
.qd-face.left   { transform: rotateY(-90deg) translateZ(80px); }
.qd-face.top    { transform: rotateX(90deg) translateZ(80px); }
.qd-face.bottom { transform: rotateX(-90deg) translateZ(80px); }

/* --- CUBE INTERNE (Électron / 80px) --- */
.qd-inner-cube {
    width: 80px;
    height: 80px;
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    transform-style: preserve-3d;
    animation: qd-spin-reverse 10s linear infinite;
}

.qd-i-face {
    position: absolute;
    width: 80px;
    height: 80px;
    border: 2px solid white;
    background: rgba(157, 0, 255, 0.2);
    box-shadow: 0 0 30px var(--neon-qd-2), inset 0 0 20px var(--neon-qd-1);
    opacity: 0.7;
}

/* Placement Géo Interne */
.i-front  { transform: translateZ(40px); }
.i-back   { transform: rotateY(180deg) translateZ(40px); }
.i-right  { transform: rotateY(90deg) translateZ(40px); }
.i-left   { transform: rotateY(-90deg) translateZ(40px); }
.i-top    { transform: rotateX(90deg) translateZ(40px); }
.i-bottom { transform: rotateX(-90deg) translateZ(40px); }

/* Particule Électron */
.qd-electron-particle {
    position: absolute;
    top: 50%; left: 50%;
    width: 15px; height: 15px;
    background: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 20px #fff, 0 0 40px var(--secondary);
    animation: qd-pulse 1s infinite alternate;
}

/* --- ANIMATIONS --- */
@keyframes qd-spin {
    from { transform: translate(-50%, -50%) rotateX(0) rotateY(0); }
    to { transform: translate(-50%, -50%) rotateX(360deg) rotateY(360deg); }
}
@keyframes qd-spin-reverse {
    from { transform: translate(-50%, -50%) rotateX(360deg) rotateY(360deg); }
    to { transform: translate(-50%, -50%) rotateX(0) rotateY(0); }
}
@keyframes qd-pulse {
    from { transform: translate(-50%, -50%) scale(0.8); opacity: 0.7; }
    to { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
}
@keyframes hachure-scroll {
    from { background-position: 0 0; }
    to { background-position: 40px 40px; }
}
.tech-title-v2 {
    position: relative;
    z-index: 20;
    font-family: var(--font-tech); /* Audiowide */
    font-size: 1.1rem;
    letter-spacing: 4px;
    color: var(--primary);
    text-transform: uppercase;
    padding: 10px 25px;
    margin-bottom: 30px;
    background: rgba(0, 255, 255, 0.05);
    border-left: 3px solid var(--primary);
    display: inline-block;
    overflow: hidden; /* Pour contenir le scan */
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

/* L'effet de balayage lumineux (Scanner) */
.title-scanner {
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg, 
        transparent, 
        rgba(0, 255, 255, 0.2), 
        transparent
    );
    animation: scanTitle 3s infinite linear;
}

/* Décoration de coin (petit angle futuriste) */
.tech-title-v2::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 10px;
    height: 10px;
    border-top: 2px solid var(--secondary);
    border-right: 2px solid var(--secondary);
}

@keyframes scanTitle {
    0% { left: -100%; }
    100% { left: 200%; }
}

/* Petit effet au survol du titre */
.tech-title-v2:hover {
    color: #fff;
    background: rgba(0, 255, 255, 0.15);
    transition: 0.3s;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.2);
}
/* =========================================
   RESPONSIVE : QUANTUM DOT & TITRE HUD
   ========================================= */

@media (max-width: 768px) {
    /* 1. On réduit la taille du titre pour mobile */
    .tech-title-v2 {
        font-size: 0.9rem;
        letter-spacing: 2px;
        padding: 8px 15px;
        width: 90%; /* Pour éviter que le texte ne touche les bords */
    }

    /* 2. On réduit l'échelle globale du cube pour les tablettes */
    .qd-wrapper {
        transform: scale(0.85);
        margin: 10px auto;
    }
    
    /* 3. On désactive les trackers sur mobile (le hover n'existe pas) */
    .qd-tracker {
        display: none;
    }
}

@media (max-width: 480px) {
    /* 4. On réduit encore plus l'échelle pour les petits téléphones (iPhone SE, etc.) */
    .qd-wrapper {
        transform: scale(0.65);
        height: 220px; /* On réduit la hauteur occupée pour éviter les grands vides */
    }

    /* 5. Ajustement fin du titre pour les écrans ultra-étroits */
    .tech-title-v2 {
        font-size: 0.8rem;
        letter-spacing: 1px;
    }
}

/* 6. Optimisation de la performance mobile */
@media (max-width: 768px) {
    /* On force l'empilement vertical strict */
    .footer-content {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        width: 100% !important;
        padding: 0 20px !important;
        gap: 40px !important;
    }

    .footer-section {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        text-align: center !important;
        overflow: hidden; /* Empêche les lueurs de dépasser */
    }

    /* --- CIBLE : LA COLONNE CONNEXION --- */
    .social-links {
        display: flex !important;
        justify-content: center !important;
        flex-wrap: wrap !important; /* Force le retour à la ligne si trop large */
        width: 100% !important;
        gap: 15px !important;
        margin: 20px auto !important;
    }

    /* On s'assure que les boutons ne sont pas trop gros */
    .social-btn {
        width: 45px !important;
        height: 45px !important;
        margin: 0 !important; /* On gère l'espace par le gap du parent */
    }

    /* Le gros bouton "Me Contacter" */
    .neural-btn-small {
        display: block !important;
        width: fit-content !important;
        margin: 20px auto !important;
        max-width: 90% !important; /* Sécurité anti-débordement */
    }
}