/* =========================================
   1. VARIABLES & RESET
   ========================================= */
:root {
    --bg-color: #0f172a;       /* Fond sombre principal */
    --bg-secondary: #1e293b;   /* Fond cartes sombre */
    --bg-light: #ffffff;       /* Fond clair (Articles/Contact) */
    --text-color: #e2e8f0;     /* Texte clair */
    --text-dark: #2c3e50;      /* Texte sombre */
    --text-muted: #94a3b8;     /* Gris */
    
    --accent-color: #38bdf8;   /* Cyan (Design SysAdmin) */
    --accent-hover: #0ea5e9;
    --primary-blue: #007bff;   /* Bleu standard */
    --warning-color: #f39c12;  /* Orange (Veille Tech) */
    
    --font-main: 'Roboto', sans-serif;
    --font-mono: 'Fira Code', monospace;
    --nav-height: 70px; /* Réduit un peu la nav car on a les bandeaux */
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }

/* =========================================
   2. LAYOUT & NAVIGATION (HEADER STACKÉ)
   ========================================= */
/* HEADER FIXE ET EMPILÉ */
#main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: auto; /* S'adapte au contenu (2 tickers + nav) */
    background-color: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: transform 0.3s ease-in-out;
}

/* Classe ajoutée par JS pour cacher le header */
.header-hidden {
    transform: translateY(-100%);
}

/* Cale pour compenser le header (30px + 30px + 70px = 130px) */
.header-spacer {
    height: 130px;
}

/* --- Style des BANDEAUX dans le Header (Version Slim) --- */
.news-ticker.header-ticker {
    width: 100%;
    height: 30px; /* Plus fin */
    line-height: 30px;
    font-size: 0.85rem;
    background: #1e293b;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex;
    overflow: hidden;
    position: relative;
    z-index: 901;
}

.news-ticker.header-ticker .ticker-title {
    background: var(--accent-color);
    color: #fff;
    padding: 0 10px; /* Padding réduit */
    font-weight: bold;
    font-size: 0.7rem; /* Titre plus petit */
    z-index: 2;
    box-shadow: 5px 0 10px rgba(0,0,0,0.5);
}

/* Couleur spécifique pour le 2ème bandeau (Veille) */
.ticker-title.tech-news {
    background-color: var(--warning-color);
}

.ticker-wrap {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.ticker-move {
    display: inline-block;
    white-space: nowrap;
    padding-left: 100%;
    animation: ticker 40s linear infinite; /* Un peu plus lent car plus petit */
}

.ticker-move:hover { animation-play-state: paused; }

.ticker-item {
    display: inline-block;
    padding: 0 1.5rem;
    color: #cbd5e1;
}

.ticker-item a:hover { color: var(--accent-color); text-decoration: underline; }

.ticker-date {
    color: var(--accent-color);
    font-family: var(--font-mono);
    font-size: 0.8em;
    margin-right: 5px;
}

@keyframes ticker {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-100%, 0, 0); }
}

/* --- NAVIGATION --- */
.navbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 5%; 
    height: var(--nav-height); /* 70px */
    width: 100%;
    position: relative;
}

.logo { font-size: 1.5rem; font-weight: 700; font-family: var(--font-mono); letter-spacing: -1px; }
.dot { color: var(--accent-color); }

/* Liens Desktop */
.nav-links { display: flex; }
.nav-links li { margin-left: 2rem; }
.nav-links a { font-weight: 500; font-size: 0.95rem; position: relative; }
.nav-links a:hover, .nav-links a.active { color: var(--accent-color); }
.nav-links a.active::after {
    content: ''; position: absolute; width: 100%; height: 2px;
    bottom: -5px; left: 0; background-color: var(--accent-color);
}

/* Burger Menu */
.burger { display: none; cursor: pointer; }
.burger div { width: 25px; height: 3px; background: var(--text-color); margin: 5px; transition: 0.3s; }

/* =========================================
   3. HERO & MACHINE A ECRIRE
   ========================================= */
