/* ═══════════════════════════════════════════════════════════════
   NEXUSFR — main.css
   Design system : terminal / hacker / underground FR
   ═══════════════════════════════════════════════════════════════ */

/* ─── Variables ──────────────────────────────────────────────── */
:root {
  --bg: #0a0a0a;
  --bg-card: #111111;
  --bg-card-hover: #141414;
  --bg-input: #0d0d0d;
  --surface: #161616;
  --surface-2: #1a1a1a;

  --border: #1e1e1e;
  --border-subtle: #161616;
  --border-hover: #00ff88;

  --text: #f0f0f0;
  --text-muted: #888888;
  --text-dim: #555555;

  --accent: #00ff88;
  --accent-dim: rgba(0, 255, 136, 0.12);
  --accent-glow: rgba(0, 255, 136, 0.06);

  --red: #ff4444;
  --yellow: #ffcc00;
  --blue: #4488ff;

  --niveau-debutant: #4488ff;
  --niveau-avance: #ffaa00;
  --niveau-expert: #ff4488;

  --font-mono: "Courier New", "Lucida Console", monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

  --radius: 3px;
  --radius-sm: 2px;

  --transition: 150ms ease;
  --transition-fast: 80ms ease;

  --header-h: 52px;
  --content-max: 1100px;
  --guide-max: 860px;
}

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

html {
  font-size: 15px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

main {
  flex: 1;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--text);
}

img {
  max-width: 100%;
  display: block;
}

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  background: none;
  border: none;
  font: inherit;
  color: inherit;
}

input, textarea, select {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

/* ─── Header ─────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
}

.header-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.site-logo {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
}

.site-logo:hover {
  color: var(--text);
}

.logo-bracket {
  color: var(--accent);
}

.logo-name {
  color: var(--text);
}

.site-nav {
  display: flex;
  align-items: center;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-link {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius);
  transition: color var(--transition), background var(--transition);
  letter-spacing: 0.02em;
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent);
  background: var(--accent-dim);
}

.nav-link.active {
  color: var(--accent);
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  transition: border-color var(--transition), color var(--transition);
}

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

.nav-toggle-icon {
  display: block;
  width: 16px;
  height: 2px;
  background: currentColor;
  position: relative;
}

.nav-toggle-icon::before,
.nav-toggle-icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
  transition: transform var(--transition);
}

.nav-toggle-icon::before { top: -5px; }
.nav-toggle-icon::after { top: 5px; }

/* ─── Footer ─────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 5rem;
}

.footer-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 1.25rem 1.25rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-logo {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
}

.footer-desc {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.footer-sep {
  color: var(--border);
  font-size: 0.8rem;
}

.footer-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
}

.footer-link {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: color var(--transition);
}

.footer-link:hover {
  color: var(--accent);
}

.footer-left,
.footer-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.footer-disclaimer {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0.5rem 1.25rem 1rem;
  border-top: 1px solid var(--border-subtle);
}

.footer-disclaimer-text {
  font-size: 0.7rem;
  color: var(--text-dim);
  line-height: 1.5;
}

/* ─── Section headers ────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.section-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: lowercase;
}

.section-title .prefix {
  color: var(--accent);
  margin-right: 0.25rem;
}

.section-subtitle {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.section-count {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-left: auto;
}

/* ─── Hero ───────────────────────────────────────────────────── */
.hero {
  padding: 5rem 1.25rem 4rem;
  max-width: var(--content-max);
  margin: 0 auto;
  border-bottom: 1px solid var(--border-subtle);
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.hero-eyebrow-line {
  width: 2rem;
  height: 2px;
  background: var(--accent);
  flex-shrink: 0;
}

.hero-eyebrow-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.hero-title {
  font-size: clamp(2.2rem, 6vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 1.75rem;
}

.hero-title .line-white {
  display: block;
  color: var(--text);
}

.hero-title .line-green {
  display: block;
  color: var(--accent);
}

.hero-tagline {
  font-size: 0.88rem;
  color: var(--text-muted);
  max-width: 480px;
  line-height: 1.65;
  margin-bottom: 2.5rem;
}

.hero-stats {
  display: flex;
  align-items: flex-end;
  gap: 3rem;
  flex-wrap: wrap;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.hero-stat strong {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  letter-spacing: -0.02em;
}

.hero-stat span {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.hero-stat-sep {
  display: none;
}

/* ─── Section wrappers ────────────────────────────────────────── */
.section {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 3rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.section:last-child {
  border-bottom: none;
}

/* ─── Category cards ─────────────────────────────────────────── */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.cat-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  text-decoration: none;
  color: inherit;
}

.cat-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  color: inherit;
}

.cat-emoji {
  font-size: 1.4rem;
  line-height: 1;
  flex-shrink: 0;
}

.cat-body {
  flex: 1;
  min-width: 0;
}

.cat-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.15rem;
}

.cat-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.cat-count {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.15rem 0.6rem;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ─── Ressource cards ────────────────────────────────────────── */
.ressource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 0.75rem;
}

.ressource-card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1rem 1.1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--transition), background var(--transition);
}

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

.ressource-card.hidden {
  display: none;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.card-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  flex: 1;
}

.card-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  text-decoration: none;
  transition: color var(--transition);
}

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

