:root {
  --bg: #faf8f4;
  --papier: #ffffff;
  --encre: #3a322c;
  --doux: #8b7f74;
  --taupe: #8a7c70;
  --trait: #e5ded3;
  --sable: #efe8dc;
  --argile: #e3d3c1;
  --rose: #ebdad0;
  --pierre: #e4e0d6;
  --moka: #7a6350;
  --ok: #5f7a5c;
  --ko: #a2564a;
  --serif: "Cormorant Garamond", "Cormorant", Georgia, "Times New Roman", serif;
  --sans: "Jost", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--encre);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--moka); }

:focus-visible { outline: 2px solid var(--moka); outline-offset: 3px; }

/* En-tête */
.bandeau {
  background: var(--taupe);
  color: #fff;
  text-align: center;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 7px 16px;
}

.entete {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 24px 22px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}

.nav { display: flex; gap: 30px; }
.nav.droite { justify-content: flex-end; }

.nav a {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding-bottom: 4px;
  border-bottom: 1px solid transparent;
}
.nav a.actif { border-bottom-color: var(--taupe); color: var(--moka); }

.marque { text-align: center; line-height: 1; }
.marque .nom {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 38px;
  letter-spacing: -0.01em;
  display: block;
}
.marque .nom i { font-style: italic; font-weight: 300; }
.marque .sous {
  display: block;
  margin-top: 8px;
  font-size: 9.5px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--doux);
  font-weight: 400;
}

main:focus { outline: none; }

main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 24px 80px;
  min-height: 60vh;
}

/* Titres */
h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.12;
  margin: 0;
}
h1 { font-size: clamp(36px, 6vw, 62px); font-weight: 300; }
h2 { font-size: clamp(26px, 3.4vw, 36px); }
h3 { font-size: 24px; }

.etiquette {
  display: inline-block;
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 400;
  color: var(--doux);
}

.filet { width: 56px; height: 1px; background: var(--taupe); margin: 22px 0; border: 0; }

