/* ------------------------------------------------------------------
   pains.css — « Les problèmes aujourd'hui » : la sonde.
   Plus on descend, plus on voit les problèmes. Sur grand écran, le titre
   et la sonde restent fixés à gauche ; à droite, les sept problèmes
   passent un à un, et celui du centre de l'écran s'allume (depth.js pose
   « has-sonde » sur la section, puis « is-active » sur le problème).
   Sur téléphone, la sonde devient un filet à gauche de la liste.
   Sans script ou sous mouvement réduit : tout est allumé, sonde pleine.
   ------------------------------------------------------------------ */

.pains-grid {
  display: grid;
  gap: 48px;
}

.pains-title {
  color: var(--ivory);
  font-family: var(--font-title);
  font-size: clamp(2.25rem, 4.4vw, 3.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  text-wrap: balance;
}

/* --- La sonde : une ligne, sept repères, un remplissage d'écume --- */
.sonde {
  position: relative;
  display: none;
  margin: 56px 0 0;
  padding-left: 28px;
}

.sonde-marks {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sonde::before,
.sonde-fill {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 0;
  width: 1px;
}

.sonde::before {
  background: rgb(var(--white-rgb) / 0.12);
}

.sonde-fill {
  left: -0.5px;
  width: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-bright));
  box-shadow: 0 0 14px rgb(var(--accent-rgb) / 0.75);
  transform-origin: 50% 0;
}

.sonde-mark {
  position: relative;
  padding-block: 13px;
  color: rgb(var(--white-rgb) / 0.42);
  font-family: var(--font-label);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  line-height: 1;
  transition: color 400ms var(--ease-out);
}

/* Le repère : un trait qui part de la ligne */
.sonde-mark::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -28px;
  width: 20px;
  height: 1px;
  background: rgb(var(--white-rgb) / 0.3);
  transform: scaleX(0.6);
  transform-origin: 0 50%;
  transition: transform 400ms var(--ease-out), background-color 400ms var(--ease-out);
}

.sonde-mark.is-on {
  color: var(--accent-bright);
}

.sonde-mark.is-on::before {
  transform: none;
  background: var(--accent-bright);
}

/* --- Les problèmes --- */
.pains-body {
  position: relative;
}

.pains-rail,
.pains-rail-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 1px;
}

.pains-rail {
  background: rgb(var(--white-rgb) / 0.14);
}

.pains-rail-fill {
  left: -0.5px;
  width: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-bright));
  box-shadow: 0 0 12px rgb(var(--accent-rgb) / 0.6);
  transform-origin: 50% 0;
}

.pains-list {
  margin: 0;
  padding: 0 0 0 28px;
  list-style: none;
}

.pain {
  padding-block: 28px;
  transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out);
}

.pain-num {
  display: block;
  color: var(--accent);
  font-family: var(--font-label);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  line-height: 1;
}

.pain-title {
  margin-top: 14px;
  color: var(--ivory);
  font-family: var(--font-title);
  font-size: clamp(1.625rem, 3vw, 2.375rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.15;
  text-wrap: balance;
}

.pain-text {
  max-width: 46ch;
  margin-top: 14px;
  color: rgb(var(--white-rgb) / 0.78);
  font-size: clamp(1.0625rem, 1.3vw, 1.1875rem);
  line-height: 1.65;
  text-wrap: pretty;
}

/* En retrait tant qu'il n'est pas au centre de l'écran. Ces états n'existent que si
   depth.js a pris la main : sans lui, tout reste allumé. */
.has-sonde .pain:not(.is-active) {
  opacity: 0.26;
  transform: translateY(10px);
}

@media (min-width: 1024px) {
  .pains-grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: clamp(48px, 7vw, 112px);
  }

  .pains-aside {
    position: sticky;
    top: calc(var(--nav-h) + 12vh);
    align-self: start;
  }

  .sonde {
    display: block;
  }

  .pains-rail {
    display: none;
  }

  .pains-list {
    padding: 12vh 0 16vh;
  }

  .pain {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 36vh;
    padding-block: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pain,
  .sonde-mark,
  .sonde-mark::before {
    transition: none;
  }
}
