/* ============================================
   JustRestart Formation — Design System
   ============================================

   TABLE OF CONTENTS
   -----------------
   1.  Fonts & Variables                    line ~6
   2.  CSS Custom Properties               line ~25
   3.  Reset & Base                         line ~105
   4.  Typography                           line ~154
   5.  Layout                               line ~200
   6.  Header                               line ~213
   7.  Footer                               line ~374
   8.  Breadcrumb                           line ~475
   9.  Pill Badge                           line ~502
   10. Role Cards (Homepage)                line ~534
   11. Hub Hero Banner                      line ~591
   12. Domain Details                       line ~610
   13. Parcours Grid (guided paths)         line ~723
   14. Role Badge                           line ~766
   15. Disclaimer / Attention Box           line ~802
   16. Buttons                              line ~820
   17. Video Embed                          line ~867
   18. Figures & Screenshots                line ~924
   19. Section Headers                      line ~958
   20. Section Label (muted uppercase)      line ~972
   21. Search (homepage prominent)          line ~983
   22. Search Dropdown                      line ~1022
   23. AI Prompt Box                        line ~1078
   24. Fiche Content Layout                 line ~1138
   25. Fiche Prev/Next Navigation           line ~1179
   26. Manual Layout                        line ~1223
   27. Video Grid                           line ~1274
   28. Video Page Layout (sidebar + main)   line ~1316
   29. Glossary Tooltip                     line ~1364
   30. Glossary Page                        line ~1393
   31. Hero Section (Homepage)              line ~1423
   32. Section Heading (Homepage)           line ~1490
   33. Stats Bar (Homepage)                 line ~1500
   34. Home Sections                        line ~1533
   35. Features Grid (Homepage)             line ~1550
   36. Fiche Preview Grid (Homepage)        line ~1592
   37. Video Teaser Strip (Homepage)        line ~1645
   38. Info Box (Homepage)                  line ~1688
   39. About Section (Homepage)             line ~1700
   40. Contributors (Homepage)              line ~1711
   41. Fiche Disclaimer                     line ~1753
   42. Page "À propos"                      line ~1765
   43. Animations                           line ~1793
   44. Accessibility                        line ~1817
   45. Responsive                           line ~1851

   ============================================ */

/* --- Self-hosted Inter font --- */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* --- CSS Custom Properties --- */
:root {
  /* Dark mode base */
  --bg-base: #0A0A0F;
  --bg-surface: #111118;
  --bg-elevated: #1A1A24;
  --bg-hover: #22222E;

  /* Borders */
  --border-subtle: rgba(255,255,255,0.07);
  --border-default: rgba(255,255,255,0.12);
  --border-hover: rgba(255,255,255,0.18);
  --border-focus: rgba(99,102,241,0.6);

  /* Text */
  --text-primary: #F4F4F6;
  --text-secondary: rgba(244,244,246,0.65);
  --text-muted: rgba(244,244,246,0.40);

  /* Accent */
  --accent: #6366F1;
  --accent-hover: #818CF8;
  --accent-glow: rgba(99,102,241,0.15);
  --accent-subtle-bg: rgba(99,102,241,0.12);
  --accent-subtle-border: rgba(99,102,241,0.25);

  /* Status */
  --color-success: #10B981;
  --color-warning: #F59E0B;
  --color-warning-bg: rgba(245,158,11,0.08);
  --color-warning-border: rgba(245,158,11,0.20);

  /* Role colors — adapted for dark mode */
  --color-greffier: #60A5FA;
  --color-greffier-bg: rgba(96,165,250,0.12);
  --color-greffier-border: rgba(96,165,250,0.25);
  --color-magistrat: #F87171;
  --color-magistrat-bg: rgba(248,113,113,0.12);
  --color-magistrat-border: rgba(248,113,113,0.25);
  --color-mediateur: #34D399;
  --color-mediateur-bg: rgba(52,211,153,0.12);
  --color-mediateur-border: rgba(52,211,153,0.25);
  --color-commun: #9CA3AF;
  --color-commun-bg: rgba(156,163,175,0.12);
  --color-commun-border: rgba(156,163,175,0.25);

  /* Typography */
  --font-family: 'Inter', system-ui, -apple-system, sans-serif;
  --font-size-xs: 0.8125rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.25rem;
  --font-size-xl: 1.5rem;
  --font-size-2xl: 2.25rem;
  --font-size-hero: clamp(2.25rem, 5vw, 3.5rem);
  --font-size-section: clamp(1.5rem, 3vw, 2.25rem);
  --line-height: 1.6;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 5rem;

  /* Layout */
  --max-width: 1200px;
  --radius: 8px;
  --radius-sm: 6px;
  --radius-lg: 12px;
  --radius-pill: 9999px;
  --header-height: 64px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + var(--space-lg));
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: var(--line-height);
  color: var(--text-primary);
  background-color: var(--bg-base);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

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

