/* Une dictée à la mer : site web.
   Habillage « Dictée Déclic » (design-system/project/tokens.json, v5) : papier écolier, encre bleue pour
   écrire, encre rouge pour corriger, boutons posés sur leur tranche, étiquettes à double filet, copie sur
   réglure Seyès. Besley (titres) + Atkinson Hyperlegible (texte), servies depuis /fonts. */

@font-face {
  font-family: "Besley";
  src: url("fonts/Besley-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Besley";
  src: url("fonts/Besley-ExtraBold.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("fonts/AtkinsonHyperlegible-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("fonts/AtkinsonHyperlegible-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;

  --page: #fbfaf6;
  --surface: #ffffff;
  --sunken: #f0eee8;
  --line: #dedad0;
  --line-edge: #c9c4b8;
  --seyes: #c9d3ea;
  --ink: #1e1c2b;
  --ink-edge: #0c0b14;
  --muted: #615e6e;
  --on-fill: #ffffff;

  --ecriture: #24448f;
  --ecriture-edge: #152b61;
  --ecriture-soft: #e4e9f5;
  --correcteur: #b8321f;
  --correcteur-edge: #84210f;
  --correcteur-soft: #fbeae5;
  --juste: #3e8e2f;
  --juste-soft: #e8f3e3;
  --juste-ink: #2e6b24;
  --ia: #0f6e5e;
  --ia-soft: #ddf0eb;
  --attention-soft: #fbf1db;
  --bureau: #d9d3c5;

  --font-titre: "Besley", "Clarendon", Georgia, serif;
  --font-texte: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;

  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 22px;

  --depth-button: 4px;
  --depth-tile: 3px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font-texte);
  font-size: 17px;
  line-height: 1.6;
}

img,
svg {
  max-width: 100%;
  display: block;
}

a {
  color: var(--ecriture);
  text-underline-offset: 3px;
}

:focus-visible {
  outline: 3px solid var(--ecriture);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.wrap {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

.wrap--texte {
  max-width: 780px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--ink);
  color: var(--on-fill);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  z-index: 200;
}
.skip:focus {
  left: 12px;
}

/* ───── Typographie ───── */

h1,
h2,
h3 {
  font-family: var(--font-titre);
  color: var(--ink);
  margin: 0;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.1rem, 5.4vw, 3.4rem);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.01em;
}

h2 {
  font-size: clamp(1.6rem, 3.6vw, 2.1rem);
  line-height: 1.2;
  font-weight: 700;
}

h3 {
  font-size: 1.3rem;
  line-height: 1.25;
  font-weight: 700;
}

p {
  margin: 0 0 1em;
}

.lede {
  font-size: 1.2rem;
  line-height: 1.55;
  color: var(--muted);
  max-width: 34em;
}

.eyebrow {
  display: block;
  margin: 0 0 12px;
  font: 700 12px/16px var(--font-texte);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ecriture);
}
.eyebrow--correcteur {
  color: var(--correcteur);
}
.eyebrow--ia {
  color: var(--ia);
}

.muted {
  color: var(--muted);
}

/* ───── Boutons : des objets posés sur leur tranche ───── */

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 24px;
  margin-bottom: var(--depth-button);
  border: 0;
  border-radius: var(--radius-md);
  background: var(--ecriture);
  box-shadow: 0 var(--depth-button) 0 var(--ecriture-edge);
  color: var(--on-fill);
  font: 700 17px/1 var(--font-texte);
  text-decoration: none;
  cursor: pointer;
  transition: transform 80ms ease-out, box-shadow 80ms ease-out;
}
.btn:active {
  transform: translateY(var(--depth-button));
  box-shadow: none;
}
.btn--correcteur {
  background: var(--correcteur);
  box-shadow: 0 var(--depth-button) 0 var(--correcteur-edge);
}
.btn--secondaire {
  background: var(--surface);
  color: var(--ink);
  border: 2px solid var(--ink);
  box-shadow: 0 var(--depth-tile) 0 var(--ink);
  margin-bottom: var(--depth-tile);
}
.btn--secondaire:active {
  transform: translateY(var(--depth-tile));
}
.btn--compact {
  min-height: 44px;
  padding: 0 18px;
  font-size: 15px;
  box-shadow: 0 3px 0 var(--ecriture-edge);
  margin-bottom: 3px;
}
.btn--compact:active {
  transform: translateY(3px);
}
.btn svg {
  width: 20px;
  height: 20px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 16px;
  margin-top: 28px;
}

