/* ==========================================================================
   BASE — réinitialisation, typographie de fond, primitives de mise en page
   Chargé après tokens.css, avant components.css.
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--h-header) + var(--sp-24));
}

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

body {
  margin: 0;
  background: var(--c-white);
  color: var(--c-body);
  font-family: var(--ff-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;               /* filet de sécurité : aucun défilement latéral */
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: var(--ff-display);
  font-weight: 700;
  line-height: var(--lh-title);
  color: var(--c-ink);
  /* Pas de text-wrap:balance : il modifie les césures et donc le découpage
     des lignes de la maquette. */
}

/* Réinitialisation des marges par défaut du navigateur.
   `figure` et `blockquote` portent un `margin: 1em 40px` qui ajoutait ici
   plus de 80 px de dérive sur la page — à ne surtout pas oublier. */
p, figure, blockquote, figcaption, address, dl, dd, fieldset, pre {
  margin: 0;
  padding: 0;
}
ul, ol { margin: 0; padding: 0; list-style: none; }
fieldset { border: 0; }
address { font-style: normal; }
hr { margin: 0; border: 0; }

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

/* `picture` est inline par défaut : le passer en block évite l'espace
   fantôme sous l'image et permet de lui appliquer la mise en page. */
img, svg, picture, video { display: block; max-width: 100%; }
img { height: auto; }

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

strong, b { font-weight: 600; }

::selection {
  background: var(--c-gold);
  color: var(--c-white);
}

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

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

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

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--sp-16);
  z-index: 999;
  padding: var(--sp-12) var(--sp-24);
  background: var(--c-navy);
  color: var(--c-white);
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: 600;
  transition: top var(--t-fast);
}
.skip-link:focus { top: var(--sp-16); }

/* --------------------------------------------------------------------------
   Primitives de mise en page
   Au format 1440 px de la maquette : padding 120 px et contenu de 1200 px.
   4vw vaut 57,6 px à 1440 px : la boîte disponible dépasse 1200 px, le
   conteneur est donc bien centré à 120 px du bord — identique à Figma.
   -------------------------------------------------------------------------- */

.section {
  padding-inline: clamp(20px, 4vw, 64px);
}

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

/* Pile verticale générique — reproduit les `gap` des auto-layouts Figma */
.stack        { display: flex; flex-direction: column; }
.stack-8      { gap: var(--sp-8); }
.stack-10     { gap: var(--sp-10); }
.stack-12     { gap: var(--sp-12); }
.stack-16     { gap: var(--sp-16); }
.stack-24     { gap: var(--sp-24); }
.stack-32     { gap: var(--sp-32); }
.stack-48     { gap: var(--sp-48); }
.stack-56     { gap: var(--sp-56); }

.row          { display: flex; align-items: center; }
.row-center   { justify-content: center; }
.row-between  { justify-content: space-between; }

.text-center  { text-align: center; }

/* --------------------------------------------------------------------------
   Échelle typographique issue de la maquette
   -------------------------------------------------------------------------- */

.t-hero    { font-size: var(--fs-hero);   line-height: var(--lh-title); }
.t-h2-xl   { font-size: var(--fs-h2-xl);  line-height: var(--lh-title); }
.t-h2      { font-size: var(--fs-h2);     line-height: var(--lh-title); }
.t-h3      { font-size: var(--fs-h3);     line-height: var(--lh-title); }
.t-h4      { font-size: var(--fs-h4);     line-height: var(--lh-title); }
.t-h5      { font-size: var(--fs-h5);     line-height: var(--lh-title); }
.t-h6      { font-size: var(--fs-h6);     line-height: var(--lh-title); }

.t-lead    { font-size: var(--fs-lead);   line-height: var(--lh-normal); font-weight: 500; }
.t-body    { font-size: var(--fs-body);   line-height: var(--lh-body); }
.t-sm      { font-size: var(--fs-sm);     line-height: var(--lh-body); }
.t-xs      { font-size: var(--fs-xs);     line-height: var(--lh-body); }

.t-white   { color: var(--c-white); }
.t-ink     { color: var(--c-ink); }
.t-body-c  { color: var(--c-body); }
