/* ==========================================================================
   RESET & VARIABLES
   ========================================================================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Thème Labo / Hautes Énergies */
    --bg-main: #020205; /* Noir d'encre */
    --bg-panel: rgba(10, 12, 18, 0.65); /* Gris Métallisé Foncé */
    
    --text-main: #e2e8f0;
    --text-secondary: #94a3b8;
    
    --accent-1: #00e5ff; /* Cyan / Effet Tcherenkov */
    --accent-2: #818cf8; /* Violet / Indigo de haute énergie */
    --accent-3: #cbd5e1; /* Gris métallique */
    
    --border-light: rgba(255, 255, 255, 0.08);
    --border-accent: rgba(0, 229, 255, 0.3);
    
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    --shadow-glow: 0 0 20px rgba(0, 229, 255, 0.15);
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ==========================================================================
   ARRANGEMENT CANVAS D'ARRIÈRE-PLAN
   ========================================================================== */
#quantum-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
    opacity: 0.8;
}

/* ==========================================================================
   TYPOGRAPHIE
   ========================================================================== */
h1, h2, h3, h4 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

h1 { font-size: clamp(3rem, 6vw, 5rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 300; }
h2 span { font-weight: 600; color: var(--accent-1); }
h3 { font-size: 1.5rem; color: var(--text-main); }
h4 { font-size: 1.2rem; }

p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.gradient-text {
    background: linear-gradient(135deg, var(--text-main) 0%, var(--accent-1) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.mono-label {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--accent-1);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    display: block;
}

.math-display {
    text-align: center;
    padding: 1rem;
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    margin: 1.5rem 0;
    font-size: 1.2rem;
    font-family: var(--font-mono);
}

.math-box {
    padding: 1.5rem;
    border-radius: 12px;
    background: rgba(10, 12, 18, 0.8);
    border: 1px solid var(--border-accent);
    margin: 2rem 0;
    backdrop-filter: blur(10px);
}

.math-box.glow {
    box-shadow: var(--shadow-glow);
}

/* ==========================================================================
   NAVIGATION
   ========================================================================== */
.glass-nav {
    position: fixed;
    top: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    z-index: 100;
    transition: all 0.3s ease;
}

.glass-nav.scrolled {
    background: rgba(2, 2, 5, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-light);
    padding: 1rem 5%;
}

.logo {
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: -0.03em;
}

.logo span {
    font-weight: 300;
    color: var(--accent-1);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2.5rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-main);
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.3s;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--accent-1);
    transition: width 0.3s ease;
}

.nav-links a:hover::after, .nav-links a.active::after {
    width: 100%;
}

.nav-links a:hover {
    color: var(--accent-1);
}

.menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
}

/* ==========================================================================
   Mise en page générale (Containers)
   ========================================================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 5%;
}

.container.wide {
    max-width: 1000px;
}

.section {
    padding: 10rem 0;
    position: relative;
}

.alt-bg {
    background: linear-gradient(to bottom, rgba(2,2,5,0), rgba(10,12,18,0.5) 50%, rgba(2,2,5,0));
}

.section-header {
    text-align: center;
    margin-bottom: 5rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 100px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent-1);
    background: rgba(0, 229, 255, 0.08);
    border: 1px solid var(--border-accent);
    margin-bottom: 1.5rem;
    letter-spacing: 0.05em;
}

.badge-reconnaissance {
    color: var(--accent-3);
    background: rgba(203, 213, 225, 0.1);
    border-color: rgba(203, 213, 225, 0.3);
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    padding: 0 5%;
}

.hero-content {
    max-width: 900px;
    z-index: 2;
}

.subtitle {
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    max-width: 700px;
    margin: 0 auto 3rem;
}

.cta-group {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    font-family: var(--font-sans);
}

.btn-primary {
    background: var(--accent-1);
    color: var(--bg-main);
    box-shadow: 0 4px 15px rgba(0, 229, 255, 0.3);
}

.btn-primary:hover {
    background: #00b8cc;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 229, 255, 0.4);
}

.btn-outline {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--border-light);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-1);
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 50px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    z-index: 2;
}

.mouse {
    width: 4px;
    height: 8px;
    background: var(--accent-1);
    border-radius: 2px;
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    animation: scroll 2s infinite ease-in-out;
}

@keyframes scroll {
    0% { top: 8px; opacity: 1; }
    100% { top: 24px; opacity: 0; }
}

/* ==========================================================================
   GRILLES ET PANNEAUX (GLASSMORPHISM)
   ========================================================================== */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 3rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transition: transform 0.4s ease, border-color 0.4s ease;
}

