/* ─── Reset ──────────────────────────────────────────────────────────────── */

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

/* ─── Fonts (Stack Sans Headline) ────────────────────────────────────────── */

@font-face {
  font-family: "Stack Sans Headline";
  src: url("/assets/fonts/StackSansHeadline-ExtraLight.ttf") format("truetype");
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Stack Sans Headline";
  src: url("/assets/fonts/StackSansHeadline-Light.ttf") format("truetype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Stack Sans Headline";
  src: url("/assets/fonts/StackSansHeadline-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Stack Sans Headline";
  src: url("/assets/fonts/StackSansHeadline-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Stack Sans Headline";
  src: url("/assets/fonts/StackSansHeadline-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Stack Sans Headline";
  src: url("/assets/fonts/StackSansHeadline-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ─── Design tokens (extraits du Figma Global Proprete) ──────────────────── */

:root {
  /* Colors */
  --gp-cyan:       #26d7ff;
  --gp-ink:        #020a0e;  /* logo + liens */
  --gp-ink-strong: #03050a;  /* texte bouton + fleche */
  --gp-white:      #ffffff;
  --gp-bg:         #ffffff;

  /* Typography */
  --gp-font-base:     "Plus Jakarta Sans", sans-serif;
  /* Stack Sans Headline embarquee via @font-face ci-dessus.
     Plus Jakarta Sans reste en fallback le temps du chargement. */
  --gp-font-headline: "Stack Sans Headline", "Plus Jakarta Sans", sans-serif;

  /* Layout */
  --gp-container: 1574px;
  --nav-h: 64px; /* hauteur du menu (pour caler le hero dessous) */
}

/* ─── Base ───────────────────────────────────────────────────────────────── */

html {
  background-color: var(--gp-bg);
  color: var(--gp-ink);
  font-family: var(--gp-font-base);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* autorise l'animation des tailles vers "auto" (accordeon FAQ) */
  interpolate-size: allow-keywords;
  /* scrollbar toujours affichee : evite tout decalage horizontal du contenu
     quand le loader verrouille puis rend le scroll (la barre ne disparait jamais) */
  overflow-y: scroll;
}

body {
  min-height: 100vh;
  background-color: var(--gp-bg);
}

/* Toute la page est plafonnee a 2560px (2K) et centree : au-dela, les blocs
   (dont les cartes sombres pleine largeur) ne s'etendent plus, marges blanches. */
.page {
  max-width: 2560px;
  margin: 0 auto;
}

/* Accessible aux lecteurs d'ecran / moteurs, invisible a l'ecran.
   Sert a poser un titre de section (H2) la ou le design n'en montre pas,
   pour une hierarchie de titres claire sans modifier le rendu. */
.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;
}

/* ─── Reveal au scroll (micro-interactions) ──────────────────────────────── */
/* Les enfants directs d'un [data-reveal] apparaissent en fondu + glissement
   quand la section entre dans l'ecran (via IntersectionObserver -> .is-visible).
   Scope sur .js : sans JavaScript, le contenu reste visible (pas de blocage). */
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] > * {
    opacity: 0;
  }

  .js [data-reveal].is-visible > * {
    animation: reveal-rise 0.95s cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  .js [data-reveal].is-visible > *:nth-child(2) {
    animation-delay: 0.14s;
  }
  .js [data-reveal].is-visible > *:nth-child(3) {
    animation-delay: 0.28s;
  }
  .js [data-reveal].is-visible > *:nth-child(4) {
    animation-delay: 0.42s;
  }
  .js [data-reveal].is-visible > *:nth-child(5) {
    animation-delay: 0.56s;
  }
  .js [data-reveal].is-visible > *:nth-child(6) {
    animation-delay: 0.7s;
  }

  @keyframes reveal-rise {
    from {
      opacity: 0;
      transform: translateY(48px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
}

/* ─── Loader d'intro (homepage) ──────────────────────────────────────────── */
/* Plein ecran (#030D11) avec le logo qui tourne. Ne s'affiche que si JS actif
   (sinon le contenu reste accessible normalement). */
.loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #030d11;
}
.js .loader {
  display: flex;
}
.loader__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
}
.loader__logo {
  position: relative;
  z-index: 1;
  width: 110px;
  height: 110px;
}
.loader__logo img {
  display: block;
  width: 100%;
  height: 100%;
}
.loader.is-done {
  opacity: 0;
  pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
  .loader {
    transition:
      inset 0.95s cubic-bezier(0.76, 0, 0.24, 1),
      border-radius 0.95s cubic-bezier(0.76, 0, 0.24, 1),
      opacity 0.6s ease;
  }
  .loader__bg {
    transition: opacity 0.9s ease;
  }
  .loader__logo {
    /* rotation "doucement . vite . doucement" a chaque tour (ease-in-out marque) */
    animation: loader-spin 1.4s cubic-bezier(1, 0, 0.03, 1) infinite;
    transition: opacity 0.5s ease;
  }
  @keyframes loader-spin {
    to {
      transform: rotate(360deg);
    }
  }
  /* la video (poster) monte a 20%, le logo disparait */
  .loader.is-revealing .loader__bg {
    opacity: 0.2;
  }
  .loader.is-revealing .loader__logo {
    opacity: 0;
  }
  /* le loader se resserre a la taille du hero (bloc) */
  .loader.is-shrinking {
    inset: calc(var(--nav-h) + 24px) 24px 24px 24px;
    border-radius: 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .loader {
    transition: opacity 0.4s ease;
  }
}

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

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

/* Ancres du menu : scroll fluide + cible decalee sous le menu sticky. */
[id] {
  scroll-margin-top: calc(var(--nav-h) + 24px);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}
