/* Candy Doodle scroll showcase — pinned WebGL + caption stack (TASK-16) */

.showcase {
  position: relative;
  --showcase-chapters: 5;
  isolation: isolate;
}

.showcase__pin {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 100vh;
  min-height: 320px;
  overflow: hidden;
  background: linear-gradient(160deg, #fdf2f8 0%, #f3e8ff 45%, #ede9fe 100%);
}

.showcase__canvas-wrap {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.showcase__canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.showcase__scrim {
  pointer-events: none;
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(253, 234, 242, 0.72) 0%,
    rgba(243, 232, 255, 0.08) 38%,
    rgba(237, 233, 254, 0.55) 100%
  );
}

.showcase__captions {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
  padding: clamp(1rem, 3vw, 2rem);
  padding-bottom: clamp(1.5rem, 4vh, 3rem);
  max-width: 36rem;
}

.showcase__caption {
  display: none;
  margin: 0;
  animation: showcase-caption-in 0.45s ease;
}

.showcase__caption.is-active {
  display: block;
}

.showcase__caption-eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pink-hot, #e8409a);
}

.showcase__caption-title {
  margin: 0 0 0.5rem;
  font-family: var(--font-display, 'Baloo 2', system-ui, sans-serif);
  font-size: clamp(1.5rem, 2.5vw, 2.25rem);
  line-height: 1.12;
  color: var(--purple-deep, #6b2d8f);
}

.showcase__caption-body {
  margin: 0;
  font-size: clamp(1rem, 1.2vw, 1.125rem);
  line-height: 1.55;
  color: var(--purple-ink, #4a1d66);
  max-width: 34ch;
}

.showcase__caption-cta {
  display: inline-flex;
  margin-top: 1rem;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  background: var(--pink-hot, #e8409a);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(232, 64, 154, 0.28);
}

.showcase__track {
  height: calc(var(--showcase-chapters) * 100vh);
  pointer-events: none;
}

.showcase__fallback {
  display: none;
  padding: clamp(1rem, 3vw, 2rem);
  background: linear-gradient(160deg, #fdf2f8 0%, #f3e8ff 100%);
}

.showcase__fallback-figure {
  margin: 0 auto 1.5rem;
  max-width: 28rem;
  text-align: center;
}

.showcase__fallback-figure img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.showcase__fallback-steps {
  display: grid;
  gap: 0.75rem;
  max-width: 40rem;
  margin: 0 auto;
  list-style: none;
  padding: 0;
}

.showcase__fallback-steps li {
  padding: 0.85rem 1rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.72);
  border: 2px solid var(--pink-light, #fadce8);
  color: var(--purple-ink, #4a1d66);
  font-size: 0.95rem;
}

.showcase[data-state='ready'] .showcase__fallback {
  display: none;
}

.showcase--static .showcase__pin {
  position: relative;
  height: auto;
  min-height: 0;
}

.showcase--static .showcase__canvas-wrap,
.showcase--static .showcase__scrim,
.showcase--static .showcase__captions,
.showcase--static .showcase__track {
  display: none;
}

.showcase--static .showcase__fallback {
  display: block;
}

@media (max-width: 899px) {
  .showcase__pin {
    height: 60vh;
    min-height: 280px;
  }

  .showcase__captions {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: auto;
    max-width: none;
    padding: 1rem;
    background: linear-gradient(180deg, transparent, rgba(253, 234, 242, 0.92) 35%);
  }

  .showcase__caption-title {
    font-size: 1.25rem;
  }

  .showcase__caption-body {
    font-size: 0.95rem;
  }
}

@keyframes showcase-caption-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .showcase__caption {
    animation: none;
  }
}
