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

/* ================================================================
   VARIABLES — MODE SOMBRE (défaut)
   ================================================================ */
:root,
[data-theme="dark"] {
    --primary: #00ff88;
    --secondary: #00d4ff;
    --bg: #050810;
    --bg-card: rgba(10, 14, 39, 0.6);
    --text: #e0e0e0;
    --text-dim: #8892b0;
    --border: rgba(0, 255, 136, 0.2);
    --border-light: rgba(0, 255, 136, 0.1);
    --border-strong: rgba(0, 255, 136, 0.4);
    --grid: rgba(0, 255, 136, 0.03);
    --nav-bg: rgba(10, 14, 39, 0.95);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    --card-hover-shadow: 0 10px 30px rgba(0, 255, 136, 0.15);
    --accent-bg: rgba(0, 255, 136, 0.1);
    --tag-bg: rgba(0, 212, 255, 0.1);
    --tag-border: rgba(0, 212, 255, 0.3);
    --tag-color: #00d4ff;
    --sources-bg: rgba(10, 14, 39, 0.4);
    --source-item-bg: rgba(10, 14, 39, 0.6);
    --filter-bg: rgba(10, 14, 39, 0.6);
}

/* ================================================================
   VARIABLES — MODE CLAIR
   ================================================================ */
[data-theme="light"] {
    --primary: #2563eb;
    --secondary: #3b82f6;
    --bg: #f8fafc;
    --bg-card: #ffffff;
    --text: #1e293b;
    --text-dim: #475569;
    --border: rgba(37, 99, 235, 0.15);
    --border-light: rgba(37, 99, 235, 0.08);
    --border-strong: rgba(37, 99, 235, 0.35);
    --grid: rgba(37, 99, 235, 0.04);
    --nav-bg: rgba(248, 250, 252, 0.97);
    --shadow: 0 2px 16px rgba(37, 99, 235, 0.08);
    --card-hover-shadow: 0 10px 30px rgba(37, 99, 235, 0.15);
    --accent-bg: rgba(37, 99, 235, 0.07);
    --tag-bg: rgba(59, 130, 246, 0.08);
    --tag-border: rgba(59, 130, 246, 0.25);
    --tag-color: #2563eb;
    --sources-bg: #ffffff;
    --source-item-bg: #f8fafc;
    --filter-bg: #ffffff;
}

/* ================================================================
   BASE
   ================================================================ */
body {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    transition: background 0.3s ease, color 0.3s ease;
}

.grid-background {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-image:
        linear-gradient(var(--grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -1;
    pointer-events: none;
}

/* ================================================================
   NAV
   ================================================================ */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 20px 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.logo {
    font-size: 22px;
    font-weight: bold;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.logo::before {
    content: '>';
    color: var(--secondary);
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 40px;
    counter-reset: item;
}

.nav-links a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.nav-links a::before {
    content: '0' counter(item) '.';
    counter-increment: item;
    color: var(--primary);
    margin-right: 5px;
    font-size: 12px;
}

.nav-links a:hover {
    color: var(--primary);
}

/* Bouton thème */
.theme-toggle {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 17px;
    flex-shrink: 0;
    margin-left: 20px;
    transition: background 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
}

.theme-toggle:hover {
    transform: scale(1.1);
    border-color: var(--primary);
    background: var(--accent-bg);
}

/* ================================================================
   SECTION
   ================================================================ */
.veille-section {
    position: relative;
    padding: 130px 80px 100px;
    z-index: 1;
}

.veille-container {
    max-width: 1400px;
    margin: 0 auto;
}

.section-header {
    display: flex;
    align-items: center;
    margin-bottom: 60px;
    gap: 20px;
}

.section-number {
    color: var(--primary);
    font-size: 20px;
    font-weight: bold;
}

.section-title {
    color: var(--text);
    font-size: 32px;
    white-space: nowrap;
}

.section-line-horizontal {
    height: 1px;
    background: var(--border-strong);
    flex-grow: 1;
    transition: background 0.3s ease;
}

.veille-intro {
    color: var(--text-dim);
    font-size: 15px;
    line-height: 1.8;
    margin-bottom: 60px;
    max-width: 800px;
}

/* ================================================================
   STATS
   ================================================================ */
.veille-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 60px;
}

.stat-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 28px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.stat-box:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--card-hover-shadow);
}

.stat-icon {
    font-size: 38px;
    margin-bottom: 14px;
}

.stat-number {
    font-size: 32px;
    color: var(--primary);
    font-weight: bold;
    margin-bottom: 6px;
}

.stat-label {
    color: var(--text-dim);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ================================================================
   FILTRES
   ================================================================ */
.filters {
    display: flex;
    gap: 12px;
    margin-bottom: 50px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 9px 18px;
    background: var(--filter-bg);
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-family: 'Consolas', monospace;
    font-size: 12px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

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

.filter-btn.active {
    background: var(--accent-bg);
    border-color: var(--primary);
    color: var(--primary);
}

/* ================================================================
   ARTICLES GRID
   ================================================================ */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 28px;
    margin-bottom: 60px;
}

.article-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 32px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.article-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), var(--secondary));
    transition: left 0.5s ease;
}

.article-card:hover::before {
    left: 100%;
}

.article-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: var(--card-hover-shadow);
}

.article-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 18px;
    gap: 12px;
}

.article-category {
    padding: 4px 12px;
    background: var(--accent-bg);
    border: 1px solid var(--primary);
    color: var(--primary);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 4px;
    white-space: nowrap;
}

.article-date {
    color: var(--text-dim);
    font-size: 12px;
    white-space: nowrap;
}

.article-title {
    color: var(--text);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.article-card:hover .article-title {
    color: var(--primary);
}

.article-description {
    color: var(--text-dim);
    font-size: 13px;
    line-height: 1.7;
    margin-bottom: 20px;
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 18px;
}

.tag {
    padding: 3px 10px;
    background: var(--tag-bg);
    border: 1px solid var(--tag-border);
    color: var(--tag-color);
    font-size: 10px;
    text-transform: uppercase;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.article-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.article-source {
    color: var(--text-dim);
    font-size: 12px;
}

.article-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--primary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.article-link:hover {
    transform: translateX(4px);
}

.arrow {
    transition: transform 0.3s ease;
}

.article-link:hover .arrow {
    transform: translateX(3px);
}

/* ================================================================
   SOURCES
   ================================================================ */
.sources-section {
    background: var(--sources-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 35px 40px;
    margin-bottom: 60px;
    box-shadow: var(--shadow);
    transition: background 0.3s ease;
}

.sources-title {
    color: var(--text);
    font-size: 20px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
}

.sources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.source-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: var(--source-item-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-dim);
    font-size: 13px;
    transition: all 0.3s ease;
}

.source-item:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateX(4px);
    background: var(--accent-bg);
}

.source-icon {
    font-size: 20px;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 768px) {
    nav {
        padding: 15px 20px;
    }
    .nav-links {
        display: none;
    }
    .veille-section {
        padding: 100px 20px 50px;
    }
    .articles-grid {
        grid-template-columns: 1fr;
    }
    .section-title {
        font-size: 22px;
    }
    .theme-toggle {
        width: 34px;
        height: 34px;
        font-size: 15px;
    }
}