/* Naoshift Academy : un seul jeu de tokens, reprises exactes des maquettes.
   Palette : celle de docs et du site (tailwind.config.js de naoshift-website).
   Composition : design system Naoshift (surtitres, pastilles, anneau de focus,
   cartes bordées sans ombre, une seule carte inversée par composition).
   Échelle d'espacement sur 4 px. Toute valeur visuelle passe par ces variables. */

@font-face {
  font-family: 'Inter';
  src: url('fonts/inter-latin-var.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: block;
}
@font-face {
  font-family: 'Outfit';
  src: url('fonts/outfit-latin-var.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: block;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('fonts/jetbrains-mono-latin-var.woff2') format('woff2');
  font-weight: 400 800;
  font-style: normal;
  font-display: block;
}

.ac {
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Outfit', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;
  --sp-20: 80px;
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-pill: 999px;
  --topbar-h: 64px;
  --cyan: #00d9ff;
  --cyan-hover: #00adcc;
  --on-cyan: #0a1220;
  --film-bg: #0a1220;
  --film-surface: #101b30;
  --film-border: #27405f;
  --film-text: #e2e8f0;
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
.ac *, .ac *::before, .ac *::after { box-sizing: border-box; }

html[data-theme='dark'] { color-scheme: dark; }
html[data-theme='light'] { color-scheme: light; }

html[data-theme='dark'] .ac {
  --bg: #0a1220;
  --bg-topbar: rgba(10, 18, 32, 0.95);
  --surface: #101b30;
  --surface-2: #1c2c45;
  --border: #1c2c45;
  --border-strong: #27405f;
  --heading: #ffffff;
  --text: #f3f4f6;
  --text-2: #d1d5db;
  --text-3: #9ca3af;
  --link: #00d9ff;
  --link-hover: #1affff;
  --eyebrow: #00d9ff;
  --accent: #00d9ff;
  --on-accent: #0a1220;
  --accent-soft: rgba(0, 217, 255, 0.1);
  --accent-border: rgba(0, 217, 255, 0.3);
  --attention: #f5a524;
  --on-attention: #0a1220;
  --attention-soft: rgba(245, 165, 36, 0.1);
  --grid-line: rgba(148, 163, 184, 0.045);
  --code-bg: #1c2c45;
  --code-text: #4dffff;
  --emphasis: #e6f6fc;
  --emphasis-heading: #0b1526;
  --emphasis-text: #3b4757;
  --emphasis-eyebrow: #0e6d8d;
  --emphasis-track: rgba(11, 21, 38, 0.16);
  --emphasis-fill: #0e6d8d;
  --emphasis-btn: #0b1526;
  --emphasis-btn-text: #ffffff;
  --emphasis-tag-bg: #0b1526;
  --emphasis-tag-text: #e6f6fc;
}
html[data-theme='light'] .ac {
  --bg: #f7fafc;
  --bg-topbar: rgba(255, 255, 255, 0.92);
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --heading: #0f172a;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #5b6b82;
  --link: #0e6d8d;
  --link-hover: #005566;
  --eyebrow: #0e6d8d;
  --accent: #00adcc;
  --on-accent: #0a1220;
  --accent-soft: rgba(0, 217, 255, 0.12);
  --accent-border: rgba(0, 129, 153, 0.35);
  --attention: #b45309;
  --on-attention: #ffffff;
  --attention-soft: rgba(180, 83, 9, 0.08);
  --grid-line: rgba(15, 23, 42, 0.045);
  --code-bg: #e8eef5;
  --code-text: #005566;
  --emphasis: #0a1220;
  --emphasis-heading: #ffffff;
  --emphasis-text: #c7d3e2;
  --emphasis-eyebrow: #00d9ff;
  --emphasis-track: rgba(255, 255, 255, 0.18);
  --emphasis-fill: #00d9ff;
  --emphasis-btn: #00d9ff;
  --emphasis-btn-text: #0a1220;
  --emphasis-tag-bg: #00d9ff;
  --emphasis-tag-text: #0a1220;
}

.ac a { color: var(--link); text-decoration: none; }
.ac a:hover { color: var(--link-hover); }
.ac a:focus-visible, .ac button:focus-visible, .ac summary:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}
.ac svg.ic {
  display: block;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
html[data-theme='dark'] .ic-sun { display: none !important; }
html[data-theme='light'] .ic-moon { display: none !important; }
.ac p, .ac h1, .ac h2, .ac h3, .ac ul, .ac ol, .ac figure { margin: 0; padding: 0; }
.ac ul, .ac ol { list-style: none; }

.ac-page { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.ac-main { flex: 1 0 auto; }
.ac-wrap { width: 100%; max-width: 1240px; margin-inline: auto; padding-inline: var(--sp-8); }
.ac-photo { display: block; width: 100%; height: 100%; object-fit: cover; }

/* Typographie */
.ac-eyebrow {
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--eyebrow);
}
.ac-display, .ac-h1, .ac-h2, .ac-h3, .ac-h4 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--heading);
}
.ac-display { font-size: 56px; line-height: 60px; letter-spacing: -0.02em; }
.ac-h1 { font-size: 40px; line-height: 48px; letter-spacing: -0.02em; }
.ac-h2 { font-size: 28px; line-height: 36px; letter-spacing: -0.01em; }
.ac-h3 { font-size: 20px; line-height: 28px; }
.ac-h4 { font-size: 16px; line-height: 24px; }
.ac a.ac-h4 { color: var(--heading); }
.ac a.ac-h4:hover { color: var(--link); }
.ac-lead { font-size: 18px; line-height: 28px; color: var(--text-2); }
.ac-body { font-size: 16px; line-height: 26px; color: var(--text-2); }
.ac-small { font-size: 14px; line-height: 22px; color: var(--text-2); }
.ac-meta { font-size: 13px; line-height: 20px; color: var(--text-3); }

/* Boutons */
.ac .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 44px;
  padding: 0 var(--sp-5);
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 20px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.ac .btn-primary { background: var(--cyan); color: var(--on-cyan); }
.ac .btn-primary:hover { background: var(--cyan-hover); color: var(--on-cyan); }
.ac .btn-ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.ac .btn-ghost:hover { border-color: var(--accent-border); color: var(--link); }
.ac .btn-sm { min-height: 36px; padding: 0 var(--sp-4); font-size: 14px; }
.ac .btn-block { width: 100%; }
.ac .btn-emphasis { background: var(--emphasis-btn); color: var(--emphasis-btn-text); }
.ac .btn svg.ic { width: 14px; height: 14px; }

/* Barre haute */
.ac-topbar { position: relative; z-index: 10; background: var(--bg-topbar); border-bottom: 1px solid var(--border); }
.ac-topbar-inner { height: var(--topbar-h); display: flex; align-items: center; gap: var(--sp-8); padding-inline: var(--sp-6); }
.ac-brand { display: flex; align-items: center; gap: var(--sp-3); flex-shrink: 0; }
.ac-brand img { display: block; width: 40px; height: 40px; border-radius: var(--r-sm); }
.ac-brand-name { font-family: var(--font-display); font-weight: 700; font-size: 24px; line-height: 32px; color: var(--heading); }
.ac-badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 var(--sp-2);
  border: 1px solid var(--accent-border);
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  color: var(--eyebrow);
  font-size: 10px;
  line-height: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ac-nav { display: flex; align-items: center; gap: var(--sp-1); }
.ac .ac-nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 var(--sp-3);
  border-radius: var(--r-sm);
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  color: var(--text-2);
}
.ac .ac-nav a:hover { color: var(--text); background: var(--accent-soft); }
.ac .ac-nav a.is-active { color: var(--heading); font-weight: 600; }
.ac-nav svg.ic { width: 12px !important; height: 12px !important; }
.ac-actions { margin-left: auto; display: flex; align-items: center; gap: var(--sp-2); }
.ac .ac-iconbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-2);
  cursor: pointer;
}
.ac .ac-iconbtn:hover { color: var(--link); border-color: var(--accent-border); }
.ac .ac-lang { font-family: var(--font-mono); font-size: 12px; line-height: 16px; font-weight: 600; }
.ac-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 var(--sp-3);
  border: 1px solid var(--accent-border);
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  color: var(--text-2);
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
}
.ac-chip svg.ic { color: var(--link); }
.ac-mobile { display: none !important; }

