/* Reset + base typo */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
[hidden] { display: none !important; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h-mobile);
  -webkit-text-size-adjust: 100%;
}

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

body {
  font-family: var(--ff-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-x: clip;
  position: relative;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* TEX-2 grain fin */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.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; }

/* Reset elements */
img, video, iframe, svg { max-width: 100%; display: block; }
img { height: auto; }
figure { margin: 0; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; border: 0; background: transparent; cursor: pointer; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }

/* Typo */
h1, h2, h3, h4 {
  font-family: var(--ff-display);
  font-weight: 500;
  line-height: 1.15;
  color: var(--text);
  letter-spacing: -0.005em;
}

h1 { font-size: clamp(2.3rem, 6vw, 4.2rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h3 { font-size: clamp(1.25rem, 2.4vw, 1.6rem); }
h4 { font-size: clamp(1.05rem, 1.8vw, 1.25rem); }

p { color: var(--text); }

em { font-style: italic; color: var(--accent); }
strong { font-weight: 600; }

/* Micro-details propres */
::selection {
  background: var(--accent);
  color: var(--text-on-dark);
}

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

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

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