/* larmiche — cyberpunk / néon / ref PCB (lisible) */

@import url("https://fonts.googleapis.com/css2?family=Audiowide&family=Kode+Mono:wght@400;500;600&family=Orbitron:wght@500;700&family=Share+Tech+Mono&display=swap");

:root {
  /* Nuit ville */
  --bg-deep: #070a0f;
  --bg-panel: rgba(12, 16, 32, 0.92);
  --bg-elevated: #101828;
  --bg-read: rgba(8, 12, 22, 0.75);
  /* PCB */
  --pcb: #1e4d3a;
  --pcb-glow: rgba(45, 180, 120, 0.12);
  --copper: #c97b53;
  --copper-dim: rgba(201, 123, 83, 0.35);
  /* Néon 2077-ish */
  --neon-yellow: #ffe600;
  --neon-magenta: #ff2a6d;
  --neon-cyan: #00e8ff;
  --neon-dim: rgba(0, 232, 255, 0.45);
  /* Texte */
  --fg: #d4e0ec;
  --fg-dim: #6b7a8f;
  --border: rgba(0, 232, 255, 0.18);
  --font: "Share Tech Mono", "SF Mono", "Menlo", Consolas, monospace;
  /* Blocs code : plus “console / firmware” */
  --font-code: "Kode Mono", "Share Tech Mono", "SF Mono", Menlo, Consolas, monospace;
  --font-display: "Orbitron", var(--font);
  /* Marque nav : typo arcade / sci-fi + fallback titres */
  --font-brand: "Audiowide", "Orbitron", var(--font);
  /* Mise en page : largeur max du site + médias dans la colonne main */
  --layout-max: 75rem;
  --content-media-max: 56rem;
}

html {
  scroll-behavior: smooth;
}

body {
  position: relative;
  min-height: 100vh;
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  color: var(--fg);
  background-color: var(--bg-deep);
  /* Grille PCB + traces + halo urbain */
  background-image:
    linear-gradient(90deg, rgba(30, 77, 58, 0.08) 1px, transparent 1px),
    linear-gradient(var(--pcb-glow) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 42, 109, 0.06) 0%, transparent 42%),
    linear-gradient(225deg, rgba(0, 232, 255, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse 100% 60% at 50% -20%, rgba(255, 42, 109, 0.09), transparent 55%);
  background-size:
    32px 32px,
    32px 32px,
    100% 100%,
    100% 100%,
    100% 100%;
  background-attachment: fixed;
}

/* Couche “traces” diagonales très discrètes */
body::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.35;
  background-image: repeating-linear-gradient(
    -12deg,
    transparent,
    transparent 38px,
    rgba(45, 180, 120, 0.04) 38px,
    rgba(45, 180, 120, 0.04) 39px
  );
}

/* Scanlines légers */
body::after {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  opacity: 0.03;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.4) 2px,
    rgba(0, 0, 0, 0.4) 3px
  );
}

/* ——— Nav ——— */
/* Au-dessus de .container (z-index:1) sinon les clics tombent sur le main et le dropdown paraît “mort” */
.navbar {
  position: relative;
  z-index: 1030;
  border-bottom: 1px solid var(--border) !important;
  background: linear-gradient(
      180deg,
      rgba(12, 16, 32, 0.92) 0%,
      rgba(8, 10, 22, 0.88) 100%
    ) !important;
  backdrop-filter: blur(10px);
  box-shadow:
    0 0 24px rgba(0, 0, 0, 0.45),
    0 0 40px rgba(255, 42, 109, 0.06),
    inset 0 -1px 0 rgba(0, 232, 255, 0.15);
}

.navbar-brand {
  font-family: var(--font-brand);
  font-size: 1.08rem !important;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--neon-yellow) !important;
  /* Aberration chromatique exagérée (RGB split + halos) */
  text-shadow:
    0 0 22px rgba(255, 230, 0, 0.55),
    0 0 48px rgba(255, 42, 109, 0.28),
    0 0 72px rgba(0, 232, 255, 0.12),
    2px 0 0 rgba(255, 42, 109, 0.65),
    3px 0 2px rgba(255, 42, 109, 0.35),
    -2px 0 0 rgba(0, 232, 255, 0.65),
    -3px 0 2px rgba(0, 232, 255, 0.35),
    1px 1px 0 rgba(255, 60, 140, 0.45),
    -1px -1px 0 rgba(0, 255, 255, 0.35);
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

