/* === VARIABLES & RESET === */
:root {
    --bg-color: #0a0a0c;
    --text-main: #e0e0e0;
    --accent-amber: #FFB000;
    --font-mono: 'Courier New', Courier, monospace;
    --font-sans: 'Inter', 'Segoe UI', Roboto, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-sans);
    overflow-x: hidden;
    height: 100vh;
}

/* === EFFET CRT (Scanlines) === */
.crt-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 4px, 3px 100%;
    pointer-events: none;
    z-index: 999;
}

/* === BOOT SEQUENCE === */
#boot-screen {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: #000; z-index: 100;
    display: flex; flex-direction: column; justify-content: center;
    padding: 2rem; font-family: var(--font-mono); color: var(--accent-amber);
    transition: opacity 0.5s ease-out, visibility 0.5s;
}

.log-line {
    opacity: 0; margin-bottom: 0.5rem; font-size: 1.1rem;
    text-shadow: 0 0 5px var(--accent-amber);
}

/* === HERO SECTION === */
.hero {
    height: 100vh; display: flex; flex-direction: column;
    justify-content: center; align-items: flex-start;
    padding: 0 10%; opacity: 0; transform: translateY(20px);
    transition: opacity 1s ease-out 0.5s, transform 1s ease-out 0.5s;
}

.hero.visible { opacity: 1; transform: translateY(0); }

.hero.fade-out {
    opacity: 0 !important; transform: scale(1.05) !important;
    pointer-events: none;
}

.hero h1 {
    font-family: var(--font-mono); font-size: clamp(3rem, 6vw, 5rem);
    font-weight: 700; margin-bottom: 0.5rem; color: #fff; letter-spacing: -2px;
}

.hero h2 {
    font-size: clamp(1.2rem, 2vw, 1.8rem); font-weight: 300;
    color: var(--text-main); margin-bottom: 2rem; opacity: 0.8;
}

.hero h2 span { color: var(--accent-amber); font-family: var(--font-mono); }

/* === BOUTON CTA === */
.cta-btn {
    background: transparent; color: var(--accent-amber);
    font-family: var(--font-mono); font-size: 1rem;
    padding: 1rem 2rem; border: 1px solid var(--accent-amber);
    cursor: pointer; position: relative; overflow: hidden;
    transition: all 0.3s ease; text-transform: uppercase; letter-spacing: 2px;
}

.cta-btn .f10-key { color: #ffffff; font-weight: bold; transition: color 0.3s ease; }

.cta-btn:hover {
    background: var(--accent-amber); color: var(--bg-color);
    box-shadow: 0 0 15px var(--accent-amber);
}

.cta-btn:hover .f10-key { color: var(--bg-color); }

.cta-btn:hover::before {
    content: ''; position: absolute; top: 0; left: -100%;
    width: 100%; height: 100%; background: rgba(255, 255, 255, 0.2);
    animation: glitch-slide 0.3s forwards;
}

@keyframes glitch-slide { 100% { left: 100%; } }

/* === SECTION DASHBOARD (COMPÉTENCES) === */
.dashboard {
    min-height: 100vh; padding: 5rem 10%;
    display: none; flex-direction: column; justify-content: center;
    opacity: 0; transform: scale(0.98);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.dashboard.visible { opacity: 1; transform: scale(1); }

.section-title {
    font-family: var(--font-mono); color: var(--text-main);
    font-size: 2rem; margin-bottom: 3rem;
    border-bottom: 1px solid rgba(255, 176, 0, 0.3);
    padding-bottom: 1rem; display: inline-block;
}

.section-title::before {
    content: '>'; color: var(--accent-amber); margin-right: 15px;
    animation: blink 1s infinite;
}

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.modules-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem; width: 100%;
}

.module-card {
    background: rgba(255, 176, 0, 0.03); border: 1px solid rgba(255, 176, 0, 0.15);
    padding: 2rem; transition: all 0.3s ease; position: relative; overflow: hidden;
}

.module-card::before {
    content: ''; position: absolute; top: 0; left: 0;
    width: 2px; height: 100%; background: var(--accent-amber);
    transform: scaleY(0); transition: transform 0.3s ease; transform-origin: bottom;
}

.module-card:hover {
    border-color: rgba(255, 176, 0, 0.5); background: rgba(255, 176, 0, 0.05);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5); transform: translateY(-5px);
}

.module-card:hover::before { transform: scaleY(1); }

