/* =============================================================
   base.css — reset sobre + typographie de base
   Charge tokens.css avant.
   ============================================================= */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
  -webkit-tap-highlight-color: transparent;
}

body, h1, h2, h3, h4, h5, h6, p, blockquote, figure, dl, dd, ol, ul, hr, pre {
  margin: 0;
}

ul, ol { padding: 0; }

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

img, picture { font-style: italic; } /* alt italique si image cassée */

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

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

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

table { border-collapse: collapse; width: 100%; }

[hidden] { display: none !important; }

/* ----------------------- Body / page ----------------------- */
html, body { height: 100%; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--ff-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: var(--fw-regular);
  font-feature-settings: "kern", "liga", "calt", "onum";
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ----------------------- Selection ----------------------- */
::selection {
  background: var(--selection-bg);
  color: var(--selection-fg);
}

::-moz-selection {
  background: var(--selection-bg);
  color: var(--selection-fg);
}

/* ----------------------- Headings ----------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--ff-display);
  font-weight: var(--fw-regular);
  color: var(--ink);
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-h1);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  margin-bottom: var(--space-5);
}

h2 {
  font-size: var(--fs-h2);
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-tight);
  margin-top: var(--rhythm-block);
  margin-bottom: var(--space-4);
}

h3 {
  font-size: var(--fs-h3);
  line-height: var(--lh-normal);
  margin-top: var(--space-6);
  margin-bottom: var(--space-3);
}

h4 {
  font-size: var(--fs-h4);
  line-height: var(--lh-normal);
  margin-top: var(--space-5);
  margin-bottom: var(--space-2);
}

h5, h6 {
  font-size: var(--fs-body);
  line-height: var(--lh-normal);
  font-family: var(--ff-mono);
  text-transform: uppercase;
  letter-spacing: var(--ls-caps);
  font-weight: var(--fw-regular);
  margin-top: var(--space-5);
  margin-bottom: var(--space-2);
}

/* H1 hero (manifesto) déclinaison plus grande, regular jamais bold */
.h-display {
  font-family: var(--ff-display);
  font-weight: var(--fw-regular);
  font-style: italic;
  font-size: var(--fs-display);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
}

/* ----------------------- Paragraphes ----------------------- */
p {
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  max-width: var(--max-prose);
  margin-bottom: var(--rhythm-para);
  text-wrap: pretty;
  hyphens: auto;
  -webkit-hyphens: auto;
}

p.lead {
  font-size: var(--fs-body-lg);
  line-height: var(--lh-relaxed);
  font-style: italic;
  color: var(--ink);
  max-width: var(--max-prose-narrow);
}

/* Pas de bold dans le corps : hiérarchie = taille + espace + couleur */
strong, b {
  font-weight: var(--fw-regular);
  font-style: italic;
  color: var(--ink);
}

em, i {
  font-style: italic;
}

/* Petits caractères, métadonnées */
small {
  font-size: var(--fs-small);
  color: var(--ink-70);
}

/* ----------------------- Listes ----------------------- */
ul, ol {
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  padding-left: 1.25em;
  margin-bottom: var(--rhythm-para);
  max-width: var(--max-prose);
}

ul { list-style: none; padding-left: 0; }

ul > li {
  position: relative;
  padding-left: 1.5em;
  margin-bottom: 0.5em;
}

ul > li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--ink-60);
  font-family: var(--ff-mono);
}

ol > li {
  margin-bottom: 0.5em;
  padding-left: 0.5em;
}

li > ul, li > ol { margin-top: 0.5em; margin-bottom: 0; }

/* ----------------------- Liens ----------------------- */
a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  text-decoration-color: var(--ink-40);
  transition: text-decoration-color var(--t-base) var(--ease-out),
              color var(--t-base) var(--ease-out);
}

a:hover, a:focus-visible {
  text-decoration-color: var(--ink);
  color: var(--ink);
}

a:visited { color: inherit; }

/* Liens sans soulignement (réservé aux contextes nav/cards où le contexte est clair) */
a.is-bare {
  text-decoration: none;
}
a.is-bare:hover, a.is-bare:focus-visible {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

/* ----------------------- Citations ----------------------- */
blockquote {
  font-family: var(--ff-display);
  font-style: italic;
  font-size: var(--fs-body-lg);
  line-height: var(--lh-relaxed);
  color: var(--ink-90);
  max-width: var(--max-prose-narrow);
  padding-left: var(--space-4);
  border-left: var(--bw) solid var(--ink);
  margin: var(--rhythm-block) 0;
}

blockquote cite {
  display: block;
  margin-top: var(--space-3);
  font-family: var(--ff-mono);
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: var(--ls-caps);
  font-size: var(--fs-meta);
  color: var(--ink-60);
}
blockquote cite::before { content: "— "; }

/* ----------------------- HR ----------------------- */
hr {
  border: 0;
  height: 1px;
  background: var(--ink-20);
  margin: var(--rhythm-block) 0;
  max-width: var(--max-content);
}

hr.is-narrow {
  width: 64px;
  margin-left: 0;
  background: var(--ink);
}

/* ----------------------- Code / pre ----------------------- */
code, kbd, samp, pre {
  font-family: var(--ff-mono);
  font-size: 0.9em;
  background: var(--paper-deep);
  padding: 0.1em 0.4em;
}

pre {
  padding: var(--space-3);
  overflow-x: auto;
}

pre code { background: transparent; padding: 0; }

/* ----------------------- Figures / captions ----------------------- */
figure {
  margin: var(--rhythm-block) 0;
}

figcaption {
  font-family: var(--ff-mono);
  font-size: var(--fs-meta);
  text-transform: uppercase;
  letter-spacing: var(--ls-caps);
  color: var(--ink-60);
  margin-top: var(--space-2);
}

/* ----------------------- Lettrine helper ----------------------- */
/* Placée sur le 1er <p> d'un main éditorial.
   Usage : <p class="lettrine">…</p>  OU  .prose > p:first-of-type::first-letter */
.lettrine::first-letter,
.prose > p:first-of-type::first-letter {
  font-family: var(--ff-display);
  font-weight: var(--fw-regular);
  font-size: 4.5em;
  line-height: 0.85;
  float: left;
  padding: 0.05em 0.12em 0 0;
  margin-right: 0.04em;
  color: var(--ink);
  font-feature-settings: "lnum";
}

/* ----------------------- Skip link ----------------------- */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-3);
  background: var(--ink);
  color: var(--paper);
  padding: var(--space-2) var(--space-3);
  z-index: var(--z-modal);
  font-family: var(--ff-mono);
  font-size: var(--fs-meta);
  text-transform: uppercase;
  letter-spacing: var(--ls-caps);
  text-decoration: none;
  transition: top var(--t-fast) var(--ease-out);
}
.skip-link:focus {
  top: var(--space-3);
  outline: var(--focus-width) solid var(--paper);
  outline-offset: 2px;
}

/* ----------------------- Focus outline (réutilisable) ----------------------- */
:focus-visible {
  outline: var(--focus-width) solid var(--ink);
  outline-offset: var(--focus-offset);
}

/* On ne tue JAMAIS l'outline sans remplacement */

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

/* ----------------------- High contrast (forced colors) ----------------------- */
@media (forced-colors: active) {
  a { text-decoration: underline; }
  :focus-visible { outline: 2px solid CanvasText; }
}

/* ----------------------- Visually hidden (a11y) ----------------------- */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}
