/* =========================================================
   Active Directory, le cours — feuille de style
   Esprit : carnet d'atelier / revue technique imprimée.
   ========================================================= */

:root {
  --paper: #f5f0e6;
  --paper-2: #ece5d6;
  --card: #fffdf8;
  --ink: #1f2430;
  --ink-soft: #545a68;
  --rule: #d9cfbc;
  --heading: #141821;

  --blue: #2449a6;          /* bleu encre */
  --blue-soft: rgba(36, 73, 166, .09);
  --terra: #c4552d;         /* terre cuite */
  --terra-soft: rgba(196, 85, 45, .10);
  --mustard: #c9921a;
  --mustard-soft: rgba(214, 160, 30, .16);
  --sage: #4f7a5a;
  --sage-soft: rgba(79, 122, 90, .12);
  --plum: #7a3e6e;
  --plum-soft: rgba(122, 62, 110, .10);

  --claire: #c4552d;        /* couleur de Claire */
  --malik: #2449a6;         /* couleur de Malik */

  --ps-bg: #012456;         /* fond PowerShell historique */
  --ps-text: #eef3ff;

  --radius: 10px;
  --shadow: 0 1px 0 rgba(60, 45, 20, .06), 0 8px 24px -12px rgba(60, 45, 20, .25);
  --f-body: "Source Sans 3", system-ui, "Segoe UI", sans-serif;
  --f-head: "Fraunces", Georgia, serif;
  --f-mono: "IBM Plex Mono", Consolas, monospace;
  --f-hand: "Caveat", "Segoe Print", cursive;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --paper: #16181d;
  --paper-2: #1d2027;
  --card: #20242c;
  --ink: #e4e1d9;
  --ink-soft: #a3a39c;
  --rule: #353a45;
  --heading: #f7f3ea;
  --blue: #84a5f2;
  --blue-soft: rgba(132, 165, 242, .12);
  --terra: #ec8a62;
  --terra-soft: rgba(236, 138, 98, .12);
  --mustard: #e8b54a;
  --mustard-soft: rgba(232, 181, 74, .13);
  --sage: #8cc09a;
  --sage-soft: rgba(140, 192, 154, .12);
  --plum: #d39bc7;
  --plum-soft: rgba(211, 155, 199, .12);
  --claire: #ec8a62;
  --malik: #84a5f2;
  --shadow: 0 8px 24px -12px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 18.5px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
/* grain de papier très léger */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: -1; opacity: .5;
  background-image: radial-gradient(rgba(120, 100, 60, .07) 1px, transparent 1px);
  background-size: 4px 4px;
}
:root[data-theme="dark"] body::before { opacity: .25; }
img, svg { max-width: 100%; }
a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { font-family: var(--f-head); color: var(--heading); font-weight: 600; line-height: 1.15; letter-spacing: -.01em; }
h3 { font-size: 1.35rem; margin: 2.2rem 0 .6rem; }
p { margin: 0 0 1.1rem; }
strong { color: var(--heading); font-weight: 650; }
code { font-family: var(--f-mono); font-size: .86em; background: var(--paper-2); padding: .1em .35em; border-radius: 4px; }
::selection { background: var(--mustard-soft); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Barre du haut ---------- */
.progress-bar { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--terra); z-index: 60; }
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule);
}
.topbar-inner { max-width: 1240px; margin: auto; padding: .7rem 24px; display: flex; align-items: center; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .55rem; color: var(--heading); text-decoration: none; font-family: var(--f-head); font-size: 1.15rem; font-weight: 600; }
.brand svg { width: 28px; height: 28px; }
.brand em { font-style: italic; color: var(--terra); }
.nav { margin-left: auto; display: flex; align-items: center; gap: 1.3rem; font-size: .95rem; }
.nav a { color: var(--ink-soft); text-decoration: none; }
.nav a:hover, .nav a.active { color: var(--heading); }
.theme-toggle { border: 1px solid var(--rule); background: var(--card); color: var(--ink); border-radius: 99px; padding: .25rem .7rem; font: inherit; font-size: .85rem; cursor: pointer; }

/* ---------- En-tête de module ---------- */
.mod-hero { max-width: 1240px; margin: auto; padding: 3.5rem 24px 2rem; display: grid; grid-template-columns: 1.15fr .85fr; gap: 3rem; align-items: center; }
.kicker { font-family: var(--f-mono); font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--terra); }
.mod-hero h1 { font-size: clamp(2.4rem, 5vw, 3.9rem); margin: .6rem 0 1rem; font-weight: 600; }
.mod-hero h1 i { color: var(--blue); font-weight: 400; }
.mod-hero .lead { font-size: 1.2rem; color: var(--ink-soft); max-width: 36em; }
.mod-hero .big-num { font-family: var(--f-head); font-size: 9rem; line-height: .8; font-weight: 700; color: transparent; -webkit-text-stroke: 1.5px var(--rule); float: right; margin: -1rem 0 0 1rem; user-select: none; }
.meta { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; margin-top: 1.4rem; font-family: var(--f-mono); font-size: .82rem; color: var(--ink-soft); }
.meta b { color: var(--heading); font-weight: 600; }
.hero-illu { position: relative; }
.hero-illu svg { width: 100%; height: auto; display: block; }

