/* =====================================================================
   Git & GitHub en images — styles
   ===================================================================== */
:root {
  --bg: #f5f6fb;
  --ink: #1c2233;
  --muted: #667085;
  --card: #ffffff;
  --line: #e3e6ef;
  --alice: #7c4dff;
  --bob: #0ca678;
  --accent: #ff6b35;
  --accent2: #ff9f1c;
  --blue: #2f81f7;
  --gh: #24292f;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 16px;
  --shadow: 0 10px 30px -12px rgba(28, 34, 51, .25);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 70px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 16px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; overflow-x: clip;
}
a { color: inherit; }
code, .mono { font-family: var(--mono); font-size: .86em; }
p code, li code, .narr-d code, .keep code, dd code, .ch-intro code, .gloss code, .qq code, .qwhy code, small code, .tip code {
  background: #eef0f7; border: 1px solid #e0e3ee; padding: 1px 5px; border-radius: 6px; white-space: nowrap;
}
.muted { color: var(--muted); }
.c-alice { color: var(--alice); }
.c-bob { color: var(--bob); }

/* ---------- boutons ---------- */
.btn {
  font: inherit; font-weight: 800; font-size: 14px; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  padding: 9px 14px; border-radius: 12px; border: 1.5px solid #d6dae6; background: #fff; color: var(--ink);
  transition: transform .12s, box-shadow .15s, background .15s, opacity .15s;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 16px -8px rgba(0,0,0,.35); }
.btn:disabled { opacity: .38; cursor: default; }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; border-color: transparent; }
.btn.big { padding: 13px 22px; font-size: 16px; border-radius: 14px; }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 100; display: flex; align-items: center; gap: 18px;
  padding: 10px 22px; background: rgba(255,255,255,.86); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 900; text-decoration: none; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.brand em { font-style: normal; color: var(--accent); }