/* Bande d'en-tête quadrillée, reprise de l'accueil de docs */
.ac-band {
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 44px 44px;
  border-bottom: 1px solid var(--border);
}

/* Accueil : héros */
.ac-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: var(--sp-16);
  align-items: center;
  padding-block: var(--sp-16) var(--sp-10);
}
.ac-hero-text { display: flex; flex-direction: column; gap: var(--sp-6); align-items: flex-start; }
.ac-hero-cta { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-2); }
.ac-hero-photo {
  position: relative;
  aspect-ratio: 5 / 4;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--surface-2);
}
.ac-hero-photo figcaption {
  position: absolute;
  inset: auto 0 0 0;
  padding: var(--sp-10) var(--sp-5) var(--sp-4);
  background: linear-gradient(180deg, rgba(10, 18, 32, 0) 0%, rgba(10, 18, 32, 0.82) 70%);
  color: #ffffff;
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
}

/* Le chemin : pastilles reliées, motif commun à l'accueil, au parcours et à la leçon */
.ac-road {
  padding: var(--sp-6);
  margin-bottom: var(--sp-16);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}
.ac-road-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-6); margin-top: var(--sp-5) !important; }
.ac-road-list > li { position: relative; display: flex; flex-direction: column; gap: var(--sp-3); }
.ac-road-list > li:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 36px;
  right: -16px;
  top: 13.5px;
  height: 1px;
  background: var(--border-strong);
}
.ac-road-title { font-size: 15px; line-height: 22px; font-weight: 600; color: var(--heading); }
.ac-road-sub { font-size: 14px; line-height: 20px; color: var(--text-3); margin-top: 2px; }

