/* ==========================================================================
   BASE — reset, typographie de fond, accessibilité, textures
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  /* Les ancres (#accueil, #categorie…) ne doivent pas passer sous le
     bandeau démo ni sous le header collant. */
  scroll-padding-top: calc(var(--demo-bar-h) + var(--header-h) + var(--sp-4));
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--bg-page);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

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

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

button { cursor: pointer; }

a { color: inherit; }

/* --- Texture kraft ----------------------------------------------------
   Grain de papier généré en SVG (aucune image à charger), posé en overlay
   fixe sur toute la page : il donne au fond crème une matière de sachet
   kraft plutôt qu'un aplat numérique plat.
   ------------------------------------------------------------------------ */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: var(--z-watermark);
  pointer-events: none;
  opacity: 0.5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)' opacity='0.3'/%3E%3C/svg%3E");
}

/* --- Filigrane DÉMO ------------------------------------------------------
   Trame diagonale très pâle façon tampon encreur, purement décorative,
   jamais cliquable, retirée à l'impression.
   ------------------------------------------------------------------------ */
.demo-watermark {
  position: fixed;
  inset: 0;
  z-index: var(--z-watermark);
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Ctext x='130' y='130' font-family='Georgia,serif' font-size='25' font-weight='700' letter-spacing='5' fill='%232d2418' text-anchor='middle' transform='rotate(-28 130 130)'%3ED%C3%89MO%3C/text%3E%3C/svg%3E");
}

/* --- Titres --------------------------------------------------------------
   Caveat est une script manuscrite : elle a besoin d'un poids marqué et
   d'un interlignage plus généreux qu'une serif pour rester lisible en gros.
   ------------------------------------------------------------------------ */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-heading);
  line-height: var(--lh-title);
}

h1 { font-size: var(--fs-h1); letter-spacing: var(--ls-display); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); font-family: var(--font-body); font-weight: 700; }

/* Mot mis en avant dans un titre : encre brique, esprit surligné au feutre */
.ink-accent { color: var(--c-brique); }

/* --- Éléments de texte récurrents ---------------------------------------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  font-family: var(--font-stamp);
  font-size: var(--fs-sm);
  font-weight: 400;
  letter-spacing: var(--ls-eyebrow);
  color: var(--c-sauge-deep);
}

.eyebrow::before {
  content: "";
  width: 26px;
  height: 2px;
  background: currentColor;
  opacity: 0.6;
  border-radius: var(--radius-pill);
}

.eyebrow--on-dark { color: var(--c-moutarde-soft); }

.lead {
  font-size: var(--fs-lead);
  color: var(--text-muted);
  max-width: 62ch;
}

.muted { color: var(--text-muted); }

strong, b { font-weight: 700; }

code {
  padding: 1px 5px;
  background: var(--c-kraft);
  border-radius: 2px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  color: var(--c-ink);
}

/* --- Accessibilité --------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--c-brique);
  outline-offset: 3px;
  border-radius: 2px;
}

.sr-only {
  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(--sp-4);
  z-index: 400;
  padding: var(--sp-3) var(--sp-5);
  background: var(--c-ardoise);
  color: var(--text-on-dark);
  font-size: var(--fs-sm);
  letter-spacing: 0.04em;
  text-decoration: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  transition: top var(--dur-fast) var(--ease-out);
}

.skip-link:focus { top: 0; }

/* --- Impression -------------------------------------------------------------
   La page produits est la plus souvent imprimée : on retire le décor et on
   passe le texte en noir sur blanc.
   ------------------------------------------------------------------------ */
@media print {
  body::before,
  .demo-watermark,
  .demo-bar,
  .site-header,
  .site-footer,
  .mobile-menu { display: none !important; }

  body { background: #fff; color: #000; }
}