.badge-verif {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-dim);
  white-space: nowrap;
}

.card-badges {
  display: flex;
  gap: 0.25rem;
}

.card-badge {
  font-size: 0.8rem;
}

.card-description {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.55;
  flex: 1;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: auto;
  flex-wrap: wrap;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-guide-link,
.card-external-link {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: color var(--transition), border-color var(--transition);
}

.card-guide-link:hover,
.card-external-link:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.card-external-link {
  color: var(--accent);
  border-color: var(--accent-dim);
}

/* ─── Niveau badges ──────────────────────────────────────────── */
.niveau-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  border: 1px solid;
}

.niveau-debutant {
  color: var(--niveau-debutant);
  border-color: rgba(68, 136, 255, 0.25);
  background: rgba(68, 136, 255, 0.07);
}

.niveau-avance {
  color: var(--niveau-avance);
  border-color: rgba(255, 170, 0, 0.25);
  background: rgba(255, 170, 0, 0.07);
}

.niveau-expert {
  color: var(--niveau-expert);
  border-color: rgba(255, 68, 136, 0.25);
  background: rgba(255, 68, 136, 0.07);
}

/* ─── Tags ────────────────────────────────────────────────────── */
.card-tags {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-dim);
  padding: 0.1rem 0.35rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

/* ─── Guide cards ─────────────────────────────────────────────── */
.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
}

.guide-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem 1.1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--transition), background var(--transition);
}

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

.guide-card.hidden {
  display: none;
}

.guide-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.guide-card-cat {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.guide-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
}

.guide-card-link {
  color: var(--text);
  text-decoration: none;
  transition: color var(--transition);
}

.guide-card-link:hover {
  color: var(--accent);
}

.guide-card-description {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
}

.guide-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: auto;
}

.guide-card-cta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
  margin-left: auto;
  transition: opacity var(--transition);
}

.guide-card-cta:hover {
  color: var(--accent);
  opacity: 0.7;
}

/* ─── Search ──────────────────────────────────────────────────── */
.search-bar-wrapper {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  transition: border-color var(--transition);
}

.search-bar:focus-within {
  border-color: var(--accent);
}

.search-prefix {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.85rem;
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text);
  background: none;
  border: none;
  outline: none;
}

.search-input::placeholder {
  color: var(--text-dim);
}

.search-cursor {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.85rem;
  opacity: 1;
  animation: blink 1s step-end infinite;
}

.search-input:focus ~ .search-cursor {
  opacity: 1;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* ─── Filter bar ──────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.filter-btn {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.filter-btn:hover {
  color: var(--text-muted);
  border-color: var(--surface-2);
}

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

/* ─── No results ──────────────────────────────────────────────── */
.no-results {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  padding: 2rem 0;
  text-align: center;
  display: none;
}

.no-results.visible {
  display: block;
}

/* ─── Page layout ─────────────────────────────────────────────── */
.page-wrapper {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 3rem 1.25rem;
}

.page-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
}

.page-description {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 580px;
}

/* ─── Category page ───────────────────────────────────────────── */
.cat-page-wrapper {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 3rem 1.25rem;
}

.cat-page-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.cat-page-title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.cat-page-emoji {
  font-size: 1.5rem;
}

.cat-page-title {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.cat-page-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 500px;
}

.cat-page-count {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 0.5rem;
}

/* ─── Guide detail ────────────────────────────────────────────── */
.guide-wrapper {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 3rem 1.25rem;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 3rem;
  align-items: start;
}

.guide-sidebar {
  position: sticky;
  top: calc(var(--header-h) + 1.5rem);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.guide-meta-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.meta-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.meta-value {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.toc-nav {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}

.toc-title {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--accent);
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
}

.toc-links {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.toc-link {
  font-size: 0.75rem;
  color: var(--text-dim);
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-sm);
  border-left: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
  line-height: 1.4;
}

.toc-link:hover,
.toc-link.active {
  color: var(--accent);
  border-left-color: var(--accent);
}

.toc-link.toc-h3 {
  padding-left: 0.8rem;
  font-size: 0.72rem;
}

.back-link {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  transition: color var(--transition);
}

.back-link:hover {
  color: var(--accent);
}

/* ─── Guide article ───────────────────────────────────────────── */
.guide-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.guide-header-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.guide-cat {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.guide-title {
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 0.5rem;
}

.guide-description {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 600px;
}

/* ─── Prose ───────────────────────────────────────────────────── */
.prose {
  max-width: var(--guide-max);
}

.prose h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
  letter-spacing: -0.01em;
}

.prose h2::before {
  content: "// ";
  color: var(--accent);
  font-family: var(--font-mono);
}

.prose h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.prose p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 0.75rem;
}

.prose ul,
.prose ol {
  list-style: none;
  margin-bottom: 0.75rem;
  padding-left: 0;
}

.prose ul li {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.65;
  padding-left: 1rem;
  position: relative;
  margin-bottom: 0.25rem;
}

.prose ul li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.prose ol {
  counter-reset: ol-counter;
}

.prose ol li {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.65;
  padding-left: 1.5rem;
  position: relative;
  margin-bottom: 0.25rem;
  counter-increment: ol-counter;
}

.prose ol li::before {
  content: counter(ol-counter) ".";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  background: var(--surface);
  color: var(--accent);
  padding: 0.15rem 0.35rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.prose pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  overflow-x: auto;
  margin-bottom: 1rem;
}

.prose pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.8rem;
  color: var(--text);
}