.ac-node {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-3);
  font-size: 13px;
  line-height: 16px;
  font-weight: 600;
}
.ac .ac-node svg.ic { width: 14px; height: 14px; stroke-width: 2.4; }
.ac-node.is-next, .ac-node.is-done { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.ac-node.is-current { background: var(--surface); border: 2px solid var(--accent); color: var(--heading); }
.ac-node.is-blocked { background: var(--attention); border-color: var(--attention); color: var(--on-attention); }
.ac .ac-node.is-blocked svg.ic { width: 16px; height: 16px; stroke-width: 3; }

.ac-path { display: flex; flex-direction: column; }
.ac-path > li { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: var(--sp-3); padding-bottom: var(--sp-4); }
.ac-path > li:last-child { padding-bottom: 0; }
.ac-path > li:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 13.5px;
  top: 28px;
  bottom: 0;
  width: 1px;
  background: var(--border-strong);
}
.ac-path > li.is-done:not(:last-child)::before { background: var(--accent); }

/* Filtre de profil */
.ac-pills { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.ac .ac-pill {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  color: var(--text-2);
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  white-space: nowrap;
}
.ac .ac-pill:hover { border-color: var(--accent-border); color: var(--text); }
.ac .ac-pill.is-active { background: var(--accent-soft); border-color: var(--accent-border); color: var(--eyebrow); font-weight: 600; }

/* Sections */
.ac-section { padding-block: var(--sp-16); }
.ac-section + .ac-section { padding-top: 0; }
.ac-section-head { display: flex; flex-direction: column; gap: var(--sp-5); margin-bottom: var(--sp-6); }

/* Grille des parcours */
.ac-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-5); }
.ac .ac-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text);
}
.ac a.ac-card:hover { border-color: var(--accent-border); color: var(--text); }
.ac-card-photo { aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-2); }
.ac-card-photo img { transition: transform 0.25s ease; }
.ac a.ac-card:hover .ac-card-photo img { transform: scale(1.03); }
.ac-card.is-soon .ac-card-photo img { opacity: 0.55; filter: grayscale(0.5); }
.ac-card-body { display: flex; flex-direction: column; gap: var(--sp-3); padding: var(--sp-6); flex: 1; }
.ac-card-top { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); min-height: 20px; }
.ac-card-desc { flex: 1; font-size: 15px; line-height: 24px; color: var(--text-2); }
.ac-card-who { font-size: 13px; line-height: 20px; color: var(--text-3); }
.ac-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border);
  font-size: 13px;
  line-height: 20px;
  color: var(--text-3);
}
.ac-card-foot svg.ic { color: var(--link); }
.ac-tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 var(--sp-2);
  border-radius: var(--r-pill);
  font-size: 11px;
  line-height: 16px;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--eyebrow);
  white-space: nowrap;
}
.ac-tag-soon { background: var(--surface-2); color: var(--text-2); }
.ac .ac-card--emphasis { background: var(--emphasis); border-color: var(--emphasis); }
.ac a.ac-card--emphasis:hover { border-color: var(--emphasis); }
.ac-card--emphasis .ac-eyebrow { color: var(--emphasis-eyebrow); }
.ac-card--emphasis .ac-h3, .ac-card--emphasis .ac-h2 { color: var(--emphasis-heading); }
.ac-card--emphasis .ac-card-desc, .ac-card--emphasis .ac-card-who { color: var(--emphasis-text); }
.ac-card--emphasis .ac-card-foot { color: var(--emphasis-text); border-top-color: var(--emphasis-track); }
.ac-card--emphasis .ac-card-foot svg.ic { color: var(--emphasis-heading); }
.ac-card--emphasis .ac-tag { background: var(--emphasis-tag-bg); color: var(--emphasis-tag-text); }

