/* =========================================
   1. VARIABLES & RESET FACTORISÉS
   ========================================= */
:root {
    --bg-dark: #121212;
    --bg-card: #1e1e1e;
    --text-main: #f5f5f5;
    --text-muted: #aaaaaa;
    --font-main: 'Montserrat', sans-serif;
}

/* Thèmes de couleurs gérés par classe sur le body */
body.theme-concevoir { --theme-accent: #C0392B; }
body.theme-verifier { --theme-accent: #E67E22; }
body.theme-maintenir { --theme-accent: #F1C40F; }
body.theme-integrer { --theme-accent: #2ECC71; }

* { box-sizing: border-box; margin: 0; padding: 0; }
body { background-color: var(--bg-dark); color: var(--text-main); font-family: var(--font-main); overflow-x: hidden; }
a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }

/* =========================================
   2. HEADER
   ========================================= */
header { position: fixed; top: 0; width: 100%; padding: 20px 50px; display: flex; justify-content: space-between; align-items: center; background: rgba(18, 18, 18, 0.95); backdrop-filter: blur(10px); z-index: 100; border-bottom: 1px solid #333; }
.logo { font-weight: 800; font-size: 1.5rem; cursor: pointer; color: white; transition: 0.3s; }
.logo:hover { color: var(--theme-accent); }
.nav-links { display: flex; gap: 30px; list-style: none; }
.nav-links a { text-decoration: none; color: white; font-size: 0.9rem; transition: 0.3s; }
.nav-links a:hover { color: var(--theme-accent); }

/* =========================================
   3. LAYOUT GLOBAL
   ========================================= */
main { padding-top: 80px; min-height: 100vh; }
.content-wrapper { max-width: 900px; margin: 0 auto; padding: 0 20px 80px 20px; }

/* --- HERO SECTION --- */
.hero-lvl { text-align: center; padding: 80px 20px 60px 20px; background: radial-gradient(circle at center, #2a2a2a 0%, #121212 70%); }
.hero-content { opacity: 0; transform: translateY(30px); animation: fadeInUp 1s forwards; }
.icon-wrapper { width: 80px; height: 80px; margin: 0 auto 20px; border: 2px solid var(--theme-accent); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 2rem; color: var(--theme-accent); box-shadow: 0 0 20px rgba(255, 255, 255, 0.1); }
h1 { font-size: 3rem; font-weight: 800; margin-bottom: 10px; letter-spacing: 2px; }
.accent { color: var(--theme-accent); }
.subtitle { font-size: 1.2rem; color: var(--text-muted); font-weight: 300; margin-bottom: 30px; }
.hero-line { width: 100px; height: 4px; background: var(--theme-accent); margin: 0 auto; border-radius: 2px; }

/* --- SECTIONS ANIMATIONS --- */
.block-section { margin-bottom: 60px; opacity: 0; transform: translateY(30px); transition: all 0.8s ease-out; }
.block-section.visible { opacity: 1; transform: translateY(0); }
.section-title { font-size: 1.5rem; color: white; margin-bottom: 25px; border-left: 4px solid var(--theme-accent); padding-left: 15px; display: flex; align-items: center; gap: 10px; }
.section-title i { color: var(--theme-accent); }

/* =========================================
   4. BLOCS DE CONTENU
   ========================================= */
/* VALIDATION BOX & TEXTES */
.text-box { background: var(--bg-card); padding: 30px; border-radius: 8px; border: 1px solid #333; line-height: 1.8; color: #ddd; text-align: justify; box-shadow: 0 5px 15px rgba(0,0,0,0.2); border-left: 1px solid var(--theme-accent); }
.text-content p { margin-bottom: 20px; font-size: 1.05rem; line-height: 1.7; color: #ddd; }
.text-content p:last-child { margin-bottom: 0; }

/* APPRENTISSAGES CRITIQUES (CARTES) */
.ac-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
.ac-card { background: var(--bg-card); padding: 35px 25px; border-radius: 8px; border: 1px solid #333; text-align: center; transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1); display: flex; flex-direction: column; align-items: center; gap: 15px; position: relative; overflow: hidden; }
.ac-card:hover { transform: translateY(-8px); background: rgba(255, 255, 255, 0.03); border-color: var(--theme-accent); box-shadow: 0 15px 35px rgba(0,0,0,0.5); }
.ac-icon-box { width: 50px; height: 50px; border-radius: 50%; background: rgba(255, 255, 255, 0.05); display: flex; align-items: center; justify-content: center; color: var(--theme-accent); font-size: 1.2rem; margin-bottom: 5px; }
.ac-card h4 { color: white; text-transform: uppercase; font-size: 1rem; }
.ac-card p { font-size: 0.9rem; color: #aaa; line-height: 1.5; }
.ac-card i { transition: all 0.4s ease; }
.ac-card:hover i { transform: scale(1.2) translateY(-2px); text-shadow: 0 0 15px var(--theme-accent); }

/* =========================================
   5. STATS & AUTO-ÉVALUATION (BARRES)
   ========================================= */
.stats-container { background: var(--bg-card); padding: 30px; border-radius: 8px; border: 1px solid #333; }
.stat-group { margin-bottom: 25px; }
.stat-header { display: flex; justify-content: space-between; margin-bottom: 10px; font-weight: 600; font-size: 0.95rem; }
.color-success { color: var(--theme-accent); }
.color-improve { color: #888; }
.progress-bg { width: 100%; height: 10px; background: #2c2c2c; border-radius: 5px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, transparent, var(--theme-accent)); transition: width 1.5s cubic-bezier(0.22, 1, 0.36, 1); border-radius: 5px; position: relative; overflow: hidden; }
.bar-improve { background: #555; }
.progress-bar::after { content: ''; position: absolute; top: 0; left: 0; bottom: 0; width: 50%; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent); transform: translateX(-100%); animation: shimmer 3s infinite ease-in-out; }
@keyframes shimmer { 100% { transform: translateX(250%); } }

.stat-info { display: flex; gap: 15px; margin-top: 25px; padding: 15px; background: rgba(255,255,255,0.03); border-radius: 4px; font-size: 0.9rem; color: #aaa; align-items: flex-start; border-left: 2px solid #555; }
.stat-info i { color: var(--theme-accent); margin-top: 3px; }

/* =========================================
   6. TRACE IMAGE (PROJET) - CORRIGÉ
   ========================================= */
.project-showcase { margin-top: 10px; padding: 20px; background: rgba(0, 0, 0, 0.2); border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.02); }
.trace-wrapper { background: var(--bg-card); padding: 10px; border-radius: 8px; border: 1px solid #333; transition: border-color 0.3s ease, box-shadow 0.3s ease; }
.trace-wrapper:hover { border-color: var(--theme-accent); box-shadow: 0 5px 20px rgba(0,0,0,0.3); }

.trace-inner { 
    width: 100%;
    max-height: 480px; /* Empêche l'image de devenir géante */
    background: #0a0a0a; /* Fond sombre derrière l'image */
    overflow: hidden; 
    border-radius: 4px; 
    border: 1px solid #222; 
    display: flex;
    justify-content: center;
    align-items: center;
}

.trace-image { 
    width: 100%; 
    height: 100%;
    max-height: 480px; 
    object-fit: contain; /* MAGIE : L'image reste toujours entière sans être coupée ! */
    display: block; 
    transition: transform 0.5s ease; 
}

.trace-image:hover { transform: scale(1.02); }
.trace-caption { text-align: center; padding: 15px 0 5px; font-size: 0.85rem; color: #888; font-style: italic; line-height: 1.4; }

/* GRILLE DE TRACES MULTIPLES */
.traces-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-top: 15px;
}
.traces-grid .trace-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
}
.traces-grid .trace-inner {
    height: 220px;
    max-height: 220px;
}
.traces-grid .trace-caption {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 5px;
    font-size: 0.82rem;
    color: #bbb;
    font-style: normal;
    text-align: center;
}

.trace-explanation {
    margin-top: 15px;
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 6px;
    border-left: 3px solid var(--theme-accent);
    font-size: 0.93rem;
    line-height: 1.65;
    color: #cbd5e1;
    text-align: left;
}
.trace-explanation strong {
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 0.96rem;
}
.trace-explanation p {
    margin: 0;
    color: #cbd5e1;
}

.badge-provisoire {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    background: rgba(230, 126, 34, 0.15);
    color: #fb923c;
    border: 1px solid rgba(230, 126, 34, 0.4);
    margin-left: 8px;
}

/* =========================================
   7. BOUTON & CTA
   ========================================= */
.cta-container { text-align: center; margin-top: 60px; padding-bottom: 40px; opacity: 0; transform: translateY(30px); transition: all 0.8s ease-out 0.2s; }
.cta-container.visible { opacity: 1; transform: translateY(0); }
.btn-primary { display: inline-flex; align-items: center; gap: 12px; padding: 16px 45px; background: transparent; border: 2px solid var(--theme-accent); color: var(--theme-accent); font-size: 1rem; font-weight: 800; text-transform: uppercase; text-decoration: none; border-radius: 50px; transition: all 0.3s ease; position: relative; overflow: hidden; }
.btn-primary:hover { background: var(--theme-accent); color: white; box-shadow: 0 5px 25px rgba(255, 255, 255, 0.1); }
.btn-primary i { transition: 0.3s; }
.btn-primary:hover i { transform: translateX(5px); }

/* =========================================
   8. FOOTER & RESPONSIVE
   ========================================= */
footer { text-align: center; padding: 30px; border-top: 1px solid #333; color: #666; font-size: 0.8rem; }
@keyframes fadeInUp { to { opacity: 1; transform: translateY(0); } }

@media (max-width: 768px) { 
    h1 { font-size: 2rem; } 
    .nav-links { display: none; } 
    .ac-grid { grid-template-columns: 1fr; } 
    .traces-grid { grid-template-columns: 1fr; } 
}

/* =========================================
   9. FONDS ANIMÉS THÉMATIQUES & PERCEPTIBLES — PAGES COMPÉTENCES, PROJETS, GEII & ALTERNANCE
   ========================================= */

/* Base commune pour tous les pseudo-éléments de fond */
body.competence-concevoir::before,
body.competence-verifier::before,
body.competence-maintenir::before,
body.competence-integrer::before,
body.project-page::before,
body.info-page::before,
body.company-page::before,
body.competence-concevoir::after,
body.competence-verifier::after,
body.competence-maintenir::after,
body.competence-integrer::after,
body.project-page::after,
body.info-page::after,
body.company-page::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

main, header, footer, .content-wrapper, .block-section, .hero-lvl, .cta-container {
    position: relative;
    z-index: 1;
}

/* -------------------------------------------------------------
   COMPÉTENCES (10 PAGES)
   ------------------------------------------------------------- */

/* 1. CONCEVOIR (Pistes de circuit PCB & flux d'électrons rouge/corail) */
body.competence-concevoir::before {
    background-image: 
        radial-gradient(circle at 15% 25%, rgba(231, 76, 60, 0.15) 0%, transparent 45%),
        radial-gradient(circle at 85% 75%, rgba(231, 76, 60, 0.12) 0%, transparent 50%),
        linear-gradient(90deg, rgba(231, 76, 60, 0.08) 1.5px, transparent 1.5px),
        linear-gradient(0deg, rgba(231, 76, 60, 0.08) 1.5px, transparent 1.5px);
    background-size: 100% 100%, 100% 100%, 50px 50px, 50px 50px;
    animation: pcbGridShift 20s linear infinite;
}
body.competence-concevoir::after {
    background-image: 
        radial-gradient(ellipse at 50% 50%, rgba(231, 76, 60, 0.16) 0%, transparent 60%),
        radial-gradient(rgba(255, 107, 107, 0.22) 2.5px, transparent 2.5px);
    background-size: 100% 100%, 100px 100px;
    animation: pcbPulseFlow 12s ease-in-out infinite alternate;
}
@keyframes pcbGridShift {
    0% { background-position: 0 0, 0 0, 0 0, 0 0; }
    100% { background-position: 0 0, 0 0, 50px 50px, 50px 50px; }
}
@keyframes pcbPulseFlow {
    0% { opacity: 0.6; transform: scale(0.98); background-position: 0 0, 0 0; }
    100% { opacity: 1; transform: scale(1.02); background-position: 0 0, 50px -50px; }
}

/* 2. VÉRIFIER (Grille oscilloscope & balayage de signaux de test orange) */
body.competence-verifier::before {
    background-image: 
        radial-gradient(circle at 80% 20%, rgba(230, 126, 34, 0.15) 0%, transparent 45%),
        radial-gradient(circle at 20% 80%, rgba(230, 126, 34, 0.12) 0%, transparent 50%),
        linear-gradient(90deg, rgba(230, 126, 34, 0.08) 1px, transparent 1px),
        linear-gradient(0deg, rgba(230, 126, 34, 0.08) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 40px 40px, 40px 40px;
    animation: oscilloGrid 18s ease-in-out infinite alternate;
}
body.competence-verifier::after {
    background: repeating-linear-gradient(0deg, transparent, transparent 38px, rgba(243, 156, 18, 0.14) 39px, transparent 41px);
    animation: oscilloSignalSweep 10s linear infinite;
}
@keyframes oscilloGrid {
    0% { background-position: 0 0, 0 0, 0 0, 0 0; opacity: 0.7; }
    100% { background-position: 0 0, 0 0, 0 20px, 0 20px; opacity: 1; }
}
@keyframes oscilloSignalSweep {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
}

/* 3. MAINTENIR (Scan de diagnostic & supervision dorée) */
body.competence-maintenir::before {
    background-image: 
        radial-gradient(circle at 50% 25%, rgba(241, 196, 15, 0.14) 0%, transparent 50%),
        radial-gradient(circle at 25% 75%, rgba(241, 196, 15, 0.10) 0%, transparent 45%),
        linear-gradient(135deg, rgba(241, 196, 15, 0.07) 25%, transparent 25%),
        linear-gradient(225deg, rgba(241, 196, 15, 0.07) 25%, transparent 25%);
    background-size: 100% 100%, 100% 100%, 54px 54px, 54px 54px;
    animation: diagMatrixShift 22s linear infinite;
}
body.competence-maintenir::after {
    background: linear-gradient(180deg, transparent 0%, rgba(241, 196, 15, 0.18) 50%, transparent 100%);
    background-size: 100% 220px;
    background-repeat: no-repeat;
    animation: diagBeamSweep 12s ease-in-out infinite;
}
@keyframes diagMatrixShift {
    0% { background-position: 0 0, 0 0, 0 0, 0 0; }
    100% { background-position: 0 0, 0 0, 54px 54px, 54px 54px; }
}
@keyframes diagBeamSweep {
    0% { background-position: 0 -220px; opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { background-position: 0 100vh; opacity: 0; }
}

/* 4. INTÉGRER (Topologie réseau & flux de données vert) */
body.competence-integrer::before {
    background-image: 
        radial-gradient(circle at 80% 25%, rgba(46, 204, 113, 0.15) 0%, transparent 45%),
        radial-gradient(circle at 20% 75%, rgba(46, 204, 113, 0.12) 0%, transparent 50%),
        radial-gradient(rgba(46, 204, 113, 0.18) 2px, transparent 2px),
        linear-gradient(90deg, rgba(46, 204, 113, 0.07) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 36px 36px, 36px 36px;
    animation: networkBusShift 18s ease-in-out infinite alternate;
}
body.competence-integrer::after {
    background-image: radial-gradient(ellipse at 50% 50%, rgba(46, 204, 113, 0.18) 0%, transparent 65%);
    animation: networkPacketFlow 10s ease-in-out infinite alternate;
}
@keyframes networkBusShift {
    0% { background-position: 0 0, 0 0, 0 0, 0 0; opacity: 0.7; }
    100% { background-position: 0 0, 0 0, 18px 18px, 18px 18px; opacity: 1; }
}
@keyframes networkPacketFlow {
    0% { opacity: 0.5; transform: scale(0.95); }
    100% { opacity: 1; transform: scale(1.05); }
}

/* -------------------------------------------------------------
   PROJETS (9 PAGES)
   ------------------------------------------------------------- */

/* SMARTLIGHT : Pistes PCB & impulsions lumineuses rouges */
body.project-smartlight::before {
    background-image: 
        radial-gradient(circle at 50% 20%, rgba(231, 76, 60, 0.18) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(231, 76, 60, 0.12) 0%, transparent 45%),
        linear-gradient(90deg, rgba(231, 76, 60, 0.08) 1.5px, transparent 1.5px),
        linear-gradient(0deg, rgba(231, 76, 60, 0.08) 1.5px, transparent 1.5px);
    background-size: 100% 100%, 100% 100%, 44px 44px, 44px 44px;
    animation: slCircuitMove 18s linear infinite;
}
body.project-smartlight::after {
    background-image: radial-gradient(circle at 50% 20%, rgba(255, 107, 107, 0.22) 0%, transparent 40%);
    animation: slLightBreathing 8s ease-in-out infinite alternate;
}
@keyframes slCircuitMove {
    0% { background-position: 0 0, 0 0, 0 0, 0 0; }
    100% { background-position: 0 0, 0 0, 44px 44px, 44px 44px; }
}
@keyframes slLightBreathing {
    0% { opacity: 0.4; transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1.1); }
}

/* ROBOT DÉTECTEUR : Arcs radar & balayage d'obstacles rouge */
body.project-robot-detecteur::before {
    background-image: 
        radial-gradient(circle at 50% 35%, rgba(231, 76, 60, 0.16) 0%, transparent 55%),
        repeating-radial-gradient(circle at 50% 35%, transparent 0, transparent 42px, rgba(231, 76, 60, 0.10) 43px, transparent 45px);
    background-size: 100% 100%, 100% 100%;
    animation: robotRadarRings 12s ease-in-out infinite alternate;
}
body.project-robot-detecteur::after {
    background: conic-gradient(from 0deg at 50% 35%, transparent 0deg, rgba(231, 76, 60, 0.20) 45deg, transparent 75deg);
    animation: robotRadarSweep 8s linear infinite;
}
@keyframes robotRadarRings {
    0% { opacity: 0.6; transform: scale(0.96); }
    100% { opacity: 1; transform: scale(1.04); }
}
@keyframes robotRadarSweep {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* SYSTÈME DOMOTIQUE : Bus domotique & signaux inter-modules orange */
body.project-systeme-domotique::before {
    background-image: 
        radial-gradient(circle at 20% 35%, rgba(230, 126, 34, 0.16) 0%, transparent 45%),
        radial-gradient(circle at 80% 65%, rgba(230, 126, 34, 0.12) 0%, transparent 50%),
        radial-gradient(rgba(230, 126, 34, 0.18) 2px, transparent 2px),
        linear-gradient(90deg, rgba(230, 126, 34, 0.07) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 38px 38px, 38px 38px;
    animation: domotiqueBus 18s linear infinite;
}
body.project-systeme-domotique::after {
    background-image: radial-gradient(ellipse at 50% 50%, rgba(243, 156, 18, 0.18) 0%, transparent 60%);
    animation: domotiqueSignals 10s ease-in-out infinite alternate;
}
@keyframes domotiqueBus {
    0% { background-position: 0 0, 0 0, 0 0, 0 0; }
    100% { background-position: 0 0, 0 0, 38px 38px, 38px 38px; }
}
@keyframes domotiqueSignals {
    0% { opacity: 0.5; transform: scale(0.92); }
    100% { opacity: 1; transform: scale(1.08); }
}

/* TÉLÉCOMMANDE ULTRASONS : Ondes de pression concentriques & porteuse 40 kHz */
body.project-telecommande-ultrasons::before {
    background-image: 
        radial-gradient(circle at 50% 30%, rgba(230, 126, 34, 0.16) 0%, transparent 50%),
        repeating-radial-gradient(circle at 50% 30%, transparent 0, transparent 32px, rgba(230, 126, 34, 0.12) 33px, transparent 35px);
    background-size: 100% 100%, 100% 100%;
    animation: usWaveRipples 8s ease-in-out infinite alternate;
}
body.project-telecommande-ultrasons::after {
    background: repeating-linear-gradient(90deg, transparent, transparent 48px, rgba(243, 156, 18, 0.14) 49px, transparent 51px);
    animation: usSineCarrier 12s linear infinite;
}
@keyframes usWaveRipples {
    0% { opacity: 0.5; transform: scale(0.94); }
    100% { opacity: 1; transform: scale(1.06); }
}
@keyframes usSineCarrier {
    0% { transform: translateX(0); }
    100% { transform: translateX(100px); }
}

/* OPTIPLANT : Flux hydroponique & micro-bulles vertes */
body.project-optiplant::before {
    background-image: 
        radial-gradient(circle at 30% 30%, rgba(46, 204, 113, 0.16) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(46, 204, 113, 0.12) 0%, transparent 45%),
        linear-gradient(0deg, rgba(46, 204, 113, 0.08) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 32px 32px;
    animation: hydroGridFlow 16s linear infinite;
}
body.project-optiplant::after {
    background-image: radial-gradient(circle at 50% 50%, rgba(52, 211, 153, 0.20) 1.5px, transparent 1.5px);
    background-size: 40px 40px;
    animation: hydroBubblesRise 8s linear infinite;
}
@keyframes hydroGridFlow {
    0% { background-position: 0 0, 0 0, 0 0; }
    100% { background-position: 0 0, 0 0, 0 -64px; }
}
@keyframes hydroBubblesRise {
    0% { background-position: 0 0; opacity: 0.6; }
    50% { opacity: 1; }
    100% { background-position: 0 -80px; opacity: 0.6; }
}

/* CYBERGUARD : Matrice de cybersécurité, logs & paquets de données cyan/bleu */
body.project-cyberguard::before {
    background-image: 
        radial-gradient(circle at 80% 25%, rgba(14, 165, 233, 0.18) 0%, transparent 50%),
        radial-gradient(circle at 20% 75%, rgba(14, 165, 233, 0.12) 0%, transparent 45%),
        linear-gradient(90deg, rgba(14, 165, 233, 0.08) 1px, transparent 1px),
        linear-gradient(0deg, rgba(14, 165, 233, 0.08) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 42px 42px, 42px 42px;
    animation: cyberMatrixFlow 16s linear infinite;
}
body.project-cyberguard::after {
    background-image: 
        radial-gradient(circle at 50% 50%, rgba(56, 189, 248, 0.24) 0%, transparent 55%),
        radial-gradient(rgba(56, 189, 248, 0.22) 2px, transparent 2px);
    background-size: 100% 100%, 84px 84px;
    animation: cyberPacketTransit 10s ease-in-out infinite alternate;
}
@keyframes cyberMatrixFlow {
    0% { background-position: 0 0, 0 0, 0 0, 0 0; }
    100% { background-position: 0 0, 0 0, 42px 42px, 42px 42px; }
}
@keyframes cyberPacketTransit {
    0% { opacity: 0.5; background-position: 0 0, 0 0; }
    100% { opacity: 1; background-position: 0 0, 42px -42px; }
}

/* RÉSEAU SÉCURISÉ : Lignes Ethernet, commutateurs Hirschmann & trames Modbus */
body.project-reseau-communication-securise::before {
    background-image: 
        radial-gradient(circle at 35% 25%, rgba(14, 165, 233, 0.18) 0%, transparent 50%),
        radial-gradient(circle at 70% 75%, rgba(14, 165, 233, 0.12) 0%, transparent 45%),
        radial-gradient(rgba(14, 165, 233, 0.18) 2px, transparent 2px),
        linear-gradient(90deg, rgba(14, 165, 233, 0.07) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 36px 36px, 36px 36px;
    animation: netEthernetGrid 16s ease-in-out infinite alternate;
}
body.project-reseau-communication-securise::after {
    background-image: radial-gradient(ellipse at 50% 50%, rgba(56, 189, 248, 0.22) 0%, transparent 60%);
    animation: netPacketBurst 10s ease-in-out infinite alternate;
}
@keyframes netEthernetGrid {
    0% { background-position: 0 0, 0 0, 0 0, 0 0; opacity: 0.7; }
    100% { background-position: 0 0, 0 0, 18px 18px, 18px 18px; opacity: 1; }
}
@keyframes netPacketBurst {
    0% { opacity: 0.5; transform: scale(0.94); }
    100% { opacity: 1; transform: scale(1.06); }
}

/* STAGE GRUE PORTUAIRE : Lignes mécaniques treillis & scan de diagnostic jaune */
body.project-stage-grue-portuaire::before {
    background-image: 
        radial-gradient(circle at 60% 25%, rgba(241, 196, 15, 0.16) 0%, transparent 50%),
        radial-gradient(circle at 25% 75%, rgba(241, 196, 15, 0.11) 0%, transparent 45%),
        linear-gradient(45deg, rgba(241, 196, 15, 0.07) 1px, transparent 1px),
        linear-gradient(-45deg, rgba(241, 196, 15, 0.07) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 48px 48px, 48px 48px;
    animation: craneGantryGrid 20s linear infinite;
}
body.project-stage-grue-portuaire::after {
    background: linear-gradient(180deg, transparent, rgba(241, 196, 15, 0.20), transparent);
    background-size: 100% 180px;
    background-repeat: no-repeat;
    animation: craneDiagnosticScan 12s linear infinite;
}
@keyframes craneGantryGrid {
    0% { background-position: 0 0, 0 0, 0 0, 0 0; }
    100% { background-position: 0 0, 0 0, 48px 48px, 48px 48px; }
}
@keyframes craneDiagnosticScan {
    0% { background-position: 0 -180px; }
    100% { background-position: 0 100vh; }
}

/* RENOUVELLEMENT POSTE SOURCE : Schéma unifilaire HTB/HTA & flux d'énergie */
body.project-nouveau-poste-source::before {
    background-image: 
        radial-gradient(circle at 30% 25%, rgba(231, 76, 60, 0.16) 0%, transparent 45%),
        radial-gradient(circle at 75% 70%, rgba(14, 165, 233, 0.15) 0%, transparent 50%),
        linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px),
        linear-gradient(0deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 52px 52px, 52px 52px;
    animation: subGridDistribution 18s ease-in-out infinite alternate;
}
body.project-nouveau-poste-source::after {
    background-image: radial-gradient(ellipse at 50% 50%, rgba(231, 76, 60, 0.18) 0%, rgba(14, 165, 233, 0.18) 40%, transparent 65%);
    animation: subPowerSurge 10s ease-in-out infinite alternate;
}
@keyframes subGridDistribution {
    0% { opacity: 0.7; background-position: 0 0, 0 0, 0 0, 0 0; }
    100% { opacity: 1; background-position: 0 0, 0 0, 26px 26px, 26px 26px; }
}
@keyframes subPowerSurge {
    0% { opacity: 0.5; transform: scale(0.95); }
    100% { opacity: 1; transform: scale(1.05); }
}

/* -------------------------------------------------------------
   PAGES FORMATION (BUT GEII) & ALTERNANCE (DEGREANE SII)
   ------------------------------------------------------------- */

/* PAGE BUT GEII : Lignes universitaires & blocs de compétences cyan */
body.info-page::before,
body.bg-geii::before {
    background-image: 
        radial-gradient(circle at 75% 20%, rgba(14, 165, 233, 0.18) 0%, transparent 50%),
        radial-gradient(circle at 25% 70%, rgba(14, 165, 233, 0.12) 0%, transparent 45%),
        radial-gradient(rgba(14, 165, 233, 0.18) 2px, transparent 2px),
        linear-gradient(90deg, rgba(14, 165, 233, 0.07) 1px, transparent 1px),
        linear-gradient(0deg, rgba(14, 165, 233, 0.07) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 40px 40px, 40px 40px, 40px 40px;
    animation: geiiAcademicGrid 18s linear infinite;
}
body.info-page::after,
body.bg-geii::after {
    background-image: radial-gradient(ellipse at 50% 50%, rgba(56, 189, 248, 0.22) 0%, transparent 60%);
    animation: geiiKnowledgeFlow 10s ease-in-out infinite alternate;
}
@keyframes geiiAcademicGrid {
    0% { background-position: 0 0, 0 0, 0 0, 0 0, 0 0; }
    100% { background-position: 0 0, 0 0, 40px 40px, 40px 40px, 40px 40px; }
}
@keyframes geiiKnowledgeFlow {
    0% { opacity: 0.5; transform: scale(0.92); }
    100% { opacity: 1; transform: scale(1.08); }
}

/* PAGE ALTERNANCE DEGREANE SII : Réseau industriel, distribution & bureau d'études */
body.company-page::before,
body.bg-alternance::before {
    background-image: 
        radial-gradient(circle at 30% 30%, rgba(14, 165, 233, 0.18) 0%, transparent 50%),
        radial-gradient(circle at 80% 65%, rgba(46, 204, 113, 0.14) 0%, transparent 45%),
        linear-gradient(135deg, rgba(14, 165, 233, 0.07) 25%, transparent 25%),
        linear-gradient(225deg, rgba(14, 165, 233, 0.07) 25%, transparent 25%),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 48px 48px, 48px 48px, 48px 48px;
    animation: degreaneIndusGrid 20s linear infinite;
}
body.company-page::after,
body.bg-alternance::after {
    background-image: radial-gradient(ellipse at 60% 40%, rgba(56, 189, 248, 0.22) 0%, rgba(46, 204, 113, 0.18) 40%, transparent 65%);
    animation: degreaneProjectPulse 11s ease-in-out infinite alternate;
}
@keyframes degreaneIndusGrid {
    0% { background-position: 0 0, 0 0, 0 0, 0 0, 0 0; }
    100% { background-position: 0 0, 0 0, 48px 48px, 48px 48px, 48px 48px; }
}
@keyframes degreaneProjectPulse {
    0% { opacity: 0.5; transform: scale(0.94); }
    100% { opacity: 1; transform: scale(1.06); }
}

/* -------------------------------------------------------------
   ACCESSIBILITÉ : PREFERS-REDUCED-MOTION
   ------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    body.competence-concevoir::before,
    body.competence-verifier::before,
    body.competence-maintenir::before,
    body.competence-integrer::before,
    body.project-page::before,
    body.info-page::before,
    body.company-page::before,
    body.bg-geii::before,
    body.bg-alternance::before,
    body.competence-concevoir::after,
    body.competence-verifier::after,
    body.competence-maintenir::after,
    body.competence-integrer::after,
    body.project-page::after,
    body.info-page::after,
    body.company-page::after,
    body.bg-geii::after,
    body.bg-alternance::after {
        animation: none !important;
        opacity: 0.6 !important;
    }
}