/* ─── Métamorphose : icônes de formats morphées + bande horizontale épinglée ───
   Sans JS / mouvement réduit : grille statique lisible.
   .is-live (ajoutée par js/morph.js) : section épinglée, la bande défile à l'horizontale. */

.morph { position: relative; padding: 96px 0; }
.morph-pin {
  display: grid; gap: 40px;
  padding: 0 clamp(24px, 4vw, 96px);
  max-width: 1900px; margin: 0 auto; box-sizing: border-box;
}
.morph-head { text-align: center; min-width: 0; }
.morph-head .section-desc { margin-top: 16px; }

.morph-stage { position: relative; display: grid; justify-items: center; gap: 18px; min-width: 0; }
.morph-orb {
  position: relative; display: grid; place-items: center;
  width: clamp(200px, 22vw, 360px); aspect-ratio: 1;
}
.morph-orb::before {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  border: 1px dashed rgba(34, 197, 94, .3);
  animation: morph-orbit 24s linear infinite;
}
.morph-orb::after {
  content: ''; position: absolute; inset: -18%; z-index: -1; border-radius: 50%;
  background: radial-gradient(circle, rgba(34, 197, 94, .16) 0%, transparent 62%);
}
@keyframes morph-orbit { to { transform: rotate(360deg); } }

.morph-icon { width: 58%; height: auto; overflow: visible; }
.morph-ghost {
  fill: none; stroke: var(--accent); stroke-width: 1.2; stroke-dasharray: 3 4; opacity: 0;
}
.morph-shape {
  fill: rgba(34, 197, 94, .14); stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round;
}
.morph-label {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: clamp(1rem, 1.6vw, 1.35rem); color: var(--text-1);
  background: var(--bg-elevated); border: 1px solid var(--border-med);
  padding: 8px 18px; border-radius: 99px;
}
.morph-arrow { color: var(--accent); }
.morph-to { color: var(--accent); }
.morph-label span { transition: opacity var(--t) var(--ease), transform var(--t) var(--ease); }
.morph-label.is-swap .morph-from,
.morph-label.is-swap .morph-to { opacity: 0; transform: translateY(-6px); }

.morph-band { min-width: 0; }
.morph-track {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 20px;
}
.morph-card {
  background: var(--bg-card); border: 1px solid var(--border-med); border-radius: var(--r-lg);
  padding: 24px; min-width: 0;
  transition: border-color var(--t-lg) var(--ease), opacity var(--t-lg) var(--ease), transform var(--t-lg) var(--ease), box-shadow var(--t-lg) var(--ease);
}
.morph-card svg { width: 40px; height: 40px; margin-bottom: 14px; }
.morph-card path { fill: rgba(34, 197, 94, .12); stroke: var(--accent); stroke-width: 5; stroke-linejoin: round; }
.morph-card h3 { font-family: var(--font-display); font-size: 1.2rem; color: var(--text-1); margin-bottom: 6px; }
.morph-card p { color: var(--text-2); font-size: .92rem; line-height: 1.55; }
.morph-card p.font-mono { color: var(--accent); font-size: .85rem; margin-bottom: 8px; }

.morph-progress { display: none; }
.morph:not(.is-live) .morph-stage { display: none; }

/* ─── Mode animé ─── */
/* 100vh d'épinglage + ~60vh de scroll par transformation */
.morph.is-live { padding: 0; height: 400vh; }
.morph.is-live .morph-pin {
  position: sticky; top: 0; height: 100vh; height: 100svh;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: 1fr auto auto;
  align-items: center; gap: 24px 48px;
  padding-top: 88px; padding-bottom: 32px;
  overflow: hidden; max-width: none;
}
.morph.is-live .morph-head { text-align: left; }
.morph.is-live .morph-head .section-desc { margin-left: 0; }
.morph.is-live .morph-band { grid-column: 1 / -1; overflow: visible; }
.morph.is-live .morph-track {
  display: flex; width: max-content; will-change: transform;
}
.morph.is-live .morph-card { width: clamp(260px, 28vw, 480px); flex: none; opacity: .45; }
.morph.is-live .morph-card.is-active {
  opacity: 1; border-color: var(--border-hover); transform: translateY(-8px);
  box-shadow: var(--shadow-accent);
}
.morph.is-live .morph-progress {
  display: block; grid-column: 1 / -1; height: 2px; background: var(--border-med); border-radius: 2px; overflow: hidden;
}
.morph.is-live .morph-progress span {
  display: block; height: 100%; background: var(--accent); transform-origin: left; transform: scaleX(0);
}

@media (max-width: 768px) {
  .morph { padding: 64px 0; }
  .morph-pin { padding: 0 16px; gap: 28px; }
  .morph.is-live .morph-pin {
    grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr auto auto;
    padding-top: 76px; padding-bottom: 20px; gap: 16px;
  }
  .morph.is-live .morph-head { text-align: center; }
  .morph.is-live .morph-head .section-desc { display: none; }
  .morph-orb { width: min(200px, 34svh); }
  .morph.is-live .morph-card { width: 240px; padding: 18px; }
  .morph-card svg { width: 32px; height: 32px; margin-bottom: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .morph-orb::before { animation: none; }
}
