/* Section is tall to give sticky scroll runway */
.loop {
  position: relative;
  height: 300vh;
  padding: 0 var(--space-lg);
}

.loop__bg-text {
  font-size: clamp(10rem, 20vw, 20rem);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  -webkit-text-stroke: 1px rgba(133, 22, 255, 0.03);
}

/* Sticky container — stays in viewport while you scroll */
.loop__sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1;
}

.loop__headline {
  text-align: center;
  margin-bottom: var(--space-sm);
}

.loop__subhead {
  text-align: center;
  font-size: 1.0625rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin-bottom: var(--space-3xl);
}

/* ── Bubble track ── */
.loop__track {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: var(--space-3xl);
}

/* ── Connector lines between bubbles ── */
.loop__line {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, rgba(133, 22, 255, 0.15), rgba(123, 228, 255, 0.15));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1),
              background 0.6s ease;
  flex-shrink: 0;
}

.loop__line.is-drawn {
  transform: scaleX(1);
  background: linear-gradient(90deg, rgba(133, 22, 255, 0.5), rgba(123, 228, 255, 0.5));
}

/* ── Bubbles ── */
.loop__bubble {
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: var(--glass-surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(133, 22, 255, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-md);
  position: relative;
  flex-shrink: 0;

  /* Default: small + dim */
  transform: scale(0.65);
  opacity: 0.3;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.6s ease,
              box-shadow 0.6s ease;
}

/* Glow ring */
.loop__bubble-ring {
  position: absolute;
  inset: -16px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(133, 22, 255, 0.15), transparent 70%);
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}

/* ── Active state ── */
.loop__bubble.is-active {
  transform: scale(1.2);
  opacity: 1;
  border-color: rgba(133, 22, 255, 0.45);
  box-shadow: 0 0 40px rgba(133, 22, 255, 0.2),
              0 0 80px rgba(133, 22, 255, 0.08),
              0 0 120px rgba(123, 228, 255, 0.04);
}

.loop__bubble.is-active .loop__bubble-ring {
  opacity: 1;
}

.loop__bubble.is-active .loop__step-title {
  background: linear-gradient(135deg, var(--text-primary) 30%, var(--accent-purple) 65%, var(--accent-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.loop__bubble.is-active .loop__step-desc {
  color: var(--text-secondary);
}

/* ── Passed state ── */
.loop__bubble.is-passed {
  transform: scale(0.8);
  opacity: 0.5;
  border-color: rgba(133, 22, 255, 0.2);
}

/* ── Step content ── */
.loop__step-num {
  font-family: var(--font-label);
  font-size: 0.625rem;
  font-weight: var(--weight-bold);
  letter-spacing: 0.15em;
  color: var(--accent-cyan);
  margin-bottom: 0.25rem;
  opacity: 0.6;
}

.loop__step-title {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: var(--weight-extrabold);
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: -0.01em;
  margin-bottom: 0.25rem;
}

.loop__step-desc {
  font-size: 0.6875rem;
  color: var(--text-tertiary);
  line-height: 1.4;
}

/* ── Closing ── */
.loop__closing {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: var(--weight-bold);
  text-align: center;
  background: linear-gradient(135deg, var(--text-primary) 30%, var(--accent-purple) 65%, var(--accent-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
