/* ==========================================================================
   AramLearning — thème inspiré d'Edumall (LMS)
   ========================================================================== */
:root {
  --primary: #0071dc;
  --primary-600: #005fb8;
  --primary-50: #e8f2fd;
  --accent: #ffc221;
  --accent-50: #fff6dc;
  --teal: #20ad96;
  --teal-50: #e3f6f2;
  --red: #e5484d;
  --red-50: #fdecec;
  --violet: #7c5cff;
  --violet-50: #f0ecff;
  --orange: #ff7a45;

  --bg: #ffffff;
  --bg-soft: #f6f7fb;
  --bg-elev: #ffffff;
  --text: #1c1c28;
  --text-2: #4b4f63;
  --muted: #7e8299;
  --border: #e7e9f0;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow: 0 10px 30px -12px rgba(16, 24, 40, .18);
  --shadow-lg: 0 30px 60px -20px rgba(0, 54, 120, .28);
  --radius: 14px;
  --radius-sm: 8px;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --header-h: 72px;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0f1117;
  --bg-soft: #151822;
  --bg-elev: #1a1e2a;
  --text: #eef0f6;
  --text-2: #c2c6d6;
  --muted: #8a90a6;
  --border: #272c3b;
  --primary-50: #10243d;
  --accent-50: #2e2610;
  --teal-50: #0f2a26;
  --red-50: #2e1416;
  --violet-50: #1f1a3a;
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, .6);
  --shadow-lg: 0 30px 60px -20px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.65; -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; cursor: pointer; }
kbd { font-family: var(--mono); font-size: .75em; padding: 1px 6px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px; background: var(--bg-soft); color: var(--text-2); }
.container { width: min(1240px, 100% - 48px); margin-inline: auto; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--primary); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 55%, transparent); outline-offset: 2px; border-radius: 6px; }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 10px; padding: 13px 24px; font-weight: 700; font-size: 15px; transition: transform .15s, box-shadow .15s, background .15s; text-decoration: none !important; white-space: nowrap; }
.btn-sm { padding: 9px 16px; font-size: 14px; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 8px 20px -8px rgba(0, 113, 220, .7); }
.btn-primary:hover { background: var(--primary-600); transform: translateY(-1px); }
.btn-accent { background: var(--accent); color: #1c1c28; }
.btn-accent:hover { transform: translateY(-1px); filter: brightness(1.03); }
.btn-ghost { background: transparent; color: var(--text); border: 1.5px solid var(--border); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-success { background: var(--teal); color: #fff; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-elev); color: var(--text-2); }
.icon-btn:hover { color: var(--primary); border-color: var(--primary); }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; height: var(--header-h); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(180%) blur(14px); border-bottom: 1px solid var(--border); }
.header-inner { height: 100%; display: flex; align-items: center; gap: 32px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; font-size: 19px; text-decoration: none !important; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--primary); color: var(--accent); font-weight: 800; }
.brand-text b { color: var(--primary); font-weight: 800; }
.main-nav { display: flex; gap: 4px; }
.main-nav a { color: var(--text-2); font-weight: 600; font-size: 15px; padding: 8px 14px; border-radius: 8px; text-decoration: none; }
.main-nav a:hover, .main-nav a.active { color: var(--primary); background: var(--primary-50); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.search-trigger { display: flex; align-items: center; gap: 10px; min-width: 240px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-soft); color: var(--muted); font-size: 14px; }
.search-trigger span { flex: 1; text-align: left; }
.search-trigger:hover { border-color: var(--primary); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; background: linear-gradient(180deg, var(--primary-50), var(--bg) 85%); padding: 72px 0 88px; }
.hero::before { content: ''; position: absolute; width: 620px; height: 620px; right: -160px; top: -200px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 35%, transparent), transparent 65%); }
.hero-grid { position: relative; display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 99px; background: var(--bg-elev); border: 1px solid var(--border); font-size: 13px; font-weight: 700; color: var(--primary); box-shadow: var(--shadow-sm); }
.eyebrow i { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px var(--teal-50); }
.hero h1 { font-size: clamp(36px, 4.6vw, 58px); line-height: 1.08; letter-spacing: -.02em; margin: 20px 0 18px; font-weight: 800; }
.hero h1 mark { background: linear-gradient(transparent 62%, var(--accent) 62%); color: inherit; padding: 0 4px; }
.hero p.lead { font-size: 18px; color: var(--text-2); max-width: 560px; margin: 0 0 30px; }
.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-trust { display: flex; gap: 28px; margin-top: 36px; flex-wrap: wrap; }
.hero-trust div { display: flex; flex-direction: column; }
.hero-trust b { font-size: 26px; font-weight: 800; }
.hero-trust span { font-size: 13px; color: var(--muted); font-weight: 600; }

