/* ==========================================================================
   NB Consulting — Couche de mouvement
   Activée uniquement par motion.js (classe html.motion), jamais si
   l’utilisateur demande à réduire les animations. Au repos, la page est
   strictement identique : le mouvement n’apparaît qu’au scroll et à la souris.
   ========================================================================== */

/* ---------- Titres : révélation mot par mot, par masque ----------------- */
.motion .w {
  display: inline-block;
  /* Le masque s’étend un peu autour du mot (italiques, accents, jambages) */
  clip-path: inset(-0.25em -0.2em -0.2em -0.2em);
}

.motion .wi {
  display: inline-block;
  transform: translate3d(0, 115%, 0);
  transition: transform 1.05s var(--ease);
  transition-delay: calc(var(--i, 0) * 32ms + var(--d0, 0ms));
}

.motion .is-split.is-in .wi {
  transform: none;
}

.motion .is-split.is-done .w {
  clip-path: none;
}

/* ---------- Lignes qui se dessinent de gauche à droite ------------------ */
.motion .problems__list,
.motion .services,
.motion .reason,
.motion .card-info {
  border-top-color: transparent;
  background-image: linear-gradient(var(--ln, var(--line)), var(--ln, var(--line)));
  background-repeat: no-repeat;
  background-position: 0 0;
  background-size: 0% 1px;
}

.motion .problem,
.motion .service,
.motion .card-info__row {
  border-bottom-color: transparent;
  background-image: linear-gradient(var(--ln, var(--line)), var(--ln, var(--line)));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 1px;
}

.motion .card-info,
.motion .card-info__row {
  --ln: var(--line-dark);
}

.motion .problems__list,
.motion .services,
.motion .card-info,
.motion .card-info__row {
  transition: background-size 1.5s var(--ease-in-out);
}

/* Ces éléments ont déjà une apparition : on conserve ses transitions */
.motion .problem,
.motion .service,
.motion .reason {
  position: relative;
  transition:
    opacity var(--dur) var(--ease) var(--d, 0s),
    transform var(--dur) var(--ease) var(--d, 0s),
    background-size 1.5s var(--ease-in-out) 0.1s,
    padding-left 0.6s var(--ease);
}

.motion .is-drawn {
  background-size: 100% 1px;
}

.motion .section--ruled::before {
  transform: translateX(-50%) scaleX(0);
  transform-origin: 0 0;
  transition: transform 1.6s var(--ease-in-out);
}

.motion .section--ruled.is-drawn::before {
  transform: translateX(-50%) scaleX(1);
}

/* ---------- Lignes numérotées : la ligne réagit à la souris ------------- */
.motion .problem::after,
.motion .service::after,
.motion .reason::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: 100% 0;
  transition: transform 0.7s var(--ease);
  pointer-events: none;
}

.motion .problem::after,
.motion .service::after {
  bottom: 0;
}

.motion .reason::after {
  top: 0;
}

.motion .problem__n,
.motion .service__n,
.motion .reason__n {
  display: inline-block;
  transition: color 0.4s ease, transform 0.6s var(--ease);
}

.motion .reason__title {
  transition: transform 0.6s var(--ease);
}

@media (hover: hover) and (pointer: fine) {
  .motion .problem:hover::after,
  .motion .service:hover::after,
  .motion .reason:hover::after {
    transform: scaleX(1);
    transform-origin: 0 0;
  }

  .motion .problem:hover .problem__n,
  .motion .service:hover .service__n,
  .motion .reason:hover .reason__n {
    color: var(--ink);
    transform: translateX(6px);
  }

  .motion .reason:hover .reason__title {
    transform: translateX(8px);
  }
}

/* ---------- Parallaxe : propriété translate, indépendante des reveals --- */
.motion [data-parallax] {
  translate: 0 var(--py, 0px);
  will-change: translate;
}

.motion .portrait img {
  scale: 1.08;
}

/* ---------- Phrase qui se structure au scroll (problems__outro) --------- */
.motion .is-scrub .wi {
  transform: none;
  transition: none;
}

.motion .is-scrub .w {
  clip-path: none;
  will-change: transform, opacity;
}

/* ---------- Boutons magnétiques ------------------------------------------ */
.motion .btn,
.motion .link-arrow {
  translate: var(--mx, 0px) var(--my, 0px);
}

.motion .btn .arrow,
.motion .link-arrow .arrow {
  translate: var(--ax, 0px) var(--ay, 0px);
}

/* ---------- Header : se compacte, s’efface en descendant ---------------- */
.motion .header {
  transition:
    background-color 0.4s ease,
    border-color 0.4s ease,
    box-shadow 0.4s ease,
    height 0.6s var(--ease),
    transform 0.7s var(--ease);
}

@media (min-width: 900px) {
  .motion .header.is-compact {
    height: 62px;
  }
}

.motion .header.is-away {
  transform: translate3d(0, -100%, 0);
}

/* ---------- Curseur (desktop uniquement) -------------------------------- */
.cursor {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 300;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid transparent;
  mix-blend-mode: difference;
  pointer-events: none;
  opacity: 0;
  transition:
    width 0.45s var(--ease),
    height 0.45s var(--ease),
    margin 0.45s var(--ease),
    background-color 0.3s ease,
    border-color 0.3s ease,
    opacity 0.3s ease;
}

.cursor.is-visible {
  opacity: 1;
}

.cursor.is-link {
  width: 46px;
  height: 46px;
  margin: -23px 0 0 -23px;
  background-color: transparent;
  border-color: #fff;
}

.cursor.is-text {
  opacity: 0;
}

.cursor.is-down {
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
}

.cursor.is-link.is-down {
  width: 38px;
  height: 38px;
  margin: -19px 0 0 -19px;
}

html.has-cursor,
html.has-cursor * {
  cursor: none;
}

html.has-cursor input,
html.has-cursor textarea,
html.has-cursor select {
  cursor: text;
}

/* Pendant l’introduction, curseur natif */
html.intro-on .cursor {
  display: none;
}

html.intro-on.has-cursor,
html.intro-on.has-cursor * {
  cursor: auto;
}

html.intro-on.has-cursor .intro__skip {
  cursor: pointer;
}
