/* ============================================================
   FEUILLE DE STYLE : ACOUSTIQUE (FINAL & PROPRE)
============================================================ */

/* 1. CONFIGURATION GLOBALE */
:root {
    --primary: #00f3ff;       /* Cyan (Onde) */
    --secondary: #ffbd2e;     /* Orange (Énergie) */
    --accent: #ff0055;        /* Rouge (Alertes) */
    --bg-dark: #0a0a0a;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --font-title: 'Orbitron', sans-serif;
    --font-tech: 'Audiowide', sans-serif;
    --font-body: 'Exo 2', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
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;
}

/* Fond Three.js */
#ocean-bg {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1; pointer-events: none;
}

/* 2. HEADER */
#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);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 243, 255, 0.2);
    z-index: 1000;
}
.nav-left a { color: var(--text-secondary); text-decoration: none; font-family: var(--font-tech); text-transform: uppercase; border: 1px solid rgba(255,255,255,0.1); padding: 8px 15px; border-radius: 50px; transition: 0.3s; }
.nav-left a:hover { color: var(--primary); border-color: var(--primary); }

.course-anchors { display: flex; gap: 20px; }
.course-anchors a { color: var(--text-secondary); text-decoration: none; font-family: var(--font-tech); font-size: 0.8rem; text-transform: uppercase; transition: 0.3s; }
.course-anchors a:hover { color: var(--primary); text-shadow: 0 0 5px var(--primary); }

/* 3. HERO SECTION */
.course-header {
    height: 90vh; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 20px;
    background: radial-gradient(circle at top center, rgba(0, 243, 255, 0.08), transparent 60%);
}
.glitch {
    font-family: var(--font-title); font-size: 4rem; font-weight: 900; color: var(--primary); text-transform: uppercase; letter-spacing: 10px;
    text-shadow: 0 0 20px rgba(0, 243, 255, 0.4); margin-bottom: 20px;
}
.subtitle { font-family: var(--font-tech); color: var(--text-secondary); max-width: 800px; font-size: 1.2rem; }
.tech-tag { display: inline-block; margin: 20px 10px; padding: 5px 15px; border: 1px solid var(--secondary); color: var(--secondary); font-family: var(--font-tech); border-radius: 50px; font-size: 0.8rem; }

