/* Formation JavaScript : design sombre, minimaliste et premium.
   Huit finitions au choix (sélecteur en bas à droite). Chacune associe trois couleurs d'accent
   et un métal (graphite, titane teinté) utilisé pour les titres, les contours et les reflets. */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Lexend:wght@400;500&family=JetBrains+Mono:wght@400;500&display=swap");

/* ---------- Palettes ---------- */
:root {
  color-scheme: dark;
  /* Titane Bleu Nuit (par défaut) : fond bleu nuit, titane bleuté. */
  --bg: #060912; --bg-2: #0e1320; --bg-3: #171e2e;
  --text: #f3f6fc; --text-2: #a3adc2; --text-3: #76819a;
  --line: rgba(255,255,255,.08); --line-2: rgba(255,255,255,.14);
  --accent: #0a84ff; --accent-2: #5e5ce6; --accent-3: #64d2ff; --on-accent: #ffffff;
  --metal: linear-gradient(120deg, #56647f 0%, #c9d6f0 18%, #7787a6 36%, #eef3ff 52%, #60708e 70%, #bccae6 86%, #56647f 100%);

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --measure: 700px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --glass: rgba(255,255,255,.045);
  --glass-2: rgba(255,255,255,.08);
  --t-comment: var(--text-3); --t-keyword: var(--accent); --t-string: var(--accent-3); --t-number: var(--accent-2);
  --t-function: var(--text); --t-punct: var(--text-2); --t-class: var(--accent-2);
  --gradient: linear-gradient(120deg, var(--accent), var(--accent-2) 55%, var(--accent-3));
}
:root[data-palette="macbook"] {
  /* MacBook : noir profond et gris titane brossé. */
  --bg: #000000; --bg-2: #0f0f10; --bg-3: #1b1b1d; --text: #f5f5f7; --text-2: #a1a1a6; --text-3: #7c7c81;
  --accent: #d6d5d2; --accent-2: #8a8986; --accent-3: #f4f3f0; --on-accent: #000000;
  --metal: linear-gradient(120deg, #66655f 0%, #d2d0ca 18%, #86847f 36%, #f4f3f0 52%, #73726c 70%, #c6c4be 86%, #66655f 100%);
}
:root[data-palette="chrome"] {
  /* Chrome liquide : miroir argenté aux reflets irisés (rose, ciel, menthe). */
  --bg: #050507; --bg-2: #101014; --bg-3: #1a1a20; --text: #f7f7fb; --text-2: #b4b4c0; --text-3: #7c7c88;
  --accent: #e8f4ff; --accent-2: #f3c8ff; --accent-3: #b8fff0; --on-accent: #050507;
  --metal: linear-gradient(120deg, #2a2a31 0%, #fbfbff 11%, #5d5d6b 22%, #dff3ff 33%, #ffd3f4 44%, #3a3a45 56%, #d6fff2 68%, #ffffff 80%, #4a4a56 90%, #2a2a31 100%);
}
:root[data-palette="aurore"] {
  --bg: #0b0916; --bg-2: #15112a; --bg-3: #1e1838; --text: #f3f0ff; --text-2: #b7aed6; --text-3: #847ba0;
  --accent: #a78bfa; --accent-2: #f472b6; --accent-3: #38bdf8; --on-accent: #0b0916;
  --metal: linear-gradient(120deg, #6f6890 0%, #d9d2f5 18%, #8b84aa 36%, #f5f2ff 52%, #7a7399 70%, #cfc8ee 86%, #6f6890 100%);
}
:root[data-palette="sunset"] {
  --bg: #110b0b; --bg-2: #1d1414; --bg-3: #281c1c; --text: #fff4ee; --text-2: #d4b8ad; --text-3: #977b71;
  --accent: #ff6b4a; --accent-2: #ff3d7f; --accent-3: #ffb547; --on-accent: #1a0905;
  --metal: linear-gradient(120deg, #8a6a60 0%, #f3d5c8 18%, #a8847a 36%, #fff1ea 52%, #8f6f66 70%, #e8c6b8 86%, #8a6a60 100%);
}
:root[data-palette="lagon"] {
  --bg: #061117; --bg-2: #0d1d25; --bg-3: #142a34; --text: #e8f6fb; --text-2: #a6c6d2; --text-3: #6a8c99;
  --accent: #2dd4bf; --accent-2: #38bdf8; --accent-3: #a3e635; --on-accent: #04201c;
  --metal: linear-gradient(120deg, #5f7a85 0%, #cfe6ee 18%, #7d98a3 36%, #f0fbff 52%, #668290 70%, #c2dbe4 86%, #5f7a85 100%);
}
:root[data-palette="foret"] {
  --bg: #0a100c; --bg-2: #131c16; --bg-3: #1b271f; --text: #eef5ef; --text-2: #b0c4b4; --text-3: #728a77;
  --accent: #4ade80; --accent-2: #22d3ee; --accent-3: #facc15; --on-accent: #062010;
  --metal: linear-gradient(120deg, #66786b 0%, #d6e6da 18%, #839488 36%, #f2fbf4 52%, #6e8174 70%, #c8dbcd 86%, #66786b 100%);
}
:root[data-palette="javascript"] {
  --bg: #0b0b0b; --bg-2: #161616; --bg-3: #202020; --text: #f4f4f0; --text-2: #b3b2ab; --text-3: #82817a;
  --accent: #f7df1e; --accent-2: #ff9f43; --accent-3: #ffffff; --on-accent: #111111;
  --metal: linear-gradient(120deg, #7a7356 0%, #efe6b8 18%, #9a9270 36%, #fffbe6 52%, #837b5c 70%, #e2d9a8 86%, #7a7356 100%);
}

/* Effets métal : texte brillant, contour titane, reflet qui glisse. */
.metal-text, .hero h1, main.lesson > h1, .vm-title h2, .vm-recap h2, .tr-num {
  background: var(--metal); background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  /* Reflet immobile : il ne bouge que lorsque le texte bouge (inclinaison 3D, souris, téléphone). */
  background-position: var(--reflet, 50%) 0; transition: background-position .6s var(--ease);
  padding-bottom: .14em;   /* le dégradé couvre aussi le bas des g, p, j : sinon ils sont coupés */
}
/* Le reflet va et vient sans jamais se répéter : un dégradé en biais répété en mosaïque
   laissait une jointure verticale visible qui glissait sur le texte. */
@keyframes shine { from { background-position: 0% 0; } to { background-position: 100% 0; } }
.metal-edge, pre:not(.out), .ticket, .vm-stage, .vm-window, .palette-list, .quiz, .sidebar .progress {
  border: 1px solid transparent;
  background: linear-gradient(var(--bg-2), var(--bg-2)) padding-box, var(--metal) border-box;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--text); font: 17px/1.75 var(--sans); letter-spacing: -0.005em;
  background:
    radial-gradient(900px 500px at 15% -10%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%),
    radial-gradient(800px 500px at 100% 0%, color-mix(in srgb, var(--accent-2) 10%, transparent), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-decoration: none; transition: color .3s var(--ease); }
a:hover { color: var(--accent-3); }
::selection { background: color-mix(in srgb, var(--accent) 40%, transparent); color: var(--text); }
strong { font-weight: 600; color: var(--text); }

/* ---------- Structure ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 290px; flex-shrink: 0; padding: 28px 18px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  font: 14px/1.45 var(--sans); background: color-mix(in srgb, var(--bg-2) 70%, transparent);
  backdrop-filter: blur(24px) saturate(1.4); -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border-right: 1px solid var(--line);
}
.sidebar .brand { display: block; color: var(--text); font: 700 17px/1.3 var(--sans); letter-spacing: -0.02em; margin: 0 6px 20px; }
.sidebar .brand span { display: table; font: 600 11px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); padding: 4px 10px; border-radius: 999px; margin-bottom: 10px; }
.progress { margin: 0 0 18px; padding: 14px 16px; border-radius: 16px; }
.progress .bar { height: 6px; background: var(--glass-2); border-radius: 999px; overflow: hidden; }
.progress .bar i { display: block; height: 100%; background: var(--gradient); width: 0; border-radius: 999px; transition: width .8s var(--ease); }
.progress small { display: block; margin-top: 8px; color: var(--text-2); font: 500 12px var(--sans); }
.sidebar h4 { margin: 22px 10px 6px; font: 600 11px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.sidebar ol { list-style: none; padding: 0; margin: 0; }
.sidebar li a { display: flex; gap: 10px; padding: 7px 10px; border-radius: 10px; color: var(--text-2); transition: background .3s var(--ease), color .3s var(--ease); }
.sidebar li a:hover { color: var(--text); background: var(--glass); }
.sidebar li a .n { color: var(--text-3); font-variant-numeric: tabular-nums; min-width: 20px; }
.sidebar li a.current { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--text); font-weight: 600; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent); }
.sidebar li a.current .n { color: var(--accent); }
.sidebar li a.done { color: var(--text-3); }
.menu-btn { display: none; }

main.lesson { flex: 1; min-width: 0; padding: 88px 40px 140px; }
main.lesson > * { max-width: var(--measure); margin-left: auto; margin-right: auto; }

/* ---------- Typographie ---------- */
.kicker { display: inline-block; font: 600 12px var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); padding: 6px 12px; border-radius: 999px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent); }
main.lesson > .kicker { display: block; width: fit-content; margin-left: max(0px, calc((100% - var(--measure)) / 2)); }
h1, h2, h3, h4 { font-family: var(--sans); color: var(--text); letter-spacing: -0.03em; }
h1 { font-size: clamp(38px, 5.4vw, 60px); line-height: 1.05; margin: 18px auto 18px; font-weight: 800; }
h2 { font-size: 30px; line-height: 1.2; margin-top: 80px; margin-bottom: 14px; font-weight: 700; }
h3 { font-size: 21px; margin-top: 40px; margin-bottom: 8px; font-weight: 650; letter-spacing: -0.02em; }
p, li { hyphens: auto; color: color-mix(in srgb, var(--text) 88%, var(--text-2)); }
.lead { font-size: 21px; line-height: 1.55; color: var(--text-2); margin-bottom: 8px; font-weight: 400; }
.intro { font-size: 18px; color: var(--text-2); background: var(--glass); border: 1px solid var(--line); border-radius: 18px; padding: 20px 24px; margin-top: 32px; margin-bottom: 8px; }
.intro::before { content: "Dans ce chapitre"; display: block; font: 600 11px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
p code, li code, td code, h2 code, h3 code, h1 code {
  font: 500 0.84em var(--mono); background: var(--glass-2); padding: 2px 7px; border-radius: 6px; color: var(--accent-3);
  -webkit-text-fill-color: var(--accent-3);
}
kbd { font: 500 0.8em var(--sans); background: var(--glass-2); border: 1px solid var(--line-2); border-radius: 6px; padding: 1px 6px; }

/* ---------- Code ---------- */
pre {
  position: relative; color: var(--text) !important; font: 14px/1.7 var(--mono) !important;
  padding: 22px 24px !important; border-radius: 18px; overflow-x: auto; margin: 28px auto !important;
  text-shadow: none !important; tab-size: 2; box-shadow: 0 20px 50px rgba(0,0,0,.35);
}
pre code { font: inherit !important; background: none !important; text-shadow: none !important; color: inherit !important; padding: 0; }
pre .copy {
  position: absolute; top: 10px; right: 10px; font: 500 12px var(--sans); padding: 5px 12px; cursor: pointer;
  background: var(--glass-2); color: var(--text); border: 1px solid var(--line-2); border-radius: 999px;
  backdrop-filter: blur(12px); opacity: 0; transition: opacity .3s var(--ease), background .3s var(--ease);
}
pre .copy:hover { background: var(--accent); color: var(--on-accent); border-color: transparent; }
pre:hover .copy, pre .copy:focus { opacity: 1; }
pre.out { background: transparent !important; border: 0; border-left: 2px solid var(--line-2); border-radius: 0; box-shadow: none; padding: 4px 0 4px 20px !important; color: var(--text-2) !important; }
pre.out::before { content: "Résultat"; display: block; font: 600 10px var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); margin-bottom: 4px; }
.token.comment { color: var(--t-comment) !important; font-style: italic; }
.token.keyword, .token.builtin, .token.tag, .token.selector { color: var(--t-keyword) !important; }
.token.string, .token.template-string, .token.attr-value, .token.regex { color: var(--t-string) !important; }
.token.number, .token.boolean, .token.attr-name, .token.property { color: var(--t-number) !important; }
.token.function { color: var(--t-function) !important; }
.token.operator, .token.punctuation { color: var(--t-punct) !important; background: none !important; }
.token.class-name { color: var(--t-class) !important; }

/* ---------- Encadrés ---------- */
.box { background: var(--glass); border: 1px solid var(--line); border-radius: 18px; padding: 20px 24px; margin: 32px auto; }
.box > :first-child { margin-top: 0; } .box > :last-child { margin-bottom: 0; }
.box strong.t { display: inline-block; font: 600 11px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); margin-bottom: 8px; }
.trap { background: color-mix(in srgb, var(--accent-2) 8%, transparent); border-color: color-mix(in srgb, var(--accent-2) 30%, transparent); }
.trap strong.t { color: var(--accent-2); }
.tip strong.t { color: var(--accent); }
.ticket { padding: 24px 28px; border-radius: 20px; margin: 36px auto; }
.ticket .id { display: inline-block; font: 600 11px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--on-accent); background: var(--gradient); padding: 5px 12px; border-radius: 999px; margin-bottom: 12px; }

/* ---------- Exercices ---------- */
.exo { border-top: 1px solid var(--line); padding: 20px 0 4px; margin: 0 auto; }
.exo + h2, .exo + .box, .exo + .quiz { margin-top: 40px; }
.exo h4 { margin: 0 0 4px; font-size: 18px; font-weight: 650; letter-spacing: -0.02em; }
.lvl { font: 600 11px var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); padding: 3px 9px; border-radius: 999px; margin-left: 10px; vertical-align: 2px; }
details { margin-top: 10px; }
details summary { cursor: pointer; display: inline-flex; align-items: center; gap: 8px; font: 600 14px var(--sans); color: var(--text); list-style: none; padding: 7px 14px; border-radius: 999px; background: var(--glass-2); border: 1px solid var(--line); transition: background .3s var(--ease); }
details summary:hover { background: var(--line-2); }
details summary::-webkit-details-marker { display: none; }
details summary::before { content: "+"; color: var(--accent); font-weight: 700; }
details[open] summary::before { content: "−"; }
details[open] summary { margin-bottom: 12px; }
.quiz { border-radius: 18px; padding: 20px 24px; margin: 32px auto; }
.quiz p { margin: 0; font-weight: 600; }
.quiz p::before { content: "Question"; display: block; font: 600 11px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }

table { border-collapse: collapse; width: 100%; margin: 28px auto; font: 15px/1.5 var(--sans); display: block; overflow-x: auto; }
th, td { border-bottom: 1px solid var(--line); padding: 12px 16px 12px 0; text-align: left; vertical-align: top; }
th { font-weight: 600; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
ul.recap { list-style: none; padding: 0; }
ul.recap li { padding: 10px 0 10px 28px; border-bottom: 1px solid var(--line); position: relative; }
ul.recap li::before { content: ""; position: absolute; left: 4px; top: 19px; width: 10px; height: 10px; border-radius: 50%; background: var(--gradient); }

/* ---------- Boutons ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; gap: 8px; overflow: hidden;
  background: var(--gradient); color: var(--on-accent); font: 600 15px var(--sans); letter-spacing: -0.01em;
  border: 0; padding: 14px 26px; border-radius: 999px; cursor: pointer; text-decoration: none;
  box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 30%, transparent), inset 0 1px 0 rgba(255,255,255,.35);
  transition: transform .4s var(--ease), box-shadow .4s var(--ease);
}
.btn::after { /* reflet brillant qui glisse au survol */
  content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.45) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform .9s var(--ease);
}
.btn:hover { color: var(--on-accent); transform: translateY(-2px); box-shadow: 0 16px 40px color-mix(in srgb, var(--accent) 40%, transparent), inset 0 1px 0 rgba(255,255,255,.35); }
.btn:hover::after { transform: translateX(120%); }
.finish { text-align: center; margin-top: 80px; }
.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 40px; }
.pager a { flex: 1; color: var(--text); font: 600 17px/1.3 var(--sans); letter-spacing: -0.02em; padding: 18px 22px; border-radius: 18px; background: var(--glass); border: 1px solid var(--line); transition: background .4s var(--ease), transform .4s var(--ease); }
.pager a small { display: block; font: 500 11px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin-bottom: 4px; }
.pager a:hover { background: var(--glass-2); transform: translateY(-2px); color: var(--text); }
.pager a.next { text-align: right; }

/* ---------- Accueil ---------- */
.home { max-width: 1100px; margin: 0 auto; padding: 0 24px 140px; }
.home-top { display: flex; justify-content: space-between; align-items: center; padding: 24px 0; border-bottom: 1px solid var(--line); font: 500 13px var(--sans); color: var(--text-3); }
.home-top b { color: var(--text); font: 700 16px var(--sans); letter-spacing: -0.02em; }
.hero { padding: 110px 0 80px; max-width: 820px; }
.hero h1 { font-size: clamp(44px, 7.2vw, 84px); line-height: 1.0; letter-spacing: -0.045em; margin: 22px 0 28px; }
.hero h1 em { font-style: normal; background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
.hero .lead { font-size: 21px; max-width: 640px; margin-bottom: 40px; }
.hero .meta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 36px; font: 13px var(--sans); color: var(--text-3); }
.hero .meta > * { padding: 14px 20px; border-radius: 18px; background: var(--glass); border: 1px solid var(--line); }
.hero .meta b { display: block; color: var(--text); font: 700 22px var(--sans); letter-spacing: -0.02em; }
.section { display: grid; grid-template-columns: 240px 1fr; gap: 48px; padding: 64px 0; border-top: 1px solid var(--line); }
.section > h2 { margin: 6px 0 0; font: 600 12px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); height: fit-content; }
.section p { margin-top: 0; max-width: 660px; }
.cols { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.cols > div { padding: 22px 24px; border-radius: 20px; background: var(--glass); border: 1px solid var(--line); transition: transform .5s var(--ease), background .5s var(--ease); }
.cols > div:hover { transform: translateY(-3px); background: var(--glass-2); }
.cols h3 { margin: 0 0 6px; font-size: 19px; }
.cols p { margin: 0; color: var(--text-2); font-size: 15.5px; }
.part-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.part-list > div { padding: 22px 24px; border-radius: 20px; background: var(--glass); border: 1px solid var(--line); }
.part-list h3 { margin: 0 0 10px; font-size: 18px; }
.part-list ol { list-style: none; padding: 0; margin: 0; font: 15px/1.5 var(--sans); }
.part-list li a { display: flex; gap: 12px; padding: 8px 10px; margin: 0 -10px; border-radius: 10px; color: var(--text-2); transition: background .3s var(--ease), color .3s var(--ease); }
.part-list li a:hover { background: var(--glass-2); color: var(--text); }
.part-list li a .n { color: var(--text-3); font-variant-numeric: tabular-nums; min-width: 22px; }
.part-list li a.done { color: var(--text-3); }

@media (max-width: 960px) {
  .layout { display: block; }
  .sidebar { position: fixed; z-index: 10; left: 0; top: 0; transform: translateX(-100%); transition: transform .5s var(--ease); background: var(--bg-2); }
  .sidebar.open { transform: none; }
  .menu-btn { display: block; position: fixed; z-index: 11; top: 14px; right: 14px; background: var(--glass-2); backdrop-filter: blur(16px); color: var(--text); border: 1px solid var(--line-2); border-radius: 999px; padding: 9px 16px; font: 600 13px var(--sans); }
  main.lesson { padding: 76px 20px 110px; }
  body { font-size: 16.5px; }
  .section { grid-template-columns: 1fr; gap: 18px; }
  .cols, .part-list { grid-template-columns: 1fr; }
  .pager { flex-direction: column; }
  .pager a.next { text-align: left; }
}
@media print {
  .sidebar, .menu-btn, .finish, .pager, pre .copy { display: none !important; }
  main.lesson { padding: 0; }
  details { display: block; } details > * { display: block !important; }
}

/* ===================== Vidéo ===================== */
.vm-launch { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 24px !important; font: 14px var(--sans); color: var(--text-3); }
.vm-stage {
  container-type: inline-size; --u: 1cqw;
  position: relative; aspect-ratio: 16 / 9; width: 100%; max-height: 46vh; overflow: hidden; isolation: isolate;
  color: var(--text); border-radius: 26px; display: flex; flex-direction: column;
  background: linear-gradient(var(--bg), var(--bg)) padding-box, var(--metal) border-box;
  box-shadow: 0 40px 100px rgba(0,0,0,.5);
}
/* Aurore lente en fond : deux halos de couleur qui dérivent. */
.vm-stage::before, .vm-stage::after {
  content: ""; position: absolute; z-index: 0; width: 60%; aspect-ratio: 1; border-radius: 50%; filter: blur(70px); opacity: .35; pointer-events: none;
}
.vm-stage::before { background: var(--accent); left: -15%; top: -40%; animation: aurora 18s var(--ease) infinite alternate; }
.vm-stage::after { background: var(--accent-2); right: -20%; bottom: -50%; animation: aurora 22s var(--ease) infinite alternate-reverse; }
@keyframes aurora { to { transform: translate(18%, 22%) scale(1.15); } }
.vm-stage > * { position: relative; z-index: 1; }
.vm-stage > .vm-glow, .vm-stage > .vm-eq { position: absolute; z-index: 0; pointer-events: none; }
.vm-eq { display: none; }
.vm-glow { left: 50%; top: 55%; width: 55%; aspect-ratio: 1; transform: translate(-50%, -50%) scale(.85); border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent-3) 22%, transparent), transparent 65%); filter: blur(20px); opacity: .6; }
.vm-glow.beat { animation: vm-beat 1s var(--ease); }
@keyframes vm-beat { 0% { transform: translate(-50%, -50%) scale(.95); opacity: .9; } 100% { transform: translate(-50%, -50%) scale(.85); opacity: .6; } }

