/*
 * 08-accueil-cahier.css
 * Page d'accueil publique, thème « cahier d'écolier ».
 *
 * L'identité de la page vient du cahier français : papier Seyès (grands
 * carreaux), marge rouge, copie à petits carreaux corrigée au stylo rouge,
 * étiquettes de cahier pour les matières, sommaire avec points de suite.
 */

:root {
  --seyes-fort: #aab4dc;
  --seyes-fin: #e2e6f4;
  --marge: #e0525f;
  --stylo-rouge: #cf3443;
  --stylo-bleu: #26358f;
  --f-main: "Playwrite FR Moderne", "Segoe Script", cursive;
}

/* ---------- Héros : une page de cahier ---------- */
.chero {
  --x-marge: clamp(22px, 7vw, 104px);
  position: relative;
  background-color: #fcfcff;
  background-image:
    linear-gradient(90deg, transparent calc(var(--x-marge) - 1px), var(--marge) calc(var(--x-marge) - 1px), var(--marge) calc(var(--x-marge) + 1px), transparent calc(var(--x-marge) + 1px)),
    repeating-linear-gradient(to bottom, transparent 0 31px, var(--seyes-fort) 31px 32px),
    repeating-linear-gradient(to bottom, transparent 0 7px, var(--seyes-fin) 7px 8px),
    repeating-linear-gradient(to right, transparent 0 31px, var(--seyes-fin) 31px 32px);
  background-position: 0 0, 0 18px, 0 18px, var(--x-marge) 0;
  border-bottom: 1px solid var(--line-strong);
}
.chero-in {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
  padding: clamp(48px, 7vw, 96px) clamp(16px, 5vw, 64px) clamp(56px, 7vw, 96px) calc(var(--x-marge) + clamp(18px, 3vw, 44px));
  max-width: 1320px;
}
.chero-txt {
  display: flex;
  flex-direction: column;
  gap: 22px;
  max-width: 600px;
}
.chero h1 {
  margin: 0;
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(42px, 6.2vw, 80px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  color: var(--ink);
  text-wrap: balance;
}
.chero-txt > p {
  margin: 0;
  max-width: 54ch;
  font-size: 17.5px;
  line-height: 1.6;
  color: var(--ink-soft);
}
.chero-facts {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14.5px;
  color: var(--ink);
}
.chero-facts li {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 28px;
}
.chero-facts li::before {
  content: "";
  flex: none;
  width: 14px;
  height: 2px;
  background: var(--marge);
  border-radius: 2px;
}

/* La copie corrigée (voir js/14b-copie-vivante.js) */
.copie-zone {
  justify-self: center;
  width: min(100%, 520px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.copie {
  margin: 0;
  width: 100%;
  transform: rotate(1.4deg);
}
.copie-feuille {
  position: relative;
  min-height: 430px;
  padding: 28px 28px 40px 78px;
  background-color: #fff;
  background-image:
    linear-gradient(90deg, transparent 57px, var(--marge) 57px, var(--marge) 59px, transparent 59px),
    repeating-linear-gradient(to bottom, transparent 0 19px, #dbe4f3 19px 20px),
    repeating-linear-gradient(to right, transparent 0 19px, #dbe4f3 19px 20px);
  border-radius: 3px;
  box-shadow:
    0 1px 0 #e7e2ea,
    6px 8px 0 -2px #fff,
    6px 8px 0 -1px #e3dde6,
    0 30px 60px -30px rgba(31, 26, 53, 0.45);
}
/* trous de perforation de la copie double */
.trous {
  position: absolute;
  left: 16px;
  top: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  padding: 40px 0;
}
.trous i {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #eef0f8;
  box-shadow: inset 1px 2px 3px rgba(31, 26, 53, 0.22);
}
.copie-tete {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-bottom: 18px;
  padding-right: 110px;
}
.copie-tete span + span {
  display: none;
}
.copie-titre {
  margin: 0 0 8px;
  padding-right: 96px;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.4;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--stylo-bleu);
  text-underline-offset: 4px;
}
.copie .ecrit {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 12px;
  font-family: var(--f-main);
  font-weight: 400;
  font-size: 17px;
  line-height: 40px;
  color: var(--stylo-bleu);
}
.copie .ecrit.petit {
  font-size: 13px;
}
.copie .faux {
  position: relative;
}
.copie .faux::after {
  content: "";
  position: absolute;
  left: -3px;
  right: -3px;
  top: 52%;
  height: 2px;
  background: var(--stylo-rouge);
  transform: rotate(-3deg);
  transform-origin: left;
}
.copie .juste {
  flex-basis: 100%;
  margin: -8px 0 6px;
  font-family: var(--f-main);
  font-size: 15px;
  line-height: 26px;
  color: var(--stylo-rouge);
}
.copie .ok {
  font-style: normal;
  color: var(--stylo-rouge);
  font-family: var(--f-main);
}
.copie .annot {
  margin: 14px 0 0;
  max-width: 25ch;
  font-family: var(--f-main);
  font-size: 14px;
  line-height: 1.75;
  color: var(--stylo-rouge);
}
.copie .note {
  position: absolute;
  right: 14px;
  top: 18px;
  width: 120px;
  height: 70px;
  display: grid;
  place-items: center;
  transform: rotate(-6deg);
}
.copie .note span {
  font-family: var(--f-main);
  font-size: 30px;
  color: var(--stylo-rouge);
}
.copie .note svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: var(--stylo-rouge);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-dasharray: 330;
  stroke-dashoffset: 0;
}
/* bon point : la fleur de la marque, collée comme une gommette */
.bonpoint {
  position: absolute;
  right: 26px;
  bottom: 22px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: #fff6d8;
  border: 3px solid #fff;
  box-shadow: 0 0 0 1px #f0d98c, 0 8px 18px -8px rgba(122, 84, 16, 0.6);
  transform: rotate(10deg);
}
.bonpoint svg {
  width: 44px;
  height: 44px;
}
.bonpoint b {
  font-family: var(--f-main);
  font-weight: 400;
  font-size: 11px;
  color: #9a5a12;
}
.carnet {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 16px 0 0 30px;
  padding: 10px 14px;
  max-width: 330px;
  background: #fff3c9;
  color: #5b4510;
  font-size: 13px;
  line-height: 1.45;
  transform: rotate(-3deg);
  box-shadow: 0 10px 22px -16px rgba(91, 69, 16, 0.6);
}
.carnet b {
  font-size: 13px;
}

/* Onglets des matières */
.copie-onglets {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  padding: 5px;
  background: #fff;
  border: 1px solid var(--seyes-fort);
  border-radius: 24px;
}
.copie-onglets button {
  border: 0;
  background: none;
  padding: 7px 14px;
  border-radius: 999px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
}
.copie-onglets button:hover {
  color: var(--ink);
}
.copie-onglets button[aria-pressed="true"] {
  background: var(--stylo-bleu);
  color: #fff;
}
.copie-onglets button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* L'écriture : l'encre bleue apparaît de gauche à droite, puis le stylo rouge */
.ecrit-anime .encre {
  display: inline-block;
  clip-path: inset(-10px 100% -10px 0);
  animation: ecrire var(--w) var(--d) linear forwards;
}
.ecrit-anime .rouge {
  opacity: 0;
  animation: corriger 0.35s var(--d) ease-out forwards;
}
.ecrit-anime .note svg {
  stroke-dashoffset: 330;
  animation: entourer 0.8s calc(var(--d) + 0.2s) ease-out forwards;
}
.ecrit-anime .bonpoint {
  animation: coller 0.45s var(--d) cubic-bezier(0.3, 1.6, 0.5, 1) both;
}
.ecrit-anime .faux::after {
  transform: rotate(-3deg) scaleX(0);
  animation: barrer 0.3s var(--d) ease-out forwards;
}
@keyframes ecrire {
  to { clip-path: inset(-10px 0 -10px 0); }
}
@keyframes corriger {
  to { opacity: 1; }
}
@keyframes entourer {
  to { stroke-dashoffset: 0; }
}
@keyframes barrer {
  to { transform: rotate(-3deg) scaleX(1); }
}
@keyframes coller {
  from { opacity: 0; transform: rotate(-20deg) scale(1.6); }
  to { opacity: 1; transform: rotate(10deg) scale(1); }
}

/* ---------- Atouts écrits sur les lignes ---------- */
.lignes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(24px, 4vw, 56px);
  margin: 0;
}
.lignes > div {
  display: grid;
  grid-template-columns: 13em 1fr;
  gap: 16px;
  align-items: baseline;
  padding: 14px 0;
  border-bottom: 1px solid var(--seyes-fort);
}
.lignes dt {
  font-weight: 700;
  color: var(--ink);
}
.lignes dd {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14.5px;
}

/* ---------- Petit écran ---------- */
@media (max-width: 900px) {
  .chero-in {
    grid-template-columns: 1fr;
  }

  .lignes {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 560px) {
  .chero {
    --x-marge: 20px;
  }
  .chero-in {
    padding-left: 36px;
    padding-right: 16px;
  }
  .copie-feuille {
    padding: 22px 16px 34px 60px;
    background-image:
      linear-gradient(90deg, transparent 43px, var(--marge) 43px, var(--marge) 45px, transparent 45px),
      repeating-linear-gradient(to bottom, transparent 0 19px, #dbe4f3 19px 20px),
      repeating-linear-gradient(to right, transparent 0 19px, #dbe4f3 19px 20px);
  }
  .trous {
    left: 10px;
  }
  .trous i {
    width: 12px;
    height: 12px;
  }
  .copie-tete,
  .copie-titre {
    padding-right: 86px;
  }
  .copie .note {
    right: 0;
    top: 14px;
    width: 96px;
  }
  .copie .note span {
    font-size: 25px;
  }
  .bonpoint {
    width: 74px;
    height: 74px;
    right: 12px;
  }
  .bonpoint svg {
    width: 34px;
    height: 34px;
  }
  .lignes > div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