/* Avancement */
.ac-progress { display: flex; align-items: center; gap: var(--sp-3); }
.ac-progress-bar { flex: 1; min-width: 0; height: 4px; border-radius: var(--r-pill); overflow: hidden; }
.ac-progress-track { fill: var(--border); }
.ac-progress-fill { fill: var(--accent); }
.ac-progress-label { font-size: 13px; line-height: 20px; color: var(--text-3); white-space: nowrap; }
.ac-card--emphasis .ac-progress-track { fill: var(--emphasis-track); }
.ac-card--emphasis .ac-progress-fill { fill: var(--emphasis-fill); }
.ac-card--emphasis .ac-progress-label { color: var(--emphasis-text); }

/* À venir et aides */
.ac-soon {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2) var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-md);
  margin-top: var(--sp-5);
}
.ac-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--sp-6); }
.ac-panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-5); }
.ac-duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-5); }
.ac-duo-item {
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}
.ac-duo-photo { min-height: 100%; background: var(--surface-2); overflow: hidden; }
.ac-duo-text { display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-2); padding: var(--sp-6); }
.ac-textlink { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; line-height: 24px; font-weight: 600; margin-top: var(--sp-1); }
.ac .ac-textlink svg.ic { width: 14px; height: 14px; }

/* Accueil connecté */
.ac-greeting { display: flex; flex-direction: column; gap: var(--sp-2); padding-block: var(--sp-12) var(--sp-8); }
.ac-resume { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--sp-5); align-items: stretch; padding-bottom: var(--sp-12); }
.ac-resume-card .ac-card-body { padding: var(--sp-8); gap: var(--sp-4); }
.ac-resume-cta { margin-top: var(--sp-1); align-self: flex-start; }
.ac-signals { display: flex; flex-direction: column; }
.ac-signal {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: var(--sp-3);
  align-items: center;
  padding-block: var(--sp-3);
  border-top: 1px solid var(--border);
}
.ac-signal:first-child { border-top: 0; padding-top: 0; }
.ac-signal:last-child { padding-bottom: 0; }
.ac-signal-title { font-size: 15px; line-height: 22px; font-weight: 600; color: var(--heading); }
.ac-signal-text { font-size: 13px; line-height: 20px; color: var(--text-3); }
.ac-signal a { font-size: 13px; line-height: 20px; font-weight: 600; white-space: nowrap; }

/* Page d'un parcours */
.ac-pathhero { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: var(--sp-12); align-items: center; padding-block: var(--sp-12); }
.ac-pathhead { display: flex; flex-direction: column; gap: var(--sp-4); }
.ac-pathphoto { aspect-ratio: 16 / 9; border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--surface-2); }
.ac-crumb { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1); font-size: 13px; line-height: 20px; color: var(--text-3); }
.ac .ac-crumb a { color: var(--text-3); font-weight: 500; }
.ac .ac-crumb a:hover { color: var(--link); }
.ac .ac-crumb svg.ic { width: 12px; height: 12px; opacity: 0.6; }
.ac-crumb-here { color: var(--text-2); font-weight: 600; }
.ac-facts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-5); font-size: 14px; line-height: 20px; color: var(--text-2); }
.ac-fact { display: inline-flex; align-items: center; gap: 6px; }
.ac-fact svg.ic { color: var(--text-3); }
.ac-fact-date { color: var(--text-3); }
.ac-pathhead .ac-progress { max-width: 420px; }
.ac-pathgrid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--sp-12); align-items: start; padding-block: var(--sp-10) var(--sp-16); }
.ac-pathaside { display: flex; flex-direction: column; gap: var(--sp-5); }
.ac-pathprose { max-width: 820px; padding-bottom: var(--sp-16); }
.ac-bullets { display: flex; flex-direction: column; gap: var(--sp-3); }
.ac-bullets li { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: var(--sp-2); font-size: 14px; line-height: 22px; color: var(--text-2); }
.ac .ac-bullets svg.ic { margin-top: 3px; color: var(--link); stroke-width: 2.2; }
.ac-bullets .is-dot { width: 6px; height: 6px; margin: 8px 5px; border-radius: var(--r-pill); background: var(--accent); }

