/* Actions Durables : feuille de style unique du site institutionnel.
   Concept : matiere et structure.
   Aucun script, aucune ressource distante. Les polices sont auto hebergees
   dans assets/fonts/, le grain est un SVG en data URI. La seule occurrence
   de http:// dans ce fichier est l'espace de noms SVG, impose par le format
   et jamais appele par le navigateur. */

/* ===== Polices auto hebergees =============================================
   Deposer les deux woff2 variables dans assets/fonts/ (cf. README).
   Tant qu'ils sont absents, la pile de repli systeme prend le relais et la
   mise en page reste correcte : font-display: swap ne bloque aucun rendu. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("fonts/bricolage-grotesque-variable.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Public Sans";
  src: url("fonts/public-sans-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ===== Jetons ============================================================ */

:root {
  --ardoise: #1B2430;
  --ardoise-profonde: #121A24;
  --calcaire: #F5F4F0;
  --craie: #FCFCFA;
  --verdigris: #158C7C;
  --verdigris-texte: #0E6B5E;
  --brume: #8A93A0;

  --filet-clair: rgba(27, 36, 48, 0.14);
  --filet-sombre: rgba(245, 244, 240, 0.14);

  --titre: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --texte: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --fs-xs: clamp(0.80rem, 0.78rem + 0.10vw, 0.86rem);
  --fs-s: clamp(0.93rem, 0.90rem + 0.14vw, 1.01rem);
  --fs-m: clamp(1.06rem, 1.02rem + 0.18vw, 1.15rem);
  --fs-l: clamp(1.32rem, 1.24rem + 0.34vw, 1.44rem);
  --fs-xl: clamp(1.64rem, 1.50rem + 0.62vw, 1.80rem);
  --fs-2xl: clamp(2.05rem, 1.80rem + 1.10vw, 2.25rem);
  --fs-3xl: clamp(2.56rem, 2.10rem + 2.00vw, 3.50rem);
  --fs-hero: clamp(3.20rem, 2.20rem + 4.40vw, 5.30rem);

  --sortie: cubic-bezier(0.2, 0.8, 0.2, 1);

  --grain-fort: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='180'%20height='180'%3E%3Cfilter%20id='g'%3E%3CfeTurbulence%20type='fractalNoise'%20baseFrequency='0.85'%20numOctaves='4'%20stitchTiles='stitch'/%3E%3C/filter%3E%3Crect%20width='180'%20height='180'%20filter='url(%23g)'%20opacity='0.10'/%3E%3C/svg%3E");
  --grain-doux: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='180'%20height='180'%3E%3Cfilter%20id='g'%3E%3CfeTurbulence%20type='fractalNoise'%20baseFrequency='0.80'%20numOctaves='4'%20stitchTiles='stitch'/%3E%3C/filter%3E%3Crect%20width='180'%20height='180'%20filter='url(%23g)'%20opacity='0.045'/%3E%3C/svg%3E");
}

/* ===== Base ============================================================== */

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

html {
  scroll-padding-top: 1.5rem;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  position: relative;
  margin: 0;
  background-color: var(--calcaire);
  background-image: var(--grain-doux);
  background-repeat: repeat;
  color: var(--ardoise);
  font-family: var(--texte);
  font-size: var(--fs-m);
  font-weight: 400;
  line-height: 1.62;
  font-synthesis-weight: none;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--ardoise);
  font-family: var(--titre);
  font-weight: 620;
  line-height: 1.08;
  letter-spacing: -0.022em;
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-3xl);
}

h2 {
  font-size: var(--fs-2xl);
}

h3 {
  font-size: var(--fs-l);
  letter-spacing: -0.014em;
}

p {
  margin: 0 0 1.05rem;
}

p:last-child {
  margin-bottom: 0;
}

ul {
  margin: 0 0 1.05rem;
  padding-left: 1.2rem;
}

li {
  margin-bottom: 0.45rem;
}

strong {
  font-weight: 640;
}

a {
  color: var(--verdigris-texte);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color 240ms var(--sortie), text-decoration-color 240ms var(--sortie);
}

a:hover {
  color: var(--ardoise);
  text-decoration-color: var(--verdigris);
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--verdigris);
  outline-offset: 2px;
  border-radius: 1px;
}

hr {
  border: 0;
}

/* ===== Gabarit =========================================================== */

.wrap {
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding-inline: clamp(1.25rem, 5vw, 3.5rem);
}

.prose {
  max-width: 68ch;
}

/* ===== Lien d'evitement ================================================== */

.skip-link {
  position: absolute;
  top: 0;
  left: -9999px;
  z-index: 20;
  background: var(--ardoise-profonde);
  color: var(--craie);
  padding: 0.8rem 1.3rem;
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  left: 0;
}

