/* =====================================================================
   EMPIRIC — L'atelier franc · Design tokens
   Sacha Gotainer — L'accès n'est pas l'adoption.
   ===================================================================== */

:root {
  /* ---- Couleurs ---- */
  --em-paper:       #f4efe6;  /* fond dominant (~90%) — neutre chaud  */
  --em-ink:         #2b2622;  /* texte / fonds sombres — noir chaud   */
  --em-clay:        #bc6440;  /* accent PRIMAIRE (marque, filets)     */
  --em-clay-light:  #d98a60;  /* terre cuite SUR fond encre           */
  --em-signal:      #e9e44a;  /* surligneur UNIQUEMENT (1 mot)        */
  --em-olive:       #7c7a4e;  /* tertiaire calme — rare               */

  /* sur papier */
  --em-on-paper-1:    #2b2622;
  --em-on-paper-2:    rgba(43, 38, 34, 0.62);
  --em-on-paper-mut:  rgba(43, 38, 34, 0.45);
  --em-hairline:      rgba(43, 38, 34, 0.14);

  /* sur encre */
  --em-on-ink-1:      #f4efe6;
  --em-on-ink-2:      rgba(244, 239, 230, 0.62);
  --em-on-ink-mut:    rgba(244, 239, 230, 0.45);
  --em-hairline-ink:  rgba(244, 239, 230, 0.14);

  /* ---- Typographie ---- */
  --em-font-voice: 'Newsreader', Georgia, serif;
  --em-font-frank: 'Space Grotesk', system-ui, sans-serif;
  --em-font-body:  'Hanken Grotesk', system-ui, sans-serif;
  --em-font-mono:  'JetBrains Mono', ui-monospace, monospace;

  --em-fs-display: clamp(2.75rem, 6vw, 4.25rem);
  --em-fs-h1:      clamp(2rem, 4vw, 2.75rem);
  --em-fs-h2:      clamp(1.5rem, 3vw, 2rem);
  --em-fs-h3:      1.25rem;
  --em-fs-lead:    1.25rem;
  --em-fs-body:    1.0625rem;
  --em-fs-small:   0.9375rem;
  --em-fs-label:   0.72rem;
  --em-fs-micro:   0.625rem;

  --em-lh-display: 1.0;
  --em-lh-title:   1.02;
  --em-lh-h2:      1.05;
  --em-lh-h3:      1.2;
  --em-lh-lead:    1.4;
  --em-lh-body:    1.6;

  --em-ls-title:   -0.015em;
  --em-ls-punch:   -0.03em;
  --em-ls-label:   0.2em;
  --em-ls-mono:    0.16em;

  /* ---- Rayons ---- */
  --em-r-sm:   4px;
  --em-r-md:   5px;
  --em-r-lg:   8px;
  --em-r-pill: 9999px;

  /* ---- Espacement (base 4) ---- */
  --em-sp-xs:  4px;
  --em-sp-sm:  8px;
  --em-sp-md:  12px;
  --em-sp-lg:  18px;
  --em-sp-xl:  28px;
  --em-sp-2xl: 44px;

  /* ---- Grille web (créée pour cette surface) ---- */
  --em-w-text:    42rem;
  --em-w-content: 60rem;
  --em-w-page:    76rem;
  --em-gutter:    24px;
  --em-section-y: 88px;

  /* ---- Motion ---- */
  --em-ease:   cubic-bezier(0.2, 0.7, 0.3, 1);
  --em-dur:    200ms;
  --em-bumper: 1200ms;
}

@media (min-width: 900px) {
  :root {
    --em-gutter: 40px;
    --em-section-y: 128px;
  }
}

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

/* =====================================================================
   BASE
   ===================================================================== */

body {
  background: var(--em-paper);
  color: var(--em-on-paper-1);
  font-family: var(--em-font-body);
  font-size: var(--em-fs-body);
  line-height: var(--em-lh-body);
  -webkit-font-smoothing: antialiased;
}

