/* Git & CI/CD, le cours — charte graphique
   Polices : Bricolage Grotesque (titres), Instrument Sans (texte), JetBrains Mono (code).
   Accent : vert « pipeline réussi ». Une couleur par partie, comme les branches d'un graphe Git :
   git = violet, github = bleu, actions = vert, deploy = ambre. */

:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #efede7;
  --ink: #15171c;
  --ink-2: #3a3e48;
  --muted: #6a6e78;
  --line: #e2dfd7;
  --line-2: #cfcabe;

  --accent: #0b7d57;
  --accent-hover: #086646;
  --accent-soft: #e0f1e9;
  --accent-ink: #ffffff;

  --git: #6c4fd8;
  --hub: #2f62d9;
  --act: #0b7d57;
  --ship: #b86200;

  --ok: #1f9d68;
  --run: #d99a1c;
  --fail: #d0453f;

  /* fenêtres de code : toujours sombres */
  --code-bg: #14171c;
  --code-bg-2: #1b1f26;
  --code-line: #2a2f38;
  --code-ink: #d9dce3;
  --code-muted: #7d8492;

  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(20, 22, 28, .05), 0 12px 32px -12px rgba(20, 22, 28, .18);

  --f-title: "Bricolage Grotesque", "Instrument Sans", system-ui, sans-serif;
  --f-text: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
}

:root[data-theme="dark"] {
  --bg: #0f1115;
  --surface: #161920;
  --surface-2: #1b1f27;
  --ink: #eceef2;
  --ink-2: #c3c7d0;
  --muted: #8d939f;
  --line: #262a33;
  --line-2: #343945;

  --accent: #34c48a;
  --accent-hover: #4fd69c;
  --accent-soft: #12291f;
  --accent-ink: #07130d;

  --git: #9b84f5;
  --hub: #6c95f2;
  --act: #34c48a;
  --ship: #eb9a3c;

  --code-bg: #0b0d11;
  --code-bg-2: #12151b;
  --code-line: #232831;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 40px -16px rgba(0, 0, 0, .6);
}