/* ───── Cartes ───── */

.carte {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 var(--depth-tile) 0 var(--line-edge);
  padding: 22px 22px 20px;
}
.carte > :last-child {
  margin-bottom: 0;
}
.carte h3 {
  margin-bottom: 8px;
}
.carte p {
  color: var(--muted);
}

.carte--ecriture {
  background: var(--ecriture-soft);
  border-color: var(--ecriture);
  box-shadow: 0 var(--depth-tile) 0 var(--ecriture);
}
.carte--correcteur {
  background: var(--correcteur-soft);
  border-color: var(--correcteur);
  box-shadow: 0 var(--depth-tile) 0 var(--correcteur);
}
.carte--ecriture p,
.carte--correcteur p {
  color: var(--ink);
}

.icone {
  width: 44px;
  height: 44px;
  margin-bottom: 14px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
  background: var(--ecriture);
  color: var(--on-fill);
}
.icone svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icone--correcteur {
  background: var(--correcteur);
}
.icone--ia {
  background: var(--ia);
}
.icone--ink {
  background: var(--ink);
}

/* Étiquette à double filet (réservée aux niveaux) */
.etiquette {
  position: relative;
  display: inline-block;
  padding: 10px 18px;
  border: 2px solid var(--ecriture);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ecriture);
  font: 700 17px/1.2 var(--font-titre);
  text-align: center;
}
.etiquette::after {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid var(--ecriture);
  border-radius: var(--radius-sm);
  pointer-events: none;
}
.etiquette small {
  display: block;
  margin-top: 2px;
  font: 400 14px/1.3 var(--font-texte);
  color: var(--muted);
}

/* ───── En-tête ───── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--page);
  border-bottom: 2px solid var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  font: 800 1.2rem/1.1 var(--font-titre);
}
.brand img {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  box-shadow: 0 3px 0 var(--ecriture-edge);
}
.nav {
  display: flex;
  align-items: center;
  gap: 6px 22px;
}
.nav a:not(.btn) {
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  padding: 10px 2px;
}
.nav a:not(.btn):hover {
  text-decoration: underline;
  text-underline-offset: 6px;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--ecriture);
}

@media (max-width: 760px) {
  .nav a:not(.btn) {
    display: none;
  }
  .brand span {
    font-size: 1.05rem;
  }
}

/* ───── Sections ───── */

section {
  padding: 72px 0;
}
.section-head {
  max-width: 40em;
  margin-bottom: 36px;
}
.section-head p {
  color: var(--muted);
  font-size: 1.1rem;
  margin: 12px 0 0;
}

.grille {
  display: grid;
  gap: 18px;
}
@media (min-width: 720px) {
  .grille--2 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grille--3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ───── Accueil : hero ───── */

.hero {
  padding: 56px 0 72px;
}
.hero .wrap {
  display: grid;
  gap: 48px;
  align-items: center;
}
@media (min-width: 900px) {
  .hero .wrap {
    grid-template-columns: 1.1fr 0.9fr;
    gap: 56px;
  }
}
.hero h1 {
  margin-bottom: 18px;
}
.hero .eyebrow {
  margin-bottom: 16px;
}
.puces {
  list-style: none;
  padding: 0;
  margin: 26px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
}
.puces li {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  background: var(--sunken);
  color: var(--ink);
  font-weight: 700;
  font-size: 15px;
}

/* La copie : réglure Seyès, marge rouge */

.bureau {
  background: var(--bureau);
  border-radius: var(--radius-lg);
  padding: 22px 18px 26px;
  transform: rotate(0.6deg);
}
.copie {
  position: relative;
  background-color: var(--surface);
  background-image:
    linear-gradient(to bottom, transparent 39px, var(--seyes) 39px 40px),
    linear-gradient(to bottom, transparent 9px, rgba(201, 211, 234, 0.55) 9px 10px);
  background-size: 100% 40px, 100% 10px;
  background-position: 0 14px, 0 14px;
  border-radius: var(--radius-md);
  box-shadow: 0 6px 18px rgba(30, 28, 43, 0.16);
  padding: 14px 18px 22px 58px;
  font-size: 1.25rem;
  line-height: 40px;
}
.copie::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 44px;
  width: 2px;
  background: var(--correcteur);
}
.copie .marge {
  position: absolute;
  left: 8px;
  top: 14px;
  width: 30px;
  text-align: center;
  font: 800 1.1rem/40px var(--font-titre);
  color: var(--correcteur);
}
.copie p {
  margin: 0;
}
.copie .titre-dictee {
  font-weight: 700;
}
.mot-faux {
  position: relative;
  text-decoration: line-through;
  text-decoration-color: var(--correcteur);
  text-decoration-thickness: 2px;
  background: var(--correcteur-soft);
  border-radius: 3px;
}
.mot-juste {
  position: relative;
  color: var(--correcteur);
  font-weight: 700;
}
.mot-juste::before {
  content: attr(data-n);
  position: absolute;
  top: -15px;
  left: -14px;
  width: 20px;
  height: 20px;
  border: 2px solid var(--correcteur);
  border-radius: 50%;
  background: var(--surface);
  font: 700 11px/16px var(--font-texte);
  text-align: center;
  color: var(--correcteur);
}
.note-copie {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
  line-height: 1.2;
}
.note-copie .eyebrow {
  margin: 0;
  color: var(--correcteur);
}
.note {
  font: 800 2.2rem/1 var(--font-titre);
  color: var(--correcteur);
  border-bottom: 5px double var(--correcteur);
  padding-bottom: 2px;
}
.bureau .verdict {
  margin: 16px 6px 0;
  padding: 12px 14px;
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 2px solid var(--line);
  box-shadow: 0 var(--depth-tile) 0 var(--line-edge);
  font-size: 15px;
  line-height: 1.45;
}
.bureau .verdict strong {
  color: var(--ia);
}