::selection {
  background: var(--accent);
  color: white;
}

/* --- Typography --- */
h1 {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--space-md);
  color: var(--text-primary);
}

h2 {
  font-size: var(--font-size-xl);
  font-weight: 600;
  line-height: 1.3;
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-md);
  color: var(--text-primary);
}

h3 {
  font-size: var(--font-size-lg);
  font-weight: 600;
  line-height: 1.4;
  margin-top: var(--space-xl);
  margin-bottom: var(--space-sm);
}

h4 {
  font-size: var(--font-size-base);
  font-weight: 600;
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
}

p {
  margin-bottom: var(--space-md);
}

ul, ol {
  margin-bottom: var(--space-md);
  padding-left: var(--space-xl);
}

li {
  margin-bottom: var(--space-xs);
}

/* --- Layout --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.main-content {
  flex: 1;
  padding-top: calc(var(--header-height) + var(--space-xl));
  padding-bottom: var(--space-2xl);
}

/* --- Header --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(10,10,15,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 100;
  display: flex;
  align-items: center;
}

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

.site-logo {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.site-logo .logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: white;
}

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

.header-nav {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.header-nav a {
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  font-weight: 500;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.header-nav a:hover,
.header-nav a.active {
  color: var(--text-primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

/* Language switcher */
.lang-switch {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.lang-switch a {
  padding: var(--space-xs) var(--space-sm);
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 400;
  transition: all var(--transition-fast);
}

.lang-switch a:hover {
  background-color: var(--bg-elevated);
  color: var(--text-secondary);
  text-decoration: none;
}

.lang-switch a.active {
  font-weight: 700;
  color: var(--text-primary);
  background-color: var(--bg-elevated);
}

/* Search in header */
.header-search {
  position: relative;
}

.header-search input {
  width: 200px;
  padding: var(--space-sm) var(--space-md);
  padding-left: 2.2rem;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  font-family: var(--font-family);
  background: var(--bg-elevated);
  color: var(--text-primary);
  transition: width var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base);
}

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

.header-search input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
  width: 280px;
  background: var(--bg-surface);
}

.header-search .search-icon {
  position: absolute;
  left: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  pointer-events: none;
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: var(--font-size-xl);
  cursor: pointer;
  padding: var(--space-sm);
  color: var(--text-primary);
}

/* --- Footer --- */
.site-footer {
  background: var(--bg-base);
  border-top: 1px solid var(--border-subtle);
  padding: var(--space-3xl) 0 var(--space-xl);
  margin-top: auto;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-2xl);
  margin-bottom: var(--space-2xl);
}

.footer-brand {
  max-width: 280px;
}

.footer-brand .footer-logo {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.footer-brand .footer-tagline {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  line-height: 1.6;
}

.footer-col h4 {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-md);
  margin-top: 0;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-col li {
  margin-bottom: var(--space-sm);
}

.footer-col a {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.footer-col a:hover {
  color: var(--text-primary);
  text-decoration: none;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: var(--space-md);
}

.footer-text {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

.footer-disclaimer {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  font-style: italic;
}

/* Legacy footer compat */
.footer-links {
  display: flex;
  gap: var(--space-lg);
}

.footer-links a {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

/* --- Breadcrumb --- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
}

.breadcrumb a {
  color: var(--text-muted);
}

.breadcrumb a:hover {
  color: var(--accent-hover);
}

.breadcrumb .separator {
  margin: 0 var(--space-xs);
}

.breadcrumb .current {
  color: var(--text-secondary);
  font-weight: 500;
}

/* --- Pill Badge --- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-subtle-bg);
  border: 1px solid var(--accent-subtle-border);
  color: var(--accent-hover);
  border-radius: var(--radius-pill);
  padding: 3px 12px;
  font-size: var(--font-size-xs);
  font-weight: 500;
}

.pill-greffier {
  background: var(--color-greffier-bg);
  border-color: var(--color-greffier-border);
  color: var(--color-greffier);
}

.pill-magistrat {
  background: var(--color-magistrat-bg);
  border-color: var(--color-magistrat-border);
  color: var(--color-magistrat);
}

.pill-mediateur {
  background: var(--color-mediateur-bg);
  border-color: var(--color-mediateur-border);
  color: var(--color-mediateur);
}

/* --- Role Cards (Homepage) --- */
.role-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  margin: var(--space-xl) 0;
}

.role-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: var(--space-xl);
  text-align: center;
  text-decoration: none;
  color: var(--text-primary);
  transition: border-color var(--transition-base), transform var(--transition-base), background var(--transition-base);
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
}

.role-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-elevated);
  transform: translateY(-2px);
  text-decoration: none;
}