/* Boutons */
.bouton {
  display: inline-block;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 15px 26px;
  border: 1px solid var(--encre);
  background: var(--encre);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.bouton:hover { background: var(--moka); border-color: var(--moka); color: #fff; }
.bouton.clair { background: transparent; color: var(--encre); }
.bouton.clair:hover { background: var(--encre); color: #fff; }
.bouton[disabled] { opacity: 0.35; cursor: default; pointer-events: none; }

.retour {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--doux);
  display: block;
  margin-bottom: 22px;
}

/* Accueil */
.accueil {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 56px;
  align-items: center;
  padding: 36px 0 24px;
}
.accueil p.chapeau { font-size: 19px; color: #5a4f46; max-width: 34em; margin: 0 0 30px; }
.accueil .actions { display: flex; flex-wrap: wrap; gap: 14px; }

.planche {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.planche { align-items: start; }
.planche div {
  padding: 26px 22px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.planche div:nth-child(1) { background: var(--sable); min-height: 190px; }
.planche div:nth-child(2) { background: var(--argile); min-height: 150px; margin-top: 40px; }
.planche div:nth-child(3) { background: var(--rose); min-height: 150px; }
.planche div:nth-child(4) { background: var(--pierre); min-height: 190px; margin-top: -10px; }
.planche .num { font-family: var(--serif); font-size: 40px; font-weight: 300; line-height: 1; }
.planche .lib { font-size: 13px; letter-spacing: 0.04em; }

.bloc-bac {
  margin-top: 64px;
  border-top: 1px solid var(--trait);
  padding-top: 40px;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  flex-wrap: wrap;
}
.bloc-bac p { margin: 12px 0 0; max-width: 34em; color: #5a4f46; }

/* Parcours */
.tete-page { margin-bottom: 40px; max-width: 40em; }
.tete-page p { margin: 18px 0 0; color: #5a4f46; }

.grille {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 22px;
}

.chap {
  background: var(--papier);
  border: 1px solid var(--trait);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, border-color 0.2s;
}
.chap:hover { border-color: var(--taupe); transform: translateY(-2px); }
.chap .haut { padding: 22px 22px 16px; min-height: 92px; }
.chap .haut .n { font-family: var(--serif); font-size: 46px; font-weight: 300; line-height: 1; }
.chap .corps { padding: 18px 22px 20px; display: flex; flex-direction: column; gap: 18px; flex: 1; justify-content: space-between; }
.chap .corps h3 { font-size: 22px; line-height: 1.2; }
.chap .barres { display: flex; gap: 5px; }
.chap .barres span { flex: 1; height: 3px; background: var(--trait); }
.chap .barres span.fait { background: var(--moka); }
.chap .pied { display: flex; justify-content: space-between; font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--doux); }

.t0 .haut { background: var(--sable); }
.t1 .haut { background: var(--argile); }
.t2 .haut { background: var(--rose); }
.t3 .haut { background: var(--pierre); }

/* Page chapitre */
.etapes { margin-top: 40px; border-top: 1px solid var(--trait); }
.etape {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 24px 0;
  border-bottom: 1px solid var(--trait);
}
.etape .num { font-family: var(--serif); font-size: 34px; font-weight: 300; color: var(--taupe); line-height: 1; }
.etape h3 { font-size: 26px; }
.etape p { margin: 4px 0 0; color: var(--doux); font-size: 15px; }
.etape .etat { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ok); margin-top: 6px; display: block; }

/* Cours */
.lecture { max-width: 40em; }
.lecture p { font-size: 18px; margin: 0 0 20px; }
.notions { margin: 34px 0; padding: 24px 26px; background: var(--sable); }
.notions .etiquette { margin-bottom: 10px; }
.notions p { margin: 0; font-size: 16px; }
.navchap { display: flex; justify-content: space-between; gap: 16px; margin-top: 44px; flex-wrap: wrap; }

/* Listes (cours, cartes) */
.liste { border-top: 1px solid var(--trait); }
.liste a {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 16px;
  align-items: baseline;
  padding: 18px 4px;
  border-bottom: 1px solid var(--trait);
}
.liste a:hover { background: var(--sable); }
.liste .n { font-family: var(--serif); font-size: 28px; font-weight: 300; color: var(--taupe); }
.liste .t { font-family: var(--serif); font-size: 22px; line-height: 1.25; }
.liste .m { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--doux); white-space: nowrap; }

/* Cartes */
.zone-carte { max-width: 640px; margin: 8px auto 0; }
.carte {
  perspective: 1400px;
  height: 340px;
  cursor: pointer;
  outline-offset: 6px;
}
.carte .face {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.55s cubic-bezier(0.3, 0.7, 0.2, 1);
  transform-style: preserve-3d;
}
.carte.retournee .face { transform: rotateY(180deg); }
.carte .cote {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 36px 40px;
  border: 1px solid var(--trait);
}
.carte .recto { background: var(--papier); }
.carte .verso { background: var(--sable); transform: rotateY(180deg); }
.carte .cote .etiquette { position: absolute; top: 18px; left: 0; right: 0; }
.carte .texte { font-family: var(--serif); font-size: clamp(24px, 3.6vw, 32px); line-height: 1.25; font-weight: 400; }
.carte .aide { position: absolute; bottom: 16px; left: 0; right: 0; font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--doux); }

.compteur { text-align: center; margin: 26px 0 16px; font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--doux); }
.commandes { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.avancee { height: 2px; background: var(--trait); margin-top: 22px; }
.avancee span { display: block; height: 100%; background: var(--moka); transition: width 0.3s; }

/* Quiz */
.quiz { max-width: 680px; margin: 0 auto; }
.quiz .q { font-family: var(--serif); font-size: clamp(26px, 4vw, 36px); line-height: 1.2; margin: 14px 0 28px; }
.reponses { display: grid; gap: 12px; }
.rep {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  align-items: baseline;
  text-align: left;
  font: inherit;
  font-size: 17px;
  color: var(--encre);
  background: var(--papier);
  border: 1px solid var(--trait);
  padding: 16px 18px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.rep:hover { border-color: var(--taupe); }
.rep .lettre { font-family: var(--serif); font-size: 22px; color: var(--taupe); }
.rep.bonne { border-color: var(--ok); background: #eef3ec; }
.rep.fausse { border-color: var(--ko); background: #f6e9e6; }
.rep[disabled] { cursor: default; }
.retour-q { min-height: 30px; margin: 20px 0 6px; font-size: 16px; }
.retour-q.ok { color: var(--ok); }
.retour-q.ko { color: var(--ko); }
.score { font-family: var(--serif); font-size: clamp(54px, 10vw, 96px); font-weight: 300; line-height: 1; margin: 10px 0 6px; }
.ratees { margin: 30px 0; border-top: 1px solid var(--trait); }
.ratees div { padding: 14px 0; border-bottom: 1px solid var(--trait); }
.ratees b { font-weight: 400; display: block; }
.ratees span { color: var(--doux); font-size: 15px; }

/* Association */
.assoc { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 28px; max-width: 860px; margin: 0 auto; }
.assoc .col { display: grid; gap: 12px; align-content: start; }
.tuile {
  font: inherit;
  font-size: 16px;
  text-align: left;
  padding: 16px 18px;
  background: var(--papier);
  border: 1px solid var(--trait);
  color: var(--encre);
  cursor: pointer;
  min-height: 64px;
  transition: border-color 0.15s, background 0.15s, opacity 0.2s;
}
.tuile.notion { font-family: var(--serif); font-size: 22px; line-height: 1.15; }
.tuile:hover { border-color: var(--taupe); }
.tuile.choisie { border-color: var(--moka); background: var(--sable); }
.tuile.trouvee { border-color: var(--ok); background: #eef3ec; opacity: 0.75; pointer-events: none; }
.tuile.erreur { animation: secoue 0.35s; border-color: var(--ko); }
@keyframes secoue { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

.fin-jeu { text-align: center; margin-top: 36px; }

/* Méthodologie */
.methodo { max-width: 46em; }
.methodo section { margin-top: 54px; padding-top: 34px; border-top: 1px solid var(--trait); }
.methodo .rom { font-family: var(--serif); font-size: 18px; color: var(--taupe); display: block; margin-bottom: 6px; }
.methodo ul, .methodo ol { padding-left: 1.2em; }
.methodo li { margin: 6px 0; }
.methodo ol { counter-reset: e; list-style: none; padding: 0; margin: 22px 0; }
.methodo ol li { counter-increment: e; display: grid; grid-template-columns: 52px 1fr; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--trait); }
.methodo ol li::before { content: counter(e); font-family: var(--serif); font-size: 28px; color: var(--taupe); }
.exemple { background: var(--sable); padding: 26px 28px; margin: 28px 0 0; }
.exemple .quest { font-family: var(--serif); font-size: 22px; line-height: 1.25; margin: 8px 0 14px; }
.exemple p { margin: 0 0 10px; font-size: 16px; white-space: pre-line; }

/* Pied */
.pied-site {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 24px 40px;
  border-top: 1px solid var(--trait);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--doux);
}

/* Mobile */
@media (max-width: 820px) {
  body { font-size: 16px; }
  .entete { grid-template-columns: 1fr; gap: 16px; padding: 20px 18px 14px; justify-items: center; }
  .marque { order: -1; }
  .marque .nom { font-size: 32px; }
  .nav { gap: 18px; flex-wrap: wrap; justify-content: center; }
  .nav.droite { justify-content: center; }
  main { padding: 14px 18px 60px; }
  .accueil { grid-template-columns: 1fr; gap: 36px; }
  .carte { height: 300px; }
  .carte .cote { padding: 30px 24px; }
  .assoc { grid-template-columns: 1fr; }
  .etape { grid-template-columns: 40px 1fr; }
  .etape .action { grid-column: 2; }
  .liste a { grid-template-columns: 44px 1fr; }
  .liste .m { grid-column: 2; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* Synthèse à trous et rédaction */
.trous-texte p { line-height: 2.2; }
.trou {
  font: inherit; font-size: 0.92em; color: var(--texte, #3a322c);
  background: transparent; border: 0; border-bottom: 1px solid #8a7c70;
  border-radius: 0; padding: 0 4px; margin: 0 2px; text-align: center; min-width: 5ch;
}
.trou:focus { outline: none; border-bottom-color: #3a322c; background: #f1ebe3; }
.trou.juste { border-bottom-color: #5c7a5a; color: #4a6a48; }
.trou.faux { border-bottom-color: #a4503f; background: #f6e6e1; }
.redac {
  width: 100%; box-sizing: border-box; font: inherit; line-height: 1.7; color: #3a322c;
  background: #fff; border: 1px solid #d9d0c5; border-radius: 0; padding: 18px; resize: vertical;
}
.redac:focus { outline: none; border-color: #8a7c70; }
.enreg { display: block; margin-top: 12px; font-size: 13px; color: #8a7c70; min-height: 18px; }
.verif { margin-top: 28px; padding-top: 24px; border-top: 1px solid #d9d0c5; }
.ligne-notion { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid #ece5dc; cursor: pointer; }
.ligne-notion input { margin-top: 5px; accent-color: #7a6350; }
.ligne-notion strong { display: block; font-weight: 500; }
.ligne-notion em { display: block; font-style: normal; color: #6d6258; font-size: 14px; margin-top: 2px; }
.verif .bouton { margin-top: 22px; }

/* Podcasts */
.episodes { border-top: 1px solid #d9d0c5; }
.episode { display: grid; grid-template-columns: 70px 1fr; gap: 20px; padding: 28px 0; border-bottom: 1px solid #d9d0c5; align-items: start; }
.episode .n { font-family: "Cormorant Garamond", Georgia, serif; font-size: 34px; color: #8a7c70; line-height: 1; }
.episode h3 { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 400; font-size: 28px; margin: 0 0 4px; color: #3a322c; }
.episode .duree { display: block; margin-top: 0; font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: #8a7c70; margin-bottom: 16px; }
.episode audio { width: 100%; max-width: 560px; }
@media (max-width: 820px) { .episode { grid-template-columns: 44px 1fr; gap: 12px; } .episode h3 { font-size: 23px; } }
.episode .duree.rang { margin-bottom: 6px; }

/* Chapitre : documents, vidéo, podcast */
.section-docs { margin-top: 56px; max-width: 880px; }
.docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.doc { background: #f1ebe3; padding: 22px; display: flex; flex-direction: column; justify-content: space-between; gap: 18px; min-height: 130px; }
.doc-lien { color: #3a322c; text-decoration: none; display: block; }
.doc-lien strong { display: block; font-family: "Cormorant Garamond", Georgia, serif; font-weight: 500; font-size: 22px; line-height: 1.2; margin-bottom: 6px; }
.doc-lien span { display: block; font-size: 14px; color: #6d6258; }
.bouton.petit { padding: 9px 16px; font-size: 11px; align-self: flex-start; }
.lecteur { width: 100%; max-width: 720px; background: #000; }
.ep-chap { margin-bottom: 20px; }
.ep-chap .duree { display: block; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: #8a7c70; margin-bottom: 10px; }
.ep-chap audio { width: 100%; max-width: 560px; }

/* Choix de matière */
.matieres { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 20px; max-width: 1000px; }
.matiere { display: flex; flex-direction: column; justify-content: space-between; min-height: 300px; padding: 30px; color: #3a322c; text-decoration: none; transition: transform 0.2s ease; }
a.matiere:hover { transform: translateY(-3px); }
.matiere.t0 { background: #efe6db; }
.matiere.t1 { background: #e6d6c3; }
.matiere.t2 { background: #e3e0d5; }
.matiere .niveau { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: #7a6a5c; }
.matiere h3 { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 400; font-size: 32px; line-height: 1.1; margin: 14px 0 10px; }
.matiere p { margin: 0; font-size: 15px; color: #5a4f46; }
.matiere .entrer { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; border-bottom: 1px solid #3a322c; align-self: flex-start; padding-bottom: 3px; margin-top: 22px; }
.matiere.bientot { opacity: 0.6; }
.matiere.bientot .entrer { border-bottom-color: transparent; }
.chap.bientot { opacity: 0.55; cursor: default; pointer-events: none; }

/* Carnet du Grand oral */
.oral-corps { max-width: 760px; margin-top: 10px; }
.bloc-oral { margin: 0 0 44px; }
.bloc-oral h3 { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 400; font-size: 28px; margin: 0 0 20px; color: #3a322c; }
.bloc-oral.info { background: #f1ebe3; padding: 22px 24px; }
.bloc-oral.info h3 { font-size: 22px; margin-bottom: 12px; }
.bloc-oral.info p { margin: 0 0 12px; font-size: 15px; line-height: 1.65; color: #4a4038; }
.bloc-oral.info p:last-child { margin-bottom: 0; }
details.bloc-oral.info summary { cursor: pointer; font-family: "Cormorant Garamond", Georgia, serif; font-size: 22px; margin-bottom: 12px; }
.ch { margin-bottom: 24px; }
.ch .lib { display: block; font-size: 15px; font-weight: 500; color: #3a322c; margin-bottom: 4px; }
.ch .aide { display: block; font-size: 13px; color: #8a7c70; margin-bottom: 8px; line-height: 1.5; }
.champ { width: 100%; box-sizing: border-box; font: inherit; color: #3a322c; background: #fff; border: 1px solid #d9d0c5; border-radius: 0; padding: 11px 14px; }
.champ:focus { outline: none; border-color: #8a7c70; }
.choix { display: flex; gap: 22px; flex-wrap: wrap; }
.choix label { display: flex; gap: 8px; align-items: center; cursor: pointer; font-size: 15px; }
.choix input { accent-color: #7a6350; }
.verdict { margin: -6px 0 26px; font-size: 14px; }
.verdict.oui { color: #4a6a48; }
.verdict.non { color: #a4503f; }
.fiches { margin-bottom: 18px; }
.fiche { border: 1px solid #d9d0c5; background: #fff; padding: 6px 20px 20px; margin-bottom: 14px; }
.fiche summary { cursor: pointer; padding: 14px 0; font-family: "Cormorant Garamond", Georgia, serif; font-size: 22px; }
.outils-carnet { margin-top: 56px; padding-top: 28px; border-top: 1px solid #d9d0c5; max-width: 760px; }
.outils-carnet h3 { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 400; font-size: 28px; margin: 0 0 10px; }
.outils-carnet p { color: #5a4f46; line-height: 1.65; margin: 0 0 20px; }
.etape-carnet { margin-top: 40px; }
.etape-carnet h3 { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 400; font-size: 28px; margin: 0 0 14px; }
.etape-carnet h4 { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: #8a7c70; margin: 22px 0 10px; font-weight: 500; }
.fiche-carnet { border-left: 2px solid #d9d0c5; padding-left: 16px; margin: 0 0 18px; }
.fiche-carnet h5 { margin: 0 0 8px; font-family: "Cormorant Garamond", Georgia, serif; font-weight: 500; font-size: 20px; }
.ligne-carnet { margin-bottom: 12px; }
.ligne-carnet b { display: block; font-size: 13px; font-weight: 500; color: #6d6258; }
.ligne-carnet p { margin: 2px 0 0; white-space: pre-wrap; line-height: 1.6; }

@media print {
  .bandeau, .entete, .pied-site, .retour, .no-print, .navchap { display: none !important; }
  body { background: #fff; }
  main { padding: 0 !important; max-width: none !important; }
  .etape-carnet { break-inside: avoid-page; }
}
