/* Managed by BriqueParBrique/nouvelle-brique — do not edit in brick repos */

/* ============================================
   Accessibilité
   ============================================ */

.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  padding: 0.5rem 1rem;
  background: var(--brique-primary, #3b7dd8);
  color: #fff;
  z-index: 1000;
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
}

/* ============================================
   Variables & Couleurs
   ============================================ */

:root {
  color-scheme: light dark;

  --color-bg: #f5f5f0;
  --color-text: #333;
  --color-text-light: #555;
  --color-text-muted: #666;
  --color-white: #fff;
  --color-dark: #2c3e50;
  --color-border: #e8e8e3;
  --color-code-bg: #f0f0ea;

  --brique-primary: #3b7dd8;
  --brique-primary-light: #5a9be6;
  --brique-gradient: linear-gradient(135deg, #3b7dd8, #5a9be6);

  --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --content-width: 720px;
  --radius: 12px;
  --radius-sm: 8px;
}

/* ============================================
   Dark mode (OS preference)
   ============================================ */

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #1a1a2e;
    --color-text: #e0e0e0;
    --color-text-light: #b0b0b0;
    --color-text-muted: #999;
    --color-white: #242440;
    --color-dark: #0f0f1e;
    --color-border: #333355;
    --color-code-bg: #2a2a45;
  }

  .dev-banner {
    background: #3d3520;
    color: #f0d080;
  }

  .step-card {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  }

  .step-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  }

  .hero-cta {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
  }

  .site-footer {
    background: #0f0f1e;
  }

  .site-footer a {
    color: #7ab8f5;
  }

  .site-footer a:hover {
    color: #fff;
  }

  .level-nav-link {
    border-color: rgba(255, 255, 255, 0.15);
  }

  .step-card.visited .step-card-number {
    background: var(--color-white);
  }

  @keyframes pulse-current {
    0%, 100% { box-shadow: 0 0 0 0 rgba(90, 155, 230, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(90, 155, 230, 0); }
  }

  /* Dark mode: TOC */
  .step-toc {
    background: var(--color-code-bg);
    border-color: var(--color-border);
  }

  /* Dark mode: Copy button */
  .copy-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #ccc;
  }

  .copy-btn:hover {
    background: rgba(255, 255, 255, 0.2);
  }

  /* Dark mode: Search */
  .search-modal-content {
    background: #242440;
  }

  .search-input {
    background: #1a1a2e;
    color: #e0e0e0;
    border-color: #333355;
  }

  .search-result-item:hover {
    background: #333355;
  }

  /* Dark mode: Completion checkbox */
  .step-completion {
    background: var(--color-code-bg);
    border-color: var(--color-border);
  }

  /* Dark mode: Prerequisite */
  .step-prerequisite.unmet {
    background: #3d3520;
    border-color: #856404;
    color: #f0d080;
  }

  /* Dark mode: Back to top */
  .back-to-top {
    background: #242440;
    color: #e0e0e0;
    border-color: #333355;
  }

  /* Dark mode: Keyboard hint */
  .keyboard-hint kbd {
    background: #333355;
    border-color: #444466;
    color: #b0b0b0;
  }
}

/* Couleurs par brique */
.brique-blue {
  --brique-primary: #3b7dd8;
  --brique-primary-light: #5a9be6;
  --brique-gradient: linear-gradient(135deg, #3b7dd8, #5a9be6);
}

.brique-teal {
  --brique-primary: #2a9d8f;
  --brique-primary-light: #3dbdad;
  --brique-gradient: linear-gradient(135deg, #2a9d8f, #3dbdad);
}

.brique-orange {
  --brique-primary: #e09f3e;
  --brique-primary-light: #f0b95a;
  --brique-gradient: linear-gradient(135deg, #e09f3e, #f0b95a);
}

/* ============================================
   Smooth scroll (#13)
   ============================================ */

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* ============================================
   Reset & Base
   ============================================ */

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

body {
  font-family: var(--font-stack);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--brique-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
}

/* ============================================
   Header
   ============================================ */

.site-header {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--color-text);
}

.header-brand:hover {
  text-decoration: none;
}

.header-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.header-name {
  font-weight: 700;
  font-size: 1.1rem;
}

.header-level {
  display: flex;
  gap: 3px;
  margin-left: 0.25rem;
}

.level-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-border);
}

