/* =============== HOW JOURNEY (How it works v2) — FORCE LIGHT =============== */

.how-journey{
  position: relative;
  overflow: hidden;
  padding-top: clamp(56px, 7vw, 92px);
  padding-bottom: clamp(56px, 7vw, 92px);
  isolation: isolate;

  /* light palette helpers */
  --how-ink: rgba(3,7,18,0.92);
  --how-muted: rgba(3,7,18,0.72);
  --how-muted2: rgba(3,7,18,0.58);

  --how-card-bg: rgba(255,255,255,0.74);
  --how-card-bg2: rgba(255,255,255,0.64);
  --how-card-border: rgba(3,7,18,0.10);

  --how-shadow:
    0 22px 50px rgba(3,7,18,0.12),
    0  2px 10px rgba(3,7,18,0.06);

  /* fallback bg */
  background: linear-gradient(180deg, var(--bg2), var(--bg));

  /* badge controls (fallback + micro-tuning) */
  --how-badge-left: 28px;
  --how-badge-bottom: 18px;
  --how-badge-shift-x: 0px;
  --how-badge-shift-y: 0px;
}

/* Улучшенный “cloud/wave glow” если поддерживается color-mix */
@supports (background: color-mix(in srgb, white, black)){
  .how-journey{
    background:
      radial-gradient(
        1100px 560px at 50% 0%,
        color-mix(in srgb, var(--primary) 22%, transparent),
        transparent 62%
      ),
      radial-gradient(
        900px 460px at 82% 30%,
        color-mix(in srgb, var(--primary2) 18%, transparent),
        transparent 64%
      ),
      radial-gradient(
        800px 420px at 12% 62%,
        color-mix(in srgb, var(--primary) 12%, transparent),
        transparent 70%
      ),
      linear-gradient(180deg, var(--bg2), var(--bg));
  }
}

/* Head */
.how-journey__head{
  text-align: center;
  max-width: 980px;
  margin: 0 auto 34px;
}

.how-journey__kicker{
  margin: 0 0 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--how-muted2);
  font-size: 12px;
}

.how-journey__title{
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.02;
  font-size: clamp(34px, 4.6vw, 56px);
  color: var(--how-ink);
}

