/* ===== VARIABLES ===== */
:root {
  --bg: #060d1a;
  --bg2: #0a1628;
  --bg3: #0f1f38;
  --cyan: #00d4ff;
  --green: #00ff88;
  --text: #e2eaf4;
  --muted: #6b8aaa;
  --border: rgba(0, 212, 255, 0.15);
  --card: rgba(10, 22, 40, 0.85);
  --radius: 8px;
}

/* ===== RESET ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); font-family: 'Segoe UI', system-ui, sans-serif; overflow-x: hidden; }
a { text-decoration: none; color: inherit; }
button { border: none; cursor: pointer; font-family: inherit; }

/* ===== CANVAS BINAIRE ===== */
#binary-canvas {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  opacity: 0.035; pointer-events: none; z-index: 0;
}

/* ===== NAVBAR ===== */
#navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 48px; height: 64px;
  background: rgba(6, 13, 26, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.3s;
}

#navbar.scrolled { box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4); }

.logo { font-size: 20px; font-weight: 700; color: var(--cyan); letter-spacing: 0.5px; }
.logo span { color: var(--green); }

.nav-links { display: flex; gap: 28px; list-style: none; }
.nav-links a { color: var(--muted); font-size: 14px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; transition: color 0.2s; }
.nav-links a:hover, .nav-links a.active { color: var(--cyan); }

.nav-search {
  display: flex; align-items: center; gap: 8px;
  background: rgba(0, 212, 255, 0.05);
  border: 1px solid var(--border); border-radius: 20px;
  padding: 6px 14px; transition: border-color 0.2s;
}
.nav-search:focus-within { border-color: rgba(0, 212, 255, 0.4); }
.nav-search input { background: none; border: none; outline: none; color: var(--text); font-size: 13px; width: 150px; }
.nav-search input::placeholder { color: var(--muted); }

/* ===== HERO ===== */
.hero {
  position: relative; min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 120px 40px 80px; overflow: hidden; z-index: 1;
}

.hero-glow {
  position: absolute; width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(0, 212, 255, 0.07) 0%, transparent 70%);
  top: 50%; left: 50%; transform: translate(-50%, -50%); pointer-events: none;
}

.hero-content { position: relative; z-index: 1; width: 100%; max-width: 700px; margin: 0 auto; }

.hero-tag {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(0, 212, 255, 0.07);
  border: 1px solid rgba(0, 212, 255, 0.2); border-radius: 20px;
  padding: 6px 16px; font-family: monospace; font-size: 11px;
  color: var(--cyan); letter-spacing: 2px; margin-bottom: 24px;
  animation: fadeUp 0.6s ease both;
}

.hero-tag::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--green); animation: pulse 2s infinite;
}

.hero h1 {
  font-size: clamp(38px, 5.5vw, 68px); font-weight: 700;
  line-height: 1.15; margin-bottom: 20px;
  animation: fadeUp 0.6s 0.1s ease both;
}

.hero h1 .cyan { color: var(--cyan); }
.hero h1 .muted { font-size: 0.6em; color: var(--muted); font-weight: 400; }

.hero-sub {
  font-size: 16px; color: var(--muted); line-height: 1.7;
  margin-bottom: 32px; animation: fadeUp 0.6s 0.2s ease both;
}

.hero-cta { display: flex; gap: 14px; justify-content: center; animation: fadeUp 0.6s 0.3s ease both; }

.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--cyan); color: var(--bg); padding: 12px 26px;
  border-radius: var(--radius); font-weight: 700; font-size: 14px;
  letter-spacing: 0.5px; text-transform: uppercase; transition: all 0.2s;
}
.btn-primary:hover { background: #fff; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0, 212, 255, 0.3); }

.btn-outline {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent; color: var(--cyan); padding: 12px 26px;
  border-radius: var(--radius); border: 1px solid var(--border);
  font-weight: 600; font-size: 14px; letter-spacing: 0.5px;
  text-transform: uppercase; transition: all 0.2s;
}
.btn-outline:hover { border-color: var(--cyan); background: rgba(0, 212, 255, 0.06); }

/* Stats hero */
.hero-stats {
  display: flex; gap: 40px; justify-content: center;
  margin-top: 56px; padding-top: 36px;
  border-top: 1px solid var(--border);
  animation: fadeUp 0.6s 0.4s ease both;
}
.stat-num { font-size: 30px; font-weight: 700; color: var(--cyan); line-height: 1; }
.stat-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; margin-top: 4px; }

/* ===== SECTIONS ===== */
.section { position: relative; z-index: 1; padding: 60px 48px; max-width: 1200px; margin: 0 auto; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 32px; }
.section-title { font-size: 24px; font-weight: 700; color: #fff; }
.section-title span { font-family: monospace; font-size: 13px; color: var(--cyan); opacity: 0.7; margin-right: 8px; }
.articles-count { font-size: 13px; color: var(--muted); font-family: monospace; }

/* ===== TOPICS PILLS ===== */
.topics { display: flex; gap: 10px; flex-wrap: wrap; padding: 20px 48px 0; max-width: 1200px; margin: 0 auto; }
.topic-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 16px; border-radius: 20px;
  border: 1px solid var(--border); background: rgba(0, 212, 255, 0.04);
  color: var(--muted); font-size: 13px; cursor: pointer; transition: all 0.2s;
}
.topic-pill:hover, .topic-pill.active { border-color: var(--cyan); color: var(--cyan); background: rgba(0, 212, 255, 0.08); }
.topic-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.5; }

