@font-face { font-family: "Source Sans 3"; src: url("fonts/SourceSans3-Variable.woff2") format("woff2"); font-weight: 300 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("fonts/SourceSerif4-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("fonts/SourceSerif4-LightItalic.woff2") format("woff2"); font-weight: 300; font-style: italic; font-display: swap; }

:root {
  --page:      #f6f5f3;
  --papier:    #ffffff;
  --encre:     #141414;
  --texte:     #2b2b2a;
  --chapeau:   #474744;
  --discret:   #62625f;
  --filet:     #dcd9d3;
  --trait:     #7c7b77;
  --juste:     #3d5a40;   --juste-fond: #ecf1ea;
  --faux:      #a52626;   --faux-fond:  #f8ecea;
  --chevron:   url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23141414' stroke-width='1.2'/%3E%3C/svg%3E");
  --sans:  "Source Sans 3", "Helvetica Neue", Arial, sans-serif;
  --serif: "Source Serif 4", Georgia, serif;
  --marge: 1rem;
  --colonne: 84rem;
  --mesure: 72ch;
  --gauche: 30rem;
  color-scheme: light;
}

[data-theme="dark"] {
  --page:      #121211;
  --papier:    #1b1b19;
  --encre:     #f3f1ec;
  --texte:     #e2dfd8;
  --chapeau:   #c9c5bc;
  --discret:   #a29e95;
  --filet:     #33322e;
  --trait:     #8c887f;
  --juste:     #a3c9a5;   --juste-fond: #1c2a1e;
  --faux:      #f09a90;   --faux-fond:  #34201e;
  --chevron:   url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23f3f1ec' stroke-width='1.2'/%3E%3C/svg%3E");
  color-scheme: dark;
}

html[lang="fr"] [lang="en"],
html[lang="en"] [lang="fr"] { display: none; }

[data-theme="light"] .vers-jour,
[data-theme="dark"]  .vers-nuit { display: none; }

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--page);
  color: var(--texte);
  font: 400 1rem/1.55 var(--sans);
  letter-spacing: .005em;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ol, ul, dl, dd { margin: 0; }
ol, ul { padding: 0; list-style: none; }
button { font: inherit; color: inherit; letter-spacing: inherit; cursor: pointer; }
a { color: inherit; }
strong { font-weight: 600; }
[hidden] { display: none !important; }
::selection { background: var(--encre); color: var(--page); }
:focus-visible { outline: 2px solid var(--encre); outline-offset: 3px; }
[tabindex="-1"]:focus { outline: none; }

.lecteur-ecran,
.retour :is(.si-faux, .si-depart) { position: absolute; width: 1px; height: 1px; margin: 0; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

.evitement { position: absolute; top: -100%; left: 1rem; padding: .7rem 1.1rem; background: var(--encre); color: var(--page); z-index: 40; text-decoration: none; }
.evitement:focus { top: 1rem; }

.invitation, .langue, .theme, .contact-bouton,
.bouton, .reinitialiser, .indice-bouton, .fermer, .numero,
a.marque .titre-court, .coordonnees dt {
  font-family: var(--sans);
  font-size: .72rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 3rem; padding: 0 2rem;
  border: 0; background: var(--encre); color: var(--page);
  text-decoration: none;
  outline: 1px solid transparent; outline-offset: 0;
  transition: outline-color .25s, outline-offset .25s;
}
.bouton:hover { outline-color: var(--encre); outline-offset: 3px; }
.bouton:focus-visible { outline: 2px solid var(--encre); outline-offset: 3px; }
.bouton .format { letter-spacing: .08em; opacity: .75; }

.reinitialiser, .indice-bouton, .fermer {
  padding: .5rem .1rem; border: 0; background: none; color: var(--discret);
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .45em;
}
.reinitialiser:hover, .indice-bouton:hover, .fermer:hover { color: var(--encre); }

.navbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: .25rem 1.5rem;
  min-height: 4rem;
  padding: .5rem max(var(--marge), (100% - var(--colonne)) / 2);
  background: var(--page);
  border-bottom: 1px solid var(--filet);
}

a.marque { justify-self: start; display: flex; flex-direction: column; gap: .35rem; padding-block: .35rem; text-decoration: none; color: var(--encre); border-bottom: 1px solid transparent; }
a.marque .nom { font-family: var(--serif); font-weight: 400; font-size: 1.05rem; line-height: 1; letter-spacing: .16em; text-transform: uppercase; white-space: nowrap; }
a.marque .titre-court { font-size: .62rem; letter-spacing: .2em; color: var(--discret); }
a.marque:hover .titre-court { color: var(--encre); }
a.marque[aria-current] { border-bottom-color: var(--encre); }

.onglets { grid-column: 2; display: flex; gap: .1rem 1.25rem; animation: fondu .5s ease both; }
.onglets a { display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 .1rem; text-decoration: none; color: var(--discret); font-size: .92rem; font-weight: 500; border-bottom: 1px solid transparent; transition: color .2s, border-color .2s; }
.onglets a:hover { color: var(--encre); }
.onglets a[aria-current] { color: var(--encre); border-bottom-color: var(--encre); }

.reglages { grid-column: 3; justify-self: end; display: flex; align-items: center; gap: .9rem; }
.langues { display: flex; align-items: center; }
.langue, .theme { min-height: 2.75rem; padding: 0 .35rem; border: 0; background: none; color: var(--discret); }
.langue:hover, .theme:hover { color: var(--encre); }
.langue[aria-pressed="true"] { color: var(--encre); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .5em; }
.langue + .langue::before { content: "/"; margin-right: .6rem; color: var(--filet); display: inline-block; }
.theme > span { display: inline-flex; align-items: center; gap: .45rem; }
.theme .icone { flex: none; position: relative; top: -1px; }

.contact-bouton { min-height: 2.5rem; padding: 0 1.1rem; border: 1px solid var(--encre); background: none; color: var(--encre); transition: background-color .25s, color .25s; }
.contact-bouton:hover { background: var(--encre); color: var(--page); }

.contact {
  position: fixed;
  inset: 4.5rem max(var(--marge), (100vw - var(--colonne)) / 2) auto auto;
  width: min(21rem, 100vw - 2 * var(--marge));
  max-height: calc(100dvh - 5.5rem);
  margin: 0; padding: 1.25rem 1.5rem 1.1rem;
  overflow: auto;
  background: var(--papier); color: var(--texte);
  border: 1px solid var(--filet);
  box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, .08);
}

