/* =========================================================================
   BASE — reset, typographie, layout, utilitaires
   ====================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
  -webkit-tap-highlight-color: transparent;
}

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

body {
  font-family: var(--font-sans);
  font-size: var(--fs-200);
  line-height: var(--lh-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  overflow-wrap: break-word;
}

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

input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }

ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }

a { color: var(--color-primary); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--color-primary-strong); }

:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

::selection { background: var(--c-amber-300); color: var(--c-green-950); }

/* ---- Typographie ---- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--lh-snug);
  letter-spacing: var(--tracking-tight);
  color: var(--color-ink);
  font-optical-sizing: auto;
  text-wrap: balance;
}
h1 { font-size: var(--fs-800); line-height: var(--lh-tight); }
h2 { font-size: var(--fs-600); }
h3 { font-size: var(--fs-400); }
h4 { font-size: var(--fs-300); }
p { text-wrap: pretty; }
strong { font-weight: 700; color: var(--color-ink); }

.font-display { font-family: var(--font-display); }
.italic { font-style: italic; }

/* ---- Layout ---- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--wide { max-width: var(--container-wide); }
.container--narrow { max-width: var(--container-narrow); }

.section { padding-block: var(--section-y); position: relative; }
.section--tight { padding-block: clamp(2.5rem, 2rem + 3vw, 4.5rem); }
.section--alt { background: var(--color-bg-alt); }
.section--dark {
  background: var(--grad-hero);
  color: var(--color-on-dark);
}
.section--surface { background: var(--color-surface); }

.section--dark h1, .section--dark h2, .section--dark h3, .section--dark h4 { color: var(--c-white); }
.section--dark .eyebrow { color: var(--c-amber-400); }
.section--dark a { color: var(--c-amber-300); }

.grid { display: grid; gap: var(--sp-6); }
.flow > * + * { margin-top: var(--sp-4); }
.flow-lg > * + * { margin-top: var(--sp-6); }

@media (min-width: 600px) {
  .cols-2 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 860px) {
  .cols-3 { grid-template-columns: repeat(3, 1fr); }
  .cols-2\@md { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1040px) {
  .cols-4 { grid-template-columns: repeat(4, 1fr); }
  .cols-3\@lg { grid-template-columns: repeat(3, 1fr); }
}

/* ---- En-tête de section ---- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-50);
  font-weight: 700;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--color-primary);
}
.eyebrow::before {
  content: "";
  width: 1.6rem;
  height: 2px;
  background: var(--color-accent);
  border-radius: 2px;
}
.eyebrow--center::before { display: none; }

.section-head { max-width: 62ch; margin-bottom: clamp(2rem, 1.5rem + 2vw, 3.5rem); }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head--row {
  max-width: none;
  display: flex; flex-wrap: wrap; align-items: flex-end;
  justify-content: space-between; gap: var(--sp-4);
}
.section-head .title { margin-top: var(--sp-3); }
.section-head .lead { margin-top: var(--sp-4); }

.lead {
  font-size: var(--fs-300);
  color: var(--color-muted);
  line-height: 1.6;
}

.text-accent { color: var(--color-accent); }
.text-primary { color: var(--color-primary); }
.text-muted { color: var(--color-muted); }

/* Mot surligné dans les titres */
.hl { position: relative; color: var(--color-primary); }
.hl--nowrap { white-space: nowrap; }
.hl--ink { color: inherit; }
.hl::after {
  content: "";
  position: absolute;
  left: -2px; right: -2px; bottom: 0.06em;
  height: 0.32em;
  background: var(--color-accent-soft);
  z-index: -1;
  border-radius: 2px;
  transform: skewX(-12deg) scaleX(var(--hl, 1));
  transform-origin: left;
  opacity: 0.85;
}

/* ---- Médias / placeholders photos ---- */
.media {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-md);
  aspect-ratio: var(--ph-ratio, 4 / 3);
  background: var(--color-bg-alt);
}
.media img { width: 100%; height: 100%; object-fit: cover; }
.media--placeholder {
  display: grid;
  place-content: center;
  gap: var(--sp-3);
  text-align: center;
  padding: var(--sp-5);
  color: color-mix(in srgb, var(--c-green-900) 55%, transparent);
  background:
    radial-gradient(120% 120% at 0% 0%, hsl(calc(140 + var(--ph-hue, 0)) 45% 92%) 0%, transparent 60%),
    linear-gradient(135deg, hsl(calc(140 + var(--ph-hue, 0)) 38% 90%), hsl(calc(40 + var(--ph-hue, 0)) 55% 90%));
}
.media--placeholder::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(currentColor 1px, transparent 1.4px);
  background-size: 18px 18px;
  opacity: 0.12;
}
.media__deco { position: relative; opacity: 0.7; display: grid; place-items: center; }
.media__label {
  position: relative;
  font-size: var(--fs-50);
  font-weight: 600;
  letter-spacing: 0.02em;
  max-width: 22ch;
  margin-inline: auto;
}
.media--round { border-radius: var(--r-lg); }
.media--blob { border-radius: 56% 44% 58% 42% / 48% 56% 44% 52%; }

/* ---- Utilitaires ---- */
.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;
}
.skip-link {
  position: absolute; top: -100px; left: var(--gutter);
  z-index: var(--z-top);
  background: var(--color-primary); color: #fff;
  padding: 0.6rem 1rem; border-radius: var(--r-sm);
  transition: top var(--t-base);
}
.skip-link:focus { top: 1rem; color: #fff; }

.text-center { text-align: center; }
.mx-auto { margin-inline: auto; }
.mt-0 { margin-top: 0; }
.mt-3 { margin-top: var(--sp-3); }
.mt-4 { margin-top: var(--sp-4); }
.mt-5 { margin-top: var(--sp-5); }
.mt-6 { margin-top: var(--sp-6); }
.mt-8 { margin-top: var(--sp-8); }
.mb-6 { margin-bottom: var(--sp-6); }
.maxw-prose { max-width: 65ch; }
.maxw-sm { max-width: 32rem; }
.hidden { display: none !important; }
.no-scroll { overflow: hidden; }
.icon--flip { transform: scaleX(-1); }

.cluster { display: flex; flex-wrap: wrap; gap: var(--sp-4); align-items: center; }
.cluster--center { justify-content: center; }

.divider {
  height: 1px;
  background: var(--color-border-soft);
  border: 0;
  margin-block: var(--sp-6);
}

/* Lignes décoratives en bordure de section */
.section--lined { border-top: 1px solid var(--color-border-soft); }
