:root {
  --bg: #0b0e14;
  --panel: #11151c;
  --panel2: #141a23;
  --border: #1f2733;
  --text: #d5dbe3;
  --muted: #6f7b8b;
  --accent: #7ee787;

  --mono: ui-monospace, "JetBrains Mono", "Fira Code", "DejaVu Sans Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.5;
}

/* ---------- Barre de fenêtre ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 18px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
}
.dots { display: flex; gap: 7px; }
.dots span { width: 11px; height: 11px; border-radius: 50%; background: #2a3342; }
.dots span:nth-child(1) { background: #ff5f57; }
.dots span:nth-child(2) { background: #febc2e; }
.dots span:nth-child(3) { background: #28c840; }

main { max-width: 1000px; margin: 0 auto; padding: 0 20px 40px; }

/* ---------- En-tête ---------- */
.hero { padding: 34px 0 22px; }

.prompt { font-family: var(--mono); font-size: 14px; margin: 0 0 14px; color: var(--muted); }
.prompt .user { color: var(--accent); }
.prompt .path { color: #79c0ff; }
.prompt .cmd  { color: var(--text); margin-left: 6px; }
.cursor {
  display: inline-block;
  width: 8px; height: 15px;
  margin-left: 4px;
  vertical-align: -2px;
  background: var(--accent);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

h1 {
  margin: 0 0 8px;
  font-size: clamp(28px, 4.5vw, 38px);
  font-weight: 650;
  letter-spacing: -0.02em;
}
.meta { margin: 0; font-family: var(--mono); font-size: 12.5px; color: var(--muted); }

/* ---------- Onglets principaux ---------- */
#onglets {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  gap: 4px;
  padding: 8px 0 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
#onglets::-webkit-scrollbar { display: none; }

.onglet {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 13.5px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  padding: 10px 16px;
  cursor: pointer;
  position: relative;
  top: 1px;
  transition: color .15s, background .15s;
}
.onglet svg { flex: none; }
.onglet:hover { color: var(--text); background: var(--panel); }
.onglet .n { font-size: 11.5px; opacity: .55; }
.onglet.actif {
  color: var(--c);
  background: var(--panel);
  border-color: var(--border);
  box-shadow: inset 0 2px 0 var(--c);
}
.onglet.actif .n { opacity: .8; }

/* ---------- Bannière ---------- */
#banniere {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 150px;
  margin: 18px 0 16px;
  padding: 24px 28px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background:
    linear-gradient(100deg, color-mix(in srgb, var(--c) 13%, var(--panel)) 0%, var(--panel) 65%),
    var(--panel);
}
#banniere::before {                       /* fine grille de fond */
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: .35;
  mask-image: linear-gradient(90deg, transparent 20%, #000);
  -webkit-mask-image: linear-gradient(90deg, transparent 20%, #000);
}
.ban-texte { position: relative; z-index: 1; max-width: 480px; }
.ban-chemin { margin: 0 0 6px; font-family: var(--mono); font-size: 12.5px; color: var(--c); }
.ban-titre  { margin: 0 0 6px; font-size: 28px; font-weight: 650; letter-spacing: -0.01em; }
.ban-desc   { margin: 0 0 10px; color: var(--muted); }
.ban-stats  { margin: 0; font-family: var(--mono); font-size: 12px; color: var(--muted); }

.ban-art {
  position: absolute;
  right: 12px; top: 0; bottom: 0;
  width: 420px; max-width: 55%;
  color: var(--c);
  opacity: .9;
}
.ban-art svg { width: 100%; height: 100%; }

/* ---------- Sous-onglets et recherche ---------- */
.barre {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
#sous-onglets { display: flex; flex-wrap: wrap; gap: 8px; }

.sous {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 11px;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.sous:hover { color: var(--text); border-color: #334052; }
.sous.actif {
  color: var(--c);
  border-color: var(--c);
  background: color-mix(in srgb, var(--c) 10%, transparent);
}
.sous .n { opacity: .6; margin-left: 5px; }

#recherche {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 12px;
  width: 220px;
  outline: none;
}
#recherche:focus { border-color: var(--accent); }
#recherche::placeholder { color: #4b5564; }

/* ---------- Liste d'articles ---------- */
#liste { display: flex; flex-direction: column; gap: 10px; }

.item {
  display: flex;
  gap: 16px;
  padding: 12px 16px 12px 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--c, var(--muted));
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
  transition: transform .12s, border-color .12s, background .12s;
}
.item:hover {
  transform: translateX(3px);
  border-color: #2e3a4d;
  border-left-color: var(--c, var(--muted));
  background: var(--panel2);
}

.vignette {
  flex: none;
  width: 132px;
  height: 88px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border);
}
.vignette img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vignette.vide {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--c) 14%, var(--bg)), var(--bg));
}
.vignette.vide svg { opacity: .7; }

