/* MATISSE DESIGN SYSTEM - NEURO VERSION */
:root {
    /* Palette Fauviste Organique */
    --color-bg: #0f1115;
    /* Noir profond */
    --color-text: #e0e0e0;
    --color-primary: #00C896;
    /* Vert Émeraude (Neurones actifs) */
    --color-secondary: #4D61FC;
    /* Bleu Nuit (Profondeur) */
    --color-accent: #FF6B6B;
    /* Orange Vif (Stimulation) */
    --color-glass: rgba(255, 255, 255, 0.05);
    --color-glass-border: rgba(255, 255, 255, 0.1);

    /* Typography */
    --font-narrative: 'Outfit', sans-serif;
    --font-tech: 'Inter', monospace;
}

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

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-narrative);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.5s ease;
}

/* --- NAVIGATION & SWITCH --- */
.glass-panel {
    background: var(--color-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--color-glass-border);
    border-radius: 16px;
    padding: 1.5rem;
}

nav {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 800px;
    z-index: 1000;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    width: 100%;
    align-items: center;
}

.home-link {
    color: var(--color-text);
    text-decoration: none;
    font-weight: 700;
    letter-spacing: 1px;
}

.switch-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.switch-label {
    font-size: 0.9rem;
    opacity: 0.7;
}

.expert-label {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--color-primary);
}

