/* ==========================================================================
   Base : reset, typographie, mise en page, utilitaires, animations d'entrée
   ========================================================================== */

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

* {
  margin: 0;
}

html {
  overflow-x: clip; /* garde-fou : jamais de défilement horizontal */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-height) + var(--space-4));
}

/* Défilement natif fluide uniquement si Lenis n'est pas actif. */
html:not(.lenis) {
  scroll-behavior: smooth;
}

/* Lenis (défilement fluide) — styles requis par la librairie. */
html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-stopped {
  overflow: clip;
}

body {
  min-height: 100vh;
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-stretch: 100%;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

body.is-locked {
  overflow: hidden;
}

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

img {
  height: auto;
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.2em;
}

h1,
h2,
h3 {
  font-weight: 800;
  font-stretch: var(--stretch-display);
  line-height: 1;
  letter-spacing: var(--tracking-display);
  text-wrap: balance;
  overflow-wrap: break-word;
}

p {
  text-wrap: pretty;
}

:where(ul, ol)[role="list"] {
  list-style: none;
  padding: 0;
}

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

:focus {
  outline: none;
}

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

main:focus {
  outline: none;
}

/* ---- Mise en page ------------------------------------------------------ */

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  position: relative;
  padding-block: var(--section-y);
}

/* Sections sombres (projets, marquee, footer). */
.is-dark {
  background: var(--color-ink);
  color: var(--color-dark-text);
}

.is-dark :focus-visible {
  outline-color: var(--color-accent-on-dark);
}

/* ---- Utilitaires ------------------------------------------------------- */

.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: fixed;
  top: var(--space-3);
  left: var(--space-3);
  z-index: 100;
  padding: var(--space-3) var(--space-4);
  background: var(--color-ink);
  color: var(--color-paper);
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus-visible {
  transform: none;
}

.icon {
  width: 1.2em;
  height: 1.2em;
  flex-shrink: 0;
}

/* Étiquette technique en mono : « Services », « Lille, FR »… */
.mono,
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  font-weight: 450;
  font-stretch: 100%;
  letter-spacing: var(--tracking-mono);
  line-height: 1.5;
  text-transform: uppercase;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

/* Petite barre arrondie devant chaque surtitre : le motif du logo. */
.eyebrow::before {
  content: "";
  width: 1.6rem;
  height: 0.42rem;
  border-radius: var(--radius-bar);
  background: currentColor;
}

/* ==========================================================================
   Entrée de page (CSS pur : visible dès le premier affichage, sans JS)
   ========================================================================== */

@keyframes rise {
  from {
    transform: translate3d(0, 105%, 0);
  }
  to {
    transform: none;
  }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translate3d(0, 1.25rem, 0);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes bar-in {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@keyframes stretch-in {
  from {
    font-stretch: 62%;
  }
  to {
    font-stretch: var(--stretch-display);
  }
}

/* Mouvement réduit : tout s'affiche dans son état final. */
@media (prefers-reduced-motion: reduce) {
  html:not(.lenis) {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    transition-delay: 0ms !important;
  }
}