.navbar-brand:hover {
  color: #fff8c8 !important;
  text-shadow:
    0 0 30px rgba(255, 230, 0, 0.7),
    0 0 56px rgba(255, 42, 109, 0.35),
    0 0 80px rgba(0, 232, 255, 0.2),
    3px 0 0 rgba(255, 42, 109, 0.75),
    4px 0 3px rgba(255, 42, 109, 0.4),
    -3px 0 0 rgba(0, 232, 255, 0.75),
    -4px 0 3px rgba(0, 232, 255, 0.4),
    2px 1px 0 rgba(255, 80, 160, 0.5),
    -2px -2px 0 rgba(0, 255, 255, 0.45);
}

.navbar-dark .navbar-nav .nav-link {
  color: var(--fg) !important;
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.5rem 0.75rem !important;
  border-radius: 2px;
  transition: color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link:focus {
  color: var(--neon-cyan) !important;
  background: rgba(0, 232, 255, 0.07);
  box-shadow: 0 0 12px rgba(0, 232, 255, 0.12);
}

.navbar-dark .navbar-nav .active > .nav-link,
.navbar-dark .navbar-nav .nav-link.active {
  color: var(--neon-magenta) !important;
  border-bottom: 1px solid var(--neon-magenta);
  text-shadow: 0 0 10px rgba(255, 42, 109, 0.35);
}

/* Menu principal : pas de soulignement classique — bus horizontal seul (voir media lg) */
.navbar-dark .navbar-nav:not(.ml-auto) .active > .nav-link,
.navbar-dark .navbar-nav:not(.ml-auto) .nav-link.active {
  border-bottom: none !important;
}

/*
 * Section courante du menu du haut uniquement (li.navitem / li.dropdown — pas le ToC).
 * Encadré HUD : coins jaune + cyan, glow, léger split RGB sur le libellé.
 */
.navbar-dark .navbar-nav:not(.ml-auto) > li.navitem.active > .nav-link,
.navbar-dark .navbar-nav:not(.ml-auto) > li.dropdown.active > .nav-link.dropdown-toggle {
  position: relative;
  z-index: 4;
  color: #f5fdff !important;
  font-weight: 600 !important;
  border: 1px solid rgba(0, 232, 255, 0.55) !important;
  border-left: 2px solid rgba(255, 234, 0, 0.95) !important;
  border-radius: 2px !important;
  background:
    linear-gradient(90deg, rgba(255, 234, 0, 0.98), rgba(255, 234, 0, 0.98)) left top / 12px 2px no-repeat,
    linear-gradient(180deg, rgba(255, 234, 0, 0.98), rgba(255, 234, 0, 0.98)) left top / 2px 12px no-repeat,
    linear-gradient(90deg, rgba(0, 232, 255, 0.95), rgba(0, 232, 255, 0.95)) right bottom / 12px 2px no-repeat,
    linear-gradient(180deg, rgba(0, 232, 255, 0.95), rgba(0, 232, 255, 0.95)) right bottom / 2px 12px no-repeat,
    linear-gradient(145deg, rgba(0, 232, 255, 0.12) 0%, rgba(8, 14, 24, 0.92) 42%, rgba(255, 42, 109, 0.1) 100%) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 -1px 0 rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(5, 10, 18, 0.95),
    0 0 22px rgba(0, 232, 255, 0.2),
    0 0 36px rgba(255, 42, 109, 0.08);
  text-shadow:
    0 0 10px rgba(0, 232, 255, 0.35),
    1px 0 0 rgba(255, 60, 140, 0.4),
    -1px 0 0 rgba(0, 255, 255, 0.35);
}

.navbar-dark .navbar-nav:not(.ml-auto) > li.navitem.active > .nav-link:hover,
.navbar-dark .navbar-nav:not(.ml-auto) > li.navitem.active > .nav-link:focus,
.navbar-dark .navbar-nav:not(.ml-auto) > li.dropdown.active > .nav-link.dropdown-toggle:hover,
.navbar-dark .navbar-nav:not(.ml-auto) > li.dropdown.active > .nav-link.dropdown-toggle:focus {
  color: #fff !important;
  border-color: rgba(0, 232, 255, 0.75) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    inset 0 -1px 0 rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(5, 10, 18, 0.95),
    0 0 28px rgba(0, 232, 255, 0.32),
    0 0 40px rgba(255, 234, 0, 0.12);
}

.navbar-toggler {
  border-color: var(--border) !important;
}

.navbar-toggler-icon {
  filter: invert(0.85) sepia(1) saturate(1.5) hue-rotate(260deg);
}

/* ——— Contenu principal ——— */
.container {
  position: relative;
  z-index: 1;
  max-width: var(--layout-max);
}

[role="main"] {
  padding: 1.75rem 1.25rem 3rem;
  margin-top: 0.25rem;
  background: var(--bg-read);
  border: 1px solid rgba(0, 232, 255, 0.1);
  border-radius: 2px;
  box-shadow:
    0 0 0 1px rgba(30, 77, 58, 0.25),
    inset 0 0 60px rgba(0, 0, 0, 0.35);
}

/* Titres / texte / liens : uniquement dans .content — le ToC mobile est dans [role="main"] mais hors .content */
[role="main"] .content h1 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--neon-cyan);
  border: none;
  border-left: 4px solid var(--neon-magenta);
  padding: 0.35rem 0 0.35rem 1rem;
  margin-bottom: 1.25rem;
  text-shadow:
    0 0 18px rgba(0, 232, 255, 0.35),
    0 0 32px rgba(255, 42, 109, 0.15);
}

