/* ==========================================================================
   Réinitialisation et éléments de base
   ========================================================================== */

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

* { margin: 0; }

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

body {
  background: var(--surface);
  color: var(--on-surface);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: var(--leading-body);
  font-weight: 300;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body[data-menu-open] { overflow: hidden; }

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

img { height: auto; }

input, button, textarea, select { font: inherit; color: inherit; }

button { background: none; border: 0; cursor: pointer; }

p, li { text-wrap: pretty; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--leading-tight);
  letter-spacing: -0.018em;
  text-wrap: balance;
  font-optical-sizing: auto;
}

h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }

a {
  color: inherit;
  text-decoration: none;
  text-underline-offset: 0.22em;
}

ul, ol { padding: 0; list-style: none; }

hr {
  border: 0;
  border-top: 1px solid var(--line);
}

/* Les ordinaux (16ᵉ, 1ʳᵉ) sont composés en balisage plutôt qu'avec les lettres
   modificatives Unicode : celles-ci obligeraient le navigateur à télécharger en
   plus les sous-ensembles latin-ext de chaque police (~200 Ko). */
sup {
  font-size: 0.55em;
  line-height: 0;
  vertical-align: 0.55em;
  letter-spacing: 0;
}

::selection {
  background: var(--ink);
  color: var(--ivory);
}

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

/* Lien d'évitement pour la navigation au clavier */
.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 200;
  padding: 0.6rem 1.1rem;
  background: var(--ink);
  color: var(--ivory);
  border-radius: var(--radius-pill);
  font-size: var(--step--1);
  transform: translateY(-200%);
  transition: transform var(--dur-fast) var(--ease);
}

.skip-link:focus-visible { transform: translateY(0); }

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

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