/* =========================================================
   /HOW_IT_WORKS — Dark section with 3-column card grid,
   connector beams, and per-card visuals (Collect, Reason,
   Act, Hand off) + bottom metrics + CTAs.
   ========================================================= */

.how-section {
  position: relative;
  background: linear-gradient(180deg, #04041A 0%, #0A0A33 50%, #04041A 100%);
  color: #fff;
  padding: 72px 0 90px;
  overflow: hidden;
  isolation: isolate;
}
.how-bg {
  position: absolute;
  inset: 0;
  background-image: url("../graphics/squares-pattern.svg");
  background-repeat: repeat;
  background-position: center top;
  background-size: 1920px 1920px;
  opacity: 1;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0.8) 45%, rgba(0,0,0,0) 85%);
          mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0.8) 45%, rgba(0,0,0,0) 85%);
  pointer-events: none;
  z-index: 0;
}
.how-glow {
  position: absolute;
  width: 720px;
  height: 720px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.45;
  pointer-events: none;
  z-index: 0;
}
.how-glow-left  { top: 280px; left: -200px;  background: radial-gradient(circle, rgba(11,108,255,0.55), transparent 60%); }
.how-glow-right { top: 560px; right: -220px; background: radial-gradient(circle, rgba(0,60,255,0.5),  transparent 60%); }
.how-section::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 35%, rgba(0,0,0,0.55) 100%);
  pointer-events: none;
  z-index: 0;
}
.how-container { position: relative; z-index: 2; max-width: 1180px; }

/* Header */
.how-head { text-align: center; margin-bottom: 72px; }
.how-eyebrow {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: #5BD5FF;
  background: #1A1A33;
  padding: 6px 12px;
  border-radius: var(--b-radius-8);
  text-transform: uppercase;
  margin-bottom: 24px;
}
.how-title {
  font-size: var(--fs-h2);
  font-weight: var(--fw-medium);
  line-height: 0.98;
  letter-spacing: -0.03em;
  color: #fff;
  margin-bottom: 22px;
}
.how-lead {
  color: rgba(255,255,255,0.6);
  font-size: 16px;
  line-height: 1.55;
  max-width: 620px;
  margin: 0 auto;
}

/* Card grid: 3 columns, middle column has 2 stacked cards */
.how-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 24px;
  grid-template-areas:
    "collect reason  handoff"
    "collect act     handoff";
}
.how-card {
  position: relative;
  background: #0D0D21;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--b-radius-15);
  padding: 34px;
  text-align: center;
  box-shadow: 0 18px 40px -24px rgb(237 241 255 / 10%);
  backdrop-filter: blur(6px);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.how-card:has(.viz) {
  justify-content: space-between;
  gap: 28px;
}
.how-card-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}
.how-card-tall { min-height: 480px; }
.how-card-mid  { min-height: 230px; }
.how-grid > .how-card:nth-of-type(1) { grid-area: collect; }
.how-grid > .how-card:nth-of-type(2) { grid-area: reason; }
.how-grid > .how-card:nth-of-type(3) { grid-area: act; }
.how-grid > .how-card:nth-of-type(4) { grid-area: handoff; }

.how-step {
  font-family: var(--mono);
  font-size: 11px;
  color: #5BD5FF;
  letter-spacing: 0.02em;
  margin-bottom: 10px;
}
.how-card-title {
  font-size: 22px;
  font-weight: var(--fw-semibold);
  letter-spacing: -0.018em;
  color: #fff;
  margin-bottom: 14px;
}
.how-card-body {
  color: rgba(255,255,255,0.6);
  font-size: 13.5px;
  line-height: 1.55;
  max-width: 280px;
  margin: 0 auto;
}
.how-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 22px;
  padding: 10px 22px;
  border-radius: var(--b-radius-10);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.14);
  color: #fff;
  font-size: 13px;
  font-weight: var(--fw-medium);
  font-family: var(--font);
  transition: background .2s ease, border-color .2s ease;
}
.how-btn:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.24); }

/* Thinking pill (Reason card) */
.thinking-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: #1A1A33;
  border-radius: var(--b-radius-full);
  color: #fff;
  font-size: 13px;
  font-weight: var(--fw-medium);
  margin: 12px auto 18px;
}
.thinking-pill img { width: 14px; height: 14px; }

