/*-- KINAGI V2 · ANIMATIONS AU DÉFILEMENT ------------------------------------
  Trois éléments :
    A · le cercle de la pratique (accueil, section « Un chemin de transformation ») ;
    B · le fil du parcours (accueil, section « Grandir pas à pas ») ;
    C · la courbe qui descend le long des quatre degrés (page Stages).
  Le script animations.js ajoute la classe « is-animated » quand l'animation
  est permise. Sans JavaScript, ou si l'appareil est réglé sur « réduire les
  animations », tout s'affiche directement : cercle tracé, mots et points visibles.
----------------------------------------------------------------------------*/
:root {
  --anim-dark: #1d211e;            /* fond sombre du fil (sous la photo) */
  --anim-on-dark: #f7f4ed;         /* textes et trait sur fond sombre */
  --anim-accent-light: #e2a488;    /* terracotta éclairci, lisible sur fond sombre */
}
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/*-- A · CERCLE DE LA PRATIQUE ---------------------------------------------*/
.practice-circle {
  position: relative;
  width: min(100%, 370px);
  aspect-ratio: 1;
  margin: 2.5rem auto;             /* laisse la place aux mots autour du cercle */
  justify-self: center;
}
.practice-circle-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.practice-circle-track { fill: none; stroke: var(--color-line); stroke-width: 1; opacity: .45; }
.practice-circle-stroke { fill: none; stroke: var(--color-ink); stroke-width: 1.1; stroke-linecap: round; opacity: .55; }
.practice-circle.is-animated .practice-circle-stroke { stroke-dasharray: 1; stroke-dashoffset: calc(1 - var(--p, 0)); }

/* Le point central rappelle celui du logo ; il apparaît quand le cercle se referme. */
.practice-circle-center { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.practice-circle-dot { width: 14px; height: 14px; /* même taille que les points du cercle (12 px + bordure) */ border-radius: 50%; background: var(--color-accent); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.2,1); }
.practice-circle.is-animated .practice-circle-dot { opacity: 0; transform: scale(.4); }
.practice-circle.is-animated.is-complete .practice-circle-dot { opacity: 1; transform: none; }

/* Les six mots : position calculée sur le cercle (rayon 37,5 %), dans le sens des aiguilles d'une montre. */
.practice-circle-words { position: absolute; inset: 0; margin: 0; padding: 0; list-style: none; }
.practice-circle-words li {
  --r: 37.5%;
  position: absolute;
  left: calc(50% + var(--r) * var(--sin));
  top: calc(50% - var(--r) * var(--cos));
}
.practice-circle-words li:nth-child(1) { --sin: 0;     --cos: 1; }
.practice-circle-words li:nth-child(2) { --sin: .866;  --cos: .5; }
.practice-circle-words li:nth-child(3) { --sin: .866;  --cos: -.5; }
.practice-circle-words li:nth-child(4) { --sin: 0;     --cos: -1; }
.practice-circle-words li:nth-child(5) { --sin: -.866; --cos: -.5; }
.practice-circle-words li:nth-child(6) { --sin: -.866; --cos: .5; }
/* Le petit cercle posé sur le trait */
.practice-circle-words li::before {
  position: absolute; left: -7px; top: -7px; width: 12px; height: 12px;
  border: 1px solid var(--color-ink); border-radius: 50%; background: var(--color-paper);
  content: ''; transition: background-color .5s ease, border-color .5s ease;
}
/* Le mot, placé à l'extérieur du cercle. --gap règle l'écart entre le petit cercle et le mot. */
.practice-circle-words li {
  --gap: 1.1rem;
  color: var(--color-ink);
  font: italic 400 clamp(1rem, 1.35vw, 1.15rem)/1.15 var(--font-heading);
  white-space: nowrap;
  transition: opacity .6s ease;
}
/* Chaque mot est décalé vers l'extérieur selon sa place sur le cercle. */
.practice-circle-words li:nth-child(1) { transform: translate(-50%, calc(-100% - var(--gap))); width: max-content; text-align: center; }
.practice-circle-words li:nth-child(4) { transform: translate(-50%, var(--gap)); width: max-content; }
.practice-circle-words li:nth-child(2), .practice-circle-words li:nth-child(3) { transform: translate(var(--gap), -50%); width: max-content; }
.practice-circle-words li:nth-child(5), .practice-circle-words li:nth-child(6) { transform: translate(calc(-100% - var(--gap)), -50%); width: max-content; text-align: right; }
/* Le petit cercle doit rester sur le trait malgré la translation du mot : on le recale. */
.practice-circle-words li:nth-child(1)::before { left: calc(50% - 7px); top: calc(100% + var(--gap) - 7px); }
.practice-circle-words li:nth-child(4)::before { left: calc(50% - 7px); top: calc(-1 * var(--gap) - 7px); }
.practice-circle-words li:nth-child(2)::before, .practice-circle-words li:nth-child(3)::before { left: calc(-1 * var(--gap) - 7px); top: calc(50% - 7px); }
.practice-circle-words li:nth-child(5)::before, .practice-circle-words li:nth-child(6)::before { left: calc(100% + var(--gap) - 7px); top: calc(50% - 7px); }

