.how-it-works {
  padding: 110px 6%;
  background: var(--bg);
}

.hiw-content {
  display: flex;
  align-items: stretch;
  gap: 70px;
  margin-top: 20px;
}

.hiw-illustration {
  width: 42%;
  flex-shrink: 0;
  position: relative;
  display: flex;
  align-items: center;
}

.hiw-illustration svg {
  width: 100%;
  height: auto;
  display: block;
}

.hiw-illustration-img {
  width: 100%;
  max-width: 480px;
  height: auto;
  display: block;
  margin: 0 auto;
  animation: hanioo-float 4.5s ease-in-out 0.6s infinite;
  will-change: transform;
}

.hiw-phone-frame {
  position: relative;
  width: 100%;
  max-width: 300px;
  aspect-ratio: 380 / 848;
  margin: 0 auto;
  padding: 14px 10px;
  background: linear-gradient(155deg, #2b2f38, #0e1015 70%);
  border-radius: 42px;
  box-shadow:
    0 25px 60px rgba(0, 0, 0, 0.28),
    0 0 0 2px rgba(255, 255, 255, 0.06) inset,
    0 0 0 6px #191b20 inset;
  animation: hanioo-float 4.5s ease-in-out 0.6s infinite;
  will-change: transform;
}

.hiw-phone-frame::before {
  /* side buttons */
  content: '';
  position: absolute;
  right: -3px;
  top: 120px;
  width: 3px;
  height: 46px;
  background: #14161b;
  border-radius: 2px 0 0 2px;
  box-shadow: 0 64px 0 #14161b;
}

.hiw-phone-frame::after {
  /* volume buttons */
  content: '';
  position: absolute;
  left: -3px;
  top: 100px;
  width: 3px;
  height: 30px;
  background: #14161b;
  border-radius: 0 2px 2px 0;
  box-shadow: 0 44px 0 #14161b, 0 84px 0 #14161b;
}

video.hiw-illustration-img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 30px;
  object-fit: cover;
  background: #000;
  animation: none;
  max-width: none;
}

.hiw-phone-notch {
  position: absolute;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #05070a;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.04);
  z-index: 2;
}

.hiw-phone-home {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.55);
  z-index: 2;
}

.hiw-badge {
  position: absolute;
  bottom: 6px;
  left: -10px;
  background: var(--card);
  border-radius: 16px;
  padding: 16px 20px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 190px;
  border: 1px solid var(--border);
}

.hiw-badge strong {
  font-family: var(--font-heading);
  font-size: 24px;
  color: var(--ink);
}

.hiw-badge span {
  font-size: 12.5px;
  color: var(--text);
  line-height: 1.4;
}

.hiw-steps {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.hiw-steps::before {
  content: '';
  position: absolute;
  left: 27px;
  top: 30px;
  bottom: 30px;
  width: 2px;
  background: linear-gradient(to bottom, var(--cyan), var(--border) 90%);
  opacity: 0.5;
}

.hiw-step {
  display: flex;
  gap: 24px;
  padding: 22px 0;
  position: relative;
}

.hiw-step-marker {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--step-color, var(--cyan)) 16%, #fff);
  border: 1px solid color-mix(in srgb, var(--step-color, var(--cyan)) 30%, #fff);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.hiw-step:hover .hiw-step-marker {
  border-color: var(--step-color, var(--cyan));
  box-shadow: 0 10px 24px rgba(47, 128, 237, 0.16);
  transform: translateY(-2px);
}

.hiw-step-icon {
  font-size: 22px;
  color: var(--step-color, var(--cyan));
}

.hiw-step-number {
  position: absolute;
  top: -9px;
  right: -9px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  color: var(--ink);
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  line-height: 1;
}

.hiw-step-text h3 {
  font-size: 18px;
  color: var(--ink);
  font-weight: 600;
  margin-bottom: 6px;
}

.hiw-step-text p {
  color: var(--text);
  font-size: 15px;
  line-height: 1.7;
}

@media (max-width: 900px) {
  .how-it-works {
    padding: 80px 6%;
  }

  .hiw-content {
    flex-direction: column;
    gap: 48px;
  }

  .hiw-illustration {
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
  }

  .hiw-phone-frame {
    max-width: 220px;
  }

  .hiw-badge {
    left: 50%;
    transform: translateX(-50%);
    bottom: -10px;
  }

  .hiw-steps {
    width: 100%;
    margin-top: 24px;
  }
}

@media (max-width: 480px) {
  .hiw-step {
    gap: 16px;
  }

  .hiw-step-marker {
    width: 48px;
    height: 48px;
  }

  .hiw-step-icon {
    font-size: 19px;
  }
}

/* ── Why It Works: benefits grid ── */
.hiw-benefits {
  padding: 0 6% 110px;
  background: var(--bg);
}

.hiw-benefits-inner .title {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 40px;
}

.hiw-benefits-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}

.hiw-benefit-card {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 28px 22px;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.hiw-benefit-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--cyan);
}

.hiw-benefit-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--cyan) 14%, #fff);
  color: var(--cyan);
  font-size: 20px;
  margin-bottom: 16px;
}

.hiw-benefit-card h3 {
  font-size: 16px;
  color: var(--ink);
  font-weight: 600;
  margin-bottom: 8px;
}

.hiw-benefit-card p {
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

@media (max-width: 900px) {
  .hiw-benefits-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .hiw-benefits {
    padding: 0 6% 70px;
  }

  .hiw-benefits-grid {
    grid-template-columns: 1fr;
  }
}
