/* Site de Cyrille de Gourcy — charte « pétrole et or » : bandeau pétrole avec portrait cerclé d'or,
   sections claires, fiches de projets ; version nuit selon le réglage de l'appareil.
   Une seule police, Hanken Grotesk (400, 600, 800), auto-hébergée. */

@font-face {
  font-family: "Hanken Grotesk";
  src: url("../fonts/hanken-grotesk-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("../fonts/hanken-grotesk-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("../fonts/hanken-grotesk-latin-800-normal.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

/* Rôles des couleurs : fond, surface (cartes), texte, texte secondaire, filet, accent (liens, titres),
   puis bandeau pétrole, or, fond teinté (encart Adjuvans) et fond alterné (projets). */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --fg: #17262c;
  --muted: #4b5c63;
  --line: #d5e0e3;
  --accent: #13495b;
  --heading: #13495b;
  --band: #13495b;
  --band-fg: #ffffff;
  --band-muted: #ddeaee;
  --gold: #ddb552;
  --on-gold: #0a2f3b;
  --tint: #dcebef;
  --alt: #f2f7f8;
  --image-filter: none;
  --mark: #fbf1d6;
  --sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --step--1: 0.9375rem;
  --step-0: 1.125rem;
  --step-1: 1.375rem;
  --step-2: clamp(1.85rem, 1.5rem + 1.4vw, 2.5rem);
  --step-4: clamp(2.75rem, 1.9rem + 3.6vw, 4.25rem);
  --radius: 1rem;
  color-scheme: light;
}
/* Version nuit du système, sauf si le visiteur a choisi « Clair » dans la console d'accessibilité. */
@media (prefers-color-scheme: dark) {
  :root:not([data-a11y-contraste="clair"]) {
    --bg: #0b1a20;
    --surface: #16323b;
    --fg: #e4eef1;
    --muted: #a3b8bf;
    --line: #2a4a54;
    --accent: #8ccbd6;
    --heading: #9ad3dd;
    --band: #123e4c;
    --band-fg: #ffffff;
    --band-muted: #d3e3e8;
    --gold: #e2be5e;
    --on-gold: #0a2f3b;
    --tint: #17414e;
    --alt: #0f242b;
    --image-filter: brightness(0.92);
    --mark: #3a3010;
    color-scheme: dark;
  }
}
/* Console d'accessibilité : thèmes forcés (Sombre, Clair) et contraste renforcé (≥ 7:1), qui suit le thème du
   système. Sans choix, « contraste élevé » du système applique le renforcé. Chaque palette redéfinit toutes les
   couleurs, car elle s'applique par-dessus la version nuit. */
:root[data-a11y-contraste="sombre"] {
  --bg: #0b1a20;
  --surface: #16323b;
  --fg: #e4eef1;
  --muted: #a3b8bf;
  --line: #2a4a54;
  --accent: #8ccbd6;
  --heading: #9ad3dd;
  --band: #123e4c;
  --band-fg: #ffffff;
  --band-muted: #d3e3e8;
  --gold: #e2be5e;
  --on-gold: #0a2f3b;
  --tint: #17414e;
  --alt: #0f242b;
  --image-filter: brightness(0.92);
  --mark: #3a3010;
  color-scheme: dark;
}
:root[data-a11y-contraste="clair"] { color-scheme: light; }
:root[data-a11y-contraste="renforce"] {
  --bg: #ffffff;
  --surface: #ffffff;
  --fg: #000000;
  --muted: #1f2d33;
  --line: #5d6f76;
  --accent: #0a3442;
  --heading: #0a3442;
  --band: #0a3442;
  --band-fg: #ffffff;
  --band-muted: #ffffff;
  --gold: #e2be5e;
  --on-gold: #000000;
  --tint: #e6f0f2;
  --alt: #f4f8f9;
  --image-filter: none;
  --mark: #fbf1d6;
  color-scheme: light;
}
@media (prefers-contrast: more) {
  :root:not([data-a11y-contraste]) {
    --bg: #ffffff;
    --surface: #ffffff;
    --fg: #000000;
    --muted: #1f2d33;
    --line: #5d6f76;
    --accent: #0a3442;
    --heading: #0a3442;
    --band: #0a3442;
    --band-fg: #ffffff;
    --band-muted: #ffffff;
    --gold: #e2be5e;
    --on-gold: #000000;
    --tint: #e6f0f2;
    --alt: #f4f8f9;
    --image-filter: none;
    --mark: #fbf1d6;
    color-scheme: light;
  }
}
@media (prefers-color-scheme: dark) {
  :root[data-a11y-contraste="renforce"] {
    --bg: #000000;
    --surface: #0b1a20;
    --fg: #ffffff;
    --muted: #d8e6ea;
    --line: #8aa3ab;
    --accent: #b5e4ec;
    --heading: #c4ecf2;
    --band: #0b1a20;
    --band-fg: #ffffff;
    --band-muted: #ffffff;
    --gold: #f0cd6e;
    --on-gold: #000000;
    --tint: #0f2a33;
    --alt: #050f13;
    --image-filter: none;
    --mark: #3a3010;
    color-scheme: dark;
  }
}
@media (prefers-contrast: more) and (prefers-color-scheme: dark) {
  :root:not([data-a11y-contraste]) {
    --bg: #000000;
    --surface: #0b1a20;
    --fg: #ffffff;
    --muted: #d8e6ea;
    --line: #8aa3ab;
    --accent: #b5e4ec;
    --heading: #c4ecf2;
    --band: #0b1a20;
    --band-fg: #ffffff;
    --band-muted: #ffffff;
    --gold: #f0cd6e;
    --on-gold: #000000;
    --tint: #0f2a33;
    --alt: #050f13;
    --image-filter: none;
    --mark: #3a3010;
    color-scheme: dark;
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 var(--step-0) / 1.6 var(--sans);
  text-rendering: optimizeLegibility;
}
h1, h2, h3 { text-wrap: balance; }
p, li { text-wrap: pretty; }
img { max-width: 100%; }
a { color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 0.2em; }
a:hover { color: var(--fg); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 2px; }
main:focus { outline: none; }
a[rel~="noopener"]::after { content: "\2197" / ""; font-size: 0.8em; margin-left: 0.2em; }

[hidden] { display: none !important; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 30;
  background: var(--gold); color: var(--on-gold); font-weight: 800;
  padding: 0.6rem 1rem; border-radius: 999px; text-decoration: none;
}
.skip:focus { top: 1rem; }

.wrap {
  max-width: 67.5rem;
  margin-inline: auto;
  padding-inline: max(1.25rem, env(safe-area-inset-left)) max(1.25rem, env(safe-area-inset-right));
}
/* Un .wrap imbriqué dans un autre ne rajoute pas de marges. */
.wrap .wrap { padding-inline: 0; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  min-height: 3rem; padding: 0 1.5rem;
  border-radius: 999px; border: 2px solid transparent;
  font-weight: 800; line-height: 1.2; text-align: center; text-decoration: none;
}
.btn-gold { background: var(--gold); color: var(--on-gold); }
.btn-gold:hover { color: var(--on-gold); background: color-mix(in srgb, var(--gold) 85%, #ffffff); }
.btn-ghost { border-color: var(--band-fg); color: var(--band-fg); font-weight: 600; }
.btn-ghost:hover { color: var(--band); background: var(--band-fg); }
.btn-band { background: var(--band); color: var(--band-fg); }
.btn-band:hover { color: var(--band-fg); background: color-mix(in srgb, var(--band) 85%, #000000); }
.btn-small { min-height: 2.75rem; padding: 0 1.1rem; font-size: var(--step--1); }
.btn:focus-visible { outline-color: var(--gold); }

/* ---------- Accueil : navigation et bandeau ---------- */
.sections {
  position: sticky; top: 0; z-index: 10;
  background: var(--band);
  border-bottom: 1px solid color-mix(in srgb, var(--band-fg) 14%, transparent);
}
.sections ul {
  list-style: none; margin-block: 0;
  display: flex; gap: 0 1.5rem; overflow-x: auto; scrollbar-width: none;
}
.sections a {
  display: inline-flex; align-items: center; min-height: 3rem; white-space: nowrap;
  color: var(--band-muted); font-weight: 600; font-size: var(--step--1); text-decoration: none;
  border-bottom: 3px solid transparent;
}
.sections a:hover { color: var(--band-fg); }
.sections a[aria-current="true"] { color: var(--band-fg); border-bottom-color: var(--gold); }

.hero { background: var(--band); color: var(--band-fg); padding-block: 3.5rem 4.5rem; }
.hero-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 2rem 4rem; }
.portrait {
  width: 7.5rem; height: 7.5rem; flex: none;
  border-radius: 50%; object-fit: cover;
  border: 5px solid var(--gold);
  background: var(--band-muted); /* pendant le chargement */
}
.hero-text { flex: 999 1 28rem; min-width: 0; }
.role { margin: 0 0 0.4rem; color: var(--gold); font-weight: 600; font-size: var(--step-0); }
.name { margin: 0; font-weight: 800; font-size: var(--step-4); line-height: 1.02; letter-spacing: -0.02em; }
.pitch {
  margin: 1.25rem 0 0; max-width: 30em;
  color: var(--band-muted); font-size: clamp(1.2rem, 1.05rem + 0.6vw, 1.45rem); line-height: 1.45;
}
.actions { margin: 2rem 0 0; display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; }

/* ---------- Sections ---------- */
.section { padding-block: 4.5rem; scroll-margin-top: 3rem; }
.section-tight { padding-top: 0; }
.section-alt { background: var(--alt); }
.section-title {
  margin: 0 0 1rem; color: var(--heading);
  font-weight: 800; font-size: var(--step-2); line-height: 1.15; letter-spacing: -0.015em;
}
.section-intro { margin: 0 0 2.25rem; max-width: 38em; font-size: 1.25rem; }

.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose p, .prose ul, .prose ol { margin: 0 0 1em; max-width: 65ch; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li + li { margin-top: 0.35em; }
.prose h2 { font-weight: 800; font-size: var(--step-1); line-height: 1.25; margin: 2rem 0 0.75rem; color: var(--heading); }
.prose h3 { font-weight: 800; font-size: var(--step-0); line-height: 1.3; margin: 1.5rem 0 0.5rem; }
.prose strong { font-weight: 800; }

/* À propos : le premier paragraphe en chapeau, la liste des activités en grille. */
.about > p:first-child { font-size: 1.25rem; line-height: 1.5; max-width: 38em; }
.about ul {
  list-style: none; padding: 0; margin-top: 2.25rem; max-width: none;
  display: grid; gap: 2rem 3rem;
}
@media (min-width: 40rem) { .about ul { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.about li + li { margin-top: 0; }
.about li::before {
  content: ""; display: block; width: 2.5rem; height: 4px; margin-bottom: 0.9rem;
  border-radius: 2px; background: var(--gold);
}
.about li strong { color: var(--heading); }

.company {
  display: flex; flex-wrap: wrap; align-items: center; gap: 2rem 4rem;
  padding: clamp(1.5rem, 4vw, 3rem);
  border-radius: 1.5rem; background: var(--tint);
}
.company-name { margin: 0; flex: 0 1 auto; min-width: 0; font-weight: 800; font-size: var(--step-2); color: var(--heading); }
.company-name img { display: block; height: 3.5rem; width: auto; max-width: 100%; object-fit: contain; object-position: left; }
.company-text { flex: 999 1 26rem; min-width: 0; }
.company-pitch { margin: 0 0 0.75rem; color: var(--heading); font-weight: 800; font-size: var(--step-1); line-height: 1.3; }
.more { margin: 1.25rem 0 0; font-weight: 800; }

/* ---------- Projets ---------- */
.projects { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.5rem; }
.project {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border-radius: var(--radius);
}
.project picture, .project img { display: block; }
.project img { width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover; filter: var(--image-filter); }
.project-body { padding: 1.4rem 1.6rem 1.6rem; }
.project .year { margin: 0 0 0.25rem; color: var(--muted); font-size: var(--step--1); font-weight: 600; font-variant-numeric: tabular-nums; }
.project h3 { margin: 0 0 0.4rem; font-weight: 800; font-size: var(--step-1); line-height: 1.25; }
.project h3 a { color: var(--heading); text-decoration: none; }
.project h3 a:hover { text-decoration: underline; }
.project p { margin: 0; }
.tags { list-style: none; margin: 0.75rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 0.4rem; color: var(--muted); font-size: var(--step--1); }
.tags li:not(:last-child)::after { content: ","; }

@media (min-width: 48rem) {
  .projects { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .project { grid-column: span 2; }
  .project.has-image { grid-column: span 3; }
  .hero { padding-block: 5rem 5.5rem; }
  .portrait { width: 12.5rem; height: 12.5rem; border-width: 6px; }
}

/* ---------- Contact ---------- */
.contact { background: var(--band); color: var(--band-fg); }
.contact .section-title { color: var(--band-fg); }
.contact-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem 3rem; }
.contact-text { flex: 999 1 26rem; }
.contact-text p { margin: 0; color: var(--band-muted); font-size: 1.25rem; }
.contact-line { margin: 0; flex: 1 1 16rem; display: flex; justify-content: flex-end; }
.contact-line .btn { max-width: 100%; overflow-wrap: anywhere; }
.social { list-style: none; margin: 1.25rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 1.5rem; }
.social a { display: inline-flex; align-items: center; min-height: 2.75rem; color: var(--band-fg); font-weight: 600; }
.social a:hover { color: var(--gold); }

@media (max-width: 30rem) {
  .actions .btn, .contact-line .btn { width: 100%; }
  .contact-line { justify-content: stretch; }
}

/* ---------- Pages simples et pages de projet ---------- */
.topbar { position: sticky; top: 0; z-index: 10; background: var(--band); color: var(--band-fg); }
/* Les ancres des pages intérieures ne passent pas sous la barre collante. */
.page-main [id] { scroll-margin-top: 5.5rem; }
.topbar-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1.5rem; min-height: 4.25rem; }
.back { display: inline-flex; align-items: center; min-height: 2.75rem; color: var(--band-fg); font-weight: 800; font-size: var(--step-0); text-decoration: none; }
.back:hover { color: var(--gold); }
.page { padding-block: 3rem 4.5rem; max-width: 46rem; margin-inline: auto; }
.page-title {
  margin: 0 0 0.75rem; color: var(--heading);
  font-weight: 800; font-size: var(--step-4); line-height: 1.04; letter-spacing: -0.02em;
}
.page-meta { color: var(--muted); margin: 0 0 2rem; font-variant-numeric: tabular-nums; }
.page .prose { margin-top: 1.5rem; }

.project-head { padding-block: 2.5rem 2rem; }
.crumb { margin: 0 0 0.5rem; }
.crumb a { display: inline-flex; align-items: center; min-height: 2.75rem; font-weight: 400; text-decoration: none; }
.crumb a:hover { text-decoration: underline; }
.crumb a::before { content: "\2039" / ""; font-size: 1.4em; line-height: 1; margin-right: 0.4rem; }
.lead { margin: 1rem 0 0; max-width: 30em; font-size: clamp(1.2rem, 1.05rem + 0.6vw, 1.45rem); line-height: 1.45; }
.project-actions { margin-top: 1.75rem; display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 2rem; }
.facts { margin: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 2rem; font-size: var(--step--1); }
.facts div { display: flex; gap: 0.5rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 800; }
.project-figure { margin-block: 0; }
.project-figure img { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630; border-radius: 1.25rem; filter: var(--image-filter); }
.project-text { padding-block: 3rem 4.5rem; }
.project-text p { max-width: 40em; }

/* ---------- Pied de page ---------- */
.site-footer {
  max-width: 67.5rem;
  margin: 0 auto;
  padding: 1.5rem max(1.25rem, env(safe-area-inset-right)) 2.5rem max(1.25rem, env(safe-area-inset-left));
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1.5rem;
  color: var(--muted); font-size: var(--step--1);
}
.site-footer p { margin: 0; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 1.25rem; }
.site-footer a, .site-footer button { display: inline-flex; align-items: center; min-height: 2.75rem; color: var(--muted); }
.site-footer a:hover, .site-footer button:hover { color: var(--fg); }
.site-footer button {
  font: inherit; background: none; border: 0; padding: 0; cursor: pointer;
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.2em;
}

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

/* ---------- Tableaux du contenu (page de confidentialité) ---------- */
.prose .table-wrap, .prose table { display: block; overflow-x: auto; }
.prose table { border-collapse: collapse; margin: 0 0 1em; font-size: var(--step--1); max-width: 100%; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--line); }
.prose th { font-weight: 600; }
.prose code { font-size: 0.9em; }

/* ---------- Bandeau de consentement ---------- */
.consent {
  position: fixed; z-index: 20;
  left: max(1rem, env(safe-area-inset-left)); right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  max-width: 40rem; margin-inline: auto;
  background: var(--surface); color: var(--fg);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.18);
  padding: 1rem 1.25rem;
  display: grid; gap: 0.75rem;
  font-size: var(--step--1);
}
.consent p { margin: 0; }
.consent div { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: flex-end; }
.consent button {
  font: 800 var(--step--1) / 1 var(--sans);
  min-height: 2.75rem; padding: 0 1.25rem; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--fg); border: 2px solid var(--line);
}
.consent button[data-choice="granted"] { background: var(--band); color: var(--band-fg); border-color: var(--band); }

/* ---------- Accessibilité : réglages de la console (attributs posés par js/a11y-init.js) ---------- */
html[data-a11y-taille="s"] { font-size: 87.5%; }
html[data-a11y-taille="l"] { font-size: 120%; }
html[data-a11y-taille="xl"] { font-size: 140%; }

/* Espacement aéré : valeurs du critère WCAG 1.4.12. */
html[data-a11y-espacement="aere"] body { line-height: 1.9; letter-spacing: 0.12em; word-spacing: 0.16em; }
html[data-a11y-espacement="aere"] :is(p, li, dd, dt, td, th, blockquote, figcaption) { line-height: 1.9; }
html[data-a11y-espacement="aere"] :is(p, ul, ol, dl, table) { margin-bottom: 2em; }

html[data-a11y-liens="on"] a:not(.btn) { text-decoration: underline; text-decoration-thickness: 0.15em; font-weight: 700; }
html[data-a11y-liens="on"] .prose a { background: var(--mark); color: var(--accent); }

html[data-a11y-animations="off"] { scroll-behavior: auto; }
html[data-a11y-animations="off"] *, html[data-a11y-animations="off"] *::before, html[data-a11y-animations="off"] *::after {
  animation: none !important; transition: none !important;
}

/* Couleurs forcées (contraste élevé de Windows) : les couleurs système priment, on retire le surlignage. */
@media (forced-colors: active) {
  html[data-a11y-liens="on"] .prose a { background: none; color: LinkText; }
}

/* Polices de la console : déclarées ici, téléchargées seulement si le visiteur les choisit (jamais préchargées).
   Une seule variable de police sert au texte et aux titres. */
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("../fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("../fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "OpenDyslexic";
  src: url("../fonts/opendyslexic-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "OpenDyslexic";
  src: url("../fonts/opendyslexic-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
html[data-a11y-police="lisible"] { --sans: "Atkinson Hyperlegible", system-ui, sans-serif; }
html[data-a11y-police="dyslexie"] { --sans: "OpenDyslexic", "Comic Sans MS", sans-serif; }

/* ---------- Accessibilité : bouton flottant et panneau (templates/a11y.html, js/a11y.js) ---------- */
.a11y-dock {
  position: fixed; z-index: 30;
  right: max(1.5rem, env(safe-area-inset-right));
  bottom: calc(max(1.5rem, env(safe-area-inset-bottom)) + var(--a11y-offset, 0px));
  display: flex; flex-direction: column; align-items: center; gap: 0.75rem;
}
.a11y-open {
  width: 4rem; height: 4rem; border-radius: 50%;
  border: 0.25rem solid var(--gold); background: var(--band); color: var(--band-fg);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  box-shadow: 0 0.5rem 1.4rem rgb(10 47 59 / 0.35);
}
.a11y-open svg { width: 2rem; height: 2rem; }
.a11y-open:focus-visible, .a11y-panel button:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.a11y-panel {
  position: absolute; right: 0; bottom: calc(100% + 0.75rem);
  width: min(24.5rem, calc(100vw - 2rem));
  max-height: calc(100vh - 12rem - var(--a11y-offset, 0px)); max-height: calc(100dvh - 12rem - var(--a11y-offset, 0px));
  overflow: auto; overscroll-behavior: contain;
  background: var(--surface); color: var(--fg);
  border: 1px solid var(--line); border-radius: 1.25rem;
  box-shadow: 0 1.1rem 3rem rgb(10 47 59 / 0.28);
  padding: 1.25rem 1.375rem 1.375rem;
  display: flex; flex-direction: column; gap: 0.75rem;
  font-size: var(--step--1); line-height: 1.4; text-align: left;
}
.a11y-panel svg { flex: none; color: var(--accent); }
.a11y-head { display: flex; align-items: center; gap: 0.75rem; }
.a11y-head h2 { margin: 0; flex: 1; font-size: 1.2rem; font-weight: 800; color: var(--fg); }
.a11y-close {
  flex: none; width: 2.75rem; height: 2.75rem; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--tint); color: var(--accent); display: flex; align-items: center; justify-content: center;
}
.a11y-label { margin: 0.25rem 0 0; font-weight: 700; display: flex; align-items: center; gap: 0.5rem; }
.a11y-group { display: grid; gap: 0.25rem; padding: 0.25rem; background: var(--tint); border-radius: 0.875rem; }
.a11y-pill { display: flex; border-radius: 999px; }
.a11y-pill button { flex: 1; border-radius: 999px; }
/* Les options prennent la largeur de leur libellé et passent à la ligne (grand texte, police Dyslexie). */
.a11y-grid4, .a11y-grid3 { display: flex; flex-wrap: wrap; }
.a11y-grid4 button, .a11y-grid3 button { flex: 1 1 auto; padding: 0 0.5rem; }
.a11y-group button {
  min-height: 2.75rem; padding: 0 0.25rem; border: 0; border-radius: 0.625rem; cursor: pointer;
  background: transparent; color: var(--fg); font: 600 0.875rem/1.2 var(--sans); letter-spacing: 0; word-spacing: 0;
}
.a11y-group button[aria-pressed="true"] { background: var(--accent); color: var(--bg); }
.a11y-pill button { font-weight: 700; font-size: 0.95rem; }
.a11y-pill .a11y-s { font-size: 0.8rem; }
.a11y-pill .a11y-l { font-size: 1.1rem; }
.a11y-pill .a11y-xl { font-size: 1.3rem; }
.a11y-switch {
  display: flex; align-items: center; gap: 0.625rem; min-height: 2.75rem; padding: 0;
  border: 0; background: none; color: var(--fg); font: 600 var(--step--1)/1.3 var(--sans); text-align: left; cursor: pointer;
}
.a11y-switch span:first-of-type { flex: 1; }
.a11y-track {
  position: relative; flex: none; width: 2.75rem; height: 1.625rem; border-radius: 999px;
  background: var(--muted);
}
.a11y-track::after {
  content: ""; position: absolute; top: 0.1875rem; left: 0.1875rem;
  width: 1.25rem; height: 1.25rem; border-radius: 50%; background: var(--bg);
  transition: transform 0.15s ease;
}
.a11y-switch[aria-checked="true"] .a11y-track { background: var(--accent); }
.a11y-switch[aria-checked="true"] .a11y-track::after { transform: translateX(1.125rem); }
.a11y-reset {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 0.5rem;
  min-height: 2.75rem; padding: 0 1rem; border-radius: 999px; cursor: pointer;
  border: 2px solid var(--accent); background: var(--surface); color: var(--accent); font: 700 0.875rem var(--sans);
}
html[data-a11y-espacement="aere"] .a11y-panel, html[data-a11y-espacement="aere"] .a11y-panel * { letter-spacing: 0; word-spacing: 0; }
html[data-a11y-espacement="aere"] .a11y-panel .a11y-label { margin: 0.25rem 0 0; }
@media (max-width: 30rem) {
  .a11y-dock { right: 1rem; }
  /* Toute la largeur moins 8 px de chaque côté, en px : le rem grossit avec la taille du texte. */
  .a11y-panel { width: calc(100vw - 16px); right: calc(8px - 1rem); }
}
@media (forced-colors: active) {
  .a11y-open, .a11y-panel, .a11y-group button, .a11y-track { border: 1px solid ButtonText; }
  .a11y-group button[aria-pressed="true"] { background: Highlight; color: HighlightText; }
  .a11y-switch[aria-checked="true"] .a11y-track { background: Highlight; }
}
.a11y-top {
  width: 3rem; height: 3rem; border-radius: 50%;
  border: 2px solid var(--accent); background: var(--surface); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0.4rem 1rem rgb(10 47 59 / 0.2);
  animation: a11y-fade 0.2s ease-out;
}
.a11y-top:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
@keyframes a11y-fade { from { opacity: 0; transform: translateY(0.5rem); } }
.a11y-marker { position: absolute; top: 0; left: 0; width: 1px; height: 100vh; pointer-events: none; }

/* ---------- Page de projet : pastille « Voir le projet » (js/projet.js) ---------- */
.project-float {
  position: fixed; z-index: 25; margin: 0;
  left: 50%; translate: -50% 0;
  bottom: calc(max(1.5rem, env(safe-area-inset-bottom)) + var(--a11y-offset, 0px));
  animation: project-float-in 0.2s ease-out;
}
.project-float .btn { box-shadow: 0 0.4rem 1.25rem rgb(10 47 59 / 0.28), 0 0 0 2px var(--bg); white-space: nowrap; }
@keyframes project-float-in { from { opacity: 0; transform: translateY(0.5rem); } }
/* Écran étroit : centrée dans l'espace libre à gauche du dock d'accessibilité (bouton de 4rem + marges). */
@media (max-width: 40rem) {
  .project-float { left: 1rem; right: 6rem; translate: none; display: flex; justify-content: center; }
  .project-float .btn { white-space: normal; text-align: center; }
}