.vm-bars { display: flex; gap: 6px; padding: 18px 26px 0; }
.vm-bars i { flex: 1; height: 3px; background: rgba(255,255,255,.12); border-radius: 999px; overflow: hidden; }
.vm-bars b { display: block; height: 100%; width: 0; background: var(--gradient); border-radius: 999px; transition: width .6s var(--ease); }
.vm-top { display: flex; align-items: center; gap: 12px; padding: 12px 26px 0; font: 600 11px var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); min-height: 34px; }
.vm-badge { color: var(--text); background: var(--glass-2); padding: 5px 11px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line-2); backdrop-filter: blur(12px); }
.vm-badge[hidden] { display: none; }
.vm-top .vm-section { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vm-screen { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 8px 7%; overflow: hidden; }
.vm-caption { text-align: center; padding: 6px 8% 22px; min-height: 3.4em; font: 600 clamp(13px, calc(1.6 * var(--u)), 21px)/1.4 var(--sans); color: rgba(255,255,255,.92); letter-spacing: -0.01em; }
.vm-caption span { padding: 0 .1em; transition: color .3s var(--ease); }
.vm-caption span.on { color: var(--accent-3); }
.vm-stage.vm-nocc .vm-caption { display: none; }

.vm-bigplay {
  position: absolute !important; z-index: 3 !important; inset: 0; margin: auto; width: 88px; height: 88px; border-radius: 50%;
  border: 1px solid transparent; color: var(--text); font-size: 28px; cursor: pointer; padding-left: 6px;
  background: linear-gradient(color-mix(in srgb, var(--bg-3) 70%, transparent), color-mix(in srgb, var(--bg-3) 70%, transparent)) padding-box, var(--metal) border-box;
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 20px 60px rgba(0,0,0,.5), 0 0 0 10px rgba(255,255,255,.04);
  transition: transform .5s var(--ease); animation: vm-pulse 3s var(--ease) infinite;
}
.vm-bigplay:hover { transform: scale(1.06); }
.vm-bigplay[hidden] { display: none; }
@keyframes vm-pulse { 50% { box-shadow: 0 20px 60px rgba(0,0,0,.5), 0 0 0 18px rgba(255,255,255,.02); } }

/* Mot fort : dégradé de la palette, sans boîte. */
.vm-hl { background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
.vm-title { text-align: center; animation: vm-in .9s var(--ease) both; }
.vm-title > span { display: inline-block; font: 600 clamp(10px, calc(1 * var(--u)), 12px) var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--text-2); }
.vm-title h2 { font: 800 clamp(32px, calc(5.4 * var(--u)), 70px)/1.04 var(--sans); margin: 14px 0 20px; border: 0; padding: 0; letter-spacing: -0.045em; }
.vm-title h2 .vm-hl { animation: none; }
.vm-heading { display: flex; align-items: center; gap: clamp(14px, calc(1.8 * var(--u)), 24px); animation: vm-in .9s .1s var(--ease) both; max-width: 92%; }
.vm-num {
  flex-shrink: 0; width: clamp(44px, 4.8vw, 64px); height: clamp(44px, 4.8vw, 64px); border-radius: 18px;
  display: grid; place-items: center; font: 700 clamp(20px, 2.4vw, 30px) var(--sans); color: var(--text);
  background: linear-gradient(var(--bg-3), var(--bg-3)) padding-box, var(--metal) border-box; border: 1px solid transparent;
  box-shadow: 0 12px 30px rgba(0,0,0,.4); animation: vm-pop .9s var(--ease) both;
}
@keyframes vm-pop { from { transform: scale(.8); opacity: 0; } }
.vm-heading small { display: block; font: 600 clamp(9px, calc(.9 * var(--u)), 11px) var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); margin-bottom: 6px; }
.vm-heading h3 { font: 700 clamp(22px, calc(3.4 * var(--u)), 46px)/1.1 var(--sans); color: var(--text); margin: 0; letter-spacing: -0.035em; }
.vm-screen.vm-section { flex-direction: column; gap: 20px; }
.vm-line { display: block; height: 2px; width: min(320px, 40%); background: var(--gradient); border-radius: 999px; transform-origin: left; animation: vm-line 1.2s .3s var(--ease) both; }
@keyframes vm-line { from { transform: scaleX(0); opacity: 0; } }
.vm-sub { animation: vm-in .9s var(--ease) both; text-align: center; }
.vm-sub h4 { font: 700 clamp(18px, calc(2.6 * var(--u)), 34px)/1.2 var(--sans); color: var(--text); margin: 0; letter-spacing: -0.03em; }
.vm-big { font: 600 clamp(17px, calc(2.2 * var(--u)), 30px)/1.4 var(--sans); color: var(--text); margin: 0; max-width: 28em; text-align: center; letter-spacing: -0.025em; }
.vm-pause .vm-big { color: var(--text-2); }

/* Texte qui se révèle au rythme de la voix */
.vm-kin > span { display: inline-block; opacity: .22; transition: opacity .5s var(--ease), filter .5s var(--ease); filter: blur(1.5px); }
.vm-kin > span.in { opacity: 1; filter: none; }
.vm-kin > span.k { background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }

/* Fenêtres façon application */
.vm-window {
  width: 100%; max-width: 860px; border-radius: 18px; box-shadow: 0 30px 80px rgba(0,0,0,.55);
  overflow: hidden; animation: vm-in .9s var(--ease) both; max-height: 100%; display: flex; flex-direction: column;
}
.vm-bar { display: flex; align-items: center; gap: 7px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.02); }
.vm-bar i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.vm-bar i:nth-child(2) { background: #febc2e; } .vm-bar i:nth-child(3) { background: #28c840; }
.vm-bar span { margin: 0 auto; font: 500 12px var(--sans); color: var(--text-3); transform: translateX(-20px); max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vm-window pre { margin: 0 !important; border: 0 !important; background: transparent !important; box-shadow: none; border-radius: 0; flex: 1; min-height: 0; overflow: auto; font-size: clamp(11px, calc(1.15 * var(--u)), 15px) !important; padding: 16px 20px 20px !important; }
.vm-window pre .copy { display: none; }
.vm-console { color: var(--text) !important; white-space: pre-wrap; font-size: clamp(13px, calc(1.4 * var(--u)), 18px) !important; }
.vm-console::before { content: none !important; }
.vm-table { display: table; width: 100%; font: clamp(11px, calc(1.1 * var(--u)), 14px)/1.4 var(--sans); color: var(--text-2); margin: 0; }
.vm-table th { color: var(--text); padding: 10px 16px; }
.vm-table td { padding: 9px 16px; }
.vm-table tr { transition: background .5s var(--ease), color .5s var(--ease); }
.vm-table tr.vm-row-on td { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--text); }
.vm-nextchap { font-size: 14px; padding: 12px 22px; }
.vm-countdown { font: 500 13px var(--sans); color: var(--text-3); margin: 12px 0 0; min-height: 1.2em; }

/* Code vivant */
.vm-run { border-top: 1px solid var(--line); background: rgba(0,0,0,.25); animation: vm-in .6s var(--ease) both; flex-shrink: 0; }
.vm-run-bar { font: 600 11px var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); padding: 10px 20px 0; }
.vm-run .vm-console { max-height: 9em; padding-top: 6px !important; }
.vm-run .vm-console span { display: block; animation: vm-type .5s var(--ease) both; }
.vm-run .vm-console span::before { content: "› "; color: var(--text-3); }
.vm-run .vm-console span.err { color: #ff6b6b; }
@keyframes vm-type { from { opacity: 0; transform: translateX(-6px); } }

/* Mouvements */
@keyframes vm-in { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
.vm-ghost { position: absolute !important; z-index: 2 !important; display: flex; align-items: center; justify-content: center; padding: 8px 7%; overflow: hidden; pointer-events: none; animation: vm-out .5s var(--ease) forwards; }
@keyframes vm-out { to { opacity: 0; transform: scale(.985); } }
.vm-swap { animation: vm-fade .6s var(--ease) both; }
@keyframes vm-fade { from { opacity: 0; transform: translateY(6px); } }
.vm-cam { animation: vm-cam 16s cubic-bezier(.25,.1,.25,1) both; }
@keyframes vm-cam { from { transform: scale(1); } to { transform: scale(1.02); } }

/* Bande-annonce */
.vm-trailer { position: relative; width: 100%; height: 100%; display: grid; place-items: center; }
.vm-trailer > * { grid-area: 1 / 1; }
.tr-flash { display: grid; }
.tr-flash span { grid-area: 1 / 1; display: block; text-align: center; font: 700 clamp(22px, calc(3.8 * var(--u)), 48px)/1.1 var(--sans); color: var(--text-2); letter-spacing: -0.035em;
  opacity: 0; animation: tr-flash .5s calc(var(--i) * .28s) var(--ease) forwards; }
.tr-flash span:nth-child(odd) { color: var(--text); }
@keyframes tr-flash { 0% { opacity: 0; transform: translateY(14px); filter: blur(6px); } 40%, 60% { opacity: 1; transform: none; filter: none; } 100% { opacity: 0; transform: translateY(-14px); filter: blur(6px); } }
.tr-num { font: 800 calc(34 * var(--u))/1 var(--sans); max-height: 100%; padding-bottom: 0; letter-spacing: -0.07em; opacity: 0;
  animation: tr-num 1.6s 1.3s var(--ease) both; }
/* Le numéro arrive seul, brille un instant, puis s'efface presque entièrement AVANT que le titre se pose :
   aucun texte n'est jamais lu par-dessus un numéro lumineux. */
@keyframes tr-num { 0% { opacity: 0; transform: scale(1.15); filter: blur(10px); } 30% { opacity: 1; transform: scale(1); filter: none; } 50% { opacity: 1; } 85%, 100% { opacity: .05; transform: scale(.97); } }
.tr-title { animation: vm-in 1s 2.45s var(--ease) both; filter: drop-shadow(0 0 22px rgba(0,0,0,.85)); }

/* Résumé de fin */
.vm-recap { text-align: center; max-width: 92%; animation: vm-in .9s var(--ease) both; }
.vm-recap > span { font: 600 clamp(10px, calc(1 * var(--u)), 12px) var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--text-2); }
.vm-recap h2 { font: 800 clamp(22px, calc(3.4 * var(--u)), 44px)/1.08 var(--sans); margin: 8px 0 16px; border: 0; padding: 0; letter-spacing: -0.04em; }
.vm-recap ol { list-style: none; margin: 0 auto 16px; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 780px; }
.vm-recap li { display: flex; align-items: center; gap: 8px; margin: 0; padding: 6px 14px 6px 6px; border-radius: 999px; background: var(--glass-2); box-shadow: inset 0 0 0 1px var(--line-2);
  font: 500 clamp(11px, 1.1vw, 14px) var(--sans); color: var(--text); backdrop-filter: blur(12px); animation: vm-in .7s calc(.4s + var(--i) * .12s) var(--ease) both; }
.vm-recap li b { width: 22px; height: 22px; border-radius: 50%; background: var(--gradient); color: var(--on-accent); display: grid; place-items: center; font-size: 11px; }

/* Barre de contrôle : une pilule de verre */
.vm-controls { display: flex; align-items: center; gap: 6px; margin-top: 12px; padding: 6px; font: 13px var(--sans); border-radius: 999px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(20px); }
.vm-controls button, .vm-controls select {
  background: transparent; color: var(--text); border: 0; border-radius: 999px; height: 36px; min-width: 36px; padding: 0 10px;
  font: 600 13px var(--sans); cursor: pointer; transition: background .3s var(--ease), opacity .3s var(--ease);
}
.vm-controls button:hover, .vm-controls select:hover { background: var(--glass-2); }
.vm-controls select { appearance: none; -webkit-appearance: none; padding: 0 12px; }
.vm-controls select option { background: var(--bg-2); }
.vm-controls .vm-play { background: var(--gradient); color: var(--on-accent); min-width: 44px; box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 35%, transparent); }
.vm-controls .vm-play:hover { background: var(--gradient); filter: brightness(1.1); }
.vm-controls .vm-music[aria-pressed="false"], .vm-controls .vm-cc[aria-pressed="false"] { opacity: .4; }
.vm-progress { flex: 1; height: 5px; background: var(--glass-2); border-radius: 999px; cursor: pointer; min-width: 60px; margin: 0 6px; }
.vm-progress i { display: block; height: 100%; width: 0; background: var(--gradient); border-radius: 999px; transition: width .6s var(--ease); }
.vm-count { color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; padding: 0 4px; }

/* Passage en cours dans le texte */
.vm-current { background: color-mix(in srgb, var(--accent) 12%, transparent); border-radius: 10px; box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent) 12%, transparent); transition: background .5s var(--ease); }
pre.vm-current { box-shadow: 0 0 0 2px var(--accent), 0 20px 50px rgba(0,0,0,.35); }
body.vm-on main.lesson p, body.vm-on main.lesson li, body.vm-on main.lesson h2, body.vm-on main.lesson h3, body.vm-on main.lesson pre { cursor: pointer; }

/* Mise en page quand la vidéo est ouverte */
body.vm-on .sidebar, body.vm-on .menu-btn { display: none; }
body.vm-on .layout { display: block; }
body.vm-on main.lesson { padding-top: 0; }
body.vm-on .vm-player { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(20px); max-width: 1000px; padding: 16px 0 14px; margin-bottom: 28px; }
@media (min-width: 1280px) {
  body.vm-on main.lesson { padding: 48px 40px 120px calc(100vw - 600px); }
  body.vm-on main.lesson > * { max-width: 560px; margin-left: 0; }
  body.vm-on .vm-player { position: fixed; left: 32px; top: 50%; transform: translateY(-50%); width: calc(100vw - 600px - 96px); max-width: none; padding: 0; margin: 0; background: transparent; backdrop-filter: none; }
  body.vm-on .vm-stage { max-height: 72vh; }
}
@media (max-width: 700px) {
  .vm-controls { flex-wrap: wrap; border-radius: 22px; }
  .vm-progress { order: 10; flex-basis: 100%; }
}