@supports (anchor-name: --contact) {
  .contact-bouton { anchor-name: --contact; }
  .contact { position-anchor: --contact; top: calc(anchor(bottom) + .9rem); }
}
.contact:popover-open { animation: apparition .35s cubic-bezier(.16, 1, .3, 1) both; }
.coordonnees > div { display: grid; gap: .2rem; padding: .75rem 0; }
.coordonnees > div:first-child { padding-top: 0; }
.coordonnees > div + div { border-top: 1px solid var(--filet); }
.coordonnees dt { font-size: .62rem; color: var(--discret); }
.coordonnees a { color: var(--encre); text-decoration-thickness: 1px; text-underline-offset: .3em; text-decoration-color: var(--trait); overflow-wrap: anywhere; }
.coordonnees a:hover { text-decoration-color: var(--encre); }
.contact-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; padding-top: 1.1rem; border-top: 1px solid var(--filet); }
.contact-actions .fermer { margin-left: auto; }

main { flex: 1; display: flex; flex-direction: column; }

.hero, .activite { width: min(var(--colonne), 100% - 2 * var(--marge)); margin-inline: auto; }

.hero {
  flex: 1;
  display: grid;
  align-content: center;
  gap: 2.75rem;
  padding-block: 2.5rem 3rem;
  scroll-margin-top: 8rem;
  animation: apparition .8s cubic-bezier(.16, 1, .3, 1) both;
}
.hero h1 {
  font-family: var(--serif); font-style: italic; font-weight: 300;
  font-size: clamp(2.6rem, 1.5rem + 4.2vw, 4.75rem); line-height: 1.04; letter-spacing: -.015em;
  color: var(--encre);
  text-wrap: balance;
}
.hero .pitch { max-width: 33rem; margin-top: 1.75rem; font-size: clamp(1.06rem, 1rem + .3vw, 1.18rem); font-weight: 300; line-height: 1.7; color: var(--chapeau); }

