/* ==========================================================================
   Process — the wow moment. A single photograph stays pinned on screen while
   four stages cross-fade in sync with scroll position, driven by invisible
   trigger zones + IntersectionObserver (see main.js) rather than continuous
   per-pixel scroll math. Dark, photographic — deliberately returning to the
   hero's register after two light, editorial sections.
   ========================================================================== */

.process {
  position: relative;
  background-color: var(--color-ink);
}

/* Tall scroll track — four 100vh zones give the pin something to hold
   through while each stage takes its turn on screen. */
.process-scroll {
  position: relative;
  height: 400vh;
}

.process-triggers {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.process-trigger {
  position: absolute;
  left: 0;
  width: 1px;
  height: 100vh;
}
.process-trigger[data-step="1"] { top: 0; }
.process-trigger[data-step="2"] { top: 100vh; }
.process-trigger[data-step="3"] { top: 200vh; }
.process-trigger[data-step="4"] { top: 300vh; }

.process-pin {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

.process-media {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.process-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
  transform: scale(1) translateX(0);
  transition: transform 1.1s var(--ease-entrance);
}
/* The image evolves with the active stage — a slow, continuous drift
   rather than a hard cut, so it reads as one unbroken scene. */
.process-pin[data-active-step="2"] .process-image { transform: scale(1.05) translateX(-1.5%); }
.process-pin[data-active-step="3"] .process-image { transform: scale(1.1) translateX(-3%); }
.process-pin[data-active-step="4"] .process-image { transform: scale(1.15) translateX(-4.5%); }

.process-vignette {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    0deg,
    rgba(14, 15, 18, 0.88) 0%,
    rgba(14, 15, 18, 0.5) 40%,
    rgba(14, 15, 18, 0.15) 65%,
    rgba(14, 15, 18, 0) 85%
  );
}

.process-content {
  position: relative;
  z-index: 1;
  padding-bottom: var(--space-16);
  max-width: 40rem;
}

.process-content .text-eyebrow {
  text-shadow: 0 1px 3px rgba(14, 15, 18, 0.85), 0 2px 14px rgba(14, 15, 18, 0.6);
}

.process-steps {
  position: relative;
  margin-top: var(--space-4);
  /* Tall enough for the longest title (up to two lines at the section-title
     size) plus a two-line description — a couple of the four steps were
     overflowing the old 10rem reservation and visually colliding with the
     progress indicator below. */
  min-height: 16rem;
}

.process-step {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s var(--ease-entrance), transform 0.6s var(--ease-entrance);
  pointer-events: none;
}
.process-step.is-active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.process-step-number {
  display: block;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-brass);
  margin-bottom: var(--space-1);
}

.process-step-title {
  font-family: var(--font-serif);
  font-size: var(--text-section-title);
  font-weight: 500;
  color: var(--color-white);
  text-shadow: 0 2px 16px rgba(14, 15, 18, 0.5);
}

.process-step-desc {
  margin-top: var(--space-2);
  max-width: 32rem;
  color: rgba(255, 255, 255, 0.82);
  text-shadow: 0 1px 10px rgba(14, 15, 18, 0.5);
}

.process-progress {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-8);
}

/* A thin line that fills as the active stage advances — elegant and
   barely noticeable, not a bouncing or attention-seeking indicator. */
.process-progress-track {
  position: relative;
  width: 120px;
  height: 1px;
  background: var(--color-graphite-line);
}
.process-progress-fill {
  position: absolute;
  inset: 0;
  width: 25%;
  background: var(--color-brass);
  transition: width 0.7s var(--ease-entrance);
}
.process-pin[data-active-step="2"] .process-progress-fill { width: 50%; }
.process-pin[data-active-step="3"] .process-progress-fill { width: 75%; }
.process-pin[data-active-step="4"] .process-progress-fill { width: 100%; }

.process-progress-label {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: var(--color-slate);
}

@media (prefers-reduced-motion: reduce) {
  .process-image { transition: none; }
  .process-step { transition: none; }
}

/* Mobile/tablet — no pin, no scrub. Photo once, steps stacked and simply
   revealed on scroll, matching how Hero already simplifies for touch. */
@media (max-width: 1023px) {
  .process-scroll {
    height: auto;
  }
  .process-pin {
    position: static;
    height: auto;
    display: block;
    padding-bottom: var(--space-8);
  }
  .process-media {
    position: relative;
    height: 60vh;
  }
  .process-triggers {
    display: none;
  }
  .process-content {
    max-width: none;
    padding-bottom: 0;
    margin-top: var(--space-8);
  }
  .process-steps {
    position: static;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-8);
  }
  .process-step {
    position: static;
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }
  .process-progress {
    display: none;
  }
}