.brand-ic { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--ink); color: #fff; font-size: 17px; }
.nav-links { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a { text-decoration: none; font-weight: 700; font-size: 14px; padding: 5px 10px; border-radius: 999px; color: var(--muted); white-space: nowrap; }
.nav-links a:hover { background: #eef0f7; color: var(--ink); }
.nav-links a.on { background: var(--ink); color: #fff; }
.speed { display: flex; background: #eef0f7; border-radius: 999px; padding: 3px; }
.speed button { border: 0; background: transparent; font: inherit; font-weight: 800; font-size: 13px; padding: 3px 9px; border-radius: 999px; cursor: pointer; color: var(--muted); }
.speed button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--alice), var(--accent), var(--bob)); }

/* ---------- héro ---------- */
.hero {
  max-width: 1200px; margin: 0 auto; padding: 60px 24px 40px;
  display: grid; grid-template-columns: 1fr 1.1fr; gap: 30px; align-items: center;
}
.kicker { text-transform: uppercase; letter-spacing: .12em; font-size: 12.5px; font-weight: 900; color: var(--accent); }
.hero h1 { font-size: clamp(42px, 6vw, 72px); line-height: 1.02; margin: 10px 0 18px; font-weight: 900; letter-spacing: -.02em; }
.hero h1 span { background: linear-gradient(90deg, var(--alice), var(--accent) 55%, var(--bob)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: 19px; color: #3b4357; max-width: 540px; }
.hero-btns { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.hero-svg { width: 100%; height: auto; overflow: visible; }
.hp { fill: none; stroke: #c3c8d6; stroke-width: 3; stroke-dasharray: 7 8; animation: dash 1.2s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -15; } }
.h-gh { font: 900 17px 'Nunito', sans-serif; fill: var(--gh); }
.h-name { font: 800 16px 'Nunito', sans-serif; fill: var(--ink); }
.hl-push, .hl-pull { font: 700 13px var(--mono); }
.hl-push { fill: var(--alice); } .hl-pull { fill: var(--bob); }
.pk { stroke-width: 2; }
.pk-a { fill: #fff7e6; stroke: var(--accent2); }
.pk-b { fill: #e9fbf4; stroke: var(--bob); }
.pk-t { font-size: 12px; }
.blink { animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .2; } }

/* ---------- sections ---------- */
.sec, .chapter { max-width: 1200px; margin: 0 auto; padding: 50px 24px; }
.chapter { max-width: 1440px; }
.sec-head { text-align: center; margin-bottom: 28px; }
.sec-head h2, .chapter h2 { font-size: clamp(26px, 3.4vw, 38px); line-height: 1.15; margin: 6px 0; font-weight: 900; letter-spacing: -.01em; }
h3.sub { text-align: center; font-size: 24px; margin: 50px 0 18px; font-weight: 900; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.big-card h3 { margin: 6px 0 6px; font-size: 26px; }
.card-ic { font-size: 40px; }
.analogy { margin-top: 12px; background: #fff6ee; border: 1px dashed #ffc49b; padding: 10px 14px; border-radius: 12px; font-weight: 700; }

/* zones */
.zones-wrap { display: flex; align-items: stretch; gap: 10px; justify-content: center; }
.zones-pc { border: 2px dashed #b9bfd0; border-radius: 20px; padding: 26px 14px 14px; position: relative; flex: 1; max-width: 820px; }
.zones-pc-label { position: absolute; top: -14px; left: 20px; background: var(--bg); padding: 0 8px; font-weight: 900; }
.zones { display: flex; align-items: center; gap: 8px; }
.zbox { flex: 1; background: #fff; border-radius: 14px; box-shadow: var(--shadow); padding: 14px 12px; text-align: center; display: flex; flex-direction: column; gap: 3px; min-width: 0; border-top: 5px solid; }
.zbox small { color: var(--muted); line-height: 1.3; }
.zi { font-size: 30px; }
.z1 { border-color: #ffb020; } .z2 { border-color: var(--blue); } .z3 { border-color: var(--alice); } .z4 { border-color: var(--gh); flex: 0 0 170px; align-self: center; }
.zarrow { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 0 0 auto; }
.zarrow code { font-weight: 700; background: var(--ink); color: #fff; padding: 2px 8px; border-radius: 6px; font-size: 12px; }
.ar { position: relative; width: 70px; height: 4px; background: #c9cedb; border-radius: 4px; overflow: visible; }
.ar::after { content: ''; position: absolute; right: -2px; top: -5px; border: 7px solid transparent; border-left: 10px solid #c9cedb; border-right: 0; }
.ar i { position: absolute; top: -3px; left: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); animation: travel 1.8s ease-in-out infinite; }
@keyframes travel { from { left: 0; opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } to { left: 60px; opacity: 0; } }
.zpush { align-self: center; }
.zback { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 16px; font-weight: 700; color: #3b4357; flex-wrap: wrap; text-align: center; }
.ar-back { position: relative; width: 120px; height: 4px; background: #c9cedb; border-radius: 4px; }
.ar-back::before { content: ''; position: absolute; left: -2px; top: -5px; border: 7px solid transparent; border-right: 10px solid #c9cedb; border-left: 0; }
.ar-back i { position: absolute; top: -3px; right: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--bob); animation: travelBack 1.8s ease-in-out infinite; }
@keyframes travelBack { from { right: 0; opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } to { right: 110px; opacity: 0; } }
.zback code { background: var(--ink); color: #fff; padding: 2px 8px; border-radius: 6px; }

/* légende */
.legend { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.lg { display: flex; gap: 12px; align-items: flex-start; background: #fff; border-radius: 14px; padding: 14px; box-shadow: var(--shadow); font-size: 14.5px; }
.lg-ic { flex: 0 0 auto; min-width: 46px; height: 40px; display: inline-flex; gap: 2px; align-items: center; justify-content: center; font-size: 20px; background: #f1f3f9; border-radius: 10px; padding: 0 6px; font-weight: 900; }
.k-u, .k-m, .k-s, .k-c { font-family: var(--mono); font-weight: 800; font-size: 13px; padding: 0 4px; border-radius: 4px; }
.k-u { color: #1f9d4c; } .k-m { color: #c98a00; } .k-s { color: var(--blue); } .k-c { color: #e5484d; }

/* parties & chapitres */
.part {
  max-width: 1200px; margin: 40px auto 0; padding: 0 24px; display: flex; align-items: center; gap: 14px;
  font-size: clamp(22px, 3vw, 30px); font-weight: 900;
}
.part span { background: var(--ink); color: #fff; font-size: 13px; text-transform: uppercase; letter-spacing: .12em; padding: 6px 12px; border-radius: 999px; }
.part::after { content: ''; flex: 1; height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--line), transparent); }
.chapter { border-top: 1px solid transparent; }
.ch-head { display: flex; align-items: center; gap: 16px; max-width: 1200px; margin: 0 auto; }
.ch-num { flex: 0 0 auto; width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; font-weight: 900; font-size: 28px; color: #fff; background: linear-gradient(135deg, var(--alice), var(--accent)); box-shadow: var(--shadow); }
.ch-intro { max-width: 1200px; margin: 12px auto 22px; font-size: 17.5px; color: #3b4357; }
.keep { max-width: 1200px; margin: 22px auto 0; background: #fffbea; border: 1.5px solid #ffe08a; border-radius: 14px; padding: 16px 20px; font-size: 15.5px; }
.keep > b:first-child { display: block; margin-bottom: 4px; font-size: 16.5px; }
.keep ul, .keep ol { margin: 6px 0 8px; padding-left: 22px; }
.routine { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; font-weight: 800; color: var(--muted); }
.routine span { background: #fff; border: 1.5px solid #f1d27a; border-radius: 999px; padding: 4px 12px; color: var(--ink); }

/* =====================================================================
   SCÈNE
   ===================================================================== */
.scene { max-width: 1440px; margin: 0 auto; }
.scene:empty { min-height: 860px; }
@media (max-width: 980px) { .scene:empty { min-height: 2000px; } }
.scene-bar {
  position: sticky; top: 58px; z-index: 30;
  display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 16px; align-items: center;
  background: rgba(255,255,255,.95); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-radius: 16px; box-shadow: var(--shadow); padding: 14px 18px; margin-bottom: 16px; border: 1px solid var(--line);
}
.narr-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.narr-k { font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); }
.dots { display: flex; gap: 5px; }
.dot { width: 13px; height: 13px; border-radius: 50%; border: 2px solid #c9cedb; background: #fff; padding: 0; cursor: pointer; transition: transform .15s; }
.dot:hover { transform: scale(1.25); }
.dot.done { background: #c9cedb; }
.dot.cur { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,107,53,.25); }
.narr-t { margin: 3px 0 2px; font-size: 19px; font-weight: 900; }
.narr-d { font-size: 15px; color: #3b4357; max-width: 900px; }
.tip { margin-top: 6px; font-size: 13.5px; background: #eef5ff; border-radius: 10px; padding: 6px 10px; color: #29466e; }
.narr-c { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; align-items: center; }
.narr-c:empty { display: none; }
.cmdchip {
  font-family: var(--mono); font-size: 12.5px; background: #1e1e2e; color: #e6e6f0; padding: 3px 9px; border-radius: 7px; cursor: copy;
  position: relative; border: 0; white-space: nowrap;
}
.cmdchip::before { content: '$ '; color: #3fb950; }
.cmdchip.demo { cursor: default; }
.cmdchip.copied::after, .copyable.copied::after {
  content: 'copié ✓'; position: absolute; left: 50%; top: -24px; transform: translateX(-50%);
  background: var(--ink); color: #fff; font: 700 11px 'Nunito', sans-serif; padding: 2px 7px; border-radius: 6px; white-space: nowrap;
}
.next-ch { font-weight: 800; color: var(--accent); text-decoration: none; margin-left: 6px; }
.controls { display: flex; gap: 6px; align-items: center; }
.controls .btn { padding: 9px 12px; }
.controls [data-c=next] { min-width: 170px; }
.controls [data-c=auto].on { background: var(--ink); color: #fff; border-color: var(--ink); }

.stage {
  position: relative; display: grid; grid-template-columns: minmax(0,1fr) minmax(0,.9fr) minmax(0,1fr); gap: 18px; align-items: start;
}
.col { position: relative; min-width: 0; --c: #888; }
.who { display: flex; align-items: center; gap: 10px; height: 46px; margin-bottom: 6px; }
.avatar { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; background: #fff; box-shadow: 0 0 0 3px var(--c), var(--shadow); transition: box-shadow .3s, transform .3s; }
.who-t { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.who-t b { font-size: 15.5px; white-space: nowrap; }
.who-t small { color: var(--muted); font-size: 12.5px; }
.sync { margin-left: auto; display: flex; flex-direction: column; gap: 2px; align-items: flex-end; }
.sb { font-size: 11.5px; font-weight: 800; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.sb.ok { background: #e3f8ea; color: #137333; }
.sb.up { background: #e6f0ff; color: #1d5fd1; }
.sb.down { background: #fff1db; color: #b25e00; }
.sb.gray { background: #eef0f5; color: var(--muted); }
.col.active .avatar { transform: scale(1.1); box-shadow: 0 0 0 4px var(--c), 0 0 0 9px color-mix(in srgb, var(--c) 22%, transparent), var(--shadow); }

/* ordinateur portable */
.laptop { position: relative; }
.screen {
  position: relative; border: 7px solid #2a2d37; border-bottom-width: 9px; border-radius: 14px 14px 4px 4px; background: #1e1e2e;
  overflow: hidden; transition: box-shadow .3s;
}
.col.active .screen { box-shadow: 0 0 0 3px var(--c), 0 14px 34px -12px var(--c); }
.base { height: 12px; margin: 0 -5%; background: linear-gradient(#4a4f5e, #2f333f); border-radius: 0 0 14px 14px; position: relative; }
.base::after { content: ''; position: absolute; left: 50%; top: 0; transform: translateX(-50%); width: 70px; height: 5px; border-radius: 0 0 6px 6px; background: #22252e; }
.titlebar { height: 24px; background: #2b2b3c; display: flex; align-items: center; gap: 5px; padding: 0 8px; color: #9da2b8; font-size: 11px; }
.titlebar i { width: 9px; height: 9px; border-radius: 50%; background: #ff5f57; }
.titlebar i:nth-child(2) { background: #febc2e; } .titlebar i:nth-child(3) { background: #28c840; }
.tb-title { flex: 1; text-align: center; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bell { opacity: .55; font-size: 12px; }
.bell.ring { opacity: 1; animation: ring .9s ease-in-out 2; }
@keyframes ring { 0%,100% { transform: rotate(0); } 20% { transform: rotate(18deg); } 40% { transform: rotate(-16deg); } 60% { transform: rotate(10deg); } 80% { transform: rotate(-6deg); } }
.ide { height: 238px; display: flex; }
.explorer { width: 30%; min-width: 92px; max-width: 128px; background: #252536; color: #c5c8d6; font-size: 11.5px; overflow: hidden; }
.ex-head { font-size: 9.5px; letter-spacing: .1em; padding: 6px 8px; color: #8b8fa3; font-weight: 800; }
.ex-row { padding: 2px 8px; white-space: nowrap; display: flex; align-items: center; gap: 4px; overflow: hidden; }
.ex-row span { overflow: hidden; text-overflow: ellipsis; }
.ex-row.folder { color: #e0e2ec; font-weight: 700; }
.ex-row.git-folder { color: #8b8fa3; font-style: italic; padding-left: 16px; }
.ex-row.file { padding-left: 16px; cursor: pointer; border-radius: 4px; }
.ex-row.file:hover { background: #2f2f45; }
.ex-row.sel { background: #37375a; color: #fff; }
.ex-empty, .ed-empty { color: #6e7389; font-style: italic; padding: 8px; font-size: 11.5px; }
.ed-empty { padding: 20px; text-align: center; }
.st { margin-left: auto; font-family: var(--mono); font-size: 10.5px; font-weight: 800; }
.st-u { color: #3fb950; } .st-m { color: #e3b341; } .st-s { color: #58a6ff; } .st-c { color: #ff6b6b; }
.editor { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tabs { height: 25px; background: #252536; display: flex; overflow: hidden; flex: 0 0 auto; }
.tab { font-size: 11px; color: #8b8fa3; padding: 4px 9px; white-space: nowrap; cursor: pointer; border-top: 2px solid transparent; }
.tab:hover { color: #d0d3e0; }
.tab.on { background: #1e1e2e; color: #fff; border-top-color: var(--accent); }
.prev-tab { margin-left: auto; }
.code { flex: 1; overflow: auto; position: relative; padding: 5px 0; font-family: var(--mono); font-size: 11.3px; line-height: 16.5px; color: #abb2bf; scrollbar-width: thin; scrollbar-color: #444 transparent; }
.ln { display: flex; white-space: pre; min-height: 16.5px; }
.ln .n { flex: 0 0 26px; text-align: right; padding-right: 9px; color: #4d5366; user-select: none; }
.ln .t { flex: 1; }
.ln.chg .n { box-shadow: inset 3px 0 #3fb950; color: #7d8599; }
.ln.flash { animation: flash 1.6s ease-out; }
@keyframes flash { 0% { background: rgba(255, 214, 10, .45); } 100% { background: transparent; } }
.ln.add { background: rgba(63, 185, 80, .22); }
.ln.add .n { color: #3fb950; }
.ln.del { background: rgba(248, 81, 73, .25); text-decoration: line-through; text-decoration-color: rgba(255,120,120,.8); opacity: .85; transition: opacity .8s; }
.ln.del .n { color: #f85149; }
.ln.ours { background: rgba(63, 185, 80, .16); }
.ln.theirs { background: rgba(56, 139, 253, .2); }
.ln.cf { background: rgba(248, 81, 73, .18); }
.t-tag { color: #e06c75; } .t-attr { color: #d19a66; } .t-str { color: #98c379; } .t-com { color: #7f848e; font-style: italic; }
.t-sel { color: #e5c07b; } .t-prop { color: #61afef; } .t-val { color: #98c379; } .t-num { color: #d19a66; } .t-pun { color: #abb2bf; }
.t-cf { color: #ff7b72; font-weight: 700; }
.swatch { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-left: 4px; border: 1px solid rgba(255,255,255,.5); vertical-align: -1px; }
.sel { background: #264f78; color: #fff; outline: 1px solid #3a78b8; }
.caret { display: inline-block; width: 2px; height: 13px; background: #fff; vertical-align: -2px; margin-left: 1px; animation: caret 1s steps(1) infinite; }
.caret.dark { background: var(--ink); }
@keyframes caret { 50% { opacity: 0; } }
.preview { flex: 1; width: 100%; border: 0; background: #fff; display: none; }
.terminal { height: 108px; background: #11121a; border-top: 1px solid #2b2b3c; display: flex; flex-direction: column; }
.term-head { font-size: 9.5px; letter-spacing: .1em; padding: 3px 8px; color: #8b8fa3; font-weight: 800; border-bottom: 1px solid #22232f; }
.term-body { flex: 1; overflow: auto; padding: 4px 8px; font-family: var(--mono); font-size: 10.8px; line-height: 15px; color: #c9d1d9; scrollbar-width: thin; scrollbar-color: #444 transparent; }
.tl { white-space: pre-wrap; word-break: break-all; tab-size: 4; }
.tl .pr { color: #3fb950; font-weight: 700; }
.tl .cm { color: #fff; }
.tl.o { color: #aeb6c2; }
.tl .ok, .tl.ok { color: #3fb950; }
.tl .err, .tl.err { color: #ff7b72; }
.tl.warn { color: #e3b341; }
.tl.dim { color: #5d6475; font-style: italic; }
.tl .hash { color: #e3b341; }
.tl .deco { color: #58a6ff; font-weight: 700; }
.toast-zone { position: absolute; top: 30px; right: 8px; z-index: 12; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; pointer-events: none; max-width: 85%; }
.toast { background: #fff; color: var(--ink); border-left: 4px solid #f59f00; border-radius: 10px; padding: 7px 11px; font-size: 12.5px; box-shadow: 0 10px 30px -8px rgba(0,0,0,.45); animation: toastIn .4s cubic-bezier(.2,1.4,.4,1); transition: opacity .5s, transform .5s; }
.toast.out { opacity: 0; transform: translateX(20px); }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px) scale(.9); } }
.off-msg { position: absolute; inset: 24px 0 0 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: #c0c4d6; font-weight: 800; font-size: 15px; text-align: center; padding: 20px; background: rgba(17,18,26,.72); z-index: 10; }
.off-msg span { font-size: 34px; }
.machine.off .off-msg { display: flex; }
.machine.off .gitpanel, .machine.off .who { opacity: .45; filter: grayscale(.9); }

/* panne */
.machine.crash .screen { animation: shake .45s ease-in-out 3; }
.machine.crash .screen::after {
  content: '💥 Panne !'; position: absolute; inset: 0; z-index: 20; background: #000e; color: #fff; display: grid; place-items: center; font-size: 30px; font-weight: 900;
  animation: crashIn .3s ease-out;
}
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-7px) rotate(-1deg); } 75% { transform: translateX(7px) rotate(1deg); } }
@keyframes crashIn { from { opacity: 0; } }

/* panneau git */
.gitpanel { margin-top: 12px; background: #fff; border-radius: 14px; box-shadow: var(--shadow); padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.zone { border: 1.5px dashed #d4d8e3; border-radius: 10px; padding: 6px 8px; transition: background .3s; }
.zone-h { font-size: 12px; font-weight: 800; display: flex; align-items: center; gap: 5px; margin-bottom: 4px; }
.zone-h small { color: var(--muted); font-weight: 700; }
.rlink { margin-left: auto; }
.rl { font-size: 10.5px; background: #eef0f7; color: var(--ink); padding: 1px 7px; border-radius: 999px; font-weight: 800; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; min-height: 24px; align-items: center; }
.chips .muted { font-size: 12px; font-style: italic; }
.chip { background: #e7f0ff; border: 1px solid #b6d0ff; color: #1d4fa8; border-radius: 999px; padding: 1px 9px; font-size: 11.5px; font-weight: 700; animation: pop .35s; }
.graph { max-height: 156px; min-height: 34px; overflow: auto; scrollbar-width: thin; }
.g-empty { font-size: 12px; color: var(--muted); font-style: italic; padding: 6px 2px; }
.g-wrap { position: relative; }
.g-svg { position: absolute; left: 0; top: 0; overflow: visible; }
.g-svg path { fill: none; stroke-width: 2.4; }
.g-svg circle.fresh { animation: popDot .7s cubic-bezier(.2,1.6,.4,1); transform-box: fill-box; transform-origin: center; }
.g-rows { position: relative; }
.g-row { display: flex; align-items: center; gap: 5px; font-size: 11.5px; white-space: nowrap; overflow: hidden; border-radius: 6px; }
.g-row.fresh { animation: rowIn 1.4s ease-out; }
.g-row code { font-size: 10.3px; color: #9a5300; background: #fff3e0; padding: 0 4px; border-radius: 4px; flex: 0 0 auto; }
.g-au { font-size: 12px; flex: 0 0 auto; }
.g-msg { overflow: hidden; text-overflow: ellipsis; color: #3b4357; }
.pill { flex: 0 0 auto; font-size: 10px; font-weight: 800; background: #e3f8ea; color: #137333; border: 1px solid #b7e4c5; border-radius: 999px; padding: 0 6px; line-height: 15px; }
.pill.head { background: var(--blue); color: #fff; border-color: var(--blue); }
@keyframes rowIn { 0% { background: #fff3b0; } 100% { background: transparent; } }
@keyframes popDot { from { transform: scale(0); } }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }

/* GitHub */
.ghwin { height: 377px; border-radius: 12px; background: #fff; border: 1px solid #d0d7de; overflow: hidden; position: relative; display: flex; flex-direction: column; box-shadow: var(--shadow); transition: box-shadow .3s; margin-bottom: 12px; }
.col.active .ghwin { box-shadow: 0 0 0 3px #24292f, 0 14px 34px -12px #24292f; }
.cloud .gitpanel { margin-top: 0; }
.gh-url { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; background: #f6f8fa; border-bottom: 1px solid #d0d7de; padding: 5px 8px; font-size: 11px; }
.gh-url .url { flex: 1; font-family: var(--mono); background: #fff; border: 1px solid #d0d7de; border-radius: 999px; padding: 1px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #57606a; }
.gh-user { display: flex; align-items: center; gap: 4px; font-weight: 800; white-space: nowrap; border-radius: 999px; padding: 1px 6px 1px 1px; }
.gh-av { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; box-shadow: 0 0 0 2px var(--c); background: #fff; font-size: 12px; }
.gh-main { flex: 1; overflow: auto; padding: 10px; font-family: -apple-system, 'Segoe UI', system-ui, sans-serif; font-size: 12px; color: #1f2328; scrollbar-width: thin; scroll-behavior: smooth; }
.gh-main code { font-size: 10.5px; background: #eff2f5; padding: 0 4px; border-radius: 4px; }
.gh-btn { font: 600 12px -apple-system, 'Segoe UI', system-ui, sans-serif; border: 1px solid rgba(31,35,40,.15); background: #f6f8fa; color: #24292f; border-radius: 6px; padding: 5px 12px; cursor: default; transition: transform .12s, filter .12s; white-space: nowrap; }
.gh-btn.green { background: #1f883d; color: #fff; border-color: rgba(31,35,40,.15); }
.gh-btn.sm { padding: 3px 8px; font-size: 11.5px; }
.pressed { transform: scale(.92); filter: brightness(.88); }
.gh-home { display: flex; flex-direction: column; gap: 10px; }
.gh-hello { font-size: 15px; }
.gh-card { border: 1px solid #d0d7de; border-radius: 8px; padding: 10px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.gh-card-h { font-weight: 700; }
.gh-blank { color: #57606a; text-align: center; padding: 14px 6px; width: 100%; border: 1px dashed #d0d7de; border-radius: 8px; }
.gh-form { display: flex; flex-direction: column; gap: 5px; align-items: stretch; }
.gh-form h5 { margin: 0 0 4px; font-size: 14px; }
.gh-form label { font-weight: 600; font-size: 11.5px; margin-top: 4px; }
.gh-form > .gh-btn { align-self: flex-start; margin-top: 8px; }
.gh-input { display: block; border: 1px solid #d0d7de; border-radius: 6px; padding: 4px 8px; min-height: 26px; background: #f6f8fa; font-size: 12px; white-space: pre-wrap; word-break: break-word; }
.gh-input.area { min-height: 46px; }
.gh-input.fixed { display: inline-block; color: #57606a; }
.gh-row { display: flex; gap: 5px; align-items: center; }
.gh-row .gh-input { flex: 1; }
.gh-radio { display: flex; gap: 14px; margin-top: 6px; }
.gh-side { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; font-size: 11.5px; }
.gh-side > span { padding: 3px 6px; border-radius: 6px; border: 1px solid #eaeef2; }
.gh-repo-h { font-size: 13.5px; display: flex; align-items: center; gap: 4px; }
.lnk { color: #0969da; }
.gh-pill { font-size: 10.5px; border: 1px solid #d0d7de; border-radius: 999px; padding: 0 7px; color: #57606a; }
.gh-tabs { display: flex; gap: 2px; border-bottom: 1px solid #d0d7de; margin: 8px -10px 10px; padding: 0 6px; }
.gh-tab { padding: 5px 6px 6px; white-space: nowrap; border-bottom: 2px solid transparent; cursor: pointer; font-size: 11.5px; }
.gh-tab.on { border-bottom-color: #fd8c73; font-weight: 700; }
.gh-tab em { font-style: normal; background: #e6eaef; border-radius: 999px; padding: 0 6px; font-size: 10.5px; }
.gh-quick { background: #ddf4ff; border: 1px solid #54aeff66; border-radius: 8px; padding: 10px; }
.gh-quick p { margin: 4px 0; }
.gh-quick pre { margin: 0; background: #fff; border-radius: 6px; padding: 6px 8px; font-family: var(--mono); font-size: 10.5px; white-space: pre-wrap; word-break: break-all; }
.gh-banner { display: flex; align-items: center; gap: 6px; justify-content: space-between; background: #fff8c5; border: 1px solid #d4a72c66; border-radius: 6px; padding: 6px 8px; margin-bottom: 8px; flex-wrap: wrap; }
.gh-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.gh-bar .gh-btn { margin-left: auto; }
.gh-branch { border: 1px solid #d0d7de; background: #f6f8fa; border-radius: 6px; padding: 2px 8px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.gh-files { border: 1px solid #d0d7de; border-radius: 6px; overflow: hidden; }
.gh-last { display: flex; justify-content: space-between; gap: 6px; background: #f6f8fa; padding: 6px 8px; border-bottom: 1px solid #d0d7de; }
.gh-last span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gh-file { display: grid; grid-template-columns: auto auto 1fr; gap: 6px; padding: 5px 8px; border-top: 1px solid #eaeef2; align-items: center; }
.gh-file:first-of-type { border-top: 0; }
.ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.gh-list { border: 1px solid #d0d7de; border-radius: 6px; }
.gh-item { display: flex; gap: 8px; padding: 7px 8px; border-top: 1px solid #eaeef2; cursor: pointer; }
.gh-item:first-child { border-top: 0; }
.gh-item:hover { background: #f6f8fa; }
.ic { font-weight: 900; }
.ic.open { color: #1a7f37; } .ic.closed, .ic.merged { color: #8250df; }
.gh-label { display: inline-block; background: #a2eeef; color: #0b4f52; font-size: 10.5px; font-weight: 700; border-radius: 999px; padding: 0 7px; }
.gh-ititle { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.gh-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.gh-state { color: #fff; border-radius: 999px; padding: 2px 9px; font-weight: 600; font-size: 11.5px; white-space: nowrap; }
.gh-state.open { background: #1f883d; } .gh-state.closed, .gh-state.merged { background: #8250df; }
.gh-side2 { font-size: 11.5px; margin-bottom: 8px; display: flex; gap: 6px; align-items: center; }
.gh-cmt { border: 1px solid #d0d7de; border-radius: 6px; margin-bottom: 8px; overflow: hidden; animation: pop .35s; }
.gh-cmt-h { background: #f6f8fa; border-bottom: 1px solid #d0d7de; padding: 4px 8px; font-size: 11.5px; }
.gh-cmt-b { padding: 6px 8px; }
.gh-cmt.approve { border-color: #1f883d88; }
.gh-cmt.approve .gh-cmt-h { background: #dafbe1; }
.gh-ev { font-size: 11.5px; color: #57606a; padding: 4px 8px; border-left: 2px solid #d0d7de; margin: 0 0 8px 10px; }
.gh-newc { display: flex; flex-direction: column; gap: 5px; align-items: flex-end; margin-bottom: 8px; }
.gh-newc .gh-input { align-self: stretch; }
.gh-subtabs { display: flex; gap: 4px; border-bottom: 1px solid #d0d7de; margin-bottom: 8px; }
.gh-subtabs span { padding: 4px 8px; cursor: pointer; border-bottom: 2px solid transparent; font-size: 11.5px; }
.gh-subtabs span.on { border-bottom-color: #fd8c73; font-weight: 700; }
.gh-merge { border: 1px solid #1f883d66; border-radius: 6px; padding: 8px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; background: #f6fff8; }
.gh-merge .gh-btn { margin-top: 4px; }
.gh-merge.merged { border-color: #8250df66; background: #fbf7ff; }
.ok { color: #1a7f37; font-weight: 600; }
.gh-compare { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.gh-collab { display: flex; flex-direction: column; gap: 4px; border: 1px solid #d0d7de; border-radius: 6px; padding: 6px 8px; margin: 4px 0; }
.diff { border: 1px solid #d0d7de; border-radius: 6px; overflow: hidden; margin-bottom: 8px; font-family: var(--mono); font-size: 10.5px; }
.d-h { display: flex; justify-content: space-between; background: #f6f8fa; padding: 4px 8px; border-bottom: 1px solid #d0d7de; font-family: -apple-system, 'Segoe UI', system-ui, sans-serif; font-size: 11.5px; font-weight: 600; }
.d-h .g { color: #1a7f37; } .d-h .r { color: #cf222e; }
.d-l { white-space: pre; padding: 0 8px; overflow: hidden; text-overflow: ellipsis; line-height: 16px; }
.d-l i { font-style: normal; display: inline-block; width: 12px; color: #8c959f; }
.d-add { background: #dafbe1; } .d-add i { color: #1a7f37; }
.d-del { background: #ffebe9; } .d-del i { color: #cf222e; }
.d-skip { color: #8c959f; background: #f6f8fa; }

/* bulles, curseur, paquets */
.bubble-anchor { position: absolute; top: 52px; right: 6px; left: 34px; z-index: 40; pointer-events: none; display: flex; justify-content: flex-start; }
.bubble {
  position: relative; background: #fff; border: 2.5px solid var(--c); border-radius: 16px; padding: 7px 12px; font-weight: 800; font-size: 14px;
  box-shadow: 0 12px 30px -10px rgba(0,0,0,.45); animation: bubbleIn .45s cubic-bezier(.2,1.6,.4,1); max-width: 100%;
}
.bubble::before { content: ''; position: absolute; left: 16px; top: -10px; border: 8px solid transparent; border-bottom-color: var(--c); border-top: 0; }
@keyframes bubbleIn { from { opacity: 0; transform: translateY(-8px) scale(.6); } }
.cursor { position: absolute; left: 0; top: 0; z-index: 60; display: none; pointer-events: none; }
.cursor svg { filter: drop-shadow(0 2px 3px rgba(0,0,0,.35)); }
.cur-who { position: absolute; left: 16px; top: 14px; font-size: 13px; background: #fff; border-radius: 50%; width: 20px; height: 20px; display: grid; place-items: center; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.ripple { position: absolute; z-index: 59; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; border: 3px solid var(--accent); pointer-events: none; animation: ripple .65s ease-out forwards; }
@keyframes ripple { from { transform: scale(.2); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
.packet {
  position: absolute; left: 0; top: 0; z-index: 55; pointer-events: none; background: #fff; border: 2.5px solid #999; border-radius: 10px;
  padding: 4px 10px; font-weight: 900; font-size: 13px; white-space: nowrap; box-shadow: 0 12px 24px -8px rgba(0,0,0,.45); text-align: center; line-height: 1.2;
}
.packet small { font-weight: 700; font-size: 10.5px; color: var(--muted); }
.p-file { border-color: var(--blue); color: #1d4fa8; font-size: 12px; }
.p-snap { border-color: var(--accent2); background: #fff7e6; font-size: 18px; padding: 3px 7px; }
.p-push { border-color: var(--alice); background: #f4efff; }
.p-pull { border-color: var(--bob); background: #e9fbf4; }
.p-clone { border-color: var(--bob); background: #e9fbf4; }
.p-reject { border-color: #e5484d; background: #fff0f0; }
.pulse { animation: pulseRing 1.3s ease-out; }
@keyframes pulseRing { 0% { box-shadow: 0 0 0 0 rgba(255,107,53,.75); } 100% { box-shadow: 0 0 0 14px rgba(255,107,53,0); } }
.zone.pulse, .gitpanel .pulse { background: #fff8ec; }
.preview.pulse { animation: none; }

/* =====================================================================
   récap, antisèche, glossaire, quiz
   ===================================================================== */
.flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; counter-reset: fl; }
.fl { position: relative; background: #fff; border-radius: 16px; box-shadow: var(--shadow); padding: 18px 14px 14px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; }
.fl b { font-size: 17px; }
.fl small { color: var(--muted); }
.fl-ic { font-size: 30px; }
.fl-n { position: absolute; top: -10px; left: -10px; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 900; font-size: 14px; }
.fl:not(:nth-child(4n))::after { content: '➜'; position: absolute; right: -16px; top: 50%; transform: translateY(-50%); color: #b9bfd0; font-size: 18px; z-index: 1; }
.cheat { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.ch-card { background: #fff; border-radius: 16px; box-shadow: var(--shadow); padding: 16px 18px; }
.ch-card h4 { margin: 0 0 8px; font-size: 16.5px; }
.ch-card dl { margin: 0; }
.ch-card dt { font-family: var(--mono); font-size: 12.5px; background: #1e1e2e; color: #e6e6f0; border-radius: 7px; padding: 4px 9px; margin-top: 8px; cursor: copy; position: relative; word-break: break-word; }
.ch-card dt::before { content: '$ '; color: #3fb950; }
.ch-card dd { margin: 2px 0 0 4px; font-size: 13.5px; color: var(--muted); }
.gloss { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 24px; }
.gloss div { background: #fff; border-radius: 12px; padding: 10px 14px; box-shadow: 0 4px 14px -8px rgba(0,0,0,.2); display: flex; flex-direction: column; }
.gloss b { color: var(--accent); }
.quiz { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.quiz-score { font-size: 17px; }
.quiz-score .btn { margin-left: 8px; }
.qcard { background: #fff; border-radius: 16px; box-shadow: var(--shadow); padding: 16px 18px; }
.qn { font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); }
.qq { font-weight: 800; font-size: 16px; margin: 4px 0 10px; }
.qa { display: flex; flex-direction: column; gap: 6px; }
.qa button { text-align: left; font: inherit; font-size: 14.5px; font-weight: 700; padding: 8px 12px; border-radius: 10px; border: 1.5px solid #dfe3ec; background: #fafbfd; cursor: pointer; transition: background .15s, border-color .15s; }
.qa button:hover { border-color: var(--accent); }
.answered .qa button { cursor: default; }
.answered .qa button:hover { border-color: #dfe3ec; }
.qa button.good { background: #e3f8ea; border-color: #3fb950 !important; }
.qa button.bad { background: #ffeceb; border-color: #f85149 !important; }
.qwhy { margin-top: 8px; font-size: 14px; color: #3b4357; }
.qwhy:empty { display: none; }
.foot { text-align: center; padding: 40px 20px 60px; border-top: 1px solid var(--line); margin-top: 40px; }
.noscript { text-align: center; padding: 20px; background: #ffeceb; }

/* =====================================================================
   responsive
   ===================================================================== */
@media (max-width: 1180px) {
  .scene-bar { grid-template-columns: minmax(0,1fr); }
  .controls { flex-wrap: wrap; }
  .legend, .cheat { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; padding-top: 36px; }
  .stage { grid-template-columns: 1fr; gap: 26px; }
  .col { max-width: 620px; width: 100%; margin: 0 auto; }
  .ghwin { height: 360px; }
  .zones-wrap { flex-direction: column; align-items: stretch; }
  .zones { flex-direction: column; }
  .zarrow { flex-direction: row; }
  .ar, .zpush .ar { transform: rotate(90deg); width: 40px; margin: 14px 0; }
  .ar i { animation-name: travelShort; }
  .z4 { flex: 1; }
  .zones-pc { max-width: none; }
  .flow { grid-template-columns: repeat(2, 1fr); }
  .fl::after { display: none; }
  .duo, .gloss, .quiz { grid-template-columns: 1fr; }
  .speed { display: none; }
}
@keyframes travelShort { from { left: 0; opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } to { left: 30px; opacity: 0; } }
@media (max-width: 640px) {
  .nav { padding: 8px 14px; gap: 10px; }
  .brand em { display: none; }
  .sec, .chapter { padding: 36px 16px; }
  .hero { padding-left: 16px; padding-right: 16px; }
  .legend, .cheat, .flow { grid-template-columns: 1fr; }
  .scene-bar { position: relative; top: auto; padding: 12px; }
  .narr-d code, .tip code, .cmdchip, .keep code { white-space: normal; overflow-wrap: anywhere; }
  .who-t b { font-size: 14px; }
  .narr-d { font-size: 14px; }
  .controls .btn { padding: 8px 10px; }
  .controls [data-c=next] { min-width: 0; flex: 1; }
  .part { padding: 0 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .hp, .ar i, .ar-back i, .blink { animation: none; }
}
