/* ==========================================================================
   braid — waiting site
   Ultra léger : pas de framework CSS, variables + flex, mobile-first ensuite.
   ========================================================================== */

/* ---- Fonts (self-hosted — déposer les woff2 dans assets/fonts/) ---------- */

@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('../assets/fonts/PlusJakartaSans-ExtraLight.woff2') format('woff2');
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('../assets/fonts/PlusJakartaSans-Light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

/* Redaction 20 : utilisée uniquement par le compteur du loader,
   subsettée aux chiffres + % (7 Ko). block : on attend la fonte
   plutôt que d'afficher un fallback flash. */
@font-face {
  font-family: 'Redaction 20';
  src: url('../assets/fonts/Redaction20-Loader.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

/* ---- Tokens --------------------------------------------------------------- */

:root {
  --paper: #ffffff;
  --ink: #111111;
  --gray: #6e6e6e;
  --btn-bg: #1f1f1f;
  --btn-bg-hover: #3d3d3d;
  --btn-fg: #ffffff;

  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Redaction 20', Georgia, 'Times New Roman', serif;

  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Base ----------------------------------------------------------------- */

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

html {
  height: 100%;
}

body {
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Images : jamais draggables ni sélectionnables */
img {
  display: block;
  max-width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}

/* ---- Structure de page ----------------------------------------------------
   Colonne centrée : header en haut, hero au centre, footer en bas.
   ========================================================================== */

.site {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(24px, 4vh, 48px) 24px clamp(32px, 6vh, 64px);
}

.site__header {
  padding-top: clamp(8px, 2vh, 24px);
}

.logo-square {
  width: clamp(84px, 6vw, 110px);
  height: auto;
}

.site__hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: clamp(20px, 4vh, 44px);
}

.tagline {
  color: var(--gray);
  font-size: clamp(15px, 1.2vw, 19px);
  font-weight: 200;
  letter-spacing: 0.01em;
}

/* Grand logo : deux images empilées, bascule d'opacité au hover (zéro flash,
   les deux fichiers sont préchargés par le loader) */
.hero-logo {
  display: grid;
  width: min(56vw, 900px);
}

.hero-logo__img {
  grid-area: 1 / 1;
  width: 100%;
  transition: opacity 0.15s var(--ease-smooth);
}

.hero-logo__img--hover {
  opacity: 0;
}

/* .is-active = équivalent tactile du hover (posée en JS au tap) */
.hero-logo:hover .hero-logo__img--default,
.hero-logo.is-active .hero-logo__img--default {
  opacity: 0;
}

.hero-logo:hover .hero-logo__img--hover,
.hero-logo.is-active .hero-logo__img--hover {
  opacity: 1;
}

/* ---- Footer : ligne, statut, bouton --------------------------------------- */

.site__footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: clamp(20px, 3.2vh, 34px);
  padding-top: clamp(24px, 5vh, 56px);
}

.rule {
  width: min(58vw, 1130px);
  border: none;
  border-top: 1.5px solid var(--ink);
}

.status {
  color: var(--gray);
  font-size: clamp(20px, 1.9vw, 30px);
  font-weight: 200;
  text-align: center;
}

.cta {
  display: inline-block;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: clamp(17px, 1.3vw, 21px);
  text-decoration: none;
  padding: 0.75em 1.9em 18px;
  border-radius: 999px;
  border: none;
  /* Transition sur le fond uniquement : une transition CSS sur transform
     interférerait avec les animations GSAP (translateY de l'entrée) */
  transition: background-color 0.25s var(--ease-smooth);
}

/* Hover sobre : même noir, juste un peu plus gris — pas d'inversion */
.cta:hover {
  background: var(--btn-bg-hover);
}

.cta:active {
  transform: scale(0.98);
}

.cta:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* ---- Loader ----------------------------------------------------------------
   Plein écran blanc, compteur géant Redaction 20, rideau noir pour le wipe.
   Sans JS le loader n'existe pas (classe .js posée dans <head>).
   ========================================================================== */

.loader {
  display: none;
}

.js .loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: var(--paper);
}

.loader__count {
  display: flex;
  align-items: baseline;
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1;
}

.loader__value {
  font-size: clamp(140px, 22vw, 420px);
  font-variant-numeric: tabular-nums;
}

.loader__pct {
  font-size: clamp(34px, 5vw, 96px);
  margin-left: 0.08em;
}

/* ---- Mobile (cf. maquette iPhone) ------------------------------------------
   Logo carré plus bas, hero dans le tiers haut, footer collé en bas.
   ========================================================================== */

@media (max-width: 768px) {
  .site {
    padding-left: 20px;
    padding-right: 20px;
  }

  .site__header {
    padding-top: clamp(32px, 9vh, 96px);
  }

  .logo-square {
    width: auto;
    height: 72px;
  }

  .site__hero {
    flex: 0 0 auto;
    padding-top: clamp(48px, 12vh, 128px);
    gap: 20px;
  }

  .hero-logo {
    width: min(82vw, 560px);
  }

  .tagline {
    font-size: 15px;
  }

  /* Le footer descend en bas de l'écran, gros espace vide au milieu */
  .site__footer {
    margin-top: auto;
    gap: 24px;
  }

  .rule {
    width: min(76vw, 560px);
  }

  .status {
    font-size: clamp(16px, 4.4vw, 20px);
  }

  .cta {
    font-size: 17px;
    padding: 0.8em 2em 18px;
  }
}

/* ---- Accessibilité : mouvement réduit -------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