.role-card.greffier { border-top: 3px solid var(--color-greffier); }
.role-card.magistrat { border-top: 3px solid var(--color-magistrat); }
.role-card.mediateur { border-top: 3px solid var(--color-mediateur); }

.role-card .role-illustration {
  width: 100%;
  max-width: 280px;
  height: auto;
  border-radius: var(--radius-sm);
}

.role-card .role-icon {
  font-size: 2.5rem;
}

.role-card .role-title {
  font-size: var(--font-size-xl);
  font-weight: 600;
}

.role-card .role-stats {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

/* --- Hub Hero Banner (role illustration + title on hub pages) --- */
.hub-hero {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.hub-hero-img {
  width: 200px;
  height: auto;
  flex-shrink: 0;
  border-radius: var(--radius);
}

.hub-hero-text h1 {
  margin-bottom: var(--space-sm);
}

/* --- Domain Details (collapsible domain sections on hub pages) --- */
.domain-details {
  margin-bottom: var(--space-md);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  overflow: hidden;
}

.domain-details[open] {
  border-color: var(--border-hover);
}

.domain-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-surface);
  cursor: pointer;
  user-select: none;
  transition: background var(--transition-base);
  list-style: none;
}

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

.domain-summary::before {
  content: "\25B6";
  font-size: 0.7em;
  margin-right: var(--space-sm);
  transition: transform var(--transition-base);
  color: var(--text-muted);
}

.domain-details[open] .domain-summary::before {
  transform: rotate(90deg);
}

.domain-summary:hover {
  background: var(--bg-elevated);
}

.domain-summary-title {
  font-weight: 600;
  font-size: var(--font-size-base);
}

.domain-summary-count {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  white-space: nowrap;
}

.domain-details .fiche-list {
  padding: 0;
  gap: 0;
}

.fiche-list-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-lg);
  text-decoration: none;
  color: var(--text-primary);
  border-top: 1px solid var(--border-subtle);
  transition: background var(--transition-base);
}

.fiche-list-item:hover {
  background: var(--bg-elevated);
  text-decoration: none;
}

.fiche-list-id {
  font-weight: 700;
  font-size: var(--font-size-sm);
  color: var(--accent);
  min-width: 2.5rem;
  flex-shrink: 0;
}

.fiche-list-title {
  flex: 1;
  font-size: var(--font-size-sm);
}

.fiche-list-roles {
  display: flex;
  gap: var(--space-xs);
  flex-shrink: 0;
}

.fiche-list-roles .pill-greffier,
.fiche-list-roles .pill-magistrat,
.fiche-list-roles .pill-mediateur {
  font-size: 0.65rem;
  padding: 2px 8px;
}

.domain-video-link {
  padding: var(--space-sm) var(--space-lg);
  border-top: 1px solid var(--border-subtle);
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

.domain-video-link a {
  color: var(--accent);
}

/* --- Parcours Grid (guided paths) --- */
.parcours-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-xl);
  margin: var(--space-lg) 0;
}

.parcours-column h3 {
  margin-bottom: var(--space-md);
}

.parcours-card {
  display: block;
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
  transition: border-color var(--transition-base), background var(--transition-base);
}

.parcours-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-elevated);
  text-decoration: none;
}

.parcours-label {
  display: block;
  font-weight: 600;
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-xs);
}

.parcours-meta {
  display: block;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

/* --- Role Badge --- */
.role-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: var(--radius-pill);
  font-size: var(--font-size-xs);
  font-weight: 500;
}

.role-badge.Greffier,
.role-badge.greffier {
  background: var(--color-greffier-bg);
  border: 1px solid var(--color-greffier-border);
  color: var(--color-greffier);
}

