/* ==========================================================================
   Power 21 — page « Mesure et suivi » (route 'tracking', content/<lang>/p_tracking.php)
   Chargée après common.css et layout.css (hero, blocs .lyt-block, conclusion).
   Compteurs [data-count] animés par common.js.
   Préfixe : .trk-
   ========================================================================== */

.trk-kicker {
  display: flex; align-items: center; gap: 18px;
  font-family: var(--ff-mono); font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--c-grey);
}
.trk-kicker::before { content: ''; width: 40px; height: 2px; background: var(--c-yellow); }

/* 1. Résultats prouvés : texte + principe, puis 3 niveaux d'indicateurs --------- */
.trk-split { display: grid; grid-template-columns: 6fr 6fr; gap: clamp(32px, 5vw, 80px); align-items: start; }
.trk-text { font-size: 18px; line-height: 1.7; color: var(--c-body); text-wrap: pretty; }
.trk-text strong { color: var(--c-blue); }
.trk-principle {
  padding: 24px 28px; border-left: 3px solid var(--c-yellow);
  background: linear-gradient(155deg, #EEF2F9 30%, var(--c-white));
  font-size: 18px; line-height: 1.65; color: var(--c-body); text-wrap: pretty;
}
.trk-principle strong { color: var(--c-ink); }
.trk-sub {
  margin: clamp(56px, 7vw, 96px) 0 24px;
  font-size: clamp(24px, 2.2vw, 32px); font-weight: 800; letter-spacing: -.03em;
}
.trk-levels {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px;
}
.trk-level {
  position: relative; overflow: hidden; display: grid; align-content: start; gap: 14px;
  padding: 32px 32px 36px; padding-top: 88px;
  background: var(--c-white); border: 1px solid rgba(91,124,182,.14); border-top: 3px solid var(--c-blue);
}
.trk-level__num { position: absolute; top: 4px; left: 28px; font-size: 76px; line-height: 1; color: rgba(91,124,182,.3); }
.trk-level h4 { margin: 0; font-size: 20px; line-height: 1.25; font-weight: 800; letter-spacing: -.02em; }
.trk-level p { font-size: 18px; line-height: 1.6; color: var(--c-body); text-wrap: pretty; }

/* 2. Ce que nos clients observent : 6 chiffres (3 × 2), méthode dépliable ------ */
.trk-stats {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid rgba(255,255,255,.3);
}
.trk-stat {
  display: flex; flex-direction: column; gap: 10px;
  padding: 36px 32px 32px 0; border-bottom: 1px solid rgba(255,255,255,.3);
}
.trk-stat:not(:nth-child(3n+1)) { padding-left: 32px; border-left: 1px solid rgba(255,255,255,.3); }
.trk-stat__value {
  font-weight: 800; font-size: clamp(56px, 6vw, 92px); line-height: .9; letter-spacing: -.05em;
  color: var(--c-white); font-variant-numeric: tabular-nums;
}
.trk-stat__label { font-size: 18px; line-height: 1.35; font-weight: 600; letter-spacing: -.01em; color: var(--c-white); text-wrap: pretty; }
.trk-stat__label span { display: block; margin-top: 4px; font-size: 15px; font-weight: 400; color: rgba(255,255,255,.75); }
.trk-stat__how { padding-top: 10px; }
.trk-stat__how summary {
  display: inline-flex; align-items: center; gap: 10px; cursor: pointer; list-style: none;
  font-family: var(--ff-mono); font-size: 12px; font-weight: 600;letter-spacing: .14em; text-transform: uppercase; color: var(--c-yellow);
}
.trk-stat__how summary::-webkit-details-marker { display: none; }
.trk-stat__how summary::after {   /* + qui pivote en × à l'ouverture */
  content: '+'; font-family: var(--ff-sans); font-size: 16px; letter-spacing: 0; line-height: 1;
  transition: transform .3s var(--ease);
}
.trk-stat__how[open] summary::after { transform: rotate(45deg); }
.trk-stat__how summary:hover { color: var(--c-yellow-hi); }
.trk-stat__how p { margin-top: 12px; font-size: 15px; line-height: 1.6; color: rgba(255,255,255,.86); text-wrap: pretty; }
.trk-stat__how .trk-stat__ex { font-style: italic; color: rgba(255,255,255,.72); }

/* 3. La web app : texte + illustration, puis avant/après ----------------------- */
.trk-app { display: grid; grid-template-columns: 7fr 5fr; gap: clamp(40px, 6vw, 96px); align-items: center; }
.trk-app__text { display: grid; gap: 22px; max-width: 680px; }
.trk-app__text .lyt-h2 { margin-bottom: 8px; text-wrap: balance; }
.trk-app__text p:not(.trk-kicker) { font-size: 17px; line-height: 1.7; color: var(--c-body); text-wrap: pretty; }
.trk-app__text strong { color: var(--c-ink); }
.trk-app__art { width: 100%; max-width: 480px; height: auto; justify-self: center; }

.trk-ba {
  display: grid; grid-template-columns: minmax(240px, 4fr) 8fr; gap: clamp(32px, 5vw, 80px); align-items: center;
  margin-top: clamp(64px, 8vw, 112px); padding: clamp(32px, 4vw, 56px);
  background: linear-gradient(155deg, #E8EEF8 30%, var(--c-white));
  border: 1px solid rgba(91,124,182,.14); border-left: 3px solid var(--c-yellow);
}
/* schéma « avant / après » (SVG décoratif), en boucle de 6,3 s une fois révélé :
   la barre Après monte depuis le niveau Avant, la flèche jaune se trace, l'écart
   (pointillés + accolade) et le point apparaissent ; pause ; tout redescend ; ça repart.
   Sans JS ou en mouvement réduit : état final fixe. */
.trk-ba__visual { display: flex; justify-content: center; }
.trk-ba__chart { display: block; width: 100%; max-width: 360px; height: auto; overflow: visible; }
.trk-ba__axis { stroke: rgba(15,17,21,.18); stroke-width: 1.5; }
.trk-ba__bar { transform-box: fill-box; transform-origin: 50% 100%; }
.trk-ba__bar--before { fill: rgba(91,124,182,.3); }
.trk-ba__bar--after  { fill: var(--c-blue); }
.trk-ba__level { stroke: var(--c-blue); stroke-width: 1.5; stroke-dasharray: 4 5; stroke-opacity: .6; }
.trk-ba__gap { fill: none; stroke: var(--c-yellow); stroke-width: 3; stroke-linejoin: round; }
.trk-ba__arrow, .trk-ba__head { fill: none; stroke: var(--c-yellow); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.trk-ba__arrow { stroke-dasharray: 1; }
.trk-ba__dot, .trk-ba__pulse { fill: var(--c-yellow); }
.trk-ba__pulse { opacity: 0; transform-box: fill-box; transform-origin: center; }
.trk-ba__label { font-family: var(--ff-mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; text-anchor: middle; fill: var(--c-body-soft); }
.trk-ba__label--after { fill: var(--c-blue-deep); font-weight: 700; }

/* avant reveal : état de départ */
.js-reveal .trk-ba:not(.is-in) .trk-ba__bar--after { transform: scaleY(.39); }   /* = hauteur Avant (70/180) */
.js-reveal .trk-ba:not(.is-in) .trk-ba__arrow { stroke-dashoffset: 1; }
.js-reveal .trk-ba:not(.is-in) :is(.trk-ba__head, .trk-ba__level, .trk-ba__gap, .trk-ba__top) { opacity: 0; }
/* révélé : le cycle tourne */
.trk-ba.is-in .trk-ba__bar--after { animation: trk-ba-bar 6.3s .3s infinite both; }
.trk-ba.is-in .trk-ba__arrow { animation: trk-ba-arrow 6.3s .3s infinite both; }
.trk-ba.is-in :is(.trk-ba__head, .trk-ba__level, .trk-ba__gap, .trk-ba__top) { animation: trk-ba-show 6.3s .3s infinite both; }
.trk-ba.is-in .trk-ba__pulse { animation: trk-ba-pulse 2.2s 2s infinite; }

@keyframes trk-ba-bar {
  0%       { transform: scaleY(.39); animation-timing-function: cubic-bezier(.22,1,.36,1); }
  19%, 76% { transform: scaleY(1);   animation-timing-function: cubic-bezier(.65,0,.35,1); }
  90%, 100% { transform: scaleY(.39); }
}
@keyframes trk-ba-arrow {
  0%, 6%   { stroke-dashoffset: 1; opacity: 1; animation-timing-function: cubic-bezier(.65,0,.35,1); }
  24%, 73% { stroke-dashoffset: 0; opacity: 1; }
  84%, 100% { stroke-dashoffset: 0; opacity: 0; }
}
@keyframes trk-ba-show {
  0%, 21%  { opacity: 0; }
  28%, 73% { opacity: 1; }
  84%, 100% { opacity: 0; }
}
@keyframes trk-ba-pulse { 0% { transform: scale(1); opacity: .55; } 70%, 100% { transform: scale(3.2); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .trk-ba .trk-ba__chart * { animation: none !important; }
  .js-reveal .trk-ba .trk-ba__chart * { transform: none; opacity: 1; stroke-dashoffset: 0; }
  .js-reveal .trk-ba .trk-ba__pulse { opacity: 0; }
}
.trk-ba__text { display: grid; gap: 18px; justify-items: start; }
.trk-ba__text h3 { margin: 0; font-size: clamp(26px, 2.6vw, 40px); line-height: 1.1; font-weight: 800; letter-spacing: -.035em; text-wrap: balance; }
.trk-ba__text h3 em { color: var(--c-blue); }
.trk-ba__text p { font-size: 17px; line-height: 1.7; color: var(--c-body); text-wrap: pretty; }
.trk-ba__text .link-rule { margin-top: 6px; }

/* 4. Un cas concret (Editis) : récit + chiffres à gauche, verbatims à droite ----- */
.trk-case-block { padding-top: 0; }   /* enchaîne avec la web app, même fond */
.trk-case {
  display: grid; grid-template-columns: 7fr 5fr; overflow: hidden;
  background: var(--c-white); border: 1px solid rgba(91,124,182,.14);
}
.trk-case__main { display: grid; gap: 20px; align-content: start; padding: clamp(32px, 4vw, 64px); }
.trk-case__logo { width: 72px; height: auto; }
.trk-case__title { font-size: clamp(28px, 3vw, 44px); line-height: 1.05; font-weight: 800; letter-spacing: -.04em; text-wrap: balance; }
.trk-case__title em { color: var(--c-blue); }
.trk-case__main > p:not(.trk-kicker) { font-size: 17px; line-height: 1.7; color: var(--c-body); text-wrap: pretty; }
.trk-case__main strong { color: var(--c-ink); }
.trk-case__figures { list-style: none; margin: 8px 0 0; padding: 24px 0 0; display: flex; flex-wrap: wrap; gap: 24px 56px; border-top: 1px solid rgba(15,17,21,.1); }
.trk-case__figures li { display: grid; gap: 6px; font-size: 14px; color: var(--c-body-soft); }
.trk-case__figures strong { font-size: clamp(44px, 4.4vw, 64px); line-height: .9; font-weight: 800; letter-spacing: -.05em; color: var(--c-blue); font-variant-numeric: tabular-nums; }
.trk-case__figures small { font-size: .45em; font-weight: 600; letter-spacing: 0; color: var(--c-body-soft); }
.trk-case__voices {
  display: grid; gap: 18px; align-content: center; padding: clamp(32px, 4vw, 56px);
  background: var(--c-blue); color: var(--c-white);
}
.trk-case__voices blockquote { margin: 0; padding-left: 20px; border-left: 2px solid var(--c-yellow); }
.trk-case__voices p { font-family: var(--ff-serif); font-style: italic; font-size: clamp(19px, 1.6vw, 23px); line-height: 1.3; letter-spacing: -.01em; text-wrap: pretty; }
.trk-case__voices .link-rule, .trk-case__voices .link-rule:hover { margin-top: 10px; color: var(--c-white); }

/* Responsive ---------------------------------------------------------------- */
@media (max-width: 1100px) {
  .trk-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trk-stat:not(:nth-child(3n+1)) { padding-left: 0; border-left: 0; }
  .trk-stat:nth-child(even) { padding-left: 32px; border-left: 1px solid rgba(255,255,255,.3); }
}
@media (max-width: 900px) {
  .trk-split, .trk-levels, .trk-app, .trk-ba, .trk-case { grid-template-columns: 1fr; }
  .trk-ba__visual { justify-content: flex-start; }
  .trk-ba__chart { max-width: 260px; }
  .trk-app__art { max-width: 360px; }
}
@media (max-width: 640px) {
  .trk-stats { grid-template-columns: 1fr; }
  .trk-stat:nth-child(even) { padding-left: 0; border-left: 0; }
}
