/* ============================================
   HOW IT WORKS PAGE
   ============================================ */

/* ---- Page wrapper ---- */
.hiw {
  padding: var(--space-24) 0 var(--space-20);
  background: var(--color-background);
}
.hiw__card {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--space-24) var(--space-16);
  border-radius: 50px;
  background: var(--color-surface);
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ---- Title area ---- */
.hiw__kicker {
  font-family: var(--font-decorative, 'Kalam', cursive);
  font-size: 1.75rem;
  font-style: italic;
  color: var(--color-primary);
  margin-bottom: var(--space-2);
}
.hiw__title {
  font-family: var(--font-heading);
  font-size: var(--text-display);
  font-weight: var(--weight-semibold);
  color: var(--color-text);
  text-align: center;
  margin-bottom: var(--space-6);
  line-height: var(--leading-tight);
}
.hiw__desc {
  font-size: var(--text-body);
  color: var(--color-text);
  text-align: center;
  max-width: 780px;
  margin-bottom: var(--space-4);
  line-height: 1.3;
}

/* ---- Step circles row ---- */
.hiw__steps-row {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 750px;
  margin: var(--space-4) 0 0;
  padding-bottom: var(--space-12);
}
.hiw__step-circle-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2;
  flex: 0 0 25%;
}
.hiw__step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 79px;
  height: 79px;
  border-radius: 50%;
  background: linear-gradient(to bottom, rgba(220, 236, 254, 0.96), rgba(124, 106, 232, 0.96));
  color: #fff;
  font-size: 2rem;
  font-weight: var(--weight-bold);
  line-height: 1;
}
.hiw__step-label {
  position: absolute;
  top: 94px;
  white-space: nowrap;
  font-size: var(--text-body);
  color: var(--color-text);
  text-align: center;
  line-height: 1.6;
}

/* Wavy connector SVG */
.hiw__curve {
  position: absolute;
  top: 5px;
  left: 56px;
  right: 56px;
  height: 70px;
  z-index: 1;
  overflow: visible;
}
.hiw__curve path {
  fill: none;
  stroke: var(--color-primary);
  stroke-width: 3;
  stroke-dasharray: 8 6;
  opacity: 0.5;
}

/* ---- Timeline section ---- */
.hiw__timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
  width: 100%;
  max-width: 910px;
  margin-top: var(--space-24);
}

/* Vertical line */
.hiw__timeline-line {
  position: absolute;
  left: 193px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--color-primary);
  z-index: 1;
}

/* Each step row */
.hiw__step {
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 2;
  gap: var(--space-8);
}

/* Video / image placeholder */
.hiw__step-media {
  flex: 0 0 385px;
  height: 216px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--color-primary-ultra-light);
  position: relative;
}
.hiw__step-media img,
.hiw__step-media video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Play icon overlay for image placeholders */
.hiw__step-media::after {
  content: '';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 46, 0.15);
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.hiw__step-media:hover::after {
  opacity: 1;
}

/* Step text */
.hiw__step-text {
  flex: 1;
}
.hiw__step-title {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: var(--weight-semibold);
  color: var(--color-text);
  margin-bottom: var(--space-3);
  line-height: var(--leading-tight);
}
.hiw__step-desc {
  font-size: var(--text-body);
  line-height: 1.3;
  color: var(--color-text);
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .hiw__card {
    padding: var(--space-16) var(--space-8);
    border-radius: var(--radius-xl);
  }
  .hiw__title {
    font-size: var(--text-h1);
  }
  .hiw__timeline-line {
    display: none;
  }
  .hiw__step {
    flex-direction: column;
    align-items: flex-start;
  }
  .hiw__step-media {
    flex: none;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }
  .hiw__step-title {
    font-size: var(--text-h3);
  }
}

@media (max-width: 768px) {
  .hiw {
    padding: var(--space-12) 0 var(--space-12);
  }
  .hiw__card {
    padding: var(--space-10) var(--space-5);
    border-radius: var(--radius-lg);
  }
  .hiw__title {
    font-size: var(--text-h2);
  }
  .hiw__kicker {
    font-size: 1.25rem;
  }
  .hiw__steps-row {
    display: none;
  }
  .hiw__timeline {
    margin-top: var(--space-10);
    gap: var(--space-10);
  }
  .hiw__step-title {
    font-size: 1.25rem;
  }
}

@media (max-width: 640px) {
  .hiw__card {
    padding: var(--space-8) var(--space-4);
    border-radius: var(--radius-md);
  }
  .hiw__title {
    font-size: var(--text-h3);
  }
}