.role-badge.Magistrat,
.role-badge.magistrat {
  background: var(--color-magistrat-bg);
  border: 1px solid var(--color-magistrat-border);
  color: var(--color-magistrat);
}

.role-badge.Médiateur,
.role-badge.mediateur {
  background: var(--color-mediateur-bg);
  border: 1px solid var(--color-mediateur-border);
  color: var(--color-mediateur);
}

.role-badge.commun {
  background: var(--color-commun-bg);
  border: 1px solid var(--color-commun-border);
  color: var(--color-commun);
}

/* --- Disclaimer / Attention Box --- */
.attention-box,
.disclaimer-box {
  background: var(--color-warning-bg);
  border: 1px solid var(--color-warning-border);
  border-left: 3px solid var(--color-warning);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius);
  margin: var(--space-lg) 0;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: 1.6;
}

.attention-box::before {
  content: "\26A0\FE0F  ";
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: var(--font-size-base);
  font-weight: 600;
  font-family: var(--font-family);
  text-decoration: none;
  cursor: pointer;
  border: none;
  min-height: 44px;
  transition: all var(--transition-base);
}

.btn-primary {
  background-color: var(--accent);
  color: white;
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  box-shadow: 0 0 20px var(--accent-glow);
  text-decoration: none;
}

.btn-outline,
.btn-ghost {
  background-color: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-default);
}

.btn-outline:hover,
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent-hover);
  text-decoration: none;
}

.btn-lg {
  padding: 14px 28px;
  font-size: var(--font-size-lg);
}

/* --- Video Embed --- */
.video-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  max-width: 800px;
  margin: var(--space-lg) 0;
  border-radius: var(--radius);
  background: var(--bg-surface);
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: var(--font-size-lg);
}

/* Video chapters */
.video-chapters {
  margin: var(--space-lg) 0;
}

.video-chapters ul {
  list-style: none;
  padding: 0;
}

.video-chapters li {
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--border-subtle);
}

.video-chapters .timestamp {
  font-weight: 600;
  color: var(--accent-hover);
  margin-right: var(--space-sm);
  font-variant-numeric: tabular-nums;
}

/* --- Figures & Screenshots --- */
figure,
.figure-screenshot {
  margin: var(--space-lg) 0;
  text-align: center;
}

figure img,
.figure-screenshot img,
.fiche-content img,
.manual-content img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  display: block;
  margin: 0 auto;
}

figcaption,
.fiche-content img + em,
.manual-content img + em {
  display: block;
  text-align: center;
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin-top: var(--space-sm);
  font-style: italic;
}

.fiche-screenshot {
  margin: var(--space-md) 0;
}

/* --- Section Headers --- */
.section-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border-subtle);
  margin: var(--space-2xl) 0 var(--space-lg);
}

.section-header h2 {
  margin: 0;
}

/* --- Section Label (muted uppercase) --- */
.section-label {
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: var(--font-size-xs);
  font-weight: 500;
  text-align: center;
  margin-bottom: var(--space-lg);
}

/* --- Search (homepage prominent) --- */
.search-prominent {
  max-width: 560px;
  margin: var(--space-xl) auto;
  position: relative;
}

.search-prominent input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  font-size: var(--font-size-base);
  font-family: var(--font-family);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  color: var(--text-primary);
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

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

.search-prominent input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-prominent .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: var(--font-size-lg);
  pointer-events: none;
}

/* --- Search Dropdown --- */
.search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  margin-top: 4px;
  z-index: 1000;
  max-height: 400px;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.search-result {
  display: block;
  padding: 10px 14px;
  color: var(--text-primary);
  text-decoration: none;
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--font-size-sm);
  transition: background 0.15s;
}

.search-result:last-child {
  border-bottom: none;
}

.search-result:hover,
.search-result:focus {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.search-result-type {
  display: inline-block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  background: var(--accent-subtle-bg);
  padding: 1px 6px;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: middle;
}

.search-no-results {
  padding: var(--space-md);
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  text-align: center;
}

/* --- AI Prompt Box --- */
.ai-prompt-box {
  background: var(--bg-surface);
  border: 1px solid var(--accent-subtle-border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: var(--space-lg) 0;
}

.ai-prompt-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) var(--space-md);
  background: var(--accent-subtle-bg);
  border-bottom: 1px solid var(--accent-subtle-border);
}

