/* ==========================================================================
   Section: Process Timeline
   ========================================================================== */

.section-process-timeline {
  position: relative;
  background: var(--color-bg);
  padding: 96px 0 120px;
}

.section-process-timeline .grid-container {
  max-width: 60rem;
}

/* --------------------------------------------------------------------------
   1. Heading
   -------------------------------------------------------------------------- */

.process-timeline-eyebrow {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: 300;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--color-black);
  text-align: center;
  margin: 0 auto 14px;
}

.process-timeline-heading {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--fs-h2);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--color-black);
  text-align: center;
  max-width: 720px;
  margin: 0 auto 80px;
}

/* --------------------------------------------------------------------------
   2. Timeline grid: left column | center spine | right column
   -------------------------------------------------------------------------- */

.process-timeline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 56px minmax(0, 1fr);
  grid-auto-flow: dense;
  column-gap: 72px;
  row-gap: 64px;
  position: relative;
}

/* Vertical spine */
.process-timeline::before {
  content: '';
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 50%;
  width: 1px;
  background: var(--color-dash);
  transform: translateX(-50%);
  z-index: 0;
}

/* Each step is a sub-grid wrapper so its children flow into the parent grid */
.process-timeline-step {
  display: contents;
}

/* --------------------------------------------------------------------------
   3. Numbered node
   -------------------------------------------------------------------------- */

.process-timeline-node {
  grid-column: 2;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-black);
  color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  justify-self: center;
  align-self: start;
  margin-top: 6px;
  position: relative;
  z-index: 1;
  box-shadow: 0 0 0 6px var(--color-bg);
}

/* --------------------------------------------------------------------------
   4. Text panel
   -------------------------------------------------------------------------- */

.process-timeline-panel-text {
  padding-top: 0;
}

.process-timeline-step-title {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: var(--fs-h3);
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--color-black);
  margin: 0 0 18px;
}

.process-timeline-step-copy {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.55;
  color: var(--color-muted);
  margin: 0;
}

.process-timeline-days {
  font-weight: 700;
  color: var(--color-black);
  margin-right: 4px;
}

/* --------------------------------------------------------------------------
   5. Image panel
   -------------------------------------------------------------------------- */

.process-timeline-panel-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--color-bg-alt);
  border-radius: var(--radius-card);
  overflow: hidden;
  position: relative;
}

.process-timeline-panel-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* --------------------------------------------------------------------------
   6. Column alignment
   -------------------------------------------------------------------------- */

.process-timeline .left-col {
  grid-column: 1;
  justify-self: end;
  width: 100%;
}

.process-timeline .right-col {
  grid-column: 3;
  justify-self: start;
  width: 100%;
}

.process-timeline .panel-text.left-col,
.process-timeline .panel-text.right-col {
  text-align: left;
}

/* --------------------------------------------------------------------------
   7. Scroll-triggered animations
   -------------------------------------------------------------------------- */

/* Heading: rise + fade with a hint of letter expansion */
.process-timeline-eyebrow,
.process-timeline-heading {
  opacity: 0;
  transform: translateY(32px);
  filter: blur(6px);
  transition:
    opacity 1000ms var(--ease-out),
    transform 1000ms var(--ease-out),
    filter 900ms var(--ease-out);
  will-change: opacity, transform, filter;
}

