/* ==========================================================================
   Socle — reset, typographie, grille, utilitaires
   ========================================================================== */

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

* { margin: 0; padding: 0; }

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

body {
  font-family: var(--font-sans);
  font-size: var(--t-body);
  font-weight: 400;
  line-height: 1.65;
  color: var(--text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  /* Les chiffres s'alignent partout : c'est un site de fiduciaire */
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

img, picture, svg, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
ul, ol { list-style: none; }

/* --- Titres -------------------------------------------------------------- */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: var(--track-display);
  color: var(--navy);
  text-wrap: balance;
}

h1 { font-size: var(--t-h1); }
h2 { font-size: var(--t-h2); }
h3 { font-size: var(--t-h3); line-height: 1.25; letter-spacing: -0.02em; }
h4 { font-size: 1.0625rem; line-height: 1.3; letter-spacing: -0.015em; }

/* --- Eyebrow : carré or + libellé, aligné à gauche ----------------------- */

.label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-sans);
  font-size: var(--t-label);
  font-weight: 600;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--gold-text);
}

.label::before {
  content: '';
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  background: var(--gold);
}

.on-dark .label,
.section--navy .label,
.section--navy-dark .label { color: var(--gold-light); }

/* --- Grille -------------------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section {
  padding: var(--section-pad) 0;
  position: relative;
}

.section--cream { background: var(--cream); }
.section--tight { padding: var(--s-7) 0; }

.section--navy { background: var(--navy); color: rgba(var(--white-rgb), 0.74); }
.section--navy-dark { background: var(--navy-dark); color: rgba(var(--white-rgb), 0.74); }

.section--navy h1, .section--navy h2, .section--navy h3, .section--navy h4,
.section--navy-dark h1, .section--navy-dark h2, .section--navy-dark h3, .section--navy-dark h4 {
  color: var(--white);
}

.section--navy,
.section--navy-dark { overflow: hidden; }

.section > .container { position: relative; z-index: var(--z-base); }

/* --- En-tête de section : index à gauche, contenu à droite --------------- */

.head {
  display: grid;
  grid-template-columns: var(--index-w) 1fr;
  gap: var(--col-gap);
  align-items: start;
  padding-bottom: var(--s-6);
  margin-bottom: var(--s-6);
  border-bottom: var(--hair);
}

.section--navy .head,
.section--navy-dark .head { border-bottom: var(--hair-dark); }

/* La contrainte doit porter sur le titre lui-même : l'unité ch se calcule
   sur la taille de police de l'élément, pas sur celle de son conteneur. */
.head__title > h2,
.head__title > h1 { max-width: 20ch; }

.head__note {
  grid-column: 2;
  margin-top: var(--s-3);
  font-size: var(--t-lead);
  line-height: 1.7;
  color: var(--muted);
  max-width: 58ch;
}

.section--navy .head__note,
.section--navy-dark .head__note { color: rgba(var(--white-rgb), 0.66); }

.lead {
  font-size: var(--t-lead);
  line-height: 1.75;
  color: var(--muted);
}

.section--navy .lead,
.section--navy-dark .lead { color: rgba(var(--white-rgb), 0.7); }

/* --- Accessibilité ------------------------------------------------------- */

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--gutter);
  z-index: var(--z-top);
  background: var(--gold);
  color: var(--navy-dark);
  padding: 12px 20px;
  font-size: var(--t-small);
  font-weight: 600;
  transition: top var(--dur) var(--ease);
}

.skip-link:focus { top: 14px; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

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

/* --- Révélations --------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
}

.reveal.is-visible { opacity: 1; transform: none; }

.stagger > * {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.stagger.is-visible > * { opacity: 1; transform: none; }
.stagger.is-visible > *:nth-child(1) { transition-delay: 0.04s; }
.stagger.is-visible > *:nth-child(2) { transition-delay: 0.09s; }
.stagger.is-visible > *:nth-child(3) { transition-delay: 0.14s; }
.stagger.is-visible > *:nth-child(4) { transition-delay: 0.19s; }
.stagger.is-visible > *:nth-child(5) { transition-delay: 0.24s; }
.stagger.is-visible > *:nth-child(6) { transition-delay: 0.29s; }

@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;
  }
  .reveal, .stagger > * { opacity: 1 !important; transform: none !important; }
}

/* --- Responsive ---------------------------------------------------------- */

@media (max-width: 900px) {
  .head {
    grid-template-columns: 1fr;
    gap: var(--s-4);
    padding-bottom: var(--s-5);
    margin-bottom: var(--s-5);
  }
  .head__note { grid-column: 1; }
}
