/* ----- SERVICES PAGE ----- */

/* Creature, confined to the hero (own stacking context) */
#creature-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  z-index: 0;
  top: 0;
  left: 0;
  overflow: hidden;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ----- HERO ----- */
/* Hero tucks under the transparent header */
.services-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -72px;
  min-height: calc(100vh - 24px);
  /* Extra bottom padding: space before the first category */
  padding: calc(var(--section-padding) + 72px) var(--gutter) calc(2 * var(--section-padding));
  text-align: center;
}
body.admin-bar .services-hero {
  min-height: calc(100vh - 24px - 32px);
}
@media screen and (max-width: 782px) {
  body.admin-bar .services-hero {
    min-height: calc(100vh - 24px - 46px);
  }
}
.services-hero__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 900px;
}
.services-hero h1 {
  margin-bottom: 1.25rem;
}
.services-hero .h1-eyebrow {
  margin-inline: auto;
}
.services-hero .lead {
  max-width: 900px;
}

/* Anchor buttons */
.services-hero__anchors {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 2rem;
}

/* ----- CATEGORIES ----- */
.services-category {
  /* Keep anchor targets clear of the sticky header */
  scroll-margin-top: 90px;
}

/* No gap between categories (continuous image column) */

/* Two columns: content + image, alternating (.is-reversed) */
.services-category__layout {
  /* Distance from the container edge to the screen edge */
  --bleed-x: calc((100vw - min(100vw - 2 * var(--edge), var(--container-width))) / 2);
  display: grid;
  /* Image column = 50vw minus the bleed */
  grid-template-columns: minmax(0, 1fr) calc(50vw - var(--bleed-x));
  gap: clamp(2rem, 4vw, 4rem);
  align-items: start;
}
.services-category__layout.is-reversed {
  grid-template-columns: calc(50vw - var(--bleed-x)) minmax(0, 1fr);
}
/* Content is a size container (see @container rules below) */
.services-category__content {
  min-width: 0;
  container-type: inline-size;
}

/* Image frame: full section height, bleeds to the screen edge; the image inside is sticky */
.services-category__media {
  /* Admin bar height (0 for visitors) */
  --adminbar: 0px;
  position: relative;
  align-self: stretch;
  height: 100%;
  min-height: 100vh;
  margin: 0 calc(-1 * var(--bleed-x)) 0 0;
  overflow: clip;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  background: var(--color-primary-light);
}
/* Reversed: image on the left */
.services-category__layout.is-reversed .services-category__media {
  order: -1;
  margin: 0 0 0 calc(-1 * var(--bleed-x));
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}
body.admin-bar .services-category__media {
  --adminbar: 32px;
}
@media screen and (max-width: 782px) {
  body.admin-bar .services-category__media {
    --adminbar: 46px;
  }
}
.services-category__media img {
  position: sticky;
  top: var(--adminbar);
  display: block;
  width: 100%;
  height: calc(100vh - var(--adminbar));
  /* Negative margins: the content sets the frame height */
  margin-top: -100vh;
  margin-bottom: -100vh;
  object-fit: cover;
}

/* Category header */
/* Title, then lead and button */
.services-category__cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
.services-category__desc {
  max-width: 70ch;
}
.services-category__head .eyebrow {
  margin-bottom: 1.25rem;
  background: var(--color-accent-yellow);
  color: var(--color-text);
}
.services-category__head h2 {
  margin-bottom: 0;
  font-size: clamp(1.7rem, 1.2rem + 2vw, 3.2rem);
}
.services-category__side {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.5rem;
}
.services-category__desc {
  color: inherit;
  font-size: 1.1rem;
}
.services-category__desc strong {
  font-weight: 700;
}

