/* Formation Rizlum : charte (bleu profond #10123C, bleu violacé #323260, bleu électrique #1220E9, Inter) */
:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --ink: #10123c;
  --ink-2: #4a4c72;
  --muted: #7b7da0;
  --line: #e2e4f0;
  --accent: #1220e9;
  --accent-soft: #eceefe;
  --violet: #323260;
  --ok: #1f8a4c;
  --ok-soft: #e7f5ec;
  --ko: #c0392b;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 18, 60, .06), 0 8px 24px rgba(16, 18, 60, .06);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0c26; --surface: #15173a; --ink: #eceefb; --ink-2: #c1c3e6; --muted: #8f92bf;
    --line: #2a2d5a; --accent: #7b84ff; --accent-soft: #1e2152; --violet: #a9abe0;
    --ok: #5fd08d; --ok-soft: #173327; --ko: #ff8a7a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  }
  :root:not([data-theme="light"]) .logo-ink { display: none !important; }
  :root:not([data-theme="light"]) .logo-white { display: block !important; }
}
:root[data-theme="dark"] {
  --bg: #0b0c26; --surface: #15173a; --ink: #eceefb; --ink-2: #c1c3e6; --muted: #8f92bf;
  --line: #2a2d5a; --accent: #7b84ff; --accent-soft: #1e2152; --violet: #a9abe0;
  --ok: #5fd08d; --ok-soft: #173327; --ko: #ff8a7a;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.65 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}
a { color: var(--accent); }
img, video { max-width: 100%; display: block; }
.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 10; }

.top { display: flex; justify-content: space-between; align-items: center; padding: 14px 24px; max-width: 1280px; margin: 0 auto; }
.brand img { height: 30px; width: auto; }
.logo-white { display: none !important; }
:root[data-theme="dark"] .logo-ink { display: none !important; }
:root[data-theme="dark"] .logo-white { display: block !important; }
.langs { display: flex; gap: 6px; }
.lang { min-width: 40px; text-align: center; padding: 5px 10px; border-radius: 9px; border: 1px solid var(--line);
  font-size: 13px; font-weight: 600; text-decoration: none; color: var(--ink-2); background: var(--surface); }