.level-dot.active {
  background: var(--brique-primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-back {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.header-back:hover {
  color: var(--brique-primary);
}

/* ============================================
   Search toggle button (#5)
   ============================================ */

.search-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.search-toggle:hover {
  color: var(--brique-primary);
  border-color: var(--brique-primary);
}

/* ============================================
   Search modal (#5)
   ============================================ */

.search-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
}

.search-modal.active {
  display: flex;
}

.search-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.search-modal-content {
  position: relative;
  width: 90%;
  max-width: 520px;
  background: var(--color-white);
  border-radius: var(--radius);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.search-input {
  width: 100%;
  padding: 1rem 1.25rem;
  border: none;
  border-bottom: 1px solid var(--color-border);
  font-size: 1rem;
  font-family: var(--font-stack);
  background: var(--color-white);
  color: var(--color-text);
  outline: none;
}

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

.search-results {
  max-height: 300px;
  overflow-y: auto;
}

.search-result-item {
  display: block;
  padding: 0.75rem 1.25rem;
  color: var(--color-text);
  text-decoration: none;
  transition: background 0.15s;
}

.search-result-item:hover {
  background: var(--color-bg);
  text-decoration: none;
}

.search-result-item strong {
  display: block;
  font-size: 0.95rem;
}

.search-result-snippet {
  display: block;
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin-top: 0.15rem;
}

.search-no-results {
  padding: 1rem 1.25rem;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.search-hint {
  padding: 0.5rem 1.25rem;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-align: right;
  border-top: 1px solid var(--color-border);
}

/* ============================================
   Bannière développement
   ============================================ */

.dev-banner {
  background: #fef3cd;
  color: #856404;
  text-align: center;
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
}

/* ============================================
   Hero (page d'accueil)
   ============================================ */

.hero {
  background: var(--brique-gradient);
  padding: 4rem 1.5rem;
  text-align: center;
  color: var(--color-white);
}

.hero-content {
  max-width: var(--content-width);
  margin: 0 auto;
}

.hero-logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin-bottom: 1rem;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.hero-level {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 1rem;
}

.level-pyramid {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
}

.level-pyramid.active {
  background: var(--color-white);
}

.hero-description {
  font-size: 1.15rem;
  opacity: 0.9;
  margin-bottom: 2rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.hero-cta {
  display: inline-block;
  background: var(--color-white);
  color: var(--brique-primary);
  padding: 0.75rem 2rem;
  border-radius: 50px;
  font-weight: 700;
  font-size: 1.05rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  text-decoration: none;
}

/* ============================================
   Hero states (fresh / progress / done)
   ============================================ */

.hero-state {
  display: none;
}

.hero-state.active {
  display: block;
}

/* Fresh: only "Commencer" */
.hero-state-fresh .hero-cta {
  margin-top: 0;
}

/* In progress: counter + resume + reset */
.completion-summary {
  font-size: 0.95rem;
  opacity: 0.9;
  margin-bottom: 1rem;
}

.completion-count {
  font-weight: 700;
  font-size: 1.1rem;
}

.hero-resume {
  display: inline-block;
}

.hero-reset {
  display: block;
  margin: 0.75rem auto 0;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  padding: 0.25rem 0.5rem;
  font-size: 0.78rem;
  font-family: var(--font-stack);
  cursor: pointer;
  text-decoration: underline;
  transition: color 0.2s;
}

.hero-reset:hover {
  color: #fff;
}

/* Done: congrats + restart */
.completion-congrats {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  padding: 0.5rem 1.25rem;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50px;
  display: inline-block;
}

/* ============================================
   Steps overview (page d'accueil)
   ============================================ */

.steps-overview {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.steps-overview-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  text-align: center;
}

.steps-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.step-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--color-white);
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s, box-shadow 0.2s;
  color: var(--color-text);
}

.step-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  text-decoration: none;
}

.step-card-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--brique-gradient);
  color: var(--color-white);
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.step-card-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.step-card-title {
  font-weight: 600;
  font-size: 1.05rem;
}

.step-card-reading-time {
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

/* Visitée (vue, pas encore complétée) — bordure colorée, sans animation */
.step-card.visited .step-card-number {
  background: var(--color-white);
  border: 3px solid var(--brique-primary);
  color: var(--brique-primary);
}

/* En cours (dernière étape visitée) — bordure colorée + pulse */
.step-card.current .step-card-number {
  background: var(--color-white);
  border: 3px solid var(--brique-primary);
  animation: pulse-current 2s ease-in-out infinite;
  font-size: 0;
}

.step-card.current .step-card-number::after {
  content: "▶";
  font-size: 0.85rem;
  color: var(--brique-primary);
}

/* Complétée (checkbox cochée) — checkmark vert */
.step-card.completed .step-card-number {
  background: #2a9d8f;
  font-size: 0;
}

.step-card.completed .step-card-number::after {
  content: "✓";
  font-size: 1.1rem;
}

@keyframes pulse-current {
  0%, 100% { box-shadow: 0 0 0 0 rgba(59, 125, 216, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(59, 125, 216, 0); }
}


/* ============================================
   Step page
   ============================================ */

.step-container {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}

/* Progress bar */
.progress-bar {
  height: 4px;
  background: var(--color-border);
  border-radius: 2px;
  margin: 1.5rem 0;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--brique-gradient);
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* Step header */
.step-header {
  margin-bottom: 2rem;
}

.step-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.25rem;
}

.step-number {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--brique-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.step-reading-time {
  font-size: 0.82rem;
  color: var(--color-text-muted);
}

.step-title {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.3;
}

/* ============================================
   Table of Contents (#1)
   ============================================ */

.step-toc {
  background: var(--color-code-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin-bottom: 2rem;
}

.step-toc-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  font-family: var(--font-stack);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-text);
  cursor: pointer;
  padding: 0;
}

.step-toc-icon {
  transition: transform 0.2s;
}

.step-toc-toggle[aria-expanded="false"] .step-toc-icon {
  transform: rotate(-90deg);
}

.step-toc-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
}

.step-toc-list li {
  margin: 0.25rem 0;
}

.step-toc-list li a {
  font-size: 0.88rem;
  color: var(--color-text-light);
  text-decoration: none;
}

.step-toc-list li a:hover {
  color: var(--brique-primary);
  text-decoration: underline;
}

.step-toc-list li.toc-indent {
  padding-left: 1.25rem;
}

/* ============================================
   Prerequisites notice (#10)
   ============================================ */

.step-prerequisite {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.step-prerequisite.unmet {
  background: #fef3cd;
  border: 1px solid #ffc107;
  color: #856404;
}

.step-prerequisite.met {
  background: #d4edda;
  border: 1px solid #28a745;
  color: #155724;
}

/* Step content (Markdown) */
.step-content {
  line-height: 1.8;
}

.step-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
}

.step-content h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

.step-content p {
  margin-bottom: 1rem;
}

.step-content ul, .step-content ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.step-content li {
  margin-bottom: 0.35rem;
}

.step-content code {
  background: var(--color-code-bg);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
}

.step-content pre {
  background: var(--color-dark);
  color: #e8e8e3;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.step-content pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: 0.9rem;
  color: inherit;
}

.step-content strong {
  font-weight: 700;
}

.step-content blockquote {
  border-left: 4px solid var(--brique-primary);
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  background: var(--color-code-bg);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.step-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.step-content th,
.step-content td {
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--color-border);
  text-align: left;
}

.step-content th {
  background: var(--color-code-bg);
  font-weight: 700;
}

.step-content tbody tr:nth-child(even) {
  background: var(--color-code-bg);
}

.step-content details {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
}

.step-content details[open] {
  padding-bottom: 1rem;
}

.step-content details summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--brique-primary);
}