[role="main"] .content h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  margin-top: 2rem;
  color: var(--fg);
  border-bottom: 1px solid var(--copper-dim);
  padding-bottom: 0.4rem;
}

[role="main"] .content h3 {
  font-size: 1rem;
  color: var(--neon-yellow);
  letter-spacing: 0.06em;
  margin-top: 1.5rem;
  text-shadow: 0 0 12px rgba(255, 230, 0, 0.2);
}

[role="main"] .content p,
[role="main"] .content li {
  color: var(--fg);
}

/* Listes Markdown : souvent <li><p>…</p></li> — sans ça le 1er paragraphe décale le texte vs les marqueurs */
[role="main"] .content ul > li > p:first-child,
[role="main"] .content ol > li > p:first-child {
  margin-top: 0;
}

[role="main"] .content a {
  color: var(--neon-cyan);
  text-decoration: none;
  border-bottom: 1px solid var(--neon-dim);
  transition: color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

[role="main"] .content a:hover {
  color: var(--neon-yellow);
  border-bottom-color: var(--neon-yellow);
  box-shadow: 0 0 14px rgba(255, 230, 0, 0.15);
}

[role="main"] .content hr {
  border: none;
  border-top: 1px dashed rgba(0, 232, 255, 0.2);
  margin: 2rem 0;
}

/* ——— Tableaux (data panel / PCB) ——— */
[role="main"] .content table {
  width: 100%;
  max-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 1rem 0 1.35rem;
  font-size: 0.88rem;
  font-family: var(--font);
  border: 1px solid rgba(0, 232, 255, 0.35);
  border-radius: 2px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.5),
    0 0 28px rgba(0, 0, 0, 0.45),
    inset 0 0 0 1px rgba(0, 232, 255, 0.06),
    inset 0 -20px 40px rgba(0, 232, 255, 0.04);
  background: linear-gradient(165deg, rgba(8, 12, 22, 0.98) 0%, rgba(4, 8, 16, 0.99) 100%);
}

[role="main"] .content table thead th {
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.65rem 0.85rem;
  text-align: left;
  color: var(--neon-cyan);
  background: linear-gradient(180deg, rgba(0, 232, 255, 0.14) 0%, rgba(8, 12, 22, 0.96) 100%);
  border-bottom: 2px solid rgba(0, 232, 255, 0.45);
  text-shadow: 0 0 18px rgba(0, 232, 255, 0.25);
}

[role="main"] .content table tbody td {
  padding: 0.55rem 0.85rem;
  vertical-align: middle;
  border-bottom: 1px solid rgba(0, 232, 255, 0.12);
  border-right: 1px solid rgba(255, 42, 109, 0.1);
  line-height: 1.45;
}

[role="main"] .content table tbody td:last-child {
  border-right: none;
}

[role="main"] .content table tbody tr:last-child td {
  border-bottom: none;
}

[role="main"] .content table tbody td:first-child {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--fg-dim);
  background: rgba(0, 0, 0, 0.25);
}

[role="main"] .content table tbody td:nth-child(2) {
  color: rgba(230, 235, 245, 0.88);
}

[role="main"] .content table tbody td:nth-child(3) {
  color: var(--neon-magenta);
  text-shadow: 0 0 14px rgba(255, 42, 109, 0.2);
}

[role="main"] .content table tbody td:nth-child(4) {
  color: var(--neon-yellow);
  font-weight: 600;
  text-shadow: 0 0 12px rgba(255, 230, 0, 0.18);
}

[role="main"] .content table tbody tr:hover td {
  background: rgba(0, 232, 255, 0.07);
}

[role="main"] .content table tbody tr:hover td:first-child {
  background: rgba(0, 232, 255, 0.1);
}

