/*!
 * MSFG Constellation: Purchase page effect · v1.1.0
 * Styles for the layer built by msfg-constellation.js.
 *
 * Theming: override the custom properties on .msfg-constellation
 * (or on the hero) in your own stylesheet. Keep --mc-laser and
 * --mc-laser-rgb in sync; the -rgb one feeds the glows.
 */

.msfg-constellation {
  --mc-laser: #8cc63e;          /* MSFG Green (brand token msfg-green) */
  --mc-laser-rgb: 140, 198, 62; /* same color as r, g, b */
  --mc-tag-color: #ffffff;
  --mc-tag-size: 15px;

  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
}

/* Too narrow for the effect, or not enough room beside the copy. */
.msfg-constellation.is-off {
  display: none;
}

/* ---------- Star points ---------- */

.mc-star {
  position: absolute;
  left: 0;
  top: 0;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: var(--mc-laser);
  color: var(--mc-laser);
  opacity: 0.45;
  box-shadow: 0 0 0 rgba(var(--mc-laser-rgb), 0), 0 0 0 rgba(var(--mc-laser-rgb), 0);
  transition: transform 400ms ease, opacity 400ms ease, box-shadow 400ms ease;
}

.mc-star::after {
  content: "";
  position: absolute;
  inset: -6px;
  border: 1px solid currentColor;
  border-radius: 50%;
  opacity: 0.3;
}

/* Targeted: the laser is on its way. */
.mc-star.is-armed {
  opacity: 0.85;
}

.mc-star.is-lit {
  opacity: 1;
  transform: scale(1.7);
  box-shadow: 0 0 10px rgba(var(--mc-laser-rgb), 0.95), 0 0 24px rgba(var(--mc-laser-rgb), 0.5);
}

/* ---------- Product names (sit 14px above their star) ---------- */

.mc-tag {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, calc(-100% - 14px));
  white-space: nowrap;
  font-family: inherit;
  font-size: var(--mc-tag-size);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.01em;
  color: var(--mc-tag-color);
  text-shadow: 0 0 14px rgba(var(--mc-laser-rgb), 0.6), 0 1px 2px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transition: opacity 420ms ease;
}

.mc-tag.is-lit {
  opacity: 1;
  transition-duration: 160ms;
}

/* ---------- Laser lines ---------- */

.mc-line {
  position: absolute;
  left: 0;
  top: 0;
  height: 0;
  transform-origin: 0 50%;
}

.mc-line__core {
  position: absolute;
  left: 0;
  top: -1px;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--mc-laser);
  box-shadow: 0 0 8px rgba(var(--mc-laser-rgb), 0.8), 0 0 18px rgba(var(--mc-laser-rgb), 0.35);
  transform-origin: 0 50%;
  transform: scaleX(0);
  opacity: 0;
}

.mc-line__head {
  position: absolute;
  left: -3px;
  top: -3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 10px #ffffff, 0 0 22px rgba(var(--mc-laser-rgb), 0.9);
  opacity: 0;
}

/* ---------- Reduced motion: names show quietly, nothing moves ---------- */

.msfg-constellation.is-static .mc-tag {
  opacity: 0.7;
  transition: none;
}

.msfg-constellation.is-static .mc-star {
  transition: none;
}

.msfg-constellation.is-static .mc-line {
  display: none;
}

/* ---------- Light theme (optional) ----------
 * For light section backgrounds. Add the class to the layer:
 *   <div class="msfg-constellation msfg-constellation--light" data-msfg-constellation></div>
 * Uses Support Green for the laser: MSFG Green is too faint on a light ground (about 1.9:1).
 */
.msfg-constellation--light {
  --mc-laser: #4b7b4d;          /* Support Green (brand token support-green) */
  --mc-laser-rgb: 75, 123, 77;
  --mc-tag-color: #104547;      /* Deep Forest (brand token deep-forest) */
}

.msfg-constellation--light .mc-tag {
  text-shadow: none;
}

.msfg-constellation--light .mc-line__core {
  box-shadow: none;
}

.msfg-constellation--light .mc-line__head {
  background: var(--mc-laser);
  box-shadow: 0 0 0 3px rgba(var(--mc-laser-rgb), 0.2);
}

.msfg-constellation--light .mc-star.is-lit {
  box-shadow: 0 0 0 4px rgba(var(--mc-laser-rgb), 0.18);
}
