:root {
    --bg-color: #0b0f19;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* Accents */
    --accent-sweet: #48cae4; /* Eau douce - claire */
    --accent-salty: #023e8a; /* Eau salée - profonde */
    --accent-fire: #e76f51; /* Feu d'Abraham */
    --accent-earth: #2a9d8f; /* Arbre et racines */
    --accent-gold: #f4a261; /* Sagesse/Trône */

    --glass-bg: rgba(15, 23, 42, 0.6);
    --glass-border: rgba(72, 202, 228, 0.15);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --font-serif: 'Georgia', serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

canvas.bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    opacity: 0.3;
    pointer-events: none;
}

/* Typographie */
h1, h2, h3, h4 {
    font-weight: 300;
    line-height: 1.2;
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent-sweet), var(--accent-salty));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 500;
}

.gradient-fire {
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-fire));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.serif-quote {
    font-family: var(--font-serif);
    font-style: italic;
    color: var(--accent-sweet);
    position: relative;
    padding-left: 1.5rem;
    border-left: 3px solid var(--accent-gold);
    margin: 2rem 0;
    font-size: 1.15rem;
    line-height: 1.8;
}

/* Nav */
.glass-nav {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1.5rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(11, 15, 25, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 1000;
    transition: all 0.3s ease;
}

.logo {
    font-weight: 300;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.logo span {
    font-weight: 600;
    color: var(--accent-sweet);
}

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

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--accent-sweet);
}

/* Conteneurs */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 5%;
}

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

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 5rem;
    position: relative;
}

.hero-content {
    max-width: 800px;
}

.badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: rgba(72, 202, 228, 0.05);
    border: 1px solid var(--accent-sweet);
    color: var(--accent-sweet);
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 2rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.hero h1 {
    font-size: clamp(3rem, 5vw, 5rem);
    margin-bottom: 1.5rem;
    letter-spacing: -2px;
}

.subtitle {
    font-size: clamp(1.1rem, 2vw, 1.25rem);
    color: var(--text-secondary);
    max-width: 700px;
    margin-bottom: 3rem;
    font-weight: 300;
}

/* Sections */
.section {
    padding: 8rem 0;
    position: relative;
}

.section.alt-bg {
    background: rgba(2, 62, 138, 0.05);
    border-top: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
}

.section-header {
    text-align: center;
    margin-bottom: 5rem;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Grilles & Cartes */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: var(--glass-shadow);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.glass-panel:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(72, 202, 228, 0.05);
}

.text-card h3 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.text-card p {
    margin-bottom: 1.2rem;
    color: var(--text-secondary);
    text-align: justify;
}

/* Canvas Wrappers */
.visual-card .canvas-wrapper {
    width: 100%;
    height: 350px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    background: #000;
    border: 1px solid rgba(255,255,255,0.05);
}

.canvas-wrapper canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.caption {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 1rem;
    font-style: italic;
}

/* IA Details */
.ia-details {
    background: rgba(15, 23, 42, 0.8);
    border: 1px dotted var(--accent-sweet);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.ia-summary {
    padding: 1.5rem;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--accent-sweet);
    background: rgba(72, 202, 228, 0.05);
    list-style: none;
    display: flex;
    align-items: center;
}

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

.ia-content {
    padding: 2rem;
    border-top: 1px solid var(--glass-border);
}

.ia-content h4 {
    color: var(--accent-gold);
    font-family: var(--font-mono);
    margin: 1.5rem 0 1rem;
    font-size: 1.1rem;
}

.ia-content p {
    margin-bottom: 1rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* Animations Reveal */
.reveal-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

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

@media (max-width: 768px) {
    .grid-2 {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .nav-links {
        display: none;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
}

/* -------------------------------------------
   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;
    }
}