.process-timeline-eyebrow.in-view,
.process-timeline-heading.in-view {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

/* Spine: draws top → bottom */
.process-timeline::before {
  transform: translateX(-50%) scaleY(0);
  transform-origin: top center;
  transition: transform 1600ms cubic-bezier(0.7, 0, 0.3, 1);
}

.process-timeline.in-view::before {
  transform: translateX(-50%) scaleY(1);
}

/* Node: pop in with a soft pulse halo */
.process-timeline-node {
  opacity: 0;
  transform: scale(0.3) rotate(-90deg);
  transition:
    opacity 500ms ease-out,
    transform 700ms cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 600ms ease-out;
}

.process-timeline-step.in-view .process-timeline-node {
  opacity: 1;
  transform: scale(1) rotate(0);
  transition-delay: 140ms;
  animation: process-timeline-node-pulse 1.4s ease-out 600ms 1;
}

@keyframes process-timeline-node-pulse {
  0% {
    box-shadow:
      0 0 0 6px var(--color-bg),
      0 0 0 0 rgba(41, 40, 36, 0.35);
  }
  70% {
    box-shadow:
      0 0 0 6px var(--color-bg),
      0 0 0 18px rgba(41, 40, 36, 0);
  }
  100% {
    box-shadow:
      0 0 0 6px var(--color-bg),
      0 0 0 0 rgba(41, 40, 36, 0);
  }
}

/* Text panel: slide in horizontally with slight rotation */
.process-timeline-panel-text {
  opacity: 0;
  transition:
    opacity 900ms var(--ease-out),
    transform 900ms var(--ease-out),
    filter 800ms var(--ease-out);
  will-change: opacity, transform, filter;
  filter: blur(4px);
}

.process-timeline-panel-text.left-col {
  transform: translateX(-48px) rotate(-1.5deg);
}
.process-timeline-panel-text.right-col {
  transform: translateX(48px) rotate(1.5deg);
}

.process-timeline-step.in-view .process-timeline-panel-text {
  opacity: 1;
  transform: translateX(0) rotate(0);
  filter: blur(0);
  transition-delay: 260ms;
}

/* Title and copy stagger inside the text panel */
.process-timeline-step-title,
.process-timeline-step-copy {
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 700ms var(--ease-out),
    transform 700ms var(--ease-out);
}

.process-timeline-step.in-view .process-timeline-step-title {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 380ms;
}

.process-timeline-step.in-view .process-timeline-step-copy {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 480ms;
}

/* Image panel: lift + scale + unblur, with a gentle hover boost once visible */
.process-timeline-panel-image {
  opacity: 0;
  transform: translateY(40px) scale(0.94);
  filter: blur(8px);
  transition:
    opacity 1000ms var(--ease-out),
    transform 1000ms var(--ease-out),
    filter 900ms var(--ease-out),
    box-shadow 400ms ease-out;
  will-change: opacity, transform, filter;
}

.process-timeline-step.in-view .process-timeline-panel-image {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
  transition-delay: 200ms;
}

.process-timeline-panel-image img {
  transition: transform 700ms var(--ease-out);
}

.process-timeline-step.in-view .process-timeline-panel-image:hover {
  box-shadow: var(--shadow-soft);
}

.process-timeline-step.in-view .process-timeline-panel-image:hover img {
  transform: scale(1.04);
}

@media (prefers-reduced-motion: reduce) {
  .process-timeline-heading,
  .process-timeline-eyebrow,
  .process-timeline::before,
  .process-timeline-node,
  .process-timeline-panel-text,
  .process-timeline-step-title,
  .process-timeline-step-copy,
  .process-timeline-panel-image,
  .process-timeline-panel-image img {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
    animation: none !important;
  }
  .process-timeline::before {
    transform: translateX(-50%) scaleY(1) !important;
  }
}

/* --------------------------------------------------------------------------
   8. Responsive — collapse to single column on small screens
   -------------------------------------------------------------------------- */

@media screen and (max-width: 1023px) {
  .section-process-timeline {
    padding: 80px 0 96px;
  }
  .process-timeline-heading {
    margin-bottom: 56px;
  }
}

@media screen and (max-width: 720px) {
  .section-process-timeline {
    padding: 64px 0 80px;
  }
  .process-timeline-heading {
    margin-bottom: 48px;
  }

  .process-timeline {
    grid-template-columns: 1fr;
    column-gap: 0;
    row-gap: 40px;
  }
  .process-timeline::before {
    left: 16px;
    transform: none;
  }
  .process-timeline.in-view::before {
    transform: scaleY(1);
  }

  /* Each step owns its own grid on mobile so image/text stay paired and ordered
     correctly. Without this, display:contents on the step flattens children
     into the outer grid where the `order` property groups all images before
     all texts globally. */
  .process-timeline-step {
    display: grid;
    grid-template-columns: 32px 1fr;
    column-gap: 20px;
    row-gap: 16px;
    align-items: start;
  }
  .process-timeline-node {
    grid-column: 1;
    grid-row: 1;
    margin-top: 4px;
  }
  .process-timeline .left-col,
  .process-timeline .right-col {
    grid-column: 2;
    padding: 0;
    justify-self: stretch;
    text-align: left;
  }
  .process-timeline-panel-image {
    grid-row: 1;
  }
  .process-timeline-panel-text {
    grid-row: 2;
  }
}
