/* ============================================================
   Section 02 — How. The signature scroll moment.
   Section is sticky; cards light up sequentially with scroll progress.
   ============================================================ */

.section-how {
  /* total scroll length = enough for headline-fade + 4 card lights + exit */
  position: relative;
  /* multiplier per card + headline buffer */
  padding-top: var(--section-py);
}

.section-how__track {
  /* the sticky stage. Total scroll: 4 * 100vh-ish so each card gets a viewport */
  height: 360vh;
  position: relative;
}

.section-how__sticky {
  position: sticky;
  top: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: clamp(4rem, 8vh, 6rem);
  overflow: hidden;
}

.section-how__head {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: clamp(2rem, 5vh, 3.5rem);
}

.section-how__cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(0.875rem, 1.5vw, 1.5rem);
}

@media (max-width: 900px) {
  .section-how__cards {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
}

@media (max-width: 540px) {
  .section-how__cards {
    grid-template-columns: 1fr;
  }
  /* on mobile, simpler: cards stack and the sticky track shrinks */
  .section-how__track {
    height: auto;
  }
  .section-how__sticky {
    position: relative;
    min-height: auto;
  }
}

/* ---------- A card ---------- */

.how-card {
  position: relative;
  background: var(--color-blue-steel);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 2vw, 1.75rem);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: clamp(220px, 30vh, 320px);
  overflow: hidden;
  transition:
    border-color 500ms var(--ease-out),
    background-color 500ms var(--ease-out),
    box-shadow 500ms var(--ease-out);
  /* muted resting state — the filament does the work, not opacity */
  opacity: 0.55;
}

.how-card.is-lit {
  opacity: 1;
  background: var(--color-lifted);
  border-color: rgba(233, 69, 96, 0.32);
  box-shadow: 0 0 0 1px rgba(233, 69, 96, 0.12),
    0 30px 60px -30px rgba(233, 69, 96, 0.22);
}

/* ---------- The filament: SVG path that traces the perimeter ---------- */

.how-card__filament {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.how-card__filament-path {
  fill: none;
  stroke: var(--color-red);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 4px rgba(233, 69, 96, 0.55))
    drop-shadow(0 0 10px rgba(233, 69, 96, 0.25));
  opacity: 0.92;
}

/* card content sits above the filament so readability holds */
.how-card > :not(.how-card__filament) {
  position: relative;
  z-index: 2;
}

.how-card__index {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--color-muted-soft);
  transition: color 400ms var(--ease-out);
}

.how-card.is-lit .how-card__index {
  color: var(--color-red);
}

.how-card__name {
  font-family: var(--font-sans);
  font-size: clamp(1.125rem, 1.2vw + 0.5rem, 1.25rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.15;
  color: var(--color-fg);
}

.how-card__body {
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--color-muted);
  flex: 1;
  transition: color 240ms var(--ease-out);
}

.how-card.is-lit .how-card__body {
  color: var(--color-fg);
}

.how-card__dots {
  display: flex;
  gap: 6px;
  margin-top: auto;
}

.how-card__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  transition: background-color 300ms var(--ease-out),
    box-shadow 300ms var(--ease-out);
}

.how-card__dot.is-on {
  background: var(--color-red);
  box-shadow: 0 0 6px var(--color-red-glow);
}

/* reduced-motion: cards arrive fully lit, no filament, no scroll-tied ignition */
@media (prefers-reduced-motion: reduce) {
  .how-card {
    opacity: 1;
  }
  .how-card .how-card__dot {
    background: var(--color-red);
    box-shadow: 0 0 6px var(--color-red-glow);
  }
  .how-card .how-card__index { color: var(--color-red); }
  .how-card__filament { display: none; }
}