/* 4. CONTENEURS & 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;
}
.glass-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 15px; padding: 40px; margin-bottom: 30px;
    backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.glass-card h3 { color: var(--primary); font-family: var(--font-title); margin-bottom: 20px; }

/* 5. TYPOGRAPHIE & UTILITAIRES */
.desc-text { font-size: 0.95rem; margin-bottom: 15px; line-height: 1.6; color: var(--text-secondary); }
.sub-text { font-size: 0.75rem; color: #aaa; text-transform: uppercase; letter-spacing: 1px; margin-top: 5px; font-weight: bold; opacity: 0.8; }
.caption { font-size: 0.85rem; color: #888; text-align: center; font-style: italic; margin-top: 10px; }
.formula-caption { margin-top: 20px; font-size: 0.9em; color: #aaa; }
.math-display {
    font-family: 'Courier New', monospace; font-size: 1.2rem; color: #fff; background: rgba(0,0,0,0.4);
    padding: 15px; border-radius: 8px; margin: 15px 0; text-align: center; border: 1px solid rgba(255,255,255,0.05);
}
.big-math { text-align: center; font-size: 1.2em; font-weight: bold; color: #fff; margin: 20px 0; }
.center-accent { text-align: center; color: var(--accent); }
.border-primary { border-color: var(--primary); }
.dashed-accent { border: 1px dashed var(--accent); background: rgba(255, 0, 85, 0.05); }

/* 6. GRILLES & FLEXBOX */
.comparison-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-top: 30px; }
.flex-container { display: flex; gap: 20px; align-items: stretch; margin-top: 30px; flex-wrap: wrap; }
.highlight-box { background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.1); padding: 20px; border-radius: 10px; height: 100%; }
.highlight-box.centered { text-align: center; display: flex; flex-direction: column; justify-content: center; flex: 1; min-width: 200px; }
.text-block { flex: 1; min-width: 300px; }

/* 7. DIAGRAMMES & CANVAS */
.diagram-container { width: 100%; background: rgba(0,0,0,0.4); border-radius: 10px; border: 1px solid rgba(255,255,255,0.05); overflow: hidden; display: flex; justify-content: center; margin: 20px 0; }
.diagram-container.column-mode { flex-direction: column; background: #050505; padding: 0; align-items: stretch; }
.relative-container { position: relative; }
canvas { display: block; max-width: 100%; }

.canvas-label {
    font-family: var(--font-tech); font-size: 0.9rem; padding: 12px 20px;
    background: rgba(255,255,255,0.03); border-bottom: 1px solid rgba(255,255,255,0.05); letter-spacing: 1px;
}
.canvas-label.primary { color: var(--primary); border-left: 4px solid var(--primary); }
.canvas-label.accent { color: var(--accent); border-left: 4px solid var(--accent); }

/* Styles spécifiques Section III */
.canvas-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.badge { font-family: monospace; font-size: 0.7em; background: rgba(255, 255, 255, 0.1); padding: 2px 6px; border-radius: 4px; color: #aaa; border: 1px solid rgba(255, 255, 255, 0.1); }
.wave-canvas { width: 100%; background: rgba(0, 0, 0, 0.3); border: 1px solid rgba(255, 255, 255, 0.05); border-radius: 4px; }

/* 8. SPECTRE INTERACTIF */
.spectrum-container { display: flex; gap: 10px; margin-top: 30px; flex-wrap: wrap; }
.oscilloscope-screen {
    background: #000; border: 2px solid #333; border-radius: 10px; position: relative; overflow: hidden; margin-bottom: 20px; box-shadow: inset 0 0 20px rgba(0,0,0,0.8);
}
.oscilloscope-screen::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-image: linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 20px 20px; pointer-events: none;
}
.scanline {
    position: absolute; top: 0; left: 0; width: 100%; height: 10px;
    background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,0.05), rgba(255,255,255,0));
    animation: scan 2s linear infinite; pointer-events: none;
}
@keyframes scan { 0% { top: -10%; } 100% { top: 110%; } }
.screen-overlay { position: absolute; top: 10px; right: 15px; text-align: right; font-family: monospace; pointer-events: none; z-index: 2; }
#oscillo-type { display: block; font-weight: bold; font-size: 1.2em; color: var(--primary); text-shadow: 0 0 5px var(--primary); }
#oscillo-freq { font-size: 0.8em; color: #888; }
.freq-scale { display: flex; justify-content: space-between; padding: 5px 15px; background: #111; border-top: 1px solid #333; font-family: monospace; font-size: 0.7em; color: #666; }

/* Cartes Fréquences */
.cards-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.freq-card { background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.1); padding: 15px; border-radius: 8px; cursor: pointer; transition: 0.3s; }
.freq-card:hover, .freq-card.active { background: rgba(255,255,255,0.08); transform: translateY(-2px); }
.freq-card.infra:hover, .freq-card.infra.active { border-color: #888; box-shadow: 0 0 10px rgba(136, 136, 136, 0.2); }
.freq-card.audible:hover, .freq-card.audible.active { border-color: var(--primary); box-shadow: 0 0 10px rgba(0, 243, 255, 0.2); }
.freq-card.ultra:hover, .freq-card.ultra.active { border-color: var(--secondary); box-shadow: 0 0 10px rgba(255, 189, 46, 0.2); }
.freq-card.hyper:hover, .freq-card.hyper.active { border-color: var(--accent); box-shadow: 0 0 10px rgba(255, 0, 85, 0.2); }
.card-header { font-family: 'Orbitron'; font-size: 0.85em; display: flex; align-items: center; gap: 8px; margin-bottom: 5px; color: #fff; }
.dot { width: 8px; height: 8px; border-radius: 50%; }
.card-range { font-family: monospace; font-size: 0.8em; color: #aaa; margin-bottom: 8px; }
.card-desc { font-size: 0.75em; color: #777; line-height: 1.4; }

/* 9. TIMELINE */
.timeline { position: relative; padding-left: 10px; }
.timeline-item { margin-bottom: 40px; position: relative; padding-left: 20px; }
.timeline-item::before { content: ''; position: absolute; left: -21px; top: 5px; width: 12px; height: 12px; background: #000; border: 2px solid var(--primary); border-radius: 50%; z-index: 2; box-shadow: 0 0 10px rgba(0, 243, 255, 0.5); }
.timeline-year { color: var(--primary); font-family: var(--font-tech); font-size: 1.1em; margin-bottom: 5px; }

/* 10. PULSE SIMULATOR */
.pulse-simulator { background: #000; border: 1px solid var(--secondary); padding: 20px; border-radius: 10px; text-align: center; }
.pulse-btn { padding: 10px 20px; background: var(--secondary); border: none; font-family: var(--font-tech); cursor: pointer; font-weight: bold; color: #000; }
#pulseResult { margin-top: 10px; font-family: monospace; color: var(--primary); height: 20px; }
.controls { margin-top: 15px; }

/* 11. FOOTER & ANIM */
#neural-footer { margin-top: 100px; padding: 50px; background: #000; border-top: 1px solid var(--primary); text-align: center; font-family: var(--font-tech); color: #555; }
.footer-sub { font-size: 0.8em; margin-top: 10px; color: #333; }
.fade-in { animation: fadeIn 1s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

input[type=range] { width: 100%; accent-color: var(--primary); }

/* 12. RESPONSIVE */
@media (max-width: 900px) {
    .glitch { font-size: 2rem; letter-spacing: 2px; }
    .comparison-grid, .flex-container, .spectrum-container { grid-template-columns: 1fr; flex-direction: column; }
    #unified-navbar { padding: 10px; flex-direction: column; height: auto; gap: 10px; }
    .course-anchors { flex-wrap: wrap; justify-content: center; }
    .course-header { padding-top: 140px; justify-content: flex-start; }
    .text-block { min-width: 100%; }
    .timeline { margin-left: 10px; }
}
/* Dans acoustic.css ou <style> */

/* Style spécifique pour les titres de l'intro (optionnel) */
#intro .section-title, 
#spectre .section-title, 
#guided .section-title, 
#dispersion .section-title, 
#history .section-title {
    border-left-color: var(--text-secondary); /* Gris au lieu de Cyan */
    color: var(--text-primary);
    font-size: 1.8rem; /* Un peu plus petit */
}

/* On remet le Cyan éclatant pour les vrais chapitres */
#equation .section-title,
#energy .section-title,
#impedance .section-title,
#applications .section-title {
    border-left-color: var(--primary);
    color: var(--secondary);
    font-size: 2.2rem;
}
.analogy-box {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    background: linear-gradient(to right, rgba(255, 255, 255, 0.05), transparent);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 4px solid var(--secondary); /* Orange */
    padding: 20px;
    border-radius: 8px;
    margin-top: 30px;
}

.analogy-icon {
    font-size: 3rem;
    background: rgba(0,0,0,0.3);
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--secondary);
    box-shadow: 0 0 15px rgba(255, 189, 46, 0.2);
    flex-shrink: 0; /* Empêche l'icône de s'écraser sur mobile */
}

.analogy-content h4 {
    color: var(--secondary);
    font-family: var(--font-tech);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Petit ajustement Responsive */
@media (max-width: 700px) {
    .analogy-box { flex-direction: column; align-items: center; text-align: center; }
    .analogy-box .comparison-grid { grid-template-columns: 1fr !important; border: none; }
    .analogy-box div[style*="border-right"] { border-right: none !important; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 15px; margin-bottom: 15px; }
}
/* Animation de respiration pour le texte néon */
@keyframes neonPulse {
    0% {
        text-shadow: 0 0 5px var(--primary), 0 0 10px var(--primary), 0 0 20px var(--primary);
        opacity: 1;
    }
    50% {
        text-shadow: 0 0 10px var(--primary), 0 0 20px var(--primary), 0 0 40px var(--primary);
        opacity: 0.9;
    }
    100% {
        text-shadow: 0 0 5px var(--primary), 0 0 10px var(--primary), 0 0 20px var(--primary);
        opacity: 1;
    }
}

.neon-box {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--primary);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.15), inset 0 0 20px rgba(0, 243, 255, 0.05);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.neon-value {
    font-family: 'Orbitron', sans-serif; /* Police Tech */
    font-size: 3em;
    font-weight: 900;
    color: #fff;
    /* L'animation magique */
    animation: neonPulse 2s infinite ease-in-out;
}

/* Style du Slider pour qu'il soit plus "Tech" */
input[type=range].tech-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: #333;
    border-radius: 5px;
    outline: none;
    box-shadow: inset 0 0 5px #000;
}
input[type=range].tech-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 0 10px var(--primary);
    border: 2px solid #fff;
    margin-top: -7px; 
}
input[type=range].tech-slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: linear-gradient(90deg, var(--secondary) 0%, var(--primary) 100%);
    border-radius: 5px;
}
.math-display {
    overflow-x: auto; /* Scroll si trop large */
    max-width: 100%;
}