/* ───── Étapes ───── */

.etapes {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 18px;
  counter-reset: etape;
}
@media (min-width: 720px) {
  .etapes {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1000px) {
  .etapes {
    grid-template-columns: repeat(4, 1fr);
  }
}
.etapes li {
  counter-increment: etape;
}
.etapes li::before {
  content: counter(etape);
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-bottom: 14px;
  border: 2px solid var(--ecriture);
  border-radius: 50%;
  color: var(--ecriture);
  background: var(--surface);
  font: 800 1.1rem/1 var(--font-titre);
}
.etapes h3 {
  font-size: 1.2rem;
  margin-bottom: 6px;
}
.etapes p {
  color: var(--muted);
  margin: 0;
}

.bande {
  background: var(--surface);
  border-top: 2px solid var(--line);
  border-bottom: 2px solid var(--line);
}

/* ───── Niveaux ───── */

.chemin {
  display: grid;
  gap: 14px;
  align-items: stretch;
}
@media (min-width: 760px) {
  .chemin {
    grid-template-columns: repeat(4, 1fr);
  }
}
.chemin .etiquette {
  width: 100%;
}
.pont {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 26px;
  padding: 16px 18px;
  border: 2px dashed var(--line-edge);
  border-radius: var(--radius-lg);
  background: var(--page);
}
.pont svg {
  flex: none;
  width: 28px;
  height: 28px;
  fill: none;
  stroke: var(--ecriture);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pont p {
  margin: 0;
}

/* ───── Confiance ───── */

.liste-coche {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}
.liste-coche li {
  position: relative;
  padding-left: 34px;
}
.liste-coche li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--juste);
}
.liste-coche li::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 10px;
  width: 8px;
  height: 4px;
  border-left: 2.5px solid #fff;
  border-bottom: 2.5px solid #fff;
  transform: rotate(-45deg);
}

.cta {
  background: var(--ecriture);
  color: var(--on-fill);
  border-radius: var(--radius-xl);
  box-shadow: 0 var(--depth-button) 0 var(--ecriture-edge);
  padding: 48px 28px;
  text-align: center;
}
.cta h2 {
  color: var(--on-fill);
  margin-bottom: 12px;
}
.cta p {
  max-width: 32em;
  margin: 0 auto 8px;
}
.cta .btn {
  background: var(--surface);
  color: var(--ecriture);
  box-shadow: 0 var(--depth-button) 0 var(--seyes);
  margin-top: 18px;
}

/* ───── Pied de page ───── */