/* ——— Images & médias (lisibles sur fond sombre, pas “plaque” blanche géante) ——— */
[role="main"] .content img,
[role="main"] .content video {
  max-width: min(100%, var(--content-media-max));
  width: auto;
  height: auto;
  max-height: min(70vh, 36rem);
  object-fit: contain;
  display: block;
  margin: 1.1rem auto;
  padding: 0.35rem;
  border: 1px solid rgba(0, 232, 255, 0.28);
  border-radius: 2px;
  background: linear-gradient(
    145deg,
    rgba(16, 24, 40, 0.95) 0%,
    var(--bg-elevated) 100%
  );
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.5),
    0 6px 28px rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px rgba(255, 42, 109, 0.06),
    0 0 24px rgba(0, 232, 255, 0.05);
  box-sizing: border-box;
}

[role="main"] .content img:hover,
[role="main"] .content video:hover {
  border-color: rgba(0, 232, 255, 0.45);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.5),
    0 8px 32px rgba(0, 0, 0, 0.55),
    0 0 28px rgba(0, 232, 255, 0.1);
}

/* Lien = image : pas de soulignement parasite */
[role="main"] .content a:has(> img) {
  border-bottom: none;
  display: block;
  width: fit-content;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}

[role="main"] .content a:has(> img):hover {
  box-shadow: none;
}

[role="main"] .content a:has(> img) img {
  margin: 0;
}

[role="main"] .content figure {
  margin: 1.25rem auto;
  max-width: min(100%, var(--content-media-max));
}

[role="main"] .content figure img,
[role="main"] .content figure video {
  margin-bottom: 0.45rem;
}

[role="main"] .content figcaption {
  font-size: 0.78rem;
  color: var(--fg-dim);
  letter-spacing: 0.05em;
  line-height: 1.45;
  padding: 0.35rem 0 0 0.6rem;
  border-left: 2px solid rgba(255, 42, 109, 0.35);
  margin: 0;
}

/* ——— Thème global : arbre à puces “circuit” (bus + branches + pads) ——— */

/* Listes non ordonnées : bus vertical + branches + pastilles */
[role="main"] .content ul {
  list-style: none;
  padding-left: 0;
  margin: 0.85rem 0 1.1rem;
  border-left: 2px solid rgba(0, 232, 255, 0.45);
  padding-left: 0.65rem;
}

[role="main"] .content ul ul {
  margin: 0.45rem 0 0.4rem;
  padding-left: 0.9rem;
  border-left: 2px solid rgba(255, 42, 109, 0.35);
}

[role="main"] .content ul ul ul {
  margin: 0.4rem 0 0.35rem;
  padding-left: 0.9rem;
  border-left: 2px solid rgba(201, 123, 83, 0.45);
}

[role="main"] .content ul ul ul ul {
  margin: 0.35rem 0 0.3rem;
  padding-left: 0.85rem;
  border-left: 2px solid rgba(0, 232, 255, 0.32);
}

[role="main"] .content ul > li {
  position: relative;
  padding-left: 1.35rem;
  margin-bottom: 0.5rem;
  line-height: 1.65;
}

[role="main"] .content ul > li:last-child {
  margin-bottom: 0;
}

/* Branche horizontale : centrée sur la première ligne (line-height 1.65) */
[role="main"] .content ul > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: calc(0.915em - 1px);
  width: 0.75rem;
  height: 2px;
  background: linear-gradient(
    90deg,
    rgba(0, 232, 255, 0.85) 0%,
    rgba(255, 42, 109, 0.55) 100%
  );
}

/* Pad : même axe vertical que la branche */
[role="main"] .content ul > li::after {
  content: "";
  position: absolute;
  left: 0.62rem;
  top: calc(0.915em - 3.5px);
  width: 7px;
  height: 7px;
  border: 1px solid var(--copper);
  border-radius: 1px;
  background: rgba(0, 232, 255, 0.12);
  box-shadow: 0 0 6px rgba(0, 232, 255, 0.25);
}

/* Listes imbriquées : branches internes */
[role="main"] .content ul ul > li::before {
  width: 0.65rem;
  background: linear-gradient(
    90deg,
    rgba(255, 42, 109, 0.55) 0%,
    rgba(0, 232, 255, 0.35) 100%
  );
}

[role="main"] .content ul ul > li::after {
  border-color: var(--neon-magenta);
  background: rgba(255, 42, 109, 0.08);
  box-shadow: 0 0 6px rgba(255, 42, 109, 0.2);
}

/* Accueil : liste Sections — branche section = même puce “primaire” que les pages top-level */
[role="main"] .content ul.home-sections-list > li.home-nav-branch {
  position: relative;
  padding-left: 1.35rem;
  margin-bottom: 1rem;
  line-height: 1.65;
}

[role="main"] .content ul.home-sections-list > li.home-nav-branch::before {
  content: "";
  position: absolute;
  left: 0;
  top: calc(0.915em - 1px);
  width: 0.75rem;
  height: 2px;
  background: linear-gradient(
    90deg,
    rgba(0, 232, 255, 0.85) 0%,
    rgba(255, 42, 109, 0.55) 100%
  );
}