.glass-panel:hover {
    border-color: rgba(0, 229, 255, 0.2);
}

.text-card p:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   CANVAS HOLDERS
   ========================================================================== */
.visual-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.canvas-wrapper {
    position: relative;
    width: 100%;
    max-width: 400px;
    aspect-ratio: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
}

.canvas-wrapper-small {
    position: relative;
    width: 100%;
    height: 250px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
}

.caption {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-align: center;
    font-style: italic;
    border-top: 1px solid var(--border-light);
    padding-top: 1rem;
    width: 100%;
}

/* ==========================================================================
   LABO IA (DÉTAILS)
   ========================================================================== */
.ia-details {
    overflow: hidden;
}

.ia-details[open] {
    border-color: var(--accent-1);
    box-shadow: 0 0 30px rgba(0, 229, 255, 0.1);
}

.ia-summary {
    cursor: pointer;
    list-style: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ia-summary::-webkit-details-marker {
    display: none;
}

.ia-summary::after {
    content: '+';
    font-size: 1.5rem;
    color: var(--accent-1);
    transition: transform 0.3s ease;
}

.ia-details[open] .ia-summary::after {
    content: '-';
    transform: rotate(180deg);
}

.ia-content {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px dashed var(--accent-1);
    color: var(--text-secondary);
}

.ia-content h4 {
    color: var(--text-main);
    margin: 1.5rem 0 1rem;
    font-family: var(--font-mono);
}

.ia-content ul, .ia-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.ia-content li {
    margin-bottom: 0.5rem;
}

.ia-content li strong {
    color: var(--accent-2);
}

/* ==========================================================================
   RECONNAISSANCE & SEPARATEUR
   ========================================================================== */
.register-transition {
    text-align: center;
    padding: 0 5%;
    margin-bottom: 4rem;
}

.separator-line {
    height: 1px;
    width: 80px;
    background: var(--accent-3);
    margin: 0 auto 2rem;
    opacity: 0.5;
}

.register-transition p {
    max-width: 650px;
    margin: 0 auto;
    font-style: italic;
    font-size: 1.05rem;
}

.reconnaissance-panel {
    border-color: rgba(203, 213, 225, 0.2);
}

.reconnaissance-panel h3 {
    color: var(--accent-3);
}

.citation-block {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
}

.citation {
    font-size: 1.15rem;
    color: var(--text-main);
    font-weight: 400;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
footer {
    background: #020202;
    padding: 4rem 5% 2rem;
    border-top: 1px solid var(--border-light);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 2rem;
    margin-bottom: 3rem;
}

.brand p {
    font-size: 0.95rem;
    margin-top: 0.5rem;
}

.footer-title {
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.footer-link:hover, .footer-link.active {
    color: var(--accent-1);
    text-decoration: underline;
}

.copyright {
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 2rem;
}

/* ==========================================================================
   ANIMATIONS D'APPARITION
   ========================================================================== */
.fade-in {
    opacity: 0;
    animation: fadeIn 1s ease forwards;
}

.delay-1 { animation-delay: 0.3s; }
.delay-2 { animation-delay: 0.6s; }

.reveal-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal-up.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-text {
    opacity: 0;
    transform: translateY(20px);
    animation: textUp 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

@keyframes textUp {
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 900px) {
    .grid-2 {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .reverse-mobile .visual-card {
        grid-row: 1;
    }
    .reverse-mobile .text-card {
        grid-row: 2;
    }
    
    .menu-btn {
        display: block;
    }
    
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(2, 2, 5, 0.95);
        backdrop-filter: blur(10px);
        flex-direction: column;
        padding: 2rem 5%;
        border-bottom: 1px solid var(--border-light);
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .cta-group {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
}

/* -------------------------------------------
   RESPONSIVE TEXT & OVERFLOW FIXES (Mobile)
   ------------------------------------------- */
body {
    word-break: break-word;
    overflow-wrap: break-word;
    -webkit-hyphens: auto;
    hyphens: auto;
}
.math-display, .math-box, .ia-content, pre, code {
    overflow-x: auto;
    overflow-y: hidden;
    max-width: 100%;
}
@media (max-width: 768px) {
    .glass-panel {
        padding: 1.5rem !important;
    }
    .ia-details {
        padding: 1rem 1.2rem !important;
    }
    .hero h1 {
        font-size: 2.2rem !important;
    }
    .section {
        padding: 4rem 0 !important;
    }
    .container {
        padding: 0 1rem !important;
    }
}