/* ===== FEATURED GRID ===== */
.featured-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; }

.featured-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: border-color 0.2s, transform 0.2s; cursor: pointer; display: block;
}
.featured-card:hover { border-color: rgba(0, 212, 255, 0.4); transform: translateY(-3px); }

.card-img {
  height: 200px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0a1628, #0f2040);
  position: relative; overflow: hidden;
}
.card-img.sm { height: 110px; }
.card-img::before {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,212,255,0.015) 2px, rgba(0,212,255,0.015) 4px);
}
.card-icon-lg { font-size: 60px; filter: drop-shadow(0 0 16px rgba(0,212,255,0.4)); position: relative; z-index: 1; }
.card-icon-md { font-size: 36px; filter: drop-shadow(0 0 10px rgba(0,212,255,0.4)); position: relative; z-index: 1; }

.card-badge {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  background: var(--cyan); color: var(--bg);
  font-family: monospace; font-size: 10px; font-weight: 700;
  padding: 3px 9px; border-radius: 2px; letter-spacing: 1px; text-transform: uppercase;
}
.card-badge.green { background: var(--green); }

.card-body { padding: 20px; }
.card-body.sm { padding: 14px 16px; }
.card-cat { font-family: monospace; font-size: 11px; color: var(--cyan); letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 8px; }
.card-title-lg { font-size: 20px; font-weight: 700; color: #fff; line-height: 1.3; margin-bottom: 10px; }
.card-title-md { font-size: 16px; font-weight: 700; color: #fff; line-height: 1.3; margin-bottom: 8px; }
.card-excerpt { font-size: 13px; color: var(--muted); line-height: 1.6; margin-bottom: 14px; }
.card-meta { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--muted); }
.niveau-debutant { color: var(--green); }
.niveau-intermediaire { color: #ffaa44; }
.niveau-avance { color: #ff6644; }

/* ===== ARTICLES GRID ===== */
.articles-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }

.article-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: all 0.2s; cursor: pointer; display: block;
}
.article-card:hover { border-color: rgba(0,212,255,0.35); transform: translateY(-4px); box-shadow: 0 12px 32px rgba(0,0,0,0.4); }

.article-img { height: 120px; display: flex; align-items: center; justify-content: center; }
.article-icon { font-size: 38px; filter: drop-shadow(0 0 8px rgba(0,212,255,0.3)); }

.article-body { padding: 14px; }
.article-tag {
  display: inline-block; font-family: monospace; font-size: 10px;
  color: var(--cyan); background: rgba(0,212,255,0.07);
  border: 1px solid rgba(0,212,255,0.15); padding: 2px 7px;
  border-radius: 2px; letter-spacing: 1px; margin-bottom: 8px;
}
.article-title { font-size: 15px; font-weight: 700; color: #fff; line-height: 1.3; margin-bottom: 6px; }
.article-excerpt { font-size: 12px; color: var(--muted); line-height: 1.5; margin-bottom: 10px; }
.article-footer {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; color: var(--muted);
  padding-top: 10px; border-top: 1px solid var(--border);
}

/* Couleurs de fond par catégorie */
.bg-securite  { background: linear-gradient(135deg, #071a30, #0d2d50); }
.bg-reseaux   { background: linear-gradient(135deg, #071a25, #0a2840); }
.bg-malware   { background: linear-gradient(135deg, #1a0a07, #301510); }
.bg-pratiques { background: linear-gradient(135deg, #15071a, #280a30); }
.bg-crypto    { background: linear-gradient(135deg, #071a10, #0a3020); }
.bg-pentest   { background: linear-gradient(135deg, #0d0d1a, #151530); }
.bg-vpn       { background: linear-gradient(135deg, #071520, #0a2035); }
.bg-default   { background: linear-gradient(135deg, #0a1020, #111830); }

/* ===== NO RESULTS ===== */
.no-results { text-align: center; padding: 60px 20px; color: var(--muted); }
.no-results span { font-size: 40px; display: block; margin-bottom: 16px; }
.no-results p { font-size: 15px; }
.hidden { display: none !important; }

/* ===== FOOTER ===== */
footer { background: var(--bg2); border-top: 1px solid var(--border); padding: 36px 48px; position: relative; z-index: 1; }
.footer-inner { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; }
.footer-logo { font-size: 18px; font-weight: 700; color: var(--cyan); margin-bottom: 4px; }
.footer-logo span { color: var(--green); }
.footer-copy { font-size: 12px; color: var(--muted); }
.footer-links { display: flex; gap: 20px; }
.footer-links a { color: var(--muted); font-size: 13px; transition: color 0.2s; }
.footer-links a:hover { color: var(--cyan); }

/* ===== ANIMATIONS ===== */
@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .articles-grid { grid-template-columns: repeat(2, 1fr); }
  .featured-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  #navbar { padding: 0 20px; }
  .nav-links { display: none; }
  .section { padding: 40px 20px; }
  .topics { padding: 20px 20px 0; }
  .articles-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 32px; }
  .hero-stats { gap: 24px; }
  .footer-inner { flex-direction: column; gap: 16px; text-align: center; }
}