/* Cards grid */
.services-grid {
  --svc-gap: 1rem;
  /* Total spacing between blocks */
  --svc-spacing: clamp(2.5rem, 4vw, 4rem);
  display: flex;
  flex-direction: column;
  /* Half spacing before the first card */
  margin-top: calc(var(--svc-spacing) / 2);
}
/* Card: intro on full width, then pros / cons columns */
.svc-card {
  --svc-pad: clamp(1.25rem, 2.2vw, 2rem);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--svc-gap);
  /* Top rule between cards */
  padding-block: calc(var(--svc-spacing) / 2);
  border-top: 1px solid var(--color-border);
}
.svc-card:last-child {
  padding-bottom: 0;
}
.svc-card__main {
  grid-column: 1 / -1;
}
.svc-card__main {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
/* Tech label */
.svc-card .eyebrow {
  align-self: flex-start;
  margin-bottom: 0;
}
.svc-card__text h3 {
  margin-bottom: 0.8rem;
  font-size: clamp(1.3rem, 1.1rem + 0.8vw, 1.9rem);
}
.svc-card__text p {
  color: var(--color-text-muted);
}
/* Highlighted text */
.svc-card__text strong {
  color: var(--color-text);
  font-weight: 700;
}
/* Lists wrapper disappears: pros and cons become grid columns */
.svc-card__lists {
  display: contents;
}
.svc-list {
  padding: var(--svc-pad);
  border-radius: var(--radius-md);
}
.svc-list--pros {
  background: color-mix(
    in srgb,
    color-mix(in srgb, var(--color-accent-green) 40%, #fff) 92%,
    transparent
  );
}
.svc-list--cons {
  background: color-mix(in srgb, var(--color-primary-light) 92%, transparent);
}
.svc-list h4 {
  margin-bottom: 0.6rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.svc-list ul {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.svc-list li {
  position: relative;
  padding-left: 1.5rem;
  font-size: 0.92rem;
}
.svc-list li::before {
  position: absolute;
  left: 0;
  font-weight: 700;
}
.svc-list--pros li::before {
  content: "✓";
  color: #2f7a49;
}
.svc-list--cons li::before {
  content: "–";
  color: var(--color-primary-dark);
}

/* Space before the CTA block */
.services-page .cta-section {
  margin-top: var(--section-padding);
}

/* Narrow content column: lists stack */
@container (max-width: 560px) {
  .svc-card {
    grid-template-columns: 1fr;
  }
}

/* ----- LARGE SCREENS (> 1024px) ----- */
@media (min-width: 1025px) {
  .services-category__media,
  .services-category__layout.is-reversed .services-category__media {
    border-radius: 0;
  }
  .services-hero + .services-category .services-category__media {
    border-top-left-radius: var(--radius-md);
  }
  .services-hero + .services-category .is-reversed .services-category__media {
    border-top-left-radius: 0;
    border-top-right-radius: var(--radius-md);
  }
  .services-category:last-of-type .services-category__media {
    border-bottom-left-radius: var(--radius-md);
  }
  .services-category:last-of-type .is-reversed .services-category__media {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: var(--radius-md);
  }

  .services-category__content {
    padding-block: var(--section-padding);
  }
  .services-hero + .services-category .services-category__content {
    padding-top: calc(var(--section-padding) / 3);
  }
  .services-category:last-of-type .services-category__content {
    padding-bottom: 0;
  }
}

/* ----- TABLET AND MOBILE (<= 1024px) ----- */
@media (max-width: 1024px) {
  /* Spacing between categories restored */
  .services-category + .services-category {
    margin-top: var(--section-padding);
  }
  .services-category__layout,
  .services-category__layout.is-reversed {
    grid-template-columns: 1fr;
  }
  .services-category__media,
  .services-category__layout.is-reversed .services-category__media {
    position: relative;
    order: -1;
    align-self: auto;
    height: clamp(16rem, 50vh, 30rem);
    min-height: 0;
    /* Full-bleed image, no radius */
    margin: 0 calc(-1 * var(--edge));
    border-radius: 0;
  }
  /* Normal (non-sticky) image */
  .services-category__media img {
    position: static;
    height: 100%;
    margin: 0;
  }
}

/* Mobile: text stays at --gutter, blocks bleed by --bleed */
@media (max-width: 768px) {
  .svc-card {
    margin-inline: calc(-1 * var(--bleed));
  }
  .svc-card__main,
  .svc-list {
    padding-inline: var(--bleed);
  }

}

/* ----- PROCESS ----- */
.services-process {
  margin-top: var(--section-padding);
  /* Keep the anchor target clear of the sticky header */
  scroll-margin-top: 90px;
}

/* Header: everything stacked and centered */
.services-process__head {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 52rem;
  margin-inline: auto;
  text-align: center;
}
.services-process__side p {
  color: var(--color-text-muted);
  font-size: 1.1rem;
}

/* Service switch */
.services-process__tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 1.5rem;
}
/* Native button reset (the .btn look comes from style.css); inactive = faded */
.services-process__tabs button.btn {
  padding-block: 0;
  padding-left: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.2s ease;
}
.services-process__tabs button.btn[aria-selected="true"],
.services-process__tabs button.btn:hover {
  opacity: 1;
}

/* Phase cards: big faint number in the background */
.process-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.25rem;
  margin: clamp(2rem, 4vw, 3rem) 0 0;
  padding: 0;
  list-style: none;
}
.process-card {
  position: relative;
  overflow: hidden;
  padding: 2rem 1.75rem;
  border-radius: 2rem;
  background: var(--color-primary-light);
}

/* Digit height = 90% of the card height (size container, cqh units) */
.process-card__num {
  position: absolute;
  inset: 0;
  container-type: size;
  pointer-events: none;
}
.process-card__num span {
  position: absolute;
  bottom: -26.18cqh;
  right: -0.1em;
  font-size: 136.36cqh;
  font-weight: 700;
  line-height: 1;
  color: var(--color-primary);
  opacity: 0.08;
}
.process-card__icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: 1.25rem;
  border-radius: var(--radius-md);
  background: var(--color-primary-dark);
  color: #fff;
}
.process-card__icon svg {
  width: 1.5rem;
  height: 1.5rem;
}
.process-card h3 {
  position: relative;
  font-size: 1.5rem;
}
.process-card__intro {
  position: relative;
  margin-top: 0.5rem;
  color: var(--color-text-muted);
}

/* Sub-steps as bullet points */
.process-card__steps {
  position: relative;
  display: grid;
  gap: 0.9rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.95rem;
  color: var(--color-text-muted);
}
.process-card__steps li {
  padding-left: 1.1rem;
  background: radial-gradient(circle, var(--color-primary) 0 3px, transparent 3.5px) 0 0.55em / 0.5rem 0.5rem no-repeat;
}
.process-card__steps strong {
  color: var(--color-text);
}

/* ----- FAQ ----- */
.services-faq {
  margin-top: var(--section-padding);
  scroll-margin-top: 90px;
}
/* Two columns (title 1/3, questions 2/3); top rule equidistant from the process
   section (margin above) and the content (padding below) */
.services-faq .container {
  padding-top: var(--section-padding);
  border-top: 1px solid var(--color-border);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 2rem clamp(2rem, 6vw, 6rem);
  align-items: start;
}
.faq {
  border-bottom: 1px solid var(--color-border);
}
.faq__item {
  border-top: 1px solid var(--color-border);
}
.faq__item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.25rem;
  font-size: 1.15rem;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}
.faq__item summary::-webkit-details-marker {
  display: none;
}
/* Plus / minus indicator */
.faq__item summary::after {
  content: "+";
  flex-shrink: 0;
  font-size: 1.6rem;
  font-weight: 400;
  line-height: 1;
  color: var(--color-primary);
}
.faq__item[open] summary::after {
  content: "–";
}
.faq__answer {
  padding-bottom: 1.5rem;
  color: var(--color-text-muted);
}
.faq__answer p + p,
.faq__answer ul,
.faq__answer ol {
  margin-top: 0.75rem;
}
.faq__answer ul,
.faq__answer ol {
  padding-left: 1.25rem;
  list-style: revert;
}
.faq__answer a {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

/* ----- FAQ (<= 768px) ----- */
@media (max-width: 768px) {
  .services-faq .container {
    grid-template-columns: 1fr;
  }
}
