/* Cormorant Garamond pour les titres, Karla pour le texte courant :
   les deux polices de la maquette Claude Design, auto-hébergées, le site
   s'interdisant toute requête vers un domaine tiers.

   Karla est une police variable : un seul fichier de 24 Ko couvre toute
   la plage de graisses, là où Inter en demandait deux pour 59 Ko. */
@font-face {
  font-family: 'Cormorant Garamond';
  src: url('/fonts/cormorant-garamond-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Cormorant Garamond';
  src: url('/fonts/cormorant-garamond-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Karla';
  src: url('/fonts/karla.woff2') format('woff2-variations'), url('/fonts/karla.woff2') format('woff2');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

/* Repli à métriques ajustées pour Karla : le temps que le fichier arrive,
   le navigateur affiche une police locale sous ce nom, calée sur la boîte
   de Karla pour que le remplacement ne déplace rien à l'écran.
   Valeurs mesurées avec fontTools sur les tables head/OS2/hhea du fichier
   réel et de Liberation Sans, selon la méthode size-adjust :
     size-adjust = (xAvg_web / upm_web) / (xAvg_repli / upm_repli)
     ascent-override = (ascent_web / upm_web) / size-adjust
   Karla : upm 2000, xAvg 1026, ascendant 1834, descendant 504. */
@font-face {
  font-family: 'Karla secours';
  src: local('Arial'), local('Liberation Sans'), local('Helvetica');
  size-adjust: 88.51%;
  ascent-override: 103.60%;
  descent-override: 28.47%;
  line-gap-override: 0%;
}

/* Repli à métriques ajustées du serif, même méthode que ci-dessus.
   Deux chaînes successives couvrent le cas où ni Georgia ni sa réplique
   métrique Gelasio ne sont installées. */
@font-face {
  font-family: 'Cormorant Garamond secours';
  src: local('Georgia'), local('Gelasio');
  font-weight: 600;
  size-adjust: 92.53%;
  ascent-override: 99.85%;
  descent-override: 31.02%;
  line-gap-override: 0%;
  font-display: swap;
}

@font-face {
  font-family: 'Cormorant Garamond secours';
  src: local('Times New Roman'), local('Liberation Serif');
  font-weight: 600;
  size-adjust: 99.12%;
  ascent-override: 93.22%;
  descent-override: 28.95%;
  line-gap-override: 0%;
  font-display: swap;
}

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

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

body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font-family: var(--sans);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.25rem, 1.6rem + 3vw, 3.75rem); }
h2 { font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.5rem); }
h3 { font-size: clamp(1.125rem, 1.05rem + 0.4vw, 1.375rem); font-family: var(--sans); }

p { margin: 0 0 1.25em; max-width: var(--mesure); text-wrap: pretty; }

a { color: var(--accent-fonce); text-underline-offset: 0.2em; }
a:hover { color: var(--texte); }

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

:focus-visible {
  outline: 3px solid var(--accent-fonce);
  outline-offset: 2px;
  border-radius: 2px;
}

.visuellement-cache {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.evitement {
  position: absolute;
  left: 0.5rem; top: -4rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--texte);
  color: var(--fond);
  border-radius: var(--rayon);
  transition: top 0.15s ease;
}

.evitement:focus { top: 0.5rem; }

.bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.75rem 1.5rem;
  border-radius: var(--rayon);
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.bouton--principal { background: var(--accent-fonce); color: var(--fond); }
.bouton--principal:hover { background: var(--texte); color: var(--fond); }

.bouton--secondaire {
  border: 1px solid var(--texte-doux);
  color: var(--texte);
}
.bouton--secondaire:hover { background: var(--fond-2); color: var(--texte); }

.js-reveal [data-reveal] {
  opacity: 0;
  transform: translateY(1rem);
}

.js-reveal [data-reveal].est-visible {
  opacity: 1;
  transform: none;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

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