/* ============================================================================
   base.css · Réinitialisation, typographie, primitives de mise en page
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--line-2) transparent;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

a { color: inherit; text-decoration: none; }

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

::selection { background: var(--accent); color: #fff; }

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

/* ------------------------------ Titres -------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-tight);
  color: var(--ink);
  text-wrap: balance;
}
h1 { font-size: var(--text-2xl); line-height: var(--leading-tight); }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-lg); }
h4 { font-size: var(--text-md); letter-spacing: -0.01em; }

p { text-wrap: pretty; }
strong, b { font-weight: 700; }

/* ------------------------- Disposition -------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap--text { max-width: var(--container-text); }

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

/* décale les ancres sous l'en-tête sticky */
[id] { scroll-margin-top: calc(var(--header-h) + 1.5rem); }

/* ------------------------------ Helpers ------------------------------- */
/* Petit label en capitales (remplace le mono de l'ancienne DA) */
.label {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--ink-3);
}
.label--accent { color: var(--accent-ink); }
.label__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }

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

/* Lien souligné discret (corps de texte) */
.link {
  color: var(--accent-ink);
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1.5px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size var(--dur-2) var(--ease);
}
.link:hover, .link:focus-visible { background-size: 100% 1.5px; }

/* Flèche qui avance au survol (boutons / liens-cartes) */
.arrow { display: inline-block; transition: transform var(--dur-2) var(--ease); }

/* En-tête de section : label + grand titre */
.section-head { display: grid; gap: var(--space-4); margin-bottom: var(--space-8); max-width: 22ch; }
.section-head--wide { max-width: none; }

/* Prose (pages projet) */
.prose p { margin-bottom: 1.15em; color: var(--ink-2); }
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--ink); }
.prose .lead { font-size: var(--text-md); color: var(--ink); line-height: 1.5; }

/* ------------------------- Accessibilité ------------------------------ */
.visually-hidden {
  position: absolute !important; 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; left: var(--space-4); top: -100%; z-index: var(--z-top);
  background: var(--ink); color: var(--bg);
  padding: 0.7em 1.1em; border-radius: var(--radius-sm); font-size: var(--text-sm); font-weight: 600;
  transition: top var(--dur-1) var(--ease);
}
.skip-link:focus { top: var(--space-4); }

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