/* ============================================================
   AUREN STUDIO — SECTION 04 / PROCESS
   Horizontal gallery: four stages in a living dark field.
   ============================================================ */

@property --process {
  syntax: '<number>';
  inherits: true;
  initial-value: 0;
}

.process {
  --process: 0;
  position: relative;
  background: var(--c-black);
  color: var(--c-ivory);
  overflow: hidden;
}

/* Residual gold at Launch — hands the path into Client Assurance. */
.process::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -10%;
  z-index: 2;
  width: min(980px, 88vw);
  height: 42vh;
  pointer-events: none;
  transform: translateX(-50%);
  opacity: clamp(0, (var(--process) - 0.78) / 0.22, 1);
  background:
    radial-gradient(
      ellipse closest-side at 50% 88%,
      rgba(201, 167, 106, 0.14) 0%,
      rgba(201, 167, 106, 0.06) 36%,
      rgba(190, 145, 65, 0.02) 58%,
      rgba(190, 145, 65, 0) 76%
    );
}

/* Residual champagne from Pricing — dissolves as the section arrives. */
.process__veil {
  position: absolute;
  left: 50%;
  top: -8%;
  z-index: 0;
  width: min(1400px, 130vw);
  height: 70vh;
  pointer-events: none;
  transform: translateX(-50%);
  background:
    radial-gradient(
      ellipse closest-side at 50% 0%,
      rgba(201, 167, 106, 0.16) 0%,
      rgba(201, 167, 106, 0.07) 34%,
      rgba(190, 145, 65, 0.025) 58%,
      rgba(190, 145, 65, 0) 78%
    );
}

.process__env {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.process__grid {
  width: 100%;
  height: 100%;
  opacity: 0.42;
}
.process__grid line {
  vector-effect: non-scaling-stroke;
  stroke-width: 1;
  fill: none;
}
.process__grid .grid__v line { stroke: var(--hair); }
.process__grid .grid__h line { stroke: rgba(255, 255, 255, 0.022); }
.process__grid .grid__gold line { stroke: var(--hair-gold); }
.process__grain {
  position: absolute;
  inset: 0;
  opacity: 0.016;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 240px 240px;
}

.process__pin {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(72px, 10vh, 110px) 0 clamp(48px, 7vh, 80px);
}

.process__intro {
  flex: 0 0 auto;
  padding: 0 var(--gutter);
  margin-bottom: clamp(36px, 5.5vh, 64px);
}
.process__identifier {
  display: flex;
  align-items: baseline;
  gap: clamp(16px, 2vw, 24px);
  margin-bottom: 16px;
}
.process__index {
  font-size: var(--fs-micro);
  letter-spacing: 0.12em;
  color: var(--c-gold-42);
}
.process__eyebrow {
  font-size: clamp(0.8125rem, 1.1vw, 0.9375rem);
  font-weight: 400;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--c-ivory-60);
}
.process__title {
  margin: 0;
  max-width: 16ch;
  font-size: clamp(2.4rem, 5.2vw, 5rem);
  font-weight: 400;
  line-height: 0.96;
  letter-spacing: -0.038em;
  color: var(--c-ivory);
}
.process__title-serif {
  font-family: var(--ff-serif);
  font-style: italic;
  letter-spacing: -0.01em;
  color: rgb(222, 204, 168);
}
.process__subtitle {
  margin-top: 18px;
  font-size: 0.9375rem;
  letter-spacing: 0.04em;
  color: var(--c-ivory-38);
}

/* ---- progress ---------------------------------------------- */
.process__rail {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.process__progress {
  position: relative;
  height: 48px;
  margin: 0 var(--gutter) clamp(20px, 3.2vh, 36px);
  pointer-events: none;
}
.process__progress-track,
.process__progress-fill {
  position: absolute;
  left: 0;
  right: 0;
  display: block;
}
.process__progress-track {
  top: calc(50% - 0.5px);
  height: 1px;
  background:
    linear-gradient(
      90deg,
      rgba(176, 138, 72, 0.06) 0%,
      rgba(201, 167, 106, 0.22) 18%,
      rgba(214, 186, 132, 0.28) 50%,
      rgba(201, 167, 106, 0.22) 82%,
      rgba(176, 138, 72, 0.06) 100%
    );
}
.process__progress-fill {
  top: calc(50% - 0.75px);
  height: 1.5px;
  background:
    linear-gradient(
      90deg,
      rgba(143, 112, 64, 0.2) 0%,
      rgba(190, 145, 65, 0.62) 28%,
      rgba(201, 167, 106, 0.88) 68%,
      rgba(232, 214, 168, 0.96) 100%
    );
  box-shadow:
    0 0 8px rgba(201, 167, 106, 0.32),
    0 0 18px rgba(190, 145, 65, 0.12);
  transform: scaleX(var(--process));
  transform-origin: left center;
  will-change: transform;
}
.process__sparkles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}
.process__progress-dot {
  position: absolute;
  top: 50%;
  left: calc(var(--process) * 100%);
  z-index: 2;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(circle at 32% 28%, #f4ead4 0%, #d4b278 38%, #c9a76a 68%, #8f7040 100%);
  box-shadow:
    0 0 0 1px rgba(232, 214, 168, 0.32),
    0 0 10px 2px rgba(201, 167, 106, 0.42),
    0 0 22px 6px rgba(190, 145, 65, 0.16);
  will-change: left;
}
.process__progress-dot::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 167, 106, 0.22) 0%, rgba(201, 167, 106, 0) 70%);
}

