/* ===== IMPORTS ===== */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&family=Inter:wght@300;400;500;600&display=swap');

/* Variables */
:root {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-tertiary: #21262d;
  --accent-teal: #00d4aa;
  --accent-blue: #0070f3;
  --accent-teal-dim: rgba(0, 212, 170, 0.12);
  --accent-blue-dim: rgba(0, 112, 243, 0.12);
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #484f58;
  --border: #21262d;
  --border-hover: #30363d;
  --nav-width: 220px;
  --font-mono: 'JetBrains Mono', monospace;
  --font-body: 'Inter', sans-serif;
  --radius: 8px;
  --radius-lg: 12px;
}

/* Reset*/
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Base */
html { scroll-behavior: smooth; }

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  min-height: 100vh;
  /* Grille de fond subtile */
  background-image:
    linear-gradient(rgba(0,212,170,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,212,170,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* Sidebar nav */
nav {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--nav-width);
  height: 100vh;
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  transition: transform 0.3s ease;
}

.nav-brand {
  padding: 28px 20px 24px;
  border-bottom: 1px solid var(--border);
}

.nav-brand-avatar {
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent-teal), var(--accent-blue));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 15px;
  color: #0d1117;
  margin-bottom: 12px;
}

.nav-brand-name {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.nav-brand-role {
  font-size: 11px;
  color: var(--accent-teal);
  margin-top: 2px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.nav-links {
  list-style: none;
  padding: 16px 0;
  flex: 1;
}

.nav-links li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-family: var(--font-body);
  transition: all 0.15s ease;
  border-left: 2px solid transparent;
  position: relative;
}

.nav-links li a .nav-icon {
  font-size: 15px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

.nav-links li a:hover {
  color: var(--text-primary);
  background: var(--accent-teal-dim);
  border-left-color: var(--accent-teal);
}

.nav-links li a.active {
  color: var(--accent-teal);
  background: var(--accent-teal-dim);
  border-left-color: var(--accent-teal);
  font-weight: 500;
}

.nav-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Menu toggle mobile */
.menu-toggle {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 200;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 18px;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.menu-toggle:hover {
  border-color: var(--accent-teal);
  color: var(--accent-teal);
}

.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 99;
}

/* Contenu principal */
main {
  margin-left: var(--nav-width);
  min-height: 100vh;
  padding: 60px 56px 80px;
  max-width: 900px;
}

/* Page header */
.page-header {
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.page-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-teal);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-label::before {
  content: '';
  display: inline-block;
  width: 20px;
  height: 1px;
  background: var(--accent-teal);
}

.page-title {
  font-family: var(--font-mono);
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.page-title span {
  color: var(--accent-teal);
}

/* Sections */
section {
  margin-bottom: 48px;
}

h2 {
  font-family: var(--font-mono);
  font-size: clamp(16px, 2.5vw, 20px);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

h2::before {
  content: '//';
  color: var(--accent-blue);
  font-size: 0.8em;
}

h3 {
  font-family: var(--font-mono);
  font-size: clamp(14px, 2vw, 17px);
  font-weight: 500;
  color: var(--accent-teal);
  margin-bottom: 12px;
}

p {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.8;
  margin-bottom: 16px;
}

p:last-child { margin-bottom: 0; }

/* Cartes */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color 0.15s;
}

.card:hover {
  border-color: var(--border-hover);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

/* Terminal block */
.terminal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 24px;
}

.terminal-bar {
  background: var(--bg-tertiary);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--border);
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.terminal-title {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 8px;
}

.terminal-body {
  padding: 20px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.9;
  color: var(--text-secondary);
}

.terminal-body .prompt { color: var(--accent-teal); }
.terminal-body .cmd { color: var(--text-primary); }
.terminal-body .out { color: var(--text-secondary); }
.terminal-body .comment { color: var(--text-muted); }

/* Tags */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.03em;
}

.tag-teal {
  background: var(--accent-teal-dim);
  color: var(--accent-teal);
  border: 1px solid rgba(0,212,170,0.2);
}

.tag-blue {
  background: var(--accent-blue-dim);
  color: #4da6ff;
  border: 1px solid rgba(0,112,243,0.2);
}

.tag-gray {
  background: rgba(139,148,158,0.1);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

/* Liens */
a { color: var(--accent-teal); text-decoration: none; transition: opacity 0.15s; }
a:hover { opacity: 0.8; }

/* Images */
img {
  max-width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.img-hero {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 2px solid var(--accent-teal);
  object-fit: cover;
  display: block;
}

.img-landscape {
  width: 100%;
  max-width: 600px;
  border-radius: var(--radius-lg);
}

.img-inline {
  width: 160px;
  border-radius: var(--radius);
  margin: 8px;
}

.img-game {
  width: 260px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin: 8px;
}

.img-cover {
  width: 100%;
  border-radius: var(--radius-lg);
}

/* Table */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}

caption {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-teal);
  padding: 12px 16px;
  text-align: left;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

td {
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

tr:last-child td { border-bottom: none; }

/* Validation badge */
.validation-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.validation-row:last-child { border-bottom: none; }

.validation-label {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-secondary);
  flex: 1;
  min-width: 160px;
}

.validation-badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.validation-badges img {
  height: 24px;
  width: auto;
  border: none;
  border-radius: 3px;
  vertical-align: middle;
}

/* Footer */
.page-footer {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.page-footer-left {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

.page-footer-right {
  font-size: 12px;
  color: var(--text-muted);
}

/* Scroll bar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

main { animation: fadeIn 0.4s ease; }

/* Responsive */
@media (max-width: 900px) {
  main {
    padding: 48px 32px 80px;
  }
}

@media (max-width: 768px) {
  nav {
    transform: translateX(-100%);
  }

  nav.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,0.5);
  }

  .nav-overlay.open {
    display: block;
  }

  .menu-toggle {
    display: flex;
  }

  main {
    margin-left: 0;
    padding: 72px 20px 60px;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .page-title {
    font-size: 22px;
  }

  .validation-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .img-inline {
    width: 120px;
  }

  .page-footer {
    flex-direction: column;
    gap: 8px;
  }
}

@media (max-width: 480px) {
  main {
    padding: 68px 16px 50px;
  }

  .card {
    padding: 16px;
  }

  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}
