/* Une planche : des cases bordées d'encre, séparées par des gouttières. La première case
   reprend l'icône à l'échelle de la page : bulle anglaise derrière, bulle française devant. */
:root {
  --encre: #17102e;
  --papier: #efedf8;
  --blanc: #ffffff;
  --violet: #4b23d6;
  --violet-clair: #8a5bff;
  --nuit: #2a1580;
  --jaune: #ffd23f;
  --lavande: #d9d2f5;
  --gris: #57507a;

  --titre: "Dela Gothic One", "Arial Black", Impact, sans-serif;
  --texte: "M PLUS Rounded 1c", "Segoe UI", system-ui, sans-serif;
  --bd: "Comic Neue", "Comic Sans MS", cursive;

  --trait: 4px;
  --gouttiere: clamp(10px, 1.4vw, 18px);
  --marge: clamp(16px, 4vw, 40px);
  color-scheme: light;
}

@font-face { font-family: "Dela Gothic One"; src: url("polices/dela-gothic-one.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "M PLUS Rounded 1c"; src: url("polices/m-plus-rounded-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "M PLUS Rounded 1c"; src: url("polices/m-plus-rounded-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "M PLUS Rounded 1c"; src: url("polices/m-plus-rounded-800.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Comic Neue"; src: url("polices/comic-neue-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 16px; -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--papier); color: var(--encre); font: 400 1.0625rem/1.65 var(--texte); }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--violet); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--titre); font-weight: 400; line-height: 1.15; text-wrap: balance; margin: 0; }
h2 { font-size: clamp(1.35rem, 2.4vw, 1.85rem); }
h3 { font-size: 1.15rem; line-height: 1.35; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 3px; }

