/* How It Works — 4-step layout (page-scoped) */

.how-steps-section .container {
  text-align: left;
}

.how-steps-section__header {
  margin-bottom: 2.5rem;
  text-align: left;
}

.how-steps-section__header .section-label {
  display: block;
  margin-bottom: 0.75rem;
}

.how-steps-section__header h2 {
  margin: 0;
  max-width: none;
}

.how-pipeline-section .container {
  text-align: left;
}

/* Technical architecture flowchart */
.arch-flow {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  box-shadow: var(--shadow-sm);
}

.arch-flow__header {
  margin-bottom: clamp(1.5rem, 3vw, 2rem);
  padding-bottom: clamp(1.25rem, 2.5vw, 1.75rem);
  border-bottom: 1px solid var(--gray-200);
  text-align: left;
}

.arch-flow__header .section-label {
  display: block;
  margin-bottom: 0.75rem;
}

.arch-flow__header h2 {
  margin: 0 0 0.875rem;
  max-width: none;
}

.arch-flow__subtitle {
  margin: 0;
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--gray-600);
  max-width: none;
}

.arch-flow__diagram {
  width: 100%;
}

.arch-flow__track {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0;
}

.arch-flow__block {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1.125rem;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.arch-flow__block-title {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(0.9375rem, 1.8vw, 1.0625rem);
  font-weight: 600;
  line-height: 1.35;
  color: var(--blue-deep);
}

.arch-flow__block-meta {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--blue-indigo);
}

.arch-flow__tokens {
  margin: 0 0 0.875rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.55;
  letter-spacing: 0.02em;
  color: var(--blue-primary);
}

.arch-flow__tokens span[aria-hidden="true"] {
  margin: 0 0.2em;
  color: var(--blue-light);
  font-weight: 400;
}

.arch-flow__context {
  margin: auto 0 0;
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--gray-600);
}

.arch-flow__connector {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.375rem;
  color: var(--blue-light);
}

.arch-flow__arrow {
  width: 1.5rem;
  height: 1.5rem;
  flex-shrink: 0;
}

/* Tablet: slightly tighter cards */
@media (min-width: 768px) and (max-width: 1100px) {
  .arch-flow__block {
    padding: 1rem 0.875rem;
  }

  .arch-flow__block-meta {
    font-size: 0.75rem;
  }

  .arch-flow__tokens {
    font-size: 0.6875rem;
  }
}

/* Mobile: vertical stack with downward arrows */
@media (max-width: 767px) {
  .arch-flow__track {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .arch-flow__block {
    flex: none;
    width: 100%;
    padding: 1.25rem 1.25rem;
  }

  .arch-flow__block-meta {
    display: inline;
    margin-top: 0;
    margin-left: 0.25rem;
    font-size: 0.8125rem;
  }

  .arch-flow__connector {
    padding: 0.5rem 0;
  }

  .arch-flow__arrow {
    transform: rotate(90deg);
  }
}

.how-steps {
  width: 100%;
}

.how-step__heading {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.875rem;
}

.how-step__heading .step-num {
  flex-shrink: 0;
  margin-bottom: 0;
}

.how-step__heading h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.125rem, 3vw, 1.375rem);
  font-weight: 600;
  line-height: 1.25;
  color: var(--blue-deep);
}

/* —— Mobile: horizontal swipe carousel (≤767px) —— */
.how-steps__viewport {
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin-inline: -1.25rem;
  padding: 0.25rem 1.25rem 0.5rem;
}

.how-steps__viewport::-webkit-scrollbar {
  display: none;
}

.how-steps__track {
  display: flex;
  gap: 0.875rem;
  align-items: stretch;
}

.how-step {
  flex: 0 0 88vw;
  max-width: 88vw;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  text-align: left;
}

.how-step p {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--gray-600);
}

.how-steps__indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding-bottom: 0.25rem;
}

.how-steps__counter {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gray-600);
}

.how-steps__counter-current {
  color: var(--blue-primary);
}

.how-steps__dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.how-steps__dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--gray-200);
  cursor: pointer;
  transition: transform var(--transition), background var(--transition);
}

.how-steps__dot.is-active {
  width: 22px;
  border-radius: 100px;
  background: linear-gradient(135deg, var(--blue-primary), var(--blue-light));
}

.how-steps__dot:focus-visible {
  outline: 2px solid var(--blue-primary);
  outline-offset: 2px;
}

/* —— Tablet & desktop: full-width stacked rows (≥768px) —— */
@media (min-width: 768px) {
  .how-steps__viewport {
    overflow: visible;
    margin-inline: 0;
    padding: 0;
    scroll-snap-type: none;
  }

  .how-steps__track {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }

  .how-step {
    flex: none;
    width: 100%;
    max-width: none;
    scroll-snap-align: none;
    padding: 1.75rem 2rem;
  }

  .how-step__heading {
    gap: 1.125rem;
    margin-bottom: 1rem;
  }

  .how-step__heading h3 {
    font-size: 1.375rem;
  }

  .how-step p {
    font-size: 1rem;
    max-width: none;
  }

  .how-steps__indicator {
    display: none;
  }
}

@media (min-width: 992px) {
  .how-step {
    padding: 2rem 2.25rem;
  }

  .how-step__heading {
    gap: 1.25rem;
  }
}

@media (max-width: 767px) {
  .how-step__heading {
    gap: 0.75rem;
    margin-bottom: 0.75rem;
  }

  .how-step__heading h3 {
    font-size: 1.125rem;
    line-height: 1.3;
  }
}