.lang.on { background: var(--violet); border-color: var(--violet); color: #fff; }
.lang.off { opacity: .45; cursor: not-allowed; }

.layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 48px; max-width: 1280px; margin: 0 auto; padding: 8px 24px 64px; }
.side { position: sticky; top: 16px; align-self: start; max-height: calc(100vh - 32px); overflow: auto; padding-right: 4px; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: 12px; font-weight: 600; color: var(--muted); margin: 0 0 6px; }
.side-title { font-weight: 700; font-size: 18px; margin: 0 0 14px; }
.bar { height: 6px; background: var(--line); border-radius: 6px; overflow: hidden; }
.bar-fill { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s; }
.side-progress { font-size: 14px; font-weight: 600; margin: 10px 0 0; }
.side-total { font-size: 13px; color: var(--muted); margin: 0 0 16px; }
.nav { list-style: none; margin: 0; padding: 0; }
.toc > summary { display: none; }
.nav-step { font-size: 11.5px; letter-spacing: .07em; text-transform: uppercase; font-weight: 700; color: var(--violet); margin: 18px 0 6px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 10px; text-decoration: none; color: var(--ink); font-size: 15px; border: 1px solid transparent; }
.nav-item:hover { background: var(--surface); }
.nav-item.on { background: var(--surface); border-color: var(--line); box-shadow: var(--shadow); font-weight: 600; }
.nav-label { flex: 1; }
.nav-dur { font-size: 12px; color: var(--muted); white-space: nowrap; }
.nav-dur.small { font-size: 11px; white-space: normal; text-align: right; max-width: 110px; line-height: 1.3; }
.dot { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line); flex: none; display: grid; place-items: center; }
.nav-item.done .dot, .welcome-dot { background: var(--ok); border-color: var(--ok); }
.nav-item.done .dot::after, .welcome-dot::after { content: ""; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.nav-sep { border-top: 1px solid var(--line); margin: 16px 0 8px; }
.lock { width: 18px; text-align: center; color: var(--muted); }

.content { min-width: 0; max-width: 780px; }
h1 { font-size: clamp(30px, 4vw, 42px); line-height: 1.15; margin: 4px 0 18px; letter-spacing: -.01em; }
h2 { font-size: 22px; margin: 40px 0 6px; }
.lead { font-size: 19px; color: var(--ink-2); }
.meta { color: var(--muted); font-size: 14px; font-weight: 600; }
.cta { display: inline-block; background: var(--accent); color: #fff; padding: 13px 24px; border-radius: 12px; font-weight: 600;
  text-decoration: none; border: 0; font: inherit; font-weight: 600; cursor: pointer; }
.cta:hover { filter: brightness(1.08); }
.hero { border-radius: var(--radius); box-shadow: var(--shadow); margin: 28px 0; }
.cards { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 10px; counter-reset: c; }
.cards a { display: block; padding: 14px 16px 14px 52px; position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; text-decoration: none; color: var(--ink); counter-increment: c; }
.cards a::before { content: counter(c); position: absolute; left: 16px; top: 14px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 700; display: grid; place-items: center; }
.card-title { display: block; font-weight: 600; }
.card-goal { display: block; font-size: 14.5px; color: var(--ink-2); }

.goal { background: var(--surface); border-left: 3px solid var(--accent); border-radius: 0 12px 12px 0; padding: 12px 16px; margin: 0 0 22px; }
.goal-label { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .07em; font-weight: 700; color: var(--accent); }
.goal p:last-child { margin: 2px 0 0; }
.player { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: #10123c; }
.player video { width: 100%; aspect-ratio: 16 / 9; }
.player-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.speeds { display: flex; align-items: center; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.speed-label { font-size: 13px; color: var(--muted); padding: 0 8px; }
.speed { border: 0; background: none; color: var(--ink-2); font: inherit; font-size: 13px; padding: 4px 10px; border-radius: 999px; cursor: pointer; }
.speed.on { background: var(--violet); color: #fff; }
.player-dur { font-size: 13px; color: var(--muted); }

.read-intro { color: var(--muted); font-size: 15px; }
.beat { margin: 22px 0 14px; padding: 2px 0 2px 14px; border-left: 3px solid transparent; transition: border-color .2s, background .2s; }
.beat.now { border-left-color: var(--accent); }
.fig { margin: 0 0 8px; }
.fig img { border-radius: 12px; border: 1px solid var(--line); box-shadow: var(--shadow); width: 100%; height: auto; }
.fig figcaption { margin-top: 6px; }
.seek { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--accent); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; padding: 4px 0; }
.seek svg { width: 12px; height: 12px; fill: currentColor; }
.seek-time { color: var(--muted); font-weight: 500; }
.practice { background: var(--accent-soft); border-radius: var(--radius); padding: 4px 22px 14px; margin-top: 36px; }
.practice h2 { margin-top: 16px; }
.done-wrap { margin: 26px 0; }
.done-btn { font: inherit; font-weight: 600; padding: 11px 20px; border-radius: 12px; border: 1.5px solid var(--ok); background: var(--surface); color: var(--ok); cursor: pointer; }
.done-btn.is-done { background: var(--ok); color: #fff; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 30px 0; }
.pager a { display: flex; flex-direction: column; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-decoration: none; color: var(--ink); font-weight: 600; }
.pager small { color: var(--muted); font-weight: 500; }
.pager .next { text-align: right; grid-column: 2; }
.foot { color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 40px; }

.quiz .q { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 14px 18px; margin: 0 0 14px; }
.quiz legend { font-weight: 600; padding: 0 4px; }
.opt { display: flex; gap: 10px; align-items: flex-start; padding: 6px 4px; cursor: pointer; }
.opt input { margin-top: 6px; }
.q.right { border-color: var(--ok); }
.q.wrong { border-color: var(--ko); }
.explain { font-size: 14.5px; color: var(--ink-2); margin: 6px 0 0; }
.score { font-weight: 700; font-size: 18px; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; gap: 8px; padding: 8px 16px 48px; }
  .side { position: static; max-height: none; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: var(--surface); }
  .top { padding: 12px 16px; }
  .toc > summary { display: list-item; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--accent); padding: 4px 0; }
  .side-total { margin-bottom: 6px; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { grid-column: auto; }
}
