/* Layout : en-tête collant (marque, vitesse audio) ; vues routées par #ancre : accueil, matière, leçon, quiz, cartes, glossaire. Une colonne de lecture de 720px, grilles qui se replient sur mobile. */
/* ===== polices hébergées sur le site (disponibles hors connexion, sans appel à un service extérieur) */
@font-face { font-family: "Literata"; font-weight: 600; font-display: swap; src: url("fonts/literata-600.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Literata"; font-weight: 600; font-display: swap; src: url("fonts/literata-600-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Literata"; font-weight: 800; font-display: swap; src: url("fonts/literata-800.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Literata"; font-weight: 800; font-display: swap; src: url("fonts/literata-800-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 400; font-display: swap; src: url("fonts/atkinson-400.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 400; font-display: swap; src: url("fonts/atkinson-400-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 700; font-display: swap; src: url("fonts/atkinson-700.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 700; font-display: swap; src: url("fonts/atkinson-700-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 400; font-style: italic; font-display: swap; src: url("fonts/atkinson-400i.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 400; font-style: italic; font-display: swap; src: url("fonts/atkinson-400i-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
:root {
  --bg: #eef1f4;
  --surface: #ffffff;
  --ink: #141c2e;
  --muted: #586174;
  --line: #d6dce5;
  --accent: #23468f;
  --accent-soft: #e2e9f7;
  --saffron: #b9740a;
  --saffron-soft: #fbefd8;
  --good: #1d7a45;
  --good-soft: #e1f2e8;
  --bad: #b3372b;
  --bad-soft: #f8e3e0;
  --s-a: #23468f; --s-b: #0f6b5f; --s-c: #7a3d8f; --s-d: #a3501c; --s-e: #8b1d3f; --s-f: #3a5f1c; --s-g: #6b4a12; --s-h: #1f5f7a; --s-i: #5a3fc0; --s-j: #c44a2d; --s-k: #2b3f8f; --s-l: #9e2e46; --s-m: #a85a14; --s-n: #0e6b4f;
  --font-display: "Literata", Georgia, "Times New Roman", serif;
  --font-body: "Atkinson Hyperlegible", "Segoe UI", Roboto, Arial, sans-serif;
  --font-ipa: "Noto Sans", "Segoe UI", "Lucida Sans Unicode", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e131d; --surface: #161d2b; --ink: #e8edf6; --muted: #a2adc2; --line: #2a3346;
    --accent: #8fb0f2; --accent-soft: #1d2a45; --saffron: #f0b24a; --saffron-soft: #3a2c10;
    --good: #6fd49a; --good-soft: #15301f; --bad: #f08a7e; --bad-soft: #3b1a16;
    --s-a: #8fb0f2; --s-b: #5ed0bf; --s-c: #d39be6; --s-d: #f0a06a; --s-e: #f08aa8; --s-f: #a9d47a; --s-g: #e3c07a; --s-h: #7fc6e3; --s-i: #b8a8f6; --s-j: #f39a80; --s-k: #a9bcf5; --s-l: #f29ab5; --s-m: #f2ae6e; --s-n: #6fd6b1;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e131d; --surface: #161d2b; --ink: #e8edf6; --muted: #a2adc2; --line: #2a3346;
  --accent: #8fb0f2; --accent-soft: #1d2a45; --saffron: #f0b24a; --saffron-soft: #3a2c10;
  --good: #6fd49a; --good-soft: #15301f; --bad: #f08a7e; --bad-soft: #3b1a16;
  --s-a: #8fb0f2; --s-b: #5ed0bf; --s-c: #d39be6; --s-d: #f0a06a; --s-e: #f08aa8; --s-f: #a9d47a; --s-g: #e3c07a; --s-h: #7fc6e3; --s-i: #b8a8f6; --s-j: #f39a80; --s-k: #a9bcf5; --s-l: #f29ab5; --s-m: #f2ae6e; --s-n: #6fd6b1;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 17px; line-height: 1.55; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--surface); }
.wrap { max-width: 1040px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.read { max-width: 760px; }
a { color: var(--accent); }
button { font-family: var(--font-body); }
:focus-visible { outline: 3px solid var(--saffron); outline-offset: 2px; }

header.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--surface); border-bottom: 1px solid var(--line); }
header.top .wrap { padding-block: 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); line-height: 1.1; }
.brand-logo { width: 46px; height: 46px; flex: none; }
.brand-t { display: flex; flex-direction: column; }
.brand small { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--saffron); font-weight: 700; }
.brand b { font-family: var(--font-display); font-size: 22px; font-weight: 800; }
.brand b span { color: var(--accent); }
.tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 6px 12px; font-size: 14px; font-weight: 700; text-decoration: none; cursor: pointer; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.seg button { border: 0; background: transparent; color: var(--ink); font-size: 14px; font-weight: 700; padding: 6px 11px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--surface); }

main .wrap { padding-block: 22px 48px; display: flex; flex-direction: column; gap: 26px; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(28px, 6vw, 42px); font-weight: 800; }
h2 { font-size: 24px; font-weight: 800; }
h3 { font-size: 20px; font-weight: 600; }
.eyebrow { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--muted); }
.lead { color: var(--muted); margin: 0; max-width: 64ch; }
.crumbs { font-size: 14px; display: flex; gap: 6px; flex-wrap: wrap; color: var(--muted); }
.crumbs a { color: var(--muted); }

.hero { display: grid; gap: 14px; padding-block: 8px; }
.hero h1 em { font-style: normal; color: var(--accent); }
.resume { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--saffron-soft); border-radius: 12px; padding: 12px 16px; }
.resume p { margin: 0; flex: 1; min-width: 200px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 10px; background: var(--accent); color: var(--surface); font-weight: 700; font-size: 16px; padding: 10px 16px; cursor: pointer; text-decoration: none; }
.btn.ghost { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
.btn.small { font-size: 14px; padding: 7px 12px; border-radius: 8px; }
.btn.playing { background: var(--saffron); }
.btn svg { width: 14px; height: 14px; fill: currentColor; }

.subjects { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.subj { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: var(--ink); border-top: 5px solid var(--sc); min-width: 0; }
.subj h3 { color: var(--sc); }
.subj p { margin: 0; color: var(--muted); font-size: 15px; }
.bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--sc, var(--accent)); border-radius: 99px; }
.meta { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.c-a { --sc: var(--s-a); } .c-b { --sc: var(--s-b); } .c-c { --sc: var(--s-c); } .c-d { --sc: var(--s-d); } .c-e { --sc: var(--s-e); } .c-f { --sc: var(--s-f); } .c-g { --sc: var(--s-g); } .c-h { --sc: var(--s-h); } .c-i { --sc: var(--s-i); } .c-j { --sc: var(--s-j); } .c-k { --sc: var(--s-k); } .c-l { --sc: var(--s-l); } .c-m { --sc: var(--s-m); } .c-n { --sc: var(--s-n); }
.space-head { display: grid; gap: 4px; margin-top: 6px; }
.space-head h2 { color: var(--ink); }
.space-head p { margin: 0; color: var(--muted); max-width: 64ch; }
.prompt-field { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 700; }
.prompt-field textarea { font: inherit; font-weight: 400; font-size: 16px; padding: 10px 12px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); resize: vertical; min-height: 64px; width: 100%; }
.prompt-out { white-space: pre-wrap; background: var(--accent-soft); border-radius: 10px; padding: 12px 14px; font-size: 15px; }

.subject-head { display: grid; gap: 10px; border-left: 6px solid var(--sc); padding-left: 14px; }
.subject-head h1 { color: var(--sc); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.lessons { display: flex; flex-direction: column; gap: 8px; counter-reset: l; }
.lesson-link { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; text-decoration: none; color: var(--ink); }
.lesson-link .num { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--bg); color: var(--sc); font-variant-numeric: tabular-nums; }
.lesson-link.done .num { background: var(--good); color: var(--surface); }
.lesson-link span.t { flex: 1; min-width: 0; font-weight: 700; }
.lesson-link small { color: var(--good); font-weight: 700; }

article.lesson { display: flex; flex-direction: column; gap: 16px; }
article.lesson h1 { color: var(--sc); }
article.lesson h3 { margin-top: 8px; padding-bottom: 4px; border-bottom: 2px solid var(--line); }
article.lesson p { margin: 0; }
article.lesson ul, article.lesson ol { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.tablewrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--sc, var(--accent)); color: var(--surface); }
tr:last-child td { border-bottom: 0; }
.box { border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.box b.k { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.box.marge { background: var(--saffron-soft); } .box.marge b.k { color: var(--saffron); }
.box.cle { background: var(--accent-soft); } .box.cle b.k { color: var(--accent); }
.box.piege { background: var(--bad-soft); } .box.piege b.k { color: var(--bad); }
.quote { border-left: 4px solid var(--sc); padding: 8px 14px; background: var(--surface); border-radius: 0 10px 10px 0; }
.verse { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.verse .lines { font-family: var(--font-display); font-size: 18px; line-height: 1.7; }
.verse .lines div { white-space: normal; }
.verse header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.verse header small { display: block; color: var(--muted); font-style: italic; }

.schema { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; font-size: 14px; text-align: center; }
.scol { display: flex; flex-direction: column; gap: 6px; }
.schema .h { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; min-height: 2.6em; display: flex; align-items: flex-end; justify-content: center; }
.schema .n { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 6px; }
.schema .top { border: 2px solid var(--sc); font-weight: 700; color: var(--sc); background: var(--accent-soft); }
.schema .cc { font-weight: 700; border-style: dashed; }
.schema .ar { color: var(--muted); font-size: 12px; }
@media (max-width: 600px) { .schema { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 18px; } }

.words { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.word { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.word.mastered { border-color: var(--good); box-shadow: inset 4px 0 0 var(--good); }
.word .w { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.word .w b { font-family: var(--font-display); font-size: 21px; color: var(--sc); }
.word .ipa { font-family: var(--font-ipa); color: var(--muted); font-size: 14px; }
.word .fig { color: var(--saffron); font-weight: 700; }
.word .tip { color: var(--muted); font-size: 14px; }
.word .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.ext { font-size: 14px; font-weight: 700; }
.mark { margin-left: auto; border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 999px; font-size: 13px; font-weight: 700; padding: 5px 10px; cursor: pointer; }
.mark[aria-pressed="true"] { border-color: var(--good); color: var(--good); background: var(--good-soft); }
.sents { display: flex; flex-direction: column; gap: 8px; }
.sent { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--sc); border-radius: 8px; padding: 10px 12px; }
.sent p { flex: 1; min-width: 0; }
.para { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--sc); margin-top: 6px; }
@media (max-width: 520px) { .sent { flex-direction: column; } }
.say { border: 0; background: none; color: var(--accent); font-weight: 700; cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 3px; font-size: 15px; }

.lesson-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 16px; }
.done-toggle[aria-pressed="true"] { background: var(--good); }

.quiz { display: flex; flex-direction: column; gap: 14px; }
.q { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.q .opts { display: grid; gap: 8px; }
.opt { text-align: left; border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 10px; padding: 10px 12px; font-size: 16px; cursor: pointer; }
.opt.right { border-color: var(--good); background: var(--good-soft); }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.opt:disabled { cursor: default; }
.expl { font-size: 15px; color: var(--muted); margin: 0; }
.score { position: sticky; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); align-self: flex-start; background: var(--ink); color: var(--surface); border-radius: 999px; padding: 8px 14px; font-weight: 700; font-variant-numeric: tabular-nums; }

.flash { display: flex; flex-direction: column; gap: 14px; align-items: stretch; max-width: 560px; }
.cardface { min-height: 210px; background: var(--surface); border: 1px solid var(--line); border-top: 6px solid var(--sc); border-radius: 16px; padding: 22px; display: flex; flex-direction: column; justify-content: center; gap: 10px; text-align: center; cursor: pointer; }
.cardface .term { font-family: var(--font-display); font-size: 28px; font-weight: 800; color: var(--sc); }
.cardface .def { font-size: 19px; }
.cardface .hint { font-size: 13px; color: var(--muted); }
.flash .controls { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.btn.good { background: var(--good); } .btn.bad { background: var(--bad); }

.search { width: 100%; font-size: 17px; padding: 12px 14px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); }
.gloss { display: flex; flex-direction: column; gap: 6px; }
.gloss-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--sc); border-radius: 8px; padding: 10px 12px; }
.gloss-item b { font-family: var(--font-display); }
.gloss-item span.s { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
.tool { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.tool input[type=date] { width: auto; font-size: 16px; }
.tool .grid2 { display: flex; gap: 12px; flex-wrap: wrap; }
.tool .grid2 label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 700; }
.tool .res { font-size: 16px; line-height: 1.5; }
.tool input { font-size: 18px; padding: 8px 10px; border-radius: 8px; border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); width: 9em; }
.tool .out { font-family: var(--font-ipa); font-size: 26px; letter-spacing: .08em; color: var(--sc); font-variant-numeric: tabular-nums; }
.notice { background: var(--saffron-soft); border-radius: 10px; padding: 10px 14px; font-size: 15px; }
footer.site { border-top: 1px solid var(--line); background: var(--surface); }
footer.site .wrap { padding-block: 20px 28px; font-size: 14px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }

/* ===== Arabe : police Lisan Naskh (code couleur des voyelles) */
@font-face { font-family: "Lisan Naskh"; src: url("fonts/LisanNaskh-R.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Lisan Naskh"; src: url("fonts/LisanNaskh-B.woff2") format("woff2"); font-weight: 700; font-display: swap; }
.ara { font-family: "Lisan Naskh", "Noto Naskh Arabic", "Amiri", serif; font-size: 1.35em; line-height: 1.9; font-weight: 400; unicode-bidi: isolate; }
.ara.big { font-size: 56px; line-height: 1.3; }
.title-ar { font-size: 30px; color: var(--sc); margin: -6px 0 0; text-align: right; }
.fs-l body { font-size: 19px; } .fs-xl body { font-size: 21px; }

/* ===== en-tête et menu ☰ */
.menu-btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 7px 14px 7px 10px; font-size: 15px; font-weight: 700; cursor: pointer; }
.menu-btn svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; fill: none; }
.scrim { position: fixed; inset: 0; background: rgb(0 0 0 / .35); z-index: 20; opacity: 0; transition: opacity .2s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(330px, 88vw); background: var(--surface); z-index: 21; overflow-y: auto; box-shadow: -8px 0 30px rgb(0 0 0 / .18);
  transform: translateX(100%); transition: transform .2s ease; padding: calc(12px + env(safe-area-inset-top, 0px)) 0 calc(24px + env(safe-area-inset-bottom, 0px)); }
body.menu-open .drawer { transform: none; } body.menu-open .scrim { opacity: 1; }
.dr-head { display: flex; align-items: center; gap: 10px; padding: 6px 16px 14px; border-bottom: 1px solid var(--line); }
.dr-head div { flex: 1; display: flex; flex-direction: column; line-height: 1.15; } .dr-head small { color: var(--saffron); font-weight: 700; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.dr-close { border: 0; background: var(--bg); color: var(--ink); width: 36px; height: 36px; border-radius: 50%; font-size: 16px; cursor: pointer; }
.drawer nav { display: flex; flex-direction: column; padding: 8px 8px 0; }
.drawer nav a, .dr-user { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 700; }
.drawer nav a:hover, .drawer nav a:focus-visible { background: var(--accent-soft); }
.drawer nav a span { width: 24px; text-align: center; }
.dr-sec { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 14px 12px 4px; }
.dr-user { margin: 10px 8px 0; background: var(--bg); } .dr-user img { border-radius: 50%; } .dr-user small { display: block; color: var(--muted); font-weight: 400; }
.dr-login { margin: 12px 16px 0; width: calc(100% - 32px); border: 0; border-radius: 10px; background: var(--accent); color: var(--surface); font-weight: 700; font-size: 16px; padding: 11px; cursor: pointer; }

/* ===== accueil : les espaces */
.spaces { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.spacecard { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--ink); border-top: 6px solid var(--sc); min-width: 0; }
.spacecard h2 { color: var(--sc); font-size: 22px; } .spacecard p { margin: 0; color: var(--muted); font-size: 15px; }
.sp-icon { font-size: 34px; line-height: 1; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--bg); color: var(--muted); margin-left: 4px; }
.tag.ok { background: var(--good-soft); color: var(--good); }
.notice.ok { background: var(--good-soft); }
.linkbtn { border: 0; background: none; color: var(--accent); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; padding: 0; }
.lock { color: var(--muted) !important; }
.gate { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 22px; display: flex; flex-direction: column; gap: 12px; max-width: 640px; }

/* ===== compagnons de livres */
.bookref { background: var(--accent-soft); border-radius: 10px; padding: 12px 14px; }
.bookref b.k { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.bookref ul { margin: 6px 0 0; }
.syl { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.sylb, .voc { display: flex; flex-direction: column; align-items: center; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-bottom: 3px solid var(--sc); border-radius: 12px; padding: 8px 6px; cursor: pointer; color: var(--ink); font: inherit; text-align: center; }
.sylb .ara { font-size: 34px; line-height: 1.5; } .sylb small, .voc small { color: var(--muted); font-size: 13px; line-height: 1.3; }
.sylb:active, .voc:active, .dl-ar:active { transform: scale(.97); }
.vocab { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.voc .ara { font-size: 26px; line-height: 1.6; } .emo { font-size: 30px; line-height: 1.2; } .emo.big { font-size: 40px; }
.letters { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.letter { background: var(--surface); border: 1px solid var(--line); border-top: 5px solid var(--sc); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.letter p { margin: 0; font-size: 15px; }
.lt-top { display: flex; align-items: center; gap: 14px; } .lt-top div { display: flex; flex-direction: column; } .lt-top b { font-size: 20px; color: var(--sc); }
.lt-forms { display: flex; gap: 6px; flex-wrap: wrap; } .lt-forms .ara { font-size: 32px; background: var(--bg); border-radius: 8px; padding: 0 10px; min-width: 52px; text-align: center; }
.lt-word { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--bg); border-radius: 10px; padding: 6px 10px; } .lt-word .ara { font-size: 28px; }
.dialog { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.dialog .situ { color: var(--muted); font-style: italic; margin: 0; }
.dl { display: grid; gap: 2px; border-left: 3px solid var(--line); padding-left: 10px; }
.who { font-size: 13px; font-weight: 700; }
.dl-ar { border: 0; background: none; padding: 0; text-align: right; cursor: pointer; color: var(--ink); font: inherit; width: 100%; }
.dl-ar .ara { font-size: 25px; line-height: 1.9; }
.dialog .fr { display: none; color: var(--muted); font-size: 15px; } .dialog.show-fr .fr { display: block; }
.texte { text-align: right; } .texte .emo { text-align: left; }
.rlines { display: flex; flex-direction: column; gap: 6px; }
.rline { display: flex; flex-wrap: wrap; gap: 6px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 14px; justify-content: flex-start; }
.rline .ara { font-size: 30px; line-height: 1.8; }
.qwords { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.qw { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--sc); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.qw .ara { font-size: 30px; align-self: stretch; text-align: right; }
.qverses { display: flex; flex-direction: column; gap: 8px; }
.qv { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; display: flex; flex-direction: column; gap: 6px; }
.qv .ara { font-size: 28px; line-height: 2; text-align: right; } .vnum { color: var(--sc); font-size: .8em; }
.cardface .term .ara { font-size: 52px; line-height: 1.5; }
.gloss-item .ara { font-size: 1.5em; }
.opt .ara, .q b .ara { font-size: 1.6em; }

/* ===== paramètres, pages, formulaire */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.panel h2 { font-size: 20px; } .panel p { margin: 0; }
.setrow { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.help summary { cursor: pointer; font-weight: 700; color: var(--accent); } .help ol { margin: 8px 0; padding-left: 22px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: 14px; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--surface); border-color: var(--accent); }
.account { display: flex; align-items: center; gap: 14px; } .account img { border-radius: 50%; }
.page h3 { margin-top: 10px; }
.form { display: flex; flex-direction: column; gap: 12px; max-width: 560px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-weight: 700; font-size: 15px; }
.form input, .form select, .form textarea { font: inherit; font-weight: 400; font-size: 16px; padding: 10px 12px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); }
.form .hp { position: absolute; left: -9999px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 16px; } .foot-links a { color: var(--accent); font-weight: 700; text-decoration: none; }
@media (max-width: 420px) { .menu-btn span { display: none; } .menu-btn { padding: 8px 10px; } }

header.top .wrap { flex-wrap: nowrap; }
.brand { min-width: 0; }

/* ===== inscription : fiche, étapes, vérification, compte */
.enroll { display: flex; flex-direction: column; gap: 14px; max-width: 680px; }
.enroll h1 { margin: 0; }
.stepper { list-style: none; display: flex; gap: 6px; padding: 0; margin: 4px 0; flex-wrap: wrap; }
.stepper li { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px 4px 4px; }
.stepper li b { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--line); color: var(--ink); font-size: 13px; }
.stepper li.now { color: var(--ink); font-weight: 700; border-color: var(--accent); }
.stepper li.now b { background: var(--accent); color: var(--surface); }
.stepper li.past b { background: var(--good); color: #fff; }
.enroll-form { max-width: none; gap: 16px; }
.enroll-form fieldset.group { border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 14px 16px 16px; margin: 0; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.enroll-form fieldset.group > legend { font-family: var(--font-display); font-weight: 800; font-size: 18px; padding: 0 6px; }
.enroll-form .fld { display: flex; flex-direction: column; gap: 5px; font-weight: 700; font-size: 15px; min-width: 0; }
.enroll-form .fld.bad input:not([type=radio]):not([type=checkbox]), .enroll-form .fld.bad select { border-color: var(--bad); }
.enroll-form .fld.bad > legend, .enroll-form .fld.bad > .lbl { color: var(--bad); }
.enroll-form input[readonly] { background: var(--bg); color: var(--muted); }
.enroll-form input, .enroll-form select { width: 100%; min-width: 0; box-sizing: border-box; }
.row2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.req { color: var(--bad); }
.opt-l, .hint { font-weight: 400; color: var(--muted); font-size: 13px; }
.err { color: var(--bad); font-weight: 700; font-size: 13px; }
fieldset.radios { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
fieldset.radios > legend { padding: 0; margin-bottom: 4px; }
.choice { display: flex !important; flex-direction: row !important; align-items: flex-start; gap: 10px; font-weight: 400 !important; font-size: 16px !important; background: var(--bg); border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.choice input { width: 20px !important; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--accent); padding: 0 !important; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice.check { background: transparent; border: 0; padding: 4px 0; flex-wrap: wrap; }
.choice.check:has(input:checked) { background: transparent; }
.choice > span { flex: 1; min-width: 0; }
.choice.check .err { flex: 0 0 100%; padding-left: 30px; }
.tel-row .lbl { font-weight: 700; }
.tel-in { display: grid; grid-template-columns: 6.2em minmax(0, 1fr); gap: 8px; }
.recap { margin: 0; display: grid; gap: 0; }
.recap > div { display: grid; grid-template-columns: minmax(0, 11em) minmax(0, 1fr); gap: 4px 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.recap > div:last-child { border-bottom: 0; }
.recap dt { color: var(--muted); font-size: 14px; }
.recap dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
@media (max-width: 480px) { .recap > div { grid-template-columns: 1fr; } }
.notice.bad-n { background: var(--bad-soft); color: var(--bad); font-weight: 700; }
.notice.big-ok { font-size: 16px; padding: 14px 16px; }
.notice.reg-n { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.fiche-head { display: flex; align-items: center; gap: 10px; border-bottom: 2px solid var(--sc, var(--accent)); padding-bottom: 10px; }
.fiche-head small { display: block; color: var(--muted); }
.ins-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.ins-row:last-child { border-bottom: 0; }
.ins-row small { display: block; color: var(--muted); font-size: 13px; }
.linkbtn.small-l { font-size: 14px; color: var(--bad); }
.panel.danger { border-color: var(--bad-soft); }
.btn.bad-b { color: var(--bad); border-color: var(--bad); }
@media print {
  header.top, footer.site, .crumbs, .noprint, .stepper, .drawer, .scrim, .notice { display: none !important; }
  body { background: #fff; color: #000; }
  .panel { border: 1px solid #999; }
}

/* ===== administration */
.admin { display: flex; flex-direction: column; gap: 14px; }
.admin h1 { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--sc, var(--accent)); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; }
.stat b { font-family: var(--font-display); font-size: 26px; line-height: 1.1; }
.stat span { color: var(--muted); font-size: 13px; }
.adm-list { display: flex; flex-direction: column; gap: 10px; }
.adm-card { background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--sc); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.adm-card p { margin: 0; }
.adm-card small { color: var(--muted); }
.adm-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; align-items: center; }
.adm-card details summary { cursor: pointer; font-weight: 700; color: var(--accent); }
.adm-card details[open] summary { margin-bottom: 6px; }
pre.rules { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 13px; overflow-x: auto; white-space: pre; }
details.panel summary { cursor: pointer; }

/* ===== vidéo de présentation (accueil) */
.hero-video { margin: 18px 0 6px; }
.hv-frame { position: relative; border-radius: 18px; overflow: hidden; background: #16204a; aspect-ratio: 16 / 9; box-shadow: 0 18px 40px rgba(20, 28, 46, .18); }
.hv-frame video { display: block; width: 100%; height: 100%; object-fit: cover; }
.hv-ctrl { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 8px; }
.hv-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(13, 18, 38, .62); color: #fff; display: grid; place-items: center; cursor: pointer; }
.hv-btn svg { width: 18px; height: 18px; fill: currentColor; }
.hv-snd { width: auto; padding: 0 12px 0 10px; border-radius: 999px; display: flex; gap: 6px; font: inherit; font-weight: 700; font-size: 14px; }
.hv-btn:focus-visible { outline: 3px solid #f0b24a; outline-offset: 2px; }
@media (min-width: 900px) { .hero-video { margin-top: 24px; } }

.hv-snd { align-items: center; justify-content: center; }

/* ===== certificats */
.cert-panel { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--accent); border-radius: 14px; padding: 12px 16px; margin: 14px 0; }
.cert-panel > div { flex: 1 1 220px; min-width: 0; }
.cert-panel b { display: block; }
.cert-panel small { color: var(--muted); }
.cert-panel.ok { border-left-color: var(--good); background: var(--good-soft); }
.cert-panel.gold { border-left-color: #c8962e; }
.cert-panel.ok.gold { background: #fbf1d9; }
:root[data-theme="dark"] .cert-panel.ok.gold { background: #3a2c10; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cert-panel.ok.gold { background: #3a2c10; } }
.cp-ic { font-size: 28px; line-height: 1; }
.cp-list { margin: 4px 0 0; padding-left: 20px; font-size: 15px; }
.cp-list li span { color: var(--muted); }
.cp-list li.ok { color: var(--good); }
.cp-list li.ok::marker { content: "✓  "; }
.cert-page { display: flex; flex-direction: column; gap: 14px; }
.cert-page h1 { margin: 0; }
.cert-wrap { container-type: inline-size; width: 100%; max-width: 1000px; }
.cert { --gold: #b8892b; --navy: #1e2a5a; position: relative; aspect-ratio: 297 / 210; background: #fdfaf2; color: #1a2033; border-radius: 6px; box-shadow: 0 18px 40px rgba(20, 28, 46, .18); padding: 2.2cqw; font-family: var(--font-body); }
.cert-in { position: relative; height: 100%; border: .45cqw solid var(--navy); outline: .18cqw solid var(--gold); outline-offset: -1.1cqw; padding: 3.2cqw 5cqw 2.4cqw; display: flex; flex-direction: column; align-items: center; text-align: center;
  background: radial-gradient(circle at 0 0, rgba(184, 137, 43, .14) 0 7cqw, transparent 7.1cqw), radial-gradient(circle at 100% 0, rgba(184, 137, 43, .14) 0 7cqw, transparent 7.1cqw),
    radial-gradient(circle at 0 100%, rgba(184, 137, 43, .14) 0 7cqw, transparent 7.1cqw), radial-gradient(circle at 100% 100%, rgba(184, 137, 43, .14) 0 7cqw, transparent 7.1cqw); }
.cert.grand .cert-in { border-color: #6b4a12; }
.cert-head { display: flex; align-items: center; gap: 1.4cqw; }
.cert-head img { width: 5.6cqw; height: 5.6cqw; }
.cert-head div { text-align: left; display: flex; flex-direction: column; }
.cert-head b { font-family: var(--font-display); font-size: 2.3cqw; letter-spacing: .12em; text-transform: uppercase; color: var(--navy); }
.cert-head span { font-size: 1.35cqw; color: #6b6150; font-style: italic; }
.cert-kicker { margin: 2.2cqw 0 0; font-family: var(--font-display); font-weight: 800; font-size: 4.6cqw; line-height: 1.05; color: var(--gold); letter-spacing: .02em; }
.cert.grand .cert-kicker { color: #8a5f12; }
.cert-ar { margin: .2cqw 0 0; font-size: 3cqw; line-height: 1.5; color: var(--navy); }
.cert-orn { margin: 1.6cqw 0 0; color: var(--gold); font-size: 1.5cqw; letter-spacing: .8em; }
.cert-lead { margin: .8cqw 0 0; font-size: 1.7cqw; color: #4a4a4a; }
.cert-name { margin: .8cqw 0 0; font-family: var(--font-display); font-weight: 800; font-size: 4cqw; line-height: 1.1; color: var(--navy); border-bottom: .15cqw solid var(--gold); padding: 0 3cqw .6cqw; }
.cert-text { margin: 1.6cqw 0 0; font-size: 1.75cqw; line-height: 1.5; max-width: 70cqw; color: #2b3040; }
.cert-foot { margin-top: auto; width: 100%; display: grid; grid-template-columns: 1fr auto 1fr auto; align-items: end; gap: 2.4cqw; }
.cert-meta { display: grid; grid-template-columns: auto 1fr; gap: .2cqw 1cqw; text-align: left; font-size: 1.3cqw; color: #6b6150; }
.cert-meta b { color: #1a2033; font-size: 1.4cqw; }
.cert-seal svg { width: 10.5cqw; height: 10.5cqw; display: block; }
.cert-sign { display: flex; flex-direction: column; align-items: center; border-top: .12cqw solid #8a8270; padding-top: .7cqw; }
.cert-sign b { font-family: var(--font-display); font-style: italic; font-weight: 600; font-size: 2cqw; color: var(--navy); }
.cert-sign span { font-size: 1.2cqw; color: #6b6150; }
.cert-qr { display: flex; flex-direction: column; align-items: center; gap: .3cqw; font-size: 1.05cqw; color: #6b6150; }
.cert-qr svg { width: 8.5cqw; height: 8.5cqw; display: block; }
.verify-form { max-width: 460px; }
.verify-form input { text-transform: uppercase; letter-spacing: .06em; }
.notice.verify-ok { font-size: 16px; }
.sugg-link { font-size: 14px; }
.sugg-item { border-top: 1px solid var(--line); padding-top: 8px; }
.sugg-item p { margin: 4px 0 0; white-space: pre-wrap; }
.sugg-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.adm-tabs { margin-top: 4px; }
@page cert { size: A4 landscape; margin: 0; }
@media print {
  body.printing-cert header.top, body.printing-cert footer.site, body.printing-cert .crumbs, body.printing-cert .cert-actions, body.printing-cert .cert-page > h1,
  body.printing-cert #cert-msg, body.printing-cert .notice, body.printing-cert .verify-form, body.printing-cert .cert-page > .lead, body.printing-cert .cert-page > .meta { display: none !important; }
  body.printing-cert { background: #fff; }
  body.printing-cert .cert-wrap { page: cert; max-width: none; width: 297mm; }
  body.printing-cert .cert { box-shadow: none; border-radius: 0; width: 297mm; height: 210mm; aspect-ratio: auto; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  body.printing-cert main .wrap { padding: 0; max-width: none; }
}

.adm-card.revoked { opacity: .65; }

/* ===== couleurs pleines : cartes, en-têtes et pages de cours dans la couleur de chaque matière
   --solid : la couleur de la matière (assombrie en mode sombre pour garder le texte blanc lisible)
   --tint  : un fond teinté clair de la même couleur (jamais de fond blanc avec une simple bordure) */
:root { --d-a: #23468f; --d-b: #0f6b5f; --d-c: #7a3d8f; --d-d: #a3501c; --d-e: #8b1d3f; --d-f: #3a5f1c; --d-g: #6b4a12; --d-h: #1f5f7a; --d-i: #5a3fc0; --d-j: #c44a2d; --d-k: #2b3f8f; --d-l: #9e2e46; --d-m: #a85a14; --d-n: #0e6b4f; }
.c-a { --scd: var(--d-a); } .c-b { --scd: var(--d-b); } .c-c { --scd: var(--d-c); } .c-d { --scd: var(--d-d); } .c-e { --scd: var(--d-e); } .c-f { --scd: var(--d-f); } .c-g { --scd: var(--d-g); } .c-h { --scd: var(--d-h); } .c-i { --scd: var(--d-i); } .c-j { --scd: var(--d-j); } .c-k { --scd: var(--d-k); } .c-l { --scd: var(--d-l); } .c-m { --scd: var(--d-m); } .c-n { --scd: var(--d-n); }
:root { --solid-k: 100%; }
:root[data-theme="dark"] { --solid-k: 82%; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --solid-k: 82%; } }
.spacecard, .subj, .subject-head, article.lesson, .quiz, .flash, .lessons, .glist, .gate, .letters, .vocab, .dialog, .verse {
  --solid: color-mix(in srgb, var(--scd, #23468f) var(--solid-k), #0c1220);
  --solid-dk: color-mix(in srgb, var(--solid) 70%, #000);
  --tint: color-mix(in srgb, var(--sc, var(--accent)) 11%, var(--surface));
  --tint-2: color-mix(in srgb, var(--sc, var(--accent)) 20%, var(--surface));
  --edge: color-mix(in srgb, var(--sc, var(--accent)) 35%, var(--surface));
}
/* cartes des espaces et des parcours : couleur pleine */
.spacecard, .subj { border: 0; color: #fff; overflow: hidden; isolation: isolate;
  background: radial-gradient(circle at 92% 8%, rgba(255,255,255,.16) 0 54px, transparent 55px), radial-gradient(circle at 100% 100%, rgba(255,255,255,.10) 0 90px, transparent 91px),
    linear-gradient(140deg, var(--solid) 0%, var(--solid-dk) 100%);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--solid) 28%, transparent); transition: transform .15s ease, box-shadow .15s ease; }
.spacecard:hover, .subj:hover { transform: translateY(-2px); box-shadow: 0 14px 30px color-mix(in srgb, var(--solid) 36%, transparent); }
.spacecard h2, .subj h3 { color: #fff; }
.spacecard p, .subj p { color: rgba(255,255,255,.9); }
.spacecard .eyebrow, .subj .eyebrow { color: rgba(255,255,255,.82); }
.spacecard .meta, .subj .meta { color: rgba(255,255,255,.88); }
.spacecard .bar, .subj .bar, .subject-head .bar { background: rgba(255,255,255,.28); }
.spacecard .bar i, .subj .bar i, .subject-head .bar i { background: #fff; }
.spacecard .tag, .subj .tag { background: rgba(255,255,255,.22); color: #fff; }
.spacecard .tag.ok, .subj .tag.ok { background: #fff; color: var(--good); }
.spacecard .sp-icon { filter: drop-shadow(0 3px 6px rgba(0,0,0,.25)); }
/* en-tête d'un espace, d'un parcours, d'un quiz ou des cartes : bandeau plein */
.subject-head { border: 0; color: #fff; padding: 20px 22px; border-radius: 18px;
  background: radial-gradient(circle at 95% 0%, rgba(255,255,255,.15) 0 80px, transparent 81px), linear-gradient(140deg, var(--solid) 0%, var(--solid-dk) 100%);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--solid) 25%, transparent); }
.subject-head h1 { color: #fff; }
.subject-head .eyebrow, .subject-head .meta { color: rgba(255,255,255,.85); }
.subject-head .lead { color: rgba(255,255,255,.93); }
.subject-head a:not(.btn) { color: #fff; }
.subject-head .btn { background: #fff; color: var(--solid-dk); }
.subject-head .btn.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.8); }
/* liste des leçons : lignes teintées, numéro dans une pastille pleine */
.lesson-link { background: var(--tint); border: 1px solid var(--edge); }
.lesson-link:hover { background: var(--tint-2); }
.lesson-link .num { background: var(--solid); color: #fff; }
.lesson-link.done { background: color-mix(in srgb, var(--good) 12%, var(--surface)); border-color: color-mix(in srgb, var(--good) 35%, var(--surface)); }
.lesson-link small.lock { filter: grayscale(.2); }
/* page de leçon : fond teinté, titre dans un bandeau plein, intertitres colorés */
article.lesson { background: var(--tint); border-radius: 20px; padding: 18px 18px 22px; }
article.lesson > h1 { color: #fff; padding: 16px 18px; border-radius: 14px; background: linear-gradient(140deg, var(--solid) 0%, var(--solid-dk) 100%); }
article.lesson > .eyebrow { color: var(--sc); }
article.lesson h3 { border: 0; padding: 8px 12px; border-radius: 10px; background: var(--tint-2); color: var(--solid-dk); }
:root[data-theme="dark"] article.lesson h3 { color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) article.lesson h3 { color: #fff; } }
article.lesson .lesson-foot { border-top-color: var(--edge); }
article.lesson.page { --sc: var(--accent); }
/* blocs des leçons : fonds teintés au lieu du blanc bordé */
.verse, .dialog, .letter, .word, .sylb, .voc, .qw, .qv, .sent, .tool, .q { background: var(--surface); border-color: var(--edge); }
article.lesson .verse, article.lesson .dialog, article.lesson .letter, article.lesson .word, article.lesson .qw, article.lesson .qv, article.lesson .sent, article.lesson .tool,
article.lesson .sylb, article.lesson .voc { background: color-mix(in srgb, var(--surface) 72%, var(--tint)); border: 1px solid var(--edge); }
.letter, .qw { border-top: 0; box-shadow: inset 0 5px 0 var(--sc); }
.sylb, .voc { border-bottom: 0; box-shadow: inset 0 -3px 0 var(--sc); }
.sent { border-left: 0; box-shadow: inset 4px 0 0 var(--sc); }
/* quiz et cartes de révision */
.quiz .q { background: var(--tint); border: 1px solid var(--edge); }
.quiz .opt { background: var(--surface); }
.cardface { border: 0; background: radial-gradient(circle at 90% 10%, color-mix(in srgb, var(--sc) 22%, transparent) 0 70px, transparent 71px), var(--tint-2, var(--surface)); box-shadow: inset 0 6px 0 var(--sc), 0 10px 24px rgba(20,28,46,.1); }
.flash { --tint-2: color-mix(in srgb, var(--sc) 16%, var(--surface)); }
/* glossaire */
.gloss-item { border: 0; background: color-mix(in srgb, var(--sc) 10%, var(--surface)); box-shadow: inset 4px 0 0 var(--sc); }
/* page d'accès réservé */
.gate[class*="c-"] { border: 0; background: var(--tint); }

/* =====================================================================
   Esthétique (octobre 2026) : fond à motif, en-tête translucide, accueil
   en deux colonnes, chiffres clés, étapes, livres, pied de page, quiz et
   cartes animés. Les animations s'arrêtent si l'appareil demande moins de mouvement.
   ===================================================================== */
:root { --navy: #18224a; --navy-2: #0f1733; --gold: #c8962e; --radius: 18px;
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='88' viewBox='0 0 88 88'%3E%3Cg fill='none' stroke='%2323468f' stroke-opacity='.07' stroke-width='1.2'%3E%3Cpath d='M44 14l8.5 21.5L74 44l-21.5 8.5L44 74l-8.5-21.5L14 44l21.5-8.5z'/%3E%3Crect x='23' y='23' width='42' height='42' transform='rotate(45 44 44)'/%3E%3Ccircle cx='44' cy='44' r='7'/%3E%3C/g%3E%3C/svg%3E"); }
:root[data-theme="dark"] { --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='88' viewBox='0 0 88 88'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.045' stroke-width='1.2'%3E%3Cpath d='M44 14l8.5 21.5L74 44l-21.5 8.5L44 74l-8.5-21.5L14 44l21.5-8.5z'/%3E%3Crect x='23' y='23' width='42' height='42' transform='rotate(45 44 44)'/%3E%3Ccircle cx='44' cy='44' r='7'/%3E%3C/g%3E%3C/svg%3E"); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='88' viewBox='0 0 88 88'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.045' stroke-width='1.2'%3E%3Cpath d='M44 14l8.5 21.5L74 44l-21.5 8.5L44 74l-8.5-21.5L14 44l21.5-8.5z'/%3E%3Crect x='23' y='23' width='42' height='42' transform='rotate(45 44 44)'/%3E%3Ccircle cx='44' cy='44' r='7'/%3E%3C/g%3E%3C/svg%3E"); } }

/* fond : halo bleu en haut de page et motif géométrique en filigrane */
body { background-color: var(--bg);
  background-image: radial-gradient(1100px 420px at 50% -140px, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%), var(--pattern);
  background-repeat: no-repeat, repeat; background-size: auto, 88px 88px; }
::selection { background: color-mix(in srgb, var(--saffron) 38%, transparent); }
html { scrollbar-color: color-mix(in srgb, var(--accent) 45%, var(--bg)) transparent; scroll-padding-top: 90px; }

/* en-tête translucide, ombre dès qu'on fait défiler la page */
header.top { background: color-mix(in srgb, var(--surface) 82%, transparent); -webkit-backdrop-filter: saturate(1.6) blur(12px); backdrop-filter: saturate(1.6) blur(12px);
  border-bottom-color: color-mix(in srgb, var(--line) 70%, transparent); transition: box-shadow .2s ease; }
body.scrolled header.top { box-shadow: 0 6px 22px rgba(20, 28, 46, .10); }
.brand-logo { border-radius: 12px; transition: transform .25s ease; }
.brand:hover .brand-logo { transform: rotate(-6deg) scale(1.04); }
.quick { display: none; gap: 4px; align-items: center; }
.quick a { color: var(--ink); text-decoration: none; font-weight: 700; font-size: 15px; padding: 7px 12px; border-radius: 999px; }
.quick a:hover { background: var(--accent-soft); color: var(--accent); }
.quick a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
@media (min-width: 980px) { .quick { display: flex; } }

/* barre de progression de lecture (leçons) */
#readbar { position: fixed; top: env(safe-area-inset-top, 0px); left: 0; height: 3px; width: 100%; transform-origin: 0 50%; transform: scaleX(0); z-index: 6;
  background: linear-gradient(90deg, var(--saffron), var(--gold)); pointer-events: none; }

/* bouton « haut de page » */
.totop { position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 4; width: 46px; height: 46px; border-radius: 50%;
  border: 0; background: var(--navy); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 8px 20px rgba(15, 23, 51, .3);
  opacity: 0; transform: translateY(12px) scale(.9); pointer-events: none; transition: opacity .2s ease, transform .2s ease; }
.totop.on { opacity: 1; transform: none; pointer-events: auto; }
.totop svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 2.6; fill: none; stroke-linecap: round; stroke-linejoin: round; }

/* fil d'Ariane en pastilles */
.crumbs { gap: 4px 6px; align-items: center; }
.crumbs a, .crumbs span { background: color-mix(in srgb, var(--surface) 75%, transparent); border: 1px solid var(--line); border-radius: 999px; padding: 3px 11px; text-decoration: none; }
.crumbs a:hover { color: var(--accent); border-color: var(--accent); }
.crumbs span { color: var(--ink); font-weight: 700; }

/* boutons : relief léger et retour au toucher */
.btn { box-shadow: 0 2px 0 rgba(0, 0, 0, .12), 0 6px 14px color-mix(in srgb, var(--accent) 22%, transparent); transition: transform .12s ease, box-shadow .12s ease, filter .12s ease; }
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: translateY(1px); box-shadow: 0 1px 0 rgba(0, 0, 0, .12); }
.btn.ghost { box-shadow: none; }
.btn.gold { background: linear-gradient(135deg, #e0aa3e, #b8811f); color: #1b1404; box-shadow: 0 6px 16px rgba(184, 129, 31, .35); }

/* apparition douce de chaque page */
@keyframes viewin { from { opacity: 0; transform: translateY(14px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
#view.enter > :not(.rvg) { animation: viewin .7s cubic-bezier(.2, .7, .2, 1) both; }
#view.enter > :nth-child(2) { animation-delay: .08s; } #view.enter > :nth-child(3) { animation-delay: .16s; } #view.enter > :nth-child(4) { animation-delay: .24s; } #view.enter > :nth-child(n+5) { animation-delay: .3s; }

/* ---------- accueil */
.home-hero { display: grid; gap: 22px; align-items: center; margin-top: 10px; }
.home-hero .hero { padding: 0; }
.home-hero .hero-video { margin: 0; }
.home-hero h1 { font-size: clamp(30px, 5.2vw, 50px); letter-spacing: -.01em; }
.home-hero h1 em { background: linear-gradient(120deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--saffron))); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--saffron); }
.hero .eyebrow::before { content: ""; width: 26px; height: 2px; background: currentColor; border-radius: 2px; }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.hero-cta .btn { font-size: 17px; padding: 12px 20px; border-radius: 12px; }
.hero-ar { font-family: "Lisan Naskh", serif; font-size: 22px; color: var(--muted); margin: 0; }
@media (min-width: 960px) {
  .home-hero { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 44px; margin-top: 26px; }
  .home-hero h1 { font-size: clamp(36px, 3.9vw, 48px); }
  .home-hero .hero-video { order: 2; }
  .home-hero .hv-frame { transform: perspective(1400px) rotateY(-5deg) rotateX(2deg); box-shadow: 30px 30px 60px rgba(20, 28, 46, .22); transition: transform .5s ease; }
  .home-hero .hv-frame:hover { transform: none; }
}
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.kpi { background: color-mix(in srgb, var(--surface) 86%, transparent); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; position: relative; overflow: hidden; }
.kpi::after { content: ""; position: absolute; right: -18px; top: -18px; width: 64px; height: 64px; border-radius: 50%; background: color-mix(in srgb, var(--kc, var(--accent)) 14%, transparent); }
.kpi b { font-family: var(--font-display); font-size: 30px; line-height: 1.05; color: var(--kc, var(--accent)); font-variant-numeric: tabular-nums; }
.kpi span { color: var(--muted); font-size: 14px; }
.kpi i { font-style: normal; font-size: 20px; }
.sec-h { display: grid; gap: 6px; justify-items: start; }
.sec-h h2 { font-size: clamp(24px, 3.6vw, 32px); }
.sec-h .orn { color: var(--gold); letter-spacing: .5em; font-size: 13px; }
.sec-h p { margin: 0; color: var(--muted); max-width: 62ch; }
@media (min-width: 700px) { .spaces { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; } }
.spacecard { padding: 22px 22px 18px; border-radius: 20px; min-height: 230px; }
.spacecard .go { margin-top: auto; align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .35); padding: 6px 14px; border-radius: 999px; transition: gap .2s ease, background .2s ease; }
.spacecard:hover .go { gap: 14px; background: rgba(255, 255, 255, .26); }
.spacecard .sp-icon { font-size: 40px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; counter-reset: st; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 8px; position: relative; }
.step::before { counter-increment: st; content: counter(st); position: absolute; right: 14px; top: 8px; font-family: var(--font-display); font-weight: 800; font-size: 46px; line-height: 1;
  color: color-mix(in srgb, var(--accent) 12%, transparent); }
.step .ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 25px; background: var(--accent-soft); }
.step h3 { font-size: 19px; }
.step p { margin: 0; color: var(--muted); font-size: 15px; }
.books { display: flex; gap: 16px; overflow-x: auto; padding: 6px 4px 18px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.book { flex: none; width: 150px; scroll-snap-align: start; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 8px; }
.book img { width: 150px; height: auto; aspect-ratio: 210 / 297; object-fit: cover; border-radius: 4px 10px 10px 4px; box-shadow: -4px 0 0 rgba(0,0,0,.18) inset, 0 12px 24px rgba(20, 28, 46, .22);
  transition: transform .25s ease, box-shadow .25s ease; background: var(--line); }
.book:hover img { transform: translateY(-6px) rotate(-1.5deg); box-shadow: 0 20px 34px rgba(20, 28, 46, .28); }
.book b { font-size: 14px; line-height: 1.25; }
.book small { color: var(--muted); font-size: 13px; }
.mine { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: linear-gradient(135deg, var(--navy), #2a3a7a); color: #fff; border-radius: 20px; padding: 18px 22px; }
.mine .ring { --p: 0; width: 64px; height: 64px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 800; font-size: 15px;
  background: radial-gradient(closest-side, var(--navy) 76%, transparent 78% 100%), conic-gradient(var(--gold) calc(var(--p) * 1%), rgba(255,255,255,.2) 0); }
.mine div { flex: 1; min-width: 200px; } .mine p { margin: 2px 0 0; color: rgba(255,255,255,.85); }
.mine .btn { background: #fff; color: var(--navy); }
.resume { background: linear-gradient(135deg, var(--saffron-soft), color-mix(in srgb, var(--saffron-soft) 60%, var(--surface))); border: 1px solid color-mix(in srgb, var(--saffron) 30%, transparent); }

/* ---------- parcours et leçons */
@media (min-width: 700px) { .subjects:has(> :nth-child(4):last-child), .subjects:has(> :nth-child(2):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.subj { border-radius: 18px; padding: 18px; }
.lesson-link { position: relative; padding-right: 38px; transition: transform .12s ease, background .12s ease; }
.lesson-link::after { content: "›"; position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 26px; line-height: 1; color: var(--sc); opacity: .6; transition: right .15s ease, opacity .15s ease; }
.lesson-link:hover { transform: translateX(3px); } .lesson-link:hover::after { right: 10px; opacity: 1; }
.lesson-link.cur { box-shadow: 0 0 0 2px var(--saffron) inset; }
.lesson-link small.now { color: var(--saffron); }
article.lesson > h1 { box-shadow: 0 10px 24px color-mix(in srgb, var(--solid) 25%, transparent); }

/* ---------- quiz : lettres A B C D, correction animée, résultat */
.qbar { position: sticky; top: calc(70px + env(safe-area-inset-top, 0px)); z-index: 3; height: 8px; border-radius: 99px; background: color-mix(in srgb, var(--sc) 18%, var(--surface)); overflow: hidden; }
.qbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--sc), color-mix(in srgb, var(--sc) 60%, var(--gold))); border-radius: 99px; transition: width .35s ease; }
.opt { display: flex; align-items: center; gap: 12px; position: relative; transition: transform .1s ease, border-color .15s ease, background .15s ease; }
.opt:not(:disabled):hover { border-color: var(--sc); transform: translateX(2px); }
.opt .ol { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; font-size: 14px; background: color-mix(in srgb, var(--sc) 14%, var(--surface)); color: var(--sc); }
.opt .ot { flex: 1; min-width: 0; }
.opt.right .ol { background: var(--good); color: #fff; } .opt.wrong .ol { background: var(--bad); color: #fff; }
.opt.right::after, .opt.wrong::after { margin-left: auto; font-weight: 800; font-size: 18px; }
.opt.right::after { content: "✓"; color: var(--good); } .opt.wrong::after { content: "✗"; color: var(--bad); }
@keyframes shake { 0%, 100% { transform: none; } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
@keyframes pop { 0% { transform: scale(1); } 50% { transform: scale(1.025); } 100% { transform: scale(1); } }
.opt.wrong { animation: shake .3s ease; } .opt.right { animation: pop .35s ease; }
.q.done-q { border-color: color-mix(in srgb, var(--sc) 45%, var(--surface)); }
.expl { background: var(--surface); border-radius: 10px; padding: 8px 12px; }
.qresult { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; border-radius: 20px; padding: 20px 22px; color: #fff; background: linear-gradient(140deg, var(--solid), var(--solid-dk)); }
.qresult .ring { --p: 0; width: 96px; height: 96px; border-radius: 50%; flex: none; display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 24px;
  background: radial-gradient(closest-side, var(--solid-dk) 78%, transparent 80% 100%), conic-gradient(#fff calc(var(--p) * 1%), rgba(255,255,255,.22) 0); }
.qresult div { flex: 1; min-width: 200px; } .qresult h2 { color: #fff; } .qresult p { margin: 4px 0 0; color: rgba(255,255,255,.9); }

/* ---------- cartes de révision : retournement */
@keyframes flipin { from { transform: perspective(900px) rotateY(80deg); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes cardin { from { transform: translateX(24px) rotate(1.5deg); opacity: 0; } to { transform: none; opacity: 1; } }
.cardface.show { animation: flipin .35s ease both; }
.cardface.next { animation: cardin .3s ease both; }
.cardface { min-height: 240px; transition: box-shadow .2s ease; }
.cardface:hover { box-shadow: inset 0 6px 0 var(--sc), 0 16px 30px rgba(20,28,46,.16); }

/* ---------- pied de page */
footer.site { background: linear-gradient(180deg, var(--navy), var(--navy-2)); color: rgba(255,255,255,.82); border-top: 0; margin-top: 30px; position: relative; }
footer.site::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='88' viewBox='0 0 88 88'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.06' stroke-width='1.2'%3E%3Cpath d='M44 14l8.5 21.5L74 44l-21.5 8.5L44 74l-8.5-21.5L14 44l21.5-8.5z'/%3E%3Crect x='23' y='23' width='42' height='42' transform='rotate(45 44 44)'/%3E%3Ccircle cx='44' cy='44' r='7'/%3E%3C/g%3E%3C/svg%3E"); background-size: 88px 88px; }
footer.site .wrap { position: relative; padding-block: 34px 26px; gap: 22px; color: inherit; }
.ft-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 22px; }
.ft-brand { display: flex; flex-direction: column; gap: 8px; grid-column: span 2; min-width: 0; }
@media (max-width: 560px) { .ft-brand { grid-column: auto; } }
.ft-brand .brand { color: #fff; } .ft-brand .brand b span { color: #b9c9f5; }
.ft-brand p { margin: 0; font-size: 14px; color: rgba(255,255,255,.75); max-width: 46ch; }
.ft-ar { font-family: "Lisan Naskh", serif; font-size: 24px; color: #f0c56b; margin: 0; line-height: 1.6; }
.ft-col { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.ft-col b { color: #fff; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 4px; }
.ft-col a { color: rgba(255,255,255,.82); text-decoration: none; } .ft-col a:hover { color: #fff; text-decoration: underline; }
.ft-bottom { border-top: 1px solid rgba(255,255,255,.14); padding-top: 14px; font-size: 13px; color: rgba(255,255,255,.65); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 14px; }

/* ---------- confettis (réussites) */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 30; }

@media (prefers-reduced-motion: reduce) {
  #view.enter > *, .opt.wrong, .opt.right, .cardface.show, .cardface.next { animation: none !important; }
  .home-hero .hv-frame { transform: none !important; }
}
@media print { #readbar, .totop, footer.site::before { display: none !important; } footer.site { background: none; color: #000; } }

/* compléments : options arabes du quiz, colonne de lecture centrée, chiffre clé en texte */
.opt .ot.ara { font-size: 1.9em; line-height: 1.45; }
.kpi b.txt { font-size: 22px; line-height: 1.2; padding-top: 4px; }
@media (min-width: 900px) {
  .read { margin-inline: auto; width: 100%; }
  #view:has(> .read) > .crumbs, #view:has(> .read) > .subject-head, #view:has(> .read) > .notice { width: 100%; max-width: 760px; margin-inline: auto; }
}

/* =====================================================================
   Apparitions en douceur : écran d'ouverture, titre mot à mot, sections
   révélées au fil du défilement, fondu entre les pages.
   ===================================================================== */
:root { --ease-soft: cubic-bezier(.2, .7, .2, 1); }
/* écran d'ouverture (une fois par visite) */
#veil { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; color: #fff; text-align: center;
  background: radial-gradient(700px 420px at 50% 42%, rgba(80, 120, 230, .35), transparent 70%), linear-gradient(160deg, #1e2c66 0%, #141c3f 55%, #0c1230 100%);
  transition: opacity .9s ease, visibility .9s ease; animation: veilauto .9s ease 3.2s forwards; }
#veil.out { opacity: 0; visibility: hidden; }
#veil.out .vl-in { transform: scale(1.04); opacity: 0; }
@keyframes veilauto { to { opacity: 0; visibility: hidden; } }
.vl-in { display: flex; flex-direction: column; align-items: center; gap: 14px; transition: transform .9s var(--ease-soft), opacity .7s ease; }
.vl-in img { width: 96px; height: 96px; border-radius: 24px; box-shadow: 0 16px 40px rgba(0, 0, 0, .35); animation: vlogo 1.1s var(--ease-soft) both; }
.vl-in b { font-family: var(--font-display); font-weight: 800; font-size: 34px; letter-spacing: .01em; animation: vtext 1s var(--ease-soft) .3s both; }
.vl-in b span { color: #9fb7f5; }
.vl-in i { display: block; height: 2px; width: 170px; background: linear-gradient(90deg, transparent, #e8b44f, transparent); transform-origin: 50% 50%; animation: vline 1s var(--ease-soft) .5s both; }
.vl-in small { font-size: 12px; font-weight: 700; letter-spacing: .32em; text-transform: uppercase; color: #e8b44f; animation: vtext 1s var(--ease-soft) .65s both; }
@keyframes vlogo { from { opacity: 0; transform: scale(.82) translateY(10px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes vtext { from { opacity: 0; transform: translateY(10px); letter-spacing: .12em; } to { opacity: 1; transform: none; } }
@keyframes vline { from { transform: scaleX(0); opacity: 0; } to { transform: none; opacity: 1; } }

/* accueil : chorégraphie du haut de page */
@keyframes wordin { from { opacity: 0; transform: translateY(.42em); filter: blur(8px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes softin { from { opacity: 0; transform: translateY(16px); filter: blur(5px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes mediain { from { opacity: 0; transform: translateX(34px) scale(.965); filter: blur(10px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes linein { from { width: 0; } to { width: 26px; } }
.home-hero h1 .wd { display: inline-block; animation: wordin 1s var(--ease-soft) both; animation-delay: calc(.2s + var(--i) * .075s); }
.home-hero h1 em { background: none; color: inherit; }
.home-hero h1 em .wd { background: linear-gradient(120deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--saffron))); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hz { animation: softin .95s var(--ease-soft) both; animation-delay: var(--hd, 0s); }
.home-hero .hero-video { animation: mediain 1.3s var(--ease-soft) .55s both; }
.home-hero .hero .eyebrow::before { animation: linein .8s var(--ease-soft) .15s both; }
body.veiled .home-hero .wd, body.veiled .home-hero .hz, body.veiled .home-hero .hero-video, body.veiled .home-hero .eyebrow::before { animation-play-state: paused; }
/* vidéo : fondu depuis l'image d'attente */
.hv-frame { background: #16204a url("media/poster.webp") center / cover no-repeat; }
.hv-frame video { opacity: 0; transition: opacity 1.2s ease; }
.hv-frame video.ready { opacity: 1; }
/* sections révélées au défilement */
.rv { opacity: 0; transform: translateY(22px); filter: blur(6px); transition: opacity .9s var(--ease-soft), transform .9s var(--ease-soft), filter .9s var(--ease-soft); transition-delay: var(--d, 0s); }
.rv.in { opacity: 1; transform: none; filter: none; }
.rv .bar i { transform: scaleX(0); transform-origin: 0 50%; transition: transform 1.2s var(--ease-soft); transition-delay: calc(var(--d, 0s) + .35s); }
.rv.in .bar i { transform: none; }
.book img { opacity: 0; transition: opacity .8s ease, transform .25s ease, box-shadow .25s ease; }
.book img.ok { opacity: 1; }
/* fondu entre deux pages */
#view { transition: opacity .2s ease, transform .2s ease; }
#view.leave { opacity: 0; transform: translateY(-6px); }

@media (prefers-reduced-motion: reduce) {
  #veil { display: none !important; }
  .home-hero .wd, .hz, .home-hero .hero-video, .home-hero .hero .eyebrow::before { animation: none !important; }
  .rv, .rv .bar i, .book img, .hv-frame video { opacity: 1 !important; transform: none !important; filter: none !important; transition: none !important; }
  #view.leave { opacity: 1; transform: none; }
}
@media print { #veil { display: none !important; } }
.home-hero h1 .nw { white-space: nowrap; }

/* =====================================================================
   Grand écran : mise en page élargie, bandeau d'accueil pleine largeur,
   panneaux latéraux (espace, parcours, leçon, quiz)
   ===================================================================== */
.duo, .duo-side, .duo-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.duo-side > .cert-panel { margin: 0; }
.lside, .qside { display: none; }
body { overflow-x: clip; }

@media (min-width: 1100px) {
  .wrap { max-width: 1240px; }
  body { font-size: 18px; }
  main .wrap { padding-block: 26px 64px; gap: 30px; }
  .quick { margin-left: auto; }
  header.top .wrap { padding-block: 12px; }

  /* accueil : bandeau bleu nuit sur toute la largeur */
  .home-hero { position: relative; isolation: isolate; margin-top: -26px; padding: 64px 0 112px; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 56px; color: #fff; }
  .home-hero::before { content: ""; position: absolute; inset: 0 calc(50% - 50vw); z-index: -1;
    background: radial-gradient(760px 420px at 74% 45%, rgba(90, 130, 240, .38), transparent 70%),
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='88' viewBox='0 0 88 88'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.06' stroke-width='1.2'%3E%3Cpath d='M44 14l8.5 21.5L74 44l-21.5 8.5L44 74l-8.5-21.5L14 44l21.5-8.5z'/%3E%3Crect x='23' y='23' width='42' height='42' transform='rotate(45 44 44)'/%3E%3Ccircle cx='44' cy='44' r='7'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 88px 88px,
      linear-gradient(160deg, #1f2d6a 0%, #151d42 55%, #0c1230 100%); }
  .home-hero h1 { color: #fff; font-size: clamp(42px, 3.8vw, 58px); }
  .home-hero h1 em .wd { background: linear-gradient(120deg, #f3c86a, #9fb7f5); -webkit-background-clip: text; background-clip: text; }
  .home-hero .lead { color: rgba(255, 255, 255, .86); font-size: 19px; }
  .home-hero .eyebrow { color: #f0c56b; }
  .home-hero .btn:not(.ghost) { background: linear-gradient(135deg, #f0c56b, #c8962e); color: #1b1404; box-shadow: 0 10px 24px rgba(200, 150, 46, .35); }
  .home-hero .btn.ghost { color: #fff; border-color: rgba(255, 255, 255, .7); }
  .home-hero .btn.ghost:hover { background: rgba(255, 255, 255, .1); }
  .home-hero .hv-frame { box-shadow: 0 40px 80px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 255, 255, .12); }
  /* chiffres clés posés à cheval sur le bandeau */
  .home-hero + .kpis { margin-top: -96px; position: relative; z-index: 1; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
  .home-hero + .kpis .kpi { background: var(--surface); border: 0; padding: 18px 20px; box-shadow: 0 18px 40px rgba(15, 23, 51, .16); }
  .kpi b { font-size: 34px; }
  .sec-h { margin-top: 18px; }
  .spaces { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .spacecard { min-height: 260px; padding: 28px 28px 22px; }
  .spacecard h2 { font-size: 26px; } .spacecard p { font-size: 16px; max-width: 52ch; }
  .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
  .books { gap: 22px; justify-content: space-between; overflow: visible; }
  .book { width: 170px; } .book img { width: 170px; }
  .mine { padding: 22px 28px; }

  /* espace et parcours : panneau fixe à gauche, contenu à droite */
  .duo { display: grid; grid-template-columns: 400px minmax(0, 1fr); gap: 30px; align-items: start; }
  .duo-side { position: sticky; top: 96px; max-height: calc(100vh - 110px); overflow-y: auto; scrollbar-width: thin; }
  .duo-side .subject-head h1 { font-size: 32px; }
  .duo-side .subject-head .lead { font-size: 16px; }
  .duo-main .subjects { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
  .duo-main .subj { min-height: 170px; padding: 22px; }
  .duo-main .subj h3 { font-size: 22px; }
  .duo-main .lessons { gap: 10px; }
  .duo-main .lesson-link { padding: 15px 44px 15px 16px; font-size: 17px; }

  /* leçon et quiz : colonne principale + panneau à droite */
  .duo.duo-r { grid-template-columns: minmax(0, 1fr) 320px; gap: 34px; }
  .duo-r > .read { max-width: none; margin: 0; }
  article.lesson { padding: 26px 30px 30px; }
  .lside, .qside { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 96px; max-height: calc(100vh - 110px); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 18px; box-shadow: 0 14px 32px rgba(15, 23, 51, .08); }
  .ls-head { display: flex; flex-direction: column; gap: 6px; }
  .ls-head a { text-decoration: none; color: var(--sc); font-family: var(--font-display); font-size: 20px; line-height: 1.2; }
  .ls-list { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; scrollbar-width: thin; margin: 0 -8px; padding: 0 8px; }
  .ls-list a { display: flex; gap: 10px; align-items: flex-start; padding: 7px 8px; border-radius: 10px; color: var(--ink); text-decoration: none; font-size: 14.5px; line-height: 1.35; }
  .ls-list a span { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: color-mix(in srgb, var(--sc) 14%, var(--surface)); color: var(--sc); }
  .ls-list a:hover { background: color-mix(in srgb, var(--sc) 8%, var(--surface)); }
  .ls-list a.done span { background: var(--good); color: #fff; }
  .ls-list a.on { background: color-mix(in srgb, var(--sc) 14%, var(--surface)); font-weight: 700; }
  .ls-list a.on span { background: var(--sc); color: #fff; }
  .ls-act { display: flex; gap: 8px; } .ls-act .btn { flex: 1; }
  .qside { align-items: center; text-align: center; }
  .qside .ring { --p: 0; width: 150px; height: 150px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 34px; color: var(--sc);
    background: radial-gradient(closest-side, var(--surface) 80%, transparent 82% 100%), conic-gradient(var(--sc) calc(var(--p) * 1%), color-mix(in srgb, var(--sc) 14%, var(--surface)) 0); transition: background .4s ease; }
  .qside .bar { width: 100%; } .qside .btn { width: 100%; }
  .duo-r .quiz .score { display: none; }
  .quiz .q { padding: 18px 20px; }
  .opt { padding: 12px 14px; }

  /* cartes de révision : grande carte centrée */
  #view:has(.flash) > .subject-head, #view:has(.flash) > .notice { width: 100%; max-width: 820px; margin-inline: auto; }
  .flash { max-width: 820px; width: 100%; margin-inline: auto; }
  .cardface { min-height: 340px; padding: 34px; }
  .cardface .term { font-size: 40px; } .cardface .def { font-size: 22px; }
  .cardface .term .ara { font-size: 72px; }

  /* glossaire, paramètres, pages : largeur de lecture confortable */
  #view:has(> .gloss), #view:has(#glist) { --x: 1; }
}
@media (min-width: 1500px) { .wrap { max-width: 1320px; } .duo { grid-template-columns: 430px minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .qside .ring { transition: none; } }
@media (min-width: 1100px) { .ls-list { flex: 1 1 auto; min-height: 0; } .lside { overflow: hidden; } }
