/* ============================================================
   Base — reset léger, body, typography defaults
   ============================================================ */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  hanging-punctuation: first last;
}

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

body {
  background-color: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-relaxed);
  font-feature-settings: 'kern', 'liga', 'calt';
  text-underline-offset: 0.18em;
  text-decoration-thickness: from-font;
  min-height: 100dvh;
}

/* === Typographie globale === */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-display);
  color: var(--ink-primary);
  text-wrap: balance;
}

h1 { font-size: var(--text-3xl); font-weight: var(--weight-medium); }
h2 { font-size: var(--text-2xl); font-weight: var(--weight-medium); }
h3 { font-size: var(--text-xl); font-weight: var(--weight-medium); }
h4 { font-size: var(--text-lg); font-weight: var(--weight-medium); }
h5 { font-size: var(--text-md); font-weight: var(--weight-semibold); }
h6 { font-size: var(--text-base); font-weight: var(--weight-semibold); }

p {
  max-width: var(--max-prose);
  text-wrap: pretty;
}

p + p {
  margin-top: 1em;
}

strong, b {
  font-weight: var(--weight-semibold);
}

em, i {
  font-style: italic;
}

small {
  font-size: var(--text-sm);
  color: var(--ink-secondary);
}

/* === Liens === */

a {
  color: var(--link);
  text-decoration: none;
  transition: color var(--duration-fast) var(--easing-out);
}

a:hover, a:focus-visible {
  color: var(--link-hover);
}

a:focus-visible {
  outline: 2px solid var(--accent-deep);
  outline-offset: 4px;
  border-radius: var(--radius-xs);
}

/* === Listes === */

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

li + li {
  margin-top: 0.4em;
}

/* === Images & média === */

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

img {
  font-style: italic;
  background-repeat: no-repeat;
  background-size: cover;
  shape-margin: 1rem;
}

/* === Focus === */

button, [role="button"], input, select, textarea {
  font: inherit;
  color: inherit;
}

:focus {
  outline: none;
}

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

/* === Sélection === */

::selection {
  background-color: var(--accent-soft);
  color: var(--ink-primary);
}

/* === Scrollbar (subtle, brand-tinted) === */

@media (pointer: fine) {
  * {
    scrollbar-width: thin;
    scrollbar-color: var(--stroke-strong) transparent;
  }
}

/* === Skip link (accessibilité) === */

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-md);
  background-color: var(--ink-primary);
  color: var(--surface-cream);
  padding: var(--space-sm) var(--space-md);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  border-radius: var(--radius-sm);
  z-index: var(--z-toast);
  transition: top var(--duration-base) var(--easing-out);
}

.skip-link:focus {
  top: var(--space-md);
}

/* === Hidden visually mais lu par screen readers === */

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

/* === Quote === */

blockquote {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: var(--weight-regular);
  font-size: var(--text-xl);
  line-height: var(--leading-snug);
  color: var(--ink-primary);
  max-width: var(--max-narrow);
}

blockquote cite {
  display: block;
  margin-top: var(--space-md);
  font-family: var(--font-body);
  font-style: normal;
  font-size: var(--text-2xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--ink-tertiary);
}

/* === HR séparateur fin === */

hr {
  border: 0;
  border-top: var(--hairline) solid var(--stroke-soft);
  margin-block: var(--space-2xl);
}

/* === Helpers texte === */

.eyebrow {
  font-family: var(--font-body);
  font-size: var(--text-2xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--ink-secondary);
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
}

.eyebrow::before {
  content: '';
  width: 1.25rem;
  height: var(--hairline);
  background-color: var(--stroke-strong);
}

.lede {
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
  color: var(--ink-secondary);
  max-width: var(--max-prose);
}

.section-number {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-sm);
  font-weight: var(--weight-regular);
  color: var(--ink-tertiary);
  letter-spacing: 0.05em;
}
