/* Page d'accueil. Chargée après style.css et chrome.css, sur l'accueil français et anglais
   seulement : les autres pages gardent leur habit.

   Le fil conducteur est le cahier d'école. Pour un étudiant suisse ou français, la feuille à
   grands carreaux, sa marge rose, le surligneur et les notes griffonnées dans la marge sont
   le décor même des révisions. On s'en sert avec retenue : le haut de page et la courbe,
   pas partout. */

@font-face {
  font-family: Caveat;
  src: url('assets/Caveat.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --ligne: #e2e9f4;
  --ligne-fine: #eff3f9;
  --marge: #f2b3be;
  --surligneur: rgba(255, 219, 77, 0.6);
  --main: Caveat, 'Bradley Hand', 'Segoe Print', cursive;
  --bleu-note: #1e4fc2;
}

/* Feuille Seyès : une ligne fine tous les 2 mm, une ligne franche tous les 8 mm, des
   verticales tous les 8 mm, comme dans un vrai cahier. */
.papier {
  background-color: #fcfdff;
  background-image:
    repeating-linear-gradient(to bottom, transparent 0 31px, var(--ligne) 31px 32px),
    repeating-linear-gradient(to bottom, transparent 0 7px, var(--ligne-fine) 7px 8px),
    repeating-linear-gradient(to right, transparent 0 31px, var(--ligne-fine) 31px 32px);
}

/* ---------------------------------------------------------------- en-tête de page */

.hero {
  position: relative;
  isolation: isolate;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0 calc(50% - 50vw) -40px;
  z-index: -1;
  background-color: #fcfdff;
  background-image:
    linear-gradient(to right, transparent var(--marge-x), var(--marge) var(--marge-x), var(--marge) calc(var(--marge-x) + 2px), transparent calc(var(--marge-x) + 2px)),
    repeating-linear-gradient(to bottom, transparent 0 31px, var(--ligne) 31px 32px),
    repeating-linear-gradient(to bottom, transparent 0 7px, var(--ligne-fine) 7px 8px),
    repeating-linear-gradient(to right, transparent 0 31px, var(--ligne-fine) 31px 32px);
  /* La marge rose se cale à gauche du texte, comme celle du cahier. */
  --marge-x: calc((100vw - min(1240px, 100vw - 96px)) / 2 - 30px);
  -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent);
  mask-image: linear-gradient(to bottom, #000 72%, transparent);
}
.hand-label {
  font-family: var(--main);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--bleu-note);
  transform: rotate(-7deg);
}
.fleche-main {
  position: absolute;
  left: 118px;
  top: 30px;
  width: 92px;
  height: 64px;
  color: var(--bleu-note);
  overflow: visible;
  z-index: 3;
}
.fleche-main path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.art-tag {
  font-family: var(--main);
  font-size: 25px;
  font-weight: 700;
  padding: 6px 18px 8px;
  transform: rotate(-3deg);
}

/* ---------------------------------------------------------------- relire / restituer */

.intro {
  text-align: left;
  max-width: none;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 56px;
  align-items: end;
  padding-block: 120px 96px;
}
.intro h2 {
  margin: 0;
  font-size: clamp(2.5rem, 4.6vw, 4.2rem);
  line-height: 1.04;
  text-wrap: balance;
}
.intro > p:last-child {
  margin: 0;
  font-size: 1.16rem;
  max-width: 32em;
  text-align: left;
}

/* Le surligneur passe sur le mot, une fois, quand on arrive dessus. */
.surligne {
  color: inherit;
  padding: 0 0.06em;
  margin: 0 -0.06em;
  background: linear-gradient(transparent 56%, var(--surligneur) 56% 90%, transparent 90%) no-repeat 0 0 / 0% 100%;
  transition: background-size 0.9s cubic-bezier(0.3, 0.7, 0.2, 1) 0.15s;
}
.surligne.vu,
.sans-js .surligne {
  background-size: 100% 100%;
}

/* ---------------------------------------------------------------- la courbe */

