.purchase-funnel {
  position: relative;
  width: min(100%, 540px);
  margin: 0 auto;
  padding: 18px 0 48px;
  isolation: isolate;
}

.purchase-funnel figcaption {
  margin: 0 0 22px;
  color: #b7e5df;
  font: 600 15px/1.3 var(--display);
  letter-spacing: .015em;
}

.funnel-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 78px;
  margin: 0 auto 5px;
  clip-path: polygon(0 0, 100% 0, calc(100% - 7%) 100%, 7% 100%);
  text-align: center;
  box-shadow: inset 0 1px 0 #ffffff66;
  animation: funnel-arrive .8s both;
}

.funnel-stage strong {
  font: 700 clamp(17px, 1.8vw, 22px)/1.1 var(--display);
}

.funnel-number {
  position: absolute;
  left: 13%;
  top: 50%;
  transform: translateY(-50%);
  font: 500 12px var(--mono);
  opacity: .7;
}

.funnel-metric {
  margin-top: 3px;
  font: 500 12px/1.2 var(--body);
  opacity: .8;
}

.funnel-stage-1 { width: 100%; background: #e8f5f3; color: var(--navy); animation-delay: .05s; }
.funnel-stage-2 { width: 86%; background: #b7e1dc; color: var(--navy); animation-delay: .17s; }
.funnel-stage-3 { width: 72%; background: #54b9ae; color: #061f37; animation-delay: .29s; }
.funnel-stage-4 { width: 58%; background: var(--orange); color: #fff; animation-delay: .41s; }

.funnel-flow {
  position: absolute;
  z-index: 2;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 5px #ffffff42, 0 0 18px #fff;
  pointer-events: none;
  animation: funnel-trace 5s ease-in-out 1.2s infinite;
}

.funnel-loss {
  position: absolute;
  left: 88%;
  color: #ffb880;
  font: 500 12px var(--mono);
  white-space: nowrap;
  opacity: .85;
}

.funnel-loss-1 { top: 192px; }
.funnel-loss-2 { top: 278px; left: 82%; }

.funnel-caption {
  display: block;
  margin-top: 19px;
  color: #ffffffa8;
  font: 500 13px/1.4 var(--body);
}

@keyframes funnel-arrive {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes funnel-trace {
  0%, 10% { left: 94%; top: 87px; opacity: 0; }
  18% { opacity: 1; }
  30% { left: 86%; top: 165px; }
  52% { left: 79%; top: 247px; }
  78% { left: 72%; top: 330px; opacity: 1; }
  88%, 100% { left: 72%; top: 330px; opacity: 0; }
}

@media (max-width: 500px) {
  .purchase-funnel { padding-bottom: 24px; }
  .funnel-stage { height: 72px; }
  .funnel-stage strong { font-size: 16px; }
  .funnel-metric { font-size: 10px; }
  .funnel-number { left: 9%; font-size: 10px; }
  .funnel-loss { display: none; }
  .funnel-caption { font-size: 12px; }
  .funnel-flow { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .funnel-stage, .funnel-flow { animation: none; }
  .funnel-flow { display: none; }
}
