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

* {
  margin: 0;
}

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

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

body {
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.55;
  color: var(--color-stone-4);
  background: var(--color-paper);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Empêche le scroll horizontal créé par le menu off-canvas (translateX hors écran). */
  overflow-x: clip;
}

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

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

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

a {
  color: var(--color-ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
}

a:hover {
  color: var(--color-accent);
}

h1, h2, h3, h4 {
  font-family: var(--font-sans);
  color: var(--color-ink);
  line-height: 1.05;
  font-weight: 500;
  letter-spacing: -0.02em;
}

h1 { font-size: var(--step-6); }
h2 { font-size: var(--step-5); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); font-weight: 600; letter-spacing: -0.01em; }

p {
  max-width: 65ch;
}

ul, ol {
  padding-left: 1.2em;
}

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

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

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

/* Helpers */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.section {
  padding-block: var(--space-3xl);
}

.section--tight {
  padding-block: var(--space-2xl);
}

.section--stone {
  background: var(--color-stone-1);
}

.section--ink {
  background: var(--color-ink);
  color: var(--color-stone-2);
}

.section--ink h1,
.section--ink h2,
.section--ink h3,
.section--ink h4 {
  color: var(--color-paper);
}

/* Label en monospace, alternative aux eyebrows uppercase systématiques */
.label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--color-stone-3);
  font-weight: 400;
  margin-bottom: var(--space-m);
}

.label--accent {
  color: var(--color-accent);
}

.lead {
  font-size: var(--step-1);
  color: var(--color-stone-4);
  max-width: 60ch;
  line-height: 1.5;
}

.section--ink .lead {
  color: var(--color-stone-2);
}

.visually-hidden {
  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(--space-s);
  background: var(--color-ink);
  color: var(--color-paper);
  padding: var(--space-2xs) var(--space-s);
  z-index: 100;
  transition: top var(--t-fast) var(--ease);
}

.skip-link:focus {
  top: var(--space-s);
  color: var(--color-paper);
}

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

/* ============================================
   Reveal au scroll : fade-up subtil orchestré en JS via IntersectionObserver.
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 1600ms cubic-bezier(0.19, 1, 0.22, 1) var(--reveal-delay, 0ms),
    transform 1600ms cubic-bezier(0.19, 1, 0.22, 1) var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

.reveal.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Le contenu d'un hero est visible d'emblée : pas de reveal au scroll. */
.hero .reveal,
.page-hero .reveal {
  opacity: 1;
  transform: none;
  transition: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
