/* ── 05 · How it works ────────────────────────────────────
   Three steps on a dashed connector that fills green when it scrolls into view.
   Each step carries a small illustration of what actually happens. */
.how { padding-block: var(--msp-section-y); background: #fff; }
.how__head { display: grid; justify-items: center; max-width: 780px; margin-inline: auto; text-align: center; }
.how__title { margin-top: 20px; font-size: var(--msp-fs-h2); line-height: 1.04; letter-spacing: -.01em; }
.how__lead { max-width: 54ch; margin-top: 22px; font-size: var(--msp-fs-lead); line-height: 1.6; }

.how__track { position: relative; margin-top: clamp(56px, 6vw, 88px); }
.how__steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }

/* Connector: dashed base + green fill that draws left to right. */
.how__line {
  position: absolute; top: 31px; left: 32px; right: calc((100% - 48px) / 3 - 32px); height: 2px;
  background: repeating-linear-gradient(90deg, #C9D1D6 0 8px, transparent 8px 14px);
}
.how__line::after { content: ""; position: absolute; inset: 0; background: var(--msp-primary); transform: scaleX(0); transform-origin: left; transition: transform 1.8s var(--msp-ease-inout) .3s; }
.how__line.is-revealed::after, html:not(.js-motion) .how__line::after { transform: scaleX(1); }
.js-motion .how__line[data-reveal] { transform: none; }

.how-step { display: flex; flex-direction: column; }
.how-step__marker {
  position: relative; z-index: 1;
  display: grid; place-items: center; flex: none;
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--msp-secondary); color: var(--msp-primary);
  box-shadow: 0 0 0 8px #fff;
  transition: transform .6s var(--msp-ease-out) .2s;
}
.how-step__marker .icon { width: 26px; height: 26px; }
.js-motion .how-step:not(.is-revealed) .how-step__marker { transform: scale(.6); }

.how-step__card {
  position: relative; overflow: hidden; flex: 1;
  display: flex; flex-direction: column;
  margin-top: 28px; padding: 30px 28px 28px;
  border-radius: var(--msp-radius-lg); background: var(--msp-surface);
}
.how-step__big {
  position: absolute; top: 10px; right: 20px;
  font-size: 104px; font-weight: 600; line-height: 1; letter-spacing: -.03em;
  color: transparent; -webkit-text-stroke: 1.5px #CDD5DA;
  pointer-events: none;
}
.how-step__label { font-size: 13px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--msp-accent); }
.how-step__title { max-width: 15ch; margin-top: 12px; font-size: clamp(1.375rem, 1.15rem + .7vw, 1.75rem); line-height: 1.18; }
.how-step__text { margin: 14px 0 26px; font-size: 16px; line-height: 1.6; }
.how-step__demo { margin-top: auto; } /* illustrations line up along the bottom of the cards */

/* Step illustrations */
.demo { padding: 16px; border-radius: 16px; background: #fff; color: var(--msp-secondary); font-size: 14px; font-weight: 400; box-shadow: 0 1px 2px rgb(8 17 25 / .06), 0 18px 34px -22px rgb(8 17 25 / .3); }
.demo .icon { width: 16px; height: 16px; }
.demo-field { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--msp-surface); }
.demo-field > .icon { color: var(--msp-accent); }
.demo-tag { margin-left: auto; padding: 3px 9px; border-radius: var(--msp-radius-pill); background: var(--msp-primary); font-size: 12px; font-weight: 600; }
.demo-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.demo-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border: 1px solid var(--msp-divider); border-radius: var(--msp-radius-pill); font-size: 12.5px; color: var(--msp-text); }
.demo-msg { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; align-items: start; }
.demo-avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--msp-surface); }
.demo-avatar img { width: 26px; height: 26px; }
.demo-msg p { padding: 10px 12px; border-radius: 4px 14px 14px 14px; background: var(--msp-surface); line-height: 1.5; }
.demo-checks { display: grid; gap: 6px; margin: 12px 0 0 48px; }
.demo-checks li { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.demo-checks .icon { color: var(--msp-accent); }
.demo-approve { display: inline-flex; margin: 12px 0 0 48px; padding: 8px 14px; border-radius: var(--msp-radius-pill); background: var(--msp-secondary); color: #fff; font-size: 12.5px; font-weight: 600; }
.demo-file { display: flex; align-items: center; gap: 12px; }
.demo-file__icon { display: grid; place-items: center; flex: none; width: 46px; height: 54px; border-radius: 8px 14px 8px 8px; background: var(--msp-secondary); color: var(--msp-primary); font-size: 12px; font-weight: 700; letter-spacing: .06em; }
.demo-file__text { display: grid; gap: 3px; min-width: 0; }
.demo-file__text strong { overflow: hidden; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.demo-file__text span { font-size: 12.5px; color: var(--msp-muted); }
.demo-file__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--msp-divider); }
.demo-ready { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--msp-accent); }
.demo-download { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: var(--msp-radius-pill); background: var(--msp-primary); font-size: 12.5px; font-weight: 600; }
.demo-download .icon { transform: rotate(180deg); }

/* CTA row */
.how__cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; margin-top: clamp(48px, 5vw, 64px); }
.how__cta-note { flex-basis: 100%; margin-top: 6px; font-size: 14px; text-align: center; color: var(--msp-muted); }

/* Tablet and phone: vertical timeline, marker left, card right. */
@media (max-width: 899px) {
  .how__line { display: none; }
  .how__steps { grid-template-columns: 1fr; gap: 24px; }
  .how-step { position: relative; display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 16px; }
  .how-step:not(:last-child)::before {
    content: ""; position: absolute; left: 31px; top: 72px; bottom: -24px; width: 2px;
    background: repeating-linear-gradient(180deg, #C9D1D6 0 8px, transparent 8px 14px);
  }
  .how-step__card { margin-top: 0; }
  .how-step__big { font-size: 76px; }
}
@media (max-width: 599px) {
  .how-step { grid-template-columns: 1fr; }
  .how-step:not(:last-child)::before { display: none; }
  .how-step__card { padding: 26px 22px 22px; }
  .how__cta .btn { flex: 1 1 100%; }
  .how__cta .btn--icon { justify-content: space-between; padding-left: 26px; }
}