[role="main"] .content ul.home-sections-list > li.home-nav-branch::after {
  content: "";
  position: absolute;
  left: 0.62rem;
  top: calc(0.915em - 3.5px);
  width: 7px;
  height: 7px;
  border: 1px solid var(--copper);
  border-radius: 1px;
  background: rgba(0, 232, 255, 0.12);
  box-shadow: 0 0 6px rgba(0, 232, 255, 0.25);
}

/* Section imbriquée (rare) : puces secondaires comme ul ul */
[role="main"] .content ul.home-nav-nested li.home-nav-branch {
  padding-left: 1.35rem;
  line-height: 1.65;
}

[role="main"] .content ul.home-nav-nested li.home-nav-branch::before {
  width: 0.65rem;
  top: calc(0.915em - 1px);
  background: linear-gradient(
    90deg,
    rgba(255, 42, 109, 0.55) 0%,
    rgba(0, 232, 255, 0.35) 100%
  );
}

[role="main"] .content ul.home-nav-nested li.home-nav-branch::after {
  top: calc(0.915em - 3.5px);
  border-color: var(--neon-magenta);
  background: rgba(255, 42, 109, 0.08);
  box-shadow: 0 0 6px rgba(255, 42, 109, 0.2);
}

[role="main"] .content .home-nav-section-label {
  display: block;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--neon-cyan);
  margin-bottom: 0.35rem;
  text-shadow: 0 0 12px rgba(0, 232, 255, 0.2);
}

[role="main"] .content ul.home-nav-nested {
  margin-top: 0.35rem;
  margin-bottom: 0.25rem;
}

[role="main"] .content .home-section-blurb {
  color: var(--fg-dim);
  font-size: 0.88em;
}

/* Listes ordonnées : préfixe compact NN/ — pas de barre verticale (contrairement aux ul) */
[role="main"] .content ol {
  list-style: none;
  counter-reset: ol-addr;
  margin: 0.85rem 0 1.1rem;
  padding-left: 0;
  border-left: none;
  box-shadow: none;
}

[role="main"] .content ol ol {
  counter-reset: ol-addr;
  margin: 0.45rem 0 0.4rem;
  padding-left: 0.9rem;
  border-left: none;
  box-shadow: none;
}

[role="main"] .content ol ol ol {
  margin: 0.4rem 0 0.35rem;
  padding-left: 0.9rem;
  border-left: none;
  box-shadow: none;
}

[role="main"] .content ol ol ol ol {
  margin: 0.35rem 0 0.3rem;
  padding-left: 0.85rem;
  border-left: none;
  box-shadow: none;
}

[role="main"] .content ol > li {
  position: relative;
  padding-left: 1.95rem;
  margin-bottom: 0.5rem;
  counter-increment: ol-addr;
  line-height: 1.65;
}

[role="main"] .content ol > li:last-child {
  margin-bottom: 0;
}

[role="main"] .content ol > li::before {
  /* Compact : NN/ (plus de “0x” — gagne ~1ch + moins de padding) */
  content: counter(ol-addr, decimal-leading-zero) "/\2009";
  position: absolute;
  left: 0;
  top: 0;
  width: 1.7rem;
  height: 1.65em;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  transform: translateY(0.14em);
  font-family: var(--font-code);
  font-size: 0.68em;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(0, 232, 255, 0.58);
  line-height: 1;
  text-shadow: 0 0 12px rgba(0, 232, 255, 0.15);
  pointer-events: none;
}

/* Profondeur ol : couleur du préfixe NN/ (comme les bus ul / ul ul / ul ul ul) */
[role="main"] .content ol ol > li::before {
  color: rgba(255, 42, 109, 0.6);
  text-shadow: 0 0 12px rgba(255, 42, 109, 0.22);
}

[role="main"] .content ol ol ol > li::before {
  color: rgba(255, 165, 55, 0.68);
  text-shadow: 0 0 10px rgba(255, 145, 0, 0.2);
}

[role="main"] .content ol ol ol ol > li::before {
  color: rgba(201, 123, 83, 0.75);
  text-shadow: 0 0 8px rgba(201, 123, 83, 0.18);
}

/* ——— Nav principale : bus horizontal uniquement (pas de traits sous les items) ——— */

.navbar .navbar-nav:not(.ml-auto) {
  position: relative;
  padding-left: 0.65rem;
  margin-left: 0.35rem;
  border-left: 2px solid rgba(0, 232, 255, 0.4);
  box-shadow: -1px 0 12px rgba(0, 232, 255, 0.08);
}