.step-content details summary::marker {
  color: var(--brique-primary);
}

.step-content details > *:not(summary) {
  margin-top: 1rem;
}

.step-content details pre,
.step-content details table {
  margin-bottom: 0;
}

/* ============================================
   Code block copy button (#7)
   ============================================ */

.code-block-wrapper {
  position: relative;
  margin-bottom: 1.5rem;
}

.code-block-wrapper pre {
  margin-bottom: 0;
}

.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  font-family: var(--font-stack);
  background: rgba(255, 255, 255, 0.08);
  color: #aaa;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  opacity: 0;
}

.code-block-wrapper:hover .copy-btn {
  opacity: 1;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.copy-btn.copied {
  background: #2a9d8f;
  color: #fff;
  border-color: #2a9d8f;
  opacity: 1;
}

/* ============================================
   Step completion checkbox (#2)
   ============================================ */

.step-completion {
  margin-top: 2rem;
  padding: 1rem 1.25rem;
  background: var(--color-code-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.step-completion-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
}

.step-completion-checkbox {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.step-completion-checkmark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 2px solid var(--color-border);
  border-radius: 6px;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s;
}

.step-completion-checkmark::after {
  content: "";
  display: none;
  width: 6px;
  height: 12px;
  border: solid #fff;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
  margin-bottom: 2px;
}

.step-completion-checkbox:checked ~ .step-completion-checkmark {
  background: #2a9d8f;
  border-color: #2a9d8f;
}

.step-completion-checkbox:checked ~ .step-completion-checkmark::after {
  display: block;
}

.step-completion-checkbox:focus-visible ~ .step-completion-checkmark {
  outline: 2px solid var(--brique-primary);
  outline-offset: 2px;
}

/* ============================================
   Keyboard navigation hint (#8)
   ============================================ */

.keyboard-hint {
  text-align: center;
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-top: 1.5rem;
  opacity: 0.7;
}

.keyboard-hint kbd {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  font-size: 0.75rem;
  font-family: var(--font-stack);
  background: var(--color-code-bg);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  box-shadow: 0 1px 0 var(--color-border);
}

/* Step navigation */
.step-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
  gap: 1rem;
}

.step-nav-link {
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.2s, transform 0.2s;
}

.step-nav-prev {
  color: var(--color-text-muted);
  background: var(--color-white);
  border: 1px solid var(--color-border);
}

.step-nav-prev:hover {
  background: var(--color-bg);
  text-decoration: none;
}

.step-nav-next {
  background: var(--brique-gradient);
  color: var(--color-white);
}

.step-nav-next:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  text-decoration: none;
}

