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

/* Piège prod #8 : [hidden] doit rester invisible même avec display:flex défini ailleurs */
[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h-mobile);
}

body {
  margin: 0;
  font-family: var(--ff-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  /* Piège prod #11 : overflow-x:clip ne crée pas de conteneur de scroll → scroll vertical préservé */
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

/* TEX-2 Grain fin — SVG noise très léger */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

body > * { position: relative; z-index: 1; }

/* Piège prod #5 : figure reset obligatoire */
figure { margin: 0; }

img, video, iframe { max-width: 100%; }

h1, h2, h3, h4, h5 {
  font-family: var(--ff-display);
  line-height: 1.1;
  margin: 0;
  font-weight: 600;
  color: var(--text);
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

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

ul, ol { margin: 0; padding: 0; list-style: none; }

button {
  font-family: var(--ff-ui);
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}

/* Micro-détails propres */
::selection { background: var(--accent); color: #fff; }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-alt); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 4px; }

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

::placeholder { color: var(--text-mute); opacity: 1; }

/* Lettrine éditoriale sur premier paragraphe de l'à-propos */
.dropcap::first-letter {
  font-family: var(--ff-display);
  font-size: 3.4em;
  font-weight: 600;
  line-height: .75;
  float: left;
  margin: .05em .1em 0 0;
  color: var(--accent);
}

@media (min-width: 768px) {
  html { scroll-padding-top: var(--header-h); }
}