/* ===== Soulignement deploye ============================================== */
/* Reserve aux liens autonomes : leur boite est stable, le pseudo element ne
   se coupe pas sur un retour a la ligne. Les liens dans le corps du texte
   gardent un soulignement permanent, plus lisible pour un document. */

.lien-deploie {
  position: relative;
  display: inline-block;
  text-decoration: none;
}

.lien-deploie::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: var(--verdigris);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 240ms var(--sortie);
}

.lien-deploie:hover::after,
.lien-deploie:focus-visible::after {
  transform: scaleX(1);
}

/* ===== En tete =========================================================== */

.topbar {
  border-bottom: 1px solid var(--filet-clair);
  background: transparent;
}

.topbar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  padding-block: 1.15rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--ardoise);
  font-family: var(--titre);
  font-size: 1.06rem;
  font-weight: 640;
  letter-spacing: -0.018em;
  text-decoration: none;
}

.brand-mark {
  display: block;
  width: 30px;
  height: 30px;
  flex: none;
}

.topnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.6rem;
  font-size: var(--fs-s);
}

.topnav a {
  color: var(--ardoise);
  font-weight: 500;
}

.topbar-over {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 3;
  border-bottom-color: var(--filet-sombre);
}

.topbar-over .brand,
.topbar-over .topnav a {
  color: var(--craie);
}

/* ===== Hero ============================================================== */

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  background-color: var(--ardoise-profonde);
  background-image:
    radial-gradient(120% 95% at 8% 4%, rgba(21, 140, 124, 0.55), transparent 58%),
    radial-gradient(95% 80% at 92% 18%, rgba(138, 147, 160, 0.42), transparent 60%),
    radial-gradient(140% 120% at 50% 122%, rgba(9, 14, 20, 0.95), transparent 68%),
    repeating-linear-gradient(90deg, rgba(252, 252, 250, 0.16) 0 1px, transparent 1px 8px),
    repeating-linear-gradient(0deg, rgba(252, 252, 250, 0.13) 0 1px, transparent 1px 8px),
    linear-gradient(158deg, #1B2430 0%, #121A24 58%, #0B1118 100%);
  color: var(--calcaire);
}

.hero::before {
  content: "";
  position: absolute;
  inset: -2%;
  z-index: -2;
  background-image: url("hero.webp");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  filter: saturate(0.14) contrast(1.12) brightness(0.85);
  transform-origin: 55% 45%;
  animation: derive 30s ease-in-out infinite alternate;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    var(--grain-fort),
    linear-gradient(
      to top,
      rgba(18, 26, 36, 0.82) 0%,
      rgba(18, 26, 36, 0.40) 15%,
      rgba(18, 26, 36, 0) 34%
    ),
    radial-gradient(
      130% 110% at 10% 52%,
      rgba(18, 26, 36, 0.95) 0%,
      rgba(18, 26, 36, 0.91) 30%,
      rgba(18, 26, 36, 0.62) 60%,
      rgba(18, 26, 36, 0.40) 100%
    );
  background-repeat: repeat, no-repeat, no-repeat;
  background-size: 180px 180px, cover, cover;
}

.hero-inner {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 2.5rem;
  padding-block: clamp(7.5rem, 14vh, 10rem) clamp(2rem, 5vh, 3rem);
}

.hero-main {
  align-self: center;
  max-width: 54ch;
}

.hero-titre {
  color: var(--craie);
  font-size: var(--fs-hero);
  font-weight: 680;
  line-height: 0.98;
  letter-spacing: -0.038em;
  animation: surgir 700ms var(--sortie) 0ms both;
}

.hero-sub {
  max-width: 46ch;
  margin: 1.6rem 0 0;
  color: var(--calcaire);
  font-size: var(--fs-l);
  font-weight: 350;
  line-height: 1.45;
  animation: surgir 700ms var(--sortie) 80ms both;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2.6rem;
  margin: 2.6rem 0 0;
  font-family: var(--titre);
  font-size: var(--fs-m);
  font-weight: 560;
  animation: surgir 700ms var(--sortie) 160ms both;
}

.hero-link {
  color: var(--craie);
  border-bottom: 1px solid rgba(138, 147, 160, 0.6);
}

.hero-link:hover {
  color: var(--craie);
}

.hero-foot {
  align-self: end;
}

.hero-rule {
  width: 0;
  height: 3px;
  margin: 0 0 1.1rem;
  background: var(--verdigris);
  animation: filet 900ms var(--sortie) 400ms both;
}

.hero-note {
  margin: 0;
  color: var(--brume);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  animation: surgir 700ms var(--sortie) 240ms both;
}

/* ===== Sections claires ================================================== */

.section {
  border-top: 1px solid var(--filet-clair);
  padding-block: clamp(3rem, 7.5vw, 5.5rem);
}

.hero + .section {
  border-top: 0;
}

.section-head {
  max-width: 62ch;
  margin-bottom: 2.4rem;
}

