@font-face {
  font-family: "Rubik";
  src: url("/polices/rubik-variable.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --papier: #EDF0EE;
  --papier-bloc: #F7F9F8;
  --encre: #16201B;
  --encre-douce: #4D5A53;
  --encre-a: #13432E;
  --encre-b: #D42F5F;
  --encre-b-txt: #AE1E4D;
  --sur-a: #FFFFFF;
  --focus: #AE1E4D;
  --filet: rgba(22, 32, 27, 0.20);
  --filet-fort: rgba(22, 32, 27, 0.52);
  --moule: 6px;
  --marge: 16px;
  --affiche: "Rubik", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --texte: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --papier: #111613;
    --papier-bloc: #192019;
    --encre: #EEF3EF;
    --encre-douce: #9AA79F;
    --encre-a: #7CD3AA;
    --encre-b-txt: #FF6E8B;
    --sur-a: #0F1A14;
    --focus: #FF6E8B;
    --filet: rgba(238, 243, 239, 0.22);
    --filet-fort: rgba(238, 243, 239, 0.52);
  }
}

/* Rubik n'a ni idéogramme ni hangul : en japonais, coréen et chinois, l'affichage passe entier sur la
   police du système plutôt que de mélanger les deux glyphe par glyphe. */
:lang(ja), :lang(ko), :lang(zh) {
  --affiche: system-ui, -apple-system, "Hiragino Sans", "Apple SD Gothic Neo", "PingFang SC",
    "Noto Sans CJK JP", "Noto Sans CJK KR", "Noto Sans CJK SC", sans-serif;
}

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

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

body {
  margin: 0;
  background: var(--papier);
  color: var(--encre);
  font: 400 1.0625rem/1.6 var(--texte);
  overflow-wrap: break-word;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--encre-a); text-decoration-thickness: 1.5px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 3px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }

h1, h2, h3 {
  font-family: var(--affiche);
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin: 0 0 0.5em;
}
h1 { font-weight: 800; font-size: clamp(2rem, 1.4rem + 3vw, 3.25rem); }
h2 { font-weight: 800; font-size: clamp(1.5rem, 1.25rem + 1.2vw, 2rem); }
h3 { font-weight: 700; font-size: 1.1875rem; }
p { margin: 0 0 1em; text-wrap: pretty; }

.contenant { width: 100%; max-width: 68rem; margin: 0 auto; padding: 0 var(--marge); }

.evitement {
  position: absolute; left: var(--marge); top: -4rem;
  background: var(--encre-a); color: var(--sur-a);
  padding: 0.6rem 1rem; border-radius: var(--moule); z-index: 2;
}
.evitement:focus { top: 0.75rem; }

/* Bandeau */
.bandeau {
  max-width: 68rem; margin: 0 auto; padding: 0.75rem var(--marge);
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
}
.marque {
  display: inline-flex; align-items: center; gap: 0.6rem; min-height: 44px;
  font: 800 1.25rem/1 var(--affiche); color: var(--encre); text-decoration: none;
}
.marque img { border-radius: 8px; }
.bandeau-nav { display: flex; align-items: center; gap: 0.25rem; }
.bandeau-nav > a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 0.75rem;
  color: var(--encre); font-weight: 600; text-decoration: none; border-radius: var(--moule);
}
.bandeau-nav > a:hover, .bandeau-nav > a[aria-current] { background: var(--papier-bloc); }

.langues { position: relative; }
.langues summary {
  list-style: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 0.4rem; min-height: 44px; padding: 0 0.75rem;
  border: 1.5px solid var(--filet-fort); border-radius: var(--moule); font-weight: 700;
}
.langues summary::-webkit-details-marker { display: none; }
.langues summary::after {
  content: ""; width: 0.45em; height: 0.45em; margin-left: 0.15rem;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: translateY(-0.12em) rotate(45deg);
}
.langues[open] summary::after { transform: translateY(0.1em) rotate(-135deg); }
.langues ul {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 3;
  list-style: none; margin: 0; padding: 0.35rem; min-width: 13rem;
  background: var(--papier-bloc); border: 1.5px solid var(--filet-fort); border-radius: var(--moule);
}
.langues li a {
  display: flex; align-items: center; min-height: 44px; padding: 0 0.75rem;
  color: var(--encre); text-decoration: none; border-radius: 4px;
}
.langues li a:hover { background: var(--papier); }
.langues li a[aria-current] { color: var(--encre-a); font-weight: 700; }

/* Accueil */
.heros { padding: clamp(2rem, 1rem + 5vw, 5rem) 0 clamp(1.5rem, 1rem + 3vw, 3.5rem); }
.heros-grille { display: grid; gap: 2rem; align-items: center; }
.heros h1 { max-width: 16ch; }
:lang(ja) .heros h1, :lang(ko) .heros h1, :lang(zh) .heros h1 { max-width: 22ch; word-break: auto-phrase; }
.chapo { font-size: 1.1875rem; color: var(--encre-douce); max-width: 38rem; }
.statut {
  margin: 0.5rem 0 0; padding: 0.15rem 0 0.15rem 0.85rem;
  border-left: 3px solid var(--encre-b); color: var(--encre-a); font-weight: 700;
}
.heros-visuel img { width: min(240px, 40vw); border-radius: 22%; }
@media (min-width: 760px) {
  .heros-grille { grid-template-columns: 1fr auto; }
}

