/* How It Works - Global Include */

.how-it-works-section {
  text-align: center;
  margin-bottom: 4rem;
}

.how-it-works-section.section-with-bg {
  overflow: visible;
}

.section-bg-image,
.section-bg-overlay {
  display: none;
}

.how-it-works-section h2 {
  font-size: 2.2rem;
  margin-bottom: 1rem;
}

.how-it-works-intro {
  max-width: 800px;
  margin: 0 auto 3rem;
  font-size: 1.1rem;
  color: var(--muted);
  line-height: 1.8;
}

.how-it-works-steps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  position: relative;
  align-items: stretch;
}

.how-step-shell {
  display: flex;
  position: relative;
  height: 100%;
}

.how-step-shell .how-step {
  width: 100%;
}

.how-step {
  background: linear-gradient(180deg,
    rgba(242, 182, 50, 0.12),
    rgba(8, 8, 10, 0.9));
  border-radius: 1rem;
  padding: 1.5rem 0.75rem;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 240px;
  height: 100%;
  overflow: hidden;
  isolation: isolate;
}

.how-step::after {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  background-image:
    linear-gradient(
      90deg,
      #fdf7dc,
      #f1d78a,
      #ddb45a,
      #c89338,
      #b97c28,
      #c89338,
      #ddb45a,
      #f1d78a,
      #fdf7dc
    ),
    linear-gradient(
      120deg,
      transparent 0%,
      transparent 45%,
      rgba(255, 255, 255, 0.65) 50%,
      transparent 55%,
      transparent 100%
    );
  background-size: 300% 300%, 200% 200%;
  background-position: 0% 50%, -50% 50%;
  animation: borderTravel 6s linear infinite;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: -1;
}

.how-step:hover {
  transform: translateY(-6px);
  border-color: rgba(242, 182, 50, 0.4);
  box-shadow: 0 8px 20px rgba(242, 182, 50, 0.15);
}

.how-step-number {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--gold-gradient);
  background-size: 400% 400%;
  background-position: 0% 50%;
  animation: auroraFlowTrulySeamless 20s linear infinite;
  box-shadow: 0 0 20px rgba(107, 82, 32, 0.4), 0 0 35px rgba(107, 82, 32, 0.2);
  color: #0b0b0d;
  font-size: 1.3rem;
  font-family: "Audiowide", "Times New Roman", Times, serif;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.75rem;
}

.how-step h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--text-light);
}

.how-step p {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.6;
}

/* Scroll animation support */
.scroll-fade {
  --scroll-x: 0;
  --scroll-y: 1.5rem;
  opacity: 0;
  transform: translate3d(var(--scroll-x), var(--scroll-y), 0);
  transition: opacity 1.35s cubic-bezier(0.19, 1, 0.22, 1), transform 1.35s cubic-bezier(0.19, 1, 0.22, 1);
  will-change: opacity, transform;
}

.scroll-fade[data-scroll="left"] {
  --scroll-x: -40vw;
  --scroll-y: 0;
}

.scroll-fade[data-scroll="right"] {
  --scroll-x: 40vw;
  --scroll-y: 0;
}

.scroll-fade.scroll-slow {
  transition: opacity 1.9s cubic-bezier(0.19, 1, 0.22, 1),
              transform 1.9s cubic-bezier(0.19, 1, 0.22, 1);
}

.scroll-fade.in-view {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* Responsive breakpoints */
@media (max-width: 1200px) {
  .how-it-works-steps {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }

  .how-step-shell:nth-child(3)::after {
    display: none;
  }

  .how-step {
    padding: 1.75rem 1.25rem;
  }

  .how-step h3 {
    font-size: 1.2rem;
  }

  .how-step p {
    font-size: 0.9rem;
  }
}

@media (max-width: 768px) {
  .how-it-works-steps {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .how-step-shell {
    width: 95%;
    margin: 0 auto;
  }

  .how-step-shell::after {
    display: none;
  }

  .how-it-works-section h2 {
    font-size: 1.8rem;
  }

  .how-it-works-intro {
    font-size: 1rem;
    margin-bottom: 2rem;
  }

  .how-step {
    padding: 1.35rem;
    min-height: 260px;
  }

  .how-step h3 {
    font-size: 1.25rem;
  }

  .how-step p {
    font-size: 0.95rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-fade {
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