.corps { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.item .titre { font-size: 16px; font-weight: 600; line-height: 1.35; }
.item .resume {
  font-size: 13.5px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.item .infos { margin-top: auto; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.item .tag { color: var(--c); }

.vide-liste { padding: 40px 0; text-align: center; font-family: var(--mono); color: var(--muted); }

#plus {
  display: block;
  margin: 22px auto 0;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 18px;
  cursor: pointer;
}
#plus:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Pied de page ---------- */
footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 12px;
  color: #4b5564;
}

/* ---------- Petits écrans ---------- */
@media (max-width: 640px) {
  #recherche { width: 100%; }
  .hero { padding-top: 24px; }
  #banniere { min-height: 120px; padding: 18px; }
  .ban-titre { font-size: 23px; }
  .ban-art { opacity: .35; max-width: 70%; }
  .vignette { width: 96px; height: 72px; }
  .item { gap: 12px; }
  .item .resume { display: none; }
}

/* ---------- Theme circuit : fond plat de pistes de circuit imprime ---------- */
body {
  background-color: var(--bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240' viewBox='0 0 240 240' fill='none' stroke='%23182230' stroke-width='2' stroke-linecap='square' stroke-linejoin='miter'%3E%3Cpath d='M0 40H52L72 60H132'/%3E%3Cpath d='M240 40H196L176 60V96'/%3E%3Cpath d='M0 110H36L56 130H104L124 150V196L144 216H164'/%3E%3Cpath d='M240 110H206L186 130V170'/%3E%3Cpath d='M0 190H28L48 210V240'/%3E%3Cpath d='M240 190H214L194 210V240'/%3E%3Cpath d='M70 0V24L90 44'/%3E%3Cpath d='M170 0V20L150 40'/%3E%3Cpath d='M96 96H150M96 108H150M96 120H150' stroke-width='1.5'/%3E%3Crect x='150' y='90' width='26' height='36' rx='1'/%3E%3Cg fill='%230b0e14'%3E%3Ccircle cx='132' cy='60' r='5'/%3E%3Ccircle cx='176' cy='96' r='5'/%3E%3Ccircle cx='164' cy='216' r='5'/%3E%3Ccircle cx='186' cy='170' r='5'/%3E%3Ccircle cx='90' cy='44' r='4'/%3E%3Ccircle cx='150' cy='40' r='4'/%3E%3C/g%3E%3Cg fill='%23182230' stroke='none'%3E%3Ccircle cx='132' cy='60' r='1.8'/%3E%3Ccircle cx='176' cy='96' r='1.8'/%3E%3Ccircle cx='164' cy='216' r='1.8'/%3E%3Ccircle cx='186' cy='170' r='1.8'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 240px 240px;
}
.item, #banniere, .vignette, .sous, #recherche, #plus { border-radius: 2px; }
.onglet { border-radius: 2px 2px 0 0; }
#onglets { background: var(--bg); }
#banniere { background: var(--panel); border-left: 4px solid var(--c); }
#banniere::before { display: none; }
.vignette.vide { background: var(--bg); }
.item:hover { transform: none; }

/* lien de soutien dans le pied de page */
footer a.soutien { color: var(--accent); text-decoration: none; border: 1px solid var(--border); border-radius: 2px; padding: 2px 10px; }
footer a.soutien:hover { border-color: var(--accent); }

/* ---------- barre d'onglets plus compacte (8 onglets) ---------- */
#onglets { gap: 2px; }
.onglet { padding: 10px 12px; gap: 6px; font-size: 13px; }
/* dernier onglet (Downloads) mis en avant */
.onglet:last-child {
  margin-left: 10px;
  color: #f0883e;
  background: color-mix(in srgb, #f0883e 9%, transparent);
  border-color: color-mix(in srgb, #f0883e 40%, var(--border));
}
.onglet:last-child.actif { background: var(--panel); border-color: var(--border); }
main, footer { max-width: 1100px; }