@media (min-width: 992px) {
  .navbar .navbar-nav:not(.ml-auto) {
    padding-bottom: 0.65rem;
    align-items: stretch;
  }

  /* Bus horizontal : ligne continue cyan → magenta */
  .navbar .navbar-nav:not(.ml-auto)::after {
    content: "";
    position: absolute;
    left: 0.35rem;
    right: 0;
    bottom: 0.2rem;
    height: 2px;
    border-radius: 1px;
    pointer-events: none;
    background: linear-gradient(
      90deg,
      rgba(0, 232, 255, 0.45) 0%,
      rgba(0, 232, 255, 0.8) 28%,
      rgba(255, 42, 109, 0.65) 78%,
      rgba(255, 42, 109, 0.35) 100%
    );
    box-shadow: 0 0 12px rgba(0, 232, 255, 0.18);
  }

  .navbar .navbar-nav:not(.ml-auto) > li.navitem,
  .navbar .navbar-nav:not(.ml-auto) > li.dropdown {
    position: relative;
    display: flex;
    align-items: flex-end;
  }

  .navbar .navbar-nav:not(.ml-auto) > li.navitem > .nav-link,
  .navbar .navbar-nav:not(.ml-auto) > li.dropdown > .nav-link {
    position: relative;
    z-index: 3;
    padding-bottom: 0.55rem !important;
  }
}

/* ——— TOC : colonne ≥ md, repliable natif < md ——— */
.bs-sidebar {
  padding-top: 1.75rem;
}

.toc-mobile-summary {
  list-style: none;
  cursor: pointer;
  font-family: var(--font-display);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.72rem;
  padding: 0.65rem 0.85rem;
  margin: 0;
  border: 1px solid rgba(0, 232, 255, 0.35);
  border-radius: 2px;
  background: var(--bg-elevated);
  color: var(--neon-cyan);
  transition: color 0.15s ease, box-shadow 0.15s ease;
}

.toc-mobile-summary::-webkit-details-marker {
  display: none;
}

.toc-mobile-sheet[open] .toc-mobile-summary {
  border-bottom: none;
  border-radius: 2px 2px 0 0;
  box-shadow: 0 0 12px rgba(0, 232, 255, 0.08);
}

.toc-mobile-sheet .toc-mobile-card {
  border-top: none !important;
  border-radius: 0 0 2px 2px !important;
}

.bs-sidebar .card,
.toc-mobile-sheet .toc-mobile-card {
  padding: 0.65rem 0.5rem 0.85rem;
  background: var(--bg-elevated) !important;
  border: 1px solid rgba(201, 123, 83, 0.35) !important;
  border-radius: 2px !important;
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.35);
}

/*
 * Sommaire MkDocs (.mkdocs-toc-wrap) : couleurs par data-level sur chaque li.
 * Le ToC mobile vit dans [role="main"] : les liens étaient stylés comme le corps
 * ([role="main"] a → cyan). On scope le main sur .content + règles dédiées ici.
 */
.mkdocs-toc-wrap ul,
.mkdocs-toc-wrap ul.mkdocs-toc-tree,
.mkdocs-toc-wrap ul.nav.flex-column {
  border-left: none !important;
  border-color: transparent !important;
  list-style: none;
  padding-left: 0.35rem;
  margin-left: 0.15rem;
}

/* Un pas d’indentation par ul imbriqué (aligné sur la colonne des puces, pas le texte parent) */
.mkdocs-toc-wrap ul ul {
  padding-left: 0.65rem;
  margin-top: 0.2rem;
  margin-bottom: 0.1rem;
  border-left: none !important;
}

.mkdocs-toc-wrap li.nav-item {
  position: relative;
}

/*
 * Bandeau coloré : seulement sur le li racine (h1). Pour ul ul > li, le bandeau sur le li
 * recréait border + padding en plus du ul → le 3e niveau partait sous le texte du parent.
 * Sous-niveaux : bandeau sur .nav-link, li sans bordure ni padding gauche.
 */
.mkdocs-toc-wrap ul.mkdocs-toc-tree > li.nav-item[data-level="1"] {
  border-left: 3px solid rgba(255, 42, 109, 0.85) !important;
  padding-left: 0.45rem;
  border-radius: 1px;
}

.mkdocs-toc-wrap ul ul li.nav-item {
  border-left: none !important;
  padding-left: 0 !important;
  border-radius: 0;
}

.mkdocs-toc-wrap ul ul li.nav-item > .nav-link {
  border-left: 3px solid rgba(0, 232, 255, 0.85);
  border-top: none;
  border-right: none;
  border-bottom: none;
  border-radius: 1px;
}

.mkdocs-toc-wrap ul ul li.nav-item[data-level="2"] > .nav-link {
  border-left-color: rgba(0, 232, 255, 0.85);
}