.process__dots {
  display: none;
}

/* ---- track ------------------------------------------------- */
.process__viewport {
  overflow: hidden;
  width: 100%;
}
.process__track {
  display: flex;
  align-items: flex-end;
  gap: clamp(56px, 7vw, 120px);
  padding: 0 var(--gutter);
  margin: 0;
  list-style: none;
  will-change: transform;
}

.process-step {
  position: relative;
  flex: 0 0 min(66vw, 700px);
  min-height: 28vh;
  padding-top: 4px;
  opacity: 0.34;
  transform: translate3d(0, 18px, 0);
  transition:
    opacity 700ms var(--ease-premium),
    transform 700ms var(--ease-premium);
}
.process-step.is-active {
  opacity: 1;
  transform: none;
}
.process-step.is-past {
  opacity: 0.46;
  transform: none;
}

.process-step__index {
  position: relative;
  z-index: 1;
  margin: 0 0 18px;
  font-size: var(--fs-micro);
  letter-spacing: var(--ls-micro);
  text-transform: uppercase;
  color: var(--c-gold-42);
}
.process-step.is-active .process-step__index {
  color: var(--c-gold-70);
}

.process-step__name {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: clamp(2rem, 3.4vw, 3.1rem);
  font-weight: 400;
  letter-spacing: -0.03em;
  color: var(--c-ivory);
}
.process-step__copy {
  position: relative;
  z-index: 1;
  max-width: 34ch;
  margin-top: 18px;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--c-ivory-60);
}

.process-step::after {
  content: "";
  position: absolute;
  left: 6%;
  top: 18%;
  z-index: 0;
  width: 220px;
  height: 180px;
  pointer-events: none;
  border-radius: 50%;
  opacity: 0;
  background:
    radial-gradient(
      circle closest-side at center,
      rgba(201, 167, 106, 0.1) 0%,
      rgba(201, 167, 106, 0.035) 48%,
      rgba(201, 167, 106, 0) 74%
    );
  transition: opacity 800ms var(--ease-premium);
}
.process-step.is-active::after { opacity: 1; }

/* ---- js initial -------------------------------------------- */
.js .process [data-process-reveal] { opacity: 0; }

/* ---- reduced motion ---------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .js .process [data-process-reveal] { opacity: 1; }
  .process__sparkles { display: none; }
  .process-step,
  .process-step::after,
  .process__progress-fill,
  .process__progress-dot {
    transition: none;
    will-change: auto;
  }
  .process__track { will-change: auto; }
  .process-step {
    opacity: 1;
    transform: none;
  }
  .process__pin {
    min-height: 0;
    padding-bottom: clamp(72px, 10vh, 120px);
  }
  .process__viewport { overflow: visible; }
  .process__track {
    flex-direction: column;
    align-items: stretch;
    gap: 56px;
  }
  .process-step {
    flex-basis: auto;
    min-height: 0;
  }
  .process__progress-fill { transform: scaleX(1); }
  .process__progress-dot { left: 100%; }
  .process__dots { display: none; }
}

/* ---- compact / swipe --------------------------------------- */
@media (max-width: 900px) {
  .process__pin {
    min-height: 0;
    padding: clamp(64px, 9vh, 88px) 0 clamp(56px, 8vh, 80px);
  }
  .process__intro { margin-bottom: 28px; }
  .process__title { font-size: clamp(2.15rem, 10vw, 3.1rem); }
  .process__progress { margin-bottom: 22px; }
  .process__dots {
    display: flex;
    gap: 8px;
    margin: 0 var(--gutter) 22px;
    padding: 0;
    list-style: none;
  }
  .process__dots li {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(201, 167, 106, 0.22);
  }
  .process__dots li.is-active {
    background: rgb(214, 186, 132);
    box-shadow: 0 0 10px 2px rgba(201, 167, 106, 0.35);
  }
  .process__viewport {
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 22px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    touch-action: pan-x pan-y;
  }
  .process__viewport::-webkit-scrollbar { display: none; }
  .process__track {
    align-items: stretch;
    gap: 28px;
    padding-right: 22px;
    will-change: auto;
  }
  .process-step {
    flex: 0 0 min(82vw, 400px);
    min-height: 0;
    scroll-snap-align: start;
    opacity: 0.5;
    transform: none;
  }
  .process-step.is-active,
  .process-step.is-past {
    transform: none;
  }
  .process-step__name { font-size: clamp(1.85rem, 8vw, 2.4rem); }
}

@media (max-width: 430px) {
  .process__intro,
  .process__progress,
  .process__dots { padding-left: 20px; padding-right: 20px; }
  .process__progress,
  .process__dots { margin-left: 20px; margin-right: 20px; }
  .process__track { padding-left: 20px; padding-right: 20px; }
  .process__viewport { scroll-padding-inline: 20px; }
}
