.nebula-section {
  position: relative;
  height: 280vh;
  height: 280svh;
  isolation: isolate;
  background: #02020a;
  color: #f5f3ff;
  overflow: clip;
  --nebula-progress: 0;
}
.nebula-stage {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  height: 100svh;
  min-height: 600px;
  overflow: hidden;
  background: #02020a;
}
.nebula-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}
.nebula-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, #02020a 0%, transparent 13%, transparent 85%, #02020a 100%);
}
.nebula-content {
  position: relative;
  z-index: 2;
  height: 100%;
  width: min(100%, 1680px);
  margin-inline: auto;
}
.nebula-beat {
  position: absolute;
  width: min(580px, 43%);
  margin: 0;
  text-wrap: pretty;
  --nebula-copy-alpha: 0;
  --nebula-copy-y: 0px;
}
.nebula-beat[data-nebula-beat="0"] { left: 8%; top: 16%; --nebula-copy-alpha: 1; }
.nebula-beat[data-nebula-beat="1"] { right: 7%; top: 54%; }
.nebula-beat[data-nebula-beat="2"] { left: 9%; top: 27%; }
.nebula-enhanced .nebula-beat {
  opacity: var(--nebula-copy-alpha);
  transform: translate3d(0, var(--nebula-copy-y), 0);
  will-change: opacity, transform;
}
.nebula-kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 24px;
  color: #aea7da;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .23em;
  text-transform: uppercase;
}
.nebula-kicker::before { content: ""; width: 25px; height: 1px; background: #8d7fdf; }
.nebula-beat h2 {
  margin: 0;
  color: inherit;
  font-size: clamp(32px, 3.65vw, 60px);
  font-weight: 500;
  line-height: 1.36;
  letter-spacing: -.045em;
  text-shadow: 0 2px 24px #02020a;
}
.nebula-beat > p:not(.nebula-kicker) {
  max-width: 430px;
  margin: 24px 0 0;
  color: #b0b1c5;
  font-size: clamp(14px, 1.1vw, 17px);
  line-height: 1.85;
}
.nebula-scroll-cue {
  position: absolute;
  z-index: 3;
  bottom: 6%;
  left: 8%;
  display: flex;
  gap: 28px;
  align-items: center;
  color: #85869e;
  font-size: 11px;
  letter-spacing: .12em;
  opacity: calc(1 - var(--nebula-progress) * .8);
}
.nebula-scroll-cue span { font-size: 17px; color: #c2b6ff; }

/* A normal readable layout is the baseline: no script / WebGL / motion needed. */
.nebula-section:not(.nebula-enhanced), .nebula-section.nebula-static { height: auto; }
.nebula-section:not(.nebula-enhanced) .nebula-stage,
.nebula-static .nebula-stage { position: relative; height: auto; min-height: 0; padding: 110px 8%; }
.nebula-section:not(.nebula-enhanced) .nebula-content,
.nebula-static .nebula-content { display: grid; gap: 90px; }
.nebula-section:not(.nebula-enhanced) .nebula-beat,
.nebula-static .nebula-beat { position: relative; inset: auto; width: min(670px, 100%); opacity: 1; transform: none; }
.nebula-section:not(.nebula-enhanced) .nebula-beat:nth-child(2),
.nebula-static .nebula-beat:nth-child(2) { justify-self: end; }
.nebula-section:not(.nebula-enhanced) .nebula-canvas,
.nebula-static .nebula-canvas { opacity: .35; }
.nebula-section:not(.nebula-enhanced) .nebula-scroll-cue,
.nebula-static .nebula-scroll-cue { display: none; }
.nebula-static .nebula-stage {
  background: radial-gradient(ellipse at 75% 25%, #24204355, transparent 55%), #02020a;
}

@media (max-width: 760px) {
  .nebula-section { height: 230vh; height: 230svh; }
  .nebula-stage { min-height: 540px; }
  .nebula-beat { width: auto; max-width: 420px; }
  .nebula-beat[data-nebula-beat] { top: auto; bottom: 19%; left: 7%; right: 7%; }
  .nebula-beat h2 { font-size: clamp(28px, 7.8vw, 40px); line-height: 1.42; letter-spacing: -.04em; }
  .nebula-kicker { font-size: 9px; letter-spacing: .20em; margin-bottom: 18px; }
  .nebula-beat > p:not(.nebula-kicker) { max-width: 32ch; font-size: 14px; line-height: 1.8; margin-top: 17px; }
  .nebula-scroll-cue { left: 7%; bottom: 7%; font-size: 10px; }
  .nebula-stage::after { background: linear-gradient(180deg, #02020a 0%, transparent 16%, transparent 41%, #02020aaa 65%, #02020a 100%); }
  .nebula-section:not(.nebula-enhanced) .nebula-stage, .nebula-static .nebula-stage { padding: 90px 7%; }
  .nebula-section:not(.nebula-enhanced) .nebula-content, .nebula-static .nebula-content { gap: 68px; }
}
@media (prefers-reduced-motion: reduce) {
  .nebula-section { height: auto; }
  .nebula-stage { position: relative; }
  .nebula-beat { will-change: auto; }
}