/* ---------- Mise en page lecture ---------- */
.layout { max-width: 1240px; margin: auto; padding: 0 24px 4rem; display: grid; grid-template-columns: 190px minmax(0, 720px) 1fr; gap: 0 48px; }
.toc { position: sticky; top: 84px; align-self: start; font-size: .88rem; padding-top: 3.2rem; }
.toc-title { font-family: var(--f-mono); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: .6rem; }
.toc ol { list-style: none; padding: 0; margin: 0; counter-reset: t; }
.toc li { counter-increment: t; }
.toc a { display: block; padding: .28rem 0 .28rem .9rem; color: var(--ink-soft); text-decoration: none; border-left: 2px solid var(--rule); line-height: 1.35; }
.toc a::before { content: counter(t, decimal-leading-zero) "  "; font-family: var(--f-mono); font-size: .72rem; opacity: .7; }
.toc a.active { color: var(--heading); border-left-color: var(--terra); }
.content { grid-column: 2; min-width: 0; }

/* Titres de section avec numéro */
.content h2 { font-size: clamp(1.8rem, 3.4vw, 2.35rem); margin: 4.2rem 0 1.2rem; position: relative; }
.content h2 .n { display: block; font-family: var(--f-mono); font-size: .8rem; font-weight: 500; letter-spacing: .14em; color: var(--terra); margin-bottom: .5rem; }
.content > p:first-of-type::first-letter { font-family: var(--f-head); float: left; font-size: 3.6em; line-height: .85; padding: .08em .1em 0 0; color: var(--terra); }

/* Notes dans la marge (à droite sur grand écran) */
.marge { float: right; clear: right; width: 230px; margin: .2rem -290px 1rem 0; font-family: var(--f-hand); font-size: 1.3rem; line-height: 1.25; color: var(--plum); transform: rotate(-1.2deg); }
.marge.plat { font-family: var(--f-body); font-size: .9rem; color: var(--ink-soft); transform: none; line-height: 1.5; border-top: 1px solid var(--rule); padding-top: .5rem; }
.marge.plat::before { content: none; }
.marge.plat b { display: block; font-family: var(--f-mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--terra); font-weight: 500; }

/* Bandeau pleine largeur (casse le rythme) */
.bandeau { margin: 3rem 0; padding: 2.2rem 2.4rem; background: var(--heading); color: var(--paper); border-radius: 4px; position: relative; overflow: hidden; }
.bandeau p { font-family: var(--f-head); font-size: clamp(1.35rem, 2.6vw, 1.75rem); line-height: 1.35; margin: 0; font-weight: 400; }
.bandeau p em { color: var(--mustard); font-style: italic; }
.bandeau small { display: block; margin-top: .9rem; font-family: var(--f-mono); font-size: .78rem; letter-spacing: .08em; opacity: .7; }
:root[data-theme="dark"] .bandeau { background: var(--paper-2); color: var(--ink); border: 1px solid var(--rule); }

/* ---------- Notes (encadrés) ---------- */
.note { margin: 1.8rem 0; padding: 1rem 1.2rem 1rem 1.3rem; border-left: 3px solid var(--blue); background: var(--blue-soft); border-radius: 0 var(--radius) var(--radius) 0; }
.note > b:first-child { display: block; font-family: var(--f-mono); font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--blue); margin-bottom: .2rem; font-weight: 600; }
.note p:last-child { margin-bottom: 0; }
.note.attention { border-color: var(--terra); background: var(--terra-soft); }
.note.attention > b:first-child { color: var(--terra); }
.note.astuce { border-color: var(--sage); background: var(--sage-soft); }
.note.astuce > b:first-child { color: var(--sage); }
.note.terrain { border: 1px dashed var(--rule); border-left: 3px solid var(--mustard); background: var(--card); }
.note.terrain > b:first-child { color: var(--mustard); }

/* ---------- Figures et schémas ---------- */
figure { margin: 2.2rem 0; }
figure.schema { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow); }
figure.large { margin-left: -60px; margin-right: -60px; }
figcaption { font-size: .88rem; color: var(--ink-soft); margin-top: .8rem; }
figcaption b { font-family: var(--f-mono); font-size: .75rem; letter-spacing: .08em; color: var(--terra); font-weight: 600; margin-right: .3rem; }
figure svg { display: block; width: 100%; height: auto; }
/* couleurs des SVG pilotées par le thème */
.s-ink { stroke: var(--ink); } .s-soft { stroke: var(--ink-soft); } .s-rule { stroke: var(--rule); }
.s-blue { stroke: var(--blue); } .s-terra { stroke: var(--terra); } .s-sage { stroke: var(--sage); } .s-mustard { stroke: var(--mustard); }
.f-card { fill: var(--card); } .f-paper { fill: var(--paper); } .f-paper2 { fill: var(--paper-2); } .f-ink { fill: var(--ink); } .f-soft { fill: var(--ink-soft); }
.f-blue { fill: var(--blue); } .f-terra { fill: var(--terra); } .f-sage { fill: var(--sage); } .f-mustard { fill: var(--mustard); } .f-plum { fill: var(--plum); }
.f-blue-soft { fill: var(--blue-soft); } .f-terra-soft { fill: var(--terra-soft); } .f-sage-soft { fill: var(--sage-soft); } .f-mustard-soft { fill: var(--mustard-soft); }
svg text { font-family: var(--f-body); }
svg .t-mono { font-family: var(--f-mono); }
svg .t-hand { font-family: var(--f-hand); }
svg .t-head { font-family: var(--f-head); }
svg .halo { paint-order: stroke; stroke: var(--card); stroke-width: 6px; stroke-linejoin: round; }