.prose blockquote {
  border-left: 2px solid var(--accent);
  padding-left: 1rem;
  margin: 1rem 0;
  color: var(--text-dim);
  font-size: 0.85rem;
}

.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(0, 255, 136, 0.3);
  text-underline-offset: 2px;
}

.prose a:hover {
  text-decoration-color: var(--accent);
  color: var(--accent);
}

.prose hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

.prose strong {
  color: var(--text);
  font-weight: 600;
}

.prose em {
  color: var(--text-muted);
  font-style: italic;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
  font-size: 0.82rem;
}

.prose th,
.prose td {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  text-align: left;
}

.prose th {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
}

.prose td {
  color: var(--text-muted);
}

/* ─── Guides list page ────────────────────────────────────────── */
.guides-page-wrapper {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 3rem 1.25rem;
}

.guides-page-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.guides-filter-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.guides-filter-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* ─── 404 ─────────────────────────────────────────────────────── */
.error-page {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 5rem 1.25rem;
  text-align: center;
}

.error-code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--red);
  margin-bottom: 1rem;
  letter-spacing: 0.1em;
}

.error-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.error-message {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.error-prompt {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 2rem;
}

.error-prompt span {
  color: var(--accent);
}

.error-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.error-link {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: color var(--transition), border-color var(--transition);
}

.error-link:hover,
.error-link.primary {
  color: var(--accent);
  border-color: var(--accent);
}

/* ─── Accent helper ───────────────────────────────────────────── */
.accent {
  color: var(--accent);
}

/* ─── Utility ─────────────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* ─── Warning box ─────────────────────────────────────────────── */
.warning-box {
  background: rgba(255, 68, 68, 0.06);
  border: 1px solid rgba(255, 68, 68, 0.2);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.warning-box::before {
  content: "⚠ ";
  color: var(--red);
}

/* ─── Responsive ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .guide-wrapper {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .guide-sidebar {
    position: static;
    order: -1;
    flex-direction: row;
    flex-wrap: wrap;
    margin-bottom: 2rem;
  }

  .guide-meta-box,
  .toc-nav {
    flex: 1;
    min-width: 200px;
  }

  .back-link {
    width: 100%;
  }
}

@media (max-width: 700px) {
  .nav-toggle {
    display: flex;
  }

  .nav-list {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 0.75rem 1.25rem;
    gap: 0.15rem;
    z-index: 99;
  }

  .nav-list.open {
    display: flex;
  }

  .nav-link {
    display: block;
    padding: 0.5rem 0.4rem;
  }

  .hero {
    padding: 2.5rem 1.25rem 2rem;
  }

  .hero-title {
    font-size: clamp(1.5rem, 8vw, 2.2rem);
  }

  .ressource-grid,
  .guide-grid {
    grid-template-columns: 1fr;
  }

  .cat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .guide-sidebar {
    flex-direction: column;
  }

  .guide-meta-box,
  .toc-nav {
    min-width: auto;
  }
}

@media (max-width: 400px) {
  .cat-grid {
    grid-template-columns: 1fr;
  }
}

/* ─── Syntax highlight overrides ──────────────────────────────── */
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
  color: var(--text-dim);
}

.token.punctuation {
  color: var(--text-muted);
}

.token.property,
.token.tag,
.token.constant,
.token.symbol,
.token.deleted {
  color: var(--red);
}

.token.boolean,
.token.number {
  color: var(--niveau-avance);
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
  color: var(--accent);
}

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string,
.token.variable {
  color: var(--text);
}

.token.atrule,
.token.attr-value,
.token.keyword {
  color: var(--blue);
}

.token.function,
.token.class-name {
  color: var(--niveau-expert);
}