.step-nav-placeholder {
  visibility: hidden;
}

.step-nav-finish {
  background: linear-gradient(135deg, #2a9d8f, #3dbdad);
}

/* ============================================
   Back to top button (#13)
   ============================================ */

.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-white);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s, transform 0.2s;
  z-index: 50;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ============================================
   Footer
   ============================================ */

.site-footer {
  background: var(--color-dark);
  color: rgba(255, 255, 255, 0.6);
  padding: 1.5rem;
  text-align: center;
  font-size: 0.85rem;
}

.site-footer a {
  color: #7ab8f5;
}

.site-footer a:hover {
  color: var(--color-white);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  padding-bottom: 1rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* ============================================
   Navigation entre niveaux (footer)
   ============================================ */

.level-nav {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  padding-bottom: 1rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.level-nav-link {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: background 0.2s, color 0.2s;
}

.level-nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-white);
  text-decoration: none;
}

/* ============================================
   Print stylesheet (#4)
   ============================================ */

@media print {
  .site-header,
  .dev-banner,
  .progress-bar,
  .step-nav,
  .site-footer,
  .hero-state,
  .back-to-top,
  .search-toggle,
  .search-modal,
  .step-toc-toggle,
  .step-completion,
  .keyboard-hint,
  .copy-btn,
  .skip-link,
  .header-actions {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 12pt;
    line-height: 1.5;
  }

  .hero {
    background: none !important;
    color: #000;
    padding: 1rem 0;
  }

  .hero-title {
    font-size: 1.8rem;
    color: #000;
  }

  .hero-description {
    color: #333;
  }

  .step-container {
    padding: 0;
    max-width: none;
  }

  .step-content pre {
    border: 1px solid #ccc;
    background: #f5f5f5 !important;
    color: #000 !important;
    white-space: pre-wrap;
    word-wrap: break-word;
    page-break-inside: avoid;
  }

  .step-content h2, .step-content h3 {
    page-break-after: avoid;
  }

  .step-content blockquote {
    border-left-color: #999;
    background: #f5f5f5;
  }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    color: #666;
  }

  .header-brand a::after,
  .step-toc a::after {
    content: none;
  }

  .step-toc-list {
    display: block !important;
  }

  .step-prerequisite {
    border: 1px solid #ccc;
    background: #f9f9f9;
    color: #333;
  }

  .step-card {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}