.module-header {
    display: flex; align-items: center; margin-bottom: 2rem;
    border-bottom: 1px dashed rgba(255, 176, 0, 0.3); padding-bottom: 1rem;
}

.module-icon { width: 30px; height: 30px; fill: var(--accent-amber); margin-right: 15px; }

.module-card h4 { font-family: var(--font-mono); font-size: 1.2rem; color: #fff; letter-spacing: 1px; }

.module-list { list-style: none; font-family: var(--font-mono); font-size: 0.95rem; }

.module-list li {
    display: flex; justify-content: space-between; margin-bottom: 1rem;
    color: var(--text-main); position: relative;
}

.module-list li::after {
    content: ''; position: absolute; bottom: 5px; left: 0; right: 0;
    border-bottom: 1px dotted rgba(224, 224, 224, 0.2); z-index: -1;
}
/* === NAVIGATION BAR === */
.system-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(10, 10, 12, 0.95); /* Fond légèrement transparent */
    border-bottom: 1px solid rgba(255, 176, 0, 0.2);
    z-index: 1000;
    transform: translateY(-100%); /* Cachée tout en haut par défaut */
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(5px); /* Floute légèrement ce qui passe en dessous */
}

/* La classe qui déclenche l'apparition */
.system-nav.booted {
    transform: translateY(0);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

/* Un petit effet de "chargement" sous la barre */
.system-nav.booted::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    height: 1px;
    background: var(--accent-amber);
    /* On remplace 'infinite' par '2' pour jouer l'animation exactement 2 fois, puis elle s'arrête */
    animation: scanline 2s ease-in-out 2 forwards; 
}

@keyframes scanline {
    0% { width: 0; opacity: 1; }
    50% { width: 100%; opacity: 0.5; }
    100% { width: 0; opacity: 1; left: auto; right: 0; }
}

.nav-links {
    display: flex;
    gap: 3rem;
}

.nav-item {
    font-family: var(--font-mono);
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: bold;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.nav-prefix {
    color: var(--accent-amber);
    opacity: 0;
    margin-right: 5px;
    transform: translateX(-10px);
    transition: all 0.3s ease;
}

/* Effet hacker au survol des liens */
.nav-item:hover {
    color: var(--accent-amber);
    text-shadow: 0 0 8px rgba(255, 176, 0, 0.4);
}

.nav-item:hover .nav-prefix {
    opacity: 1;
    transform: translateX(0);
}

.nav-socials {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.social-icon {
    width: 24px;
    height: 24px;
    fill: var(--text-main);
    transition: all 0.3s ease;
}

.social-icon:hover {
    fill: var(--accent-amber);
    transform: scale(1.1) translateY(-2px);
    filter: drop-shadow(0 0 5px rgba(255, 176, 0, 0.5));
}

/* === SCROLL FLUIDE === */
html { scroll-behavior: smooth; }

/* === STRUCTURE GLOBALE DES SECTIONS === */
.dashboard-section {
    padding: 6rem 10% 4rem 10%;
    min-height: auto;
}

/* === SECTION WHOAMI === */
.whoami-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
}
@media (max-width: 768px) {
    .whoami-grid { grid-template-columns: 1fr; }
}

.terminal-card {
    background: rgba(10, 10, 12, 0.8);
    border: 1px solid rgba(255, 176, 0, 0.2);
    font-family: var(--font-mono);
}
.card-header {
    background: rgba(255, 176, 0, 0.1);
    border-bottom: 1px solid rgba(255, 176, 0, 0.2);
    padding: 0.5rem 1rem;
    color: var(--accent-amber);
    font-weight: bold;
}
.card-body {
    padding: 1.5rem;
    color: var(--text-main);
    line-height: 1.6;
}
.card-body .label {
    color: var(--accent-amber);
    display: inline-block;
    width: 120px;
}

/* === SECTION OPERATIONS (EN CONSTRUCTION) === */
.construction-box {
    border: 1px dashed var(--accent-amber);
    background: repeating-linear-gradient(
        45deg,
        rgba(255, 176, 0, 0.02),
        rgba(255, 176, 0, 0.02) 10px,
        transparent 10px,
        transparent 20px
    );
    padding: 4rem;
    text-align: center;
    font-family: var(--font-mono);
}
.glitch-icon {
    font-size: 3rem;
    color: var(--accent-amber);
    margin-bottom: 1rem;
    animation: blink 1s infinite;
}
.construction-box h4 {
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 0.5rem;
}
.construction-box p {
    color: var(--text-main);
    margin-bottom: 2rem;
    opacity: 0.7;
}
.loading-bar {
    width: 60%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}
.loading-fill {
    position: absolute;
    top: 0; left: 0; height: 100%;
    width: 30%;
    background: var(--accent-amber);
    animation: load 2s ease-in-out infinite alternate;
}
@keyframes load {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(350%); }
}