.section-head p {
  margin-top: 0.95rem;
}

.eyebrow {
  margin: 0 0 0.9rem;
  color: var(--verdigris-texte);
  font-size: var(--fs-xs);
  font-weight: 620;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.cta-row {
  margin: 2.2rem 0 0;
}

.btn {
  display: inline-block;
  background: var(--ardoise);
  color: var(--craie);
  padding: 0.85rem 1.5rem;
  font-family: var(--titre);
  font-weight: 580;
  text-decoration: none;
  transition: background-color 240ms var(--sortie);
}

.btn:hover {
  background: var(--verdigris-texte);
  color: var(--craie);
}

/* ===== Grille de blocs =================================================== */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 1.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.grid li {
  margin: 0;
}

.card {
  height: 100%;
  background: var(--craie);
  border: 1px solid var(--filet-clair);
  border-top: 3px solid var(--verdigris);
  padding: clamp(1.4rem, 3vw, 2rem);
}

.card-soft {
  background: transparent;
  border: 1px dashed var(--filet-clair);
  border-top: 3px solid var(--brume);
}

.card-kicker {
  margin: 0 0 0.55rem;
  color: var(--verdigris-texte);
  font-size: var(--fs-xs);
  font-weight: 620;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.card h3 {
  margin-bottom: 0.65rem;
}

.card p {
  font-size: var(--fs-s);
}

.card-link {
  margin-top: 1rem;
  color: var(--verdigris-texte);
  font-family: var(--titre);
  font-weight: 580;
  border-bottom: 1px solid rgba(14, 107, 94, 0.4);
}

/* ===== Liste d'identite ================================================== */

.identity {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
  gap: 1.8rem 2.5rem;
  margin: 0;
}

.identity dt {
  color: var(--verdigris-texte);
  font-size: var(--fs-xs);
  font-weight: 620;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.identity dd {
  max-width: 46ch;
  margin: 0.4rem 0 0;
  color: var(--ardoise);
  font-size: var(--fs-s);
  font-weight: 400;
}

/* ===== Pages de documents ================================================ */

.page-document main {
  animation: apparaitre 500ms ease-out both;
}

.page-head {
  padding-block: clamp(3rem, 7vw, 4.5rem) 0;
}

.page-head h1 {
  font-size: var(--fs-2xl);
}

.updated {
  margin: 1.1rem 0 0;
  padding-bottom: 1.6rem;
  border-bottom: 1px solid var(--filet-clair);
  font-size: var(--fs-s);
}

.legal {
  padding-block: 2.2rem clamp(3.5rem, 8vw, 5.5rem);
}

.legal h2 {
  margin-top: 3rem;
  margin-bottom: 0.9rem;
  font-size: var(--fs-xl);
}

.legal h2:first-of-type {
  margin-top: 1.8rem;
}

.legal dl {
  margin: 0 0 1.05rem;
}

.legal dt {
  margin-top: 1rem;
  font-weight: 640;
}

.legal dd {
  margin: 0.2rem 0 0;
}

.callout {
  margin: 1.8rem 0;
  padding: 1.2rem 1.4rem;
  background: var(--craie);
  border-left: 3px solid var(--verdigris);
  font-size: var(--fs-s);
}

/* ===== Pied de page ====================================================== */

.sitefoot {
  background-color: var(--ardoise-profonde);
  background-image: var(--grain-fort);
  background-repeat: repeat;
  color: var(--calcaire);
  padding-block: clamp(2.8rem, 6.5vw, 4rem);
  font-size: var(--fs-s);
}

.foot-inner {
  display: grid;
  gap: 1.5rem;
}

.sitefoot p {
  margin: 0;
  max-width: 62ch;
}

.footnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.9rem;
}

.footnav a {
  color: var(--craie);
  font-weight: 500;
}

.sitefoot :focus-visible {
  outline-color: var(--craie);
}

.foot-note {
  color: var(--brume);
  font-size: var(--fs-xs);
}

/* ===== Mouvements ======================================================== */

@keyframes surgir {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes derive {
  from {
    transform: scale(1);
  }

  to {
    transform: scale(1.06);
  }
}

@keyframes filet {
  from {
    width: 0;
  }

  to {
    width: 100%;
  }
}

@keyframes apparaitre {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* ===== Mouvement reduit ==================================================
   Filet de securite universel, puis etat final impose element par element,
   pour qu'aucune animation ne laisse un contenu invisible ou tronque. */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
    scroll-behavior: auto !important;
  }

  .hero-titre,
  .hero-sub,
  .hero-links,
  .hero-note,
  .page-document main {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .hero-rule {
    animation: none !important;
    width: 100% !important;
  }

  .hero::before {
    animation: none !important;
    transform: none !important;
  }

  .lien-deploie::after {
    transition: none !important;
  }

  a,
  .btn {
    transition: none !important;
  }
}
