/* services.css — "What we build" reel.
   One long rectangle, two conveyors of our website heroes moving in
   opposite directions. (--old/--new are legacy class names from an
   abandoned before/after concept — both lanes carry current work.)
   Uses only root tokens from styles.css; all class names prefixed .services- */

.services {
  max-width: 1640px;
  margin: 0 auto;
  padding: clamp(96px, 14vh, 180px) 0 clamp(64px, 9vh, 120px);
  --services-pad: clamp(24px, 5vw, 72px);
  /* anchor nav: keep the section head clear of the sticky header */
  scroll-margin-top: 96px;
}

/* ---------- header ---------- */

.services-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  margin: 0 var(--services-pad);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--hairline);
}

.services-kicker {
  font-size: 11px;
  letter-spacing: var(--ls-kicker);
  text-transform: uppercase;
  color: var(--ink-soft);
}

.services-count {
  font-size: 11px;
  letter-spacing: var(--ls-kicker);
  text-transform: uppercase;
  color: var(--ink-soft);
  white-space: nowrap;
}

.services-note {
  margin: 16px var(--services-pad) 0;
  font-size: 14px;
  font-weight: 200;
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 56ch;
}

/* ---------- the long rectangle ---------- */

.services-duo {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: min(100vh, 1080px);
  margin: clamp(28px, 4vh, 44px) auto 0;
  max-width: min(780px, calc(100% - 2 * var(--services-pad)));
  column-gap: clamp(56px, 9vw, 140px);
  overflow: hidden;
}

.services-lane {
  position: relative;
  overflow: hidden;
}

.services-lane-track {
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 1.6vw, 22px);
  padding: clamp(14px, 1.6vw, 22px) 0;
  will-change: transform;
}

.services-lane-track img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top center;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(77, 69, 55, 0.09);
  user-select: none;
  -webkit-user-drag: none;
}

/* masonry rhythm: every lane mixes wide, squarish and tall crops */
.services-lane-track img:nth-child(3n + 2) { aspect-ratio: 4 / 3; }
.services-lane-track img:nth-child(3n) { aspect-ratio: 5 / 4; }

/* conveyors — duration set per-lane by services.js */
@media (prefers-reduced-motion: no-preference) {
  .services-lane--old .services-lane-track {
    animation: services-lane-up var(--lane-duration, 48s) linear infinite;
  }
  .services-lane--new .services-lane-track {
    animation: services-lane-down var(--lane-duration, 48s) linear infinite;
  }
  /* pause is class-based so hover (desktop), tap (touch, via services.js)
     and the off-screen IntersectionObserver all share one mechanism */
  .services-duo:hover .services-lane-track,
  .services-duo.is-paused .services-lane-track,
  .services-duo.is-offscreen .services-lane-track {
    animation-play-state: paused;
  }
}

@keyframes services-lane-up {
  from { transform: translateY(0); }
  to { transform: translateY(-50%); }
}

@keyframes services-lane-down {
  from { transform: translateY(-50%); }
  to { transform: translateY(0); }
}

/* soft fades at the rectangle's top and bottom edges */
.services-lane::before,
.services-lane::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 56px;
  z-index: 1;
  pointer-events: none;
}
.services-lane::before {
  top: 0;
  background: linear-gradient(to bottom, #ffffff, rgba(255, 255, 255, 0));
}
.services-lane::after {
  bottom: 0;
  background: linear-gradient(to top, #ffffff, rgba(255, 255, 255, 0));
}

/* ---------- engagement facts ---------- */

.services-facts {
  margin: clamp(36px, 6vh, 56px) var(--services-pad) 0;
  padding-top: 16px;
  border-top: 1px solid var(--hairline);
  font-size: 11px;
  letter-spacing: var(--ls-kicker);
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .services { padding-top: clamp(72px, 10vh, 120px); }
  .services-duo { height: min(78vh, 760px); }
}

@media (max-width: 640px) {
  .services { padding-bottom: 40px; }

  /* head: stack kicker over count instead of a cramped collision */
  .services-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .services-count { white-space: normal; }

  /* one full-width lane — two columns leave ~143px thumbnails at 390px */
  .services-duo {
    grid-template-columns: 1fr;
    column-gap: 0;
    height: min(70vh, 560px);
    max-width: calc(100% - 2 * var(--services-pad));
  }
  .services-lane--new { display: none; }

  .services-facts { margin-top: 28px; }
}