.ac-lessons { display: flex; flex-direction: column; }
.ac-lessons > li { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: var(--sp-4); padding-bottom: var(--sp-3); }
.ac-lessons > li:last-child { padding-bottom: 0; }
.ac-lessons > li > .ac-node { margin-top: var(--sp-5); }
.ac-lessons > li:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 13.5px;
  top: 48px;
  bottom: -20px;
  width: 1px;
  background: var(--border-strong);
}
.ac-lessons > li.is-done:not(:last-child)::before { background: var(--accent); }
.ac .ac-lesson {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text);
}
.ac .ac-lesson:hover { border-color: var(--accent-border); color: var(--text); }
.ac .ac-lesson.is-current { border-color: var(--accent); }
.ac-lesson-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3); }
.ac .ac-lesson-title { font-family: var(--font-display); font-weight: 600; font-size: 18px; line-height: 26px; color: var(--heading); }
.ac-lesson-text { font-size: 15px; line-height: 24px; color: var(--text-2); }
.ac-lesson-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-4); font-size: 13px; line-height: 20px; color: var(--text-3); }
.ac-lesson-meta span { display: inline-flex; align-items: center; gap: 6px; }
.ac .ac-lesson-meta svg.ic { width: 14px; height: 14px; }

/* Page d'une leçon */
.ac-lessonpage {
  width: 100%;
  max-width: 1440px;
  margin-inline: auto;
  padding-inline: var(--sp-8);
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: var(--sp-10);
  align-items: stretch;
}
.ac-outline { padding-block: var(--sp-10); padding-right: var(--sp-6); border-right: 1px solid var(--border); }
.ac-outline-box { display: none; }
.ac-outline-photo { aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--r-md); background: var(--surface-2); margin-bottom: var(--sp-5); }
.ac-outline-head { display: flex; flex-direction: column; gap: var(--sp-1); margin-bottom: var(--sp-6); }
.ac .ac-outline-link { display: block; font-size: 14px; line-height: 20px; color: var(--text-2); padding-top: 4px; }
.ac .ac-outline-link:hover { color: var(--link); }
.ac .ac-outline-link.is-here { color: var(--heading); font-weight: 600; }
.ac-outline-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  min-height: 44px;
  cursor: pointer;
  list-style: none;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  color: var(--text);
}
.ac-outline-bar::-webkit-details-marker { display: none; }
.ac .ac-outline-bar svg.ic { transform: rotate(90deg); color: var(--text-3); }
.ac-outline-box[open] .ac-outline-bar svg.ic { transform: rotate(-90deg); }
.ac-outline-box .ac-path { padding-block: var(--sp-3); }

.ac-lessonmain {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  column-gap: var(--sp-10);
  row-gap: var(--sp-8);
  align-items: start;
  align-content: start;
  padding-block: var(--sp-10) var(--sp-16);
}
.ac-lessonmain > * { grid-column: 1; min-width: 0; }
.ac-lessonmain > .ac-verify { grid-column: 2; grid-row: 1 / span 9; position: sticky; top: var(--sp-6); }
.ac-lessonhead { display: flex; flex-direction: column; gap: var(--sp-3); }
.ac-print { align-self: flex-start; }

/* Affiche de la vidéo : façade, aucune requête vers YouTube avant le clic */
.ac-media { display: flex; flex-direction: column; gap: var(--sp-2); }
.ac-videos { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-4); }
.ac-videos.has-many { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ac-video { display: flex; flex-direction: column; gap: var(--sp-2); }
.ac-video figcaption { font-size: 14px; line-height: 20px; font-weight: 600; color: var(--text); }
.ac-videos.has-many .ac-play { width: 56px; height: 56px; }
.ac-videos.has-many .ac-play svg { width: 22px; height: 22px; }
.ac .ac-poster {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--film-border);
  border-radius: var(--r-md);
  background: var(--film-bg);
}
.ac-poster img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ac-play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: var(--r-pill);
  background: #00d9ff;
  color: #0a1220;
}
.ac-play svg { display: block; width: 28px; height: 28px; margin-left: 4px; fill: currentColor; }
.ac-duration {
  position: absolute;
  right: var(--sp-3);
  bottom: var(--sp-3);
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 var(--sp-2);
  border-radius: var(--r-xs);
  background: rgba(10, 18, 32, 0.85);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  color: #ffffff;
}
.ac-player { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: var(--r-md); background: var(--film-bg); }

.ac-objective {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  padding: var(--sp-4) var(--sp-5);
  border: 1px solid var(--accent-border);
  border-radius: var(--r-md);
  background: var(--accent-soft);
}
.ac-objective p { font-size: 16px; line-height: 26px; color: var(--text); }