.hero {
    min-height: 80vh;
    display: flex; align-items: center; justify-content: center;
    text-align: center; background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
    padding: 20px; color: #fff;
}
.hero h1 { font-size: 3.5rem; margin-bottom: 1rem; font-weight: 700; }
.hero-subtitle {
    font-size: 1.5rem; color: var(--accent-color); font-family: var(--font-mono);
    margin-bottom: 40px; min-height: 1.6em;
}
.cursor {
    display: inline-block; width: 10px; background-color: var(--accent-color);
    animation: blink 1s infinite; margin-left: 5px; font-weight: bold;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* =========================================
   4. COMPOSANTS (Cartes & Boutons)
   ========================================= */
.btn {
    display: inline-block; padding: 12px 25px; border-radius: 5px;
    font-weight: bold; font-family: var(--font-mono); transition: transform 0.3s ease;
    cursor: pointer;
}
.btn:hover { transform: translateY(-3px); }

.btn-primary, .btn.primary { background-color: var(--accent-color); color: var(--bg-color); border: none; }
.btn-primary:hover { background-color: var(--accent-hover); }

.btn-outline, .btn.secondary { 
    border: 2px solid var(--accent-color); 
    color: var(--accent-color); 
    background: transparent; 
}
.btn-outline:hover { background: rgba(56, 189, 248, 0.1); }

/* Grilles */
.grid-cards, .news-grid, .projects-grid, .competences-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; margin-top: 30px;
}

.page-content { padding-top: 40px; padding-bottom: 4rem; flex: 1; }
.container { padding: 0 10%; max-width: 1400px; margin: 0 auto; }

/* =========================================
   5. PAGES SPÉCIFIQUES
   ========================================= */

/* --- Projets --- */
.project-card {
    background: var(--bg-secondary); border: 1px solid rgba(255,255,255,0.1); padding: 30px;
    border-radius: 10px; transition: 0.3s;
    display: flex; flex-direction: column;
}
.project-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.2); }

.project-icon { font-size: 2.5rem; color: var(--accent-color); margin-bottom: 20px; }
.project-card h3 { font-size: 1.5rem; margin-bottom: 15px; font-weight: 700; }
.project-card p { color: var(--text-muted); margin-bottom: 20px; font-size: 0.95rem; }

.tech-stack { margin-top: auto; display: flex; flex-wrap: wrap; gap: 10px; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 15px;}
.tech-stack small {
    background: rgba(56, 189, 248, 0.1); color: var(--accent-color);
    padding: 5px 10px; border-radius: 4px; font-family: var(--font-mono); font-size: 0.8rem;
}

