/* =========================================================================
   Solutions hero — "data lifecycle" looping animation
   Scoped under .lifecycle. Brand tokens only. prefers-reduced-motion aware.
   A synthetic sensor point-cloud (canvas) sits behind all four stages.
   ========================================================================= */
.lifecycle {
  position: absolute; inset: 0; z-index: 1;
  background: var(--bg, #0A0A0A);
  font-family: var(--font-mono);
  overflow: hidden;
  display: flex; flex-direction: column;
}

/* ---- top stepper ---- */
.lifecycle__stepper {
  position: relative; z-index: 3;
  display: flex; gap: 6px; flex-wrap: nowrap;
  padding: 14px 16px 0;
}
.lifecycle .lc-step {
  flex: 1 1 0; min-width: 0;
  display: flex; align-items: center; gap: 5px;
  font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--fg-dim, rgba(255,255,255,0.4));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--border, #24282E);
  transition: color .4s var(--ease-out), border-color .4s var(--ease-out);
}
.lifecycle .lc-step i {
  font-style: normal;
  color: var(--fg-muted, rgba(255,255,255,0.6));
  transition: color .4s var(--ease-out);
}
.lifecycle .lc-step.is-active { color: var(--accent, #FB9826); border-color: var(--accent, #FB9826); }
.lifecycle .lc-step.is-active i { color: var(--accent, #FB9826); }

/* ---- stage = the device "viewport" ---- */
.lifecycle__stage {
  position: relative; flex: 1 1 auto; margin: 12px 16px;
  border: 1px solid var(--border, #24282E);
  border-radius: 8px; overflow: hidden;
  background:
    radial-gradient(120% 95% at 50% 38%, #16191d 0%, #101316 45%, var(--bg,#0A0A0A) 100%);
  box-shadow:
    inset 0 0 70px rgba(0,0,0,0.65),
    inset 0 0 1px 1px rgba(251,152,38,0.06);
}
/* faint orange edge glow echoing the hero */
.lifecycle__stage::before {
  content: ""; position: absolute; inset: 0; z-index: 4; pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 0 36px -8px rgba(251,152,38,0.18);
}
/* radial vignette */
.lifecycle .lc-vignette {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(70% 64% at 50% 46%, transparent 52%, rgba(5,6,7,0.6) 100%);
}
/* subtle scanline / grain texture */
.lifecycle .lc-grain {
  position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0.5;
  background-image: repeating-linear-gradient(
    to bottom, rgba(255,255,255,0.025) 0px, rgba(255,255,255,0.025) 1px,
    transparent 1px, transparent 3px);
  mix-blend-mode: overlay;
}
/* the point-cloud canvas */
.lifecycle .lc-cloud { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; display: block; }

/* ---- scenes (overlays over the canvas) ---- */
.lifecycle .lc-scene {
  position: absolute; inset: 0; z-index: 3;
  opacity: 0; visibility: hidden;
  transition: opacity .5s var(--ease-out), visibility 0s linear .5s;
}
.lifecycle .lc-scene.is-on { opacity: 1; visibility: visible; transition: opacity .5s var(--ease-out); }

.lifecycle .lc-corner {
  position: absolute; z-index: 6;
  font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--fg-dim, rgba(255,255,255,0.42));
}
.lifecycle .lc-corner.tl { top: 10px; left: 12px; }
.lifecycle .lc-corner.tr { top: 10px; right: 12px; color: var(--accent, #FB9826); }
.lifecycle .lc-corner.bl { bottom: 10px; left: 12px; }

/* =========================================================================
   02 ANNOTATE — boxes wrap real clusters
   ========================================================================= */
.lifecycle .lc-box {
  position: absolute; border: 1.5px solid var(--accent, #FB9826);
  border-radius: 2px; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.25);
  opacity: 0;
}
.lifecycle .lc-box.b1 { left: 16%; top: 36%; width: 30%; height: 36%; border-color: var(--accent,#FB9826); }
.lifecycle .lc-box.b2 { left: 60%; top: 27%; width: 22%; height: 30%; border-color: var(--data-blue,#3B6FE0); }
.lifecycle .lc-box.b3 { left: 62%; top: 63%; width: 20%; height: 22%; border-color: var(--data-red,#FF2D2D); }
.is-running .lc-scene[data-scene="1"].is-on .lc-box { animation: lc-box-in .5s var(--ease-out) forwards; }
.is-running .lc-scene[data-scene="1"].is-on .lc-box.b1 { animation-delay: .25s; }
.is-running .lc-scene[data-scene="1"].is-on .lc-box.b2 { animation-delay: .6s; }
.is-running .lc-scene[data-scene="1"].is-on .lc-box.b3 { animation-delay: .95s; }
@keyframes lc-box-in {
  from { opacity: 0; transform: scale(1.08); clip-path: inset(0 100% 0 0); }
  to { opacity: 1; transform: scale(1); clip-path: inset(0 0 0 0); }
}
.lifecycle .lc-chip {
  position: absolute; z-index: 6;
  font-size: 8.5px; letter-spacing: 0.04em; font-weight: 500;
  background: var(--accent, #FB9826); color: #0A0A0A;
  padding: 1px 5px; border-radius: 2px; white-space: nowrap;
  opacity: 0; transform: translateY(3px);
}
.lifecycle .lc-chip.c2 { background: var(--data-blue,#3B6FE0); color: #fff; }
.lifecycle .lc-chip.c3 { background: var(--data-red,#FF2D2D); color: #fff; }
.is-running .lc-scene[data-scene="1"].is-on .lc-chip { animation: lc-chip-in .4s var(--ease-out) forwards; }
.is-running .lc-scene[data-scene="1"].is-on .lc-chip.c1 { animation-delay: .55s; }
.is-running .lc-scene[data-scene="1"].is-on .lc-chip.c2 { animation-delay: .9s; }
.is-running .lc-scene[data-scene="1"].is-on .lc-chip.c3 { animation-delay: 1.25s; }
@keyframes lc-chip-in { to { opacity: 1; transform: translateY(0); } }
/* segmentation polygon over cluster 1 */
.lifecycle .lc-poly {
  position: absolute; left: 16%; top: 36%; width: 30%; height: 36%;
  background: rgba(251,152,38,0.20);
  border: 1px solid rgba(251,152,38,0.55);
  clip-path: polygon(24% 6%, 74% 0, 96% 40%, 88% 84%, 46% 100%, 8% 78%, 0 38%);
  opacity: 0;
}
.is-running .lc-scene[data-scene="1"].is-on .lc-poly { animation: lc-fade-in .7s var(--ease-out) .45s forwards; }
@keyframes lc-fade-in { from { opacity: 0; } to { opacity: 1; } }
.lifecycle .lc-kp {
  position: absolute; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent, #FB9826); box-shadow: 0 0 0 2px rgba(251,152,38,0.25);
  opacity: 0; transform: scale(0);
}
.is-running .lc-scene[data-scene="1"].is-on .lc-kp { animation: lc-kp-pop .4s var(--ease-out) forwards; }
.is-running .lc-scene[data-scene="1"].is-on .lc-kp:nth-of-type(1){ animation-delay: 1.15s; }
.is-running .lc-scene[data-scene="1"].is-on .lc-kp:nth-of-type(2){ animation-delay: 1.27s; }
.is-running .lc-scene[data-scene="1"].is-on .lc-kp:nth-of-type(3){ animation-delay: 1.39s; }
@keyframes lc-kp-pop { to { opacity: 1; transform: scale(1); } }

/* =========================================================================
   03 EVALUATE — two panes; canvas draws the cloud into each
   ========================================================================= */
.lifecycle .lc-ab { position: absolute; inset: 0; display: flex; gap: 8px; padding-bottom: 52px; z-index: 4; }
.lifecycle .lc-ab__pane {
  position: relative; flex: 1 1 0; border: 1px solid var(--border, #24282E);
  border-radius: 6px; overflow: hidden; background: transparent;
}
.lifecycle .lc-ab__pane::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(70% 60% at 50% 45%, rgba(120,140,160,0.06), transparent 65%);
}
.lifecycle .lc-ab__label {
  position: absolute; top: 8px; left: 8px; z-index: 3;
  font-size: 10px; color: var(--fg-muted, rgba(255,255,255,0.6)); letter-spacing: .1em;
}
.lifecycle .lc-ab__pane.win { border-color: var(--accent, #FB9826); }
.lifecycle .lc-pref {
  position: absolute; top: 44%; left: 50%; z-index: 6;
  transform: translate(-50%,-50%) scale(.8);
  background: var(--accent, #FB9826); color: #0A0A0A;
  font-size: 9px; letter-spacing: .06em; padding: 3px 8px; border-radius: 3px;
  white-space: nowrap; opacity: 0; font-weight: 500;
}
.is-running .lc-scene[data-scene="2"].is-on .lc-pref { animation: lc-pref-stamp .5s var(--ease-out) 1.2s forwards; }
@keyframes lc-pref-stamp {
  0% { opacity: 0; transform: translate(-50%,-50%) scale(1.4); }
  60% { opacity: 1; transform: translate(-50%,-50%) scale(.92); }
  100% { opacity: 1; transform: translate(-50%,-50%) scale(1); }
}
.lifecycle .lc-metrics {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 5;
  display: flex; flex-direction: column; gap: 6px; padding: 10px 2px 2px;
}
.lifecycle .lc-metric { display: flex; align-items: center; gap: 8px; font-size: 8.5px; letter-spacing: .06em; color: var(--fg-muted, rgba(255,255,255,0.6)); text-transform: uppercase; }
.lifecycle .lc-metric span { width: 84px; flex: none; }
.lifecycle .lc-metric .bar { position: relative; flex: 1 1 auto; height: 4px; background: var(--border, #24282E); border-radius: 999px; overflow: hidden; }
.lifecycle .lc-metric .bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--accent, #FB9826); border-radius: 999px; }
.is-running .lc-scene[data-scene="2"].is-on .lc-metric .bar i { animation: lc-fill 1s var(--ease-out) .5s forwards; }
@keyframes lc-fill { from { width: 0; } to { width: var(--to, 80%); } }

/* =========================================================================
   04 DEPLOY — canvas converges points to a grid; QA stamp pulses
   ========================================================================= */
.lifecycle .lc-stamp {
  position: absolute; top: 50%; left: 50%; z-index: 6;
  transform: translate(-50%,-50%) scale(.6); opacity: 0;
  display: flex; align-items: center; gap: 8px;
  background: rgba(10,10,10,0.72); border: 1px solid var(--accent, #FB9826);
  color: var(--accent, #FB9826); padding: 8px 14px; border-radius: 999px;
  font-size: 12px; letter-spacing: .08em; backdrop-filter: blur(2px);
}
.lifecycle .lc-stamp svg { width: 16px; height: 16px; }
.is-running .lc-scene[data-scene="3"].is-on .lc-stamp { animation: lc-stamp 1.4s var(--ease-out) 1s forwards; }
@keyframes lc-stamp {
  0% { opacity: 0; transform: translate(-50%,-50%) scale(.6); }
  30% { opacity: 1; transform: translate(-50%,-50%) scale(1.08); }
  45% { transform: translate(-50%,-50%) scale(1); }
  100% { opacity: 1; transform: translate(-50%,-50%) scale(1); }
}

/* ---- bottom progress rail ---- */
.lifecycle__rail {
  position: relative; z-index: 3; height: 2px; margin: 0 16px 14px;
  background: var(--border, #24282E); border-radius: 999px; overflow: hidden;
}
.lifecycle__rail i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--accent, #FB9826); }
.is-running .lifecycle__rail i { animation: lc-rail var(--loop, 14s) linear infinite; }
@keyframes lc-rail { from { width: 0; } to { width: 100%; } }

/* ---- reduced motion: static finished stage-02 (cloud + boxes) ---- */
@media (prefers-reduced-motion: reduce) {
  .lifecycle__rail { display: none; }
  .lifecycle .lc-scene[data-scene="1"] { opacity: 1 !important; visibility: visible !important; }
  .lifecycle .lc-scene[data-scene="1"] .lc-box,
  .lifecycle .lc-scene[data-scene="1"] .lc-chip,
  .lifecycle .lc-scene[data-scene="1"] .lc-poly,
  .lifecycle .lc-scene[data-scene="1"] .lc-kp { opacity: 1 !important; transform: none !important; clip-path: none !important; }
  .lifecycle .lc-step[data-stage="1"] { color: var(--accent,#FB9826); border-color: var(--accent,#FB9826); }
  .lifecycle .lc-step[data-stage="1"] i { color: var(--accent,#FB9826); }
}