.how-journey__accent{
  background: linear-gradient(90deg, var(--primary), var(--primary2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.how-journey__sub{
  margin: 0 auto;
  max-width: 52ch;

  font-size: clamp(15px, 1.3vw, 18px);
  line-height: 1.4;
  font-weight: 650;
  letter-spacing: -0.012em;

  color: rgba(3, 7, 18, 0.76);
}

@supports (-webkit-background-clip: text){
  .how-journey__sub{
    background: linear-gradient(90deg, rgba(3,7,18,0.78), rgba(3,7,18,0.60));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}

/* Layout grid */
.how-journey__grid{
  position: relative;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: clamp(18px, 3vw, 40px);
  align-items: start;
  max-width: 1100px;
  margin: 0 auto;
}

/* Rail */
.how-journey__rail{
  position: relative;
  width: 260px;
  min-height: 520px; /* JS overrides to match steps height */
}

.how-journey__svg{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.how-journey__path{
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 10;
}

/* base stroke */
.how-journey__path--base{
  stroke: rgba(94, 234, 212, 0.18);
}

@supports (color: color-mix(in srgb, white, black)){
  .how-journey__path--base{
    stroke: color-mix(in srgb, var(--primary) 25%, transparent);
  }
}

.how-journey__path--draw{
  opacity: 1;
}

/* =========================
   NODES (галочки)
========================= */

.how-journey__node{
  position: absolute;
  left: 72px;
  top: 60px;

  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  border-radius: 999px;
  pointer-events: none;
  isolation: isolate;
}

.how-journey__nodeRing{
  position: absolute;
  inset: 0;
  border-radius: inherit;

  background: radial-gradient(circle at 30% 25%, rgba(255,255,255,0.86), rgba(255,255,255,0.38));
  border: 2px solid rgba(94,234,212,0.62);

  box-shadow:
    0 18px 40px rgba(3,7,18,0.14),
    0 0 0 7px rgba(94,234,212,0.10);

  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))){
  .how-journey__nodeRing{ background: rgba(255,255,255,0.92); }
}

/* маленький “блик” внутри */
.how-journey__nodeRing::after{
  content:"";
  position:absolute;
  inset: 7px 10px auto 10px;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,0.70), rgba(255,255,255,0));
  opacity: 0.55;
  pointer-events: none;
}

@supports (color: color-mix(in srgb, white, black)){
  .how-journey__nodeRing{
    border-color: color-mix(in srgb, var(--primary) 70%, white);
    box-shadow:
      0 18px 40px rgba(3,7,18,0.14),
      0 0 0 7px color-mix(in srgb, var(--primary) 14%, transparent);
  }
}

.how-journey__nodeIcon{
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;

  color: rgba(3,7,18,0.78);
  z-index: 1;
}

.how-journey__nodeIcon svg{
  width: 20px;
  height: 20px;
}

.how-journey__node::after{
  content:"";
  position:absolute;
  inset:-14px;
  border-radius:inherit;
  background: radial-gradient(circle, rgba(94,234,212,0.22), transparent 62%);
  filter: blur(8px);
  opacity: 1;
  z-index: 0;
}

@supports (background: color-mix(in srgb, white, black)){
  .how-journey__node::after{
    background: radial-gradient(
      circle,
      color-mix(in srgb, var(--primary) 22%, transparent),
      transparent 62%
    );
  }
}

/* =========================
   BADGE (shield)
========================= */

.how-journey__badge{
  position: absolute;
  width: 140px;
  height: 140px;
  display: grid;
  place-items: center;

  /* always light shadow */
  filter: drop-shadow(0 14px 22px rgba(3,7,18,0.18));

  /* fallback position if JS not running */
  left: var(--how-badge-left);
  bottom: var(--how-badge-bottom);
  transform: translate(var(--how-badge-shift-x), var(--how-badge-shift-y));
}

/* anchored mode (JS sets --how-badge-left/top in px inside rail) */
.how-journey__badge.is-anchored{
  bottom: auto;
  top: var(--how-badge-top, 0px);
  left: var(--how-badge-left, 0px);
  transform: translate(-50%, -50%) translate(var(--how-badge-shift-x), var(--how-badge-shift-y));
}

.how-journey__badge img{
  width: 120px;
  height: 120px;
  object-fit: contain;
}

/* =========================
   STEPS / CARDS
========================= */

.how-journey__steps{
  list-style: none;
  padding: 6px 0 0;
  margin: 0;
  display: grid;
  gap: 22px;

  width: 100%;
  max-width: 880px;
}

.how-journey__step{
  position: relative;
}

/* Card — light glass */
.how-journey__card{
  position: relative;
  width: 100%;
  min-height: 132px;

  border-radius: 22px;
  padding: 26px 28px;

  background: linear-gradient(180deg, var(--how-card-bg), var(--how-card-bg2));
  border: 1px solid var(--how-card-border);
  box-shadow: var(--how-shadow);

  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);

  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* gradient border overlay (modern browsers) */
@supports (-webkit-mask: linear-gradient(#000, #000)){
  .how-journey__card{
    border: none;
  }
  .how-journey__card::before{
    content:"";
    position:absolute;
    inset:0;
    padding: 1px;
    border-radius: inherit;
    background: linear-gradient(135deg,
      rgba(94,234,212,0.42),
      rgba(59,130,246,0.24),
      rgba(94,234,212,0.20)
    );
    -webkit-mask:
      linear-gradient(#000 0 0) content-box,
      linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events:none;
    opacity: 0.95;
  }
}

/* soft highlight */
.how-journey__card::after{
  content:"";
  position:absolute;
  left:-20%;
  top:-60%;
  width: 70%;
  height: 180%;
  background: radial-gradient(circle, rgba(255,255,255,0.22), transparent 60%);
  transform: rotate(18deg);
  pointer-events:none;
  opacity: 0.7;
}

/* subtle separators between cards */
.how-journey__step::before{
  content:"";
  position:absolute;
  left:-24px;
  right:-24px;
  top:50%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(3,7,18,0.06), transparent);
  transform: translateY(-50%);
  pointer-events:none;
  opacity: 0.9;
}

@supports (background: color-mix(in srgb, white, black)){
  .how-journey__step::before{
    background: linear-gradient(
      90deg,
      transparent,
      color-mix(in srgb, var(--primary) 14%, transparent),
      transparent
    );
  }
}

@media (hover:hover){
  .how-journey__card{
    transition: transform 220ms ease, box-shadow 220ms ease;
  }
  .how-journey__card:hover{
    transform: translateY(-2px);
    box-shadow:
      0 28px 64px rgba(3,7,18,0.14),
      0  2px 12px rgba(3,7,18,0.07);
  }
}

/* Head внутри карточки */
.how-journey__stepHead{
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  position: relative;
}

/* Мини-коннектор: короткая линия слева к карточке */
.how-journey__stepHead::before{
  content:"";
  position:absolute;
  left: -32px;
  top: 50%;
  width: 26px;
  height: 2px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(94,234,212,0.55), transparent);
  opacity: 0.9;
  pointer-events: none;
}

/* Заголовок */
.how-journey__stepHead h3{
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 22px;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--how-ink);
  background: none;
  display: inline-block;
}

