/* ==========================================================================
   182 — Spring Follow · physique
   Pendentif élastique : ancrage, élastique SVG, pastille. Les positions
   (transform) et la géométrie du path sont pilotées par anim.js — ne pas
   ajouter de transition `transform` ni de `stroke-width` ici.
   ========================================================================== */

.spring-follow {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  width: min(320px, 100%);
}

.spring-follow__zone {
  position: relative;
  height: 185px;
  overflow: hidden;
  border-radius: 16px;
  background:
    radial-gradient(
      130% 100% at 50% 0%,
      color-mix(in srgb, var(--ml-accent, #7c8cff) 9%, transparent) 0%,
      transparent 58%
    ),
    color-mix(in srgb, var(--ml-surface, #151a24) 60%, transparent);
  touch-action: none;
}

.spring-follow__svg {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.spring-follow__band {
  fill: none;
  stroke: color-mix(in srgb, var(--ml-accent, #7c8cff) 75%, transparent);
  stroke-linecap: round;
  /* stroke-width piloté par anim.js selon la tension */
}

.spring-follow__anchor {
  position: absolute;
  top: 0;
  left: 0;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border: 2px solid var(--ml-accent, #7c8cff);
  border-radius: 50%;
  background: var(--ml-bg, #0d1017);
  box-shadow: 0 0 10px color-mix(in srgb, var(--ml-accent, #7c8cff) 45%, transparent);
  pointer-events: none;
  will-change: transform;
}

.spring-follow__bob {
  position: absolute;
  top: 0;
  left: 0;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border-radius: 50%;
  background:
    radial-gradient(
      circle at 32% 30%,
      color-mix(in srgb, var(--ml-accent-2, #2dd4bf) 60%, var(--ml-fg, #e8eaf2)),
      var(--ml-accent-2, #2dd4bf) 45%,
      color-mix(in srgb, var(--ml-accent-2, #2dd4bf) 40%, var(--ml-bg, #0d1017)) 100%
    );
  box-shadow:
    0 8px 16px -6px rgba(0, 0, 0, 0.6),
    0 0 18px -4px color-mix(in srgb, var(--ml-accent-2, #2dd4bf) 45%, transparent);
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  will-change: transform;
}

.spring-follow__bob.is-dragging {
  cursor: grabbing;
}

.spring-follow__hint {
  margin: 0;
  text-align: center;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--ml-muted, #8b91a3);
}

/* --- Accessibilité --------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  /* Oscillations et suivi désactivés par anim.js (placement direct). */
  .spring-follow__anchor,
  .spring-follow__bob {
    will-change: auto;
  }
}