/* === SECTION TRACE LOGS (TIMELINE) === */
.timeline {
    border-left: 2px solid rgba(255, 176, 0, 0.3);
    margin-left: 20px;
    padding-left: 30px;
}
.timeline-item {
    position: relative;
    margin-bottom: 3rem;
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: -37px;
    top: 0;
    width: 12px;
    height: 12px;
    background: var(--bg-color);
    border: 2px solid var(--accent-amber);
    border-radius: 50%;
    transition: all 0.3s ease;
}
.timeline-item:hover::before {
    background: var(--accent-amber);
    box-shadow: 0 0 10px var(--accent-amber);
}
.timeline-date {
    font-family: var(--font-mono);
    color: var(--accent-amber);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}
.timeline-content h4 {
    font-family: var(--font-mono);
    color: #fff;
    margin-bottom: 0.5rem;
}
.timeline-content p {
    color: var(--text-main);
    opacity: 0.8;
}
/* === SYSTÈME DE SECTIONS DÉPLIANTES (ACCORDÉON) === */
.section-title {
    cursor: pointer; /* Transforme la souris en main */
    user-select: none; /* Empêche de surligner le texte par erreur en cliquant */
    transition: text-shadow 0.3s ease;
}

.section-title:hover {
    text-shadow: 0 0 8px rgba(255, 176, 0, 0.6);
}

/* L'indicateur [ - ] ou [ + ] à la fin du titre */
.section-title::after {
    content: ' [ - ]';
    font-size: 1.2rem;
    margin-left: 20px;
    color: rgba(255, 176, 0, 0.5);
    vertical-align: middle;
}

/* Quand la section a la classe 'collapsed', on change le symbole */
.dashboard-section.collapsed .section-title::after {
    content: ' [ + ]';
    color: var(--accent-amber);
}

/* L'animation d'ouverture/fermeture magique avec CSS Grid */
.collapsible-wrapper {
    display: grid;
    grid-template-rows: 1fr;
    transition: grid-template-rows 0.4s ease-out;
}

.dashboard-section.collapsed .collapsible-wrapper {
    grid-template-rows: 0fr; /* Plie la div à 0px de haut */
}

.collapsible-inner {
    overflow: hidden; /* Cache le contenu qui dépasse pendant l'animation */
}
/* === TOOLTIPS (AIDE COMPÉTENCES) === */
.help-icon {
    color: var(--accent-amber);
    font-size: 0.85rem;
    cursor: help;
    margin-left: 8px;
    opacity: 0.6;
    position: relative; /* Indispensable pour que le pop-up se fixe dessus */
    transition: opacity 0.3s ease, text-shadow 0.3s ease;
}

.help-icon:hover {
    opacity: 1;
    text-shadow: 0 0 8px var(--accent-amber);
}

/* Le corps du petit pop-up */
.help-icon::after {
    content: attr(data-tooltip); /* Récupère le texte de l'attribut HTML */
    position: absolute;
    bottom: 150%; 
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 10, 12, 0.98);
    border: 1px solid var(--accent-amber);
    color: var(--text-main);
    padding: 0.5rem 0.8rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    line-height: 1.4;
    text-align: center;
    width: max-content;
    max-width: 220px; /* Pour éviter que le texte soit trop long sur une ligne */
    white-space: normal;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.8);
    pointer-events: none; /* Empêche le curseur de bugger si on survole le pop-up */
}

/* La petite flèche ambrée en bas du pop-up */
.help-icon::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: var(--accent-amber) transparent transparent transparent;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

/* L'animation d'apparition au survol */
.help-icon:hover::after {
    opacity: 1;
    visibility: visible;
    bottom: calc(100% + 10px); /* Glisse légèrement vers le haut */
}

.help-icon:hover::before {
    opacity: 1;
    visibility: visible;
    bottom: calc(100% + 4px);
}

.tech-name { background: var(--bg-color); padding-right: 10px; }
.tech-status { background: var(--bg-color); padding-left: 10px; color: var(--accent-amber); }