/* --- Actualités (Cartes) --- */
.news-card {
    background: var(--bg-light); border: 1px solid #e2e8f0; padding: 25px;
    border-radius: 10px; display: flex; flex-direction: column;
    color: var(--text-dark);
}
.news-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.1); }
.news-date { color: #64748b; font-size: 0.85rem; margin-bottom: 10px; display: block; }
.news-card h3 { font-size: 1.2rem; margin-bottom: 10px; color: var(--text-dark); }
.news-card p { color: #475569; font-size: 0.95rem; margin-bottom: 20px; flex: 1; }
.news-link { color: var(--primary-blue); font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }

/* --- Compétences --- */
.competence-card {
    background: var(--bg-light); color: var(--text-dark); padding: 30px;
    border-top: 4px solid var(--primary-blue); border-radius: 10px;
}
.competence-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.1); }
.competence-card .icon-header { font-size: 2.5rem; color: var(--primary-blue); text-align: center; margin-bottom: 20px; }
.competence-card h3 { text-align: center; margin-bottom: 20px; font-size: 1.4rem; }
.competence-card ul li { margin-bottom: 12px; padding-left: 20px; position: relative; color: #555; }
.competence-card ul li::before { content: "•"; color: var(--primary-blue); font-weight: bold; position: absolute; left: 0; }

/* --- Articles Détail --- */
.article-container { max-width: 800px; margin: 40px auto; padding: 0 20px; background: var(--bg-light); color: var(--text-dark); border-radius: 8px; }
.article-header h1 { font-size: 2.5em; color: var(--text-dark); }
.article-content { line-height: 1.8; font-size: 1.1em; margin-top: 30px; padding-bottom: 40px;}
.article-content h2 { margin-top: 40px; color: var(--primary-blue); border-left: 4px solid var(--primary-blue); padding-left: 15px; }
pre { background: #2d2d2d; color: #f8f8f2; padding: 20px; border-radius: 5px; overflow-x: auto; margin: 20px 0; border-left: 5px solid #ff9800; font-family: var(--font-mono); }

/* --- Parcours (Timeline) --- */
.timeline { position: relative; max-width: 900px; margin: 50px auto; }
.timeline::after { content: ''; position: absolute; width: 2px; background: rgba(56,189,248,0.3); top: 0; bottom: 0; left: 20px; }
.timeline-item { padding: 10px 40px; position: relative; width: 100%; margin-bottom: 60px; }
.timeline-content { padding: 20px; background: var(--bg-secondary); border-radius: 6px; border: 1px solid rgba(255,255,255,0.05); }
.timeline-date { font-family: var(--font-mono); color: var(--accent-color); font-weight: bold; margin-bottom: 0.5rem; display: block; }

@media(min-width: 768px) {
    .timeline::after { left: 50%; }
    .timeline-item { width: 50%; padding-left: 0; }
    
    .timeline-item:nth-child(odd) { left: 0; padding-right: 40px; text-align: right; }
    .timeline-item:nth-child(even) { left: 50%; padding-left: 40px; text-align: left; }

    .timeline-item:nth-child(even) .timeline-date { position: absolute; left: -140px; top: 20px; width: 100px; text-align: right; }
    .timeline-item:nth-child(odd) .timeline-date { position: absolute; right: -140px; top: 20px; width: 100px; text-align: left; }
    
    /* Points sur la ligne */
    .timeline-item::after {
        content: ''; position: absolute; width: 16px; height: 16px;
        background: var(--accent-color); border-radius: 50%; top: 25px; z-index: 1;
    }
    .timeline-item:nth-child(odd)::after { right: -8px; }
    .timeline-item:nth-child(even)::after { left: -8px; }
}

/* --- Contact --- */
.contact-wrapper { display: grid; grid-template-columns: 1fr; gap: 40px; margin-top: 30px; }
@media(min-width: 992px) { .contact-wrapper { grid-template-columns: 1fr 1.5fr; } }

.contact-info-col { background: #f8f9fa; padding: 30px; border-radius: 10px; color: var(--text-dark); }
.info-item { display: flex; align-items: center; margin-bottom: 20px; font-size: 1.05rem; }
.info-item i { color: var(--primary-blue); margin-right: 15px; width: 30px; text-align: center; }

.contact-form-col { background: var(--bg-light); padding: 30px; border-radius: 10px; border: 1px solid #eee; }
.form-group label { display: block; margin-bottom: 8px; font-weight: bold; color: #333; }
.form-group input, .form-group textarea {
    width: 100%; padding: 12px; border: 1px solid #ccc; border-radius: 5px; font-family: inherit;
    background: #fcfcfc;
}

/* =========================================
   6. FOOTER & RESPONSIVE GLOBAL
   ========================================= */
footer {
    text-align: center; padding: 2rem; background: #0b1120;
    font-size: 0.9rem; color: var(--text-muted); border-top: 1px solid rgba(255,255,255,0.05); margin-top: auto;
}

/* MOBILE */
@media (max-width: 768px) {
    .burger { display: block; z-index: 1001; }
    
    /* Menu Mobile ajusté pour le Header Stacké */
    .nav-links {
        position: absolute;
        right: 0;
        /* Le menu commence SOUS les 2 bandeaux + la barre nav (30+30+70 = 130px) */
        top: 130px; 
        background: rgba(15, 23, 42, 0.98);
        height: calc(100vh - 130px);
        width: 100%;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        transform: translateX(100%);
        transition: transform 0.3s ease-in;
    }
    
    .nav-links.nav-active {
        transform: translateX(0%);
    }

    .nav-links li { margin: 25px 0; }
    
    .hero h1 { font-size: 2.2rem; }
    .page-title { font-size: 2rem; }
    
    /* Timeline Mobile Fix */
    .timeline::after { left: 20px; }
    .timeline-item { width: 100%; padding-left: 50px; text-align: left; }
    .timeline-item:nth-child(even) { left: 0; }
    .timeline-date { position: static !important; text-align: left !important; }
}