/* ==========================================================================
   SpeeGo — Process Hero Overlay (pinned scroll journey)
   ========================================================================== */

/*
  Theme sets html/body { overflow-x: hidden } which makes overflow-y compute to
  auto and breaks position:sticky. Use clip so horizontal spill is still clipped
  without killing the pinned 8-step journey.
*/
html,
body {
  overflow-x: clip !important;
}

#page.site,
.site,
.site-content,
.site-main,
#main,
#primary,
.content-area,
.layout-full {
  overflow: visible !important;
  transform: none !important;
  filter: none !important;
  perspective: none !important;
  contain: none !important;
}

/* Tall track: sticky panel pins until all 8 steps are scrolled through */
.process-journey {
  --process-steps: 8;
  position: relative;
  width: 100%;
  height: calc(var(--process-steps) * 100vh);
  height: calc(var(--process-steps) * 100svh);
  min-height: calc(var(--process-steps) * 100vh);
  min-height: calc(var(--process-steps) * 100svh);
  overflow: visible;
  z-index: 1;
}

.process-hero {
  --speego-navy: #071A2F;
  --speego-navy-2: #0B243E;
  --speego-orange: #FF5A1F;
  --speego-orange-hover: #F04F15;
  --white: #FFFFFF;
  --white-92: rgba(255, 255, 255, 0.92);
  --white-76: rgba(255, 255, 255, 0.76);
  --white-58: rgba(255, 255, 255, 0.58);
  --white-24: rgba(255, 255, 255, 0.24);
  --line: rgba(255, 255, 255, 0.32);
  --line-active: #FF5A1F;
  --success: #1FB981;
  --progress: 0%;

  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  height: 100svh;
  min-height: 100svh;
  max-height: none;
  overflow: hidden;
  isolation: isolate;
  background: var(--speego-navy);
  font-family:
    "Inter",
    "SF Pro Display",
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

.process-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  box-shadow: inset 0 0 180px rgba(0, 0, 0, 0.18);
}

/* Dual backgrounds for crossfade — always behind text */
.process-hero__bg-stack {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.process-hero__background {
  position: absolute !important;
  inset: 0 !important;
  z-index: 0;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: cover !important;
  object-position: 54% center;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: block !important;
  opacity: 0;
  transform: scale(1.04);
  transition:
    opacity 0.7s cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 1.35s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.process-hero__background.is-active {
  opacity: 1;
  transform: scale(1);
  z-index: 1;
}

.process-hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    linear-gradient(
      90deg,
      rgba(5, 20, 37, 0.88) 0%,
      rgba(5, 20, 37, 0.72) 26%,
      rgba(5, 20, 37, 0.35) 48%,
      rgba(5, 20, 37, 0.08) 68%,
      rgba(5, 20, 37, 0.02) 100%
    ),
    linear-gradient(
      180deg,
      rgba(3, 15, 28, 0.05) 0%,
      rgba(3, 15, 28, 0) 55%,
      rgba(3, 15, 28, 0.78) 100%
    );
}

/* All copy sits ON TOP of the photo */
.process-micro-brand {
  position: absolute;
  z-index: 6;
  top: 96px;
  left: 48px;
  font-size: 11px;
  line-height: 1.55;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.74);
  white-space: pre-line;
  pointer-events: none;
}

.process-micro-brand::before {
  content: "";
  display: block;
  width: 32px;
  height: 2px;
  margin-bottom: 14px;
  background: var(--speego-orange);
}

.process-hero__content {
  position: absolute;
  z-index: 5;
  left: 0;
  top: 0;
  width: min(650px, 44vw);
  padding-top: clamp(170px, 19vh, 220px);
  margin-left: clamp(56px, 9vw, 180px);
  pointer-events: none;
}

.process-hero__content a {
  pointer-events: auto;
}

.process-step-index {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 18px;
  font-size: 21px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.process-step-index strong {
  font-size: 42px;
  font-weight: 800;
  color: var(--speego-orange);
}

.process-step-index span {
  font-size: 20px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.72);
}