.badge {
    background: var(--color-primary);
    color: #000;
    font-size: 0.6rem;
    padding: 2px 5px;
    border-radius: 4px;
    font-weight: bold;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #333;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

input:checked+.slider {
    background-color: var(--color-primary);
}

input:checked+.slider:before {
    transform: translateX(18px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* --- SCROLLYTELLING SECTIONS --- */
.scrolly-container {
    padding-top: 100px;
}

.hero-section {
    height: 90vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

h1 {
    font-size: 4rem;
    background: linear-gradient(45deg, var(--color-text), var(--color-primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
}

.subtitle {
    font-size: 1.5rem;
    opacity: 0.8;
    max-width: 600px;
}

.content-section {
    min-height: 80vh;
    padding: 4rem 10%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4rem;
    position: relative;
}

.text-content {
    flex: 1;
    max-width: 600px;
    position: relative;
}

.text-content.reverse {
    text-align: right;
}

/* --- DUAL LAYER SYSTEM --- */
.narrative-layer h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--color-accent);
}

.narrative-layer p {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
}

.technical-layer {
    margin-top: 2rem;
    border-left: 3px solid var(--color-primary);
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s ease;
    filter: blur(5px);
    position: absolute;
    width: 100%;
    top: 100%;
}

/* --- MODE EXPERT ACTIVE --- */
body.mode-expert .technical-layer {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    filter: blur(0);
    position: relative;
    /* Reprend sa place dans le flux */
    top: auto;
}

body.mode-expert .narrative-layer {
    opacity: 0.6;
    /* Diminue l'importance du narratif */
}

/* Typography Expert */
.technical-layer h3 {
    font-family: var(--font-tech);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

.technical-layer p {
    font-family: var(--font-tech);
    font-size: 0.9rem;
    color: #aaa;
}

.source.link a {
    color: var(--color-primary);
    text-decoration: none;
    border-bottom: 1px dotted var(--color-primary);
}

.concept-tag {
    display: inline-block;
    background: rgba(0, 200, 150, 0.1);
    color: var(--color-primary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-right: 5px;
    font-family: var(--font-tech);
}

/* --- ANIMATIONS --- */
.fade-in-up {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

.delay-1 {
    transition-delay: 0.2s;
}

.delay-2 {
    transition-delay: 0.4s;
}

/* Visual Metaphor Placeholders */
.visual-metaphor {
    flex: 1;
    height: 300px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--color-glass-border);
    border-radius: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    transition: all 0.5s ease;
}

/* Metaphore Bibliothèque */
.book-shelf {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    height: 100px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 5px;
}

.book {
    width: 20px;
    height: 80px;
    background: var(--color-secondary);
    border-radius: 2px;
    opacity: 0.8;
    transition: all 0.5s ease;
}

.book.hidden-book {
    transform: translateY(-20px);
    opacity: 0.2;
    filter: blur(2px);
}

body.mode-expert .book.hidden-book {
    opacity: 0.6;
    filter: blur(0);
    border: 1px dashed var(--color-primary);
    background: transparent;
}

/* Metaphore Neurone (Generique) */
.visual-metaphor::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(0, 200, 150, 0.1) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.5s;
}

body.mode-expert .visual-metaphor::before {
    opacity: 1;
}

/* 1. Timer (Complex Molecular Clock) */
.timer-metaphor {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.timer-ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid transparent;
    transition: all 0.5s ease;
}

/* Outer Ring (Long Term) */
.ring-outer {
    width: 120px;
    height: 120px;
    border-top-color: rgba(255, 255, 255, 0.1);
    border-bottom-color: rgba(255, 255, 255, 0.1);
    animation: spin 10s linear infinite;
}

/* Middle Ring (Stabilization) */
.ring-middle {
    width: 80px;
    height: 80px;
    border-left-color: var(--color-secondary);
    border-right-color: var(--color-secondary);
    animation: spin 5s linear infinite reverse;
}

/* Inner Ring (Transcription) */
.ring-inner {
    width: 50px;
    height: 50px;
    border-top-color: var(--color-primary);
    animation: spin 2s linear infinite;
}

/* Core (The Memory) */
.timer-core {
    width: 10px;
    height: 10px;
    background: var(--color-accent);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--color-accent);
    animation: pulse 2s ease-in-out infinite;
}

/* Mode Expert Effects */
body.mode-expert .ring-outer {
    border-color: rgba(255, 255, 255, 0.2);
    border-style: dashed;
}

body.mode-expert .ring-middle {
    border-color: var(--color-secondary);
    width: 90px;
    height: 90px;
}

body.mode-expert .ring-inner {
    border-color: var(--color-primary);
    border-width: 4px;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.5;
        transform: scale(0.8);
    }

    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* 2. Layers */
.layers-metaphor {
    flex-direction: column;
    gap: 10px;
}

.layer {
    width: 120px;
    height: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    transition: all 0.5s ease;
}

body.mode-expert .layer.l1 {
    background: var(--color-primary);
    width: 140px;
}

body.mode-expert .layer.l2 {
    background: var(--color-secondary);
    width: 100px;
}

body.mode-expert .layer.l3 {
    background: var(--color-accent);
    width: 130px;
}

body.mode-expert .layer.l4 {
    background: #888;
    width: 110px;
}

/* 3. Signals */
.signal-metaphor {
    position: relative;
}

.neuron-core {
    width: 40px;
    height: 40px;
    background: var(--color-secondary);
    border-radius: 50%;
    box-shadow: 0 0 20px var(--color-secondary);
}

.signal-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--color-primary);
    border-radius: 50%;
    animation: signalMove 2s infinite;
}

.d2 {
    animation-delay: 0.5s;
}

.d3 {
    animation-delay: 1s;
}

@keyframes signalMove {
    0% {
        transform: translate(40px, 0);
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: translate(0, 0);
        opacity: 0;
    }
}

/* 4. Stone Tablet (Etymology) */
.stone-metaphor {
    perspective: 1000px;
}

.stone-tablet {
    font-family: 'Times New Roman', serif;
    font-size: 3rem;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.1);
    letter-spacing: 5px;
    text-shadow: -1px -1px 0 rgba(255, 255, 255, 0.1), 1px 1px 0 rgba(0, 0, 0, 0.5);
    transform: rotateY(20deg) rotateX(10deg);
    transition: all 1s ease;
}

body.mode-expert .stone-tablet {
    color: var(--color-text);
    text-shadow: 0 0 10px var(--color-primary);
    transform: rotateY(0) rotateX(0);
    font-family: sans-serif;
    /* Modernisation instantanée */
    content: "ENGRAMME";
    /* Note: content change requires JS or pseudo-element trick, keeping font change for simplicity implies modernisation */
}

@media (max-width: 768px) {
    .content-section {
        flex-direction: column;
        text-align: center;
        padding: 4rem 5%;
    }

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

    .visual-metaphor {
        width: 100%;
        margin-bottom: 2rem;
    }

    h1 {
        font-size: 2.5rem;
    }
}