/* ---------- Schémas : verre, fines lignes, un seul élément actif en dégradé ---------- */
.vm-split { display: grid; grid-template-columns: 1.2fr 1fr; align-items: center; gap: 6%; width: 100%; }
.vm-split .vm-big { text-align: left; font-size: clamp(15px, calc(1.9 * var(--u)), 26px); }
.vm-schema { display: flex; flex-direction: column; align-items: center; gap: 14px; font: 500 clamp(11px, calc(1.05 * var(--u)), 14px) var(--sans); color: var(--text-2); animation: vm-in 1s .15s var(--ease) both; }
.vm-schema.still { animation: none; }
.vm-schema small { color: var(--text-3); font: 500 clamp(10px, calc(.95 * var(--u)), 12px) var(--mono); }
/* Pièce de base : carte de verre au contour fin */
.sc-box, .sc-cell b, .sc-diamond, .sc-fork span, .sc-chip, .sc-btn, .sc-machine, .sc-drawer, .sc-card, .sc-node, .sc-task, .sc-code span, .sc-tests span, .sc-label {
  background: var(--glass); box-shadow: inset 0 0 0 1px var(--line-2); border: 0; border-radius: 14px; color: var(--text);
  transition: background .6s var(--ease), color .6s var(--ease), box-shadow .6s var(--ease), transform .6s var(--ease), opacity .6s var(--ease);
}
/* Élément actif : dégradé de la palette et halo doux */
.sc-cell.on b, .sc-fork span.on, .sc-chip.y, .sc-machine.y, .sc-node.on, .sc-task.on, .sc-btn {
  background: var(--gradient); color: var(--on-accent); box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 35%, transparent);
}
.sc-pop { animation: vm-pop .8s var(--ease); }
.sc-label { padding: 4px 12px; border-radius: 999px; font-family: var(--mono); color: var(--text-2); }
.sc-box { width: 7.5em; height: 5em; display: grid; place-items: center; border-radius: 20px; box-shadow: inset 0 0 0 1px var(--line-2), 0 20px 50px rgba(0,0,0,.35); }
.sc-box b, .sc-ring b { font: 700 clamp(20px, calc(2.6 * var(--u)), 34px) var(--sans); letter-spacing: -0.03em; display: inline-block; background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
.sc-row { display: flex; gap: 8px; }
.sc-cell { width: 3.2em; text-align: center; }
.sc-cell b { display: block; padding: .75em 0; font-weight: 600; }
.sc-cell small { display: block; margin-top: 6px; }
.sc-cell.on b { transform: translateY(-6px); }
.sc-ring { position: relative; width: 8em; height: 8em; display: grid; place-items: center; }
.sc-ring svg { position: absolute; inset: 0; animation: sc-rot 2.4s linear infinite; }
.sc-ring circle { fill: none; stroke: var(--line-2); stroke-width: 3; }
.sc-ring path { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; filter: drop-shadow(0 0 6px var(--accent)); }
@keyframes sc-rot { to { transform: rotate(360deg); } }
.sc-dots { display: flex; gap: 7px; }
.sc-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); transition: background .6s var(--ease); }
.sc-dots i.on { background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.sc-diamond { width: 4.4em; height: 4.4em; transform: rotate(45deg); display: grid; place-items: center; border-radius: 16px; }
.sc-diamond b { transform: rotate(-45deg); font: 700 24px var(--sans); color: var(--accent-3); }
.sc-fork { display: flex; gap: 2.5em; }
.sc-fork span { padding: 7px 16px; border-radius: 999px; opacity: .55; }
.sc-fork span.on { opacity: 1; }
.sc-flow { display: flex; align-items: center; gap: 10px; }
.sc-chip, .sc-btn { padding: 8px 16px; border-radius: 999px; white-space: nowrap; }
.sc-machine, .sc-drawer { padding: 1em 1.3em; border-radius: 16px; font-family: var(--mono); }
.sc-drawer { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 50%, transparent); }
.sc-arrow { position: relative; width: 2.8em; height: 1px; background: var(--line-2); overflow: visible; }
.sc-arrow::after { content: ""; position: absolute; top: -3px; left: 0; width: 7px; height: 7px; border-radius: 50%; background: var(--accent-3); box-shadow: 0 0 10px var(--accent-3); animation: sc-go 1.6s var(--ease) infinite; }
.sc-both::after { animation-direction: alternate; }
@keyframes sc-go { from { left: 0; opacity: 0; } 20%, 80% { opacity: 1; } to { left: calc(100% - 7px); opacity: 0; } }
.sc-btn { position: relative; overflow: hidden; }
.sc-ripple { position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px; border-radius: 50%; background: rgba(255,255,255,.6); animation: sc-ripple 1.8s var(--ease) infinite; }
@keyframes sc-ripple { to { transform: scale(10); opacity: 0; } }
.sc-card { font: 500 clamp(12px, calc(1.25 * var(--u)), 15px)/1.8 var(--mono); color: var(--text-2); text-align: left; padding: 14px 20px; border-radius: 18px; }
.sc-card > b { color: var(--text-3); font-weight: 500; }
.sc-kv { padding-left: 1.2em; opacity: .2; transition: opacity .6s var(--ease); } .sc-kv.in { opacity: 1; }
.sc-kv em { font-style: normal; color: var(--accent-3); }
.sc-tree { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; font-family: var(--mono); }
.sc-node { padding: 4px 12px; border-radius: 10px; }
.sc-node.d1 { margin-left: 1.4em; } .sc-node.d2 { margin-left: 2.8em; } .sc-node.d3 { margin-left: 4.2em; } .sc-node.d4 { margin-left: 5.6em; }
.sc-lanes { display: flex; flex-direction: column; gap: 12px; }
.sc-lanes > div { display: flex; align-items: center; gap: 8px; }
.sc-lanes em { font-style: normal; width: 7em; color: var(--text-3); font-size: .9em; }
.sc-task { padding: 7px 14px; border-radius: 12px; }
.sc-task.wait:not(.on) { animation: sc-blink 2s var(--ease) infinite; }
@keyframes sc-blink { 50% { opacity: .4; } }
.sc-wire { position: relative; width: 5em; height: 1px; background: var(--line-2); }
.sc-wire i { position: absolute; top: -4px; left: 0; width: 9px; height: 9px; border-radius: 50%; background: var(--accent-3); box-shadow: 0 0 14px var(--accent-3); animation: sc-go2 1.6s var(--ease) infinite; }
.sc-wire i.back { animation-direction: reverse; }
@keyframes sc-go2 { from { left: 0; } to { left: calc(100% - 9px); } }
.sc-git { display: flex; align-items: center; }
.sc-git i { width: 14px; height: 14px; border-radius: 50%; background: var(--bg-3); box-shadow: inset 0 0 0 1px var(--line-2); transition: all .6s var(--ease); }
.sc-git i + i { margin-left: 26px; position: relative; }
.sc-git i + i::before { content: ""; position: absolute; right: 100%; top: 6px; width: 26px; height: 1px; background: var(--line-2); }
.sc-git i.on { background: var(--gradient); box-shadow: 0 0 16px var(--accent); animation: vm-pop .8s var(--ease); }
.sc-code { display: flex; flex-direction: column; gap: 6px; font: 500 clamp(11px, calc(1.15 * var(--u)), 14px) var(--mono); text-align: left; }
.sc-code span { padding: 6px 12px; border-radius: 10px; color: var(--text-2); }
.sc-code .bad { background: rgba(255,95,87,.1); box-shadow: inset 0 0 0 1px rgba(255,95,87,.4); color: var(--text); }
.sc-code em { font-style: normal; margin-left: 10px; color: #ff6b6b; font-weight: 600; }
.sc-tests { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.sc-tests span { display: flex; align-items: center; gap: 10px; padding: 7px 14px; border-radius: 12px; color: var(--text-2); }
.sc-tests i { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--line-2); transition: all .6s var(--ease); }
.sc-tests .ok { color: var(--text); }
.sc-tests .ok i { background: #30d158; box-shadow: 0 0 10px #30d158; }
@media (prefers-reduced-motion: reduce) { .vm-stage *, .vm-stage::before, .vm-stage::after { animation: none !important; transition: none !important; } }
@media print { .vm-launch, .vm-player, .palette-picker { display: none !important; } }

/* ---------- Sélecteur de finition ---------- */
.palette-picker { position: relative; z-index: 50; font: 500 13px var(--sans); }
.home-top > span { margin-left: auto; margin-right: 16px; }
.home-top .palette-toggle b { white-space: nowrap; }
@media (max-width: 600px) { .home-top > span { display: none; } .home-top .palette-picker { margin-left: auto; } }
/* Chapitres : petit rond en haut à droite du cours, sur la ligne du « Chapitre … », sans prendre de place. */
main.lesson > .palette-picker.compact { z-index: 5; display: flex;   /* sous la vidéo fixée en haut (z 20) : ne passe jamais devant */
   justify-content: flex-end; align-items: flex-start; height: 0; overflow: visible; }
.palette-picker.compact .palette-toggle { padding: 5px; margin-top: 4px; }
.palette-picker.compact .palette-toggle span { display: none; }
.palette-picker.compact .palette-toggle i { width: 30px; height: 30px; }
.palette-toggle {
  display: flex; align-items: center; gap: 10px; padding: 6px 16px 6px 6px; border-radius: 999px; cursor: pointer; color: var(--text);
  border: 1px solid transparent; font: inherit; text-align: left;
  background: linear-gradient(color-mix(in srgb, var(--bg-2) 72%, transparent), color-mix(in srgb, var(--bg-2) 72%, transparent)) padding-box, var(--metal) border-box;
  -webkit-backdrop-filter: blur(20px) saturate(1.6); backdrop-filter: blur(20px) saturate(1.6);
  box-shadow: 0 12px 34px rgba(0,0,0,.45); transition: transform .5s var(--ease), box-shadow .5s var(--ease);
}
.palette-toggle:hover { transform: translateY(-2px); box-shadow: 0 18px 44px rgba(0,0,0,.55); }
.palette-toggle span { display: grid; line-height: 1.15; }
.palette-toggle small { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.palette-toggle b { font-weight: 600; font-size: 13px; }
.palette-picker i { width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  box-shadow: inset 0 -3px 6px rgba(0,0,0,.45), inset 0 1px 1px rgba(255,255,255,.5), 0 2px 6px rgba(0,0,0,.5); }
.palette-list {
  position: absolute; right: 0; top: calc(100% + 10px); min-width: 250px; padding: 10px; border-radius: 24px; display: grid; gap: 2px;
  background: linear-gradient(color-mix(in srgb, var(--bg-2) 80%, transparent), color-mix(in srgb, var(--bg-2) 80%, transparent)) padding-box, var(--metal) border-box;
  -webkit-backdrop-filter: blur(24px) saturate(1.6); backdrop-filter: blur(24px) saturate(1.6);
  box-shadow: 0 30px 80px rgba(0,0,0,.55); transform-origin: top right; animation: vm-in .5s var(--ease) both;
}
.palette-list h5 { margin: 4px 12px 8px; font: 600 11px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.palette-list[hidden] { display: none; }
.palette-list button { display: flex; align-items: center; gap: 12px; padding: 8px 12px 8px 8px; border: 0; border-radius: 16px; background: transparent; color: var(--text-2); font: inherit; cursor: pointer; text-align: left; transition: background .3s var(--ease), color .3s var(--ease); }
.palette-list button:hover { background: var(--glass-2); color: var(--text); }
.palette-list button[aria-checked="true"] { background: var(--glass-2); color: var(--text); font-weight: 600; }
.palette-list button[aria-checked="true"]::after { content: "✓"; margin-left: auto; color: var(--accent); font-weight: 700; }
.palette-list i { width: 26px; height: 26px; }
.vm-controls button { display: inline-grid; place-items: center; }
.vm-bigplay { display: grid; place-items: center; padding-left: 4px !important; }
.vm-bigplay svg { width: 30px; height: 30px; }
.btn svg { width: 16px; height: 16px; }

/* Plein écran : la vidéo occupe tout l'espace disponible au-dessus des commandes. */
.vm-player:fullscreen, .vm-player:-webkit-full-screen { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 0; padding: 24px; background: var(--bg); width: calc(100 * var(--u)); height: 100vh; max-width: none; transform: none; }
.vm-player:fullscreen .vm-stage, .vm-player:-webkit-full-screen .vm-stage { max-height: none; width: min(100%, calc((100vh - 110px) * 16 / 9)); }
.vm-player:fullscreen .vm-controls, .vm-player:-webkit-full-screen .vm-controls { width: min(100%, calc((100vh - 110px) * 16 / 9)); }
.vm-player:fullscreen .vm-caption { font-size: clamp(16px, calc(1.8 * var(--u)), 30px); }
body.vm-on .vm-player:fullscreen { position: fixed; inset: 0; top: 0; left: 0; margin: 0; padding: 24px; transform: none; width: 100vw; height: 100vh; background: var(--bg); }

/* Code expliqué ligne par ligne : une bande éclaire les lignes dont parle la voix. */
.vm-window pre { position: relative; }
.vm-window pre code { position: relative; z-index: 1; }
.vm-focus { position: absolute; left: 0; right: 0; z-index: 0; opacity: 0; pointer-events: none;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 22%, transparent), color-mix(in srgb, var(--accent) 6%, transparent));
  box-shadow: inset 2px 0 0 var(--accent); transition: top .6s var(--ease), height .6s var(--ease), opacity .6s var(--ease); }

/* Marque FormAll */
.formall { display: inline-flex; align-items: center; gap: 10px; font: 500 20px/1 "Lexend", var(--sans); font-style: normal; letter-spacing: -.01em; color: var(--text); }
.formall img, .formall svg { width: 28px; height: auto; filter: drop-shadow(0 0 10px color-mix(in srgb, var(--accent) 45%, transparent)); }
.formall em { font-style: normal; background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
.sidebar .brand .formall { display: flex; margin-bottom: 16px; font-size: 19px; }
.sidebar .brand .formall span { display: inline; background: none; padding: 0; margin: 0; font: inherit; letter-spacing: inherit; text-transform: none; color: var(--text); }
.home-top b.formall { font: 500 22px/1 "Lexend", var(--sans); }

/* Effet carte qui flotte et penche sous le doigt (assets/app.js) : grand titre et logos. */
.flotte { transition: none; transform: perspective(var(--persp, 900px)) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--ty, 0px));
  transform-origin: 50% 50%; will-change: transform; }
/* Logo en relief : le F se détache en avant du texte et son épaisseur suit l'inclinaison. */
.formall.flotte { --persp: 600px; transform-style: preserve-3d; }
.formall.flotte svg { transform: translateZ(5px);
  filter: drop-shadow(var(--sx, 0px) var(--sy, 1px) 0 color-mix(in srgb, var(--accent-2) 55%, #000))
          drop-shadow(var(--sx, 0px) var(--sy, 1px) 0 color-mix(in srgb, var(--accent-2) 40%, #000))
          drop-shadow(var(--sx, 0px) var(--sy, 1px) 0 color-mix(in srgb, var(--accent-2) 25%, #000))
          drop-shadow(0 6px 14px color-mix(in srgb, var(--accent) 45%, transparent)); }
.formall.flotte span { transform: translateZ(2px); text-shadow: 0 1px 0 rgba(0,0,0,.6), 0 4px 12px rgba(0,0,0,.5); }


/* ===================== Refonte vidéo : schémas plein écran, mots qui frappent, style TikTok ===================== */
.vm-screen { padding: calc(1 * var(--u)) calc(4 * var(--u)); }
/* Mise en page « show » : le schéma occupe presque toute la scène, le mot-clé claque au-dessus. */
.vm-show { position: relative; width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(1.2 * var(--u)); }
.vm-punch { min-height: calc(7.4 * var(--u)); display: grid; place-items: center; text-align: center; }
.vm-punch b { display: inline-block; font: 900 calc(6.2 * var(--u))/1 var(--sans); letter-spacing: -0.05em; max-width: calc(88 * var(--u)); overflow-wrap: anywhere;
  background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 calc(.5 * var(--u)) calc(1.6 * var(--u)) color-mix(in srgb, var(--accent) 45%, transparent)); }
.vm-punch b.hit { animation: vm-hit .55s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes vm-hit { 0% { transform: scale(2.6) rotate(-4deg); opacity: 0; filter: blur(6px); } 55% { transform: scale(.92) rotate(1deg); opacity: 1; filter: none; } 100% { transform: scale(1) rotate(0); } }
.vm-show .vm-schema { flex: 1; width: 100%; min-height: 0; justify-content: center; gap: calc(1.6 * var(--u)); font: 500 calc(1.7 * var(--u)) var(--sans); color: var(--text-2); }
.vm-show-idee .vm-punch { position: absolute; inset: 0; z-index: 2; }
.vm-show-idee .vm-punch b { font-size: calc(7.4 * var(--u)); }
.vm-screen.vm-cam:has(.vm-show) { animation: none; }

/* Sous-titres façon TikTok : 2 à 4 mots, très gros, le mot prononcé s'allume. */
.vm-caption { min-height: calc(6.2 * var(--u)); padding: 0 calc(6 * var(--u)) calc(2.2 * var(--u)); display: grid; place-items: center; font: 800 calc(2.9 * var(--u))/1.15 var(--sans); letter-spacing: -0.02em; }
.vm-cc-g { display: inline-block; animation: vm-cc-in .22s var(--ease) both; text-shadow: 0 calc(.25 * var(--u)) calc(.9 * var(--u)) rgba(0,0,0,.75); }
.vm-cc-g span { display: inline-block; padding: 0 .08em; transition: transform .15s var(--ease), color .15s; }
.vm-cc-g span.on { color: var(--accent-3); transform: scale(1.1) translateY(-.15em); }
@keyframes vm-cc-in { from { opacity: 0; transform: translateY(calc(.6 * var(--u))) scale(.94); } }
.vm-player:fullscreen .vm-caption { font-size: calc(2.9 * var(--u)); }

/* Titres : entrée qui frappe */
.vm-heading h3 { font-size: calc(4.6 * var(--u)); }
.vm-heading { animation: vm-hit .7s cubic-bezier(.2, 1.4, .4, 1) both; }
.vm-big { font-size: calc(2.6 * var(--u)); max-width: calc(80 * var(--u)); }

/* Souris animée */
.vm-mouse { position: absolute !important; left: 0; top: 0; z-index: 6 !important; width: calc(2.6 * var(--u)); height: calc(2.6 * var(--u)); opacity: 0; pointer-events: none;
  transition: transform .75s cubic-bezier(.45, 0, .2, 1), opacity .3s; filter: drop-shadow(0 calc(.3 * var(--u)) calc(.6 * var(--u)) rgba(0,0,0,.6)); }
.vm-mouse.on { opacity: 1; }
.vm-mouse svg { width: 100%; height: 100%; fill: #fff; stroke: #111; stroke-width: 1.2; stroke-linejoin: round; }
.vm-mouse::after { content: ""; position: absolute; left: 0; top: 0; width: calc(2.4 * var(--u)); height: calc(2.4 * var(--u)); margin: calc(-1.2 * var(--u)); border-radius: 50%; border: calc(.25 * var(--u)) solid var(--accent-3); opacity: 0; }
.vm-mouse.click svg { animation: vm-press .25s var(--ease); }
.vm-mouse.click::after { animation: vm-ring .6s var(--ease); }
@keyframes vm-press { 50% { transform: scale(.8); } }
@keyframes vm-ring { from { opacity: 1; transform: scale(.3); } to { opacity: 0; transform: scale(2.2); } }

/* Éditeur : bouton Exécuter et curseur de frappe */
.vm-bar { position: relative; }
.vm-runbtn { margin-left: auto; font: 700 calc(1.05 * var(--u)) var(--sans); padding: calc(.35 * var(--u)) calc(.9 * var(--u)); border-radius: 999px; color: var(--on-accent); background: var(--gradient); transition: transform .15s var(--ease);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 30%, transparent), inset 0 1px 0 rgba(255,255,255,.35); }
.vm-runbtn.presse { transform: scale(.9); }
.vm-caret { display: inline-block; width: .55ch; height: 1.15em; margin-left: 1px; vertical-align: text-bottom; background: var(--accent-3); animation: vm-caret 1s steps(1) infinite; box-shadow: 0 0 calc(.6 * var(--u)) var(--accent-3); }
@keyframes vm-caret { 50% { opacity: 0; } }

/* ---------- Schémas (préfixe sx) ---------- */
.vm-show { --sx-fond: color-mix(in srgb, var(--text) 9%, transparent); --sx-fond-2: color-mix(in srgb, var(--text) 22%, transparent);
  --sx-trait: color-mix(in srgb, var(--text) 32%, transparent); }
.vm-show .vm-schema { color: var(--text); }
.vm-schema small { font-size: calc(1.2 * var(--u)); }
.sx-ligne { font: 600 calc(1.9 * var(--u)) var(--mono); color: var(--text-2); padding: calc(.6 * var(--u)) calc(1.6 * var(--u)); border-radius: 999px; background: var(--sx-fond); box-shadow: inset 0 0 0 1px var(--sx-trait); }
.sx-ligne em, .sx-tag em { font-style: normal; color: var(--accent-2); }
.sx-ligne b { color: var(--accent-3); font-weight: 700; }
.sx-drop { display: inline-block; animation: sx-drop .7s cubic-bezier(.2, 1.5, .4, 1) both; }
@keyframes sx-drop { from { transform: translateY(calc(-5 * var(--u))) scale(1.4); opacity: 0; } }

/* Variable */
.sx-mem { display: flex; gap: calc(2 * var(--u)); align-items: flex-end; }
.sx-slot { display: flex; flex-direction: column; align-items: center; gap: calc(.8 * var(--u)); opacity: .45; transform: scale(.86); transition: all .6s var(--ease); }
.sx-slot.on { opacity: 1; transform: scale(1.12); }
.sx-tag { font: 600 calc(1.3 * var(--u)) var(--mono); color: var(--text-2); padding: calc(.3 * var(--u)) calc(.9 * var(--u)); border-radius: 999px; background: var(--sx-fond-2); }
.sx-boite { width: calc(13 * var(--u)); height: calc(9 * var(--u)); display: grid; place-items: center; border-radius: calc(1.6 * var(--u)); background: var(--sx-fond); box-shadow: inset 0 0 0 1px var(--sx-trait), 0 calc(1.6 * var(--u)) calc(3 * var(--u)) rgba(0,0,0,.35); }
.sx-slot.on .sx-boite { box-shadow: inset 0 0 0 calc(.2 * var(--u)) var(--accent), 0 0 calc(4 * var(--u)) color-mix(in srgb, var(--accent) 40%, transparent); }
.sx-boite b { font: 800 calc(2.8 * var(--u)) var(--mono); color: var(--text); }
.sx-slot.on .sx-boite b { background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }

/* Tableau : graphique en barres */
.sx-chart { display: flex; align-items: flex-end; gap: calc(1.6 * var(--u)); height: calc(22 * var(--u)); margin-bottom: calc(3.2 * var(--u)); padding: 0 calc(2 * var(--u)); border-bottom: 1px solid var(--sx-trait);
  background: repeating-linear-gradient(to top, transparent 0 calc(5.4 * var(--u)), var(--line) calc(5.4 * var(--u)) calc(calc(5.4 * var(--u)) + 1px)); }
.sx-col { width: calc(7 * var(--u)); height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: calc(.5 * var(--u)); }
.sx-col i { width: 100%; height: calc(var(--h) * 82%); border-radius: calc(1 * var(--u)) calc(1 * var(--u)) calc(.3 * var(--u)) calc(.3 * var(--u)); background: var(--sx-fond-2); box-shadow: inset 0 0 0 1px var(--sx-trait); transition: all .6s var(--ease); animation: sx-grow .9s var(--ease) both; transform-origin: bottom; }
.sx-col.on i { background: var(--gradient); box-shadow: 0 0 calc(3 * var(--u)) color-mix(in srgb, var(--accent) 50%, transparent); }
@keyframes sx-grow { from { transform: scaleY(0); } }
.sx-val { font: 700 calc(1.3 * var(--u)) var(--mono); color: var(--text-2); transition: color .6s; }
.sx-col.on .sx-val { color: var(--accent-3); transform: scale(1.2); }
.sx-col small { position: relative; top: calc(2.6 * var(--u)); font: 600 calc(1.3 * var(--u)) var(--mono) !important; color: var(--text-2); }

/* Boucle */
.sx-loop { position: relative; width: calc(22 * var(--u)); height: calc(22 * var(--u)); display: grid; place-items: center; }
.sx-loop svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.sx-loop circle { fill: none; stroke-width: 7; }
.sx-loop .fond { stroke: var(--sx-trait); }
.sx-loop .arc { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 314.16; stroke-dashoffset: calc(314.16 * (1 - var(--p))); transition: stroke-dashoffset .8s var(--ease); filter: drop-shadow(0 0 4px var(--accent)); }
.sx-centre { display: flex; flex-direction: column; align-items: center; }
.sx-centre b { font: 900 calc(7 * var(--u))/1 var(--sans); background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
.sx-centre small { font: 600 calc(1.2 * var(--u)) var(--sans) !important; color: var(--text-2); text-transform: uppercase; letter-spacing: .12em; }
.sx-orbite { position: absolute; inset: 0; animation: sc-rot 3s linear infinite; }
.sx-orbite::before { content: ""; position: absolute; left: 50%; top: calc(-.6 * var(--u)); width: calc(1.4 * var(--u)); height: calc(1.4 * var(--u)); margin-left: calc(-.7 * var(--u)); border-radius: 50%; background: var(--accent-3); box-shadow: 0 0 calc(2 * var(--u)) var(--accent-3); }
.sx-tours { display: flex; gap: calc(1 * var(--u)); }
.sx-tours span { width: calc(3.4 * var(--u)); height: calc(3.4 * var(--u)); display: grid; place-items: center; border-radius: 50%; font: 700 calc(1.4 * var(--u)) var(--sans); background: var(--sx-fond); box-shadow: inset 0 0 0 1px var(--sx-trait); transition: all .5s var(--ease); }
.sx-tours span.on { background: var(--gradient); color: var(--on-accent); }

/* Organigrammes SVG (condition, DOM, git) */
.sx-flow, .sx-arbre, .sx-git { width: min(calc(78 * var(--u)), 100%); height: 100%; max-height: calc(34 * var(--u)); overflow: visible; }
.vm-schema svg text { font: 600 11px var(--sans); fill: var(--text); text-anchor: middle; }
.vm-schema svg .q { font: 800 20px var(--sans); fill: var(--accent-3); }
.sx-lien { fill: none; stroke: var(--sx-trait); stroke-width: 2.5; transition: stroke .6s; }
.sx-lien.on { stroke: var(--accent); stroke-width: 3.5; filter: drop-shadow(0 0 4px var(--accent)); stroke-dasharray: 8 6; animation: sx-flux 1s linear infinite; }
@keyframes sx-flux { to { stroke-dashoffset: -28; } }
.sx-pill, .sx-res, .sx-noeud rect { fill: color-mix(in srgb, var(--bg-3) 80%, transparent); stroke: var(--sx-trait); transition: all .6s var(--ease); }
.sx-losange { fill: var(--bg-3); stroke: var(--accent-3); stroke-width: 2; }
.sx-res.on, .sx-noeud.on rect { fill: var(--accent); stroke: var(--accent-3); filter: drop-shadow(0 0 8px var(--accent)); }
.sx-noeud.on text { fill: var(--on-accent); }
.sx-bille { fill: var(--accent-3); filter: drop-shadow(0 0 6px var(--accent-3)); }
.sx-git .sx-lien.f { stroke: color-mix(in srgb, var(--accent-2) 60%, transparent); }
.sx-commit { fill: var(--bg-3); stroke: var(--sx-trait); stroke-width: 2; opacity: .25; transition: all .5s var(--ease); }
.sx-commit.in { opacity: 1; fill: var(--accent-2); stroke: var(--accent-3); }
.sx-commit.on { fill: var(--accent-3); filter: drop-shadow(0 0 8px var(--accent-3)); }
.sx-git text { fill: var(--text-2) !important; text-anchor: start !important; font-family: var(--mono) !important; }

/* Fonction : machine à engrenage */
.sx-machine { display: flex; align-items: center; gap: calc(2.4 * var(--u)); }
.sx-chip { font: 700 calc(2 * var(--u)) var(--mono); padding: calc(1 * var(--u)) calc(1.8 * var(--u)); border-radius: 999px; background: var(--sx-fond-2); box-shadow: inset 0 0 0 1px var(--sx-trait); color: var(--text); }
.sx-chip.in { animation: sx-in-l .8s var(--ease) both; }
.sx-chip.out { background: var(--gradient); color: var(--on-accent); animation: sx-in-r .8s .7s var(--ease) both; box-shadow: 0 0 calc(3 * var(--u)) color-mix(in srgb, var(--accent) 45%, transparent); }
@keyframes sx-in-l { from { transform: translateX(calc(-8 * var(--u))); opacity: 0; } }
@keyframes sx-in-r { from { transform: translateX(calc(-6 * var(--u))) scale(.6); opacity: 0; } }
.sx-usine { position: relative; width: calc(22 * var(--u)); height: calc(15 * var(--u)); display: grid; place-items: center; border-radius: calc(2 * var(--u)); background: var(--sx-fond); box-shadow: inset 0 0 0 1px var(--sx-trait), 0 calc(2 * var(--u)) calc(4 * var(--u)) rgba(0,0,0,.35); }
.sx-usine b { position: relative; font: 700 calc(2 * var(--u)) var(--mono); color: var(--text); }
.sx-engrenage { position: absolute; width: calc(11 * var(--u)); height: calc(11 * var(--u)); opacity: .22; animation: sc-rot 4s linear infinite; }
.sx-engrenage path, .sx-engrenage circle { fill: none; stroke: var(--accent-3); stroke-width: 3; }

/* Objet : fiche */
.sx-fiche { font: 500 calc(2 * var(--u))/1.4 var(--mono); padding: calc(1.8 * var(--u)) calc(2.6 * var(--u)); border-radius: calc(2 * var(--u)); background: var(--sx-fond); box-shadow: inset 0 0 0 1px var(--sx-trait), 0 calc(2 * var(--u)) calc(4 * var(--u)) rgba(0,0,0,.35); min-width: calc(44 * var(--u)); }
.sx-fiche-tete { color: var(--text-2); } .sx-fiche-tete b { color: var(--text); }
.sx-prop { display: flex; align-items: center; gap: calc(1.2 * var(--u)); padding: calc(.4 * var(--u)) 0 calc(.4 * var(--u)) calc(2.4 * var(--u)); opacity: .15; transition: all .6s var(--ease); }
.sx-prop.in { opacity: 1; }
.sx-prop.last { animation: sx-in-l .6s var(--ease) both; }
.sx-prop em { font-style: normal; color: var(--accent-3); }
.sx-prop i { flex: 0 0 calc(4 * var(--u)); height: 2px; background: linear-gradient(90deg, var(--accent-3), transparent); }
.sx-prop span { color: var(--text); }

/* Événement : bouton, onde, souris */
.sx-event { position: relative; display: flex; align-items: center; gap: calc(3 * var(--u)); }
.sx-bouton { position: relative; overflow: hidden; font: 800 calc(2.6 * var(--u)) var(--sans); padding: calc(1.6 * var(--u)) calc(3 * var(--u)); border-radius: 999px; background: var(--gradient); color: var(--on-accent); box-shadow: 0 calc(1.4 * var(--u)) calc(4 * var(--u)) color-mix(in srgb, var(--accent) 45%, transparent); animation: sx-press 2.2s .9s var(--ease) infinite; }
.sx-bouton b { display: inline-block; margin-left: .4em; }
.sx-onde { position: absolute; left: 60%; top: 60%; width: calc(1 * var(--u)); height: calc(1 * var(--u)); border-radius: 50%; background: rgba(255,255,255,.7); animation: sx-onde 2.2s .9s var(--ease) infinite; opacity: 0; }
@keyframes sx-onde { 0% { transform: scale(0); opacity: .9; } 40%, 100% { transform: scale(30); opacity: 0; } }
@keyframes sx-press { 0%, 100% { transform: scale(1); } 4% { transform: scale(.93); } 12% { transform: scale(1.04); } }
.sx-souris { position: absolute; left: calc(9 * var(--u)); top: calc(9 * var(--u)); width: calc(3 * var(--u)); height: calc(3 * var(--u)); fill: #fff; stroke: #111; stroke-width: 1.2; filter: drop-shadow(0 calc(.3 * var(--u)) calc(.6 * var(--u)) rgba(0,0,0,.6)); animation: sx-vise 2.2s var(--ease) infinite; }
@keyframes sx-vise { 0% { transform: translate(calc(-6 * var(--u)), calc(6 * var(--u))); opacity: 0; } 25% { opacity: 1; } 40%, 70% { transform: translate(0, 0); opacity: 1; } 100% { transform: translate(calc(2 * var(--u)), calc(4 * var(--u))); opacity: 0; } }
.sx-fleche { width: calc(6 * var(--u)); height: 2px; background: var(--sx-trait); position: relative; }
.sx-fleche::after { content: ""; position: absolute; top: calc(-.5 * var(--u)); width: calc(1.1 * var(--u)); height: calc(1.1 * var(--u)); border-radius: 50%; background: var(--accent-3); box-shadow: 0 0 calc(1.4 * var(--u)) var(--accent-3); animation: sc-go 2.2s .9s var(--ease) infinite; }
.sx-carte { display: flex; flex-direction: column; gap: calc(.3 * var(--u)); padding: calc(1.6 * var(--u)) calc(2.2 * var(--u)); border-radius: calc(1.6 * var(--u)); background: var(--sx-fond); box-shadow: inset 0 0 0 1px var(--sx-trait); font: 600 calc(1.7 * var(--u)) var(--mono); }
.sx-carte small { font-size: calc(1.2 * var(--u)) !important; color: var(--text-2); }
.sx-carte b { color: var(--accent-3); } .sx-carte span { color: var(--text); }

/* Stockage */
.sx-store { display: flex; align-items: center; gap: calc(2 * var(--u)); }
.sx-page { width: calc(18 * var(--u)); height: calc(13 * var(--u)); border-radius: calc(1.4 * var(--u)); background: var(--sx-fond); box-shadow: inset 0 0 0 1px var(--sx-trait); padding: calc(1.4 * var(--u)); display: flex; flex-direction: column; gap: calc(.8 * var(--u)); }
.sx-page i { height: calc(1 * var(--u)); border-radius: 999px; background: var(--sx-fond-2); } .sx-page i:nth-child(2) { width: 70%; } .sx-page i:nth-child(3) { width: 45%; }
.sx-page b { margin-top: auto; font: 700 calc(1.6 * var(--u)) var(--sans); color: var(--text-2); }
.sx-tuyau { position: relative; width: calc(16 * var(--u)); height: 2px; background: var(--sx-trait); }
.sx-tuyau span { position: absolute; bottom: calc(1.2 * var(--u)); left: 50%; transform: translateX(-50%); font: 700 calc(1.6 * var(--u)) var(--mono); color: var(--accent-3); }
.sx-tuyau i { position: absolute; top: calc(-1 * var(--u)); width: calc(4 * var(--u)); height: calc(2 * var(--u)); border-radius: calc(.6 * var(--u)); background: var(--gradient); animation: sx-voyage 1.6s var(--ease) infinite; }
.sx-tuyau.retour i { animation-direction: reverse; }
@keyframes sx-voyage { from { left: 0; opacity: 0; } 20%, 80% { opacity: 1; } to { left: calc(100% - calc(4 * var(--u))); opacity: 0; } }
.sx-cylindre { position: relative; width: calc(22 * var(--u)); padding: calc(2.4 * var(--u)) calc(1.6 * var(--u)) calc(1.6 * var(--u)); border-radius: 50% / calc(2.6 * var(--u)); display: flex; flex-direction: column; gap: calc(.6 * var(--u)); align-items: center;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 22%, var(--bg-3)), var(--bg-3)); box-shadow: inset 0 0 0 1px var(--sx-trait), 0 calc(2 * var(--u)) calc(4 * var(--u)) rgba(0,0,0,.4); }
.sx-cylindre b { font: 700 calc(1.8 * var(--u)) var(--mono); color: var(--text); }
.sx-cylindre span { font: 500 calc(1.3 * var(--u)) var(--mono); color: var(--accent-3); }

/* Asynchrone : Gantt */
.sx-gantt { width: calc(72 * var(--u)); display: flex; flex-direction: column; gap: calc(1.2 * var(--u)); }
.sx-piste { display: grid; grid-template-columns: calc(14 * var(--u)) 1fr; align-items: center; gap: calc(1.4 * var(--u)); opacity: .5; transition: opacity .5s; }
.sx-piste.on { opacity: 1; }
.sx-piste em { font: 600 calc(1.6 * var(--u)) var(--mono); font-style: normal; color: var(--text-2); text-align: right; }
.sx-piste > div { position: relative; height: calc(3 * var(--u)); border-radius: 999px; background: var(--sx-fond); }
.sx-piste > div i { position: absolute; top: 0; bottom: 0; left: calc(var(--d) * 1%); width: calc(var(--l) * 1%); border-radius: 999px; animation: sx-gantt 1.2s var(--ease) both; transform-origin: left; }
.sx-piste i.sync { background: var(--sx-fond-2); box-shadow: inset 0 0 0 1px var(--sx-trait); }
.sx-piste i.wait { background: var(--gradient); }
.sx-piste.on i { box-shadow: 0 0 calc(2.4 * var(--u)) color-mix(in srgb, var(--accent) 50%, transparent); }
@keyframes sx-gantt { from { transform: scaleX(0); } }
.sx-axe { display: flex; justify-content: space-between; margin-left: calc(15.4 * var(--u)); font: 500 calc(1.2 * var(--u)) var(--mono); color: var(--text-2); border-top: 1px solid var(--sx-trait); padding-top: calc(.6 * var(--u)); }

/* Réseau */
.sx-net { display: flex; align-items: center; gap: calc(1.6 * var(--u)); }
.sx-poste { display: flex; flex-direction: column; align-items: center; gap: calc(.8 * var(--u)); }
.sx-poste svg { width: calc(14 * var(--u)); height: calc(11 * var(--u)); fill: var(--sx-fond-2); stroke: var(--accent-3); stroke-width: 2; }
.sx-poste b { font: 700 calc(1.6 * var(--u)) var(--sans); color: var(--text-2); }
.sx-cable { position: relative; width: calc(34 * var(--u)); height: 2px; background: repeating-linear-gradient(90deg, var(--sx-trait) 0 calc(1 * var(--u)), transparent calc(1 * var(--u)) calc(1.6 * var(--u))); }
.sx-paquet { position: absolute; top: calc(-1.8 * var(--u)); white-space: nowrap; font: 700 calc(1.5 * var(--u)) var(--mono); padding: calc(.7 * var(--u)) calc(1.2 * var(--u)); border-radius: 999px; background: var(--gradient); color: var(--on-accent); animation: sx-paquet 2.2s var(--ease) infinite; box-shadow: 0 0 calc(2.4 * var(--u)) color-mix(in srgb, var(--accent) 50%, transparent); }
.sx-paquet.retour { animation-name: sx-paquet-r; }
@keyframes sx-paquet { from { left: 0; opacity: 0; } 15%, 85% { opacity: 1; } to { left: calc(100% - calc(16 * var(--u))); opacity: 0; } }
@keyframes sx-paquet-r { from { left: calc(100% - calc(13 * var(--u))); opacity: 0; } 15%, 85% { opacity: 1; } to { left: 0; opacity: 0; } }

/* Erreur */
.sx-bug { position: relative; display: flex; flex-direction: column; align-items: center; gap: calc(1.6 * var(--u)); }
.sx-code { display: flex; flex-direction: column; gap: calc(.8 * var(--u)); font: 500 calc(1.9 * var(--u)) var(--mono); }
.sx-code span { padding: calc(.8 * var(--u)) calc(1.6 * var(--u)); border-radius: calc(1 * var(--u)); background: var(--sx-fond); box-shadow: inset 0 0 0 1px var(--sx-trait); color: var(--text-2); }
.sx-code .bad { color: var(--text); background: rgba(255,69,58,.14); box-shadow: inset 0 0 0 calc(.15 * var(--u)) rgba(255,69,58,.6), 0 0 calc(3 * var(--u)) rgba(255,69,58,.25); animation: sx-shake .5s .3s both; }
@keyframes sx-shake { 20%, 60% { transform: translateX(calc(-.8 * var(--u))); } 40%, 80% { transform: translateX(calc(.8 * var(--u))); } }
.sx-alerte { font: 600 calc(1.6 * var(--u)) var(--mono); padding: calc(.8 * var(--u)) calc(1.6 * var(--u)); border-radius: 999px; background: rgba(255,69,58,.18); color: #ff8a80; animation: vm-hit .6s .6s cubic-bezier(.2, 1.6, .4, 1) both; }
.sx-alerte b { color: #ff453a; margin-right: .6em; }
.sx-loupe { position: absolute; right: calc(-6 * var(--u)); top: calc(2 * var(--u)); width: calc(6 * var(--u)); height: calc(6 * var(--u)); fill: none; stroke: var(--accent-3); stroke-width: 2; animation: sx-loupe 3s ease-in-out infinite; }
@keyframes sx-loupe { 50% { transform: translate(calc(-3 * var(--u)), calc(2 * var(--u))) rotate(-10deg); } }

/* Tests */
.sx-tests { display: flex; flex-direction: column; gap: calc(1 * var(--u)); min-width: calc(46 * var(--u)); }
.sx-tests > span { display: flex; align-items: center; gap: calc(1.2 * var(--u)); font: 600 calc(1.8 * var(--u)) var(--sans); padding: calc(1 * var(--u)) calc(1.6 * var(--u)); border-radius: calc(1.2 * var(--u)); background: var(--sx-fond); color: var(--text-2); transition: all .5s var(--ease); }
.sx-tests > span i { width: calc(2.6 * var(--u)); height: calc(2.6 * var(--u)); display: grid; place-items: center; border-radius: 50%; font-style: normal; box-shadow: inset 0 0 0 calc(.15 * var(--u)) var(--sx-trait); color: #000; font-weight: 900; }
.sx-tests .ok { color: var(--text); }
.sx-tests .ok i { background: #30d158; box-shadow: 0 0 calc(1.6 * var(--u)) #30d158; animation: vm-hit .5s cubic-bezier(.2, 1.6, .4, 1) both; }
.sx-score { display: flex; align-items: center; gap: calc(1.4 * var(--u)); margin-top: calc(.6 * var(--u)); }
.sx-score > div { flex: 1; height: calc(1.2 * var(--u)); border-radius: 999px; background: var(--sx-fond); overflow: hidden; }
.sx-score > div i { display: block; height: 100%; width: calc(var(--p) * 100%); background: linear-gradient(90deg, #30d158, #64d2ff); transition: width .8s var(--ease); }
.sx-score b { font: 700 calc(1.6 * var(--u)) var(--sans); color: #30d158; }

/* Idée : orbe lumineux */
.sx-orbe { position: relative; width: calc(30 * var(--u)); height: calc(30 * var(--u)); }
.sx-orbe i { position: absolute; inset: 0; border-radius: 50%; border: calc(.2 * var(--u)) solid color-mix(in srgb, var(--accent) 40%, transparent); animation: sx-orbe 9s linear infinite; }
.sx-orbe i:nth-child(1) { background: radial-gradient(circle, color-mix(in srgb, var(--accent) 30%, transparent), transparent 65%); border-color: transparent; animation: vm-beat 3s ease-in-out infinite alternate; }
.sx-orbe i:nth-child(2) { inset: 8%; transform: rotateX(70deg); border-style: dashed; }
.sx-orbe i:nth-child(3) { inset: 16%; animation-duration: 6s; animation-direction: reverse; border-color: color-mix(in srgb, var(--accent-3) 50%, transparent); }
@keyframes sx-orbe { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) { .vm-punch b.hit, .vm-cc-g, .sx-drop { animation: none !important; } }

/* Éditeur et console : grands, comme une capture d'écran de développeur en plein cadre */
.vm-window { max-width: calc(88 * var(--u)); width: calc(88 * var(--u)); border-radius: calc(1.6 * var(--u)); }
.vm-window pre { font-size: calc(1.75 * var(--u)) !important; line-height: 1.55 !important; padding: calc(1.6 * var(--u)) calc(2.2 * var(--u)) calc(2 * var(--u)) !important; }
.vm-bar { padding: calc(1 * var(--u)) calc(1.4 * var(--u)); gap: calc(.7 * var(--u)); }
.vm-bar i { width: calc(1 * var(--u)); height: calc(1 * var(--u)); }
.vm-bar span { font-size: calc(1.1 * var(--u)); }
.vm-run pre, .vm-console { font-size: calc(1.6 * var(--u)) !important; }

/* Glossaire : bulle de définition au clic sur un mot du code */
pre:not(.out) code, .vm-editor pre code { cursor: help; }
.gloss { position: fixed; z-index: 2147483647; max-width: min(360px, calc(100vw - 24px)); padding: 14px 16px 12px; border-radius: 16px;
  background: color-mix(in srgb, var(--bg-2) 92%, transparent); -webkit-backdrop-filter: blur(20px) saturate(1.6); backdrop-filter: blur(20px) saturate(1.6);
  box-shadow: inset 0 0 0 1px var(--line-2), 0 20px 60px rgba(0,0,0,.55); animation: vm-in .25s var(--ease) both; font: 14px/1.5 var(--sans); color: var(--text); }
.gloss code { font: 700 15px var(--mono); background: none !important; padding: 0 !important; color: var(--accent-3); }
.gloss p { margin: 6px 0 8px; }
.gloss small { color: var(--text-3); font-size: 11px; }


/* Bouton « Regarder en vidéo » masqué quand le lecteur est ouvert */
.vm-launch[hidden] { display: none !important; }

/* Téléphone : vidéo plus haute (format proche des shorts), textes et schémas agrandis, commandes compactes */
@media (max-width: 700px) {
  .vm-controls { gap: 2px; padding: 6px 8px; justify-content: space-between; }
  .vm-controls button, .vm-controls select { min-width: 34px; width: auto; padding: 6px !important; margin: 0 !important; }
  .vm-controls .vm-play { width: 46px !important; }
  .vm-count { display: none; }
  .gloss { font-size: 15px; }
}
/* Plein écran de secours (iPhone) */
.vm-player.vm-pseudo { position: fixed !important; inset: 0 !important; z-index: 1000; margin: 0 !important; max-width: none !important; width: 100% !important;
  transform: none !important; display: flex; flex-direction: column; justify-content: center; background: #000; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
.vm-player.vm-pseudo .vm-stage { width: 100%; max-height: calc(100dvh - 90px); border-radius: 0; }
html.vm-pseudo-on, html.vm-pseudo-on body { overflow: hidden; }

/* Sous-titres : chaque mot tombe en place quand il est prononcé, le mot en cours devient une pastille colorée */
.vm-cc-g { animation: none; }
.vm-cc-g span { display: inline-block; margin: 0 .05em; padding: .02em .16em; border-radius: .32em; opacity: .22; filter: blur(2px);
  transform: translateY(.35em) scale(.86); transition: opacity .22s, filter .22s, transform .38s cubic-bezier(.2, 1.7, .4, 1), background .2s, color .2s, box-shadow .2s; }
.vm-cc-g span.dit { opacity: 1; filter: none; transform: none; }
.vm-cc-g span.on { color: var(--on-accent); background: var(--gradient); transform: scale(1.14) rotate(-2deg);
  box-shadow: 0 .3em 1.1em color-mix(in srgb, var(--accent) 55%, transparent); text-shadow: none; }
@media (prefers-reduced-motion: reduce) { .vm-cc-g span { transition: none; filter: none; } }


/* ---------- Finitions des schémas ---------- */
.vm-stage::before, .vm-stage::after { opacity: .18; }
.sx-loop .tete { fill: var(--accent-3); stroke: var(--bg); stroke-width: 3; filter: drop-shadow(0 0 5px var(--accent-3)); transition: cx .8s var(--ease), cy .8s var(--ease); }
.sx-orbite { display: none; }
.sx-res.on + text { fill: var(--on-accent); font-weight: 700; }
.sx-noeud text { fill: var(--text); }
.sx-slot { opacity: .62; transform: scale(.9); }
.sx-tag { color: var(--text); }
.sx-prop { opacity: .32; }
.sx-commit { opacity: 1; fill: var(--bg-3); }
.sx-commit:not(.in) { stroke: color-mix(in srgb, var(--text) 25%, transparent); }
.sx-cable { height: 2px; background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--text) 40%, transparent) 0 calc(1 * var(--u)), transparent calc(1 * var(--u)) calc(1.6 * var(--u))); }
.sx-usine { overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(.4 * var(--u)); }
.sx-usine small { font: 600 calc(1.1 * var(--u)) var(--mono) !important; color: var(--accent-2); letter-spacing: .04em; }
.sx-balayage { position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, color-mix(in srgb, var(--accent-3) 22%, transparent) 50%, transparent 70%);
  background-size: 250% 100%; animation: sx-balayage 2.4s ease-in-out infinite; }
@keyframes sx-balayage { from { background-position: 120% 0; } to { background-position: -20% 0; } }
.sx-engrenage { display: none; }

/* ===================== Leçon : texte du cours + schéma expliqué ===================== */
.vm-screen.vm-texte { padding: calc(1.4 * var(--u)) calc(3 * var(--u)); align-items: stretch; }
.vm-lesson { width: 100%; height: 100%; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: calc(3 * var(--u)); align-items: center; animation: vm-in .6s var(--ease) both; }
.vm-lesson.seul { grid-template-columns: minmax(0, 1fr); max-width: calc(72 * var(--u)); margin: 0 auto; }
.vm-lecture small { display: block; font: 600 calc(1.15 * var(--u)) var(--sans); letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent-3); margin-bottom: calc(1 * var(--u)); }
.vm-para { margin: 0; font: 500 calc(2.05 * var(--u))/1.55 var(--sans); color: var(--text); letter-spacing: -.01em; text-align: left; }
.vm-lesson.seul .vm-para { font-size: calc(2.5 * var(--u)); }
.vm-para span { transition: color .25s; }
.vm-para span.k { font-weight: 700; }
.vm-joue .vm-para span { color: color-mix(in srgb, var(--text) 50%, transparent); }
.vm-joue .vm-para span.lu { color: var(--text); }
.vm-joue .vm-para span.on { color: var(--on-accent); background: var(--gradient); border-radius: .25em; padding: 0 .12em; margin: 0 -.12em; }

.vm-fig { --u: .85cqw; margin: 0; height: 100%; min-height: 0; overflow: hidden; display: flex; flex-direction: column; justify-content: center;
  gap: calc(1.6 * var(--u)); padding: calc(2.4 * var(--u)); border-radius: calc(2.2 * var(--u));
  background: color-mix(in srgb, var(--text) 4%, transparent); box-shadow: inset 0 0 0 1px var(--line-2);
  --sx-fond: color-mix(in srgb, var(--text) 9%, transparent); --sx-fond-2: color-mix(in srgb, var(--text) 22%, transparent);
  --sx-trait: color-mix(in srgb, var(--text) 32%, transparent); }
.vm-fig .vm-schema { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: calc(2 * var(--u)); color: var(--text); font: 500 calc(1.7 * var(--u)) var(--sans); animation: none; }
.vm-fig figcaption { font: 500 clamp(11px, calc(2.1 * var(--u)), 16px)/1.45 var(--sans); color: var(--text-2); text-align: center; text-wrap: balance; }
.vm-fig svg { max-width: 100%; }

/* Nouvelles pièces de schéma */
.sx-boite.fixe { box-shadow: inset 0 0 0 calc(.2 * var(--u)) color-mix(in srgb, var(--accent-2) 70%, transparent), 0 calc(1.6 * var(--u)) calc(3 * var(--u)) rgba(0,0,0,.35); }
.sx-slot small { font: 500 calc(1.3 * var(--u)) var(--sans); color: var(--text-2); }
.sx-cases { display: flex; flex-wrap: wrap; justify-content: center; gap: calc(1.2 * var(--u)); }
.sx-case { min-width: calc(9 * var(--u)); display: flex; flex-direction: column; align-items: center; gap: calc(.6 * var(--u)); transition: transform .5s var(--ease); }
.sx-case b { display: block; width: 100%; text-align: center; padding: calc(1.6 * var(--u)) calc(1.2 * var(--u)); border-radius: calc(1.2 * var(--u));
  font: 600 calc(1.8 * var(--u)) var(--mono); background: var(--sx-fond); box-shadow: inset 0 0 0 1px var(--sx-trait); transition: all .5s var(--ease); }
.sx-case small { font: 600 calc(1.3 * var(--u)) var(--mono); color: var(--text-2); }
.sx-case.fait b { opacity: .55; }
.sx-case.on { transform: translateY(calc(-.8 * var(--u))); }
.sx-case.on b { background: var(--gradient); color: var(--on-accent); box-shadow: 0 calc(1 * var(--u)) calc(3 * var(--u)) color-mix(in srgb, var(--accent) 40%, transparent); }
.sx-tantque { display: flex; flex-direction: column; align-items: center; gap: calc(2 * var(--u)); }
.sx-cond { font: 700 calc(2.2 * var(--u)) var(--mono); padding: calc(1.4 * var(--u)) calc(2.4 * var(--u)); border-radius: 999px; background: var(--sx-fond-2); }
.sx-retour { display: flex; gap: calc(2 * var(--u)); }
.sx-retour span { font: 600 calc(1.6 * var(--u)) var(--sans); padding: calc(1 * var(--u)) calc(1.8 * var(--u)); border-radius: calc(1 * var(--u)); background: var(--sx-fond); box-shadow: inset 0 0 0 1px var(--sx-trait); }
.sx-retour span.on { background: var(--gradient); color: var(--on-accent); }
.sx-entrees { display: flex; flex-direction: column; gap: calc(.8 * var(--u)); }
.vm-schema svg .sx-etiq { font: 600 11px var(--sans); fill: var(--text-2); }
.vm-fig .sx-centre small { font-size: calc(1.5 * var(--u)) !important; text-transform: none; letter-spacing: 0; }

/* Sous-titres sobres (code, titres) ; masqués pendant le texte du cours, déjà affiché à l'écran */
.vm-caption { font: 600 calc(1.75 * var(--u))/1.45 var(--sans); min-height: calc(5 * var(--u)); padding: 0 8% calc(1.6 * var(--u)); }
.vm-cc-g { animation: none; text-shadow: 0 1px 6px rgba(0,0,0,.6); }
.vm-cc-g span, .vm-cc-g span.dit, .vm-cc-g span.on { opacity: 1; filter: none; transform: none; background: none; box-shadow: none; padding: 0 .06em; margin: 0; transition: color .2s; }
.vm-cc-g span.on { color: var(--accent-3); }
.vm-stage.vm-lecon .vm-caption { display: none; }

/* Téléphone : le texte au-dessus, le schéma en dessous, tout lisible */

/* ===================== Illustrations dessinées (écrans d'installation, console, VS Code, terminal) ===================== */
/* Une illustration = une fenêtre dessinée en CSS + des repères numérotés + une légende ; les étapes suivent en liste. */
.illu { margin: 36px auto; max-width: var(--measure); }
.illu figcaption { margin-top: 12px; font: 14px/1.5 var(--sans); color: var(--text-2); text-align: center; }
.illu .ecran { position: relative; border-radius: 14px; overflow: hidden; background: #1e1e22; color: #d4d4d8; font: 12px/1.5 var(--mono);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12), 0 24px 60px rgba(0,0,0,.45); }
.illu .barre { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; background: #2a2a30; border-bottom: 1px solid rgba(255,255,255,.08); font: 600 11px var(--sans); color: #a1a1aa; }
.illu .barre i { width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; } .illu .barre i:nth-child(2) { background: #febc2e; } .illu .barre i:nth-child(3) { background: #28c840; }
.illu .barre span { margin: 0 auto; }
/* Repères : voir « Repères des dessins » plus bas. */
.illu .zone { position: absolute; z-index: 2; border-radius: 8px; box-shadow: inset 0 0 0 2px var(--accent-3), 0 0 18px color-mix(in srgb, var(--accent-3) 35%, transparent); pointer-events: none; }
ol.etapes { counter-reset: e; list-style: none; padding: 0; margin: 20px auto 28px; max-width: var(--measure); }
ol.etapes > li { counter-increment: e; position: relative; padding: 4px 0 12px 44px; }
ol.etapes > li::before { content: counter(e); position: absolute; left: 0; top: 2px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font: 800 13px var(--sans); color: var(--on-accent); background: var(--gradient); }
.os { display: inline-block; font: 700 11px var(--sans); letter-spacing: .08em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; margin-right: 6px; vertical-align: 2px;
  background: var(--glass-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }

/* Navigateur avec ses outils de développement ouverts sur la console */
.illu-nav .adresse { display: flex; align-items: center; gap: 8px; padding: 6px 12px; background: #24242a; border-bottom: 1px solid rgba(255,255,255,.06); }
.illu-nav .adresse b { flex: 1; padding: 4px 12px; border-radius: 999px; background: #34343c; font: 500 11px var(--sans); color: #c4c4cc; }
.illu-nav .page { height: 90px; display: grid; place-items: center; background: #f4f4f6; color: #555; font: 600 14px var(--sans); }
.illu-nav .outils { background: #202024; border-top: 2px solid #3a3a42; }
.illu-nav .onglets { display: flex; gap: 2px; padding: 0 8px; background: #2a2a30; font: 600 11px var(--sans); color: #9a9aa2; }
.illu-nav .onglets span { padding: 6px 10px; } .illu-nav .onglets span.on { color: #fff; box-shadow: inset 0 -2px 0 var(--accent-3); }
.illu .lignes { padding: 8px 14px 10px; min-height: 70px; }
.illu .lignes div { padding: 2px 0; border-bottom: 1px solid rgba(255,255,255,.04); white-space: pre-wrap; }
.illu .lignes .entree::before { content: "› "; color: #7aa2f7; }
.illu .lignes .sortie { color: #a6e3a1; padding-left: 14px; }
.illu .lignes .erreur { color: #ff8a80; background: rgba(255,69,58,.1); padding-left: 14px; }
.illu .lignes .curseur::after { content: ""; display: inline-block; width: 7px; height: 13px; margin-left: 2px; vertical-align: -2px; background: #e4e4e7; animation: vm-caret 1s steps(1) infinite; }

/* Fenêtre VS Code */
.illu-vscode .corps { display: grid; grid-template-columns: 34px 150px 1fr; min-height: 210px; }
.illu-vscode .activite { background: #2c2c32; display: flex; flex-direction: column; align-items: center; gap: 14px; padding-top: 12px; }
.illu-vscode .activite i { width: 16px; height: 16px; border-radius: 4px; box-shadow: inset 0 0 0 2px #8a8a92; }
.illu-vscode .activite i.on { box-shadow: inset 0 0 0 2px #fff; }
.illu-vscode .explorateur { background: #252529; padding: 8px 10px; font: 11px/1.9 var(--sans); color: #b4b4bc; }
.illu-vscode .explorateur b { display: block; font: 700 10px var(--sans); letter-spacing: .08em; color: #8a8a92; margin-bottom: 4px; }
.illu-vscode .explorateur span { display: block; padding-left: 10px; } .illu-vscode .explorateur span.on { background: #37373f; color: #fff; border-radius: 4px; }
.illu-vscode .editeur { background: #1e1e22; display: flex; flex-direction: column; }
.illu-vscode .tabs { display: flex; background: #252529; font: 11px var(--sans); color: #9a9aa2; }
.illu-vscode .tabs span { padding: 6px 12px; } .illu-vscode .tabs span.on { background: #1e1e22; color: #fff; }
.illu-vscode .code { padding: 8px 12px; flex: 1; }
.illu-vscode .code div { white-space: pre; } .illu-vscode .code em { font-style: normal; color: #6a6a72; display: inline-block; width: 20px; }
.illu-vscode .code .k { color: #c792ea; } .illu-vscode .code .s { color: #c3e88d; } .illu-vscode .code .f { color: #82aaff; }
.illu-vscode .panneau { border-top: 1px solid #3a3a42; background: #1a1a1e; }
.illu-vscode .panneau .onglets { display: flex; gap: 14px; padding: 4px 12px; font: 600 10px var(--sans); letter-spacing: .06em; color: #8a8a92; }
.illu-vscode .panneau .onglets span.on { color: #fff; box-shadow: inset 0 -2px 0 var(--accent-3); }
.illu-vscode .barre-etat { height: 20px; background: color-mix(in srgb, var(--accent) 70%, #000); }

/* Terminal */
.illu-term .lignes { min-height: 120px; padding: 12px 16px; font-size: 12.5px; }
.illu-term .invite { color: #7dcfff; }

/* Installeur */
.illu-install .contenu { display: grid; grid-template-columns: 120px 1fr; min-height: 190px; background: #f2f2f5; color: #222; font: 13px/1.5 var(--sans); }
.illu-install .cote { background: linear-gradient(160deg, #0a64d6, #1aa0f0); }
.illu-install .texte { padding: 16px 20px; }
.illu-install .texte b { display: block; font-size: 15px; margin-bottom: 8px; }
.illu-install .case { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.illu-install .case i { width: 14px; height: 14px; border-radius: 3px; border: 1.5px solid #555; display: grid; place-items: center; font: 900 10px var(--sans); font-style: normal; }
.illu-install .case i.oui { background: #0a64d6; border-color: #0a64d6; color: #fff; }
.illu-install .boutons { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 16px; background: #e6e6ea; }
.illu-install .boutons span { padding: 4px 14px; border-radius: 4px; border: 1px solid #999; background: #fff; color: #222; font: 12px var(--sans); }
.illu-install .boutons span.on { background: #0a64d6; color: #fff; border-color: #0a64d6; }

/* Schéma de principe (boîtes et flèches) */
.illu-flux { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; padding: 26px 14px; border-radius: 16px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line-2); }
.illu-flux .bloc { padding: 12px 16px; border-radius: 12px; background: var(--glass-2); box-shadow: inset 0 0 0 1px var(--line-2); text-align: center; font: 600 14px var(--sans); min-width: 110px; }
.illu-flux .bloc small { display: block; font: 500 12px var(--sans); color: var(--text-2); margin-top: 2px; }
.illu-flux .bloc.fort { background: var(--gradient); color: var(--on-accent); }
.illu-flux .bloc.fort small { color: inherit; opacity: .8; }
.illu-flux .fleche { font: 700 20px var(--sans); color: var(--accent-3); }
@media (max-width: 700px) {
  .illu-vscode .corps { grid-template-columns: 26px 96px 1fr; }
  .illu .ecran { font-size: 11.5px; }
  .illu-install .contenu { grid-template-columns: 50px 1fr; }
  .illu-flux { flex-direction: column; } .illu-flux .fleche { transform: rotate(90deg); }
}

/* Dans la vidéo : l'illustration en grand */
.vm-illu { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(1.4 * var(--u)); animation: vm-in .6s var(--ease) both; }
.vm-illu .illu { margin: 0; width: min(100%, calc(70 * var(--u))); max-width: none; }
.vm-illu .illu figcaption { display: none; }
.vm-illu .legende { font: 500 calc(1.8 * var(--u))/1.45 var(--sans); color: var(--text); text-align: center; max-width: calc(70 * var(--u)); }
.vm-illu .repere { animation: vm-hit .5s cubic-bezier(.2, 1.6, .4, 1) both; }

/* Repères accrochés aux zones qu'ils désignent (restent bien placés à toutes les tailles) */
.illu .activite, .illu .explorateur, .illu .code, .illu .panneau, .illu .lignes, .illu .onglets span, .illu .boutons span, .illu .case, .illu .invite { position: relative; }
.illu-vscode .corps { grid-template-columns: 34px 150px minmax(0, 1fr); }
.illu-vscode .editeur { min-width: 0; overflow: hidden; }
.illu-vscode .explorateur span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 700px) { .illu-vscode .corps { grid-template-columns: 26px 92px minmax(0, 1fr); } }

/* Téléphone : dans le lecteur vidéo, les longues lignes de code passent à la ligne au lieu d'être coupées à droite. */

.palette-picker.compact .palette-list { top: 40px; }

/* Titres en métal : le reflet ne se peint que dans la boîte du texte. Avec des lettres resserrées, la dernière
   lettre dépasse un peu de cette boîte et serait tranchée à droite : on agrandit la boîte sans rien décaler. */
.tr-num, .vm-title h2, .vm-recap h2, main.lesson > h1, .hero h1, .metal-text, .hero h1 em, .formall em { padding-right: .12em; margin-right: -.12em; }

/* Très petits écrans (320 px) : le grand titre de l'accueil tient en largeur, ponctuation comprise. */
@media (max-width: 360px) { .hero h1 { font-size: 38px; } }
/* Une longue adresse ou un long nom écrit dans une phrase passe à la ligne au lieu de faire déborder la page. */
main.lesson p code, main.lesson li code { overflow-wrap: anywhere; hyphens: none; }


/* ---------- Repères des dessins ----------
   Règle : un repère ne recouvre JAMAIS un mot. L'élément visé est entouré d'un cadre lumineux (.cible),
   et la pastille numérotée se place à côté, dans un espace libre, avec une pointe vers l'élément. */
.illu .cible { position: relative; border-radius: 6px; outline: 2px solid var(--accent-3); outline-offset: 2px;
  box-shadow: 0 0 14px color-mix(in srgb, var(--accent-3) 40%, transparent); }
.illu .cible.zone { position: relative; outline-offset: -3px; box-shadow: inset 0 0 22px color-mix(in srgb, var(--accent-3) 16%, transparent); }
.illu .repere { position: static; display: inline-grid; place-items: center; vertical-align: middle; flex: none;
  min-width: 22px; height: 22px; padding: 0 6px; margin: 0 0 0 8px; border-radius: 999px;
  font: 800 12px/1 var(--sans); letter-spacing: 0; color: #0b0b0d; background: var(--accent-3);
  box-shadow: 0 2px 10px rgba(0,0,0,.45), 0 0 0 2px rgba(0,0,0,.35); white-space: nowrap; }
.illu .repere.fin { margin-left: auto; }   /* au bout d'une barre (onglets, en-tête) */
/* Pastilles placées autour de l'élément visé, avec une pointe vers lui. */
.illu .repere.r-droite, .illu .repere.r-gauche, .illu .repere.r-dessus, .illu .repere.r-dessous, .illu .repere.r-bas-dedans { position: absolute; z-index: 3; margin: 0; }
.illu .repere.r-droite { top: 50%; left: calc(100% + 13px); transform: translateY(-50%); }
.illu .repere.r-gauche { top: 50%; right: calc(100% + 13px); transform: translateY(-50%); }
.illu .repere.r-dessus { bottom: calc(100% + 13px); left: 50%; transform: translateX(-50%); }
.illu .repere.r-dessous { top: calc(100% + 11px); left: 50%; transform: translateX(-50%); }
.illu .repere.r-bas-dedans { bottom: 10px; left: 50%; transform: translateX(-50%); }
.illu .repere[class*="r-"]::before { content: ""; position: absolute; border: 5px solid transparent; }
.illu .repere.r-droite::before { right: 100%; top: 50%; margin-top: -5px; border-right-color: var(--accent-3); }
.illu .repere.r-gauche::before { left: 100%; top: 50%; margin-top: -5px; border-left-color: var(--accent-3); }
.illu .repere.r-dessus::before { top: 100%; left: 50%; margin-left: -5px; border-top-color: var(--accent-3); }
.illu .repere.r-dessous::before { bottom: 100%; left: 50%; margin-left: -5px; border-bottom-color: var(--accent-3); }
.illu .repere.r-bas-dedans::before { display: none; }
.vm-illu .repere, .vm-illu .cible { animation: vm-hit .5s cubic-bezier(.2, 1.6, .4, 1) both; }

/* Lisibilité des dessins : aucun texte sous 11,5 px. */
.illu-nav .adresse b, .illu-nav .onglets, .illu-vscode .tabs, .illu .barre { font-size: 12px; }
.illu-vscode .explorateur { font-size: 12px; }
.illu-vscode .explorateur b, .illu-vscode .panneau .onglets { font-size: 11.5px; color: #a8a8b0; }
.illu-install .case i { font-size: 11.5px; }
/* Espace réservé sous une ligne pour les pastilles placées en dessous. */
.illu .lignes div.place-dessous { padding-bottom: 38px; }

/* VS Code sur téléphone : l'explorateur passe au-dessus de l'éditeur, pour que le code ne soit jamais coupé. */
@media (max-width: 600px) {
  .illu-vscode .corps { grid-template-columns: 30px minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .illu-vscode .activite { grid-row: 1 / 3; }
  .illu-vscode .explorateur { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; padding: 8px 10px; }
  .illu-vscode .explorateur b { width: 100%; display: flex; align-items: center; margin: 0; }
  .illu-vscode .explorateur span { display: inline-block; padding: 0 6px; }
  .illu-vscode .code div { white-space: pre-wrap; }
}

/* Les touches d'un raccourci clavier, dessinées. */
.illu-touches { display: grid; gap: 14px; padding: 22px 18px; border-radius: 16px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line-2); }
.illu-touches .ligne { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; justify-content: center; }
.illu-touches .os { margin: 0 6px 0 0; }
.illu-touches kbd { display: inline-grid; place-items: center; min-width: 46px; height: 46px; padding: 0 12px; border-radius: 10px;
  font: 600 16px var(--sans); color: var(--text); background: linear-gradient(var(--bg-3), var(--bg-2));
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.45), inset 0 0 0 1px var(--line-2), 0 4px 10px rgba(0,0,0,.35); }
.illu-touches kbd small { display: block; font: 500 11.5px var(--sans); color: var(--text-2); margin-top: -2px; }
.illu-touches .plus { color: var(--text-3); font: 600 18px var(--sans); }
/* Console dessinée : la ligne où l'on tape est un champ court, la pastille se place dans l'espace libre à droite. */
.illu-nav .lignes .entree.champ { display: block; width: 55%; padding-left: 4px; }
/* Dessins : les en-têtes qui portent une pastille au bout s'alignent comme une barre. */
.illu-vscode .explorateur b, .illu-vscode .tabs, .illu .panneau .onglets { display: flex; align-items: center; }
.illu-vscode .tabs .repere, .illu .panneau .onglets .repere { margin-right: 8px; }
.illu-install .case.court { width: fit-content; }
/* Numéros de ligne de l'éditeur dessiné : lisibles. */
.illu-vscode .code em { color: #8f8f98; }
/* Sur petit écran, les onglets d'un panneau passent à la ligne au lieu d'être coupés. */
.illu .panneau .onglets { flex-wrap: wrap; row-gap: 2px; }
/* Une pastille placée sous un fichier de l'explorateur : on lui garde la place. */
.illu-vscode .explorateur:has(.r-dessous) { padding-bottom: 44px; }
mark.repere { background: var(--accent-3); color: #0b0b0d; }
.illu-vscode .explorateur span.cible { overflow: visible; }   /* la pastille sous le fichier visé doit rester visible */

/* Repères : une couleur fixe, orange vif, visible sur fond clair comme sur fond sombre, quelle que soit la finition. */
.illu { --repere: #ff9f0a; }
.illu .cible { outline-color: var(--repere); box-shadow: 0 0 14px color-mix(in srgb, var(--repere) 45%, transparent); }
.illu .cible.zone { box-shadow: inset 0 0 22px color-mix(in srgb, var(--repere) 18%, transparent); }
.illu .repere, mark.repere { background: var(--repere); color: #1a1000; box-shadow: 0 2px 10px rgba(0,0,0,.45), 0 0 0 2px rgba(0,0,0,.55); }
.illu .repere.r-droite::before { border-right-color: var(--repere); }
.illu .repere.r-gauche::before { border-left-color: var(--repere); }
.illu .repere.r-dessus::before { border-top-color: var(--repere); }
.illu .repere.r-dessous::before { border-bottom-color: var(--repere); }

/* ---------- Repères, version sobre et premium ----------
   Une couleur par numéro (couleurs système d'Apple), un cadre fin, une petite pastille ronde à côté,
   et une légende de couleurs sous le dessin. */
.illu .c1 { --c: #ff9f0a; } .illu .c2 { --c: #64d2ff; } .illu .c3 { --c: #30d158; } .illu .c4 { --c: #bf5af2; }
.illu .cible[class*="c"] { outline: 1.5px solid var(--c); outline-offset: 2px; border-radius: 7px;
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--c) 12%, transparent); }
.illu .cible.zone[class*="c"] { outline-offset: -3px; box-shadow: inset 0 0 0 4px color-mix(in srgb, var(--c) 7%, transparent); }
.illu .repere[class*="c"], .legende-reperes .repere { min-width: 19px; height: 19px; padding: 0 5px; font: 700 11.5px/1 var(--sans);
  background: var(--c); color: #0b0b0d; box-shadow: 0 1px 6px rgba(0,0,0,.4); }
.illu .repere[class*="c"]::before { display: none; }   /* plus de flèche : la couleur fait le lien */
.illu .repere.r-droite { left: calc(100% + 9px); } .illu .repere.r-gauche { right: calc(100% + 9px); }
.illu .repere.r-dessus { bottom: calc(100% + 9px); } .illu .repere.r-dessous { top: calc(100% + 8px); }
.legende-reperes { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; margin-top: 14px; font: 500 13.5px var(--sans); color: var(--text-2); }
.legende-reperes span { display: inline-flex; align-items: center; gap: 8px; }
.legende-reperes .repere { margin: 0; }
.legende-reperes span:nth-child(1) { --c: #ff9f0a; } .legende-reperes span:nth-child(2) { --c: #64d2ff; }
.legende-reperes span:nth-child(3) { --c: #30d158; } .legende-reperes span:nth-child(4) { --c: #bf5af2; }
.vm-illu .legende-reperes { font-size: calc(1.5 * var(--u)); }
/* Bouton « Sommaire » sur téléphone : s'efface en descendant, revient en remontant. */
.menu-btn { transition: transform .45s var(--ease), opacity .45s var(--ease); }
.menu-btn.cache { transform: translateY(-80px); opacity: 0; pointer-events: none; }
/* Lecteur vidéo sur téléphone : légende des repères, étiquette du chapitre et boutons toujours confortables. */
.vm-illu .legende-reperes { font-size: max(12px, calc(1.5 * var(--u))); }
@media (max-width: 700px) {
  .vm-controls button { min-width: 40px; min-height: 40px; }
}
/* Alignement : toutes les pastilles posées au bout d'une barre sont exactement à 12 px du bord droit du dessin. */
.illu-vscode .explorateur b .repere.fin { margin-right: 2px; }
.illu-vscode .tabs .repere.fin { margin-right: 12px; }
.illu .panneau .onglets .repere.fin { margin-right: 0; }
/* Légende des repères en grille régulière : jamais un élément seul et décalé sur une ligne. */
.legende-reperes { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, max-content)); justify-content: center; column-gap: 22px; row-gap: 8px; }
@media (max-width: 600px) { .legende-reperes { grid-template-columns: repeat(2, minmax(0, max-content)); } }
.vm-illu .legende-reperes { grid-template-columns: repeat(2, minmax(0, max-content)); }
.vm-illu .legende-reperes { grid-template-columns: repeat(4, max-content); }
/* L'étiquette du chapitre dans le lecteur reste sur une seule ligne. */
.vm-badge { white-space: nowrap; flex: none; }

/* ---------- Vraies captures d'écran ----------
   L'image réelle, avec par-dessus des cadres fins de couleur (en pourcentage : ils suivent l'image à
   toutes les tailles) et des pastilles posées dans des zones vides. Un toucher ouvre l'image en grand. */
.illu-capture .capture { position: relative; display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in;
  border-radius: 12px; overflow: hidden; box-shadow: 0 0 0 1px var(--line-2), 0 24px 60px -24px rgba(0,0,0,.7); }
.illu-capture .capture img { display: block; width: 100%; height: auto; }
.illu-capture .zone-capture { position: absolute; left: var(--x); top: var(--y); width: var(--w); height: var(--h); border-radius: 8px;
  outline: 2px solid var(--c); outline-offset: -1px; box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 14%, transparent); pointer-events: none; }
.illu-capture .capture .repere { position: absolute; left: var(--x); top: var(--y); translate: -50% -50%; margin: 0; }
.capture-grand { position: fixed; inset: 0; z-index: 2000; background: #000; overflow: auto; cursor: zoom-out;
  -webkit-overflow-scrolling: touch; display: grid; place-items: center; padding: 16px; }
.capture-grand img { width: min(1600px, 180vw); max-width: none; height: auto; border-radius: 10px; }
@media (min-width: 900px) { .capture-grand img { width: min(1600px, 94vw); } }
.capture-grand .fermer { position: fixed; top: 14px; right: 14px; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line-2);
  background: rgba(30,30,34,.85); color: #fff; font: 600 14px var(--sans); }
.illu-capture .astuce-zoom { display: none; margin: 8px 0 0; text-align: center; font: 500 12.5px var(--sans); color: var(--text-3); }
@media (max-width: 700px) { .illu-capture .astuce-zoom { display: block; } }
.vm-illu .astuce-zoom { display: none !important; }

/* Capture réelle dans le lecteur : l'image tient en hauteur, les repères suivent (ils sont placés en % de l'image). */
.vm-illu .illu-capture .capture { width: fit-content; max-width: 100%; margin: 0 auto; }
.vm-illu .illu-capture .capture img { width: auto; max-width: 100%; max-height: calc(30 * var(--u)); }
/* Une légende longue passe à la ligne au lieu de faire déborder l'écran. */
.legende-reperes span { min-width: 0; }
.legende-reperes span .repere { flex: none; }

/* Système choisi au premier lancement : on ne montre que le sien. Sans choix, les deux restent visibles. */
html[data-os="mac"] .pour-win, html[data-os="win"] .pour-mac { display: none !important; }
html[data-os] .pour-mac .sep { display: none; }

/* Écran de choix : système puis parcours, au premier lancement et via « Modifier ». */
html.choix-ouvert, html.choix-ouvert body { overflow: hidden; }
.choix-ecran { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 24px 16px; overflow-y: auto;
  background: radial-gradient(120% 80% at 50% 0%, var(--bg-3), var(--bg) 62%); animation: choix-entre .5s var(--ease) both; }
.choix-ecran.sort { animation: choix-sort .35s var(--ease) both; }
@keyframes choix-entre { from { opacity: 0; } }
@keyframes choix-sort { to { opacity: 0; } }
.choix-boite { position: relative; width: min(100%, 760px); text-align: center; }
.choix-boite .kicker { margin: 0 auto 18px; }
.choix-etape { animation: choix-glisse .5s var(--ease) both; }
@keyframes choix-glisse { from { opacity: 0; transform: translateY(10px); } }
.choix-etape h2 { font: 700 clamp(28px, 6vw, 44px)/1.12 var(--sans); letter-spacing: -.02em; margin: 0 0 12px; color: var(--text); }
.choix-sous { margin: 0 auto 32px; max-width: 46ch; font: 400 17px/1.5 var(--sans); color: var(--text-2); }
.choix-cartes { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .choix-cartes { grid-template-columns: 1fr; gap: 12px; } .choix-sous { margin-bottom: 24px; } }
.choix-cartes button { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 18px; row-gap: 4px; align-items: center;
  text-align: left; padding: 24px; min-height: 120px; border-radius: 22px; border: 1px solid var(--line-2); background: var(--glass); color: var(--text);
  cursor: pointer; font: inherit; transition: border-color .25s, background .25s, transform .25s var(--ease), box-shadow .25s; }
.choix-cartes button:hover { border-color: color-mix(in srgb, var(--accent) 70%, transparent); background: var(--glass-2); transform: translateY(-2px);
  box-shadow: 0 14px 36px color-mix(in srgb, var(--accent) 22%, transparent), inset 0 1px 0 rgba(255,255,255,.12); }
.choix-cartes button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.choix-cartes svg { grid-row: 1 / 3; width: 48px; height: 40px; fill: none; stroke: var(--text); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.choix-cartes svg .plein, .choix-cartes [data-os="win"] svg path { fill: var(--text); stroke: none; }
.choix-cartes b { font: 600 20px/1.2 var(--sans); align-self: end; }
.choix-cartes b i { font: 600 11px/1 var(--sans); font-style: normal; letter-spacing: .06em; text-transform: uppercase; color: var(--bg);
  background: var(--gradient); color: var(--on-accent); padding: 4px 8px; border-radius: 99px; margin-left: 8px; vertical-align: 3px; white-space: nowrap; }
.choix-cartes small { font: 400 14.5px/1.45 var(--sans); color: var(--text-2); align-self: start; }
.choix-retour { margin-top: 22px; min-height: 44px; padding: 0 16px; border: 0; background: none; color: var(--text-2); font: 500 15px var(--sans); cursor: pointer; }
.choix-retour:hover { color: var(--text); }
.choix-fermer { position: absolute; top: -8px; right: 0; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-2);
  background: var(--glass); color: var(--text); font-size: 16px; cursor: pointer; }
.mes-choix { margin: 14px 0 0; font: 400 14.5px/1.5 var(--sans); color: var(--text-2); }
.mes-choix span { color: var(--text); }
.mes-choix button { min-height: 32px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent); background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--text); font: 600 13.5px var(--sans); transition: background .3s var(--ease), color .3s var(--ease), transform .3s var(--ease); }
.mes-choix button:hover { background: var(--gradient); color: var(--on-accent); border-color: transparent; transform: translateY(-1px); }
.mes-choix button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.mes-choix-lien { display: block; margin: -4px 0 18px; padding: 8px 0; font: 500 13px/1.4 var(--sans); color: var(--text-2); text-decoration: none; }
.mes-choix-lien u { color: var(--text); text-underline-offset: 3px; }
.choix-etape h2, .choix-sous { text-wrap: balance; }
.choix-cartes b { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.choix-cartes b i { margin-left: 0; vertical-align: 0; }
.choix-fermer { position: fixed; top: 16px; right: 16px; background: var(--bg-2); z-index: 1; }

/* ===== Accueil (refonte validée : maquette outils/maquettes/accueil-v2.html) ===== */
/* Maquette de la nouvelle page d'accueil : s'appuie sur les couleurs et polices du site (style.css). */
.acc { --gut: clamp(16px, 5vw, 56px); background: transparent; color: var(--text); overflow-x: hidden; }
.acc * { box-sizing: border-box; }
.acc-top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px var(--gut); background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line); }
.acc-top .formall { font-size: 17px; }
.acc-finition { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--glass); color: var(--text-2); font: 500 13px var(--sans); white-space: nowrap; }
.acc-finition i { width: 22px; height: 22px; border-radius: 50%; background: var(--metal); background-size: 200% 100%; }

.acc-sec { min-height: 100svh; padding: clamp(64px, 12vh, 120px) var(--gut); display: flex; flex-direction: column; justify-content: center; }
.acc-sec.auto { min-height: 0; padding-block: clamp(40px, 8vh, 80px); }
.acc-kick { font: 600 13px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin: 0 0 14px; }
.acc h1 { font-size: clamp(38px, 7.2vw, 84px); line-height: 1.02; margin: 0; max-width: 14ch; }
.acc h1 em, .acc h2 em { font-style: normal; background: var(--metal); background-size: 100% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; }
.acc h2 { font-size: clamp(30px, 5vw, 56px); line-height: 1.05; margin: 0 0 14px; max-width: 18ch; }
.acc-sub { font-size: clamp(17px, 2vw, 21px); line-height: 1.5; color: var(--text-2); max-width: 34ch; margin: 22px 0 32px; }
.acc-btn { gap: 10px; padding: 16px 30px; font-size: 17px; width: fit-content; }
.acc-btn small { font-weight: 500; opacity: .6; }

/* Haut de page : texte + vrai lecteur */
.acc-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.acc-stack { position: relative; padding-top: 96px; cursor: pointer; -webkit-tap-highlight-color: transparent; outline: none; }
.acc-stack:focus-visible .acc-shot.p0 { box-shadow: 0 0 0 3px var(--accent); }
.acc-stack-in { position: relative; aspect-ratio: 760 / 540; }
.acc-shot { position: absolute; inset: 0; margin: 0; display: grid; grid-template-rows: 34px minmax(0, 1fr); border-radius: 18px; overflow: hidden;
  border: 1px solid rgba(255,255,255,.16); background: #000;
  transition: transform .7s var(--ease), opacity .7s var(--ease), filter .7s var(--ease); transform-origin: 50% 0; will-change: transform; }
.acc-shot .bar { display: flex; align-items: center; gap: 7px; padding: 0 14px; background: #1c1c1f; border-bottom: 1px solid rgba(255,255,255,.08);
  font: 600 12.5px var(--sans); color: #c7c7cc; white-space: nowrap; overflow: hidden; }
.acc-shot .bar i { flex: none; width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; }
.acc-shot .bar i:nth-child(2) { background: #febc2e; } .acc-shot .bar i:nth-child(3) { background: #28c840; margin-right: 8px; }
.acc-shot .bar span { overflow: hidden; text-overflow: ellipsis; }
.acc-shot picture { display: block; min-height: 0; padding: 0 6px 6px; }
.acc-shot img { width: 100%; height: 100%; object-fit: contain; object-position: center top; display: block; pointer-events: none; }
.acc-shot.p0 { z-index: 4; transform: none; box-shadow: 0 40px 100px -40px rgba(0,0,0,.85); }
.acc-shot.p1 { z-index: 3; transform: translateY(-32px) scale(.95); filter: brightness(.7); }
.acc-shot.p2 { z-index: 2; transform: translateY(-64px) scale(.9); filter: brightness(.5); }
.acc-shot.p3 { z-index: 1; transform: translateY(-96px) scale(.85); filter: brightness(.35); }
.acc-shot.out { z-index: 5; transform: translateY(70px) scale(.97); opacity: 0; }
.acc-cap { margin: 14px 0 0; color: var(--text-3); font-size: 13px; text-align: center; }
.acc-cap b { color: var(--text-2); font-weight: 600; }

/* Chiffres clés */
.acc-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 56px; }
.acc-stats div { padding: 22px 18px; border-radius: 20px; background: var(--glass); border: 1px solid var(--line); }
.acc-stats b { display: block; font: 700 clamp(32px, 4.6vw, 52px) / 1 var(--sans); letter-spacing: -.04em; }
.acc-stats span { display: block; margin-top: 8px; color: var(--text-2); font-size: 15px; }

/* Reprendre */
.acc-resume { display: flex; align-items: center; gap: 22px; padding: 22px 24px; border-radius: 24px; background: var(--bg-2); border: 1px solid var(--line-2); max-width: 760px; }
.acc-resume .ring { flex: none; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font: 700 15px var(--sans);
  background: radial-gradient(closest-side, var(--bg-2) 76%, transparent 78%), conic-gradient(var(--text) calc(var(--p, 0) * 1%), var(--line-2) 0); }
.acc-resume p { margin: 0; color: var(--text-2); font-size: 14px; }
.acc-resume h3 { margin: 4px 0 0; font-size: 20px; }
.acc-resume a { margin-left: auto; flex: none; }

/* Carrousel des projets, façon Disney+ */
.acc-car { position: relative; margin: 40px calc(var(--gut) * -1) 0; }
.acc-track { display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 10px 14vw 30px; overscroll-behavior-x: contain; }
.acc-track::-webkit-scrollbar { display: none; }
.acc-card { flex: 0 0 72vw; max-width: 980px; scroll-snap-align: center; border-radius: 26px; overflow: hidden; border: 1px solid var(--line-2);
  background: var(--bg-2); transition: transform .7s var(--ease), opacity .7s var(--ease); transform: scale(.92); opacity: .45; }
.acc-card.on { transform: none; opacity: 1; }
.acc-card .vis { aspect-ratio: 16 / 7.5; position: relative; display: grid; place-items: center; padding: 22px;
  background: radial-gradient(120% 120% at 20% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%), var(--bg-3); }
.acc-card { display: flex; flex-direction: column; }
.acc-card .txt { flex: 1; align-content: flex-start; padding: 18px 22px 22px; display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.acc-card .txt b { font-size: 20px; }
.acc-card .txt span { color: var(--text-2); font-size: 15px; }
.acc-card .txt em { margin-left: auto; font-style: normal; font: 600 12px var(--sans); color: var(--text-3); letter-spacing: .06em; text-transform: uppercase; }
.acc-dots { display: flex; justify-content: center; gap: 8px; }
.acc-dots i { width: 7px; height: 7px; border-radius: 99px; background: var(--line-2); transition: width .5s var(--ease), background .5s; }
.acc-dots i.on { width: 26px; background: var(--text); }

/* Mini-aperçus des projets (dessinés en CSS) */
.term { width: min(100%, 520px); border-radius: 14px; background: #0c0c0e; border: 1px solid rgba(255,255,255,.1); font: 13px/1.7 var(--mono); color: #d1d1d6; padding: 34px 18px 16px; position: relative; }
.term::before { content: ""; position: absolute; top: 12px; left: 14px; width: 9px; height: 9px; border-radius: 50%; background: #ff5f57; box-shadow: 15px 0 #febc2e, 30px 0 #28c840; }
.term .g { color: #32d74b; } .term .r { color: #ff453a; } .term .b { color: #64d2ff; } .term .d { color: #6e6e73; }
.wx { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.wx div { width: 150px; padding: 16px; border-radius: 18px; background: linear-gradient(160deg, #2a6df5, #6aa8ff); color: #fff; }
.wx div:nth-child(2) { background: linear-gradient(160deg, #3a3f55, #7a83a6); }
.wx small { display: block; opacity: .85; font-size: 12px; } .wx b { display: block; font-size: 36px; letter-spacing: -.03em; margin: 6px 0 2px; }
.todo, .todo *, .app > div, .app > div * { color: #1d1d1f; }
.todo { width: min(100%, 380px); border-radius: 18px; background: #f5f5f7; padding: 18px; font-size: 14px; }
.todo h4 { margin: 0 0 12px; color: #1d1d1f; font-size: 18px; }
.todo p { display: flex; align-items: center; gap: 10px; margin: 0; padding: 9px 0; border-top: 1px solid #e5e5ea; }
.todo p i { width: 16px; height: 16px; border-radius: 5px; border: 2px solid #c7c7cc; flex: none; }
.todo p { color: #1d1d1f; }
.todo p.ok i { background: #0a84ff; border-color: #0a84ff; } .todo p.ok span { text-decoration: line-through; color: #6e6e73; }
.app small { color: #6e6e73; }
.wx *, .wx div { color: #fff; }
@media (min-width: 861px) { .acc-card .vis > * { zoom: 1.45; } }
.app { width: min(100%, 560px); display: grid; grid-template-columns: 1fr 1.4fr; gap: 12px; }
.app > div { border-radius: 16px; background: #f5f5f7; color: #1d1d1f; padding: 14px; font-size: 13px; }
.app .big { font: 700 30px var(--sans); letter-spacing: -.03em; margin: 4px 0; color: #1d1d1f; }
.app .bar { height: 8px; border-radius: 9px; background: #e5e5ea; margin-top: 8px; overflow: hidden; } .app .bar i { display: block; height: 100%; width: 64%; background: #0a84ff; }
.app li { list-style: none; display: flex; justify-content: space-between; padding: 6px 0; border-top: 1px solid #e5e5ea; }
.app ul { margin: 0; padding: 0; }

/* Shorts */
.acc-shorts { display: flex; gap: 14px; overflow-x: auto; scrollbar-width: none; margin: 34px calc(var(--gut) * -1) 0; padding: 0 var(--gut) 8px; scroll-snap-type: x proximity; scroll-padding-inline: var(--gut); }
.acc-shorts::-webkit-scrollbar { display: none; }
.acc-short { flex: 0 0 clamp(150px, 22vw, 210px); aspect-ratio: 9 / 16; border-radius: 22px; position: relative; overflow: hidden; scroll-snap-align: start;
  border: 1px solid var(--line-2); background: linear-gradient(180deg, var(--bg-3), var(--bg-2)); padding: 58px 16px 18px; display: flex; flex-direction: column; justify-content: space-between; }
.acc-short code { font: 13px/1.6 var(--mono); color: var(--accent-3); white-space: pre; }
.acc-short b { font-size: 16px; line-height: 1.25; }
.acc-short small { display: block; color: var(--text-3); margin-top: 6px; font-size: 12px; }
.acc-short::after { content: "▶"; position: absolute; top: 14px; right: 14px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  font-size: 11px; background: rgba(255,255,255,.14); color: #fff; }

/* FAQ */
.acc-faq { max-width: 820px; margin-top: 26px; }
.acc-faq details { border-top: 1px solid var(--line-2); margin: 0; }
.acc-faq details:last-child { border-bottom: 1px solid var(--line-2); }
.acc-faq summary::before, .acc-faq details[open] summary::before { content: none; display: none; }
.acc-faq details[open] summary { margin-bottom: 0; }
.acc-faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 22px 0; border: 0; border-radius: 0; background: none; text-align: left; color: var(--text); font: 600 clamp(17px, 2vw, 20px) var(--sans); }
.acc-faq summary:hover { background: none; }
.acc-faq summary::-webkit-details-marker { display: none; }
.acc-faq summary::after { content: "+"; color: var(--text-3); font-weight: 400; font-size: 26px; line-height: 1; transition: transform .4s var(--ease); }
.acc-faq details[open] summary::after { transform: rotate(45deg); }
.acc-faq details p { margin: -6px 0 22px; color: var(--text-2); line-height: 1.6; max-width: 62ch; }

/* Comment ça marche (bas de page) */
.acc-how { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 26px; }
.acc-how div { padding: 28px 26px; border-radius: 24px; border: 1px solid var(--line); background: var(--glass); }
.acc-how svg { width: 40px; height: 40px; stroke: var(--text); fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.acc-how b { display: block; margin: 18px 0 8px; font-size: 22px; letter-spacing: -.02em; } .acc-how p { margin: 0; color: var(--text-2); font-size: 16px; line-height: 1.5; }
.acc-foot { padding: 40px var(--gut) 60px; color: var(--text-3); font-size: 13px; border-top: 1px solid var(--line); }

@media (max-width: 860px) {
  .acc-stack-in { aspect-ratio: 520 / 775; }
  .acc-stack { padding-top: 96px; }
  .acc-hero { grid-template-columns: minmax(0, 1fr); }
  .acc-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .acc-card { flex-basis: 84vw; } .acc-track { padding-inline: 8vw; gap: 10px; }
  .acc-card .vis { aspect-ratio: 4 / 3.2; padding: 14px; }
  .acc-how { grid-template-columns: minmax(0, 1fr); }
  .acc-resume { flex-wrap: wrap; } .acc-resume a { margin-left: 0; width: 100%; justify-content: center; }
  .app { grid-template-columns: minmax(0, 1fr); } .app > div:first-child { display: none; }
  .wx { flex-wrap: nowrap; gap: 10px; }
  .wx div { width: auto; flex: 1; padding: 12px; border-radius: 14px; }
  .wx b { font-size: 26px; }
  .term { font-size: 11px; padding: 30px 12px 12px; }
}
/* Accueil intégré : badge des projets à venir, programme, choix de l'élève. */
.acc-card .txt { position: relative; }
.acc-card .bientot { position: absolute; top: 18px; right: 18px; font: 600 11px/1 var(--sans); font-style: normal; letter-spacing: .06em; text-transform: uppercase;
  color: var(--bg); background: var(--metal); padding: 5px 9px; border-radius: 99px; }
.acc .acc-progression { max-width: 320px; margin: 18px 0 28px; }
.acc .part-list { margin-top: 0; }
.acc-hero .mes-choix { margin-top: 18px; }
.acc-card .bientot { position: static; }
.acc h1 em, .acc h2 em { padding-right: .12em; margin-right: -.12em; }   /* le reflet métal ne tranche plus la dernière lettre */
.term .d { color: #8e8e93; }
.acc h1 em, .acc h2 em { -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.app small { font-size: max(11px, 1em); }
.mes-choix-mod { white-space: nowrap; }

/* Sommaire : titres de partie et numéros un peu plus clairs (contraste suffisant sur le fond du sommaire). */
.sidebar h4, .sidebar li a .n { color: color-mix(in srgb, var(--text-3) 85%, var(--text)); }
/* Un mot très long dans un grand titre se coupe proprement au lieu de faire déborder la page. */
main.lesson h1 { overflow-wrap: break-word; hyphens: auto; }
.sidebar li a.current .n, .sidebar .brand > span { color: color-mix(in srgb, var(--accent) 55%, var(--text)); }

/* ---------- Accueil : retour à la DA d'origine ----------
   Lueur colorée de la finition en fond (celle du body), titres en titane,
   mot fort dans le dégradé de couleur, petits titres en pastille d'accent. */
.acc h1, .acc h2 {
  background: var(--metal); background-size: 300% 100%; background-position: var(--reflet, 50%) 0;
  -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: .14em;
}
.acc h1 em, .acc h2 em {
  background: var(--gradient); background-size: 100% 100%; -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
}
.acc-kick { display: inline-block; width: fit-content; color: var(--accent); letter-spacing: .06em; font-size: 12px;
  background: color-mix(in srgb, var(--accent) 12%, transparent); padding: 6px 12px; border-radius: 999px;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent); }

/* ---------- Lecteur : un vrai rectangle 16:9 qui se réduit d'un bloc ----------
   Le cadre prend la place disponible (largeur, et hauteur maximale --hmax) en gardant le 16:9.
   L'écran est dessiné à 1120 × 630 puis mis à l'échelle (--k, calculé dans video.js). */
.vm-player { --hmax: 46vh; }
.vm-cadre, .vm-player .vm-controls { width: min(100%, calc(var(--hmax) * 16 / 9)); margin-inline: auto; }
.vm-cadre { position: relative; aspect-ratio: 16 / 9; margin-inline: auto; }
body.vm-on .vm-player { --hmax: 72vh; }
.vm-player:fullscreen, .vm-player:-webkit-full-screen { --hmax: calc(100vh - 110px); }
.vm-player.vm-pseudo { --hmax: calc(100dvh - 90px); }
/* Même image partout : l'ordinateur et le téléphone voient la même vidéo, réduite d'un bloc. */
.vm-player .vm-stage { position: absolute; top: 0; left: 0; width: 1120px !important; height: 630px !important; max-height: none !important;
  aspect-ratio: auto; transform: scale(var(--k, 1)); transform-origin: 0 0; }
@media (max-width: 700px) {
  .vm-cadre, .vm-player .vm-controls { width: 100%; }
  .vm-qr { display: none !important; }                       /* déjà sur le téléphone */
  .vm-music { display: none !important; }                    /* une seule ligne de boutons */
  .vm-controls { flex-wrap: wrap; row-gap: 6px; }
}
/* Plein écran sur iPhone tenu droit : le lecteur pivote en paysage et prend tout l'écran. */
@media (max-width: 700px) and (orientation: portrait) {
  body.vm-on .vm-player.vm-pseudo, .vm-player.vm-pseudo { width: 100dvh !important; height: 100vw !important; inset: auto !important; top: 0 !important; left: 100vw !important;
    transform: rotate(90deg) !important; transform-origin: top left; --hmax: calc(100vw - 76px);
    padding: 0 env(safe-area-inset-top) !important; }
  .vm-player.vm-pseudo .vm-cadre, .vm-player.vm-pseudo .vm-controls { width: min(100%, calc(var(--hmax) * 16 / 9)) !important; }
}
@media (max-width: 360px) {
  .vm-controls button, .vm-controls select { min-width: 32px !important; min-height: 36px; }
  .vm-controls { gap: 0; }
}

/* Fenêtre « Continuer sur ton téléphone » (QR code) */
.vm-qr-boite { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(0,0,0,.55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.vm-qr-carte { position: relative; width: min(340px, 90%); padding: 26px 24px 20px; border-radius: 22px; text-align: center;
  background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line-2), 0 30px 80px rgba(0,0,0,.5); }
.vm-qr-carte b { display: block; font: 600 17px var(--sans); margin-bottom: 14px; }
.vm-qr-code { width: 200px; height: 200px; margin: 0 auto; padding: 10px; border-radius: 14px; background: #fff; color: #1d1d1f; display: grid; place-items: center; font-size: 12px; overflow-wrap: anywhere; }
.vm-qr-code svg { width: 100%; height: 100%; display: block; }
.vm-qr-carte p { margin: 14px 0 0; color: var(--text-2); font-size: 14px; line-height: 1.45; }
.vm-qr-carte .vm-qr-note { margin-top: 10px; color: var(--text-3); font-size: 12.5px; }
.vm-qr-fermer { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border: 0; border-radius: 50%; display: grid; place-items: center;
  background: var(--glass-2); color: var(--text); cursor: pointer; }

/* Schéma de quatre cases sans flèches : grille 2 × 2, équilibrée. */
.illu-flux.grille2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 560px; margin-inline: auto; }

/* ---------- Pages Bonus ---------- */
.bonus-menu .n { font-size: 13px; }
.outils { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 18px auto 8px; }
.outil { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border-radius: 16px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line); text-decoration: none; color: var(--text); transition: transform .4s var(--ease), box-shadow .4s var(--ease); }
.outil:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px var(--line-2); color: var(--text); }
.outil b { font: 600 16px var(--sans); }
.outil span { color: var(--text-2); font: 400 14px/1.45 var(--sans); flex: 1; }
.outil em { font: 500 12px var(--sans); font-style: normal; color: var(--text-3); }

.pg-tete { display: flex; align-items: center; gap: 32px; margin: 28px auto; }
.pg-anneau { --p: 0; flex: none; width: 140px; height: 140px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--glass-2) 0); }
.pg-anneau b { display: grid; place-items: center; width: 116px; height: 116px; border-radius: 50%; background: var(--bg); font: 700 36px var(--sans); letter-spacing: -0.03em; }
.pg-anneau small { font-size: 16px; color: var(--text-2); margin-left: 2px; }
.pg-anneau b { display: flex; align-items: baseline; justify-content: center; padding-top: 38px; box-sizing: border-box; }
.pg-chiffres p { margin: 6px 0; color: var(--text-2); }
.pg-chiffres b { color: var(--text); font-size: 18px; }
.pg-reprendre { margin: 4px 0 8px; }
.pg-fin { font-weight: 600; }
.pg-parties { display: grid; gap: 12px; margin-top: 16px; }
.pg-partie { padding: 16px 18px; border-radius: 16px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line); }
.pg-ligne { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.pg-ligne span { color: var(--text-2); font-variant-numeric: tabular-nums; }
.pg-barre { height: 6px; margin: 10px 0 12px; border-radius: 999px; background: var(--glass-2); overflow: hidden; }
.pg-barre i { display: block; height: 100%; border-radius: 999px; background: var(--gradient); }
.pg-partie ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.pg-partie li a { display: grid; place-items: center; min-width: 34px; height: 30px; padding: 0 6px; border-radius: 8px; font: 600 12px var(--mono); color: var(--text-3); background: var(--glass); text-decoration: none; box-shadow: inset 0 0 0 1px var(--line); }
.pg-partie li.lu a { color: var(--on-accent); background: var(--accent); box-shadow: none; }
.pg-partie li.prochain a { color: var(--text); box-shadow: inset 0 0 0 1.5px var(--accent); }
.pg-projets { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-top: 16px; }
.pg-projet { padding: 14px 16px; border-radius: 14px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line); display: flex; flex-direction: column; gap: 4px; }
.pg-projet span { color: var(--text-3); font-size: 13px; }
.pg-projet.fait { box-shadow: inset 0 0 0 1.5px var(--accent); }
.pg-projet.fait span { color: var(--accent); }
.pg-note { margin-top: 28px; color: var(--text-3); font-size: 14px; }

.pf-form { display: grid; gap: 12px; }
.pf-champ { display: grid; gap: 6px; }
.pf-champ span { font: 600 14px var(--sans); }
.pf-champ input { font: 400 15px var(--sans); color: var(--text); background: var(--bg-2); border: 0; border-radius: 12px; padding: 12px 14px; box-shadow: inset 0 0 0 1px var(--line-2); outline: none; }
.pf-champ input:focus { box-shadow: inset 0 0 0 1.5px var(--accent); }
.pf-champ input::placeholder { color: var(--text-3); }
.pf-projet-champ small { display: block; margin-top: 6px; color: var(--text-3); font-size: 13px; }
.pf-projet-champ.verrou .pf-champ span::after { content: " · pas encore terminé"; color: var(--text-3); font-weight: 400; }
.pf-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px auto; }
.btn.pf-sec { background: var(--glass-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn.pf-sec:hover { color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.pf-carte { margin-top: 8px; padding: 36px 36px 28px; border-radius: 20px; background: #fbfbfd; color: #1d1d1f; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.pf-carte header { padding-bottom: 20px; margin-bottom: 8px; border-bottom: 1px solid #e5e5ea; }
.pf-carte h3 { margin: 0; font: 700 30px var(--sans); letter-spacing: -0.03em; color: #1d1d1f; }
.pf-carte header p { margin: 4px 0 6px; color: #515154; }
.pf-carte a { color: #0066cc; font-weight: 500; text-decoration: none; }
.pf-carte section { padding: 18px 0; border-bottom: 1px solid #ececf0; }
.pf-carte section:last-child { border-bottom: 0; }
.pf-carte h4 { margin: 0 0 6px; font: 600 18px var(--sans); color: #1d1d1f; }
.pf-carte section p { margin: 0 0 10px; color: #3a3a3c; line-height: 1.5; }
.pf-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.pf-tags span { font: 500 12px var(--sans); padding: 4px 10px; border-radius: 999px; background: #eeeef3; color: #3a3a3c; }
.pf-vide { color: #6e6e73; padding: 18px 0 4px; }
@media print {
  body[data-chap="portfolio"] * { visibility: hidden; }
  body[data-chap="portfolio"] .pf-carte, body[data-chap="portfolio"] .pf-carte * { visibility: visible; }
  body[data-chap="portfolio"] .pf-carte { position: absolute; left: 0; top: 0; width: 100%; box-shadow: none; border-radius: 0; padding: 0; }
}
.acc-bonus { margin-top: 28px; text-align: center; color: var(--text-3); font-size: 14.5px; } .acc-bonus a { color: var(--text-2); }
.outils .outil:last-child:nth-child(odd) { grid-column: 1 / -1; }

/* ---------- Site de vente (site/) : même direction artistique que l'accueil ---------- */
.vente .palette-picker { display: none !important; }        /* le choix des finitions reste dans la formation */
.vente .acc-top { gap: 16px; }
.vente-mini { padding: 10px 18px; font-size: 14px; }
.vente-cta { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 26px; }
.vente-lien { color: var(--text-2); font-weight: 500; text-decoration: none; border-bottom: 1px solid var(--line-2); padding-bottom: 2px; }
.vente-lien:hover { color: var(--text); }
.vente-intro { max-width: 640px; color: var(--text-2); font-size: 17px; line-height: 1.55; margin: 14px 0 0; }
.vente-programme { max-width: 820px; margin-top: 26px; }
.vente-programme details { border-top: 1px solid var(--line-2); }
.vente-programme details:last-child { border-bottom: 1px solid var(--line-2); }
.vente-programme summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: 14px; padding: 20px 0; background: none; border: 0; }
.vente-programme summary::-webkit-details-marker { display: none; }
.vente-programme summary::before, .vente-programme details[open] summary::before { content: none; display: none; }
.vente-programme summary b { font: 600 19px var(--sans); letter-spacing: -0.01em; }
.vente-programme summary span { color: var(--text-3); font-size: 14px; }
.vente-programme summary::after { content: "+"; margin-left: auto; color: var(--text-3); font-size: 26px; line-height: 1; transition: transform .4s var(--ease); }
.vente-programme details[open] summary::after { transform: rotate(45deg); }
.vente-programme ol { list-style: none; margin: 0 0 22px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 28px; }
.vente-programme li { display: flex; gap: 12px; align-items: baseline; color: var(--text-2); font-size: 15px; line-height: 1.4; }
.vente-programme .n { flex: none; min-width: 30px; font: 600 12px var(--mono); color: var(--text-3); }
.vente-offre { max-width: 560px; margin: 30px auto 0; padding: 40px 40px 32px; border-radius: 28px; text-align: center;
  background: var(--glass); box-shadow: inset 0 0 0 1px var(--line-2), 0 40px 120px rgba(0,0,0,.35); }
.vente-prix { display: flex; justify-content: center; align-items: baseline; gap: 14px; }
.vente-prix b { font: 700 64px var(--sans); letter-spacing: -0.04em; background: var(--metal); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: .06em; }
.vente-prix s { color: var(--text-3); font-size: 24px; }
.vente-inclus { list-style: none; padding: 0; margin: 26px 0 30px; text-align: left; display: grid; gap: 12px; }
.vente-inclus li { position: relative; padding-left: 30px; color: var(--text-2); line-height: 1.45; }
.vente-inclus li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--accent); font-weight: 700; }
.vente-acheter { margin: 0 auto; }
.btn.inactif { opacity: .55; cursor: default; pointer-events: none; }
.vente-note { margin: 14px 0 0; color: var(--text-3); font-size: 13px; }
@media (max-width: 700px) {
  .vente-programme ol { grid-template-columns: 1fr; }
  .vente-offre { padding: 30px 22px 26px; }
  .vente-prix b { font-size: 52px; }
}

/* ---------- Connexion (espace élève) ---------- */
.formall-lien { text-decoration: none; color: inherit; }
.connexion { display: grid; place-items: center; min-height: 70vh; }
.connexion-carte { width: min(440px, 100%); padding: 38px 34px 28px; border-radius: 28px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line-2), 0 40px 120px rgba(0,0,0,.35); }
.connexion-carte h2 { margin: 12px 0 22px; }
.connexion-carte form { display: grid; gap: 14px; }
.connexion-carte .acc-btn { width: 100%; justify-content: center; }
.connexion-fournisseur { width: 100%; padding: 14px; margin-bottom: 10px; border-radius: 999px; border: 0; cursor: pointer; font: 600 15px var(--sans);
  color: var(--text); background: var(--glass-2); box-shadow: inset 0 0 0 1px var(--line-2); transition: box-shadow .3s var(--ease); }
.connexion-fournisseur:hover { box-shadow: inset 0 0 0 1px var(--text-3); }
.connexion-ou { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 13px; margin: 16px 0; }
.connexion-ou::before, .connexion-ou::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.connexion-texte { color: var(--text-2); line-height: 1.5; margin: 0 0 4px; }
.connexion-alerte { padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--text); font-size: 14px; line-height: 1.45; margin: 0 0 18px; }
.connexion-retour { background: none; border: 0; border-bottom: 1px solid var(--line-2); cursor: pointer; font: inherit; justify-self: center; }
.connexion-appareils { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; }
.connexion-appareils li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line); }
.connexion-appareils li div { display: grid; gap: 3px; }
.connexion-appareils small { color: var(--text-3); font-size: 12.5px; }
.connexion-appareils .btn { padding: 8px 14px; font-size: 13px; }
.connexion-pied { margin: 22px 0 0; text-align: center; color: var(--text-3); font-size: 14px; }
.connexion-pied a { color: var(--text-2); }

/* Filigrane : l'e-mail de l'élève, discret, change de place de temps en temps. */
.vm-filigrane { position: absolute; z-index: 6; pointer-events: none; user-select: none; font: 500 15px var(--sans); letter-spacing: .02em;
  color: rgba(255,255,255,.13); white-space: nowrap; transition: top 1.2s var(--ease), left 1.2s var(--ease); }
.vm-ecran-bloque { position: absolute; inset: 0; z-index: 40; display: grid; place-items: center; text-align: center; padding: 30px;
  background: rgba(0,0,0,.82); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.vm-ecran-bloque p { max-width: 420px; color: var(--text-2); line-height: 1.5; margin: 10px auto 20px; }
.sidebar .deconnexion { display: block; width: 100%; margin: 4px 0 18px; padding: 9px 12px; border: 0; border-radius: 12px; cursor: pointer; font: 500 13px var(--sans); color: var(--text-2); background: var(--glass); box-shadow: inset 0 0 0 1px var(--line); text-align: left; }
.connexion-carte [hidden] { display: none !important; }