.practice-circle.is-animated .practice-circle-words li { opacity: .22; }
.practice-circle.is-animated .practice-circle-words li.is-on { opacity: 1; }
.practice-circle-words li.is-on::before,
.practice-circle:not(.is-animated) .practice-circle-words li::before { border-color: var(--color-accent); background: var(--color-accent); }

@media (max-width: 760px) {
  /* Cercle plus petit sur téléphone : les mots de gauche et de droite doivent tenir dans l'écran. */
  .practice-circle { width: min(52vw, 230px); margin: 2.4rem auto 1.2rem; }
  .practice-circle-words li { --gap: .7rem; font-size: .95rem; }
  /* « revenir au corps » passe sur deux lignes si l'écran est étroit */
  .practice-circle-words li:nth-child(2) { white-space: normal; width: 5.2em; }
}

/*-- B · LE FIL DU PARCOURS ------------------------------------------------*/
.thread {
  position: relative;
  padding-block: clamp(4.5rem, 9vw, 7.5rem);
  color: var(--anim-on-dark);
  background:
    linear-gradient(180deg, rgb(20 23 21 / 55%), rgb(20 23 21 / 35%) 40%, rgb(20 23 21 / 65%)),
    url("fil-fond.jpg") center / cover no-repeat,
    var(--anim-dark);
}
.thread .eyebrow { color: var(--anim-accent-light); }
.thread-heading { max-width: 620px; margin-bottom: clamp(3rem, 7vw, 5rem); }
.thread-heading h2 { margin-bottom: 1.1rem; color: var(--anim-on-dark); }
.thread-heading p:not(.eyebrow) { color: rgb(247 244 237 / 78%); font-size: clamp(1rem, 1.4vw, 1.12rem); }

.thread-track { position: relative; }
.thread-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.thread-svg path { fill: none; stroke-linecap: round; }
.thread-ghost { stroke: rgb(247 244 237 / 18%); stroke-width: 1; }
.thread-line { stroke: var(--anim-on-dark); stroke-width: 1.3; }
.thread-upcoming { stroke: var(--anim-on-dark); stroke-width: 1.3; stroke-dasharray: 3 7; }