.process-title {
  display: flex;
  flex-direction: column;
  margin: 0;
  font-family: Inter, sans-serif;
  font-size: clamp(64px, 6.2vw, 112px);
  line-height: 0.88;
  font-weight: 800;
  letter-spacing: -0.055em;
  text-transform: uppercase;
  color: #ffffff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.1);
}

.process-title__accent {
  color: var(--speego-orange);
}

.process-description {
  max-width: 520px;
  margin-top: 26px;
  font-size: clamp(17px, 1.2vw, 22px);
  line-height: 1.5;
  font-weight: 400;
  letter-spacing: -0.012em;
  color: rgba(255, 255, 255, 0.88);
}

.process-next {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  margin-top: 32px;
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

.process-next::before {
  content: "";
  width: 34px;
  height: 1px;
  background: rgba(255, 255, 255, 0.45);
}

.process-next__icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--speego-orange);
  color: #ffffff;
  font-size: 22px;
  transition:
    transform 0.25s ease,
    background 0.25s ease;
}

.process-next:hover .process-next__icon {
  transform: translateX(5px);
  background: var(--speego-orange-hover);
}

.process-side-copy {
  position: absolute;
  z-index: 5;
  top: 64px;
  right: 48px;
  text-align: right;
  font-size: 11px;
  line-height: 1.65;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.75);
  white-space: pre-line;
}

.scroll-indicator {
  position: absolute;
  z-index: 6;
  right: 36px;
  top: 44%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
}

.scroll-indicator > span:first-child {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.13em;
}

.scroll-indicator__line {
  width: 1px;
  height: 80px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.2),
    rgba(255, 255, 255, 0.85)
  );
}

.scroll-indicator__arrow {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.55);
  font-size: 20px;
}

/* Process Navigation — secondary, editorial, on-photo */
.process-nav {
  position: absolute;
  z-index: 7;
  left: 0;
  right: 0;
  bottom: 0;
  padding:
    72px
    clamp(48px, 5vw, 100px)
    36px;
  background: linear-gradient(
    180deg,
    rgba(7, 26, 47, 0) 0%,
    rgba(7, 26, 47, 0.28) 42%,
    rgba(7, 26, 47, 0.55) 100%
  );
  pointer-events: none;
}

.process-nav > * {
  pointer-events: auto;
}

.process-timeline {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.process-timeline::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.28);
  pointer-events: none;
}

.process-timeline::after {
  content: "";
  position: absolute;
  top: 3.5px;
  left: 0;
  width: var(--progress);
  height: 2px;
  background: #FF5A1F;
  transition: none;
  pointer-events: none;
}

.timeline-step {
  position: relative;
  z-index: 2;
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.timeline-step__icon {
  display: none;
}

.timeline-step__dot {
  width: 8px;
  height: 8px;
  margin: 0 0 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  transition:
    background 0.25s ease,
    box-shadow 0.25s ease,
    width 0.25s ease,
    height 0.25s ease;
}

.timeline-step:hover:not(.timeline-step--active) .timeline-step__dot {
  background: rgba(255, 255, 255, 0.85);
}

.timeline-step--active .timeline-step__dot {
  width: 10px;
  height: 10px;
  background: #FF5A1F;
  box-shadow: 0 0 0 4px rgba(255, 90, 31, 0.18);
}

.timeline-step__number {
  margin: 0;
  font-family: Inter, sans-serif;
  font-size: 12px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.48);
  transition: color 0.25s ease;
}

.timeline-step:hover:not(.timeline-step--active) .timeline-step__number {
  color: rgba(255, 255, 255, 0.78);
}

.timeline-step--active .timeline-step__number {
  color: #FF5A1F;
}

/* Hover tooltip — inactive only */
.timeline-step__tooltip {
  position: absolute;
  bottom: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(7, 26, 47, 0.88);
  color: #fff;
  font-family: Inter, sans-serif;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.timeline-step__tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(7, 26, 47, 0.88);
}

