.services-section {
  --services-bg: #0f1714;
  position: relative;
  height: 470svh;
  background: var(--services-bg);
  color: var(--vg-offwhite);
}

.services-sticky {
  position: sticky;
  top: var(--header-height);
  height: calc(100svh - var(--header-height));
  min-height: 0;
  overflow: hidden;
  padding: clamp(34px, 5vh, 60px) 0 clamp(24px, 3.4vh, 42px);
  display: flex;
  flex-direction: column;
}

.services-heading {
  position: relative;
  z-index: 10;
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: clamp(24px, 4vh, 46px);
}

.services-heading .eyebrow {
  margin: 0 0 10px;
  color: var(--vg-earth);
}

.services-heading h2 {
  margin: 0;
  font-size: clamp(3.2rem, 6.7vw, 7.1rem);
  line-height: .88;
  letter-spacing: -.055em;
  font-weight: 800;
  color: var(--vg-offwhite);
}

.services-heading-note {
  max-width: 320px;
  margin: 0 0 8px;
  font-size: .76rem;
  line-height: 1.65;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(251, 251, 247, .48);
  text-align: right;
}

.services-stage {
  --service-card-height: 100%;
  --services-stage-drift: 0px;
  position: relative;
  flex: 1 1 auto;
  width: min(calc(100% - 48px), var(--max-width));
  margin-inline: auto;
  min-height: 0;
  transform: translate3d(0, var(--services-stage-drift), 0);
  will-change: transform;
}

.service-card {
  --service-y: 0px;
  --service-scale: 1;
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: var(--service-card-height);
  overflow: hidden;
  border: 1px solid rgba(251, 251, 247, .34);
  border-radius: 30px;
  background: #15201c;
  transform: translate3d(0, var(--service-y), 0) scale(var(--service-scale));
  transform-origin: 50% 0;
  will-change: transform;
  box-shadow: 0 28px 70px rgba(0, 0, 0, .23);
}

.service-card-media {
  position: absolute;
  inset: 0;
  margin: 0;
}

.service-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.76) contrast(1.04) brightness(.72);
  transform: scale(1.025);
}

.service-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(7, 16, 13, .84) 0%, rgba(7, 16, 13, .54) 28%, rgba(7, 16, 13, .1) 62%, rgba(7, 16, 13, .42) 100%),
    linear-gradient(90deg, rgba(5, 16, 12, .48), transparent 60%);
  pointer-events: none;
}

.service-card-head {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: clamp(22px, 3vw, 36px);
}

.service-icon {
  width: clamp(62px, 7vw, 94px);
  height: clamp(62px, 7vw, 94px);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--vg-offwhite);
}

.service-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.45;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.service-title-wrap {
  min-width: 0;
}

.service-title-wrap p {
  margin: 0 0 8px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--vg-earth);
}

.service-title-wrap h3 {
  margin: 0;
  max-width: 780px;
  font-size: clamp(1.55rem, 3vw, 3.2rem);
  line-height: 1.02;
  letter-spacing: -.035em;
  font-weight: 700;
  color: var(--vg-offwhite);
}

.service-card-index {
  margin-left: auto;
  align-self: flex-start;
  padding-top: 5px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .14em;
  color: rgba(251, 251, 247, .52);
}

/* Two rigid title lines. Only the two spans are allowed to create line breaks. */
.projects-heading h2 {
  max-width: none !important;
  width: 100%;
  white-space: normal !important;
  overflow: visible;
  font-size: clamp(1.55rem, 5.2vw, 5.4rem) !important;
  line-height: .96;
}

.projects-heading h2 span {
  display: block;
  white-space: nowrap;
}

/*
  Project cards stay on one perfectly aligned baseline. Depth is created with
  perspective/rotation around the Y axis, never with vertical offsets or Z-axis
  rotation, so the row reads as gently bent rather than crooked.
*/
.projects-carousel {
  perspective: 1400px;
  perspective-origin: 50% 50%;
}

.projects-track {
  align-items: center !important;
  transform-style: preserve-3d;
}

.project-card {
  --depth-scale: 1;
  --depth-tilt: 0deg;
  --depth-z: 0px;
  transform: perspective(1200px) translateZ(var(--depth-z)) rotateY(var(--depth-tilt)) scale(var(--depth-scale)) !important;
  transform-origin: 50% 50% !important;
  transition: transform .16s linear;
}

@media (max-width: 860px) {
  .services-section {
    height: 430svh;
  }

  .services-sticky {
    min-height: 0;
    padding-top: 28px;
  }

  .services-heading {
    align-items: flex-start;
    margin-bottom: 24px;
  }

  .services-heading-note {
    display: none;
  }

  .services-heading h2 {
    font-size: clamp(3rem, 12vw, 5.2rem);
  }

  .services-stage {
    width: min(calc(100% - 36px), var(--max-width));
  }

  .service-card {
    border-radius: 24px;
  }

  .service-card-head {
    gap: 16px;
    padding: 22px;
  }

  .service-icon {
    width: 58px;
    height: 58px;
  }

  .service-title-wrap h3 {
    font-size: clamp(1.35rem, 5.4vw, 2rem);
  }

  .projects-heading h2 {
    font-size: clamp(1.75rem, 6.7vw, 3.8rem) !important;
  }
}

@media (max-width: 640px) {
  .services-section {
    height: 400svh;
  }

  .services-sticky {
    padding-top: 22px;
    padding-bottom: 20px;
  }

  .services-heading {
    width: min(calc(100% - 28px), var(--max-width));
    margin-bottom: 18px;
  }

  .services-heading .eyebrow {
    margin-bottom: 7px;
  }

  .services-heading h2 {
    font-size: clamp(2.6rem, 13vw, 4.2rem);
  }

  .services-stage {
    width: min(calc(100% - 28px), var(--max-width));
  }

  .service-card {
    border-radius: 20px;
  }

  .service-card-head {
    gap: 13px;
    padding: 18px;
  }

  .service-icon {
    width: 48px;
    height: 48px;
  }

  .service-title-wrap p {
    margin-bottom: 5px;
    font-size: .58rem;
  }

  .service-title-wrap h3 {
    font-size: clamp(1.15rem, 5.6vw, 1.65rem);
  }

  .service-card-index {
    font-size: .58rem;
  }

  .projects-heading h2 {
    font-size: clamp(1.45rem, 7vw, 2.7rem) !important;
    line-height: .98;
  }
}

@media (max-height: 700px) and (min-width: 641px) {
  .services-sticky {
    padding-top: 18px;
    padding-bottom: 16px;
  }

  .services-heading {
    margin-bottom: 16px;
  }

  .services-heading-note {
    display: none;
  }

  .services-heading .eyebrow {
    margin-bottom: 6px;
  }

  .services-heading h2 {
    font-size: clamp(2.6rem, 7vw, 4.4rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .services-section {
    height: auto;
    padding: 76px 0;
  }

  .services-sticky {
    position: relative;
    top: auto;
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .services-stage {
    display: grid;
    gap: 16px;
    transform: none !important;
  }

  .service-card {
    position: relative;
    top: auto;
    right: auto;
    left: auto;
    height: auto !important;
    min-height: 420px;
    transform: none !important;
  }

  .project-card {
    transform: none !important;
  }
}
