/* Socle : polices, reset léger, typographie, conteneurs, sections, utilitaires. */

/* Polices de l'app (dsm/fonts, licence OFL), sous-ensemble latin servi depuis
   le site : la page n'appelle aucun tiers. Régénérées par tools/gen-assets.sh. */
@font-face {
  font-family: 'Bangers';
  src: url('../assets/fonts/bangers-latin.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Nunito';
  src: url('../assets/fonts/nunito-700-latin.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Nunito';
  src: url('../assets/fonts/nunito-800-latin.woff2') format('woff2');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Nunito';
  src: url('../assets/fonts/nunito-900-latin.woff2') format('woff2');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

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

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--text);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: var(--display-spacing);
  line-height: 1;
  text-wrap: balance;
}

h2 {
  font-size: clamp(2.4rem, 6vw, 3.6rem);
}

h3 {
  font-size: 1.75rem;
}

p,
ul,
ol {
  margin: 0;
}

p {
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input {
  font: inherit;
}

:focus-visible {
  outline: var(--stroke-panel) solid var(--panel-border);
  outline-offset: 3px;
}

/* ---------- Texte contouré (StrokeText) ---------- */

/* Remplissage blanc, contour à l'encre, ombre portée dure. `paint-order` peint
   le contour sous le remplissage : sa demi-épaisseur intérieure est couverte,
   d'où le trait doublé. */
.hero-text {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: var(--display-spacing);
  color: var(--hero-text);
  -webkit-text-stroke: calc(var(--stroke-text-hero) * 2) var(--ink);
  paint-order: stroke fill;
  text-shadow: var(--offset-row) var(--offset-row) 0 var(--hard-shadow);
}

/* ---------- Conteneurs & sections ---------- */

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

.section {
  padding-block: var(--section-y);
}

.section-head {
  max-width: 680px;
  margin: 0 auto clamp(2.5rem, 6vw, 4rem);
  display: grid;
  justify-items: center;
  gap: 1.1rem;
  text-align: center;
}

.section-head h2 {
  transform: rotate(var(--tilt-hero));
}

/* Convention : les règles génériques d'un composant ne ciblent que les
   paragraphes sans classe, pour ne jamais écraser une variante nommée. */
.section-head p:not([class]) {
  font-size: 1.15rem;
  color: var(--text-soft);
  text-wrap: balance;
}

.section-foot {
  max-width: 640px;
  margin: clamp(2.5rem, 6vw, 3.5rem) auto 0;
  text-align: center;
  font-weight: 900;
  font-size: 1.25rem;
  line-height: 1.35;
  text-wrap: balance;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--panel);
  color: var(--text);
  border: var(--stroke-panel) solid var(--panel-border);
}

.skip-link:focus {
  left: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.sprite {
  display: none;
}

/* ---------- Révélation au défilement (seulement si le JS tourne) ---------- */

html.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity var(--duration-reveal) ease,
    transform var(--duration-reveal) var(--ease-back);
}

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

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

  html.js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