.bloc { padding: clamp(1.75rem, 1rem + 3vw, 3.5rem) 0; border-top: 1.5px solid var(--filet); }
.intro { color: var(--encre-douce); max-width: 40rem; }
.note { color: var(--encre-douce); font-size: 0.9375rem; max-width: 46rem; margin-top: 1.25rem; }

.etapes, .fonctions { list-style: none; margin: 1.25rem 0 0; padding: 0; display: grid; gap: 12px; }
@media (min-width: 760px) {
  .etapes { grid-template-columns: repeat(3, 1fr); }
  .fonctions { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1000px) {
  .fonctions { grid-template-columns: repeat(3, 1fr); }
  .fonctions > :last-child:nth-child(3n + 2) { grid-column: span 2; }
}
.etape, .fonction, .offre {
  background: var(--papier-bloc); border: 1.5px solid var(--filet); border-radius: var(--moule);
  padding: 1.1rem 1.1rem 0.4rem;
}
.etape { border-top: 3px solid var(--encre-a); }
.etape-numero {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; margin-bottom: 0.6rem; border-radius: var(--moule);
  background: var(--encre-b); color: #FFFFFF; font: 800 1rem/1 var(--affiche);
}
.etape p, .fonction p { color: var(--encre-douce); }

.offres { display: grid; gap: 12px; margin-top: 1.25rem; }
@media (min-width: 760px) { .offres { grid-template-columns: 1fr 1fr; } }
.offre ul { margin: 0 0 1rem; padding-left: 1.2rem; }
.offre li { margin-bottom: 0.35rem; }
.offre-pro { border: 2px solid var(--encre-a); }

.bloc-donnees p { max-width: 44rem; }
.lien-fort { font-weight: 700; }

/* Documents */
.document { max-width: 46rem; padding-top: clamp(1.5rem, 1rem + 3vw, 3rem); padding-bottom: 3rem; }
.document h2 { margin-top: 2.25rem; font-size: clamp(1.35rem, 1.2rem + 0.8vw, 1.65rem); }
.document h3 { margin-top: 1.5rem; }
.document ul, .document ol { padding-left: 1.3rem; margin: 0 0 1em; }
.document li { margin-bottom: 0.35rem; }
.autres-langues { margin: 0 0 1.5rem; }
.autres-langues summary {
  cursor: pointer; display: inline-flex; align-items: center; min-height: 44px;
  color: var(--encre-a); font-weight: 600;
}
.autres-langues ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }
.sommaire {
  background: var(--papier-bloc); border: 1.5px solid var(--filet); border-radius: var(--moule);
  padding: 1rem 1.25rem 0.5rem; margin: 0 0 1.5rem;
}
.sommaire h2 { margin: 0 0 0.5rem; font-size: 1.0625rem; }
.tableau { overflow-x: auto; margin: 0 0 1.25rem; border: 1.5px solid var(--filet); border-radius: var(--moule); }
table { border-collapse: collapse; width: 100%; font-size: 0.9375rem; background: var(--papier-bloc); }
th, td { text-align: left; vertical-align: top; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--filet); }
th { font-weight: 700; }
tbody tr:last-child td { border-bottom: 0; }
@media (max-width: 560px) {
  .tableau table, .tableau thead, .tableau tbody, .tableau tr, .tableau th, .tableau td { display: block; }
  .tableau thead { display: none; }
  .tableau tr { padding: 0.5rem 0; border-bottom: 1px solid var(--filet); }
  .tableau tbody tr:last-child { border-bottom: 0; }
  .tableau td { border: 0; padding: 0.2rem 0.75rem; }
  .tableau td:first-child { font-weight: 700; }
  .tableau td[data-label]::before {
    content: attr(data-label); display: block; margin-top: 0.35rem;
    font-size: 0.8125rem; font-weight: 600; color: var(--encre-douce);
  }
  .tableau td:empty { display: none; }
}

.contact {
  background: var(--papier-bloc); border: 1.5px solid var(--filet); border-radius: var(--moule);
  padding: 1.1rem 1.25rem 0.25rem; margin: 1.5rem 0 1rem;
}
.contact h2 { margin-top: 0; }
.bouton {
  display: inline-flex; align-items: center; min-height: 50px; padding: 0 1.25rem;
  background: var(--encre-a); color: var(--sur-a); border-radius: var(--moule);
  font-weight: 600; text-decoration: none;
}
.bouton:hover { text-decoration: underline; }
.question { padding: 0.25rem 0 0.5rem; border-bottom: 1px solid var(--filet); }
.question:last-child { border-bottom: 0; }
.question h3 { margin-top: 1.25rem; }

.liste-langues { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
.liste-langues a { display: inline-flex; align-items: center; min-height: 44px; }

/* Pied */
.pied { border-top: 1.5px solid var(--filet); padding: 1.75rem 0 2.5rem; font-size: 0.9375rem; color: var(--encre-douce); }
.pied-liens { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: 0 1.25rem; }
.pied-liens a { display: inline-flex; align-items: center; min-height: 44px; }
.mention-marque { max-width: 46rem; }
.editeur { margin-bottom: 0; }

@media (prefers-reduced-motion: no-preference) {
  .langues summary::after { transition: transform 0.15s ease-out; }
}