.masque { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.evitement { position: absolute; left: 12px; top: -60px; z-index: 5; background: var(--jaune); color: var(--encre); padding: 10px 16px; font-weight: 700; }
.evitement:focus { top: 12px; }

/* --- En-tête --- */
.entete { width: 100%; max-width: 1240px; margin-inline: auto; padding: 16px var(--marge); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 28px; }
.marque { display: inline-flex; align-items: center; gap: 10px; color: var(--encre); text-decoration: none; font: 400 1.5rem/1 var(--titre); }
.entete nav { display: flex; flex-wrap: wrap; gap: 2px 22px; }
.entete nav a { color: var(--encre); font-weight: 700; text-decoration: none; padding-block: 6px; border-bottom: 3px solid transparent; }
.entete nav a:hover { border-color: var(--jaune); }

/* --- La planche --- */
.planche { width: 100%; max-width: 1240px; margin-inline: auto; padding: 0 var(--marge) clamp(28px, 5vw, 56px); display: grid; gap: var(--gouttiere); }
.rangee { display: grid; gap: var(--gouttiere); }
.case { background: var(--blanc); border: var(--trait) solid var(--encre); padding: clamp(20px, 3vw, 36px); min-width: 0; }
.case > * + * { margin-top: 0.9em; }

/* --- Bulles --- */
.bulle { position: relative; border: var(--trait) solid var(--encre); border-radius: 46% 54% 50% 50% / 58% 56% 44% 42%; }
/* La queue : un triangle d'encre derrière la bulle, un triangle de sa couleur devant */
.dialogue, .contact, .erreur { isolation: isolate; }
.bulle::before, .bulle::after { content: ""; position: absolute; clip-path: polygon(0 0, 100% 0, 86% 100%); }
.bulle::before { z-index: -1; width: 54px; height: 64px; bottom: -34px; background: var(--encre); }
.bulle::after { width: 38px; height: 54px; bottom: -22px; background: inherit; }

/* --- Case 1 : le titre --- */
.heros {
  position: relative; overflow: hidden; color: var(--blanc);
  background: linear-gradient(135deg, var(--violet-clair), var(--violet) 62%);
  display: grid; gap: clamp(28px, 4vw, 48px); align-items: center;
  padding-block: clamp(28px, 4.5vw, 56px) clamp(36px, 5vw, 64px);
}
.heros::before { /* trame de points, qui s'efface en diagonale comme sur l'icône */
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle, rgb(255 255 255 / 0.2) 3.2px, transparent 3.8px) 0 0 / 22px 22px, radial-gradient(circle, rgb(255 255 255 / 0.2) 3.2px, transparent 3.8px) 11px 11px / 22px 22px;
  -webkit-mask-image: linear-gradient(35deg, #000, transparent 58%); mask-image: linear-gradient(35deg, #000, transparent 58%);
}
.heros > * { position: relative; margin: 0; }
.dialogue { display: grid; justify-items: start; }
.bulle-en { background: var(--lavande); color: var(--gris); font: 700 clamp(0.95rem, 1.5vw, 1.2rem)/1.3 var(--bd); text-align: center; padding: 1.5em 2.6em 2.1em; max-width: 19em; }
.bulle-en::before, .bulle-en::after { clip-path: polygon(0 0, 100% 0, 14% 100%); }
.bulle-en::before { left: calc(16% - 9px); bottom: -22px; }
.bulle-en::after { left: 16%; bottom: -10px; height: 42px; }
.bulle-fr { background: var(--jaune); color: var(--nuit); font-size: clamp(1.5rem, 3.3vw, 2.65rem); line-height: 1.2; text-align: center; padding: 1.15em 1.25em; margin: -1.1rem 0 0 clamp(0px, 4vw, 64px); max-width: 15.5em; }
.bulle-fr::before { right: calc(19% - 9px); }
.bulle-fr::after { right: 19%; }
.accroche { display: grid; gap: 1.4em; font-size: clamp(1.05rem, 1.5vw, 1.2rem); max-width: 34em; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* --- Boutons --- */
.bouton { display: inline-block; font: 800 1rem/1.2 var(--texte); padding: 0.85em 1.3em; border: var(--trait) solid var(--encre); background: var(--jaune); color: var(--encre); text-decoration: none; cursor: pointer; }
a.bouton:hover, button.bouton:hover { background: var(--encre); color: var(--jaune); }
.bouton-clair { background: var(--blanc); }
.heros .bouton:focus-visible { outline-color: var(--blanc); }

/* --- Case 2 : avant / après --- */
.exemple { padding: 0; background: var(--encre); }
.exemple figure { margin: 0; }
.compare { --pos: 51.5%; position: relative; overflow: hidden; }
.compare img { width: 100%; }
.compare .dessus { position: absolute; inset: 0; height: 100%; clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.compare input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; touch-action: pan-y; }
.poignee { position: absolute; inset-block: 0; left: var(--pos); width: 4px; margin-left: -2px; background: var(--encre); pointer-events: none; }
.poignee::after { content: "⇆"; position: absolute; top: 50%; left: 50%; width: 48px; height: 48px; margin: -24px 0 0 -24px; display: grid; place-items: center; font: 800 1.25rem/1 var(--texte); background: var(--jaune); color: var(--encre); border: var(--trait) solid var(--encre); border-radius: 50%; }
.compare:focus-within .poignee::after { outline: 3px solid var(--blanc); outline-offset: 2px; }
.langue { position: absolute; bottom: 14px; padding: 0.2em 0.75em 0.3em; border: 3px solid var(--encre); border-radius: 999px; font: 400 1.05rem/1.3 var(--titre); pointer-events: none; }
.langue-en { left: 14px; background: var(--lavande); color: var(--gris); }
.langue-fr { right: 14px; background: var(--jaune); color: var(--nuit); }
figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 28px; padding: 12px clamp(16px, 2vw, 24px); color: var(--lavande); font-size: 0.9rem; line-height: 1.5; }
figcaption a { color: var(--jaune); }

/* --- Étapes --- */
.etape { display: grid; grid-template-columns: auto 1fr; column-gap: 16px; align-content: start; align-items: center; }
.etape > * { margin: 0; }
.etape p { grid-column: 1 / -1; margin-top: 0.8em; }
.numero { font: 400 2.6rem/1 var(--titre); color: var(--violet); }
.etape h2 { font-size: 1.25rem; }

/* --- Le projet --- */
.recit { max-width: none; }
.recit p, .recit h3 { max-width: 36em; }
.recit .chapeau { font-size: clamp(1.15rem, 1.9vw, 1.4rem); line-height: 1.5; font-weight: 700; color: var(--violet); text-wrap: pretty; }
.recit h3 { margin-top: 1.5em; }
.fiche { background: var(--nuit); color: var(--blanc); }
.fiche dl { margin: 1.1em 0 0; display: grid; gap: 14px; }
.fiche dt { font-weight: 800; color: var(--jaune); font-size: 0.95rem; }
.fiche dd { margin: 0; line-height: 1.5; }

/* --- Contact et installation --- */
.contact { background: var(--lavande); }
.contact p, .installer p { max-width: 32em; }
.bulle-mail { background: var(--blanc); display: inline-block; padding: 1em 1.9em 1.15em; margin-bottom: 14px; max-width: 100%; }
.bulle-mail::before { right: calc(20% - 8px); width: 40px; height: 48px; bottom: -22px; }
.bulle-mail::after { right: 20%; width: 26px; height: 30px; bottom: -12px; }
.bulle-mail a { position: relative; z-index: 1; font: 700 clamp(1.1rem, 2.4vw, 1.5rem)/1.2 var(--bd); color: var(--encre); overflow-wrap: anywhere; }
.installer { background: var(--jaune); }
.installer .bouton { background: var(--blanc); }
.installer .petit { font-size: 0.92rem; opacity: 0.8; }

/* --- Questions --- */
.liste-questions { display: grid; align-items: start; gap: 0 clamp(28px, 4vw, 56px); }
details { border-bottom: 2px solid var(--lavande); }
summary { cursor: pointer; font-weight: 800; padding: 0.95em 34px 0.95em 0; position: relative; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 4px; top: 0.55em; font: 400 1.4rem/1.4 var(--titre); color: var(--violet); }
details[open] summary::after { content: "–"; }
details p { padding-bottom: 1.1em; max-width: 60ch; }

/* --- Pied de page --- */
.pied { margin-top: auto; background: var(--encre); color: var(--lavande); font-size: 0.95rem; }
.pied-grille { max-width: 1240px; margin-inline: auto; padding: clamp(28px, 4vw, 48px) var(--marge) 24px; display: grid; gap: 28px; }
.pied h2 { font: 800 0.95rem/1.4 var(--texte); color: var(--jaune); margin-bottom: 6px; }
.pied p + p { margin-top: 6px; }
.pied ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pied a { color: var(--blanc); }
.pied :focus-visible { outline-color: var(--jaune); }
.pied-marque { display: flex; align-items: center; gap: 10px; font: 400 1.25rem/1 var(--titre); color: var(--blanc); margin-bottom: 10px; }
.pied-bas { max-width: 1240px; margin-inline: auto; padding: 16px var(--marge) 28px; font-size: 0.85rem; }

/* --- Pages de texte (confidentialité, mentions légales, erreur) --- */
.page .planche { max-width: 900px; }
.texte h1 { font-size: clamp(1.6rem, 3.6vw, 2.4rem); }
.texte h2 { font-size: 1.3rem; margin-top: 1.9em; scroll-margin-top: 16px; }
.texte ul { margin: 0.9em 0 0; padding-left: 1.3em; display: grid; gap: 0.45em; }
.texte p, .texte li { max-width: 68ch; }
.texte .date { color: var(--gris); }
.tableau { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: 0.97rem; line-height: 1.5; }
th, td { text-align: left; vertical-align: top; padding: 10px 14px; border: 2px solid var(--encre); }
th { background: var(--lavande); }
code { font-size: 0.92em; background: var(--papier); padding: 0.1em 0.35em; overflow-wrap: anywhere; }
.erreur { text-align: center; display: grid; justify-items: center; gap: 28px; background: var(--lavande); padding-block: 64px; }
.erreur > * { margin: 0; }

@media (max-width: 719px) {
  /* Petit écran : on cadre sur les bulles de droite, pour qu'elles restent lisibles */
  .compare img { aspect-ratio: 4 / 5; height: auto; object-fit: cover; object-position: 100% 0; }
  .compare .dessus { height: 100%; }
}
@media (min-width: 720px) {
  .trois { grid-template-columns: repeat(3, 1fr); }
  .deux { grid-template-columns: 1fr 1fr; }
  .liste-questions { grid-template-columns: 1fr 1fr; }
  .pied-grille { grid-template-columns: 1.3fr 1.2fr 1fr 1fr; }
}
@media (min-width: 900px) {
  .heros { grid-template-columns: 1.25fr 1fr; }
  .projet { grid-template-columns: 1.85fr 1fr; }
}
@media (max-width: 480px) {
  .bulle-en { padding-inline: 1.9em; }
  .bulle-en::after { height: 34px; }
  .bulle-fr { padding-inline: 1em; }
  .langue { bottom: 8px; font-size: 0.85rem; }
  .langue-en { left: 8px; }
  .langue-fr { right: 8px; }
  .poignee::after { width: 40px; height: 40px; margin: -20px 0 0 -20px; font-size: 1rem; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