/* ---------- Notes vocales ---------- */
.vocal { margin: 2rem 0; background: var(--card); border: 1px solid var(--rule); border-radius: 18px; padding: 1rem 1.1rem .9rem; box-shadow: var(--shadow); position: relative; }
.vocal-head { display: flex; align-items: center; gap: .7rem; margin-bottom: .6rem; }
.duo { display: flex; }
.av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-family: var(--f-head); font-weight: 600; color: #fff; font-size: .95rem; border: 2px solid var(--card); }
.av.c { background: var(--claire); } .av.m { background: var(--malik); margin-left: -10px; }
:root[data-theme="dark"] .av { color: #16181d; }
.vocal-title { font-weight: 650; color: var(--heading); line-height: 1.25; }
.vocal-title small { display: block; font-weight: 400; color: var(--ink-soft); font-size: .85rem; }
.vocal-player { display: flex; align-items: center; gap: .8rem; }
.vocal .play { flex: none; width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--heading); color: var(--paper); cursor: pointer; display: grid; place-items: center; transition: transform .15s; }
.vocal .play:hover { transform: scale(1.06); }
.vocal .play svg { width: 18px; height: 18px; fill: currentColor; }
.onde { flex: 1; height: 42px; display: flex; align-items: center; gap: 2px; cursor: pointer; min-width: 0; }
.onde i { flex: 1; min-width: 2px; background: var(--rule); border-radius: 2px; transition: background .1s; }
.onde i.lu { background: var(--terra); }
:root[data-theme="dark"] .onde i:not(.lu) { background: #4a505d; }
.vocal .temps { font-family: var(--f-mono); font-size: .8rem; color: var(--ink-soft); min-width: 3.2em; text-align: right; }
.vocal .vitesse { border: 1px solid var(--rule); background: transparent; color: var(--ink-soft); font-family: var(--f-mono); font-size: .75rem; border-radius: 99px; padding: .15rem .5rem; cursor: pointer; }
.vocal details { margin-top: .6rem; border-top: 1px dashed var(--rule); padding-top: .5rem; }
.vocal summary { cursor: pointer; font-size: .85rem; color: var(--ink-soft); list-style: none; }
.vocal summary::before { content: "▸ "; }
.vocal details[open] summary::before { content: "▾ "; }
.transcript { font-size: .95rem; margin-top: .5rem; }
.transcript p { margin: 0 0 .35rem; padding-left: 4.4rem; text-indent: -4.4rem; }
.transcript p::before { display: inline-block; width: 4.4rem; text-indent: 0; font-weight: 650; font-size: .85rem; }
.transcript .c::before { content: "Claire"; color: var(--claire); }
.transcript .m::before { content: "Malik"; color: var(--malik); }
.vocal.attente .play { opacity: .35; cursor: not-allowed; }

/* ---------- Pause quiz (dans le texte) ---------- */
.pause { margin: 2.4rem 0; border: 2px solid var(--heading); border-radius: var(--radius); padding: 1.2rem 1.3rem; position: relative; background: var(--card); }
.pause::before { content: "PAUSE · 30 s"; position: absolute; top: -.75rem; left: 1rem; background: var(--mustard); color: #1f2430; font-family: var(--f-mono); font-size: .72rem; font-weight: 600; letter-spacing: .12em; padding: .15rem .55rem; border-radius: 3px; }
.pause .question { font-weight: 650; color: var(--heading); margin-bottom: .8rem; }
.opts { display: grid; gap: .5rem; }
.opts button { text-align: left; font: inherit; font-size: .98rem; color: var(--ink); background: var(--paper); border: 1px solid var(--rule); border-radius: 8px; padding: .55rem .85rem; cursor: pointer; transition: border-color .15s, background .15s; }
.opts button:hover:not(:disabled) { border-color: var(--heading); }
.opts button:disabled { cursor: default; }
.opts button.ok { background: var(--sage-soft); border-color: var(--sage); color: var(--heading); }
.opts button.ko { background: var(--terra-soft); border-color: var(--terra); text-decoration: line-through; text-decoration-color: var(--terra); }
.pourquoi { display: none; margin-top: .9rem; font-size: .95rem; padding-top: .8rem; border-top: 1px dashed var(--rule); }
.pourquoi::before { font-family: var(--f-mono); font-size: .75rem; letter-spacing: .1em; font-weight: 600; margin-right: .4rem; }
.repondu .pourquoi { display: block; }
.repondu.juste .pourquoi::before { content: "EXACT —"; color: var(--sage); }
.repondu.faux .pourquoi::before { content: "PAS TOUT À FAIT —"; color: var(--terra); }

/* ---------- Tri (objet / attribut…) ---------- */
.tri { margin: 2rem 0; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.2rem 1.3rem; }
.tri .consigne { font-weight: 650; color: var(--heading); margin-bottom: .8rem; }
.tri ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.tri li { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; padding: .35rem 0; border-bottom: 1px dotted var(--rule); }
.tri li span.mot { flex: 1; min-width: 10em; }
.tri li button { font: inherit; font-size: .82rem; font-family: var(--f-mono); border: 1px solid var(--rule); background: var(--paper); color: var(--ink); border-radius: 99px; padding: .15rem .7rem; cursor: pointer; }
.tri li.ok button.choisi { background: var(--sage); border-color: var(--sage); color: #fff; }
.tri li.ko button.choisi { background: var(--terra); border-color: var(--terra); color: #fff; }
.tri li .expl { flex-basis: 100%; font-size: .88rem; color: var(--ink-soft); display: none; }
.tri li.ok .expl, .tri li.ko .expl { display: block; }
.tri .bilan { margin-top: .8rem; font-family: var(--f-mono); font-size: .85rem; color: var(--ink-soft); }

/* ---------- Simulation « départ d'une salariée » ---------- */
.simu { margin: 2.4rem 0; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.simu-tabs { display: flex; border-bottom: 1px solid var(--rule); }
.simu-tabs button { flex: 1; font: inherit; font-weight: 600; padding: .8rem; border: 0; background: var(--paper-2); color: var(--ink-soft); cursor: pointer; }
.simu-tabs button.actif { background: var(--card); color: var(--heading); box-shadow: inset 0 -3px 0 var(--terra); }
.simu-body { padding: 1.3rem; }
.simu-body .consigne { margin-bottom: 1rem; font-size: .98rem; }
.services { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; }
.svc { border: 1px solid var(--rule); border-radius: 8px; padding: .7rem .5rem; text-align: center; background: var(--paper); font-size: .85rem; cursor: pointer; position: relative; transition: opacity .3s, transform .15s; user-select: none; }
.svc:hover { transform: translateY(-2px); }
.svc svg { width: 26px; height: 26px; display: block; margin: 0 auto .3rem; }
.svc .compte { display: block; font-family: var(--f-mono); font-size: .7rem; color: var(--terra); }
.svc.ferme { opacity: .45; cursor: default; transform: none; }
.svc.ferme .compte { color: var(--sage); }
.svc.ferme::after { content: "✓"; position: absolute; top: .2rem; right: .45rem; color: var(--sage); font-weight: 700; }
.svc.oubli { animation: clignote 1s 3; }
@keyframes clignote { 50% { box-shadow: 0 0 0 3px var(--terra); } }
.simu-ad { display: none; }
.simu.mode-ad .simu-ad { display: block; }
.simu.mode-ad .simu-sans { display: none; }
.simu .gros-btn { font: inherit; font-weight: 650; background: var(--heading); color: var(--paper); border: 0; border-radius: 8px; padding: .7rem 1.2rem; cursor: pointer; margin-bottom: 1rem; }
.simu .compteur { margin-top: 1rem; font-family: var(--f-mono); font-size: .85rem; color: var(--ink-soft); min-height: 1.4em; }
.simu .compteur b { color: var(--heading); }

/* ---------- Frise ---------- */
.frise { margin: 2rem 0; position: relative; padding-left: 0; list-style: none; }
.frise li { display: grid; grid-template-columns: 5.2rem 1fr; gap: 1.2rem; padding-bottom: 1.4rem; position: relative; }
.frise li::before { content: ""; position: absolute; left: 6.15rem; top: .55rem; bottom: -.3rem; width: 1px; background: var(--rule); }
.frise li:last-child::before { display: none; }
.frise .an { font-family: var(--f-head); font-size: 1.6rem; font-weight: 600; color: var(--heading); line-height: 1.1; text-align: right; }
.frise .txt { position: relative; padding-left: 1.1rem; }
.frise .txt::before { content: ""; position: absolute; left: -.3rem; top: .5rem; width: 9px; height: 9px; border-radius: 50%; background: var(--paper); border: 2px solid var(--terra); }
.frise .txt b { display: block; color: var(--heading); }
.frise .txt span { display: block; color: var(--ink-soft); font-size: .95rem; line-height: 1.55; margin-top: .15rem; }
.frise li.cle .txt::before { background: var(--terra); }

/* ---------- Comparaison deux colonnes ---------- */
.versus { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; margin: 2rem 0; }
.versus > div { background: var(--card); padding: 1.1rem 1.2rem; }
.versus h4 { margin: 0 0 .5rem; font-family: var(--f-mono); font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--terra); }
.versus > div:last-child h4 { color: var(--sage); }
.versus ul { margin: 0; padding-left: 1.1rem; font-size: .97rem; }

/* ---------- Terminal PowerShell ---------- */
.ps { margin: 1.6rem 0; border-radius: 8px; overflow: hidden; background: var(--ps-bg); box-shadow: var(--shadow); }
.ps-bar { display: flex; align-items: center; gap: .6rem; padding: .4rem .5rem .4rem .9rem; background: #0b1a3a; color: #b9c6e4; font-family: var(--f-mono); font-size: .75rem; }
.ps-bar .titre { flex: 1; }
.ps-bar button { font: inherit; background: transparent; color: #b9c6e4; border: 1px solid #2c3f6b; border-radius: 4px; padding: .1rem .5rem; cursor: pointer; }
.ps pre { margin: 0; padding: 1rem 1.1rem; color: var(--ps-text); font-family: var(--f-mono); font-size: .86rem; line-height: 1.6; overflow-x: auto; }
.ps .p { color: #f4f4f4; }
.ps .k { color: #fdf05a; }    /* cmdlet (jaune PowerShell) */
.ps .f { color: #a7a7a7; }    /* paramètre */
.ps .s { color: #7fd0ff; }    /* chaîne / valeur */
.ps .o { color: #d6def0; }
.ps .c { color: #6fbf73; }

/* ---------- Glossaire ---------- */
dl.glossaire { display: grid; grid-template-columns: max-content 1fr; gap: .55rem 1.4rem; margin: 1.5rem 0; }
dl.glossaire dt { font-family: var(--f-head); font-weight: 600; color: var(--heading); }
dl.glossaire dd { margin: 0; color: var(--ink); }

/* ---------- Missions ---------- */
.missions { list-style: none; padding: 0; margin: 1.5rem 0; counter-reset: m; }
.missions > li { counter-increment: m; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: .9rem 1.1rem; margin-bottom: .7rem; }
.missions label { display: flex; gap: .8rem; align-items: flex-start; cursor: pointer; }
.missions label::before { content: counter(m); font-family: var(--f-head); font-weight: 600; font-size: 1.3rem; color: var(--terra); line-height: 1.2; min-width: 1.2rem; }
.missions input { margin-top: .4rem; accent-color: var(--sage); width: 1.05rem; height: 1.05rem; flex: none; order: 2; margin-left: auto; }
.correction { display: none; margin-top: .8rem; padding-top: .8rem; border-top: 1px dashed var(--rule); font-size: .95rem; }
.missions li.fait .correction { display: block; }
.missions li.fait { border-color: var(--sage); }
.corr-titre { display: block; font-family: var(--f-mono); font-size: .75rem; letter-spacing: .1em; color: var(--sage); font-weight: 600; margin-bottom: .3rem; }

/* ---------- Quiz final ---------- */
.quiz { margin: 2rem 0; }
.quiz .q { margin-bottom: 1.4rem; }
.quiz .q > p { font-weight: 650; color: var(--heading); margin-bottom: .5rem; }
.quiz-score { font-family: var(--f-mono); font-size: .9rem; color: var(--ink-soft); }

/* ---------- Q/R ---------- */
#qa-list details { border-bottom: 1px solid var(--rule); padding: .7rem 0; }
#qa-list summary { cursor: pointer; font-weight: 600; color: var(--heading); }
#qa-list details > div { padding-top: .5rem; }

/* ---------- Fin de module ---------- */
.done-btn { display: block; width: 100%; margin: 3rem 0 1.5rem; font: inherit; font-weight: 650; padding: 1rem; border-radius: var(--radius); border: 2px dashed var(--rule); background: transparent; color: var(--ink); cursor: pointer; }
.done-btn.is-done { border-style: solid; border-color: var(--sage); background: var(--sage-soft); color: var(--heading); }
.page-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1rem; }
.page-nav a, .page-nav span { flex: 1; padding: .9rem 1.1rem; border: 1px solid var(--rule); border-radius: var(--radius); text-decoration: none; color: var(--heading); background: var(--card); }
.page-nav small { display: block; color: var(--ink-soft); font-size: .8rem; }
.page-nav .next { text-align: right; }
.page-nav span { opacity: .5; }
.credits { font-size: .85rem; color: var(--ink-soft); border-top: 1px solid var(--rule); margin-top: 3rem; padding-top: 1rem; }
footer.site-footer { border-top: 1px solid var(--rule); padding: 2rem 24px; text-align: center; font-size: .85rem; color: var(--ink-soft); }

/* ---------- Apparition ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s, transform .6s; }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; } }

/* =========================================================
   Accueil
   ========================================================= */
.home-hero { max-width: 1240px; margin: auto; padding: 4.5rem 24px 3rem; display: grid; grid-template-columns: 1.1fr .9fr; gap: 3rem; align-items: center; }
.home-hero h1 { font-size: clamp(2.8rem, 6.5vw, 5.2rem); margin: .8rem 0 1.2rem; font-weight: 600; line-height: 1.02; }
.home-hero h1 i { font-weight: 400; color: var(--terra); }
.home-hero .lead { font-size: 1.25rem; color: var(--ink-soft); max-width: 32em; }
.cta { display: inline-flex; align-items: center; gap: .5rem; margin-top: 1.4rem; background: var(--heading); color: var(--paper); padding: .85rem 1.4rem; border-radius: 99px; text-decoration: none; font-weight: 650; }
.cta:hover { text-decoration: none; transform: translateY(-1px); }
.wrap { max-width: 1240px; margin: auto; padding: 0 24px; }
.section-title { font-size: clamp(1.8rem, 3.6vw, 2.6rem); margin: 4rem 0 .6rem; }
.section-sub { color: var(--ink-soft); max-width: 40em; margin-bottom: 2rem; }

/* Personnages */
.persos { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.perso { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.3rem; display: flex; gap: 1rem; align-items: flex-start; }
.perso .av { width: 56px; height: 56px; font-size: 1.4rem; flex: none; margin: 0; border: 0; }
.perso h3 { margin: 0 0 .2rem; font-size: 1.25rem; }
.perso p { margin: 0; font-size: .98rem; color: var(--ink-soft); }

/* Plan de ligne (programme) */
.ligne-phase { display: grid; grid-template-columns: 220px 1fr; gap: 2rem; padding: 1.8rem 0; border-top: 1px solid var(--rule); }
.ligne-phase h3 { margin: 0; font-size: 1.3rem; }
.ligne-phase h3 small { display: block; font-family: var(--f-mono); font-size: .72rem; letter-spacing: .14em; color: var(--phase, var(--terra)); font-weight: 500; margin-bottom: .3rem; }
.ligne-phase .desc { font-size: .92rem; color: var(--ink-soft); margin-top: .4rem; }
.stations { list-style: none; margin: 0; padding: 0; position: relative; }
.stations::before { content: ""; position: absolute; left: 11px; top: 14px; bottom: 14px; width: 4px; border-radius: 2px; background: var(--phase, var(--terra)); opacity: .9; }
.stations li { position: relative; }
.station { display: grid; grid-template-columns: 26px 3rem 1fr auto; align-items: center; gap: .9rem; padding: .55rem .4rem .55rem 0; color: var(--ink); text-decoration: none; border-radius: 8px; }
a.station:hover { background: var(--card); text-decoration: none; }
.station .pt { width: 26px; height: 26px; border-radius: 50%; background: var(--paper); border: 4px solid var(--phase, var(--terra)); position: relative; z-index: 1; }
a.station .pt { background: var(--phase, var(--terra)); box-shadow: 0 0 0 4px var(--paper); }
.station .num { font-family: var(--f-mono); font-size: .85rem; color: var(--ink-soft); }
.station .nom { font-weight: 600; color: var(--heading); line-height: 1.3; }
.station .nom small { display: block; font-weight: 400; color: var(--ink-soft); font-size: .88rem; }
.station.ferme .nom { color: var(--ink-soft); font-weight: 500; }
.station .etat { font-family: var(--f-mono); font-size: .72rem; letter-spacing: .06em; color: var(--ink-soft); white-space: nowrap; }
a.station .etat { color: var(--sage); }
.station .etat.fini { color: var(--sage); font-weight: 600; }
.overall { display: flex; align-items: center; gap: 1rem; margin: 1rem 0 0; font-family: var(--f-mono); font-size: .85rem; color: var(--ink-soft); }
.meter { flex: 1; max-width: 320px; height: 6px; background: var(--paper-2); border-radius: 99px; overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; background: var(--sage); transition: width 1s; }

/* Journal */
.journal { list-style: none; padding: 0; margin: 0 0 4rem; font-size: .95rem; }
.journal li { display: grid; grid-template-columns: 7rem 1fr; gap: 1rem; padding: .5rem 0; border-bottom: 1px dotted var(--rule); }
.journal time { font-family: var(--f-mono); font-size: .82rem; color: var(--ink-soft); }

/* =========================================================
   Petits écrans
   ========================================================= */
@media (max-width: 1180px) {
  .layout { grid-template-columns: minmax(0, 1fr); max-width: 780px; }
  .toc { display: none; }
  .content { grid-column: 1; }
  .marge { float: none; width: auto; margin: 0 0 1.2rem 1rem; display: block; }
  figure.large { margin-left: 0; margin-right: 0; }
}
@media (max-width: 860px) {
  .mod-hero, .home-hero { grid-template-columns: 1fr; gap: 1.5rem; padding-top: 2.4rem; }
  .mod-hero .big-num { font-size: 6rem; }
  .hero-illu { max-width: 460px; }
  .persos, .versus { grid-template-columns: 1fr; }
  .ligne-phase { grid-template-columns: 1fr; gap: 1rem; }
  .services { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  body { font-size: 17px; }
  .topbar-inner, .mod-hero, .layout, .home-hero, .wrap { padding-left: 16px; padding-right: 16px; }
  .hide-sm { display: none; }
  .bandeau { padding: 1.5rem 1.3rem; }
  .station { grid-template-columns: 26px 2.2rem 1fr; }
  .station .etat { display: none; }
  .frise li { grid-template-columns: 3.8rem 1fr; gap: .8rem; }
  .frise li::before { left: 4.45rem; }
  .frise .an { font-size: 1.25rem; }
  dl.glossaire { grid-template-columns: 1fr; gap: .1rem; }
  dl.glossaire dd { margin-bottom: .6rem; }
  .journal li { grid-template-columns: 1fr; gap: 0; }
  .page-nav { flex-direction: column; }
}

/* ---------- Fiche d'objet (annuaire vu de l'intérieur) ---------- */
.fiche { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.fiche-tete { padding: 1rem 1.2rem .9rem; background: var(--blue-soft); border-bottom: 1px solid var(--rule); }
.fiche-tete strong { display: block; font-family: var(--f-head); font-size: 1.5rem; font-weight: 600; }
.fiche-type { font-family: var(--f-mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--blue); }
.fiche-chemin { display: block; font-family: var(--f-mono); font-size: .74rem; color: var(--ink-soft); word-break: break-all; margin-top: .2rem; }
.fiche dl { display: grid; grid-template-columns: max-content 1fr; margin: 0; font-size: .95rem; }
.fiche dt, .fiche dd { padding: .42rem 1.2rem; border-bottom: 1px dotted var(--rule); margin: 0; }
.fiche dt { font-family: var(--f-mono); font-size: .82rem; color: var(--terra); padding-top: .5rem; }
.fiche dd i { color: var(--ink-soft); font-size: .88rem; }
.fiche figcaption { padding: 0 1.2rem 1rem; }
@media (max-width: 560px) {
  .fiche dl { grid-template-columns: 1fr; }
  .fiche dt { border-bottom: 0; padding-bottom: 0; }
}

/* ---------- Notes vocales à une voix ---------- */
.av.voix-f, .av.voix-h { width: 40px; height: 40px; border: 0; flex: none; }
.av.voix-f { background: var(--terra); } .av.voix-h { background: var(--blue); }
.av svg { width: 20px; height: 20px; fill: currentColor; }
.vocal .transcript p { padding: 0; text-indent: 0; }
.vocal .transcript p::before { content: none; }

/* ---------- Vidéos ---------- */
.video-card { margin: 2.2rem 0; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.video-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .8rem; padding: .85rem 1.1rem; }
.video-badge { font-family: var(--f-mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: #fff; background: var(--terra); padding: .12rem .5rem; border-radius: 3px; }
.video-head strong { font-family: var(--f-head); font-size: 1.15rem; font-weight: 600; }
.video-head span:last-child { color: var(--ink-soft); font-size: .9rem; }
.video-card video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.video-card figcaption { margin: 0; padding: .55rem 1.1rem .75rem; font-size: .78rem; }
.video-attente { aspect-ratio: 16 / 9; display: grid; place-items: center; color: var(--ink-soft); font-family: var(--f-head);
  background: repeating-linear-gradient(135deg, var(--paper-2) 0 18px, var(--paper) 18px 36px); }

/* ---------- Lecteur vidéo (assets/js/lecteur-video.js) ---------- */
.lv { --lv-accent: #c4552d; --lv-police: var(--f-body); }

/* ---------- Module 01 : zoom sur les niveaux ---------- */
.ps .v { color: #9cdcfe; }
.ps.arbo pre { line-height: 1.5; }
.zoom-btns { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.zoom-btns button { font: inherit; font-family: var(--f-mono); font-size: .85rem; border: 1px solid var(--rule); background: var(--paper); color: var(--ink); border-radius: 99px; padding: .25rem .9rem; cursor: pointer; }
.zoom-btns button.actif { background: var(--terra); border-color: var(--terra); color: #fff; }
.zoom .cadre { fill: none; stroke: var(--ink-soft); stroke-width: 1.6; transition: stroke .25s, fill .25s, stroke-width .25s; }
.zoom .lbl { fill: var(--ink-soft); transition: fill .25s; }
.zoom [data-n].hl .cadre { stroke: var(--terra); stroke-width: 3.5; fill: var(--terra-soft); }
.zoom [data-n].hl .lbl { fill: var(--terra); font-weight: 600; }
.zoom.choisi svg [data-n]:not(.hl) { opacity: .55; }
.zoom-txt { margin: .9rem 0 0; min-height: 3.2em; font-size: .97rem; }
.zoom-txt b { color: var(--heading); }

/* ---------- Nom distinctif décomposé ---------- */
.dn { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.2rem 1.3rem; box-shadow: var(--shadow); }
.dn-ligne { font-family: var(--f-mono); font-size: 1rem; word-break: break-word; padding-bottom: .9rem; border-bottom: 1px dashed var(--rule); color: var(--ink-soft); }
.dn-ligne span { padding: .1rem .3rem; border-radius: 4px; color: var(--heading); }
.dn-cn { background: var(--terra-soft); } .dn-ou { background: var(--sage-soft); } .dn-dc { background: var(--blue-soft); }
.dn-legende { margin: .9rem 0 0; padding-left: 1.2rem; font-size: .95rem; }
.dn-legende li { margin-bottom: .35rem; }
.dn-legende li > span:first-child { font-family: var(--f-mono); font-size: .85rem; padding: .05rem .3rem; border-radius: 4px; }

/* ---------- Choix (une option, un résultat) ---------- */
.choix { margin: 2rem 0; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.2rem 1.3rem; }
.choix .consigne { font-weight: 650; color: var(--heading); margin-bottom: .8rem; }
.choix-btns { display: flex; flex-wrap: wrap; gap: .5rem; }
.choix-btns button { font: inherit; font-family: var(--f-mono); font-size: .95rem; border: 1px solid var(--rule); background: var(--paper); color: var(--ink); border-radius: 8px; padding: .45rem 1rem; cursor: pointer; }
.choix-btns button.actif { border-color: var(--heading); box-shadow: inset 0 -3px 0 var(--terra); }
.choix-res { margin: 1rem 0 0; min-height: 3em; font-size: .97rem; }
.choix-res:empty { display: none; }

/* ---------- Tableau ---------- */
.table-wrap { overflow-x: auto; margin: 1.6rem 0; }
.tableau { width: 100%; border-collapse: collapse; font-size: .95rem; background: var(--card); }
.tableau th { text-align: left; font-family: var(--f-mono); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--terra); font-weight: 600; padding: .6rem .8rem; border-bottom: 2px solid var(--heading); }
.tableau td { padding: .55rem .8rem; border-bottom: 1px dotted var(--rule); vertical-align: top; }
.tableau td:first-child { font-weight: 650; color: var(--heading); white-space: nowrap; }
.content p code, .content li code, .content dd code { overflow-wrap: anywhere; }

/* ---------- Corrections : petits blocs de commandes ---------- */
.correction pre.mini { margin: .6rem 0; padding: .7rem .9rem; background: var(--ps-bg); color: var(--ps-text); border-radius: 6px; font-family: var(--f-mono); font-size: .8rem; line-height: 1.55; overflow-x: auto; }
.correction pre.mini .p { color: #f4f4f4; opacity: .7; }
.correction pre.mini .o { color: #d6def0; opacity: .85; }
.correction pre.mini .c { color: #6fbf73; }

/* ---------- Frise avec des mots à la place des années ---------- */
.frise.mots li { grid-template-columns: 6.6rem 1fr; }
.frise.mots li::before { left: 7.55rem; }
.frise.mots .an { font-size: 1.05rem; padding-top: .1rem; }
@media (max-width: 640px) {
  .frise.mots li { grid-template-columns: 5rem 1fr; }
  .frise.mots li::before { left: 5.65rem; }
  .frise.mots .an { font-size: .92rem; }
}

/* ---------- Jeton d'accès (groupes imbriqués) ---------- */
.jeton { margin: 2rem 0; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.2rem 1.3rem; box-shadow: var(--shadow); }
.jeton .consigne { font-weight: 650; color: var(--heading); margin: 0 0 .8rem; }
.jeton-btns { display: flex; flex-wrap: wrap; gap: .5rem; }
.jeton-btns button { font: inherit; font-size: .95rem; border: 1px solid var(--rule); background: var(--paper); color: var(--ink); border-radius: 99px; padding: .35rem 1rem; cursor: pointer; }
.jeton-btns button.actif { background: var(--heading); border-color: var(--heading); color: var(--paper); }
.jeton-res { display: grid; grid-template-columns: 1.2fr 1fr; gap: 1rem; margin-top: 1rem; }
.jeton-res:empty { display: none; }
.jeton-res h5 { margin: 0 0 .5rem; font-family: var(--f-mono); font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--terra); }
.jeton-res ul { list-style: none; margin: 0; padding: 0; }
.jeton-res li { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .5rem; padding: .32rem 0; border-bottom: 1px dotted var(--rule); font-size: .93rem; animation: jeton-in .3s both; }
.jeton-res li code { font-family: var(--f-mono); font-size: .84rem; padding: .05rem .35rem; border-radius: 4px; background: var(--blue-soft); color: var(--heading); }
.jeton-res li code.dl { background: var(--mustard-soft); }
.jeton-res li small { color: var(--ink-soft); font-size: .8rem; }
.jeton-res .acces li { color: var(--heading); }
.jeton-res .acces li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--sage); flex: none; align-self: center; }
.jeton figcaption { margin-top: 1rem; }
@keyframes jeton-in { from { opacity: 0; transform: translateY(4px); } }
@media (max-width: 640px) { .jeton-res { grid-template-columns: 1fr; } }

/* Zoom : les flèches (path) ne se remplissent pas quand elles sont surlignées */
.zoom [data-n] path.cadre, .zoom [data-n].hl path.cadre { fill: none; }

/* ---------- Décalage d'horloge (Kerberos) ---------- */
.decalage { margin: 2rem 0; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.2rem 1.3rem; box-shadow: var(--shadow); }
.decalage .consigne { font-weight: 650; color: var(--heading); margin: 0 0 .9rem; }
.decalage-horloges { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.decalage-horloges > div { text-align: center; padding: .7rem; border: 1px solid var(--rule); border-radius: 10px; background: var(--paper); }
.decalage-horloges small { display: block; font-family: var(--f-mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.decalage-horloges b { font-family: var(--f-mono); font-size: 1.9rem; color: var(--heading); }
.decalage input[type=range] { width: 100%; accent-color: var(--terra); }
.decalage-res { margin: .8rem 0 0; padding: .6rem .8rem; border-radius: 8px; font-size: .97rem; background: var(--sage-soft); border-left: 3px solid var(--sage); }
.decalage-res.refus { background: var(--terra-soft); border-left-color: var(--terra); }
.decalage figcaption { margin-top: .9rem; }