.thread-steps { position: relative; margin: 0; padding: 0; list-style: none; }
.thread-step { --dot-x: 38%; position: relative; min-height: clamp(210px, 34vh, 320px); }
.thread-step:nth-child(even) { --dot-x: 62%; }
.thread-step:last-child { min-height: 0; padding-bottom: 1rem; }
.thread-step a { display: block; width: min(32%, 340px); margin-left: calc(var(--dot-x) + 2.2rem); color: inherit; }
.thread-step:nth-child(odd) a { margin-left: calc(var(--dot-x) - 2.2rem - min(32%, 340px)); text-align: right; }
.thread-dot {
  position: absolute; left: var(--dot-x); top: .55rem;
  width: 13px; height: 13px; margin-left: -7.5px;
  border: 1px solid var(--anim-on-dark); border-radius: 50%; background: var(--anim-dark);
  transition: background-color .5s ease, transform .5s ease;
}
.thread-step.is-on .thread-dot, .thread:not(.is-animated) .thread-dot { background: var(--anim-accent-light); border-color: var(--anim-accent-light); transform: scale(1.15); }
.thread-step.is-upcoming .thread-dot { background: var(--anim-dark) !important; border-color: var(--anim-on-dark) !important; border-style: dashed; transform: none !important; }
.thread-label { display: block; margin-bottom: .5rem; color: var(--anim-accent-light); font-size: var(--font-size-label); font-weight: 600; letter-spacing: .18em; text-transform: uppercase; }
.thread-title { display: block; margin-bottom: .55rem; color: var(--anim-on-dark); font: 400 clamp(1.45rem, 2.4vw, 2rem)/1.1 var(--font-heading); letter-spacing: -.02em; }
.thread-text { display: block; color: rgb(247 244 237 / 78%); font-size: var(--font-size-p); line-height: 1.55; }
.thread-step a:hover .thread-title, .thread-step a:focus-visible .thread-title { color: var(--anim-accent-light); }
.thread-step a:focus-visible { outline: 1px solid var(--anim-accent-light); outline-offset: 6px; }

/* Apparition des textes : en fondu, quand le fil atteint le point */
.thread.is-animated .thread-step a > span:not(.thread-dot) { opacity: .25; transform: translateY(8px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
.thread.is-animated .thread-step.is-on a > span:not(.thread-dot) { opacity: 1; transform: none; }

@media (max-width: 760px) {
  /* Sur téléphone, le fil longe le bord gauche et tous les textes passent à droite. */
  .thread-step, .thread-step:nth-child(even) { --dot-x: 10px; min-height: 0; padding-bottom: 3.2rem; }
  .thread-step a, .thread-step:nth-child(odd) a { width: auto; margin-left: 2.6rem; text-align: left; }
}

/* Accueil sur téléphone : titre, puis cercle, puis texte.
   « display: contents » laisse le titre et les paragraphes se placer
   indépendamment, pour glisser le cercle entre eux. L'ordinateur n'est pas concerné. */
@media (max-width: 760px) {
  .approach { gap: 0; }
  .approach .approach-copy { display: contents; }
  .approach .approach-copy > .eyebrow,
  .approach .approach-copy > h2 { order: 1; }
  .approach .approach-copy > h2 { margin-bottom: 0; }
  .approach .practice-circle { order: 2; margin: 3.6rem auto 3.2rem; }
  .approach .approach-copy > p:not(.eyebrow) { order: 3; }
}

/* Bouton au bout du fil (accueil) */
.thread-cta { display: flex; justify-content: center; margin-top: clamp(3rem, 6vw, 4.5rem); }
.thread-cta .button-primary:hover { background: #fffaf4; color: var(--color-accent-dark); }
.thread.is-animated .thread-cta { opacity: 0; transform: translateY(10px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.2,1); }
.thread.is-animated.is-done .thread-cta { opacity: 1; transform: none; }
@media (max-width: 760px) { .thread-cta { justify-content: flex-start; } }
/* Respiration entre la section claire précédente et la bande sombre */
#degres.thread { margin-top: clamp(3.5rem, 7vw, 6rem); }

/*-- C · COURBE DE LA PAGE STAGES -------------------------------------------
  La courbe se dessine au défilement ; le tracé complet reste visible en très pâle. */
.journey-route .journey-ghost { opacity: .55; }
.journey-route.is-animated path:not(.journey-ghost) { stroke: #a8968a; stroke-width: 1.35; }
