/* The How — intro + step grid (v1 + v2) */

:is(.theme-v1, .theme-v2) #how .hwi {
  text-align: center;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
}

:is(.theme-v1, .theme-v2) #how .how-head {
  margin: 0 0 clamp(0.85rem, 2vw, 1.15rem);
  line-height: 1.12;
}

:is(.theme-v1, .theme-v2) #how .how-head em {
  font-style: italic;
  color: var(--orange-em);
}

:is(.theme-v1, .theme-v2) #how :is(.how-head, .how-intro, .hws).copy-unified em {
  font-style: normal;
  font-weight: 400;
  color: var(--text);
}

:is(.theme-v1, .theme-v2) #how .how-intro {
  margin: 0 auto clamp(0.75rem, 1.5vw, 1rem);
  max-width: 44ch;
  font-family: var(--sans);
  font-size: clamp(0.98rem, 1.5vw, 1.12rem);
  font-weight: 400;
  line-height: 1.58;
  color: var(--text);
  text-align: center;
}

:is(.theme-v1, .theme-v2) #how .how-intro em {
  font-style: italic;
  font-weight: 400;
  color: var(--orange-em);
}

:is(.theme-v1, .theme-v2) #how .hws {
  margin: 0 auto;
  max-width: 38ch;
  text-align: center;
  font-size: clamp(0.88rem, 1.2vw, 0.95rem);
}

:is(.theme-v1, .theme-v2) #how .steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.1rem, 2.2vw, 1.5rem);
  max-width: 1280px;
  margin: 0 auto;
  padding: 0;
  background: transparent;
  border: none;
}

/* Step card — thin outer border trace on hover only */
:is(.theme-v1, .theme-v2) #how .step {
  --step-fill: rgba(22, 18, 14, 0.55);
  --step-fill-hover: rgba(28, 24, 20, 0.96);
  --step-ring-idle: rgba(138, 128, 120, 0.2);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: clamp(1.5rem, 2.4vw, 2.1rem);
  border-radius: 22px;
  border: 1px solid var(--step-ring-idle);
  background: var(--step-fill);
  overflow: visible;
  transition:
    transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.4s ease,
    border-color 0.4s ease,
    box-shadow 0.4s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* 1px animated stroke on the outer edge — nothing inside the card */
:is(.theme-v1, .theme-v2) #how .step::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    90deg,
    rgba(224, 90, 26, 0.15) 0%,
    rgba(232, 184, 90, 0.85) 45%,
    rgba(224, 90, 26, 0.9) 55%,
    rgba(196, 104, 42, 0.15) 100%
  );
  background-size: 200% 100%;
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
  opacity: 0;
  pointer-events: none;
  z-index: 2;
  transition: opacity 0.35s ease;
  animation: how-step-border-run 2.6s linear infinite;
  animation-play-state: paused;
}

:is(.theme-v1, .theme-v2) #how .step::after {
  display: none !important;
}

:is(.theme-v1, .theme-v2) #how .step:hover,
:is(.theme-v1, .theme-v2) #how .step:focus-within {
  transform: translateY(-3px);
  background: var(--step-fill-hover);
  border-color: transparent;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
}

:is(.theme-v1, .theme-v2) #how .step:hover::before,
:is(.theme-v1, .theme-v2) #how .step:focus-within::before {
  opacity: 1;
  animation-play-state: running;
}

:is(.theme-v1, .theme-v2) #how .step > * {
  position: relative;
  z-index: 3;
}

@keyframes how-step-border-run {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

:is(.theme-v1, .theme-v2) #how .step-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-bottom: 1.15rem;
  border-radius: 14px;
  color: var(--orange-em, var(--orange));
  background: linear-gradient(145deg, rgba(224, 90, 26, 0.16), rgba(224, 90, 26, 0.05));
  border: 1px solid rgba(224, 90, 26, 0.32);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 4px 14px rgba(224, 90, 26, 0.08);
  transition:
    color 0.45s ease,
    border-color 0.45s ease,
    background 0.45s ease,
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.45s ease;
}

:is(.theme-v1, .theme-v2) #how .step-icon svg {
  width: 24px;
  height: 24px;
  display: block;
}

:is(.theme-v1, .theme-v2) #how .step:hover .step-icon,
:is(.theme-v1, .theme-v2) #how .step:focus-within .step-icon {
  border-color: rgba(224, 90, 26, 0.45);
}

:is(.theme-v1, .theme-v2) #how .step .st {
  transition: color 0.35s ease;
}

:is(.theme-v1, .theme-v2) #how .step .sd {
  transition: color 0.35s ease;
}

:is(.theme-v1, .theme-v2) #how .step:hover .st,
:is(.theme-v1, .theme-v2) #how .step:focus-within .st {
  color: var(--text);
}

@media (prefers-reduced-motion: reduce) {
  :is(.theme-v1, .theme-v2) #how .step,
  :is(.theme-v1, .theme-v2) #how .step::before {
    transition-duration: 0.01ms;
    animation: none;
  }

  :is(.theme-v1, .theme-v2) #how .step:hover,
  :is(.theme-v1, .theme-v2) #how .step:focus-within {
    transform: none;
  }

  :is(.theme-v1, .theme-v2) #how .step:hover::before,
  :is(.theme-v1, .theme-v2) #how .step:focus-within::before {
    opacity: 1;
    animation: none;
    background: rgba(224, 90, 26, 0.55);
    background-size: auto;
  }
}

:is(.theme-v1, .theme-v2) #how .step .st {
  margin-bottom: 0.75rem;
}

:is(.theme-v1, .theme-v2) #how .sno,
:is(.theme-v1, .theme-v2) #how .sg {
  display: none !important;
}

body.theme-light.theme-v2 #how .step {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(52, 44, 36, 0.12);
}

body.theme-light.theme-v2 #how .step:hover {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(184, 69, 15, 0.32);
  box-shadow: 0 14px 36px rgba(184, 69, 15, 0.1);
}

body.theme-light.theme-v2 #how .step-icon {
  color: var(--orange-em);
  background: linear-gradient(145deg, rgba(184, 69, 15, 0.12), rgba(255, 255, 255, 0.5));
  border-color: rgba(184, 69, 15, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

@media (max-width: 900px) {
  :is(.theme-v1, .theme-v2) #how .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  :is(.theme-v1, .theme-v2) #how .steps {
    grid-template-columns: 1fr;
  }
}