/* Corps d'une leçon, écrit en Markdown */
.ac-prose { font-size: 16px; line-height: 26px; color: var(--text-2); }
.ac .ac-prose > * + * { margin-top: var(--sp-4); }
.ac .ac-prose h2 { font-family: var(--font-display); font-weight: 600; font-size: 28px; line-height: 36px; letter-spacing: -0.01em; color: var(--heading); }
.ac .ac-prose > h2:not(:first-child) { margin-top: var(--sp-8); }
.ac .ac-prose h3 { font-family: var(--font-display); font-weight: 600; font-size: 20px; line-height: 28px; color: var(--heading); margin-top: var(--sp-6); }
.ac-prose .anchor { display: none; }
.ac-prose strong { color: var(--text); font-weight: 600; }
.ac-prose a { text-decoration: underline; text-underline-offset: 2px; }
.ac-prose blockquote {
  margin-inline: 0;
  padding: var(--sp-3) var(--sp-4);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: var(--r-md);
  font-size: 15px;
  line-height: 24px;
}
.ac-prose blockquote p { color: var(--text-2); }
.ac-prose > ul { display: flex; flex-direction: column; gap: var(--sp-2); }
.ac-prose > ul > li { position: relative; padding-left: var(--sp-5); }
.ac-prose > ul > li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--accent);
}
.ac-prose > ol { counter-reset: step; display: flex; flex-direction: column; gap: var(--sp-5); }
.ac-prose > ol > li { counter-increment: step; position: relative; padding-left: var(--sp-10); min-height: 28px; }
.ac-prose > ol > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: var(--on-accent);
  font-size: 13px;
  line-height: 16px;
  font-weight: 600;
}
.ac .ac-prose > ol > li > * + * { margin-top: var(--sp-3); }
.ac code {
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--code-text);
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 5px;
}
.ac-code { position: relative; }
.ac-code pre {
  margin: 0;
  padding: var(--sp-3) 88px var(--sp-3) var(--sp-4);
  background: #0a1220;
  border: 1px solid #27405f;
  border-radius: var(--r-sm);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.ac .ac-code code { padding: 0; background: none; color: #e2e8f0; font-size: 13px; line-height: 21px; }
.ac .ac-copy {
  position: absolute;
  top: var(--sp-2);
  right: var(--sp-2);
  height: 28px;
  padding: 0 var(--sp-2);
  background: #101b30;
  border: 1px solid #27405f;
  border-radius: var(--r-xs);
  color: #d1d5db;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 16px;
  cursor: pointer;
}
.ac .ac-copy:hover { color: #00d9ff; }
.table-wrap, .ac-tablewrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); }
.ac-tablewrap { margin-top: var(--sp-4); }
.ac table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 22px; }
.ac th { padding: var(--sp-2) var(--sp-4); text-align: left; font-weight: 600; color: var(--text); background: var(--surface-2); border-bottom: 1px solid var(--border-strong); white-space: nowrap; }
.ac td { padding: var(--sp-3) var(--sp-4); color: var(--text-2); border-bottom: 1px solid var(--border); vertical-align: top; }
.ac tr:last-child td { border-bottom: 0; }
.ac-table td:first-child { color: var(--heading); font-weight: 600; white-space: nowrap; }
.ac-table tr.is-here td { background: var(--attention-soft); }

.ac-help { display: flex; flex-direction: column; gap: var(--sp-2); margin-top: var(--sp-4); }
.ac-lessonmain > .ac-help { margin-top: 0; }
.ac-help details { border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
.ac-help summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  min-height: 48px;
  padding: var(--sp-3) var(--sp-4);
  cursor: pointer;
  list-style: none;
  font-size: 15px;
  line-height: 22px;
  font-weight: 600;
  color: var(--heading);
}
.ac-help summary::-webkit-details-marker { display: none; }
.ac .ac-help summary svg.ic { color: var(--text-3); transform: rotate(90deg); }
.ac .ac-help details[open] summary svg.ic { transform: rotate(-90deg); }
.ac-help-body { display: flex; flex-direction: column; gap: var(--sp-2); padding: 0 var(--sp-4) var(--sp-4); font-size: 15px; line-height: 24px; color: var(--text-2); }
.ac-help-body strong { color: var(--text); font-weight: 600; }

.ac-more { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); margin-top: var(--sp-4); }
.ac .ac-more-link {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text);
}
.ac .ac-more-link:hover { border-color: var(--accent-border); color: var(--text); }
.ac-more-title { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); font-size: 15px; line-height: 22px; font-weight: 600; color: var(--heading); }
.ac .ac-more-title svg.ic { width: 14px; height: 14px; color: var(--link); }
.ac-more-sub { font-size: 13px; line-height: 20px; color: var(--text-3); }

.ac-cta {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--accent-border);
  border-radius: var(--r-md);
}
.ac-cta .btn { margin-top: var(--sp-2); }

