/* Encyclomédia - Régie F1 Kiosque */

:root {
    --bg-dark: #0a0a0f;
    --bg-panel: #12121a;
    --bg-card: #1a1a25;
    --accent-red: #e63946;
    --accent-blue: #4895ef;
    --accent-cyan: #4cc9f0;
    --accent-gold: #f4a261;
    --accent-green: #2a9d8f;
    --text-primary: #f8f8f2;
    --text-secondary: #a0a0b0;
    --text-muted: #606070;
    --glow-red: rgba(230, 57, 70, 0.4);
    --glow-blue: rgba(72, 149, 239, 0.4);
    --glow-cyan: rgba(76, 201, 240, 0.3);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Source Sans 3', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
}

.site-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo { height: 20px; width: auto; }
.logo img { height: 100%; width: auto; }

.sound-toggle {
    background: var(--bg-card);
    border: 1px solid var(--text-muted);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.sound-toggle:hover { border-color: var(--accent-cyan); color: var(--accent-cyan); }
.sound-toggle.active { background: var(--accent-red); border-color: var(--accent-red); color: white; }

.hero {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse at 20% 80%, var(--glow-red) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, var(--glow-blue) 0%, transparent 50%);
    opacity: 0.3;
    animation: pulse-bg 8s ease-in-out infinite alternate;
}
@keyframes pulse-bg { from { opacity: 0.2; } to { opacity: 0.4; } }

.hero-content { position: relative; z-index: 1; max-width: 800px; }
.hero-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--accent-red);
    margin-bottom: 1.5rem;
    opacity: 0;
    animation: fade-in 1s ease 0.3s forwards;
}
.hero h1 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(3rem, 10vw, 7rem);
    line-height: 0.95;
    letter-spacing: 0.02em;
    margin-bottom: 1.5rem;
    color: #f8f8f2;
    opacity: 0;
    animation: fade-in 1s ease 0.5s forwards;
}
.hero h1 .highlight { color: var(--accent-red); }
.hero-subtitle {
    font-size: 1.25rem;
    font-weight: 300;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 3rem;
    opacity: 0;
    animation: fade-in 1s ease 0.7s forwards;
}
.scroll-indicator {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    opacity: 0;
    animation: fade-in 1s ease 1s forwards;
}
.scroll-indicator::after {
    content: '';
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, var(--accent-cyan), transparent);
    animation: scroll-line 2s ease-in-out infinite;
}
@keyframes scroll-line { 0%, 100% { transform: scaleY(0.5); opacity: 0.3; } 50% { transform: scaleY(1); opacity: 1; } }
@keyframes fade-in { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-red), var(--accent-cyan));
    z-index: 1000;
    transform-origin: left;
    transform: scaleX(0);
}

.scrollytelling { position: relative; }
.sticky-container {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.8s ease;
}
.sticky-container.visible { opacity: 1; }

.schema-container {
    position: relative;
    width: 95vw;
    max-width: 1400px;
    height: 80vh;
    max-height: 750px;
}
.schema-bg {
    position: absolute;
    inset: 0;
    background: var(--bg-panel);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 8px;
    box-shadow: 0 0 60px rgba(0,0,0,0.5);
}
.schema-svg { position: absolute; inset: 0; width: 100%; height: 100%; }

.schema-element {
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.schema-element.visible { opacity: 1; transform: scale(1); }
.schema-element.highlight { filter: drop-shadow(0 0 15px var(--accent-cyan)); }

.connection-line {
    stroke-width: 2.5;
    fill: none;
    opacity: 0;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
}
.connection-line.visible { opacity: 1; animation: draw-line 1s ease forwards; }
@keyframes draw-line { to { stroke-dashoffset: 0; } }
.led-blink { animation: led-blink 1.5s ease-in-out infinite; }
@keyframes led-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

.scroll-sections { position: relative; z-index: 10; }
.scroll-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 2rem;
}
.section-content {
    max-width: 380px;
    background: rgba(10, 10, 15, 0.95);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 2rem;
    backdrop-filter: blur(10px);
    opacity: 0;
    transform: translateX(-30px);
    transition: all 0.6s ease;
}
.scroll-section.active .section-content { opacity: 1; transform: translateX(0); }
.scroll-section:nth-child(even) { justify-content: flex-end; }
.scroll-section:nth-child(even) .section-content { transform: translateX(30px); }
.scroll-section:nth-child(even).active .section-content { transform: translateX(0); }