.invitation { margin-bottom: 1.1rem; color: var(--discret); }

.choix { display: grid; gap: .6rem; }
.choix a {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  column-gap: 1.25rem;
  padding: 1.3rem 1.5rem;
  border: 1px solid var(--filet);
  background: var(--papier);
  color: var(--encre);
  text-decoration: none;
  transition: border-color .3s;
}
.choix a:hover { border-color: var(--encre); }
.choix .numero { grid-row: 1 / span 2; align-self: start; padding-top: .45rem; color: var(--discret); letter-spacing: .1em; }
.choix strong { grid-column: 2; font-family: var(--serif); font-weight: 400; font-size: 1.32rem; line-height: 1.25; }
.choix .resume { grid-column: 2; margin-top: .25rem; font-size: .93rem; line-height: 1.45; color: var(--discret); }
.choix .fleche { grid-column: 3; grid-row: 1 / span 2; transition: transform .3s cubic-bezier(.16, 1, .3, 1); }
.choix a:hover .fleche { transform: translateX(5px); }

.sans-js { margin-top: 1rem; font-size: .85rem; color: var(--discret); }

.activite { flex: 1; padding-block: 2rem 2.5rem; }

.module { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; animation: apparition .6s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes apparition { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fondu { from { opacity: 0; } }

.consigne { max-width: var(--mesure); margin-bottom: .7rem; font-size: 1rem; line-height: 1.55; color: var(--texte); }
.consigne strong { font-weight: 600; color: var(--encre); }

.consigne-bloc {
  padding: 1.15rem 1.2rem;
  background: var(--papier);
  border: 1px solid var(--filet);
}
.consigne-bloc .consigne:last-child { margin-bottom: 0; }
.ordre-calques, .consigne-liste { margin: .2rem 0 .7rem; padding-left: 1.4rem; list-style-type: "–  "; font-size: 1rem; line-height: 1.45; color: var(--texte); }
.ordre-calques li::marker, .consigne-liste li::marker { color: var(--discret); }

.editeur { display: block; width: 100%; height: 32rem; height: min(32rem, 75svh); border: 1px solid var(--trait); background: var(--papier); }

@media (width < 46rem) {
  .editeur { height: min(calc(323px + (100vw - 2rem) * .5625), 85svh); }
}

.editeur-zone { position: relative; }

.editeur-zone .editeur { pointer-events: none; }
.editeur-zone.active .editeur { pointer-events: auto; }

.apercu { position: absolute; inset: 0; z-index: 2; overflow: hidden; border: 1px solid var(--trait); background: var(--papier); }
.apercu img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top left; filter: blur(4px) grayscale(.35); transform: scale(1.04); }
.editeur-zone.active .apercu { display: none; }

.editeur-zone .lancer {
  position: absolute; inset: 0; z-index: 3;
  display: flex; align-items: center; justify-content: center;
  border: 0; background: rgba(12, 12, 12, .24);
  cursor: pointer; transition: background-color .4s;
}
.editeur-zone .lancer > span {
  padding: 1.05rem 2.25rem; background: var(--encre); color: var(--page);
  font-size: .75rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  outline: 1px solid transparent; outline-offset: 2px;
  transition: transform .45s cubic-bezier(.16, 1, .3, 1), box-shadow .45s, outline-color .35s, outline-offset .45s cubic-bezier(.16, 1, .3, 1);
}
.editeur-zone .lancer:is(:hover, :focus-visible) { background: rgba(12, 12, 12, .46); }
.editeur-zone .lancer:is(:hover, :focus-visible) > span {
  transform: translateY(-2px) scale(1.04);
  outline-color: rgba(255, 255, 255, .6); outline-offset: 6px;
  box-shadow: 0 0 1.5rem rgba(255, 255, 255, .14), 0 .9rem 1.8rem -.6rem rgba(0, 0, 0, .55);
}
.editeur-zone .lancer:focus-visible { outline-offset: -6px; }
.editeur-zone.active .lancer { display: none; }

.barre-reinit { display: flex; justify-content: flex-end; margin-top: .35rem; }

.menus { display: flex; flex-direction: column; gap: .5rem; max-width: var(--mesure); margin: 0 0 1rem; }
.menus li { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; padding: .6rem 1rem; background: var(--papier); border: 1px solid transparent; transition: background-color .4s, border-color .4s; }
.menus li.juste { background: var(--juste-fond); border-color: var(--juste); }
.menus li.faux  { background: var(--faux-fond);  border-color: var(--faux); }
.menus .enonce { flex: 1 1 100%; font-size: .95rem; line-height: 1.45; color: var(--texte); }
.menus select {
  min-height: 2.75rem; max-width: 100%; padding: 0 2.4rem 0 .8rem;
  appearance: none; border: 1px solid var(--trait); border-radius: 0;
  background: var(--page) var(--chevron) no-repeat right .85rem center / .65rem auto;
  color: var(--encre); font: 400 1rem var(--sans); cursor: pointer;
  transition: border-color .2s;
}
.menus select:hover { border-color: var(--encre); }
.menus .coche { flex: none; width: 1.1rem; text-align: center; font-weight: 600; }
.menus .juste .coche { color: var(--juste); }
.menus .faux  .coche { color: var(--faux); }

.menus.associations { max-width: none; }
.menus.associations li { flex-wrap: nowrap; padding: .45rem .9rem; }
.associations label { flex: 1; display: grid; gap: .4rem; }
.associations select { justify-self: start; }
@media (min-width: 40rem) {
  .associations label { grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); align-items: center; column-gap: 1.25rem; }
}