.l-git { --lane: var(--git); }
.l-hub { --lane: var(--hub); }
.l-act { --lane: var(--act); }
.l-ship { --lane: var(--ship); }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.65 var(--f-text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
h1, h2, h3, h4 { font-family: var(--f-title); color: var(--ink); margin: 0; line-height: 1.12; letter-spacing: -0.02em; font-weight: 600; }
p { margin: 0 0 1em; }
code, .mono { font-family: var(--f-mono); font-size: .86em; }
pre, code, .mono, svg text { font-variant-ligatures: none; font-feature-settings: "liga" 0, "calt" 0; }
:not(pre) > code {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: .08em .38em;
  color: var(--ink);
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }

/* ---------- barre du haut ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; align-items: center; gap: 24px; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 600 17px/1 var(--f-title); letter-spacing: -0.01em; }
.brand:hover { color: var(--ink); }
.brand img { border-radius: 7px; }
.brand em { font-style: normal; color: var(--muted); font-weight: 500; }
.topnav { display: flex; gap: 4px; margin-left: auto; }
.topnav a { color: var(--ink-2); text-decoration: none; font-size: 15px; font-weight: 500; padding: 6px 12px; border-radius: 8px; }
.topnav a:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  border-radius: 10px; cursor: pointer;
}
.icon-btn:hover { color: var(--ink); border-color: var(--line-2); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .sun, [data-theme="dark"] .icon-btn .moon { display: none; }
[data-theme="dark"] .icon-btn .sun { display: block; }

/* ---------- boutons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 10px;
  font: 600 15.5px/1 var(--f-text); text-decoration: none;
  border: 1px solid transparent; cursor: pointer; transition: background .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); color: var(--accent-ink); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { color: var(--ink); border-color: var(--ink-2); }

/* ---------- hero ---------- */
.hero { padding: 72px 0 88px; border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: 56px; align-items: center; }
.kicker {
  display: inline-flex; align-items: center; gap: 10px;
  font: 500 13.5px/1 var(--f-mono); color: var(--ink-2);
  border: 1px solid var(--line); background: var(--surface);
  padding: 8px 12px; border-radius: 99px; margin-bottom: 26px;
}
.kicker .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 22%, transparent); }
.hero h1 { font-size: clamp(40px, 5.6vw, 66px); letter-spacing: -0.035em; line-height: 1.02; font-weight: 700; }
.hero h1 .hl { color: var(--accent); }
.lead { font-size: 18.5px; color: var(--ink-2); margin: 24px 0 32px; max-width: 34em; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.facts { display: flex; gap: 36px; margin: 44px 0 0; padding-top: 26px; border-top: 1px solid var(--line); }
.facts div { margin: 0; }
.facts dt { font: 700 30px/1 var(--f-title); letter-spacing: -0.03em; }
.facts dd { margin: 6px 0 0; color: var(--muted); font-size: 14.5px; line-height: 1.35; max-width: 11em; }

/* ---------- fenêtre d'exécution ---------- */
.runwin {
  background: var(--code-bg); color: var(--code-ink);
  border-radius: var(--radius); box-shadow: var(--shadow);
  border: 1px solid var(--code-line); overflow: hidden; min-width: 0;
}
.runwin-bar { display: flex; align-items: center; border-bottom: 1px solid var(--code-line); background: var(--code-bg-2); padding: 0 8px; }
.tabs { display: flex; overflow-x: auto; scrollbar-width: none; }
.tab {
  font: 500 13px/1 var(--f-mono); color: var(--code-muted);
  background: none; border: 0; padding: 14px 12px 13px; cursor: pointer; white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.tab:hover { color: var(--code-ink); }
.tab[aria-selected="true"] { color: #fff; border-bottom-color: #34c48a; }

.run-panel { padding: 18px 18px 16px; }
.run-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 8px; }
.run-state { display: inline-flex; align-items: center; gap: 8px; font: 600 14px/1 var(--f-text); color: #fff; }
.run-state i { width: 10px; height: 10px; border-radius: 50%; background: var(--code-muted); }
.run-state[data-state="running"] i { background: var(--run); animation: pulse 1.2s ease-in-out infinite; }
.run-state[data-state="wait"] i { background: var(--run); }
.run-state[data-state="ok"] i { background: #34c48a; }
.run-meta { font-size: 13px; color: var(--code-muted); }
.run-meta .mono { color: var(--code-ink); font-size: 12.5px; }
.run-meta .pill { background: #2a3140; border-radius: 5px; padding: 1px 6px; }

.run-graph { width: 100%; height: auto; margin: 4px 0 2px; }
.run-graph .edges path { fill: none; stroke: #343a46; stroke-width: 2; transition: stroke .4s; }
.run-graph .edges path.on { stroke: #34c48a; }
.run-graph .job rect { fill: #1b1f27; stroke: #313744; stroke-width: 1; transition: stroke .3s, fill .3s; }
.run-graph .job text { font: 500 13px var(--f-mono); fill: #d9dce3; }
.run-graph .job .tm { font-size: 11px; fill: var(--code-muted); }
.run-graph .lbl { font: 400 11px var(--f-mono); fill: var(--code-muted); }
.run-graph .st circle { fill: none; stroke: #59606e; stroke-width: 1.6; stroke-dasharray: 2.4 2.2; }
.run-graph .st path { fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.run-graph .st .ck { stroke: #0b0d11; }
.run-graph .st .sp { stroke: var(--run); transform-origin: 0 0; }
.run-graph .st .wt { stroke: var(--run); }
.run-graph .job.is-running rect { stroke: color-mix(in srgb, var(--run) 70%, transparent); }
.run-graph .job.is-running .st circle { stroke: #3c3524; stroke-dasharray: none; }
.run-graph .job.is-running .sp { opacity: 1; animation: spin .8s linear infinite; }
.run-graph .job.is-ok .st circle { fill: #34c48a; stroke: #34c48a; stroke-dasharray: none; }
.run-graph .job.is-ok .ck { opacity: 1; }
.run-graph .job.is-wait rect { stroke: var(--run); stroke-dasharray: 4 3; }
.run-graph .job.is-wait .st circle { stroke: var(--run); stroke-dasharray: none; }
.run-graph .job.is-wait .wt { opacity: 1; }

.run-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--code-line); padding-top: 14px; }
.run-foot p { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--code-muted); flex: 1 1 260px; }
.run-foot p b { color: var(--code-ink); font-weight: 600; }
.run-foot code { background: #232833; border-color: #2f3542; color: var(--code-ink); }
.run-btns { display: flex; gap: 8px; }
.btn-mini {
  font: 600 13px/1 var(--f-text); padding: 9px 12px; border-radius: 8px; cursor: pointer;
  background: #1f242d; color: var(--code-ink); border: 1px solid #343a46;
}
.btn-mini:hover { border-color: #59606e; }
.btn-approve { background: #34c48a; color: #07130d; border-color: #34c48a; }
.btn-approve:hover { background: #4fd69c; border-color: #4fd69c; }

.yaml {
  margin: 0; padding: 18px 20px; max-height: 470px; overflow: auto;
  font: 400 13px/1.62 var(--f-mono); color: var(--code-ink); tab-size: 2;
}
.y-k { color: #8fb8ff; }
.y-s { color: #d9dce3; }
.y-a { color: #c3a6ff; }
.y-n { color: #f2b56b; }
.y-e { color: #5fd7a2; }
.y-c { color: var(--code-muted); font-style: italic; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .35; } }

/* ---------- sections ---------- */
.section { padding: 96px 0; border-bottom: 1px solid var(--line); }
.section-alt { background: var(--surface); }
.section-head { max-width: 720px; margin-bottom: 48px; }
.eyebrow { font: 500 13px/1 var(--f-mono); color: var(--accent); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 14px; }
.section-head h2, .story h2 { font-size: clamp(30px, 3.8vw, 44px); letter-spacing: -0.03em; margin-bottom: 16px; }
.section-head p:not(.eyebrow) { color: var(--ink-2); font-size: 18px; margin: 0; }

/* ---------- trajet ---------- */
.trajet {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); position: relative;
}
.trajet::before {
  content: ""; position: absolute; left: 6.25%; right: 6.25%; top: 27px; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, var(--git) 0 25%, var(--hub) 25% 50%, var(--act) 50% 87.5%, var(--ship) 87.5%);
}
.trajet li { position: relative; }
.trajet a { display: flex; flex-direction: column; align-items: center; text-align: center; text-decoration: none; color: var(--ink); padding: 0 4px 6px; }
.trajet .tn {
  position: relative; z-index: 1;
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  background: var(--bg); border: 3px solid var(--lane);
  font: 600 16px/1 var(--f-mono); color: var(--lane); margin-bottom: 14px;
  transition: background .15s, color .15s, transform .15s;
}
.trajet a:hover .tn { background: var(--lane); color: var(--bg); transform: translateY(-2px); }
.trajet b { font: 600 17px/1.2 var(--f-title); letter-spacing: -0.01em; }
.trajet a > span:last-child { font: 400 12.5px/1.4 var(--f-mono); color: var(--muted); margin-top: 4px; }

.cicd-defs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 56px; }
.cicd-defs > div {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px 24px 20px; border-top: 3px solid var(--lane);
}
.cicd-defs h3 { font-size: 20px; margin-bottom: 10px; }
.cicd-defs p { color: var(--ink-2); font-size: 15.5px; margin: 0; }
.cicd-defs .mono { position: absolute; top: 22px; right: 20px; font-size: 12.5px; font-weight: 600; color: var(--lane); }

/* ---------- programme en graphe ---------- */
.graph { position: relative; }
.lane { position: relative; padding-left: 56px; padding-bottom: 28px; }
.lane::before { content: ""; position: absolute; left: 17px; top: 0; bottom: 0; width: 3px; background: var(--lane); border-radius: 3px; opacity: .9; }
.lane:last-child { padding-bottom: 0; }
.lane:last-child::before { bottom: 40px; }
.lane-head { position: relative; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; padding: 4px 0 22px; }
.lane-head::before {
  content: ""; position: absolute; left: -49px; top: 4px; width: 23px; height: 23px; border-radius: 6px;
  background: var(--lane);
}
.ref {
  font: 600 12.5px/1 var(--f-mono); color: var(--lane);
  border: 1px solid color-mix(in srgb, var(--lane) 45%, transparent);
  background: color-mix(in srgb, var(--lane) 10%, transparent);
  padding: 5px 9px; border-radius: 99px; align-self: center;
}
.lane-head h3 { font-size: 26px; letter-spacing: -0.025em; }
.lane-head p { margin: 0; color: var(--muted); font-size: 15.5px; flex-basis: 100%; }

.mod {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px 26px 22px; margin-bottom: 16px;
  transition: border-color .15s, box-shadow .15s;
}
.mod:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.mod::before {
  content: ""; position: absolute; left: -46px; top: 28px; width: 17px; height: 17px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--lane); box-sizing: border-box;
}
.mod::after { content: ""; position: absolute; left: -29px; top: 36px; width: 29px; height: 1px; background: var(--line-2); }
.mod-top { display: flex; align-items: baseline; gap: 14px; margin-bottom: 8px; }
.mn { font: 600 15px/1 var(--f-mono); color: var(--lane); }
.mod h4 { font-size: 22px; letter-spacing: -0.02em; flex: 1; }
.status { font: 500 12px/1 var(--f-mono); color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 5px 10px; white-space: nowrap; }
.status.open { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); background: var(--accent-soft); }
.mod > p { color: var(--ink-2); font-size: 16px; margin: 0 0 16px; max-width: 62em; }
.chips { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { font: 400 12.5px/1 var(--f-mono); color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; }
.eps { list-style: none; margin: 0; padding: 14px 0 0; border-top: 1px dashed var(--line-2); display: grid; grid-template-columns: 1fr 1fr; gap: 8px 24px; }
.eps li { display: flex; align-items: baseline; gap: 10px; font-size: 15px; color: var(--ink); font-weight: 500; }
.eps li span { flex: none; font: 500 12px/1 var(--f-mono); color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.eps li span::before { content: ""; width: 0; height: 0; border-left: 7px solid var(--lane); border-top: 4.5px solid transparent; border-bottom: 4.5px solid transparent; }
a.mod { display: block; text-decoration: none; color: inherit; }

/* ---------- méthode ---------- */
.method { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; }
.method svg { width: 34px; height: 34px; fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 18px; }
.method h3 { font-size: 20px; margin-bottom: 10px; }
.method p { color: var(--ink-2); font-size: 15.5px; margin: 0; }

/* ---------- fil rouge ---------- */
.story { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: 56px; align-items: center; }
.story > div > p:not(.eyebrow) { color: var(--ink-2); }
.steps-list { list-style: none; margin: 26px 0 0; padding: 0; border-top: 1px solid var(--line); }
.steps-list li { display: grid; grid-template-columns: 76px 1fr; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 15.5px; }
.steps-list span { font: 500 13px/1.6 var(--f-mono); color: var(--accent); }

.gitgraph { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.gitgraph svg { width: 100%; height: auto; }
.gitgraph figcaption { font-size: 14px; color: var(--muted); margin-top: 14px; line-height: 1.55; }
.g-main { fill: none; stroke: var(--git); stroke-width: 3; }
.g-feat { fill: none; stroke: var(--hub); stroke-width: 3; }
.g-c-main circle { fill: var(--surface); stroke: var(--git); stroke-width: 3; }
.g-c-main circle:last-child { fill: var(--git); }
.g-c-feat circle { fill: var(--surface); stroke: var(--hub); stroke-width: 3; }
.g-ref { font: 600 13px var(--f-mono); }
.g-ref-main { fill: var(--git); }
.g-ref-feat { fill: var(--hub); }
.g-sha { font: 400 11px var(--f-mono); fill: var(--muted); }
.g-pr { fill: color-mix(in srgb, var(--hub) 14%, var(--surface)); stroke: var(--hub); }
.g-pr-t { font: 600 11.5px var(--f-mono); fill: var(--hub); }
.g-tag { fill: var(--ink); }
.g-tag-t { font: 600 12px var(--f-mono); fill: var(--surface); }
.g-dep { fill: none; stroke: var(--ship); stroke-width: 2; }
.g-dep-wait { stroke-dasharray: 5 4; }
.g-arrowhead { fill: var(--ship); }
.g-env { fill: color-mix(in srgb, var(--ship) 12%, var(--surface)); stroke: var(--ship); stroke-width: 1.5; }
.g-env-prod { fill: var(--ship); }
.g-env-t { font: 600 13px var(--f-mono); fill: var(--ship); }
.g-env-prod + .g-env-t { fill: var(--surface); }
.g-note { font: italic 400 12px var(--f-text); fill: var(--muted); }
.g-check { fill: var(--surface-2); stroke: var(--line); }
.g-check-dot { fill: var(--ok); }
.g-check-ck { fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.g-check-t { font: 500 12.5px var(--f-mono); fill: var(--ink-2); }

.repo { margin-top: 56px; background: var(--code-bg); border: 1px solid var(--code-line); border-radius: var(--radius); overflow: hidden; }
.repo-head { display: flex; justify-content: space-between; gap: 12px; padding: 12px 20px; background: var(--code-bg-2); border-bottom: 1px solid var(--code-line); font-size: 13px; color: var(--code-muted); }
.repo-head .mono { color: #fff; font-weight: 600; }
.tree { margin: 0; padding: 18px 20px; overflow-x: auto; font: 400 13.5px/1.75 var(--f-mono); color: var(--code-ink); }
.t-d { color: #8fb8ff; }
.t-c { color: var(--code-muted); }

/* ---------- prérequis, journal ---------- */
.prereq { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.prereq > div { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; background: var(--bg); }
.prereq h3 { font-size: 18px; margin-bottom: 8px; }
.prereq p { margin: 0; font-size: 15px; color: var(--ink-2); }

.log { list-style: none; margin: 0; padding: 0; max-width: 820px; }
.log li { display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); color: var(--ink-2); font-size: 15.5px; }
.log time { font: 500 13.5px/1.7 var(--f-mono); color: var(--muted); }

.site-footer { padding: 36px 0 48px; color: var(--muted); font-size: 14.5px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }
.site-footer .auteur { color: var(--ink); font-weight: 600; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 18px; }
.site-footer nav a { color: var(--ink-2); text-decoration: none; cursor: pointer; }
.site-footer nav a:hover { color: var(--accent); }

/* ---------- adaptatif ---------- */
@media (max-width: 1020px) {
  .hero-grid, .story { grid-template-columns: 1fr; gap: 44px; }
  .method, .prereq { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .trajet { grid-template-columns: 1fr; gap: 0; }
  .trajet::before { left: 26px; right: auto; top: 28px; bottom: 28px; width: 3px; height: auto;
    background: linear-gradient(180deg, var(--git) 0 25%, var(--hub) 25% 50%, var(--act) 50% 87.5%, var(--ship) 87.5%); }
  .trajet a { flex-direction: row; text-align: left; gap: 16px; padding: 6px 0; }
  .trajet .tn { margin: 0; flex: none; }
  .trajet b { min-width: 120px; }
  .trajet a > span:last-child { margin: 0; }
  .cicd-defs { grid-template-columns: 1fr; }
  .eps { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .topnav { display: none; }
  .topbar .wrap { justify-content: space-between; }
  .hero { padding: 44px 0 56px; }
  .facts { gap: 22px; }
  .section { padding: 64px 0; }
  .method, .prereq { grid-template-columns: 1fr; }
  .lane { padding-left: 40px; }
  .lane::before { left: 9px; }
  .lane-head::before { left: -40px; width: 21px; height: 21px; }
  .mod { padding: 20px 18px; }
  .mod::before { left: -38px; }
  .mod::after { left: -21px; width: 21px; }
  .mod-top { flex-wrap: wrap; gap: 8px 12px; }
  .mn { order: 1; }
  .status { order: 2; margin-left: auto; }
  .mod h4 { order: 3; flex-basis: 100%; font-size: 20px; }
  .run-panel { padding: 14px 12px; }
  .tree { font-size: 12px; }
  .log li { grid-template-columns: 1fr; gap: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}


/* =====================================================================
   PAGES DE MODULE (composants repris du cours Docker, charte de ce cours)
   ===================================================================== */
.d-box { fill: var(--surface); stroke: var(--line-2); }
.d-zone { fill: none; stroke: var(--line-2); stroke-dasharray: 4 4; }
.d-line { stroke: var(--muted); fill: none; }
.d-accent { fill: var(--accent-soft); stroke: var(--accent); }
.d-t { font: 600 13px var(--f-text); fill: var(--ink); }
.d-s { font: 400 11.5px var(--f-mono); fill: var(--muted); }
.d-z { font: 500 11.5px var(--f-mono); fill: var(--muted); }
.d-arrow { fill: var(--muted); }
.progress-bar { position: fixed; top: 0; left: 0; height: 2px; width: 0; background: var(--accent); z-index: 60; }
.topnav a.current { color: var(--ink); }

.mod-hero { padding: 64px 0 48px; border-bottom: 1px solid var(--line); }
.mod-hero .kicker { margin-bottom: 18px; }
.mod-hero .kicker .dot { background: var(--lane, var(--ok)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--lane, var(--ok)) 22%, transparent); }
.mod-hero { border-top: 3px solid var(--lane, var(--accent)); }
.mod-hero h1 { font-size: clamp(34px, 4.6vw, 52px); letter-spacing: -0.04em; line-height: 1.05; margin-bottom: 18px; max-width: 18em; }
.mod-hero .lead { max-width: 40em; margin-bottom: 26px; }
.meta { display: flex; flex-wrap: wrap; gap: 8px 28px; font-size: 14px; color: var(--muted); }
.meta b { color: var(--ink); font-weight: 500; }

.layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 64px; max-width: 1208px; margin: 0 auto; padding: 48px 24px 32px; }
.toc { position: sticky; top: 92px; align-self: start; max-height: calc(100vh - 120px); overflow-y: auto; font-size: 13.5px; }
.toc-title { font-weight: 600; color: var(--ink); margin-bottom: 12px; font-size: 13px; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc a { display: flex; gap: 10px; padding: 5px 0 5px 14px; margin-left: -1px; border-left: 1px solid transparent; color: var(--muted); line-height: 1.4; }
.toc a span { font-family: var(--f-mono); font-size: 12px; padding-top: 1px; }
.toc a:hover { color: var(--ink); text-decoration: none; }
.toc a.active { color: var(--ink); border-left-color: var(--lane, var(--accent)); }
@media (max-width: 960px) { .layout { grid-template-columns: 1fr; gap: 0; padding-top: 32px; } .toc { display: none; } }
@media (max-width: 640px) { .layout { padding: 24px 16px; } }

.content { max-width: 740px; min-width: 0; font-size: 16.5px; }
.content > p, .content > ul, .content > ol:not(.missions) { color: var(--ink-2); }
.content strong { color: var(--ink); font-weight: 600; }
.content h2 {
  font-size: 27px; letter-spacing: -0.03em; margin: 72px 0 18px; padding-top: 28px; border-top: 1px solid var(--line);
  display: flex; gap: 14px; align-items: baseline;
}
.content h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.content h2 .n { font: 600 15px/1 var(--f-mono); color: var(--lane, var(--accent)); letter-spacing: 0; flex: none; }
.content h3 { font-size: 19px; letter-spacing: -0.02em; margin: 36px 0 12px; }
.content ul, .content ol { padding-left: 22px; }
.content li { margin: 6px 0; }
.content li::marker { color: var(--muted); }
.content > p.intro { font-size: 18px; color: var(--ink); }

/* terminal */
.term { position: relative; margin: 24px 0; border: 1px solid var(--code-line); border-radius: var(--radius); background: var(--code-bg); overflow: hidden; }
.term::before { content: attr(data-title); display: block; padding: 9px 16px; border-bottom: 1px solid var(--code-line); background: var(--code-bg-2); font: 500 12.5px/1.4 var(--f-mono); color: var(--muted); }
.term pre { margin: 0; padding: 16px 18px; overflow-x: auto; font-size: 13.5px; line-height: 1.7; color: var(--code-ink); }
.term .p, .mini .p { color: #34c48a; user-select: none; }
.term .k { color: #fff; font-weight: 500; }
.term .f { color: #8fb8ff; }
.term .s { color: #f2b56b; }
.term .v { color: #5fd7a2; }
.term .o, .mini .o { color: #aeb4bf; }
.term .c, .mini .c { color: var(--code-muted); font-style: italic; }
.copy-btn {
  position: absolute; top: 5px; right: 8px; font: 500 12px/1 var(--f-text); color: var(--muted); background: #1f242d;
  border: 1px solid #343a46; border-radius: 6px; padding: 5px 9px; cursor: pointer;
}
.copy-btn:hover { color: #fff; border-color: #59606e; }

/* vidéos */
.video-card { margin: 32px 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.video-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.video-badge { font: 500 12px/1 var(--f-mono); color: var(--accent); background: var(--accent-soft); padding: 4px 8px; border-radius: 5px; }
.video-head strong { font-size: 16px; font-weight: 600; letter-spacing: -0.015em; }
.video-head span:last-child { color: var(--muted); font-size: 14px; }
.video-card video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.video-attente {
  aspect-ratio: 16 / 9; display: grid; place-items: center; align-content: center; gap: 12px; color: var(--muted); font-size: 14px;
  background: radial-gradient(circle at 50% 45%, var(--surface-2), var(--bg) 70%);
}
.video-attente::before {
  content: ""; width: 54px; height: 54px; border-radius: 50%; border: 1px solid var(--line-2);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cpath d=%22M9 7l9 5-9 5z%22 fill=%22%238a909c%22/%3E%3C/svg%3E") center / 22px no-repeat;
}
.lv { --lv-accent: #34c48a; --lv-rayon: 0px; --lv-police: "Instrument Sans", system-ui, sans-serif; }

/* figures */
.content figure.diagram { margin: 32px 0; }
figure.diagram figcaption b { color: var(--ink); font-weight: 600; margin-right: 6px; }
.d-ok { fill: color-mix(in srgb, var(--ok) 14%, var(--surface)); stroke: var(--ok); }
.d-warn { fill: color-mix(in srgb, var(--run) 14%, var(--surface)); stroke: var(--run); }
.d-solid { fill: var(--accent); }
.d-soft { fill: var(--surface-2); stroke: var(--line-2); }
.d-tw { font: 600 12.5px var(--f-text); fill: #fff; }
.d-sw { font: 400 11px var(--f-mono); fill: rgba(255, 255, 255, .82); }
.d-acc-t { font: 600 12.5px var(--f-mono); fill: var(--accent); }
.d-lacc { stroke: var(--accent); fill: none; }
.d-arrow-acc { fill: var(--accent); }

/* schéma pas à pas */
.pas { margin: 32px 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); overflow: hidden; }
.pas-tete { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--surface); }
.pas-tete strong { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.pas-ctrl { display: flex; align-items: center; gap: 6px; font: 500 12.5px var(--f-mono); color: var(--muted); }
.pas-ctrl button {
  width: 30px; height: 30px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  cursor: pointer; font: 500 14px/1 var(--f-text); display: grid; place-items: center;
}
.pas-ctrl button:hover:not(:disabled) { border-color: var(--line-2); }
.pas-ctrl button:disabled { opacity: .35; cursor: default; }
.pas-ctrl .cpt { min-width: 44px; text-align: center; }
.pas svg { display: block; width: 100%; height: auto; padding: 20px; }
.pas [data-step] { opacity: 0; transition: opacity .35s ease; }
.pas [data-step].vu { opacity: 1; }
.pas [data-step].estompe { opacity: .3; }
.pas-legende { margin: 0; padding: 14px 18px 16px; border-top: 1px solid var(--line); background: var(--surface); font-size: 15px; color: var(--ink-2); min-height: 78px; }
.pas-legende b { color: var(--ink); font-weight: 600; }
.pas ol.etapes { display: none; }
@media (prefers-reduced-motion: reduce) { .pas [data-step] { transition: none; } }

/* commande ou fichier annoté */
.annote { margin: 28px 0; border: 1px solid var(--code-line); border-radius: var(--radius); overflow: hidden; background: var(--code-bg); }
.annote-tete { padding: 9px 16px; border-bottom: 1px solid var(--code-line); background: var(--code-bg-2); font: 500 12.5px/1.4 var(--f-mono); color: var(--muted); }
.annote-code { padding: 16px 18px; font: 14px/2.1 var(--f-mono); color: var(--code-ink); overflow-x: auto; white-space: pre; }
.annote-code .l { border-radius: 4px; padding: 2px 3px; cursor: pointer; border-bottom: 1px dashed #59606e; transition: background .15s; }
.annote-code .l:hover { background: rgba(52, 196, 138, .1); }
.annote-code .l.on { background: rgba(52, 196, 138, .2); border-bottom-color: #34c48a; color: #fff; }
.annote-expl { padding: 14px 18px; border-top: 1px solid var(--line); background: var(--surface); font-size: 15px; color: var(--ink-2); min-height: 82px; }
.annote-expl .vide { color: var(--muted); }

/* notes */
.note { margin: 24px 0; padding: 14px 18px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius-sm); background: var(--surface); font-size: 15.5px; color: var(--ink-2); }
.note > b:first-child { display: block; color: var(--ink); font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.note p:last-child { margin-bottom: 0; }
.note.attention { border-left-color: var(--run); }
.note.terrain { border-left-color: var(--ok); }

/* comparaison */
.versus { display: grid; grid-template-columns: 1fr 1fr; margin: 28px 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.versus > div { padding: 18px 20px; }
.versus > div + div { border-left: 1px solid var(--line); }
.versus h4 { font-size: 15px; margin-bottom: 8px; }
.versus ul { margin: 0; padding-left: 18px; font-size: 15px; color: var(--ink-2); }
@media (max-width: 600px) { .versus { grid-template-columns: 1fr; } .versus > div + div { border-left: 0; border-top: 1px solid var(--line); } }

/* tableaux */
.table-wrap { margin: 24px 0; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table.tableau { width: 100%; border-collapse: collapse; font-size: 14.5px; background: var(--surface); }
.tableau th { text-align: left; font-weight: 600; color: var(--ink); background: var(--surface-2); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tableau td { padding: 10px 14px; border-top: 1px solid var(--line); color: var(--ink-2); vertical-align: top; }
.tableau tr:first-child td { border-top: 0; }

/* pause, tri, quiz */
.pause, .tri, .quiz { margin: 32px 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 20px; }
.pause::before { content: "Question"; display: block; font: 500 12px/1 var(--f-mono); color: var(--accent); margin-bottom: 10px; }
.tri::before { content: "Exercice"; display: block; font: 500 12px/1 var(--f-mono); color: var(--accent); margin-bottom: 10px; }
.pause .question, .tri .consigne { font-weight: 600; color: var(--ink); margin: 0 0 14px; }
.opts { display: flex; flex-direction: column; gap: 8px; }
.opts button {
  text-align: left; font: inherit; font-size: 15px; color: var(--ink); background: var(--surface); cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 14px; transition: border-color .15s, background .15s;
}
.opts button:hover:not(:disabled) { border-color: var(--line-2); background: var(--surface-2); }
.opts button:disabled { cursor: default; }
.opts button.ok { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 9%, var(--surface)); }
.opts button.ko { border-color: var(--fail); background: color-mix(in srgb, var(--fail) 8%, var(--surface)); }
.pourquoi { display: none; margin: 14px 0 0; font-size: 15px; color: var(--ink-2); }
.pause.repondu .pourquoi { display: block; }

.tri ul { list-style: none; padding: 0; margin: 0; }
.tri li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); margin: 0; }
.tri li:first-child { border-top: 0; padding-top: 0; }
.tri .mot { flex: 1 1 260px; font-size: 15px; color: var(--ink); }
.tri button { font: 500 13px/1 var(--f-mono); padding: 7px 11px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; }
.tri button:hover:not(:disabled) { border-color: var(--line-2); color: var(--ink); }
.tri button:disabled { cursor: default; }
.tri button.ok { border-color: var(--ok); color: var(--ok); background: color-mix(in srgb, var(--ok) 9%, var(--surface)); }
.tri button.ko { border-color: var(--fail); color: var(--fail); }
.tri .expl { display: none; flex-basis: 100%; font-size: 14px; color: var(--muted); }
.tri li.fait .expl { display: block; }
.bilan, .quiz-score { margin: 14px 0 0; font: 500 13px var(--f-mono); color: var(--muted); }

.quiz .q { padding: 18px 0; border-top: 1px solid var(--line); }
.quiz .q:first-child { border-top: 0; padding-top: 0; }
.quiz .q > p { font-weight: 600; color: var(--ink); margin: 0 0 12px; }

/* missions */
.content ol.missions { list-style: none; counter-reset: m; padding: 0; margin: 24px 0; }
.missions > li { counter-increment: m; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin: 0 0 12px; overflow: hidden; }
.missions label { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; cursor: pointer; color: var(--ink); font-size: 15.5px; }
.missions label::before { content: counter(m, decimal-leading-zero); font: 500 13px/1.75 var(--f-mono); color: var(--muted); flex: none; }
.missions label span { flex: 1; }
.missions input { margin-top: 4px; width: 17px; height: 17px; accent-color: var(--accent); flex: none; cursor: pointer; }
.correction { display: none; padding: 16px 18px 18px; border-top: 1px solid var(--line); background: var(--surface-2); font-size: 15px; color: var(--ink-2); }
.missions li.fait .correction { display: block; }
.missions li.fait label span { color: var(--muted); }
.corr-titre { display: block; font: 500 12px/1 var(--f-mono); color: var(--ok); margin-bottom: 10px; }
.correction p:last-child { margin-bottom: 0; }
pre.mini { margin: 0 0 12px; padding: 12px 14px; border: 1px solid var(--code-line); border-radius: var(--radius-sm); background: var(--code-bg); color: var(--code-ink); font-size: 13px; line-height: 1.65; overflow-x: auto; }

/* mémo */
dl.glossaire { margin: 24px 0; display: grid; grid-template-columns: minmax(150px, 230px) 1fr; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.glossaire dt, .glossaire dd { margin: 0; padding: 11px 16px; border-top: 1px solid var(--line); font-size: 14.5px; }
.glossaire dt { font-weight: 600; color: var(--ink); background: var(--surface-2); }
.glossaire dd { color: var(--ink-2); }
.glossaire dt:first-of-type, .glossaire dt:first-of-type + dd { border-top: 0; }
@media (max-width: 600px) { dl.glossaire { grid-template-columns: 1fr; } .glossaire dd { border-top: 0; padding-top: 0; background: var(--surface-2); } }

/* questions fréquentes */
#qa-list details { border-top: 1px solid var(--line); }
#qa-list details:last-child { border-bottom: 1px solid var(--line); }
#qa-list summary { cursor: pointer; padding: 15px 0; font-weight: 500; color: var(--ink); list-style: none; display: flex; justify-content: space-between; gap: 16px; }
#qa-list summary::-webkit-details-marker { display: none; }
#qa-list summary::after { content: "+"; font: 400 18px/1 var(--f-mono); color: var(--muted); }
#qa-list details[open] summary::after { content: "\2212"; }
#qa-list details > div { padding: 0 0 16px; color: var(--ink-2); font-size: 15.5px; }
#qa-list details > div p:last-child { margin-bottom: 0; }

/* fin de module */
.done-btn { margin: 56px 0 0; font: 500 15px var(--f-text); padding: 11px 18px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.done-btn:hover { border-color: var(--line-2); }
.done-btn.fait { border-color: color-mix(in srgb, var(--ok) 40%, transparent); color: var(--ok); background: color-mix(in srgb, var(--ok) 7%, var(--surface)); }
.page-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 28px 0; }
.page-nav a, .page-nav span { display: block; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); font-weight: 500; font-size: 15px; background: var(--surface); }
.page-nav a:hover { text-decoration: none; border-color: var(--line-2); }
.page-nav small { display: block; color: var(--muted); font-weight: 400; font-size: 13px; margin-bottom: 3px; }
.page-nav .next { text-align: right; grid-column: 2; }
.page-nav span.next { color: var(--muted); }
.content > p.credits { margin-top: 40px; font-size: 13.5px; color: var(--muted); }

/* frise */
.content ul.frise { list-style: none; padding: 0; margin: 28px 0; border-left: 1px solid var(--line-2); }
.frise li { position: relative; padding: 0 0 16px 24px; margin: 0; color: var(--ink-2); font-size: 15px; }
.frise li::before { content: ""; position: absolute; left: -4px; top: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); }
.frise li.cle::before { background: var(--accent); }
.frise b { display: inline-block; min-width: 52px; font: 500 13.5px var(--f-mono); color: var(--ink); }

/* accueil : module terminé */
.status.fini { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, transparent); background: var(--accent-soft); }

/* compléments propres au cours */
.d-git { fill: color-mix(in srgb, var(--git) 12%, var(--surface)); stroke: var(--git); }
.d-hub { fill: color-mix(in srgb, var(--hub) 12%, var(--surface)); stroke: var(--hub); }
.d-act { fill: color-mix(in srgb, var(--act) 12%, var(--surface)); stroke: var(--act); }
.d-ship { fill: color-mix(in srgb, var(--ship) 12%, var(--surface)); stroke: var(--ship); }
.d-lane { stroke: var(--lane, var(--accent)); fill: none; }
.d-lane-t { font: 600 12.5px var(--f-mono); fill: var(--lane, var(--accent)); }
.d-ref { font: 600 11.5px var(--f-mono); fill: #fff; }
.d-refbox { fill: var(--lane, var(--accent)); }
.d-head { fill: var(--ink); }
.d-headt { font: 600 11.5px var(--f-mono); fill: var(--bg); }
.content .term pre .y-k, .annote-code .y-k { color: #8fb8ff; }

.toc a, .page-nav a, a.mod { text-decoration: none; }

/* le code dans le texte peut passer à la ligne sur petit écran */
.content :not(pre) > code, .content h2, #qa-list summary { overflow-wrap: anywhere; }
#qa-list summary > * { min-width: 0; }
.tableau code { overflow-wrap: normal; white-space: nowrap; }