.ac-pager { display: flex; justify-content: space-between; gap: var(--sp-3); padding-top: var(--sp-6); border-top: 1px solid var(--border); }
.ac .ac-pager a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 48%;
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--heading);
  font-size: 15px;
  line-height: 22px;
  font-weight: 600;
}
.ac .ac-pager a:hover { border-color: var(--accent-border); }
.ac-pager-label { font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.ac .ac-pager a.is-next { margin-left: auto; text-align: right; }

/* Bloc Vérifier */
.ac-verify {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.ac-verify.is-done { border-color: var(--accent); }
.ac-verify.is-blocked { border-color: var(--attention); }
.ac-verify-state { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: var(--sp-3); align-items: start; }
.ac-verify-title { font-family: var(--font-display); font-weight: 600; font-size: 18px; line-height: 26px; color: var(--heading); padding-top: 1px; }
.ac-verify-sub { font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--attention); }
.ac-verify p { font-size: 15px; line-height: 24px; color: var(--text-2); }
.ac-verify .ac-meta { display: inline-flex; align-items: center; gap: 6px; }
.ac .ac-verify .ac-meta svg.ic { width: 14px; height: 14px; }
.ac-verify form { margin: 0; }

/* 404, crédits */
.ac-notfound-band { min-height: 100%; }
.ac-notfound { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: var(--sp-16); align-items: center; padding-block: var(--sp-20); }
.ac-notfound-text { display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-4); }
.ac-notfound-code { font-family: var(--font-mono); font-size: 14px; line-height: 20px; font-weight: 600; color: var(--eyebrow); }
.ac-notfound-photo { aspect-ratio: 4 / 3; border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--surface-2); }
.ac-credits { padding-block: var(--sp-12) var(--sp-16); max-width: 720px; }

/* Pied de page, repris de docs */
.ac-footer { margin-top: auto; border-top: 1px solid var(--border); background: var(--surface); }
.ac-footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2) var(--sp-4);
  padding: var(--sp-5) var(--sp-6);
  font-size: 13px;
  line-height: 20px;
  color: var(--text-3);
}
.ac-footer-links { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-4); }
.ac .ac-footer a { color: var(--text-3); }
.ac .ac-footer a:hover { color: var(--link); }
.ac-flag {
  display: inline-block;
  width: 15px;
  height: 10px;
  border-radius: 2px;
  background: linear-gradient(90deg, #0055a4 33%, #ffffff 33% 66%, #ef4135 66%);
}

/* ---------- Tablette ---------- */
@media (max-width: 1180px) {
  .ac-hero, .ac-pathhero, .ac-notfound { grid-template-columns: minmax(0, 1fr); gap: var(--sp-8); }
  .ac-hero-photo, .ac-pathphoto { aspect-ratio: 16 / 9; }
  .ac-notfound-photo { display: none; }
  .ac-road-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ac-road-list > li:not(:last-child)::after { display: none; }
  .ac-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ac-duo { grid-template-columns: minmax(0, 1fr); }
  .ac-pathgrid { grid-template-columns: minmax(0, 1fr); gap: var(--sp-8); }
  .ac-pathaside { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-5); }
  .ac-pathaside .ac-cta { grid-column: 1 / -1; }
  .ac-lessonpage { grid-template-columns: 240px minmax(0, 1fr); gap: var(--sp-8); }
  .ac-lessonmain { grid-template-columns: minmax(0, 1fr); }
  .ac-lessonmain > .ac-verify { grid-column: 1; grid-row: auto; position: static; order: 1; }
  .ac-lessonmain > .ac-after-verify { order: 2; }
}

