/* -------------------------------------------
   GLOBAL & VARIABLES (Thème Rouge/Ambre "Conscience")
   ------------------------------------------- */
   :root {
    --bg-base: #fffdf9; /* Softer, slightly warm white */
    --bg-panel: rgba(255, 255, 255, 0.75);
    --border-light: rgba(200, 16, 46, 0.15); /* Rouge Crimson doux */
    
    --text-main: #2b1d1f; /* Brun très profond / Bourgogne */
    --text-secondary: rgba(43, 29, 31, 0.7); 
    
    --accent-1: #c8102e; /* Crimson profond (Conscience) */
    --accent-2: #eda421; /* Ambre chaud (Flux nerveux) */
    --accent-gradient: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    
    --font-sans: 'Inter', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    --transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --radius-lg: 20px;
}

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

html {
    scroll-behavior: smooth;
}

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

/* Background Canvas */
#neural-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    opacity: 0.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 2rem;
}

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

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

.alt-bg {
    background: linear-gradient(to bottom, transparent, rgba(200, 16, 46, 0.03), transparent);
}

/* -------------------------------------------
   NAVIGATION
   ------------------------------------------- */
.glass-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 253, 249, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
    z-index: 1000;
    transition: var(--transition);
}

.glass-nav.scrolled {
    padding: 0.8rem 2rem;
    background: rgba(255, 253, 249, 0.85);
    box-shadow: 0 4px 20px rgba(200, 16, 46, 0.05);
}

.logo {
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: -0.5px;
}

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

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

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

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

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-gradient);
    transition: var(--transition);
}

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

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

/* -------------------------------------------
   HERO SECTION
   ------------------------------------------- */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 1rem;
    position: relative;
    background: radial-gradient(circle at center, rgba(200, 16, 46, 0.05) 0%, transparent 60%);
}

.badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    border-radius: 50px;
    background: rgba(200, 16, 46, 0.05);
    border: 1px solid rgba(200, 16, 46, 0.3);
    color: var(--accent-1);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
    animation: fadeInDown 0.8s ease-out forwards;
}

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

.gradient-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    max-width: 600px;
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
}

.cta-group {
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 0.8rem 1.8rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
}

.btn-primary {
    background: var(--accent-gradient);
    color: #fff;
    box-shadow: 0 4px 15px rgba(200, 16, 46, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(200, 16, 46, 0.3);
}

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

.btn-outline:hover {
    border-color: var(--accent-1);
    background: rgba(200, 16, 46, 0.04);
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0.6;
}

.mouse {
    width: 24px;
    height: 36px;
    border: 2px solid var(--text-secondary);
    border-radius: 20px;
    position: relative;
}

.mouse::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: scroll 1.5s infinite;
}

@keyframes scroll {
    0% { transform: translate(-50%, 0); opacity: 1; }
    100% { transform: translate(-50%, 15px); opacity: 0; }
}

/* -------------------------------------------
   SECTION COMPONENTS
   ------------------------------------------- */
.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

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

.section-header h2 span {
    color: var(--accent-1);
}

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

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
}

.text-card h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    letter-spacing: -0.5px;
}

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

.math-box {
    background: rgba(200, 16, 46, 0.03);
    border-left: 3px solid var(--accent-1);
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 4px 8px 8px 4px;
    font-size: 1rem;
    overflow-x: auto;
    overflow-y: hidden;
}

.math-box.glow {
    box-shadow: 0 0 20px rgba(200, 16, 46, 0.08);
    border: 1px solid rgba(200, 16, 46, 0.2);
    border-left: 4px solid var(--accent-1);
}

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

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

.feature-card {
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: rgba(200, 16, 46, 0.4);
    box-shadow: 0 10px 30px rgba(200, 16, 46, 0.1);
}

.math-display {
    margin: 1rem 0;
    padding: 1rem 0;
}

.canvas-wrapper {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 12px;
    overflow: hidden;
    background: radial-gradient(circle, rgba(200, 16, 46, 0.04) 0%, transparent 70%);
}

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

.text-center {
    text-align: center;
}

/* -------------------------------------------
   SECTION IA (DÉPLIANTE)
   ------------------------------------------- */

.ia-details {
    padding: 1.5rem 2rem;
    transition: var(--transition);
    cursor: default;
}

.ia-summary {
    cursor: pointer;
    list-style: none; /* Hide default triangle in many browsers */
    outline: none;
    display: flex;
    align-items: center;
}

.ia-summary::-webkit-details-marker {
    display: none; /* Hide default triangle in WebKit */
}

/* Custom triangle/arrow */
.ia-summary::after {
    content: '+';
    margin-left: auto;
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--accent-1);
    transition: transform 0.3s ease;
}

.ia-details[open] .ia-summary::after {
    transform: rotate(45deg); /* Transform into a cross */
}

.ia-content {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px dashed rgba(200, 16, 46, 0.2);
    font-size: 0.95rem;
    color: var(--text-main);
    animation: fadeDown 0.4s ease forwards;
}

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

.ia-content p, .ia-content ul, .ia-content ol {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.ia-content ul, .ia-content ol {
    padding-left: 2rem;
}

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

.ia-quote {
    background: rgba(200, 16, 46, 0.03);
    border-left: 3px solid var(--accent-1);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    border-radius: 0 8px 8px 0;
}

@keyframes fadeDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* -------------------------------------------
   FOOTER
   ------------------------------------------- */
.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    border-bottom: 1px dashed rgba(200, 16, 46, 0.4);
    padding-bottom: 2px;
    transition: var(--transition);
    margin: 0 10px;
}

.footer-link:hover {
    color: var(--accent-1);
    border-bottom-color: var(--accent-1);
}

.copyright {
    text-align: center;
    color: rgba(43, 29, 31, 0.5);
    font-size: 0.85rem;
    margin-top: 2rem;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
}

/* -------------------------------------------
   ANIMATIONS & RESPONSIVE
   ------------------------------------------- */
.reveal-up {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    opacity: 0;
    animation: fadeIn 1s ease-out forwards;
    animation-delay: 0.3s;
}

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

@media (max-width: 768px) {
    .glass-nav {
        padding: 1rem;
    }
    
    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(255, 253, 249, 0.98);
        flex-direction: column;
        gap: 0;
        clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
        transition: var(--transition);
        border-bottom: 1px solid var(--border-light);
    }

    .nav-links.active {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }

    .nav-links li a {
        display: block;
        padding: 1rem 2rem;
        border-bottom: 1px solid rgba(0,0,0,0.03);
    }

    .menu-btn {
        display: block;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .grid-2 {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .reverse-mobile {
        display: flex;
        flex-direction: column-reverse;
    }

    .section {
        padding: 4rem 0;
    }
}

/* -------------------------------------------
   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;
    }
}
