/* ============================================================
   04 — DIFFERENCE (« Vous allez voir la différence immédiatement. »)
   Figma : OOjXOqpdlvsMfWGqmVWN6c / node 5369:22717 — 1440×875, full-bleed sombre
   ============================================================ */

.difference {
  position: relative;
  overflow: hidden;
  background: var(--color-neutral-950);
  font-family: var(--font-sans);
}

/* Halo décoratif orange/violet (SVG plein cadre, hors flux) */
.difference__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.difference__inner {
  position: relative; /* au-dessus du halo */
  max-width: var(--container-max);
  margin-inline: auto;
  padding: 127px clamp(20px, 8.33vw, 120px) 105px; /* hors tokens: mesuré Figma (127 haut / 105 bas) */
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* — Badge « GAME CHANGER » — */
.difference__badge {
  margin: 0 0 19px; /* hors tokens: mesuré Figma */
  display: inline-flex;
  padding: 3px;
  border-radius: var(--radius-pill);
  background: var(--color-neutral-950);
  border: 1px solid rgba(229, 231, 233, 0.5); /* --color-border @50% */
  box-shadow: 0 4px 20px 0 rgba(255, 255, 255, 0.2);
}

.difference__badge-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, #fff1ed, #f0efff); /* hors tokens: mesuré Figma */
}