.suite-reponse { margin-bottom: 1rem; }
.suite-label   { margin-bottom: .55rem; font-weight: 600; line-height: 1.45; color: var(--encre); }
.menus.suite   { flex-direction: row; gap: .4rem; margin: 0; max-width: none; }
.menus.suite li { flex-wrap: nowrap; padding: .3rem; gap: .25rem; }
.menus.suite li:not(.juste):not(.faux) { background: transparent; padding-inline: 0; }
.menus.suite select { flex: 1 1 auto; min-width: 0; text-align: center; }
[data-exercice="texte"] .menus.suite li { flex: 0 1 7.5rem; min-width: 0; }

@media (min-width: 40rem) {
  .menus.suite li { flex: 1 1 0; min-width: 0; }
}

@media (width < 40rem) {
  [data-exercice="image"] .menus.suite { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.5rem; }
.actions .indice-bouton { animation: fondu .5s ease both; }

.retour p { margin-top: .75rem; padding: .7rem 1rem; background: var(--papier); border-left: 2px solid var(--trait); font-size: .95rem; line-height: 1.55; color: var(--texte); }
.retour .si-juste { border-left-color: var(--juste); }
.retour .si-erreur { border-left-color: var(--faux); }

.indice {
  max-width: var(--mesure); margin-top: .75rem; padding: .8rem 1rem;
  background: var(--papier); border: 1px solid var(--filet);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 1rem;
}
.indice img { grid-column: 2; grid-row: 1; display: block; width: auto; height: auto; max-width: 9rem; max-height: 10rem; }
.indice p { grid-column: 1; grid-row: 1; font-size: .95rem; line-height: 1.55; color: var(--texte); }

@media (min-width: 56rem) {
  :root { --marge: 2rem; }

  .hero { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: center; column-gap: clamp(3rem, 8vw, 8rem); padding-block: 3rem; }
}

@media (min-width: 64rem) {

  .module:not(:has(.editeur-zone)) { width: min(100%, 48rem); margin-inline: auto; }
}

@media (min-width: 80rem) {

  .module:has(.editeur-zone) {
    grid-template-columns: minmax(0, var(--gauche)) minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    grid-template-areas:
      "consigne   simulateur"
      "reponse    simulateur";
    align-items: start;
    column-gap: 2rem;
  }
  .module:has(.editeur-zone) > .consigne-bloc { grid-area: consigne; }
  .module:has(.editeur-zone) > .simulateur    { grid-area: simulateur; }
  .module:has(.editeur-zone) > .exercice      { grid-area: reponse; }

  .module:has(.editeur-zone) .menus.suite { gap: .3rem; }
  .module:has(.editeur-zone) .menus.suite select { padding: 0 1.6rem 0 .45rem; background-position: right .5rem center; font-size: .92rem; }

  .module:not(:has(.editeur-zone)) {
    width: auto;
    grid-template-columns: minmax(0, var(--gauche)) minmax(0, 44rem);
    grid-template-rows: auto 1fr;
    justify-content: center;
    align-items: start;
    column-gap: 2rem;
  }
  .module:not(:has(.editeur-zone)) > .consigne-bloc { grid-column: 1; grid-row: 1; }
  .module:not(:has(.editeur-zone)) > .exercice      { grid-column: 2; grid-row: 1 / span 2; }
}

@media (min-width: 90rem) {
  :root { --colonne: 90rem; --gauche: 34rem; }
}
@media (min-width: 96rem) {
  :root { --gauche: 36rem; }
}

@media (min-width: 80rem) and (min-height: 36rem) {
  body { height: 100vh; height: 100dvh; }
  main { min-height: 0; }

  .activite { display: flex; flex-direction: column; min-height: 0; padding-block: 1rem; }
  .activite > .module { flex: 1; min-height: 0; grid-template-rows: auto minmax(0, 1fr); align-items: stretch; }
  .activite > .module > .consigne-bloc { align-self: start; }

  .module > .exercice {
    min-height: 0; overflow-y: auto;
    margin: -.75rem -.4rem; padding: .75rem .4rem;
    scroll-padding-block: .75rem;
    -webkit-mask-image: linear-gradient(transparent, #000 .75rem, #000 calc(100% - .75rem), transparent);
            mask-image: linear-gradient(transparent, #000 .75rem, #000 calc(100% - .75rem), transparent);
  }

  .simulateur { display: flex; flex-direction: column; min-height: 0; }
  .editeur-zone { flex: 1; min-height: 0; }
  .editeur { height: 100%; }
}

@media (min-width: 80rem) and (min-height: 36rem) and (max-height: 45rem) {
  .activite { padding-block: .75rem; }
  .consigne-bloc { padding: .9rem 1.15rem; }
  .consigne, .ordre-calques, .consigne-liste { line-height: 1.4; }
  .retour p { padding: .55rem .9rem; }
  .indice { padding: .6rem .9rem; }
  .indice img { max-height: 9rem; }
}

@media (width < 64rem) {
  .navbar { grid-template-columns: 1fr auto; }
  .reglages { grid-column: 2; }
  .onglets { grid-column: 1 / -1; grid-row: 2; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 .5rem; border-top: 1px solid var(--filet); margin-top: .35rem; }
  .onglets a { justify-content: center; text-align: center; padding: .4rem .25rem; font-size: .85rem; line-height: 1.25; }
}

@media (max-width: 30rem) {
  .navbar { column-gap: .75rem; }
  .reglages { gap: .2rem; }
  .langue { padding: 0 .3rem; }
  .langue + .langue::before { margin-right: .3rem; }
  .theme { padding: 0 .45rem; }
  .theme-texte { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  .contact-bouton { padding: 0 .75rem; letter-spacing: .12em; }
  a.marque .nom { font-size: .92rem; letter-spacing: .1em; white-space: nowrap; }
  a.marque .titre-court { font-size: .56rem; letter-spacing: .12em; white-space: nowrap; }
  .contact { inset: auto 0 0 0; width: 100%; max-height: 88dvh; border-width: 1px 0 0; padding: 1.4rem var(--marge) 1rem; }
  .contact:popover-open { animation: monter .35s cubic-bezier(.16, 1, .3, 1) both; }
  .contact::backdrop { background: rgba(0, 0, 0, .3); }
  .choix a { padding: 1.1rem 1.1rem; column-gap: 1rem; }
  .indice { grid-template-columns: minmax(0, 1fr); }
  .indice img { grid-column: 1; grid-row: 2; }
}
@keyframes monter { from { transform: translateY(100%); } }

@media (max-width: 22rem) {
  .navbar { column-gap: .4rem; }
  a.marque .nom { letter-spacing: .06em; }
  a.marque .titre-court { white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media (forced-colors: active) {
  .menus select { appearance: auto; background-image: none; }
}

@media print {
  body { display: block; height: auto; background: #fff; color: #000; }
  .navbar, .evitement, .simulateur, .contact { display: none !important; }
}
