/* ——— "Here's how Hello Mathy helps Ava grow" (js/loop-explainer.js) ———
   One screen: a loop of three steps (🎯 you tell us, 🎮 the child plays,
   🌱 you see progress) with a dot going around it and a sprout in the middle
   that grows a stage each lap; then the same three steps in words, and the
   trust line. Neutral grown-up colours that don't depend on the page's world,
   so the welcome page can use it too. Class prefix .lx-. */

.lx {
  --lx-ink: var(--ink, #4a2a5c);
  --lx-soft: var(--ink-soft, #82639a);
  --lx-line: #eadff2;
  --lx-card: #fff;
  --lx-accent: #ff8a3d;
  --lx-accent-deep: #c9580f;
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: var(--lx-ink);
}
.lx-title {
  margin: 0;
  font-family: var(--font, 'Fredoka', ui-rounded, system-ui, sans-serif);
  font-size: clamp(26px, 6.6vw, 34px);
  font-weight: 600;
  line-height: 1.15;
  text-wrap: balance;
}

/* The loop */
.lx-stage { position: relative; display: flex; justify-content: center; }
.lx-loop { display: block; width: 100%; max-width: 260px; height: auto; overflow: visible; }
.lx-ring { fill: none; stroke: var(--lx-line); stroke-width: 6; stroke-dasharray: 2 12; stroke-linecap: round; }
.lx-node circle {
  fill: var(--lx-card);
  stroke: var(--lx-line);
  stroke-width: 3;
  transform-box: fill-box;
  transform-origin: center;
  transition: stroke 0.2s, transform 0.25s;
}
.lx-node.lx-hot circle { stroke: var(--lx-accent); transform: scale(1.12); }
.lx-node text { font-size: 26px; text-anchor: middle; dominant-baseline: central; }
.lx-dot { fill: var(--lx-accent); }

/* The sprout: stage 0 a shoot, 1 a leaf, 2 two leaves, 3 a flower. */
.lx-soil { fill: #c79a6b; }
.lx-stem {
  fill: none;
  stroke: #3fa86d;
  stroke-width: 5;
  stroke-linecap: round;
  transform-box: fill-box;
  transform-origin: 50% 100%;
  transition: transform 0.6s cubic-bezier(0.3, 1.5, 0.5, 1);
}
.lx-leaf { fill: #52c27f; transform-box: fill-box; transition: transform 0.5s cubic-bezier(0.3, 1.6, 0.5, 1); }
.lx-l1 { transform-origin: 100% 100%; }
.lx-l2 { transform-origin: 0% 100%; }
.lx-bloom { transform-box: fill-box; transform-origin: center; transition: transform 0.5s cubic-bezier(0.3, 1.6, 0.5, 1); }
.lx-petal { fill: #ff9f5a; }
.lx-heart { fill: #ffd34d; }
.lx-loop[data-stage='0'] .lx-stem { transform: scaleY(0.25); }
.lx-loop[data-stage='0'] .lx-leaf,
.lx-loop[data-stage='0'] .lx-bloom { transform: scale(0); }
.lx-loop[data-stage='1'] .lx-stem { transform: scaleY(0.55); }
.lx-loop[data-stage='1'] .lx-l2,
.lx-loop[data-stage='1'] .lx-bloom { transform: scale(0); }
.lx-loop[data-stage='2'] .lx-stem { transform: scaleY(0.8); }
.lx-loop[data-stage='2'] .lx-bloom { transform: scale(0); }

/* The three steps in words */
.lx-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.lx-steps li { display: grid; grid-template-columns: 38px 1fr; gap: 12px; align-items: start; }
.lx-num {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff4e8;
  color: var(--lx-accent-deep);
  font-size: 19px;
  font-weight: 700;
  box-shadow: 0 3px 0 #f6dcc4;
}
.lx-steps li > div > b { display: block; font-size: 19px; font-weight: 600; line-height: 1.25; }
.lx-steps li > div > span { display: block; margin-top: 2px; font-size: 16px; color: var(--lx-soft); }
.lx-trust { margin: 2px 0 0; text-align: center; font-size: 16px; font-weight: 600; color: var(--lx-soft); }

@media (max-width: 380px) {
  .lx-loop { max-width: 220px; }
  .lx-steps li > div > b { font-size: 17px; }
}

/* Still under reduced motion: the loop is drawn full grown, with no dot. */
@media (prefers-reduced-motion: reduce) {
  .lx-node circle, .lx-stem, .lx-leaf, .lx-bloom { transition: none; }
  .lx-dot { display: none; }
}