.ai-prompt-label {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ai-prompt-copy {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 4px 12px;
  font-size: var(--font-size-sm);
  font-family: var(--font-family);
  cursor: pointer;
  transition: background var(--transition-base), border-color var(--transition-base);
}

.ai-prompt-copy:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
}

.ai-prompt-text {
  margin: 0;
  padding: var(--space-md);
  font-size: var(--font-size-sm);
  line-height: 1.6;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: var(--font-family);
}

.ai-tip-note {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin-top: var(--space-sm);
}

/* --- Fiche Content Layout --- */
.fiche-header {
  margin-bottom: var(--space-xl);
}

.fiche-header .fiche-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  align-items: center;
  margin-top: var(--space-sm);
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

.fiche-content h4 {
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: var(--space-xs);
}

.fiche-sidebar {
  margin-top: var(--space-2xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-subtle);
}

.fiche-sidebar h2 {
  border-bottom: none;
  padding-bottom: 0;
}

.fiche-sidebar ul {
  list-style: none;
  padding: 0;
}

.fiche-sidebar li {
  margin-bottom: var(--space-sm);
}

/* --- Fiche Prev/Next Navigation --- */
.fiche-nav {
  display: flex;
  justify-content: space-between;
  gap: var(--space-lg);
  margin-top: var(--space-2xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border-subtle);
}

.fiche-nav-link {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding: var(--space-md);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  color: var(--text-secondary);
  text-decoration: none;
  max-width: 45%;
  transition: border-color var(--transition-base), background var(--transition-base);
}

.fiche-nav-link:hover {
  border-color: var(--accent);
  background: var(--accent-subtle-bg);
}

.fiche-nav-link.next {
  margin-left: auto;
  text-align: right;
}

.fiche-nav-dir {
  font-size: var(--font-size-sm);
  color: var(--accent);
  font-weight: 600;
}

.fiche-nav-title {
  font-size: var(--font-size-sm);
  color: var(--text-primary);
}

/* --- Manual Layout --- */
.manual-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: var(--space-2xl);
}

.manual-sidebar {
  position: sticky;
  top: calc(var(--header-height) + var(--space-lg));
  align-self: start;
  max-height: calc(100vh - var(--header-height) - var(--space-2xl));
  overflow-y: auto;
}

.manual-sidebar ul {
  list-style: none;
  padding: 0;
}

.manual-sidebar li {
  margin-bottom: 2px;
}

.manual-sidebar a {
  display: block;
  padding: var(--space-sm) var(--space-md);
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  border-left: 3px solid transparent;
  transition: all var(--transition-fast);
}

.manual-sidebar a:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
  text-decoration: none;
}

.manual-sidebar a.active {
  border-left-color: var(--accent);
  color: var(--text-primary);
  background: var(--accent-glow);
  text-decoration: none;
}

.manual-content {
  max-width: 800px;
}

/* --- Video Grid --- */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-md);
  margin: var(--space-lg) 0;
}

.video-thumb {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: var(--space-md);
  text-align: center;
  text-decoration: none;
  color: var(--text-primary);
  transition: border-color var(--transition-base);
}

.video-thumb:hover {
  border-color: var(--border-hover);
  text-decoration: none;
}

.video-thumb .play-icon {
  font-size: 2rem;
  margin-bottom: var(--space-sm);
}

.video-thumb .video-title {
  font-size: var(--font-size-sm);
  font-weight: 500;
}

.video-thumb-img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-sm);
}

/* --- Video Page Layout (sidebar + main) --- */
.video-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: var(--space-2xl);
}

.video-sidebar {
  position: sticky;
  top: calc(var(--header-height) + var(--space-lg));
  align-self: start;
  max-height: calc(100vh - var(--header-height) - var(--space-2xl));
  overflow-y: auto;
}

.video-sidebar ul {
  list-style: none;
  padding: 0;
}

.video-sidebar li {
  margin-bottom: 2px;
}

.video-sidebar a {
  display: block;
  padding: var(--space-sm) var(--space-md);
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  border-left: 3px solid transparent;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.video-sidebar a:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
  text-decoration: none;
}

.video-sidebar a.active {
  border-left-color: var(--accent);
  color: var(--text-primary);
  background: var(--accent-glow);
  text-decoration: none;
}

/* --- Glossary Tooltip --- */
.glossary-term {
  border-bottom: 1px dotted var(--accent-hover);
  cursor: help;
  position: relative;
}