p { text-wrap: pretty; }

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

*:focus-visible {
  outline: 2px solid var(--em-clay);
  outline-offset: 2px;
}

/* =====================================================================
   CLASSES UTILITAIRES
   ===================================================================== */

/* Surtitre mono — UPPERCASE, tracking large */
.em-kicker {
  font-family: var(--em-font-mono);
  font-weight: 500;
  font-size: var(--em-fs-label);
  letter-spacing: var(--em-ls-label);
  text-transform: uppercase;
  color: var(--em-clay);
}
.em-kicker--on-ink { color: var(--em-clay-light); }

/* Surligneur — surligne UN mot, jamais un bloc décoratif */
.em-mark {
  background: var(--em-signal);
  color: var(--em-ink);
  padding: 0 0.28em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* Titre éditorial (la voix) */
.em-title {
  font-family: var(--em-font-voice);
  font-weight: 600;
  line-height: var(--em-lh-title);
  letter-spacing: var(--em-ls-title);
  color: var(--em-ink);
  text-wrap: balance;
}
.em-title--italic { font-style: italic; font-weight: 400; }

/* Punchline franche */
.em-punch {
  font-family: var(--em-font-frank);
  font-weight: 700;
  line-height: var(--em-lh-h3);
  letter-spacing: var(--em-ls-punch);
  color: var(--em-ink);
}

/* Citation */
.em-quote {
  font-family: var(--em-font-voice);
  font-style: italic;
  font-weight: 400;
  line-height: var(--em-lh-lead);
  color: var(--em-ink);
}

/* Corps de texte */
.em-body {
  font-family: var(--em-font-body);
  font-weight: 400;
  line-height: var(--em-lh-body);
  color: var(--em-on-paper-1);
}

/* Folio / compteur */
.em-folio {
  font-family: var(--em-font-mono);
  font-weight: 500;
  font-size: var(--em-fs-micro);
  letter-spacing: 0.1em;
  color: var(--em-on-paper-mut);
}

/* Carré de marque — rayon = 0.16 × taille */
.em-square {
  width: 32px; height: 32px;
  background: var(--em-clay);
  border-radius: calc(32px * 0.16);
}

/* Filet d'accent sous un surtitre */
.em-rule {
  width: 44px; height: 0;
  border-top: 2px solid var(--em-clay);
  margin: var(--em-sp-md) 0 var(--em-sp-lg);
}

/* Section à fond encre */
.em-section--ink {
  background: var(--em-ink);
  color: var(--em-on-ink-1);
}
.em-section--ink .em-title,
.em-section--ink .em-punch,
.em-section--ink .em-quote { color: var(--em-on-ink-1); }

/* Boutons */
.em-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 var(--em-sp-xl);
  font-family: var(--em-font-body); font-weight: 600;
  border-radius: var(--em-r-md);
  transition: background var(--em-dur) var(--em-ease),
              border-color var(--em-dur) var(--em-ease);
}
.em-btn--primary {
  background: var(--em-ink); color: var(--em-paper); border: 1px solid var(--em-ink);
}
.em-btn--primary:hover { background: var(--em-clay); border-color: var(--em-clay); }
.em-btn--secondary {
  background: transparent; color: var(--em-ink); border: 1px solid var(--em-hairline);
}
.em-btn--secondary:hover { border-color: var(--em-clay); }

/* Carte — filet, jamais d'ombre */
.em-card {
  background: var(--em-paper);
  border: 1px solid var(--em-hairline);
  border-radius: var(--em-r-lg);
  padding: var(--em-sp-xl);
}

/* Lien dans le corps de texte */
.em-body a, .em-prose a {
  color: var(--em-ink);
  text-decoration: underline;
  text-decoration-color: var(--em-clay);
  text-underline-offset: 3px;
}
.em-body a:hover, .em-prose a:hover { text-decoration-thickness: 2px; }