/* ============================================
   Responsive — Tablette (≤ 768px)
   ============================================ */

@media (max-width: 768px) {
  .hero {
    padding: 3rem 1.25rem;
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-description {
    font-size: 1.05rem;
  }

  .step-title {
    font-size: 1.75rem;
  }

  .step-content h2 {
    font-size: 1.35rem;
  }

  .footer-links {
    gap: 1rem;
  }

  .level-nav {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
}

/* ============================================
   Responsive — Mobile (≤ 480px)
   ============================================ */

@media (max-width: 480px) {
  .header-content {
    padding: 0.6rem 1rem;
  }

  .header-name {
    font-size: 0.95rem;
  }

  .header-back {
    font-size: 0.8rem;
  }

  .hero {
    padding: 2rem 1rem;
  }

  .hero-logo {
    width: 60px;
    height: 60px;
  }

  .hero-title {
    font-size: 1.6rem;
  }

  .hero-description {
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
  }

  .hero-cta {
    padding: 0.65rem 1.5rem;
    font-size: 0.95rem;
  }

  .steps-overview {
    padding: 2rem 1rem;
  }

  .steps-overview-title {
    font-size: 1.25rem;
  }

  .step-container {
    padding: 0 1rem 2rem;
  }

  .step-title {
    font-size: 1.4rem;
  }

  .step-content h2 {
    font-size: 1.2rem;
  }

  .step-content h3 {
    font-size: 1.05rem;
  }

  .step-content pre {
    padding: 1rem;
    font-size: 0.85rem;
    border-radius: 6px;
  }

  .step-card {
    padding: 0.85rem 1rem;
  }

  .step-card-number {
    width: 34px;
    height: 34px;
    font-size: 0.95rem;
  }

  .step-card-title {
    font-size: 0.95rem;
  }

  .step-nav {
    flex-direction: column;
  }

  .step-nav-link {
    width: 100%;
    text-align: center;
    padding: 0.75rem 1rem;
  }

  .step-nav-placeholder {
    display: none;
  }

  .footer-links {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }

  .level-nav {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }

  .level-nav-link {
    width: 100%;
    text-align: center;
  }

  .site-footer {
    padding: 1.25rem 1rem;
  }

  /* TOC: collapsed by default on mobile */
  .step-toc-list {
    display: none;
  }

  .step-toc-toggle[aria-expanded="true"] ~ .step-toc-list {
    display: block;
  }

  .back-to-top {
    bottom: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .keyboard-hint {
    display: none;
  }

  .step-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
}