.section-number {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 3rem;
    color: #e63946;
    opacity: 1;
    line-height: 1;
    margin-bottom: 0.5rem;
}
.section-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.5rem;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    color: #ffffff;
}
.section-text { color: var(--text-secondary); font-size: 0.95rem; font-weight: 300; }
.section-text strong { color: #4cc9f0 !important; font-weight: 600; }

.tech-note {
    margin-top: 1rem;
    padding: 0.75rem;
    background: rgba(76, 201, 240, 0.05);
    border-left: 2px solid var(--accent-cyan);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.realisations-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; margin-top: 1rem; }
.realisation-card {
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 4px;
    padding: 0.5rem;
    transition: all 0.3s ease;
}
.realisation-card:hover { border-color: var(--accent-cyan); }
.realisation-num { font-family: 'Bebas Neue', sans-serif; font-size: 1.1rem; color: var(--accent-red); }
.realisation-title { font-size: 0.7rem; color: var(--text-primary); font-weight: 600; }
.realisation-desc { font-size: 0.6rem; color: var(--text-muted); }

.six-programs {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 4rem 2rem;
    background: var(--bg-dark);
}
.six-programs h2 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-align: center;
}
.six-programs .subtitle {
    color: var(--text-secondary);
    max-width: 600px;
    margin-bottom: 3rem;
    text-align: center;
}
.programs-container {
    max-width: 900px;
    width: 100%;
}
.programs-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}
.program-card {
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}
.program-card:hover {
    border-color: var(--accent-cyan);
    transform: translateY(-5px);
}
.program-num {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2rem;
    color: var(--accent-red);
    margin-bottom: 0.5rem;
}
.program-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}
.program-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
}
@media (max-width: 768px) {
    .programs-grid { grid-template-columns: repeat(2, 1fr); }
    .six-programs h2 { font-size: 1.8rem; }
}
@media (max-width: 480px) {
    .programs-grid { grid-template-columns: 1fr; }
}

.outro {
    min-height: 50vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(to bottom, var(--bg-dark), #050508);
}
.outro h2 { font-family: 'Bebas Neue', sans-serif; font-size: 2.5rem; margin-bottom: 1rem; }
.outro p { color: var(--text-secondary); max-width: 600px; margin-bottom: 2rem; }
.outro-source {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 1rem;
    background: var(--bg-panel);
    border-radius: 4px;
}

.final-schema {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--bg-dark);
}
.final-schema h2 { font-family: 'Bebas Neue', sans-serif; font-size: 2rem; margin-bottom: 0.5rem; text-align: center; }
.final-schema .subtitle { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 2rem; text-align: center; }
.final-schema-container {
    position: relative;
    width: 95vw;
    max-width: 1400px;
    height: 75vh;
    max-height: 750px;
    background: var(--bg-panel);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    box-shadow: 0 0 60px rgba(0,0,0,0.5);
    overflow: hidden;
}
.final-schema-container .schema-svg { width: 100%; height: 100%; }
.final-schema-container .schema-element { opacity: 1; transform: scale(1); cursor: pointer; transition: filter 0.3s ease; }
.final-schema-container .schema-element:hover { filter: drop-shadow(0 0 12px var(--accent-cyan)); }
.final-schema-container .connection-line { opacity: 1; stroke-dashoffset: 0; }

.tooltip {
    position: fixed;
    max-width: 320px;
    background: rgba(18, 18, 26, 0.98);
    border: 1px solid var(--accent-cyan);
    border-radius: 8px;
    padding: 1.25rem;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5), 0 0 20px var(--glow-cyan);
    pointer-events: none;
}
.tooltip.visible { opacity: 1; visibility: visible; transform: translateY(0); pointer-events: auto; }
.tooltip-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.3rem;
    color: var(--accent-cyan);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.tooltip-title::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--accent-red);
    border-radius: 50%;
    animation: led-blink 1s ease-in-out infinite;
}
.tooltip-text { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.6; }
.tooltip-close {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
}
.tooltip-close:hover { color: var(--text-primary); }

@media (max-width: 900px) {
    .schema-container { height: 60vh; }
    .scroll-section { padding: 1rem; }
    .section-content { max-width: 100%; padding: 1.5rem; }
    .scroll-section:nth-child(even) { justify-content: flex-start; }
}
@media (max-width: 768px) {
    .tooltip { left: 1rem !important; right: 1rem !important; bottom: 1rem !important; top: auto !important; max-width: none; transform: translateY(20px); }
    .tooltip.visible { transform: translateY(0); }
    .final-schema-container { height: 60vh; }
    .final-schema h2 { font-size: 1.5rem; }
}
