/* Starter Kit process chapter: vertical scroll becomes a horizontal story. */
.motion-chapter {
  position: relative;
  height: 430vh;
  background: var(--bg-void);
  color: var(--ink-light);
}

.motion-pin {
  position: sticky;
  top: 0;
  height: 100svh;
  display: grid;
  grid-template-columns: minmax(250px, 24vw) minmax(0, 1fr);
  align-items: center;
  gap: clamp(2rem, 4vw, 5rem);
  padding: 7rem clamp(1.5rem, 4vw, 5rem) 3rem;
  overflow: hidden;
}

.motion-heading {
  position: relative;
  z-index: 2;
  align-self: center;
}

.motion-kicker {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: .63rem;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.motion-heading h2 {
  margin: 1rem 0 0;
  font-family: var(--font-body);
  font-size: clamp(3.3rem, 5vw, 6.4rem);
  font-weight: 500;
  line-height: .9;
  letter-spacing: -.065em;
}

.motion-heading h2 em {
  display: inline-block;
  color: var(--accent);
  font-family: var(--font-display);
  font-weight: 300;
  letter-spacing: -.035em;
}

.motion-instruction {
  max-width: 27ch;
  margin-top: 1.4rem;
  color: var(--ink-mute-light);
  font-family: var(--font-mono);
  font-size: .58rem;
  letter-spacing: .09em;
  line-height: 1.6;
  text-transform: uppercase;
}

.motion-progress {
  width: min(100%, 270px);
  height: 2px;
  margin-top: 2rem;
  overflow: hidden;
  background: rgba(245, 242, 236, .13);
}

.motion-progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
}

.motion-viewport {
  min-width: 0;
  overflow: visible;
}

.motion-track {
  display: flex;
  gap: clamp(1rem, 2vw, 2rem);
  width: max-content;
  will-change: transform;
}

.motion-card {
  position: relative;
  width: min(62vw, 820px);
  height: min(68vh, 680px);
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid rgba(245, 242, 236, .12);
  background: var(--bg-dark-elev);
}

.motion-media {
  position: absolute;
  inset: 0;
}

.motion-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 35%, rgba(5, 5, 7, .95) 100%);
}

.motion-media img,
.motion-media video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.motion-card-copy {
  position: absolute;
  z-index: 2;
  left: clamp(1.25rem, 3vw, 2.5rem);
  right: clamp(1.25rem, 3vw, 2.5rem);
  bottom: clamp(1.25rem, 3vw, 2.5rem);
}

.motion-card-copy > span {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: .58rem;
  letter-spacing: .13em;
}

.motion-card-copy h3 {
  margin: .7rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.4vw, 4rem);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -.03em;
}

.motion-card-copy p {
  max-width: 46ch;
  margin-top: .8rem;
  color: var(--ink-soft-light);
  font-size: .95rem;
  line-height: 1.6;
}

@media (max-width: 980px) {
  .motion-chapter {
    height: auto;
    padding: 7rem 0 7rem var(--pad-x);
  }

  .motion-pin {
    position: relative;
    height: auto;
    display: block;
    padding: 0;
    overflow: visible;
  }

  .motion-heading { padding-right: var(--pad-x); }
  .motion-progress { display: none; }

  .motion-viewport {
    overflow-x: auto;
    padding: 3rem var(--pad-x) 1rem 0;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) rgba(245, 242, 236, .12);
  }

  .motion-track { transform: none !important; }
  .motion-card { width: min(80vw, 640px); height: min(68vh, 580px); scroll-snap-align: start; }
}

@media (max-width: 620px) {
  .motion-chapter { padding-top: 6rem; padding-bottom: 6rem; }
  .motion-heading h2 { font-size: clamp(3.4rem, 14vw, 5rem); }
  .motion-card { width: 84vw; height: 62svh; min-height: 470px; }
  .motion-card-copy h3 { font-size: clamp(2rem, 8vw, 3rem); }
}

@media (prefers-reduced-motion: reduce) {
  .motion-chapter {
    height: auto;
    padding: 7rem 0 7rem var(--pad-x);
  }

  .motion-pin {
    position: relative;
    height: auto;
    display: block;
    padding: 0;
    overflow: visible;
  }

  .motion-heading { padding-right: var(--pad-x); }
  .motion-progress { display: none; }

  .motion-viewport {
    overflow-x: auto;
    padding: 3rem var(--pad-x) 1rem 0;
    scroll-snap-type: x mandatory;
  }

  .motion-track { transform: none !important; }
  .motion-progress span { transform: none !important; }
  .motion-card { scroll-snap-align: start; }
}
