/* Homepage hero reveal + rotating promise, process timeline */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hero__title {
  margin-top: 22px;
  font-size: clamp(34px, 4.6vw, 45px);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -.035em;
  color: var(--ink);
}

.hero__title .hero__line {
  display: block;
}

.hero__title .hero__line--rotating {
  margin-top: 0.06em;
}

.hero__word {
  display: inline-block;
  white-space: pre;
}

.hero__word + .hero__word::before,
.hero-rotator + .hero__word::before {
  content: " ";
  white-space: pre;
}

.hero-rotator {
  display: inline-block;
  vertical-align: baseline;
  position: relative;
  text-align: left;
}

.hero-rotator__ghost {
  visibility: hidden;
  display: inline-block;
  font-weight: 800;
  letter-spacing: -.035em;
  white-space: nowrap;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

.hero-rotator__viewport {
  display: inline-block;
  overflow: hidden;
  height: 1.1em;
  line-height: 1.1;
  vertical-align: bottom;
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
}

.hero-rotator__track {
  display: flex;
  flex-direction: column;
  will-change: transform;
}

.hero-rotator__item {
  flex: 0 0 auto;
  height: 1.1em;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -.035em;
  background: linear-gradient(90deg, #1f3a7a, var(--purple));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

html.has-motion .hero__title[data-hero-state="idle"] .hero__word {
  opacity: 0;
  transform: translate3d(0, 0.42em, 0);
}

html.has-motion .hero__title[data-hero-state="reveal"] .hero__word,
html.has-motion .hero__title[data-hero-state="revealed"] .hero__word {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  transition:
    opacity 0.62s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.62s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: calc(var(--i, 0) * 68ms);
}

html.has-motion .hero__title[data-hero-state="idle"] .hero-rotator {
  opacity: 0;
  transform: translate3d(0, 0.35em, 0);
}

html.has-motion .hero__title[data-hero-state="reveal"] .hero-rotator,
html.has-motion .hero__title[data-hero-state="revealed"] .hero-rotator {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  transition:
    opacity 0.55s ease 0.35s,
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.35s;
}

html.has-motion .hero-rotator__track {
  --hero-rotator-index: 0;
  transform: translate3d(0, calc(var(--hero-rotator-index) * -1.1em), 0);
  transition: transform 0.72s cubic-bezier(0.22, 1, 0.36, 1);
}

html.has-motion .hero-rotator__track.is-instant {
  transition: none;
}

@media (prefers-reduced-motion: reduce) {
  .hero__title .hero__word,
  .hero-rotator {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .hero-rotator__track {
    transition: none !important;
    transform: none !important;
  }

  .hero-rotator__item:not(:first-child) {
    display: none;
  }
}

/* Process timeline — wavy path behind cards */
.process-timeline {
  position: relative;
  margin-top: 12px;
  padding: 8px 0 4px;
  --process-fill: 0;
  --navy-process: #0f3256;
}

.process-timeline__wave {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: visible;
}

.process-wave {
  display: block;
  width: 100%;
  height: 100%;
}

.process-wave--desktop {
  position: absolute;
  left: -2%;
  width: 104%;
  top: 50%;
  height: clamp(100px, 18vw, 148px);
  transform: translateY(-46%);
}

.process-wave--mobile {
  display: none;
}

.process-wave__base {
  stroke: #e3e8f0;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.process-wave__progress {
  stroke: url(#process-wave-grad);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: calc(1 - var(--process-fill, 0));
  transition: stroke-dashoffset 0.85s cubic-bezier(0.33, 1, 0.45, 1);
  will-change: stroke-dashoffset;
}

.process-wave--mobile .process-wave__progress {
  stroke: url(#process-wave-grad-mobile);
}

.grid--process {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(22px, 3.2vw, 44px);
  align-items: stretch;
}

.process-step {
  position: relative;
  z-index: 2;
  cursor: default;
  outline: none;
  background: #fff;
  isolation: isolate;
  transition:
    border-color 0.4s ease,
    box-shadow 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.45s ease;
}

.process-step.is-active {
  border-color: rgba(106, 69, 227, 0.4);
  box-shadow:
    0 18px 40px rgba(15, 50, 86, 0.1),
    0 0 0 1px rgba(106, 69, 227, 0.08);
  transform: translateY(-4px);
}

.process-step .icon-box {
  transition:
    background 0.35s ease,
    color 0.35s ease,
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.process-step.is-active .icon-box {
  background: #f0ecfd;
  color: var(--purple);
  transform: scale(1.07);
}

html.has-motion .process-timeline.is-visible .process-step {
  opacity: 0;
  transform: translate3d(0, 20px, 0);
}

html.has-motion .process-timeline.is-visible .process-step.is-revealed {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  transition:
    opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.6s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.4s ease,
    box-shadow 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

html.has-motion .process-timeline.is-visible .process-step.is-revealed:nth-child(1) {
  transition-delay: 0.05s;
}
html.has-motion .process-timeline.is-visible .process-step.is-revealed:nth-child(2) {
  transition-delay: 0.14s;
}
html.has-motion .process-timeline.is-visible .process-step.is-revealed:nth-child(3) {
  transition-delay: 0.23s;
}
html.has-motion .process-timeline.is-visible .process-step.is-revealed:nth-child(4) {
  transition-delay: 0.32s;
}

html.has-motion .process-timeline.is-visible .process-step.is-revealed.is-active {
  transform: translate3d(0, -4px, 0);
}

.process-step:focus-visible {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(106, 69, 227, 0.2);
}

html.has-motion .process-timeline:not(.is-visible) {
  opacity: 0;
  transform: translateY(18px);
}

html.has-motion .process-timeline.is-visible {
  opacity: 1;
  transform: none;
  transition:
    opacity 0.55s ease,
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (max-width: 900px) {
  .process-timeline {
    padding-left: 8px;
    padding-bottom: 8px;
  }

  .grid--process {
    grid-template-columns: 1fr;
    gap: clamp(20px, 5vw, 28px);
    padding-left: 28px;
  }

  .process-wave--desktop {
    display: none;
  }

  .process-wave--mobile {
    display: block;
    position: absolute;
    left: 6px;
    top: 0;
    bottom: 0;
    width: 52px;
    height: 100%;
    transform: none;
  }

  .process-timeline__wave {
    left: 0;
    top: 0;
    bottom: 0;
    width: 64px;
    right: auto;
    height: 100%;
  }

  .process-step.is-active,
  html.has-motion .process-timeline.is-visible .process-step.is-revealed.is-active {
    transform: none;
  }

  .process-step.is-active .icon-box {
    transform: scale(1.04);
  }

  .process-wave__progress {
    transition: stroke-dashoffset 0.18s linear;
    will-change: auto;
  }

  html.has-motion .process-timeline.is-visible .process-step,
  html.has-motion .process-timeline.is-visible .process-step.is-revealed {
    transform: none;
    transition-delay: 0s !important;
  }

  html.has-motion .process-timeline.is-visible .process-step.is-revealed:nth-child(n) {
    transition-duration: 0.4s;
  }
}

@media (prefers-reduced-motion: reduce) {
  .process-wave__progress,
  .process-step {
    transition: none !important;
  }

  .process-step.is-active {
    transform: none;
  }

  html.has-motion .process-timeline,
  html.has-motion .process-timeline.is-visible .process-step {
    opacity: 1 !important;
    transform: none !important;
  }
}