.mkdocs-toc-wrap ul ul li.nav-item[data-level="3"] > .nav-link {
  border-left-color: #ff9100;
}

.mkdocs-toc-wrap ul ul li.nav-item[data-level="4"] > .nav-link {
  border-left-color: rgba(201, 123, 83, 0.9);
}

.mkdocs-toc-wrap ul ul li.nav-item[data-level="5"] > .nav-link {
  border-left-color: rgba(255, 42, 109, 0.65);
}

.mkdocs-toc-wrap a.nav-link {
  position: relative;
  color: var(--fg-dim) !important;
  font-size: 0.82rem;
  padding: 0.35rem 0.5rem 0.35rem 1.1rem !important;
  border-radius: 2px;
  border-bottom: none !important;
  box-shadow: none !important;
  text-decoration: none !important;
  transition: color 0.15s ease, background 0.15s ease;
}

.mkdocs-toc-wrap a.nav-link:hover {
  color: var(--neon-magenta) !important;
  background: rgba(255, 42, 109, 0.06);
  border-bottom: none !important;
  box-shadow: none !important;
}

.mkdocs-toc-wrap .nav-link::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  margin-top: -1px;
  width: 0.55rem;
  height: 2px;
  background: linear-gradient(
    90deg,
    rgba(255, 42, 109, 0.85) 0%,
    rgba(255, 42, 109, 0.35) 100%
  );
}

.mkdocs-toc-wrap li.nav-item[data-level="1"] .nav-link::after {
  border-color: rgba(255, 42, 109, 0.65);
  background: rgba(255, 42, 109, 0.12);
  box-shadow: 0 0 6px rgba(255, 42, 109, 0.25);
}

.mkdocs-toc-wrap li.nav-item[data-level="2"] .nav-link::before {
  background: linear-gradient(
    90deg,
    rgba(0, 232, 255, 0.9) 0%,
    rgba(0, 232, 255, 0.35) 100%
  );
}

.mkdocs-toc-wrap li.nav-item[data-level="3"] .nav-link::before {
  background: linear-gradient(
    90deg,
    #ffb74d 0%,
    rgba(255, 145, 0, 0.5) 100%
  );
}

.mkdocs-toc-wrap li.nav-item[data-level="4"] .nav-link::before {
  background: linear-gradient(
    90deg,
    rgba(201, 123, 83, 0.95) 0%,
    rgba(201, 123, 83, 0.45) 100%
  );
}

.mkdocs-toc-wrap li.nav-item[data-level="5"] .nav-link::before {
  background: linear-gradient(
    90deg,
    rgba(255, 42, 109, 0.75) 0%,
    rgba(255, 42, 109, 0.35) 100%
  );
}

.mkdocs-toc-wrap .nav-link::after {
  content: "";
  position: absolute;
  left: 0.48rem;
  top: 50%;
  margin-top: -3px;
  width: 6px;
  height: 6px;
  border: 1px solid var(--copper);
  border-radius: 1px;
  background: rgba(0, 232, 255, 0.1);
  pointer-events: none;
}

.mkdocs-toc-wrap li.nav-item[data-level="2"] .nav-link::after {
  border-color: rgba(0, 232, 255, 0.6);
  background: rgba(0, 232, 255, 0.14);
}

.mkdocs-toc-wrap li.nav-item[data-level="3"] .nav-link::after {
  border-color: #ff9100;
  background: rgba(255, 145, 0, 0.18);
  box-shadow: 0 0 6px rgba(255, 145, 0, 0.25);
}

.mkdocs-toc-wrap li.nav-item[data-level="4"] .nav-link::after {
  border-color: rgba(201, 123, 83, 0.75);
  background: rgba(201, 123, 83, 0.14);
}

.mkdocs-toc-wrap li.nav-item[data-level="5"] .nav-link::after {
  border-color: rgba(255, 42, 109, 0.55);
  background: rgba(255, 42, 109, 0.1);
}

/* ——— Code ——— */
code {
  font-family: var(--font-code);
  font-size: 0.88em;
  color: var(--neon-yellow);
  background: rgba(16, 24, 40, 0.9) !important;
  border: 1px solid rgba(0, 232, 255, 0.2);
  padding: 0.1em 0.35em;
  border-radius: 2px;
}

/* Fallback hors contenu principal (modales, etc.) */
pre {
  font-family: var(--font-code);
  font-size: 0.85rem;
  background: var(--bg-panel) !important;
  border: 1px solid rgba(30, 77, 58, 0.5) !important;
  border-radius: 2px !important;
  padding: 1rem !important;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.4);
}

/*
 * Blocs code dans les pages : HUD léger (coins comme le menu actif), gouttière,
 * police Kode Mono — plus discret que la nav (opacités basses).
 */
