/* ==========================================================================
   main.css — Fondations, tokens de la charte et styles de base
   Kim Delage Bélanger, travailleuse sociale — « Phénix & Sérénité »
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;0,600;1,400&family=Raleway:wght@300;400;500;600;700&family=Parisienne&display=swap');

/* --------------------------------------------------------------------------
   1. Tokens — variables de la charte
   -------------------------------------------------------------------------- */
:root {
  /* Neutres chauds — sable / blanc cassé */
  --sable-0: #ffffff;
  --sable-50: #faf6f0;
  --sable-100: #f2eadf;
  --sable-200: #e7dbc9;
  --sable-300: #d8c7ae;

  /* Vert sauge — calme (l'eau, la pierre) */
  --sauge-100: #e3eae0;
  --sauge-300: #a7ba9d;
  --sauge-500: #7b9070;
  --sauge-700: #556a4d;
  --sauge-900: #33402e;

  /* Terracotta — le phénix (touche d'accent) */
  --phenix-200: #f2cba3;
  --phenix-400: #db8b4e;
  --phenix-500: #c56a38;
  --phenix-600: #b0562c;
  --phenix-700: #8f4522;

  /* Encre & états */
  --encre: #2b2723;
  --encre-doux: #574e45;
  --succes: #4a7c59;
  --erreur: #b3261e;

  /* Rôles sémantiques */
  --bg: var(--sable-50);
  --bg-alt: var(--sable-100);
  --surface: var(--sable-0);
  --border: var(--sable-300);
  --border-doux: #e7ddcd;
  --text: var(--encre);
  --text-soft: var(--encre-doux);
  --primary: var(--sauge-700);
  --primary-soft: var(--sauge-500);
  --accent: var(--phenix-600);
  --accent-strong: var(--phenix-700);
  --accent-glow: var(--phenix-400);

  /* Eau (dégradés du hero) */
  --water-a: #dfeae4;
  --water-b: #c9dbcf;

  /* Typographies */
  --serif: 'Lora', Georgia, 'Times New Roman', serif;
  --sans: 'Raleway', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --script: 'Parisienne', 'Segoe Script', cursive;

  /* Échelle typographique fluide */
  --fs-xs: 0.78rem;
  --fs-sm: 0.9rem;
  --fs-base: clamp(1rem, 0.97rem + 0.15vw, 1.075rem);
  --fs-lg: clamp(1.1rem, 1.04rem + 0.3vw, 1.25rem);
  --fs-xl: clamp(1.35rem, 1.2rem + 0.7vw, 1.7rem);
  --fs-2xl: clamp(1.7rem, 1.4rem + 1.4vw, 2.4rem);
  --fs-3xl: clamp(2.1rem, 1.6rem + 2.4vw, 3.3rem);
  --fs-4xl: clamp(2.6rem, 1.8rem + 3.6vw, 4.2rem);

  /* Espacement (échelle 4/8) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;
  --section-y: clamp(3.5rem, 7vw, 6.5rem);

  /* Rayons & ombres */
  --radius-sm: 8px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --shadow-sm: 0 2px 10px rgba(43, 39, 35, 0.06);
  --shadow: 0 8px 30px rgba(43, 39, 35, 0.09);
  --shadow-lg: 0 20px 55px rgba(43, 39, 35, 0.14);

  /* Divers */
  --container: 1160px;
  --container-narrow: 760px;
  --header-h: 88px;
  --transition: 220ms cubic-bezier(0.33, 0.7, 0.4, 1);
  --transition-slow: 600ms cubic-bezier(0.33, 0.7, 0.4, 1);
}

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

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

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

body {
  font-family: var(--sans);
  font-size: var(--fs-base);
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img,
picture,
svg,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--accent-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color var(--transition);
}

a:hover { color: var(--accent); }

ul, ol { padding-left: 1.15rem; }

/* --------------------------------------------------------------------------
   3. Typographie
   -------------------------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.15;
  color: var(--text);
  text-wrap: balance;
}

h1 { font-size: var(--fs-3xl); letter-spacing: -0.01em; }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }

p { max-width: 68ch; }

.lead {
  font-size: var(--fs-lg);
  color: var(--text-soft);
  line-height: 1.7;
}

.eyebrow {
  display: inline-block;
  font-family: var(--sans);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-strong);
  margin-bottom: var(--space-4);
}

.script {
  font-family: var(--script);
  font-weight: 400;
  line-height: 1;
}

/* --------------------------------------------------------------------------
   4. Mise en page
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.15rem, 4vw, 2.5rem);
}

.container--narrow { max-width: var(--container-narrow); }

.section { padding-block: var(--section-y); }
.section--alt { background: var(--bg-alt); }
.section--sauge { background: var(--sauge-900); color: var(--sable-50); }
.section--tight { padding-block: clamp(2.5rem, 5vw, 4rem); }

.section-head {
  max-width: 62ch;
  margin-bottom: clamp(2rem, 4vw, 3.25rem);
}
.section-head--center {
  margin-inline: auto;
  text-align: center;
}
.section-head p { margin-top: var(--space-4); }
.section-head--center p { margin-inline: auto; }

.stack > * + * { margin-top: var(--space-4); }
.stack-lg > * + * { margin-top: var(--space-8); }

/* --------------------------------------------------------------------------
   5. Boutons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--sans);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  padding: 0.95em 1.6em;
  border: 1.5px solid transparent;
  border-radius: var(--radius-pill);
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--transition), background var(--transition),
    box-shadow var(--transition), color var(--transition), border-color var(--transition);
}

.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 18px rgba(176, 86, 44, 0.28);
}
.btn--primary:hover { background: var(--accent-strong); color: #fff; box-shadow: 0 10px 24px rgba(143, 69, 34, 0.32); }

.btn--ghost {
  background: transparent;
  color: var(--primary);
  border-color: var(--border);
}
.btn--ghost:hover { border-color: var(--primary); background: var(--sauge-100); color: var(--primary); }

.btn--light {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(4px);
}
.btn--light:hover { background: #fff; color: var(--sauge-900); }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-top: var(--space-8);
}

/* Lien fléché */
.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  font-weight: 600;
  font-size: var(--fs-sm);
  text-decoration: none;
  color: var(--accent-strong);
}
.arrow-link svg { transition: transform var(--transition); }
.arrow-link:hover svg { transform: translateX(4px); }

/* --------------------------------------------------------------------------
   6. Accessibilité
   -------------------------------------------------------------------------- */
:focus-visible {
  outline: 2.5px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100%;
  z-index: 200;
  background: var(--accent);
  color: #fff;
  padding: 0.7rem 1.1rem;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
  transition: top var(--transition);
}
.skip-link:focus { top: 0; color: #fff; }

.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;
}

/* --------------------------------------------------------------------------
   7. Animations — apparition au défilement
   -------------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
.reveal--left { transform: translateX(-34px); }
.reveal--right { transform: translateX(34px); }
.reveal--scale { transform: scale(0.94); }

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal--left,
  .reveal--right,
  .reveal--scale {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* Utilitaires */
.text-center { text-align: center; }
.mx-auto { margin-inline: auto; }
.accent { color: var(--accent-strong); }
.serif { font-family: var(--serif); }