.site-footer {
  border-top: 2px solid var(--line);
  padding: 44px 0 36px;
  color: var(--muted);
  font-size: 15px;
}
.site-footer .wrap {
  display: grid;
  gap: 28px;
}
@media (min-width: 760px) {
  .site-footer .wrap {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
}
.site-footer h4 {
  margin: 0 0 10px;
  font: 700 12px/16px var(--font-texte);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
}
.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-footer li {
  margin-bottom: 6px;
}
.site-footer a {
  color: var(--muted);
}
.site-footer a:hover {
  color: var(--ecriture);
}
.site-footer .brand {
  margin-bottom: 12px;
}
.copyright {
  grid-column: 1 / -1;
  border-top: 2px solid var(--line);
  padding-top: 20px;
  margin: 0;
}

/* ───── Pages de texte (confidentialité, suppression) ───── */

.page-texte {
  padding: 32px 0 80px;
}
.retour {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 28px;
  font-weight: 700;
  color: var(--ecriture);
}
.page-entete {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 8px;
}
.page-entete h1 {
  font-size: clamp(1.9rem, 4.6vw, 2.6rem);
}
.app-name {
  margin: 8px 0 0;
}

/* Sélecteur de langue : le rail du sélecteur de mode */
.langue {
  display: inline-flex;
  padding: 4px;
  gap: 4px;
  background: var(--sunken);
  border-radius: var(--radius-md);
}
.langue button {
  appearance: none;
  border: 0;
  min-height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink);
  font: 700 15px/1 var(--font-texte);
  cursor: pointer;
}
.langue button.active {
  background: var(--ecriture);
  color: var(--on-fill);
  box-shadow: 0 3px 0 var(--ecriture-edge);
}

.langue-section {
  display: none;
}
.langue-section.active {
  display: block;
}

.maj {
  color: var(--muted);
  font-size: 15px;
  margin: 18px 0 28px;
}

.en-bref {
  margin: 0 0 12px;
}
.en-bref h2 {
  font-size: 1.35rem;
  margin-bottom: 12px;
}
.en-bref ul {
  margin: 0;
  padding-left: 1.2em;
}
.en-bref li {
  margin-bottom: 6px;
}

.bloc {
  margin-top: 44px;
}
.bloc h2 {
  font-size: 1.6rem;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--line);
}
.bloc h3 {
  font-family: var(--font-texte);
  font-size: 1.05rem;
  font-weight: 700;
  margin: 24px 0 8px;
}
.bloc ul,
.bloc ol {
  padding-left: 1.3em;
  margin: 0 0 1em;
}
.bloc li {
  margin-bottom: 6px;
}
.bloc li::marker {
  color: var(--ecriture);
}

.page-texte .carte {
  margin: 22px 0;
}
.page-texte .carte h2 {
  font-size: 1.4rem;
  margin: 0 0 10px;
}
.tag {
  display: inline-block;
  margin-bottom: 10px;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  background: var(--ecriture-soft);
  color: var(--ecriture);
  font: 700 12px/16px var(--font-texte);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* Tableau des services : des lignes réglées sur grand écran, des fiches sur mobile */
.services {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 var(--depth-tile) 0 var(--line-edge);
  overflow: hidden;
  margin: 18px 0;
  font-size: 15px;
  line-height: 1.5;
}
.services th,
.services td {
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 2px solid var(--sunken);
}
.services thead th {
  background: var(--sunken);
  font: 700 12px/16px var(--font-texte);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.services tbody tr:last-child td {
  border-bottom: 0;
}
.services td:first-child {
  font-weight: 700;
  white-space: nowrap;
}
@media (max-width: 719px) {
  .services,
  .services tbody,
  .services tr,
  .services td {
    display: block;
    width: 100%;
  }
  .services thead {
    display: none;
  }
  .services tr {
    padding: 8px 0;
    border-bottom: 2px solid var(--sunken);
  }
  .services tr:last-child {
    border-bottom: 0;
  }
  .services td {
    border: 0;
    padding: 4px 14px;
  }
  .services td:first-child {
    font-size: 1.05rem;
    white-space: normal;
  }
  .services td[data-label]::before {
    content: attr(data-label) " : ";
    font-weight: 700;
    color: var(--muted);
  }
}

.mail {
  font-weight: 700;
  word-break: break-word;
}

@media (max-width: 520px) {
  section {
    padding: 52px 0;
  }
  .hero {
    padding: 36px 0 52px;
  }
  .copie {
    font-size: 1.1rem;
    padding-left: 54px;
  }
  .copie::before {
    left: 40px;
  }
}