.difference__badge-label {
  font-size: var(--text-eyebrow);
  line-height: var(--text-eyebrow--line-height);
  letter-spacing: var(--text-eyebrow--letter-spacing);
  font-weight: var(--text-eyebrow--font-weight);
  text-transform: uppercase;
  white-space: nowrap;
  background: linear-gradient(90deg, var(--color-accent-coral), var(--color-primary-vivid));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* — Titre — */
.difference__title {
  margin: 0 0 26px; /* hors tokens: mesuré Figma */
  max-width: 865px;
  text-align: center;
  color: var(--color-white);
  font-size: clamp(32px, 4.5vw, var(--text-h2));
  line-height: 1.04; /* = 56/54, --text-h2--line-height fluide */
  letter-spacing: var(--text-h2--letter-spacing);
  font-weight: var(--text-h2--font-weight);
}

/* — Intro — */
.difference__intro {
  margin: 0 0 54px; /* hors tokens: mesuré Figma */
  max-width: 689px;
  text-align: center;
  color: rgba(255, 255, 255, 0.8); /* --color-white @80% */
  font-size: var(--text-body-sm);
  line-height: var(--text-body-sm--line-height);
  font-weight: var(--text-body-sm--font-weight);
}

.difference__intro p {
  margin: 0;
}

/* — Panneau dégradé autour du comparateur — */
.difference__panel {
  width: min(791px, 100%);
  padding: 14px; /* hors tokens: mesuré Figma (écart wrapper 791 → carte 760) */
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: linear-gradient(270deg, rgba(255, 241, 237, 0.1), rgba(240, 239, 254, 0.1)); /* hors tokens: mesuré Figma */
}

.difference__scroll {
  overflow-x: auto;
  border-radius: 14px; /* hors tokens: mesuré Figma */
}

/* — Carte comparateur — */
.difference__card {
  position: relative;
  min-width: 758px; /* préserve la géométrie (surlignage absolu) ; scroll horizontal en dessous */
  padding: 0 23px 25px; /* hors tokens: mesuré Figma */
  border-radius: 14px; /* hors tokens: mesuré Figma */
  border: 1px solid var(--color-border);
  background: var(--color-white);
  overflow: hidden;
}

/* Colonne « + DesignBrain » surlignée (décor) */
.difference__highlight {
  position: absolute;
  left: 569px;
  top: 9px;
  width: 179px;
  height: 301px;
  border-radius: var(--radius-lg);
  background: rgba(113, 96, 243, 0.07); /* --color-primary @7% */
  pointer-events: none;
}

.difference__row {
  position: relative; /* au-dessus du surlignage */
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 46px;
  border-top: 1px solid var(--color-border);
}

.difference__row--head {
  margin-top: 23px; /* hors tokens: mesuré Figma */
  align-items: flex-start;
  border-top: 0;
}

.difference__th {
  width: 160px;
  text-align: center;
  color: var(--color-neutral-950);
  font-size: var(--text-small);
  line-height: normal;
  font-weight: 600;
}

.difference__th--label {
  width: 165px;
  text-align: left;
}

.difference__th--brand {
  background: linear-gradient(90deg, var(--color-accent-coral) 24.375%, var(--color-primary-vivid) 77.813%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.difference__label {
  width: 165px;
  color: var(--color-neutral-950);
  font-size: var(--text-caption);
  line-height: normal;
  font-weight: var(--text-caption--font-weight);
}

/* Première ligne : label en 14px dans la maquette (les suivantes en 13px) */
.difference__label--lead {
  font-size: var(--text-small);
}

.difference__cell {
  width: 160px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

/* Notes en pastilles — retours 13/08 : les 3 SVG statiques (dots-N-sur-3)
   sont remplacés par du markup, pour animer le remplissage au scroll.
   Géométrie reprise au pixel des SVG d'origine : 3 ronds de 8px, pas de
   12px, groupe centré dans une cellule de 160px. */
.difference__dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px; /* pas 12px = 8px de rond + 4px */
  width: 160px;
  height: 8px;
}

.difference__dot {
  box-sizing: border-box;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--color-neutral-950); /* #111 — rond plein des SVG */
}

.difference__dot--empty {
  background: none;
  border: 1.2px solid var(--color-border); /* #E5E7E9 — rond vide des SVG */
}

.difference__dots--accent .difference__dot { background: var(--color-primary-vivid); } /* #7160F3 */

/* Animation : les ronds pleins « s'allument » l'un après l'autre quand le
   panneau entre dans le viewport (classe .is-in posée par interactions.js).
   Les ronds vides restent inertes — c'est le contraste qui fait la démo. */
@media (prefers-reduced-motion: no-preference) {
  .difference__panel.reveal .difference__dot { transform: scale(0.2); opacity: 0; }

  .difference__panel.reveal .difference__dot--empty { transform: none; opacity: 1; }

  .difference__panel.reveal.is-in .difference__dot {
    animation: difference-dot-in 460ms cubic-bezier(0.34, 1.4, 0.5, 1) both;
    animation-delay: var(--dot-delay, 0ms);
  }

  .difference__panel.reveal.is-in .difference__dot--empty { animation: none; }
}

/* Cascade : ligne par ligne, puis rond par rond dans chaque note. */
.difference__row:nth-child(2) .difference__dots { --row-delay: 60ms; }
.difference__row:nth-child(3) .difference__dots { --row-delay: 170ms; }
.difference__row:nth-child(4) .difference__dots { --row-delay: 280ms; }
.difference__row:nth-child(5) .difference__dots { --row-delay: 390ms; }
.difference__row:nth-child(6) .difference__dots { --row-delay: 500ms; }

.difference__dot:nth-child(1) { --dot-delay: var(--row-delay, 0ms); }
.difference__dot:nth-child(2) { --dot-delay: calc(var(--row-delay, 0ms) + 80ms); }
.difference__dot:nth-child(3) { --dot-delay: calc(var(--row-delay, 0ms) + 160ms); }

@keyframes difference-dot-in {
  from { transform: scale(0.2); opacity: 0; }
  60%  { transform: scale(1.18); opacity: 1; }
  to   { transform: scale(1); opacity: 1; }
}

.difference__sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   Responsive (maquette desktop-only → adaptation)
   ============================================================ */

@media (max-width: 1024px) {
  .difference__inner {
    padding-top: 96px;
    padding-bottom: 80px;
  }
}

@media (max-width: 768px) {
  .difference__inner {
    padding-top: 72px;
    padding-bottom: 64px;
  }

  .difference__title {
    margin-bottom: 20px;
  }

  .difference__intro {
    margin-bottom: 40px;
  }

  .difference__panel {
    padding: 8px;
  }
  /* La carte garde sa largeur minimale (758px) et défile horizontalement */
}