.hero-visual { position: relative; min-height: 460px; }
.hv-card { position: absolute; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg); }
.hv-main { inset: 20px 40px 40px 30px; overflow: hidden; }
.hv-main .hv-thumb { height: 180px; background: linear-gradient(135deg, #0071dc, #20ad96); position: relative; display: grid; place-items: center; }
.hv-thumb .hv-play { width: 64px; height: 64px; border-radius: 50%; background: rgba(255,255,255,.95); display: grid; place-items: center; color: var(--primary); box-shadow: 0 0 0 12px rgba(255,255,255,.25); }
.hv-thumb .hv-tag { position: absolute; left: 16px; top: 16px; background: var(--accent); color: #1c1c28; font-weight: 800; font-size: 12px; padding: 4px 10px; border-radius: 6px; }
.hv-body { padding: 20px 22px; }
.hv-body h4 { margin: 0 0 8px; font-size: 18px; }
.hv-meta { display: flex; gap: 16px; color: var(--muted); font-size: 13px; font-weight: 600; margin-bottom: 14px; }
.hv-progress { height: 8px; background: var(--bg-soft); border-radius: 99px; overflow: hidden; }
.hv-progress i { display: block; height: 100%; width: 64%; background: linear-gradient(90deg, var(--primary), var(--teal)); border-radius: 99px; }
.hv-code { width: 300px; right: -10px; bottom: 0; padding: 14px 16px; background: #0d1117; color: #c9d1d9; font-family: var(--mono); font-size: 12px; line-height: 1.6; border-color: #222; }
.hv-code .k { color: #ff7b72; } .hv-code .s { color: #a5d6ff; } .hv-code .a { color: #d2a8ff; } .hv-code .c { color: #8b949e; }
.hv-badge { left: -18px; bottom: 70px; padding: 12px 16px; display: flex; gap: 12px; align-items: center; font-weight: 700; font-size: 14px; animation: float 5s ease-in-out infinite; }
.hv-badge .dot { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--teal-50); color: var(--teal); }
.hv-badge small { display: block; color: var(--muted); font-weight: 600; font-size: 12px; }
.hv-pill { right: 0; top: 0; padding: 10px 14px; font-weight: 800; font-size: 13px; color: var(--primary); animation: float 6s ease-in-out infinite reverse; }
@keyframes float { 50% { transform: translateY(-10px); } }

/* ---------- Sections ---------- */
.section { padding: 88px 0; }
.section-soft { background: var(--bg-soft); }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 48px; }
.section-head .kicker { color: var(--primary); font-weight: 800; letter-spacing: .12em; text-transform: uppercase; font-size: 13px; }
.section-head h2 { font-size: clamp(28px, 3.2vw, 40px); line-height: 1.15; margin: 10px 0 12px; letter-spacing: -.01em; }
.section-head p { color: var(--text-2); margin: 0; font-size: 17px; }

.stats-band { margin-top: -44px; position: relative; z-index: 2; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--bg-elev); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); }
.stat { padding: 26px 28px; display: flex; gap: 16px; align-items: center; }
.stat + .stat { border-left: 1px solid var(--border); }
.stat .ico { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; }
.stat b { font-size: 28px; font-weight: 800; display: block; line-height: 1.1; }
.stat span { color: var(--muted); font-size: 14px; font-weight: 600; }

/* Cartes modules (style course card Edumall) */
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 26px; }
.course-card { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s; color: inherit; text-decoration: none !important; }
.course-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.cc-thumb { height: 150px; position: relative; display: grid; place-items: center; color: #fff; }
.cc-thumb svg { width: 58px; height: 58px; opacity: .95; }
.cc-thumb .cc-num { position: absolute; left: 14px; top: 14px; background: rgba(255,255,255,.92); color: #1c1c28; font-weight: 800; font-size: 12px; padding: 4px 10px; border-radius: 6px; }
.cc-thumb .cc-done { position: absolute; right: 14px; top: 14px; background: var(--teal); color: #fff; font-weight: 800; font-size: 12px; padding: 4px 10px; border-radius: 6px; }
.cc-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.cc-body h3 { margin: 0; font-size: 17px; line-height: 1.35; }
.cc-body p { margin: 0; color: var(--text-2); font-size: 14px; flex: 1; }
.cc-meta { display: flex; gap: 14px; color: var(--muted); font-size: 13px; font-weight: 600; padding-top: 12px; border-top: 1px dashed var(--border); }
.cc-meta span { display: inline-flex; align-items: center; gap: 5px; }
.bar { height: 6px; background: var(--bg-soft); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--teal)); border-radius: 99px; transition: width .4s; }

.g-1 { background: linear-gradient(135deg, #0071dc, #3aa0ff); }
.g-2 { background: linear-gradient(135deg, #20ad96, #5fd3b5); }
.g-3 { background: linear-gradient(135deg, #7c5cff, #b39bff); }
.g-4 { background: linear-gradient(135deg, #ff7a45, #ffb37a); }
.g-5 { background: linear-gradient(135deg, #e5484d, #ff8a8f); }
.g-6 { background: linear-gradient(135deg, #1c1c28, #4b4f63); }
.g-7 { background: linear-gradient(135deg, #f5a300, #ffd166); }

/* Projet fil rouge */
.project-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center; }
.browser { border-radius: 16px; border: 1px solid var(--border); background: var(--bg-elev); box-shadow: var(--shadow-lg); overflow: hidden; }
.browser-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--bg-soft); border-bottom: 1px solid var(--border); }
.browser-bar .dots { display: flex; gap: 6px; } .browser-bar .dots i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; } .browser-bar .dots i:nth-child(2) { background: #febc2e; } .browser-bar .dots i:nth-child(3) { background: #28c840; }
.browser-bar .url { flex: 1; font-size: 12px; color: var(--muted); background: var(--bg-elev); border: 1px solid var(--border); padding: 4px 12px; border-radius: 99px; font-family: var(--mono); }
.tp-hero { padding: 22px; background: linear-gradient(120deg, #3b1fa8, #0071dc); color: #fff; }
.tp-hero small { opacity: .8; font-weight: 600; } .tp-hero h5 { margin: 4px 0 10px; font-size: 20px; } .tp-hero .chip { display: inline-block; background: var(--accent); color: #1c1c28; font-weight: 800; font-size: 12px; padding: 5px 12px; border-radius: 8px; }
.tp-cats { display: flex; gap: 6px; padding: 14px 18px 0; flex-wrap: wrap; } .tp-cats span { font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 99px; background: var(--bg-soft); color: var(--text-2); } .tp-cats span:first-child { background: var(--primary); color: #fff; }
.tp-events { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 14px 18px 20px; }
.tp-ev { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; font-size: 11px; }
.tp-ev .img { height: 58px; } .tp-ev div:last-child { padding: 8px; } .tp-ev b { display: block; font-size: 12px; } .tp-ev em { font-style: normal; color: var(--primary); font-weight: 800; }
.feature-list { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 14px; }
.feature-list li { display: flex; gap: 14px; align-items: flex-start; }
.feature-list .ico { flex: none; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); }
.feature-list b { display: block; } .feature-list span { color: var(--text-2); font-size: 15px; }

.stack-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.stack-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 12px; font-weight: 700; font-size: 15px; }
.stack-item small { display: block; font-weight: 600; color: var(--muted); font-size: 12px; }
.stack-item .sq { width: 10px; height: 34px; border-radius: 4px; flex: none; }

.method-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.method { padding: 28px 24px; border-radius: var(--radius); background: var(--bg-elev); border: 1px solid var(--border); }
.method .ico { width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 16px; }
.method h3 { margin: 0 0 8px; font-size: 18px; } .method p { margin: 0; color: var(--text-2); font-size: 15px; }

.cta-band { border-radius: 24px; padding: 52px; background: linear-gradient(120deg, var(--primary), #004c96); color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 32px; position: relative; overflow: hidden; }
.cta-band::after { content: ''; position: absolute; right: -80px; bottom: -120px; width: 320px; height: 320px; border-radius: 50%; border: 50px solid rgba(255, 194, 33, .25); }
.cta-band h2 { margin: 0 0 8px; font-size: 32px; } .cta-band p { margin: 0; opacity: .85; }

.site-footer { border-top: 1px solid var(--border); padding: 36px 0; color: var(--muted); font-size: 14px; }
.site-footer .container { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }

/* ---------- Page title band ---------- */
.page-band { background: linear-gradient(180deg, var(--primary-50), var(--bg)); padding: 48px 0 36px; border-bottom: 1px solid var(--border); }
.crumbs { font-size: 14px; color: var(--muted); font-weight: 600; margin-bottom: 10px; }
.crumbs a { color: var(--muted); } .crumbs a:hover { color: var(--primary); }
.page-band h1 { margin: 0 0 8px; font-size: clamp(28px, 3.4vw, 42px); letter-spacing: -.01em; line-height: 1.15; }
.page-band p { margin: 0; color: var(--text-2); max-width: 760px; font-size: 17px; }

/* ---------- Programme ---------- */
.programme-grid { display: grid; grid-template-columns: 1fr 360px; gap: 40px; align-items: start; padding: 40px 0 88px; }
.curriculum { display: grid; gap: 14px; }
.cur-module { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-elev); overflow: hidden; }
.cur-module summary { list-style: none; display: flex; align-items: center; gap: 16px; padding: 18px 20px; cursor: pointer; }
.cur-module summary::-webkit-details-marker { display: none; }
.cur-module .mnum { flex: none; width: 46px; height: 46px; border-radius: 12px; color: #fff; display: grid; place-items: center; font-weight: 800; }
.cur-module .mtitle { flex: 1; min-width: 0; }
.cur-module .mtitle b { display: block; font-size: 17px; }
.cur-module .mtitle small { color: var(--muted); font-weight: 600; font-size: 13px; }
.cur-module .mprog { width: 120px; text-align: right; font-size: 13px; color: var(--muted); font-weight: 700; }
.cur-module .mprog .bar { margin-top: 6px; }
.cur-module .chev { transition: transform .2s; color: var(--muted); }
.cur-module[open] .chev { transform: rotate(180deg); }
.cur-module .msum { padding: 0 20px 6px 82px; color: var(--text-2); font-size: 15px; margin: -4px 0 8px; }
.lesson-list { list-style: none; margin: 0; padding: 0 12px 12px; }
.lesson-list a { display: flex; align-items: center; gap: 12px; padding: 11px 12px 11px 70px; border-radius: 10px; color: var(--text); font-weight: 600; font-size: 15px; text-decoration: none; position: relative; }
.lesson-list a:hover { background: var(--bg-soft); color: var(--primary); }
.lesson-list .lnum { position: absolute; left: 22px; color: var(--muted); font-size: 13px; font-family: var(--mono); }
.lesson-list .ltitle { flex: 1; }
.lesson-list .ldur { color: var(--muted); font-size: 13px; font-weight: 600; }
.check { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border); display: grid; place-items: center; }
.check.done { background: var(--teal); border-color: var(--teal); color: #fff; }
.check.done::after { content: ''; width: 6px; height: 10px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) translate(-1px, -1px); }

.side-card { position: sticky; top: calc(var(--header-h) + 24px); background: var(--bg-elev); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; }
.side-card .sc-top { padding: 26px; background: linear-gradient(135deg, var(--primary), #20ad96); color: #fff; display: flex; gap: 18px; align-items: center; }
.ring { --p: 0; width: 86px; height: 86px; border-radius: 50%; background: conic-gradient(var(--accent) calc(var(--p) * 1%), rgba(255,255,255,.25) 0); display: grid; place-items: center; flex: none; }
.ring span { width: 66px; height: 66px; border-radius: 50%; background: rgba(0, 40, 90, .55); display: grid; place-items: center; font-weight: 800; font-size: 18px; }
.side-card .sc-top b { font-size: 18px; display: block; } .side-card .sc-top small { opacity: .85; }
.side-card .sc-body { padding: 22px 26px 26px; display: grid; gap: 16px; }
.inc-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; font-size: 15px; color: var(--text-2); }
.inc-list li { display: flex; gap: 10px; align-items: center; }
.inc-list li::before { content: ''; width: 18px; height: 18px; flex: none; border-radius: 50%; background: var(--teal-50) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 12 4 4 8-8' stroke='%2320ad96' stroke-width='3' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") center/12px no-repeat; }

/* ---------- Lecteur de leçon ---------- */
.player { display: grid; grid-template-columns: 330px minmax(0, 1fr); min-height: calc(100vh - var(--header-h)); }
.player.no-side { grid-template-columns: 0 minmax(0, 1fr); }
.player-side { border-right: 1px solid var(--border); background: var(--bg-soft); position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h)); overflow-y: auto; overscroll-behavior: contain; }
.player.no-side .player-side { visibility: hidden; }
.ps-head { padding: 18px 18px 14px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--bg-soft); z-index: 2; }
.ps-head b { display: block; font-size: 15px; } .ps-head small { color: var(--muted); font-weight: 600; font-size: 13px; }
.ps-head .bar { margin-top: 10px; }
.ps-mod { border-bottom: 1px solid var(--border); }
.ps-mod > button { width: 100%; text-align: left; background: none; border: 0; padding: 14px 18px; display: flex; gap: 10px; align-items: center; color: var(--text); }
.ps-mod > button b { flex: 1; font-size: 14px; line-height: 1.35; }
.ps-mod > button small { color: var(--muted); font-weight: 700; font-size: 12px; }
.ps-mod ul { list-style: none; margin: 0; padding: 0 0 8px; display: none; }
.ps-mod.open ul { display: block; }
.ps-mod li a { display: flex; gap: 10px; align-items: center; padding: 8px 18px 8px 22px; font-size: 14px; color: var(--text-2); font-weight: 600; text-decoration: none; border-left: 3px solid transparent; }
.ps-mod li a:hover { color: var(--primary); }
.ps-mod li a.current { background: var(--primary-50); color: var(--primary); border-left-color: var(--primary); }
.ps-mod li .check { width: 18px; height: 18px; }
.ps-mod li .check.done::after { width: 5px; height: 8px; }
.ps-mod li span.t { flex: 1; line-height: 1.35; }
.ps-mod li small { color: var(--muted); font-size: 12px; }

.player-main { min-width: 0; }
.player-top { position: sticky; top: var(--header-h); z-index: 5; display: flex; align-items: center; gap: 14px; padding: 10px 28px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); font-size: 14px; }
.player-top .pt-title { flex: 1; min-width: 0; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-top .pt-title b { color: var(--text); }
.read-progress { position: absolute; left: 0; bottom: -1px; height: 3px; background: var(--primary); width: 0; transition: width .1s; }
.lesson-wrap { display: grid; grid-template-columns: minmax(0, 820px) 220px; gap: 48px; justify-content: center; padding: 40px 32px 80px; }
.lesson-head .lh-kicker { display: inline-flex; gap: 8px; align-items: center; font-weight: 800; color: var(--primary); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.lesson-head h1 { font-size: clamp(28px, 3vw, 38px); line-height: 1.18; margin: 10px 0 12px; letter-spacing: -.01em; }
.lesson-head .lh-meta span { display: inline-flex; align-items: center; gap: 6px; }
.lesson-head .lh-meta { display: flex; gap: 18px; color: var(--muted); font-size: 14px; font-weight: 600; flex-wrap: wrap; padding-bottom: 22px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.toc { position: sticky; top: calc(var(--header-h) + 70px); align-self: start; font-size: 14px; }
.toc b { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 10px; }
.toc a { display: block; padding: 5px 0 5px 12px; border-left: 2px solid var(--border); color: var(--text-2); text-decoration: none; line-height: 1.4; }
.toc a:hover, .toc a.active { color: var(--primary); border-left-color: var(--primary); }

/* Contenu prose */
.prose { font-size: 16.5px; color: var(--text); }
.prose h2 { font-size: 26px; margin: 44px 0 14px; letter-spacing: -.01em; line-height: 1.25; }
.prose h3 { font-size: 20px; margin: 32px 0 10px; }
.prose h4 { font-size: 17px; margin: 24px 0 8px; }
.prose p { margin: 0 0 16px; }
.prose ul, .prose ol { padding-left: 24px; margin: 0 0 18px; }
.prose li { margin: 6px 0; }
.prose li > p { margin: 0 0 6px; }
.prose strong { font-weight: 700; }
.prose blockquote { margin: 20px 0; padding: 14px 20px; border-left: 4px solid var(--primary); background: var(--bg-soft); border-radius: 0 10px 10px 0; color: var(--text-2); }
.prose blockquote p:last-child { margin: 0; }
.prose :not(pre) > code { font-family: var(--mono); font-size: .87em; padding: 2px 7px; border-radius: 6px; background: var(--primary-50); color: var(--primary-600); border: 1px solid color-mix(in srgb, var(--primary) 15%, transparent); word-break: break-word; }
[data-theme="dark"] .prose :not(pre) > code { color: #7cc0ff; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 36px 0; }
.prose img { border-radius: 12px; border: 1px solid var(--border); }
.table-wrap { overflow-x: auto; margin: 0 0 20px; border: 1px solid var(--border); border-radius: 12px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; }
.prose th { background: var(--bg-soft); text-align: left; font-weight: 700; }
.prose th, .prose td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose tr:last-child td { border-bottom: 0; }

.code-block { margin: 0 0 22px; border-radius: 12px; overflow: hidden; background: #0d1117; border: 1px solid #1f2430; }
.code-head { display: flex; align-items: center; gap: 12px; padding: 8px 12px; background: #161b22; border-bottom: 1px solid #222a36; font-size: 12.5px; color: #8b949e; }
.code-dots { display: flex; gap: 5px; } .code-dots i { width: 10px; height: 10px; border-radius: 50%; background: #3a404b; }
.is-terminal .code-dots i:nth-child(1) { background: #ff5f57; } .is-terminal .code-dots i:nth-child(2) { background: #febc2e; } .is-terminal .code-dots i:nth-child(3) { background: #28c840; }
.code-title { flex: 1; font-family: var(--mono); color: #c9d1d9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.code-lang { text-transform: uppercase; letter-spacing: .08em; font-size: 11px; }
.copy-btn { background: #21262d; color: #c9d1d9; border: 1px solid #30363d; border-radius: 6px; padding: 3px 10px; font-size: 12px; }
.copy-btn:hover { background: #30363d; } .copy-btn.ok { color: #3fb950; border-color: #3fb950; }
.code-block pre { margin: 0; padding: 16px 18px; overflow-x: auto; font-family: var(--mono); font-size: 13.5px; line-height: 1.65; tab-size: 4; }
.code-block pre code.hljs { background: transparent; padding: 0; }

.callout { margin: 24px 0; border-radius: 12px; border: 1px solid var(--border); border-left-width: 5px; background: var(--bg-soft); padding: 16px 20px 4px; }
.callout-title { font-weight: 800; font-size: 15px; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.callout-title::before { content: ''; width: 22px; height: 22px; border-radius: 6px; flex: none; background: currentColor; -webkit-mask: var(--ico) center/16px no-repeat; mask: var(--ico) center/16px no-repeat; }
.callout-body > :last-child { margin-bottom: 12px; }
.callout-tip { border-left-color: var(--teal); background: var(--teal-50); } .callout-tip .callout-title { color: var(--teal); }
.callout-info { border-left-color: var(--primary); background: var(--primary-50); } .callout-info .callout-title { color: var(--primary); }
.callout-warning { border-left-color: var(--accent); background: var(--accent-50); } .callout-warning .callout-title { color: #b07d00; }
[data-theme="dark"] .callout-warning .callout-title { color: var(--accent); }
.callout-danger { border-left-color: var(--red); background: var(--red-50); } .callout-danger .callout-title { color: var(--red); }
.callout-exercise { border-left-color: var(--violet); background: var(--violet-50); } .callout-exercise .callout-title { color: var(--violet); }
.callout-goal { border-left-color: var(--primary); background: linear-gradient(120deg, var(--primary-50), var(--teal-50)); } .callout-goal .callout-title { color: var(--primary); }
.callout-pro { border-left-color: var(--orange); background: color-mix(in srgb, var(--orange) 9%, var(--bg)); } .callout-pro .callout-title { color: var(--orange); }
.callout-git { border-left-color: #f05033; background: color-mix(in srgb, #f05033 8%, var(--bg)); } .callout-git .callout-title { color: #f05033; }
.callout { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='9' fill='none' stroke='black' stroke-width='2.4'/%3E%3Cpath d='M12 8v5M12 16v.5' stroke='black' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E"); }
.callout-tip, .callout-pro { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 18h6M10 21h4M12 3a6 6 0 0 0-4 10.5c.7.7 1 1.5 1 2.5h6c0-1 .3-1.8 1-2.5A6 6 0 0 0 12 3z' fill='none' stroke='black' stroke-width='2.2' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.callout-exercise { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 20h4L19 9l-4-4L4 16v4z' fill='none' stroke='black' stroke-width='2.2' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.callout-goal { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='9' fill='none' stroke='black' stroke-width='2.2'/%3E%3Ccircle cx='12' cy='12' r='4.5' fill='none' stroke='black' stroke-width='2.2'/%3E%3C/svg%3E"); }
.callout-git { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='6' cy='6' r='2.5' fill='none' stroke='black' stroke-width='2.2'/%3E%3Ccircle cx='6' cy='18' r='2.5' fill='none' stroke='black' stroke-width='2.2'/%3E%3Ccircle cx='18' cy='9' r='2.5' fill='none' stroke='black' stroke-width='2.2'/%3E%3Cpath d='M6 8.5v7M18 11.5c0 4-6 3-11 5' fill='none' stroke='black' stroke-width='2.2'/%3E%3C/svg%3E"); }
details.callout-solution { padding: 0; border-left-color: var(--teal); background: var(--bg-elev); }
details.callout-solution summary { padding: 14px 20px; font-weight: 800; color: var(--teal); cursor: pointer; }
details.callout-solution .callout-body { padding: 4px 20px 8px; border-top: 1px dashed var(--border); }

.task-item { list-style: none; margin-left: -22px !important; }
.task-item label { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; padding: 6px 10px; border-radius: 8px; }
.task-item label:hover { background: var(--bg-soft); }
.task-item p { margin: 0; }
.task-check { appearance: none; flex: none; width: 20px; height: 20px; margin-top: 3px; border: 2px solid var(--border); border-radius: 6px; background: var(--bg-elev); display: grid; place-items: center; }
.task-check:checked { background: var(--teal); border-color: var(--teal); }
.task-check:checked::after { content: ''; width: 5px; height: 9px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) translate(-1px, -1px); }
.task-check:checked + span { color: var(--muted); text-decoration: line-through; }

.quiz { margin: 30px 0; border: 1px solid var(--border); border-radius: 16px; padding: 22px; background: var(--bg-elev); box-shadow: var(--shadow-sm); }
.quiz-head { display: flex; align-items: center; gap: 10px; font-weight: 700; margin-bottom: 12px; }
.quiz-badge { background: var(--accent); color: #1c1c28; font-weight: 800; font-size: 12px; padding: 4px 10px; border-radius: 6px; text-transform: uppercase; letter-spacing: .06em; }
.quiz-score { margin-left: auto; color: var(--teal); font-weight: 800; }
.quiz-q { padding: 14px 0; border-top: 1px dashed var(--border); }
.quiz-question { margin: 0 0 10px !important; }
.quiz-opts { display: grid; gap: 8px; }
.quiz-opt { display: flex; gap: 12px; align-items: center; text-align: left; width: 100%; padding: 10px 14px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--bg); color: var(--text); font-size: 15px; transition: border-color .15s, background .15s; }
.quiz-opt:hover:not(:disabled) { border-color: var(--primary); }
.quiz-letter { flex: none; width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: var(--bg-soft); font-weight: 800; font-size: 13px; color: var(--text-2); }
.quiz-opt.correct { border-color: var(--teal); background: var(--teal-50); } .quiz-opt.correct .quiz-letter { background: var(--teal); color: #fff; }
.quiz-opt.wrong { border-color: var(--red); background: var(--red-50); } .quiz-opt.wrong .quiz-letter { background: var(--red); color: #fff; }
.quiz-opt:disabled { cursor: default; }
.quiz-explain { margin-top: 10px; padding: 10px 14px; border-radius: 10px; background: var(--bg-soft); font-size: 14.5px; color: var(--text-2); }
.quiz-reset { margin-top: 10px; font-size: 13px; padding: 8px 14px; }

.lesson-foot { margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--border); display: grid; gap: 20px; }
.complete-box { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 24px; border-radius: 14px; background: var(--bg-soft); border: 1px solid var(--border); }
.complete-box b { display: block; } .complete-box span { color: var(--muted); font-size: 14px; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pager a { display: block; padding: 16px 20px; border: 1px solid var(--border); border-radius: 14px; color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s; }
.pager a:hover { border-color: var(--primary); transform: translateY(-2px); }
.pager small { display: block; color: var(--muted); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.pager b { font-size: 15.5px; }
.pager .next { text-align: right; grid-column: 2; }

/* ---------- Progression / attestation ---------- */
.prog-wrap { padding: 40px 0 88px; display: grid; gap: 28px; }
.prog-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.prog-card { padding: 22px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg-elev); }
.prog-card b { font-size: 30px; display: block; font-weight: 800; } .prog-card span { color: var(--muted); font-weight: 600; font-size: 14px; }
.prog-table { width: 100%; border-collapse: collapse; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.prog-table th, .prog-table td { padding: 14px 18px; border-bottom: 1px solid var(--border); text-align: left; font-size: 15px; }
.prog-table th { background: var(--bg-soft); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.prog-table td .bar { width: 160px; display: inline-block; vertical-align: middle; margin-right: 8px; }

.cert { max-width: 920px; margin: 40px auto 88px; padding: 56px; border-radius: 20px; background: var(--bg-elev); border: 1px solid var(--border); box-shadow: var(--shadow-lg); text-align: center; position: relative; overflow: hidden; }
.cert::before { content: ''; position: absolute; inset: 14px; border: 2px solid var(--accent); border-radius: 14px; pointer-events: none; }
.cert h2 { font-size: 15px; letter-spacing: .3em; text-transform: uppercase; color: var(--primary); margin: 0; }
.cert .cert-name { font-size: 42px; font-weight: 800; margin: 18px 0 6px; border: 0; background: transparent; text-align: center; width: 100%; color: var(--text); font-family: var(--font); border-bottom: 2px dashed var(--border); }
.cert p { color: var(--text-2); }
.cert .cert-title { font-size: 22px; font-weight: 800; color: var(--text); margin: 10px 0; }
.cert .cert-foot { display: flex; justify-content: space-between; margin-top: 40px; font-size: 14px; color: var(--muted); text-align: left; }
.locked { text-align: center; padding: 80px 20px; }

/* ---------- Recherche ---------- */
.search-modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: start center; padding-top: 12vh; }
.search-modal[hidden] { display: none; }
.search-backdrop { position: absolute; inset: 0; background: rgba(10, 14, 30, .55); backdrop-filter: blur(3px); }
.search-panel { position: relative; width: min(680px, 92vw); background: var(--bg-elev); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; border: 1px solid var(--border); }
.search-panel input { width: 100%; border: 0; border-bottom: 1px solid var(--border); padding: 20px 22px; font: inherit; font-size: 17px; background: transparent; color: var(--text); outline: none; }
.search-results { list-style: none; margin: 0; padding: 8px; max-height: 52vh; overflow-y: auto; }
.search-results a { display: block; padding: 10px 14px; border-radius: 10px; color: var(--text); text-decoration: none; }
.search-results a small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.search-results a span { display: block; color: var(--text-2); font-size: 13px; margin-top: 2px; }
.search-results a.sel, .search-results a:hover { background: var(--primary-50); }
.search-results mark { background: var(--accent-50); color: inherit; border-radius: 3px; }
.search-foot { padding: 10px 16px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--border); }

.toast { visibility: hidden; position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 140%); background: #1c1c28; color: #fff; padding: 12px 20px; border-radius: 12px; font-weight: 600; font-size: 14px; box-shadow: var(--shadow-lg); transition: transform .3s; z-index: 120; }
.toast.show { visibility: visible; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) { .lesson-wrap { grid-template-columns: minmax(0, 820px); } .toc { display: none; } }
@media (max-width: 1020px) {
  .hero-grid, .project-grid, .programme-grid { grid-template-columns: 1fr; }
  .hero-visual { min-height: 420px; }
  .method-grid { grid-template-columns: 1fr 1fr; }
  .stats-grid, .prog-cards { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(3) { border-left: 0; }
  .search-trigger { min-width: 0; } .search-trigger span, .search-trigger kbd { display: none; }
  .player { grid-template-columns: 1fr; }
  .player-side { position: fixed; left: 0; top: var(--header-h); width: min(340px, 88vw); z-index: 40; transform: translateX(-100%); transition: transform .25s; box-shadow: var(--shadow-lg); }
  .player.side-open .player-side { transform: none; }
  .player.no-side .player-side { visibility: visible; }
  .side-card { position: static; }
}
@media (max-width: 760px) {
  .main-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: var(--bg-elev); border-top: 1px solid var(--border); box-shadow: 0 -6px 20px rgba(16,24,40,.08); }
  .main-nav a { font-size: 13px; padding: 8px 10px; }
  body { padding-bottom: 64px; }
  .header-inner { gap: 12px; }
  #resume-btn { display: none; }
  .section { padding: 64px 0; }
  .method-grid, .stats-grid, .prog-cards { grid-template-columns: 1fr; }
  .stat + .stat { border-left: 0; border-top: 1px solid var(--border); }
  .cta-band { flex-direction: column; align-items: flex-start; padding: 36px 28px; }
  .tp-events { grid-template-columns: 1fr 1fr; }
  .hv-code { display: none; }
  .lesson-wrap { padding: 28px 18px 64px; }
  .pager { grid-template-columns: 1fr; } .pager .next { grid-column: 1; }
  .cur-module .mprog { display: none; } .cur-module .msum { padding-left: 20px; }
  .lesson-list a { padding-left: 50px; } .lesson-list .lnum { left: 12px; }
  .cert { padding: 36px 22px; } .cert .cert-name { font-size: 28px; }
  .complete-box { flex-direction: column; align-items: flex-start; }
}
@media print {
  .site-header, .no-print, .search-modal, .toast { display: none !important; }
  .cert { box-shadow: none; margin: 0 auto; }
}

/* ==========================================================================
   Mode atelier : XP, mission, exercices auto-corrigés
   ========================================================================== */
.xp-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; background: var(--accent-50); border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent); color: var(--text); font-size: 13px; font-weight: 600; text-decoration: none !important; white-space: nowrap; }
.xp-chip b { font-weight: 800; }
.xp-chip .xp-lv { color: var(--muted); font-weight: 600; padding-left: 6px; border-left: 1px solid var(--border); }
.xp-chip .xp-bar { width: 46px; height: 5px; border-radius: 99px; background: var(--border); overflow: hidden; }
.xp-chip .xp-bar i { display: block; height: 100%; background: var(--accent); }
@media (max-width: 1180px) { .xp-chip .xp-lv, .xp-chip .xp-bar { display: none; } }
.toast.xp { background: #1c1c28; border-left: 4px solid var(--accent); }
.toast.level { background: linear-gradient(120deg, var(--primary), var(--teal)); font-size: 16px; }
.toast.badge { background: linear-gradient(120deg, #7c5cff, #e5484d); }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 200; }

/* Carte mission en tête de leçon */
.mission { margin: 4px 0 28px; border-radius: 16px; background: linear-gradient(120deg, var(--primary), #004c96); color: #fff; padding: 18px 20px; box-shadow: var(--shadow); }
.mission-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 12px; }
.mission-kicker { display: block; font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.mission-head b { font-size: 18px; }
.mission-xp { background: rgba(255,255,255,.14); padding: 6px 12px; border-radius: 99px; font-size: 14px; white-space: nowrap; }
.mission-xp b { font-size: 16px; color: var(--accent); }
.mission-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.mission-list button { width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); color: #fff; border-radius: 10px; padding: 9px 12px; font-size: 14px; }
.mission-list button:hover { background: rgba(255,255,255,.16); }
.ms-dot { flex: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255,255,255,.6); }
.mission-list [data-status="done"] .ms-dot { background: var(--teal); border-color: var(--teal); }
.mission-list [data-status="revealed"] .ms-dot, .mission-list [data-status="skipped"] .ms-dot { background: rgba(255,255,255,.5); }
.ms-type { flex: none; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); width: 128px; }
.ms-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-xp { font-weight: 800; font-size: 13px; }
@media (max-width: 760px) { .ms-type { display: none; } }
#complete.is-locked { background: var(--bg-elev); color: var(--muted); border: 1.5px dashed var(--border); box-shadow: none; }

.ldefis { font-size: 12px; font-weight: 700; color: var(--violet); background: var(--violet-50); padding: 2px 8px; border-radius: 99px; white-space: nowrap; }

/* Code long replié */
.code-block.is-collapsed pre { max-height: 330px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.code-more { display: block; width: 100%; border: 0; border-top: 1px solid #222a36; background: #161b22; color: #8bb8ff; font-size: 13px; font-weight: 700; padding: 8px; }
.code-more:hover { background: #1b2230; }

/* Théorie repliable */
details.callout-theorie { padding: 0; border-left-color: var(--muted); background: var(--bg-soft); }
details.callout-theorie summary { padding: 12px 18px; font-weight: 700; color: var(--text-2); cursor: pointer; }
details.callout-theorie[open] summary { border-bottom: 1px dashed var(--border); }
details.callout-theorie .callout-body { padding: 12px 18px 4px; }

/* ---------- Carte d'exercice ---------- */
.exc { margin: 30px 0; border: 2px solid var(--border); border-radius: 18px; background: var(--bg-elev); box-shadow: var(--shadow-sm); overflow: hidden; transition: border-color .3s; }
.exc[data-status="done"] { border-color: var(--teal); }
.exc[data-status="revealed"], .exc[data-status="skipped"] { border-color: color-mix(in srgb, var(--muted) 50%, var(--border)); }
.exc.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@media (prefers-reduced-motion: reduce) { .exc.shake { animation: none; } }
.exc-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 18px; background: var(--bg-soft); border-bottom: 1px solid var(--border); }
.exc-type { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #fff; padding: 4px 10px; border-radius: 6px; background: var(--violet); }
.exc-redaction .exc-type { background: var(--primary); }
.exc-preuve .exc-type { background: var(--orange); }
.exc-terminal .exc-type { background: #1c1c28; }
.exc-cloze .exc-type, .exc-order .exc-type { background: var(--teal); }
.exc-bugfind .exc-type { background: var(--red); }
.exc-sql .exc-type { background: #336791; }
.exc-title { flex: 1; min-width: 200px; margin: 0 !important; font-size: 17px !important; line-height: 1.3; }
.exc-xp { font-weight: 800; color: #b07d00; background: var(--accent-50); padding: 3px 10px; border-radius: 99px; font-size: 13px; }
[data-theme="dark"] .exc-xp { color: var(--accent); }
.exc-badge:empty { display: none; }
.exc-badge { font-size: 13px; font-weight: 800; color: #fff; background: var(--teal); padding: 3px 10px; border-radius: 99px; }
.exc[data-status="revealed"] .exc-badge, .exc[data-status="skipped"] .exc-badge { background: var(--muted); }
.exc-consigne { padding: 16px 18px 0; }
.exc-consigne > :last-child { margin-bottom: 0; }
.exc-body { padding: 16px 18px; }
.exc-feedback:empty { display: none; }
.exc-feedback { margin: 0 18px 12px; padding: 10px 14px; border-radius: 10px; font-size: 15px; font-weight: 600; }
.fb-ok { background: var(--teal-50); color: #127a69; }
[data-theme="dark"] .fb-ok { color: #5fd3b5; }
.fb-ko { background: var(--red-50); color: var(--red); }
.fb-info { background: var(--primary-50); color: var(--text-2); font-weight: 500; }
.exc-explain { margin-top: 8px; font-weight: 400; color: var(--text-2); }
.exc-explain > :last-child { margin-bottom: 0; }
.exc-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 0 18px 18px; }
.btn-link { background: none; border: 0; color: var(--primary); padding: 9px 8px; font-weight: 700; }
.btn-link:hover { text-decoration: underline; }
.muted { color: var(--muted); font-size: 14px; }

/* Rédaction */
.exc-write { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; align-items: start; }
.exc-editor { width: 100%; min-height: 160px; resize: vertical; border: 1.5px solid var(--border); border-radius: 12px; padding: 14px 16px; font: 16px/1.6 var(--font); color: var(--text); background: var(--bg); }
.exc-editor.mono { font: 14px/1.6 var(--mono); tab-size: 2; }
.exc-editor:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-50); }
.exc-criteria { position: sticky; top: calc(var(--header-h) + 70px); border: 1px solid var(--border); border-radius: 12px; padding: 14px; background: var(--bg-soft); font-size: 14px; }
.exc-criteria > b { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 8px; }
.exc-criteria ul, .sql-tests ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.crit { display: grid; grid-template-columns: 18px 1fr; gap: 4px 8px; line-height: 1.4; }
.crit .dot { width: 16px; height: 16px; margin-top: 2px; border-radius: 50%; border: 2px solid var(--border); background: var(--bg-elev); transition: all .2s; }
.crit[data-state="ok"] .dot { background: var(--teal); border-color: var(--teal); box-shadow: inset 0 0 0 3px var(--bg-elev); }
.crit[data-state="ko"] .dot { border-color: var(--red); }
.crit[data-state="ok"] span { color: var(--text); }
.crit[data-state="idle"] span, .crit:not([data-state]) span { color: var(--text-2); }
.crit-hint, .crit-err { grid-column: 2; display: none; color: var(--red); font-size: 13px; }
.crit.show-hint .crit-hint, .crit-err:not(:empty) { display: block; }
.crit-err { font-family: var(--mono); font-size: 12px; word-break: break-word; }
.exc-meta { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border); color: var(--muted); font-size: 13px; }
.exc-command { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; padding: 10px 12px; border-radius: 10px; background: #0d1117; color: #c9d1d9; }
.exc-command span { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #8b949e; font-weight: 800; }
.exc-command code { flex: 1; font-family: var(--mono); font-size: 13.5px; background: none !important; border: 0 !important; color: #7ee787 !important; word-break: break-all; }
.exc-command .btn-ghost { color: #c9d1d9; border-color: #30363d; }
.exc-model { margin: 0 18px 16px; padding: 16px 18px; border-radius: 12px; border: 1px dashed var(--teal); background: var(--teal-50); }
.exc-model h4 { margin: 0 0 10px; font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: #127a69; }
[data-theme="dark"] .exc-model h4 { color: #5fd3b5; }
.exc-model h4 + .muted { margin-top: -6px; }
.exc-model-body { background: var(--bg-elev); border-radius: 10px; padding: 14px 16px; margin-bottom: 14px; font-size: 15px; }
.exc-model-body > :last-child { margin-bottom: 0; }
.selfcheck { list-style: none; padding: 0 !important; margin: 0 !important; }
.selfcheck label { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.selfcheck input { margin-top: 5px; accent-color: var(--teal); width: 16px; height: 16px; }

/* Terminal */
.term { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; }
.term-steps { margin: 0; padding: 0 0 0 4px; list-style: none; counter-reset: st; display: grid; gap: 8px; align-content: start; font-size: 14px; }
.term-steps li { counter-increment: st; display: grid; grid-template-columns: 26px 1fr; gap: 8px; color: var(--muted); line-height: 1.4; }
.term-steps li::before { content: counter(st); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 12px; background: var(--bg-soft); border: 1px solid var(--border); }
.term-steps li[data-state="current"] { color: var(--text); font-weight: 600; }
.term-steps li[data-state="current"]::before { background: var(--primary); color: #fff; border-color: var(--primary); }
.term-steps li[data-state="ok"]::before { content: '✓'; background: var(--teal); color: #fff; border-color: var(--teal); }
.term-steps li[data-state="ok"] { color: var(--text-2); }
.term-screen { background: #0d1117; border-radius: 12px; overflow: hidden; border: 1px solid #1f2430; font-family: var(--mono); font-size: 13.5px; color: #c9d1d9; display: flex; flex-direction: column; min-height: 280px; cursor: text; }
.term-bar { display: flex; align-items: center; gap: 6px; padding: 8px 12px; background: #161b22; color: #8b949e; font-size: 12px; }
.term-bar i { width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; } .term-bar i:nth-child(2) { background: #febc2e; } .term-bar i:nth-child(3) { background: #28c840; }
.term-bar span { margin-left: 8px; }
.term-out { flex: 1; padding: 12px 14px 0; max-height: 340px; overflow-y: auto; }
.term-out pre { margin: 0 0 4px; white-space: pre-wrap; word-break: break-word; font: inherit; }
.term-out .term-cmd { color: #e6edf3; }
.term-out .term-err { color: #ff7b72; margin-bottom: 4px; }
.term-out .term-hint { color: #febc2e; margin-bottom: 4px; }
.term-out .term-hint code { color: #7ee787; background: none !important; border: 0 !important; }
.term-out .term-ok { color: #3fb950; margin: 6px 0; }
.term-out .term-muted { color: #6e7681; }
.term-line { display: flex; gap: 8px; padding: 8px 14px 14px; align-items: center; }
.term-ps1 { color: #3fb950; white-space: nowrap; }
.term-line input { flex: 1; min-width: 0; background: transparent; border: 0; color: #e6edf3; font: inherit; outline: none; caret-color: #3fb950; }
.term-line input:disabled { opacity: .4; }

/* Code à trous / chasse au bug */
.exc-code { margin-bottom: 0 !important; }
.exc-code pre { margin: 0; padding: 16px 18px; overflow-x: auto; font-family: var(--mono); font-size: 13.5px; line-height: 1.9; }
.blank { font: inherit; font-size: 13px; color: #e6edf3; background: #21262d; border: 1px dashed #58a6ff; border-radius: 5px; padding: 1px 6px; margin: 0 2px; }
.blank:focus { outline: 2px solid #58a6ff; border-style: solid; }
.blank.ok { border: 1px solid #3fb950; background: #12261b; color: #7ee787; }
.blank.ko { border: 1px solid #f85149; background: #2d1214; color: #ffa198; }
.bug-lines { padding: 10px 0; font-family: var(--mono); font-size: 13.5px; line-height: 1.7; overflow-x: auto; }
.bug-line { display: flex; width: 100%; gap: 14px; text-align: left; background: transparent; border: 0; border-left: 3px solid transparent; padding: 1px 16px 1px 10px; color: #c9d1d9; font: inherit; cursor: pointer; }
.bug-line:hover { background: #161b22; }
.bug-line .ln { width: 26px; flex: none; color: #6e7681; text-align: right; user-select: none; }
.bug-line code { white-space: pre; background: none !important; border: 0 !important; padding: 0 !important; color: inherit; }
.bug-line[aria-pressed="true"] { background: #1f2a3d; border-left-color: #58a6ff; }
.bug-line.ok { background: #12261b; border-left-color: #3fb950; }
.bug-line.ko { background: #2d1214; border-left-color: #f85149; }
.bug-line.miss { background: #2e2410; border-left-color: #febc2e; }

/* Remise en ordre */
.order-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; counter-reset: o; }
.order-list li { counter-increment: o; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 10px; background: var(--bg); cursor: grab; transition: border-color .15s, transform .15s; }
.order-list li::before { content: counter(o); flex: none; width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; font-weight: 800; font-size: 12px; background: var(--bg-soft); color: var(--muted); }
.order-list li.dragging { opacity: .5; } .order-list li.over { border-color: var(--primary); }
.order-list li.ok { border-color: var(--teal); background: var(--teal-50); } .order-list li.ko { border-color: var(--red); background: var(--red-50); }
.order-list .grip { color: var(--muted); letter-spacing: -2px; }
.ord-txt { flex: 1; min-width: 0; }
.order-list.is-code .ord-txt code { font-family: var(--mono); font-size: 13px; background: none !important; border: 0 !important; padding: 0 !important; color: var(--text) !important; white-space: pre-wrap; }
.ord-btns { display: flex; gap: 4px; }
.ord-btns button { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-elev); color: var(--text-2); font-size: 11px; }
.ord-btns button:hover { border-color: var(--primary); color: var(--primary); }

/* Labo SQL */
.sql-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.sql-label { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; font-size: 13px; }
.sql-label b { font-family: var(--mono); }
.sql-tests { border: 1px solid var(--border); border-radius: 12px; padding: 14px; background: var(--bg-soft); font-size: 14px; }
.sql-tests > b { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 8px; }
.sql-console { margin-top: 14px; }
.sql-console summary { cursor: pointer; font-weight: 700; color: var(--text-2); font-size: 14px; }
.sql-console textarea { margin: 10px 0 8px; min-height: 70px; }
.sql-result { margin-top: 10px; font-size: 13px; }
.sql-result table { font-size: 13px; }

/* Progression : niveau et badges */
.level-card { display: flex; align-items: center; gap: 24px; padding: 24px; border-radius: 18px; background: linear-gradient(120deg, var(--primary), #20ad96); color: #fff; box-shadow: var(--shadow); flex-wrap: wrap; }
.lv-ring { --p: 0; width: 96px; height: 96px; border-radius: 50%; background: conic-gradient(var(--accent) calc(var(--p) * 1%), rgba(255,255,255,.25) 0); display: grid; place-items: center; flex: none; }
.lv-ring span { width: 74px; height: 74px; border-radius: 50%; background: rgba(0, 40, 90, .55); display: grid; place-items: center; font-weight: 800; font-size: 30px; }
.lv-txt { flex: 1; min-width: 220px; display: grid; gap: 6px; }
.lv-txt small { opacity: .8; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: 12px; }
.lv-txt b { font-size: 26px; }
.lv-txt .bar { background: rgba(255,255,255,.25); height: 8px; } .lv-txt .bar i { background: var(--accent); }
.lv-txt span { opacity: .9; font-size: 14px; }
.lv-streak { text-align: center; background: rgba(255,255,255,.14); border-radius: 14px; padding: 12px 18px; }
.lv-streak b { display: block; font-size: 30px; } .lv-streak span { font-size: 13px; opacity: .9; }
.h-sec { font-size: 22px; margin: 12px 0 0; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.badge-item { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 18px 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--bg-elev); opacity: .55; filter: grayscale(1); }
.badge-item.on { opacity: 1; filter: none; border-color: var(--accent); box-shadow: 0 8px 22px -12px rgba(255, 194, 33, .9); }
.badge-medal { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-50); color: #c79200; }
.badge-item.on .badge-medal { background: var(--accent); color: #1c1c28; }
.badge-item b { font-size: 15px; } .badge-item small { color: var(--muted); font-size: 13px; line-height: 1.35; }

@media (max-width: 900px) {
  .exc-write, .sql-grid, .term { grid-template-columns: 1fr; }
  .exc-criteria { position: static; }
}
[hidden] { display: none !important; }
.main-nav a { white-space: nowrap; }
@media (max-width: 1480px) { .search-trigger { min-width: 0; } .search-trigger span, .search-trigger kbd { display: none; } }
.code-block pre { color: #c9d1d9; }
.hv-meta span, .cc-meta span { display: inline-flex; align-items: center; gap: 5px; }

/* Vidéo d'intro de la leçon */
.lesson-video { margin: 0 0 28px; border-radius: 16px; overflow: hidden; background: #0b1530; box-shadow: 0 14px 40px rgba(10,26,63,.18); }
.lesson-video video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #0b1530; }
.lesson-video figcaption { display: flex; align-items: center; gap: 8px; padding: 10px 16px; font-size: 13px; font-weight: 600; color: #c8d3f5; }

/* Leçon en pages : onglets Leçon / Pratique / Quiz */
.part[hidden] { display: none; }
.part-tabs { display: flex; gap: 8px; margin: 0 0 28px; padding: 6px; background: var(--surface-2, #f4f6f8); border: 1px solid var(--border); border-radius: 14px; position: sticky; top: calc(var(--header-h) + 8px); z-index: 5; }
.part-tabs button { flex: 1; padding: 10px 12px; border: 0; border-radius: 10px; background: transparent; color: var(--text-2); font: inherit; font-weight: 600; cursor: pointer; }
.part-tabs button b { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 6px; border-radius: 50%; background: var(--border); font-size: 12px; }
.part-tabs button.active { background: var(--surface, #fff); color: var(--primary); box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.part-tabs button.active b { background: var(--primary); color: #fff; }
.part-next { margin-top: 32px; }
