/* ==========================================================================
   Main Courante - socle : tokens, reset, typographie, grille, boutons, motion
   Direction : maintien a domicile. Vert profond, sauge, terre cuite, creme.
   Lisibilite d abord : corps de texte large, interlignage genereux,
   contrastes verifies au seuil AA (4,5:1) pour tout le texte.
   ========================================================================== */

/* --- 1. Tokens ---------------------------------------------------------- */
:root {
  --ink: #123432;
  --ink-clair: #1d4a46;
  --ink-fonce: #0d2725;
  --sauge: #4e6b48;
  --sauge-clair: #a9c6a0;
  --sauge-pale: #c2dcbb;
  --creme: #faf7f1;
  --sable: #f1eadd;
  --sable-sombre: #e3dac9;
  --terre: #95452f;
  --terre-sombre: #75331f;
  --or-sombre: #8a5f1c;
  --blanc: #fff;

  --texte: #152e2c;
  --texte-doux: #4b5f5c;
  --ligne: #d7dedb;

  --fond: #fff;
  --fond-alt: var(--creme);
  --focus: var(--or-sombre);

  --serif: "Fraunces", Georgia, "Iowan Old Style", "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --t-xs: 0.8125rem;
  --t-sm: 0.9375rem;
  --t-base: 1.0625rem;
  --t-lg: clamp(1.125rem, 0.45vw + 1.03rem, 1.3125rem);
  --t-xl: clamp(1.25rem, 0.8vw + 1.08rem, 1.5rem);
  --t-2xl: clamp(1.5rem, 1.5vw + 1.15rem, 2.125rem);
  --t-3xl: clamp(1.9rem, 2.8vw + 1.3rem, 3rem);
  --t-4xl: clamp(2.4rem, 4.4vw + 1.3rem, 4rem);

  --e-1: 0.5rem;
  --e-2: 1rem;
  --e-3: 1.5rem;
  --e-4: 2.25rem;
  --e-5: 3.25rem;
  --e-6: 4.5rem;
  --e-7: 6rem;

  --largeur: 73rem;
  --lisible: 44rem;
  --rayon: 14px;
  --rayon-l: 24px;

  --ombre-1: 0 1px 2px rgba(18, 52, 50, .05), 0 2px 10px rgba(18, 52, 50, .04);
  --ombre-2: 0 2px 6px rgba(18, 52, 50, .06), 0 14px 32px rgba(18, 52, 50, .08);
  --ombre-3: 0 4px 10px rgba(18, 52, 50, .07), 0 28px 60px rgba(18, 52, 50, .12);

  --rapide: 150ms;
  --normal: 240ms;
  --lent: 420ms;
  --sortie: cubic-bezier(.22, 1, .36, 1);
  --entree: cubic-bezier(.4, 0, .2, 1);
}

/* --- 2. Reset ----------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

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

body {
  background: var(--fond);
  color: var(--texte);
  font-family: var(--sans);
  font-size: var(--t-base);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; }
table { border-collapse: collapse; }

:where(a, button, summary, input, textarea, select):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection { background: var(--sauge-clair); color: var(--ink); }

/* --- 3. Typographie ----------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: -.02em;
  text-wrap: balance;
  color: var(--ink);
}

h1 { font-size: var(--t-4xl); line-height: 1.06; }
h2 { font-size: var(--t-3xl); }
h3 { font-size: var(--t-xl); }
h4 { font-size: var(--t-lg); }
p { text-wrap: pretty; }

.chapo,
.lead {
  font-size: var(--t-lg);
  line-height: 1.6;
  color: var(--texte-doux);
  max-width: 54ch;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: .7rem;
  font-family: var(--sans);
  font-size: var(--t-xs);
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--sauge);
  margin-bottom: var(--e-2);
}

.eyebrow::before {
  content: "";
  width: 1.75rem;
  height: 2px;
  background: currentColor;
  flex: none;
}

/* --- 4. Mise en page ---------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--largeur);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2.75rem);
}

.section { padding-block: var(--e-7); }
.section.sand { background: var(--fond-alt); }

.section.dark,
.dark {
  background: var(--ink);
  color: #e3ebe9;
  --focus: var(--sauge-clair);
}

.dark h1, .dark h2, .dark h3, .dark h4 { color: #fff; }
.dark .lead, .dark .chapo { color: #cfdcda; }
.dark .eyebrow { color: var(--sauge-pale); }

.skip {
  position: absolute;
  left: 50%;
  top: -5rem;
  transform: translateX(-50%);
  z-index: 300;
  background: var(--ink);
  color: #fff;
  padding: .8rem 1.4rem;
  border-radius: 0 0 10px 10px;
  text-decoration: none;
  transition: top var(--rapide) var(--entree);
}

.skip:focus { top: 0; }

/* --- 5. Boutons et liens ------------------------------------------------ */
.btn {
  --btn-fond: var(--terre);
  --btn-texte: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  min-height: 3.25rem;
  padding: .85rem 1.6rem;
  background: var(--btn-fond);
  color: var(--btn-texte);
  font-size: var(--t-sm);
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  border: 2px solid var(--btn-fond);
  border-radius: 999px;
  transition: background-color var(--normal) var(--entree),
              transform var(--normal) var(--sortie),
              box-shadow var(--normal) var(--sortie);
}

.btn:hover {
  background: var(--terre-sombre);
  border-color: var(--terre-sombre);
  transform: translateY(-2px);
  box-shadow: var(--ombre-2);
}

.btn:active { transform: translateY(0); transition-duration: var(--rapide); }

.btn-outline {
  --btn-fond: transparent;
  --btn-texte: var(--ink);
  border-color: var(--ink);
}

.btn-outline:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-sm { min-height: 2.875rem; padding: .6rem 1.2rem; }

.dark .btn-outline { --btn-texte: #fff; border-color: rgba(255, 255, 255, .55); }
.dark .btn-outline:hover { background: #fff; color: var(--ink); border-color: #fff; }

/* Lien dans le texte courant : souligne, jamais la couleur seule. */
.lisible a:not(.btn):not(.carte):not(.item):not(.telbloc),
.prose a:not(.btn) {
  color: var(--terre);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

.lisible a:not(.btn):not(.carte):not(.item):not(.telbloc):hover { color: var(--terre-sombre); }
.dark a:not(.btn):not(.carte) { color: var(--sauge-pale); }

.external { font-weight: 700; }

/* --- 6. Motion ---------------------------------------------------------- */
/* Rien n est masque sans JavaScript : l etat initial est pose par le script
   via [data-pret]. La feuille seule ne cache aucun contenu. */
[data-anime][data-pret] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity var(--lent) var(--entree), transform var(--lent) var(--sortie);
  transition-delay: var(--retard, 0ms);
}

[data-anime][data-pret][data-vu] { opacity: 1; transform: none; }
[data-anime="voile"][data-pret] { transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }

  [data-anime][data-pret] { opacity: 1 !important; transform: none !important; }
}

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

.hp {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}