/* ---------- Menu replié, plan du parcours replié ---------- */
@media (max-width: 900px) {
  .ac-desktop { display: none !important; }
  .ac-mobile { display: inline-flex !important; }
  .ac-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 20;
    flex-direction: column;
    align-items: stretch;
    padding: var(--sp-2) var(--sp-3) var(--sp-3);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
  }
  .ac-nav.is-open { display: flex; }
  .ac .ac-nav a { min-height: 44px; }
  .ac-lessonpage { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .ac-outline { padding: var(--sp-3) 0; border-right: 0; border-bottom: 1px solid var(--border); }
  .ac-outline-desktop { display: none; }
  .ac-outline-box { display: block; }
}

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
  .ac-wrap, .ac-lessonpage { padding-inline: var(--sp-4); }
  .ac-display { font-size: 36px; line-height: 42px; }
  .ac-h1 { font-size: 30px; line-height: 38px; }
  .ac-h2, .ac .ac-prose h2 { font-size: 24px; line-height: 32px; }
  .ac-lead { font-size: 17px; line-height: 26px; }
  .ac .btn:not(.btn-sm) { width: 100%; white-space: normal; padding-block: var(--sp-2); }
  .ac-topbar-inner { padding-inline: var(--sp-3); gap: var(--sp-2); }
  .ac-brand img { width: 36px; height: 36px; }
  .ac .ac-iconbtn { width: 44px; height: 44px; }
  .ac-chip { width: 44px; height: 44px; padding: 0; justify-content: center; }
  .ac-hero { padding-block: var(--sp-10) var(--sp-8); }
  .ac-hero-cta { width: 100%; }
  .ac-road { margin-bottom: var(--sp-10); }
  .ac-road-list { grid-template-columns: minmax(0, 1fr); gap: var(--sp-4); }
  .ac-road-list > li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: var(--sp-3); }
  .ac-videos.has-many { grid-template-columns: minmax(0, 1fr); }
  .ac .ac-pill { height: 44px; }
  .ac-pills { flex-wrap: nowrap; overflow-x: auto; margin-inline: calc(var(--sp-4) * -1); padding-inline: var(--sp-4); }
  .ac-section { padding-block: var(--sp-10); }
  .ac-cards { grid-template-columns: minmax(0, 1fr); gap: var(--sp-3); }
  .ac-duo { gap: var(--sp-3); }
  .ac-duo-item { grid-template-columns: minmax(0, 1fr); }
  .ac-duo-photo { aspect-ratio: 16 / 9; min-height: 0; }
  .ac-greeting { padding-block: var(--sp-8) var(--sp-5); }
  .ac-resume { grid-template-columns: minmax(0, 1fr); gap: var(--sp-3); padding-bottom: var(--sp-8); }
  .ac-resume-card .ac-card-body { padding: var(--sp-6); }
  .ac-pathhero { padding-block: var(--sp-8); }
  .ac-pathgrid { gap: var(--sp-6); padding-block: var(--sp-6) var(--sp-10); }
  .ac-pathaside { grid-template-columns: minmax(0, 1fr); }
  .ac-lessons > li { gap: var(--sp-3); }
  .ac-lessonmain { row-gap: var(--sp-6); padding-block: var(--sp-6) var(--sp-10); }
  .ac-play { width: 56px; height: 56px; }
  .ac-play svg { width: 22px; height: 22px; }
  .ac-code pre { padding: var(--sp-3) var(--sp-4) 48px; }
  .ac .ac-copy { top: auto; bottom: var(--sp-2); height: 32px; }
  .ac-more { grid-template-columns: minmax(0, 1fr); }
  .ac-table, .ac-table tbody, .ac-table tr, .ac-table td { display: block; }
  .ac-table thead { display: none; }
  .ac-table tr { padding: var(--sp-4); border-bottom: 1px solid var(--border); }
  .ac-table tr:last-child { border-bottom: 0; }
  .ac .ac-table td { padding: 0; border-bottom: 0; }
  .ac-table td + td { margin-top: var(--sp-1); }
  .ac-table td:first-child { font-size: 15px; line-height: 22px; white-space: normal; }
  .ac-table tr.is-here { background: var(--attention-soft); }
  .ac-table tr.is-here td { background: transparent; }
  .ac-notfound { padding-block: var(--sp-12) var(--sp-10); }
  .ac-footer-inner { padding: var(--sp-5) var(--sp-4); }
}

@media (prefers-reduced-motion: reduce) {
  .ac-card-photo img { transition: none; }
  .ac a.ac-card:hover .ac-card-photo img { transform: none; }
}

/* ---------- Impression : la page à transmettre, noir sur blanc ---------- */
@media print {
  html .ac {
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-2: #f1f5f9;
    --border: #cbd5e1;
    --border-strong: #94a3b8;
    --heading: #000000;
    --text: #000000;
    --text-2: #1f2937;
    --text-3: #4b5563;
    --link: #000000;
    --eyebrow: #005566;
    --accent: #005566;
    --on-accent: #ffffff;
    --accent-soft: #ffffff;
    --accent-border: #94a3b8;
    --code-bg: #f1f5f9;
    --code-text: #000000;
  }
  .ac-topbar, .ac-outline, .ac-verify, .ac-footer, .ac-media, .ac-pager, .ac-cta, .ac-copy, .ac-print, .ac-more { display: none !important; }
  .ac-lessonpage, .ac-lessonmain { display: block; padding: 0; }
  .ac-lessonmain > * { margin-bottom: var(--sp-5); }
  .ac-code pre { background: #f1f5f9; border-color: #94a3b8; padding: var(--sp-3); }
  .ac .ac-code code { color: #000000; }
  .ac-help details { border: 0; }
  .ac-help summary svg { display: none; }
}
