/* VierBot — 3-step timeline, optimized for scrolling (performance v2).
   Only affects homepage #how; theme follows the existing CSS variables.
   Mobile: decorative accents remain, continuous animations and large blur do not.
*/

#how {
  position: relative;
  overflow: hidden;
}

/* Decorative background: static gradient, without a large blur layer. */
#how::before {
  content: "";
  position: absolute;
  width: min(640px, 85vw);
  aspect-ratio: 1;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle,
    color-mix(in srgb, var(--primary) 6%, transparent),
    transparent 65%);
}

#how .container {
  position: relative;
  z-index: 1;
}

#how .steps {
  position: relative;
  isolation: isolate;
  gap: 30px;
  overflow: visible;
}

#how .steps article {
  position: relative;
  z-index: 2;
  overflow: visible;
  min-width: 0;
  padding: 30px;
  border: 1px solid color-mix(in srgb, var(--primary) 15%, var(--border));
  border-radius: 26px;
  background: linear-gradient(145deg,
    color-mix(in srgb, var(--primary) 3%, var(--surface-solid)),
    var(--surface-solid));
  box-shadow: 0 10px 28px rgba(25, 32, 64, .07);
  transition: transform .2s ease, border-color .2s ease;
}

@media (hover: hover) and (pointer: fine) {
  #how .steps article:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--primary) 34%, var(--border));
  }
}

/* Connector stays static. Animated background-position caused repeated painting. */
#how .steps article:not(:last-child)::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: calc(100% + 1px);
  top: 50%;
  width: 30px;
  height: 2px;
  transform: translateY(-50%);
  background: repeating-linear-gradient(90deg,
    color-mix(in srgb, var(--primary) 58%, transparent) 0 6px,
    color-mix(in srgb, var(--primary) 12%, transparent) 6px 11px);
}

/* Only two tiny connector dots may move on desktop; transform/opacity only. */
#how .steps article:not(:last-child)::before {
  content: "";
  position: absolute;
  z-index: 4;
  left: calc(100% + 1px);
  top: calc(50% - 4px);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  opacity: .78;
}

@media (min-width: 901px) and (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  #how .steps article:not(:last-child)::before {
    animation: stepConnectorDrift 4s ease-in-out infinite;
  }
  #how .steps article:nth-child(2)::before { animation-delay: 1.8s; }
}

@keyframes stepConnectorDrift {
  0%, 10% { transform: translateX(0); opacity: .25; }
  50% { opacity: .85; }
  90%, 100% { transform: translateX(22px); opacity: .2; }
}

#how .step-icon {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: linear-gradient(145deg,
    color-mix(in srgb, var(--primary) 15%, var(--surface-solid)),
    color-mix(in srgb, var(--primary) 7%, var(--surface-solid)));
  border: 1px solid color-mix(in srgb, var(--primary) 13%, transparent);
  box-shadow: 0 6px 15px color-mix(in srgb, var(--primary) 7%, transparent);
}

#how .step-icon::before,
#how .step-icon::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border-radius: inherit;
}

/* Static ring retains the original look without perpetual scale animations. */
#how .step-icon::before {
  inset: -7px;
  border: 1px solid color-mix(in srgb, var(--primary) 13%, transparent);
}

#how .step-icon::after {
  width: 7px;
  height: 7px;
  right: 5px;
  bottom: 5px;
  border-radius: 50%;
  background: var(--primary);
}

#how .step-icon .ui-icon {
  width: 22px;
  height: 22px;
  position: relative;
  z-index: 2;
}

#how .step-no {
  top: 20px;
  right: 20px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border: 1px solid color-mix(in srgb, var(--primary) 12%, var(--border));
  border-radius: 999px;
  background: var(--surface-solid);
  color: color-mix(in srgb, var(--text) 48%, var(--muted));
  font-size: 11px;
  letter-spacing: .04em;
  font-variant-numeric: tabular-nums;
  /* Removed backdrop-filter: blur(10px) to reduce mobile compositing work. */
}

#how .step-no::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
}

#how .steps h3 {
  margin-top: 26px;
  margin-bottom: 10px;
  letter-spacing: -.025em;
}

#how .steps p { max-width: 34ch; }

/* Touch devices: no infinite animations, no big background effect, lighter shadows. */
@media (max-width: 900px), (hover: none), (pointer: coarse) {
  #how::before { display: none; }
  #how .steps article {
    box-shadow: 0 7px 18px rgba(25, 32, 64, .055);
    transition: none;
  }
  #how .steps article:not(:last-child)::before { animation: none; }
  #how .step-icon { box-shadow: none; }
}

/* Mobile timeline uses a fixed dashed vertical line and a stationary accent dot. */
@media (max-width: 680px) {
  #how .steps { gap: 30px; }

  #how .steps article {
    padding: 26px 24px 28px;
    border-radius: 24px;
  }

  #how .steps article:not(:last-child)::after {
    left: 51px;
    top: calc(100% + 1px);
    width: 2px;
    height: 30px;
    transform: none;
    background: repeating-linear-gradient(180deg,
      color-mix(in srgb, var(--primary) 62%, transparent) 0 6px,
      color-mix(in srgb, var(--primary) 11%, transparent) 6px 11px);
  }

  #how .steps article:not(:last-child)::before {
    left: 48px;
    top: calc(100% + 12px);
    opacity: .9;
  }

  #how .steps h3 {
    margin-top: 25px;
    font-size: clamp(23px, 7vw, 30px);
  }

  #how .steps p {
    max-width: none;
    font-size: 14px;
    line-height: 1.72;
  }
}

@media (prefers-reduced-motion: reduce) {
  #how .steps article,
  #how .steps article:not(:last-child)::before {
    animation: none !important;
    transition: none !important;
  }
}