[role="main"] .content pre {
  position: relative;
  margin: 1.1rem 0;
  padding: 0 !important;
  overflow-x: auto;
  overflow-y: hidden;
  font-family: var(--font-code) !important;
  font-size: 0.8125rem;
  line-height: 1.55;
  tab-size: 2;
  border: 1px solid rgba(0, 232, 255, 0.26) !important;
  border-radius: 3px !important;
  background-color: #080c14;
  background-image:
    linear-gradient(90deg, rgba(255, 224, 90, 0.38), rgba(255, 224, 90, 0.38)) left 11px top 11px / 8px 1px no-repeat,
    linear-gradient(180deg, rgba(255, 224, 90, 0.38), rgba(255, 224, 90, 0.38)) left 11px top 11px / 1px 8px no-repeat,
    linear-gradient(90deg, rgba(0, 228, 255, 0.32), rgba(0, 228, 255, 0.32)) right 11px bottom 11px / 8px 1px no-repeat,
    linear-gradient(180deg, rgba(0, 228, 255, 0.32), rgba(0, 228, 255, 0.32)) right 11px bottom 11px / 1px 8px no-repeat,
    repeating-linear-gradient(
      180deg,
      transparent 0,
      transparent calc(1.55em - 1px),
      rgba(0, 232, 255, 0.028) calc(1.55em - 1px),
      rgba(0, 232, 255, 0.028) 1.55em
    ),
    linear-gradient(90deg, rgba(5, 9, 18, 0.99) 0%, rgba(5, 9, 18, 0.99) 2.55rem, rgba(10, 14, 24, 0.97) 2.55rem, rgba(10, 14, 24, 0.97) 100%),
    linear-gradient(90deg, transparent calc(2.55rem - 1px), rgba(0, 232, 255, 0.11) 2.55rem, transparent calc(2.55rem + 1px));
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, repeat, no-repeat, no-repeat;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.035),
    inset 0 -1px 0 rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(0, 0, 0, 0.35),
    0 0 28px rgba(0, 232, 255, 0.05);
}

[role="main"] .content pre code {
  display: block;
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 1rem 1.1rem 1.1rem 3.05rem !important;
  font-family: var(--font-code) !important;
  font-size: inherit !important;
  line-height: inherit;
  letter-spacing: 0.03em;
  color: rgba(214, 226, 238, 0.94);
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  white-space: pre;
  word-break: normal;
  overflow-wrap: normal;
}

/* Étiquette discrète dans la gouttière (ambiance “segment mémoire”) */
[role="main"] .content pre::before {
  content: "MEM";
  position: absolute;
  left: 0.55rem;
  top: 0.55rem;
  z-index: 2;
  font-family: var(--font-display);
  font-size: 0.52rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  color: rgba(0, 232, 255, 0.28);
  text-shadow: 0 0 10px rgba(0, 232, 255, 0.12);
  pointer-events: none;
}

pre code {
  color: var(--fg);
  border: none;
  padding: 0;
  background: transparent !important;
}

/* ——— Footer ——— */
footer {
  position: relative;
  z-index: 1;
  margin-top: 2rem;
  padding: 1.5rem 0 2rem;
  border-top: 1px solid rgba(0, 232, 255, 0.15);
  box-shadow: 0 -8px 32px rgba(255, 42, 109, 0.04);
  color: var(--fg-dim);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
}

footer hr {
  display: none;
}

footer p {
  margin: 0.35rem 0;
}

footer a {
  color: var(--copper);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease;
}

footer a:hover {
  color: var(--neon-cyan);
}

/* ——— Modal recherche ——— */
.modal-content {
  background: var(--bg-panel) !important;
  border: 1px solid var(--border) !important;
  border-radius: 2px !important;
  color: var(--fg);
  box-shadow: 0 0 40px rgba(255, 42, 109, 0.12);
}

.modal-header {
  border-bottom-color: var(--border) !important;
}

.form-control {
  background: var(--bg-elevated) !important;
  border-color: rgba(0, 232, 255, 0.25) !important;
  color: var(--fg) !important;
  font-family: var(--font);
}

.close {
  color: var(--fg) !important;
  text-shadow: none;
  opacity: 0.7;
}

/* ——— Dropdown nav ——— */
.dropdown-menu {
  z-index: 1050;
  background: var(--bg-elevated) !important;
  border: 1px solid rgba(255, 42, 109, 0.25) !important;
  border-radius: 2px !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.dropdown-item {
  color: var(--fg) !important;
  font-size: 0.85rem;
}

.dropdown-item:hover {
  background: rgba(0, 232, 255, 0.08) !important;
  color: var(--neon-cyan) !important;
}
