/* ==========================================================================
   Services — scoped to .services, .service-card
   Stacked-cards-on-scroll mechanic — see assets/js/services-stack.js
   ========================================================================== */

.services {
  background: var(--prism-band);
  position: relative;
  padding-block: clamp(80px, 10vw, 128px);
  overflow: hidden; /* clip cards receding/scaling behind the pinned stack */
}

.services-intro {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin-bottom: 24px;
}

/* matches the hero's title treatment, per the client's ask */
.services-intro .section-heading {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--h3-size);
  line-height: 1.08;
  letter-spacing: -0.01em;
}

.services-intro-body {
  color: var(--prism-band-text-body);
  line-height: 1.7;
  max-width: 66ch;
}

/* ---- stacked-cards stage ---- */

.services-stack {
  position: relative;
  z-index: 1;
  /* fills the screen below the sticky header while pinned, so incoming
     cards genuinely rise from the bottom edge of the viewport rather
     than from a tight slit around the card itself */
  height: calc(100vh - 60px);
  min-height: 600px;
  margin-top: 64px;
  overflow: hidden; /* clips waiting cards (translated below) until their turn */
  border-radius: 32px; /* matches .service-card so the clip edge is invisible */
}

.service-card {
  position: absolute;
  inset: 0;
  margin: auto;
  width: min(1320px, 96vw);
  height: min(720px, 84vh);
  background: var(--prism-band-card);
  border: 1px solid var(--prism-band-border);
  border-radius: 32px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  overflow: hidden; /* clips the media panel to the card's rounded corners */
  display: flex;
  flex-direction: row;
  will-change: transform, opacity;
  scroll-margin-top: 96px;
}

.service-card-media {
  flex: 0 0 38%;
  height: 100%;
}

.service-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.service-card-content {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: clamp(28px, 4vw, 56px);
}

.service-card-head {
  flex: 0 0 auto;
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--prism-band-line);
}

.service-card-num {
  font-family: var(--font-body);
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--prism-teal);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.service-card-num em { color: var(--prism-band-text-faint); }

.service-card-title {
  font-family: var(--font-body);
  font-weight: 900; /* Outfit Black, the heaviest weight */
  font-size: clamp(22px, 2.2vw, 26px);
  color: var(--prism-band-text);
  margin: 0;
}

/* content scrolls inside the fixed-size card rather than growing it, so
   every card stays the same size no matter how much copy it holds */
.service-card-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding-right: 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--prism-band-border) transparent;
}
.service-card-body::-webkit-scrollbar { width: 6px; }
.service-card-body::-webkit-scrollbar-track { background: transparent; }
.service-card-body::-webkit-scrollbar-thumb { background: var(--prism-band-border); border-radius: 3px; }

.service-card-body p {
  color: var(--prism-band-text-body);
  line-height: 1.75;
  max-width: 66ch;
  margin: 0 0 18px;
}
.service-card-body a { color: var(--prism-teal); font-weight: 600; text-decoration: none; }
.service-card-body a:hover { text-decoration: underline; }

.service-card-kicker {
  font-weight: 500 !important;
  color: var(--prism-band-text) !important;
}

.service-card-list {
  margin: 0 0 18px;
  padding-left: 20px;
  color: var(--prism-band-text-body);
  line-height: 1.75;
  max-width: 66ch;
}
.service-card-list li { margin-bottom: 8px; }

.service-callout {
  margin-top: 24px;
  padding: 20px 24px;
  background: var(--prism-band-inset);
  border-radius: var(--radius-card);
}
.service-callout p { margin: 0; }
.service-callout-title {
  font-weight: 500 !important;
  color: var(--prism-band-text) !important;
  margin-bottom: 8px !important;
}

@media (max-width: 760px) {
  /* No pin/stack effect on mobile (assets/js/services-stack.js skips its
     GSAP setup below this breakpoint) — cards sit in normal flow and
     scroll past one another like ordinary stacked sections instead of
     transitioning over each other, which was making the incoming card's
     text unreadable mid-scroll. */
  .services-stack {
    height: auto;
    min-height: 0;
    margin-top: 40px;
    overflow: visible;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
  }
  .service-card {
    position: relative;
    inset: auto;
    margin: 0;
    width: 100%;
    /* no fixed height on mobile — each card grows to fit its own copy
       instead of clipping/scrolling text inside a shared fixed height */
    height: auto;
    flex-direction: column;
    border-radius: 24px;
  }
  .service-card-media { flex: 0 0 auto; width: 100%; height: 220px; }
  .service-card-content { padding: 20px 22px; }
  .service-card-head { flex-direction: column; align-items: flex-start; gap: 6px; }
  .service-card-body {
    overflow-y: visible;
    padding-right: 0;
  }
}