/* Нумерация не нужна */
.how-journey__num{
  display: none !important;
}

.how-journey__text{
  margin: 0;
  color: var(--how-muted);
  font-size: 16px;
  line-height: 1.6;
  max-width: 58ch;
}

/* CTA */
.how-journey__cta{
  display: grid;
  place-items: center;
  margin-top: 26px;
}

.how-journey__cta .btn{
  box-shadow: 0 18px 48px rgba(59,130,246,0.14);
}

/* Decorative background layer */
.how-journey__bg{
  position: absolute;
  inset: auto 0 0 0;
  height: 56%;
  pointer-events: none;
  opacity: 0.95;
  z-index: 0;

  background:
    radial-gradient(900px 260px at 18% 58%, rgba(94,234,212,0.14), transparent 72%),
    radial-gradient(900px 260px at 82% 44%, rgba(59,130,246,0.12), transparent 72%),
    radial-gradient(700px 220px at 60% 78%, rgba(94,234,212,0.10), transparent 72%);
}

@supports (background: color-mix(in srgb, white, black)){
  .how-journey__bg{
    background:
      radial-gradient(
        900px 260px at 18% 58%,
        color-mix(in srgb, var(--primary) 18%, transparent),
        transparent 72%
      ),
      radial-gradient(
        900px 260px at 82% 44%,
        color-mix(in srgb, var(--primary2) 14%, transparent),
        transparent 72%
      ),
      radial-gradient(
        700px 220px at 60% 78%,
        color-mix(in srgb, var(--primary) 12%, transparent),
        transparent 72%
      );
  }
}

/* Sticky header offset */
#how{ scroll-margin-top: 96px; }

/* =========================
   ANIMATION — синхронно node+card
========================= */

.how-journey[data-anim="on"] .how-journey__card,
.how-journey[data-anim="on"] .how-journey__node{
  opacity: 0;
  transform: translateY(10px);
}

.how-journey[data-anim="on"] .how-journey__node{
  transform: translate(-50%, -50%) scale(0.88);
}

/* reveal — node и card вместе */
.how-journey.is-visible .how-journey__card,
.how-journey.is-visible .how-journey__node{
  opacity: 1;
  transition: opacity 520ms ease, transform 520ms ease;
  transition-delay: calc(var(--i) * 160ms);
}

.how-journey.is-visible .how-journey__card{
  transform: none;
}

.how-journey.is-visible .how-journey__node{
  transform: translate(-50%, -50%) scale(1);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  .how-journey[data-anim="on"] .how-journey__card,
  .how-journey[data-anim="on"] .how-journey__node{
    opacity: 1;
    transform: none;
    transition: none !important;
  }
  .how-journey__card{
    transition: none !important;
  }
}

/* Responsive */
@media (max-width: 920px){
  .how-journey__grid{ grid-template-columns: 190px 1fr; }
  .how-journey__rail{ width: 190px; }
  .how-journey__stepHead::before{
    left: -24px;
    width: 18px;
    opacity: 0.85;
  }
}

@media (max-width: 680px){
  .how-journey__head{ margin-bottom: 24px; }

  .how-journey__grid{
    grid-template-columns: 120px 1fr;
    gap: 16px;
  }

  .how-journey__rail{ width: 120px; }

  .how-journey__node{
    width: 56px;
    height: 56px;
  }

  .how-journey__nodeIcon svg{
    width: 18px;
    height: 18px;
  }

  .how-journey__badge{ width: 120px; height: 120px; }
  .how-journey__badge img{ width: 104px; height: 104px; }

  .how-journey__steps{ gap: 16px; }

  .how-journey__card{
    padding: 20px 18px;
    border-radius: 18px;
    min-height: 120px;
  }

  .how-journey__stepHead h3{ font-size: 18px; }
  .how-journey__text{ font-size: 15px; }

  .how-journey__step::before{
    left: -10px;
    right: -10px;
    opacity: 0.7;
  }

  .how-journey__stepHead::before{
    left: -18px;
    width: 14px;
    opacity: 0.75;
  }
}