.glossary-tooltip {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elevated);
  color: var(--text-primary);
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  max-width: 300px;
  white-space: normal;
  z-index: 50;
}

.glossary-term:hover .glossary-tooltip,
.glossary-term:focus .glossary-tooltip {
  display: block;
}

/* --- Glossary Page --- */
.glossary-list {
  columns: 2;
  column-gap: var(--space-2xl);
}

.glossary-entry {
  break-inside: avoid;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border-subtle);
}

.glossary-entry .term {
  font-weight: 700;
  font-size: var(--font-size-base);
}

.glossary-entry .term-alt {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  font-style: italic;
}

.glossary-entry .definition {
  margin-top: var(--space-xs);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

/* --- Hero Section (Homepage) --- */
.hero {
  text-align: center;
  padding: 120px var(--space-lg) 80px;
  margin-bottom: var(--space-lg);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero .pill {
  margin-bottom: var(--space-lg);
}

.hero h1 {
  font-size: var(--font-size-hero);
  font-weight: 700;
  margin-bottom: var(--space-md);
  background: linear-gradient(135deg, #F4F4F6 0%, #A5B4FC 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}

.hero-subtitle {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
  font-style: normal;
}

.hero-desc {
  max-width: 700px;
  margin: 0 auto var(--space-md);
  font-size: var(--font-size-base);
  color: var(--text-secondary);
  line-height: 1.7;
}

.hero-disclaimer {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  font-style: italic;
  margin-top: var(--space-sm);
}

/* --- Section Heading (Homepage) --- */
.section-heading {
  text-align: center;
  font-size: var(--font-size-xl);
  font-weight: 600;
  margin-top: var(--space-xl);
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}

/* --- Stats Bar (Homepage) --- */
.stats-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding: var(--space-xl) 0;
  margin: var(--space-2xl) 0;
}

.stats-bar .stat-item {
  text-align: center;
  padding: 0 var(--space-2xl);
}

.stats-bar .stat-item + .stat-item {
  border-left: 1px solid var(--border-subtle);
}

.stats-bar .stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
  display: block;
}

.stats-bar .stat-label {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

/* --- Home Sections --- */
.home-section {
  max-width: 800px;
  margin: var(--space-2xl) auto;
  padding: 0 var(--space-lg);
}

.home-section h2 {
  text-align: center;
  margin-bottom: var(--space-lg);
}

.home-section p {
  line-height: 1.7;
  color: var(--text-secondary);
}

/* --- Features Grid (Homepage) --- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
  margin-top: var(--space-xl);
}

.feature-item {
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
  background: var(--bg-surface);
  padding: var(--space-lg);
  border-radius: var(--radius);
  border: 1px solid var(--border-subtle);
  transition: border-color var(--transition-base);
}

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

.feature-icon {
  font-size: 1.75rem;
  flex-shrink: 0;
  line-height: 1;
}

.feature-text strong {
  display: block;
  margin-bottom: var(--space-xs);
  font-size: var(--font-size-base);
  color: var(--text-primary);
}

.feature-text span {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  line-height: 1.5;
}

/* --- Fiche Preview Grid (Homepage) --- */
.fiche-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  margin: var(--space-lg) 0;
}

.fiche-preview-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: var(--space-lg);
  text-decoration: none;
  color: var(--text-primary);
  transition: border-color var(--transition-base);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.fiche-preview-card:hover {
  border-color: var(--border-hover);
  text-decoration: none;
}

.fiche-preview-card .fiche-category {
  display: inline-block;
  margin-bottom: var(--space-xs);
}

.fiche-preview-card .fiche-title {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
}

.fiche-preview-card .fiche-excerpt {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.fiche-preview-card .fiche-link {
  color: var(--accent-hover);
  font-size: var(--font-size-sm);
  font-weight: 500;
  margin-top: auto;
}

/* --- Video Teaser Strip (Homepage) --- */
.video-teaser {
  max-width: 800px;
  margin: var(--space-2xl) auto;
  padding: var(--space-xl) var(--space-2xl);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  gap: var(--space-2xl);
}

.video-teaser-content {
  flex: 1;
}

.video-teaser-content h2 {
  margin-top: 0;
  margin-bottom: var(--space-sm);
}

.video-teaser-content p {
  color: var(--text-secondary);
}

.video-teaser-thumb {
  flex-shrink: 0;
}

.video-placeholder {
  width: 200px;
  aspect-ratio: 16/9;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 2.5rem;
}

/* --- Info Box (Homepage) --- */
.info-box {
  background: var(--accent-glow);
  border-left: 3px solid var(--accent);
  padding: var(--space-md) var(--space-lg);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-top: var(--space-lg);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: 1.6;
}

/* --- About Section (Homepage) --- */
.about-section {
  margin-top: var(--space-2xl);
}

.about-disclaimer {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  font-style: italic;
}

/* --- Contributors (Homepage) --- */
.contributors {
  margin-top: var(--space-xl);
}

.contributors h3 {
  text-align: center;
  margin-bottom: var(--space-lg);
}

.contributors-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

.contributor {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: var(--space-md) var(--space-lg);
  text-align: center;
}

.contributor-name {
  font-weight: 600;
  font-size: var(--font-size-base);
  margin-bottom: var(--space-xs);
}

.contributor-role {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

.contribute-cta {
  text-align: center;
  margin-top: var(--space-lg);
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

/* --- Fiche Disclaimer --- */
.fiche-disclaimer {
  background: var(--color-warning-bg);
  border: 1px solid var(--color-warning-border);
  border-radius: var(--radius);
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-xl);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: 1.5;
}

/* --- Page "À propos" --- */
.about-page {
  max-width: 800px;
  margin: 0 auto;
}

.about-page .hero {
  padding-bottom: var(--space-2xl);
}

.about-block {
  margin-bottom: var(--space-2xl);
  padding-bottom: var(--space-2xl);
  border-bottom: 1px solid var(--border-subtle);
}

.about-block:last-child {
  border-bottom: none;
}

.about-block h2 {
  margin-top: 0;
}

.about-block .features-grid {
  margin-top: var(--space-lg);
}

/* --- Animations --- */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-up {
  animation: fadeUp 0.5s ease forwards;
  opacity: 0;
}

.animate-delay-1 { animation-delay: 100ms; }
.animate-delay-2 { animation-delay: 200ms; }
.animate-delay-3 { animation-delay: 300ms; }
.animate-delay-4 { animation-delay: 400ms; }
.animate-delay-5 { animation-delay: 500ms; }
.animate-delay-6 { animation-delay: 600ms; }

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

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-md);
  background: var(--accent);
  color: white;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  z-index: 200;
  font-weight: 600;
}

.skip-link:focus {
  top: var(--space-md);
}

*:focus-visible {
  outline: 2px solid var(--accent-hover);
  outline-offset: 2px;
}

/* --- Responsive --- */

/* Tablet: < 1024px */
@media (max-width: 1024px) {
  .role-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .manual-layout,
  .video-layout {
    grid-template-columns: 1fr;
  }

  .manual-sidebar,
  .video-sidebar {
    position: static;
    max-height: none;
  }

  .glossary-list {
    columns: 1;
  }

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

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

  .video-teaser {
    flex-direction: column;
    text-align: center;
  }

  .video-teaser-thumb {
    order: -1;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .stats-bar .stat-item {
    padding: 0 var(--space-lg);
  }
}

/* Mobile: < 640px */
@media (max-width: 640px) {
  :root {
    --font-size-2xl: 1.75rem;
    --font-size-hero: 2rem;
  }

  .role-cards {
    grid-template-columns: 1fr;
  }

  .hub-hero {
    flex-direction: column;
    text-align: center;
  }

  .hub-hero-img {
    width: 160px;
  }

  .header-nav {
    display: none;
  }

  .header-nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    padding: var(--space-md) var(--space-lg);
  }

  .menu-toggle {
    display: block;
  }

  .header-search input {
    width: 140px;
  }

  .header-search input:focus {
    width: 180px;
  }

  .fiche-nav {
    flex-direction: column;
    gap: var(--space-md);
  }

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

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

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

  .fiche-preview-grid {
    grid-template-columns: 1fr;
  }

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

  .hero {
    padding: 80px var(--space-md) 60px;
  }

  .home-section {
    padding: 0 var(--space-md);
  }

  .stats-bar {
    flex-direction: column;
    gap: var(--space-lg);
  }

  .stats-bar .stat-item + .stat-item {
    border-left: none;
    border-top: 1px solid var(--border-subtle);
    padding-top: var(--space-lg);
  }

  .video-teaser-thumb {
    width: 100%;
  }

  .video-placeholder {
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
  }
}