/* Connector beams behind cards */
.beam {
  position: absolute;
  background: linear-gradient(90deg, transparent 0%, #2E6BFF 25%, #5BD5FF 50%, #2E6BFF 75%, transparent 100%);
  box-shadow:
    0 0 10px #0b6cff,
    0 0 24px rgba(0,120,255,0.8),
    0 0 48px rgba(91,213,255,0.45);
  z-index: 1;
  pointer-events: none;
  border-radius: var(--b-radius-full);
}
.beam::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 30%, rgba(255,255,255,0.95) 50%, transparent 70%);
  border-radius: inherit;
  filter: blur(0.5px);
}
.beam-h { height: 4px; }
.beam-v {
  width: 4px;
  background: linear-gradient(180deg, transparent 0%, #2E6BFF 25%, #5BD5FF 50%, #2E6BFF 75%, transparent 100%);
}
.beam-v::before {
  background: linear-gradient(180deg, transparent 30%, rgba(255,255,255,0.95) 50%, transparent 70%);
}
.beam-left  { top: 25%; left: 26%;  width: 22%; }
.beam-right { top: 75%; right: 26%; width: 22%; }
.beam-mid   { left: 50%; top: 38%; height: 24%; transform: translateX(-50%); }

/* Per-card viz container + Act mini-toggles */
.viz {
  width: 100%;
  position: relative;
}
.viz img { width: 100%; height: auto; display: block; }

.viz-act {
  margin-top: 12px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--b-radius-10);
}
.viz-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 12px;
  color: rgba(255,255,255,0.78);
}
.viz-toggle-row + .viz-toggle-row { border-top: 1px solid rgba(255,255,255,0.06); }
.d-tg {
  width: 30px; height: 16px;
  border-radius: var(--b-radius-full);
  background: rgba(255,255,255,0.18);
  position: relative;
  flex-shrink: 0;
}
.d-tg::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #fff;
  transition: transform .2s ease;
}
.d-tg.on { background: var(--accent); }
.d-tg.on::after { transform: translateX(14px); }

/* Metrics + CTA */
.how-metrics { margin-top: 96px; text-align: center; position: relative; z-index: 2; }
.how-metrics-title {
  font-size: 18px;
  color: rgba(255,255,255,0.85);
  margin-bottom: 40px;
  font-weight: var(--fw-regular);
}
.how-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 48px;
  margin-bottom: 56px;
}
.how-metric .v {
  font-family: var(--mono);
  font-size: clamp(40px, 5vw, 56px);
  font-weight: var(--fw-regular);
  letter-spacing: -0.025em;
  line-height: 1;
  color: #fff;
  margin-bottom: 10px;
}
.how-metric .l {
  font-size: 13px;
  color: rgba(255,255,255,0.55);
}
.how-cta {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.how-cta .btn { justify-content: center; text-align: center; }
.how-cta .btn-primary {
  background: #0757ff;
  background-image: none;
  min-width: 152px;
  height: 52px;
  border-radius: var(--b-radius-10);
}
.how-btn-secondary {
  background: rgba(255,255,255,0.04);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.14);
  min-width: 152px;
  height: 52px;
  border-radius: var(--b-radius-10);
}
.how-btn-secondary:hover { background: rgba(255,255,255,0.08); }

/* Responsive */
@media (max-width: 960px) {
  .how-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    grid-template-areas:
      "collect"
      "reason"
      "act"
      "handoff";
    gap: 16px;
  }
  .how-card-tall,
  .how-card-mid { min-height: 0; }
  .how-grid > .how-card:nth-of-type(1),
  .how-grid > .how-card:nth-of-type(2),
  .how-grid > .how-card:nth-of-type(3),
  .how-grid > .how-card:nth-of-type(4) { grid-area: auto; }
  .beam { display: none; }
  .how-metrics-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 560px) {
  .how-card { padding: 28px 22px; gap: 22px; }
  .how-card-title { font-size: 20px; }
  .how-metrics-grid { grid-template-columns: 1fr; }
  .how-section { padding: 56px 0 72px; }
  .how-head { margin-bottom: 48px; }
  .how-title br { display: none; }
  .how-lead br { display: none; }
}