.timeline-step:hover:not(.timeline-step--active) .timeline-step__tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.timeline-step:first-child .timeline-step__tooltip {
  left: 0;
  transform: translateX(0) translateY(4px);
}

.timeline-step:first-child:hover:not(.timeline-step--active) .timeline-step__tooltip {
  transform: translateX(0) translateY(0);
}

.timeline-step:first-child .timeline-step__tooltip::after {
  left: 16px;
}

.timeline-step:last-child .timeline-step__tooltip {
  left: auto;
  right: 0;
  transform: translateX(0) translateY(4px);
}

.timeline-step:last-child:hover:not(.timeline-step--active) .timeline-step__tooltip {
  transform: translateX(0) translateY(0);
}

.timeline-step:last-child .timeline-step__tooltip::after {
  left: auto;
  right: 16px;
  transform: none;
}

/* Meta row under rail: active title + counter */
.process-nav__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  margin-top: 18px;
}

.process-nav__active-title {
  margin: 0;
  font-family: Inter, sans-serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.process-nav__counter {
  margin: 0;
  flex-shrink: 0;
  font-family: Inter, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.62);
}

.process-nav__counter strong {
  color: #FF5A1F;
  font-weight: 800;
}
/* Text enter animation — scroll-driven step change */
@keyframes processTextIn {
  from {
    opacity: 0;
    transform: translateY(28px);
    filter: blur(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

.process-hero.is-animating .process-step-index,
.process-hero.is-animating .process-title,
.process-hero.is-animating .process-description,
.process-hero.is-animating .process-next {
  animation: processTextIn 0.62s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.process-hero.is-animating .process-step-index {
  animation-delay: 0ms;
}

.process-hero.is-animating .process-title {
  animation-delay: 80ms;
}

.process-hero.is-animating .process-description {
  animation-delay: 150ms;
}

.process-hero.is-animating .process-next {
  animation-delay: 220ms;
}

@media (min-width: 1440px) {
  .process-title {
    font-size: 76px;
  }
}

@media (min-width: 1920px) {
  .process-title {
    font-size: 96px;
  }
}

@media (min-width: 2200px) {
  .process-title {
    font-size: 108px;
  }
}

@media (max-width: 1180px) {
  .process-title {
    font-size: 64px;
  }

  .process-hero__content {
    width: 52vw;
    margin-left: 48px;
    position: absolute;
  }

  .process-side-copy,
  .process-micro-brand {
    display: none;
  }

  .process-nav {
    padding-left: 32px;
    padding-right: 32px;
  }
}

@media (max-width: 768px) {
  .process-journey {
    /* Still pin on mobile — slightly shorter track for comfort */
    --process-steps: 6.5;
  }

  .process-hero {
    height: 100svh;
    min-height: 100svh;
    max-height: none;
  }

  .process-hero__background {
    object-position: 62% center;
  }

  .process-hero__overlay {
    background: linear-gradient(
      180deg,
      rgba(4, 17, 31, 0.46) 0%,
      rgba(4, 17, 31, 0.64) 45%,
      rgba(4, 17, 31, 0.94) 100%
    );
  }

  .process-hero__content {
    position: absolute;
    width: auto;
    left: 0;
    right: 0;
    margin: 0;
    padding: 120px 22px 220px;
  }

  .process-title {
    font-size: clamp(46px, 13vw, 64px);
    line-height: 0.92;
  }

  .process-description {
    font-size: 16px;
    line-height: 1.55;
  }

  .scroll-indicator {
    display: none;
  }

  .process-nav {
    padding: 56px 20px 28px;
  }

  .process-nav__meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-top: 14px;
  }

  .process-nav__active-title {
    font-size: 14px;
  }

  .timeline-step__tooltip {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .process-hero *,
  .process-hero *::before,
  .process-hero *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