.courbe {
  padding-block: 112px 104px;
  background: #f7f9fc;
  border-block: 1px solid #e6ecf5;
}
.courbe-tete {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 56px;
  align-items: end;
  margin-bottom: 40px;
}
.courbe-tete h2 {
  margin: 0;
  text-wrap: balance;
}
.courbe-tete p {
  margin: 0;
  font-size: 1.08rem;
  color: var(--muted);
  max-width: 34em;
}
.cahier {
  margin: 0;
  padding: 26px 24px 18px;
  border: 1px solid #dfe7f2;
  border-radius: 18px;
  box-shadow: 0 30px 70px -38px rgba(21, 45, 80, 0.35);
  position: relative;
  overflow: hidden;
}
.cahier::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 58px;
  width: 2px;
  background: var(--marge);
  opacity: 0.8;
}
.cahier svg {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.axe {
  font: 700 14px Nunito, system-ui, sans-serif;
  fill: #8a9ab0;
  font-variant-numeric: tabular-nums;
}
.socle {
  stroke: #c9d5e5;
  stroke-width: 1.5;
}
.seuil {
  stroke: #10b981;
  stroke-width: 1.6;
  stroke-dasharray: 5 7;
}
.seuil-texte {
  font: 800 13px Nunito, system-ui, sans-serif;
  fill: #0e9468;
}
.trait {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.trait-sans {
  stroke: #a5b3c6;
  stroke-width: 3;
}
.trait-avec {
  stroke: var(--blue, #3b82f6);
  stroke-width: 4;
}
.rappel {
  fill: #fff;
  stroke: var(--blue, #3b82f6);
  stroke-width: 3;
}
.note text {
  font: 700 27px var(--main);
}
.note.gris {
  color: #64748b;
  fill: #64748b;
}
.note.bleu {
  color: var(--bleu-note);
  fill: var(--bleu-note);
}
.fleche {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.legende {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 30px;
  margin: 14px 4px 0 44px;
  padding: 0;
  list-style: none;
  font-size: 15px;
  font-weight: 700;
}
.legende li {
  display: flex;
  align-items: center;
  gap: 10px;
}
.legende i {
  flex: none;
  width: 26px;
  height: 4px;
  border-radius: 2px;
}
.legende .l-avec i {
  background: var(--blue, #3b82f6);
}
.legende .l-sans i {
  background: #a5b3c6;
}
.legende span {
  font-weight: 600;
  color: var(--muted);
}
.cahier figcaption {
  position: relative;
  margin: 10px 4px 0 44px;
  font-size: 13.5px;
  color: #7c8ba0;
}
.cahier figcaption a {
  font-weight: 800;
  color: var(--ink);
}

/* Le tracé. Sans script, ou avec « Réduire les animations », tout est déjà dessiné. */
.anime .trait {
  transition: stroke-dashoffset 2.4s cubic-bezier(0.45, 0.05, 0.25, 1);
}
.anime .trait-sans {
  transition-duration: 1.6s;
}
.anime .rappel,
.anime .note {
  opacity: 0;
  transition: opacity 0.4s ease;
}
.anime.trace .rappel,
.anime.trace .note {
  opacity: 1;
}

@media (max-width: 720px) {
  .note {
    display: none;
  }
  .cahier {
    padding: 18px 10px 14px;
  }
  .cahier::before {
    left: 34px;
  }
  .legende,
  .cahier figcaption {
    margin-left: 24px;
  }
}

/* ---------------------------------------------------------------- sur quoi ça s'appuie */

.appuis {
  margin-top: 72px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px 40px;
}
.appuis-titre {
  grid-column: 1 / -1;
  margin: 0 0 4px;
  font: 700 34px/1 var(--main);
  color: var(--bleu-note);
  letter-spacing: 0;
  transform: rotate(-1.5deg);
  transform-origin: left;
}
.appui h3 {
  margin: 0 0 10px;
  font-size: 1.28rem;
  letter-spacing: -0.02em;
}
.appui p {
  margin: 0 0 14px;
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--muted);
}
.appui p strong {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.appui .dans {
  color: var(--ink);
  border-left: 2px solid var(--marge);
  padding-left: 14px;
}
.appui a {
  font-size: 14px;
  font-weight: 800;
  text-underline-offset: 4px;
}
.appuis-note {
  grid-column: 1 / -1;
  margin: 18px 0 0;
  font-size: 13.5px;
  color: #7c8ba0;
  max-width: 62em;
}

@media (max-width: 900px) {
  .courbe-tete,
  .intro {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .intro {
    padding-block: 76px 60px;
  }
  .courbe {
    padding-block: 76px 72px;
  }
  .appuis {
    grid-template-columns: 1fr;
    margin-top: 52px;
  }
}

/* ---------------------------------------------------------------- le reste de la page */

/* Les personnages sont détourés : plus besoin de fondre un fond blanc dans la couleur. */
.avatar-paper {
  mix-blend-mode: normal;
}

/* Un fondu plus court et plus discret : l'animation de la page, c'est la courbe. */
.reveal {
  transition: opacity 0.5s var(--sortie), transform 0.5s var(--sortie);
}
.js .reveal:not(.visible) {
  transform: translateY(12px);
}

@media (prefers-reduced-motion: reduce) {
  .surligne {
    transition: none;
    background-size: 100% 100%;
  }
  .anime .trait,
  .anime .rappel,
  .anime .note {
    transition: none;
    opacity: 1;
  }
}

@media (max-width: 760px) {
  .fleche-main {
    display: none;
  }
}

/* La carte verte suit maintenant la section de la courbe, qui a son propre fond : elle a
   besoin de sa respiration à elle. */
.courbe + .companion {
  margin-top: 104px;
}
@media (max-width: 900px) {
  .courbe + .companion {
    margin-top: 64px;
  }
}

/* En face de la formule du modèle, une note de marge : les deux cartes se répondent. */
.note-carte {
  font-family: var(--main);
  font-size: 34px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0;
  color: #0e8a60;
  transform: rotate(-2deg);
  transform-origin: left;
}

/* Sur un téléphone, le dessin est réduit au tiers : le texte et les traits, eux, doivent
   garder une taille lisible. On les grossit dans les unités du dessin. */
@media (max-width: 720px) {
  .axe {
    font-size: 30px;
  }
  .seuil-texte {
    font-size: 28px;
  }
  .trait-avec {
    stroke-width: 8;
  }
  .trait-sans {
    stroke-width: 6;
  }
  .seuil {
    stroke-width: 3;
    stroke-dasharray: 10 12;
  }
  .rappel {
    r: 13px;
    stroke-width: 6;
  }
  .socle {
    stroke-width: 3;
  }
}

@media (max-width: 720px) {
  /* La ligne de base dit déjà zéro, et l'étiquette toucherait « J0 ». */
  .axe-zero {
    display: none;
  }
}
@media (max-width: 760px) {
  /* Sur un téléphone, la marge rose tomberait contre le titre : elle sort de l'écran. */
  .hero::before {
    --marge-x: -20px;
  }
}

@media (max-width: 760px) {
  /* Sur un téléphone, la carte occupe presque toute la largeur : la note passe au-dessus. */
  .hero-art {
    margin-top: 34px;
  }
  .hand-label {
    top: -34px;
    left: 4px;
    z-index: 4;
    font-size: 26px;
  }
}
