/* Block: how-it-works */

.hiw {
  padding: var(--space-12) 0;
  background: var(--color-surface);
}

.hiw__container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.hiw__eyebrow {
  font-size: 12px;
  color: var(--color-text-secondary);
  letter-spacing: 1.8px;
  text-transform: uppercase;
  margin-bottom: var(--space-6);
}

.hiw__title {
  font-family: var(--font-serif);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.6px;
  color: var(--color-text-primary);
  margin-bottom: var(--space-11);
  max-width: 560px;
}

/* ── Desktop: horizontal SVG flow ───────────────── */

.hiw__flow--desktop {
  display: block;
  width: 100%;
  height: auto;
}

.hiw__flow--mobile {
  display: none;
}

/* SVG internals — shared between both orientations */

.hiw__track {
  stroke: var(--color-border-secondary);
  stroke-width: 0.5;
  stroke-dasharray: 3 4;
}

.hiw__entry-dot {
  fill: var(--color-text-primary);
}

.hiw__hub {
  fill: none;
  stroke: var(--color-text-primary);
  stroke-width: 1;
}

.hiw__spoke {
  stroke: var(--color-accent);
  stroke-width: 0.5;
}

.hiw__node {
  fill: var(--color-accent);
}

.hiw__cycle {
  fill: none;
  stroke: var(--color-accent);
  stroke-width: 1;
}

.hiw__cycle-tip {
  fill: var(--color-accent);
}

.hiw__growth {
  fill: none;
  stroke: var(--color-accent);
  stroke-width: 1.5;
}

.hiw__growth-dot {
  fill: var(--color-accent);
}

.hiw__step-title {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  fill: var(--color-text-primary);
}

.hiw__step-sub {
  font-family: var(--font-sans);
  font-size: 11px;
  fill: var(--color-text-secondary);
}

/* ── Animation: line draw + sequential step reveal ── */

.hiw__draw {
  stroke-dashoffset: var(--draw-length, 480);
}

.is-revealed .hiw__draw {
  animation: hiw-draw 2000ms var(--ease-out) 200ms forwards;
}

.hiw__growth.hiw__draw {
  --draw-length: 70;
  stroke-dasharray: 70;
}

.is-revealed .hiw__growth.hiw__draw {
  animation: hiw-draw 800ms var(--ease-out) 1700ms forwards;
}

.hiw__step {
  opacity: 0;
}

.is-revealed .hiw__step {
  animation: hiw-appear 600ms var(--ease-out) forwards;
}

.is-revealed .hiw__step--1 { animation-delay: 100ms; }
.is-revealed .hiw__step--2 { animation-delay: 500ms; }
.is-revealed .hiw__step--3 { animation-delay: 1000ms; }
.is-revealed .hiw__step--4 { animation-delay: 1500ms; }

@keyframes hiw-draw {
  to { stroke-dashoffset: 0; }
}

@keyframes hiw-appear {
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .hiw__draw,
  .hiw__growth.hiw__draw {
    stroke-dashoffset: 0 !important;
    animation: none !important;
  }
  .hiw__step {
    opacity: 1 !important;
    animation: none !important;
  }
}

/* ── Mobile: vertical flow ──────────────────────── */

@media (max-width: 768px) {
  .hiw {
    padding: var(--space-10) 0;
  }

  .hiw__title {
    margin-bottom: var(--space-9);
  }

  .hiw__flow--desktop {
    display: none;
  }

  .hiw__flow--mobile {
    display: block;
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
    height: auto;
  }
}
