/* ==========================================================================
   FOOT FACTORY — BASE
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100svh;
  overflow-x: hidden;
  transition: background-color var(--t-slow) var(--ease);
}

/* Pas de scroll horizontal sur mobile (iOS ignore overflow-x sur body seul). */
html { overflow-x: clip; }
body.is-locked { overflow: hidden; }

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

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  word-spacing: .11em;
  text-wrap: balance;
  overflow-wrap: break-word;
}

p { text-wrap: pretty; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; padding: 0; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }

::selection { background: var(--accent); color: var(--accent-ink); }

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

/* --- Grain global, très léger --- */
body::after {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: .035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* --- Utilitaires --- */
.container { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--pad-x); }
.container--wide { max-width: 104rem; }
.container--narrow { max-width: 62rem; }

.section { padding-block: var(--pad-y); position: relative; }
.section--tight { padding-block: clamp(3rem, 2rem + 3vw, 5.5rem); }
.section--flush-top { padding-block-start: 0; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

.skip-link {
  position: absolute; top: -100%; left: var(--s4); z-index: 999;
  background: var(--accent); color: var(--accent-ink);
  padding: var(--s3) var(--s5); border-radius: var(--r-pill); font-weight: 600;
}
.skip-link:focus { top: var(--s4); }

.text-lead { font-size: var(--fs-lead); line-height: var(--lh-loose); color: var(--text-2); }
.text-muted { color: var(--text-3); }
.text-accent { color: var(--accent); }

.eyebrow {
  display: inline-flex; align-items: center; gap: var(--s3);
  font-family: var(--font-body);
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--text-3);
}
.eyebrow::before {
  content: ""; width: 1.75rem; height: 1px;
  background: currentColor; opacity: .55; flex: none;
}
.eyebrow--plain::before { display: none; }
.eyebrow--accent { color: var(--accent); }

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