/* Services page — Hero + Section blocks (tokens from config.css :root) */

/* —— Hero (locked) —— */

.services-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100dvh - var(--header-height));
  width: 100%;
  padding: clamp(1.5rem, 5vh, 3.5rem) var(--chrome-pad-x);
}

.services-hero::before {
  content: "";
  position: absolute;
  inset: -12%;
  z-index: -1;
  background:
    radial-gradient(
      95% 75% at 50% 38%,
      rgba(94, 58, 140, 0.36),
      transparent 60%
    ),
    radial-gradient(
      60% 50% at 82% 18%,
      rgba(0, 174, 239, 0.18),
      transparent 52%
    ),
    radial-gradient(
      50% 45% at 14% 78%,
      rgba(212, 175, 55, 0.14),
      transparent 50%
    ),
    radial-gradient(
      40% 35% at 48% 62%,
      rgba(0, 174, 239, 0.06),
      transparent 55%
    ),
    radial-gradient(
      35% 30% at 55% 28%,
      rgba(212, 175, 55, 0.07),
      transparent 50%
    );
  background-size: 118% 118%;
  background-position: 50% 50%;
  animation: services-hero-drift calc(var(--motion-ambient) * 1.25) ease-in-out
    infinite alternate;
}

.services-hero__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: clamp(1.25rem, 3.5vh, 2rem);
  max-width: min(40rem, 100%);
  width: 100%;
}

.services-hero__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 5.6vw, 3.5625rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: 0.01em;
  color: var(--color-text);
  animation: services-enter var(--motion-enter) var(--ease-out) both;
}

.services-hero__support {
  margin: 0;
  font-family: var(--font-ui);
  font-size: clamp(1.1875rem, 2.3vw, 1.375rem);
  line-height: 1.55;
  color: var(--color-text-muted);
  animation: services-enter var(--motion-enter) var(--ease-out) 80ms both;
}

.services-hero__cta {
  margin: 0.35rem 0 0;
  animation: services-enter var(--motion-enter) var(--ease-out) 140ms both;
}

/* .services-hero__cta-link alias — paint owned by .site-cta in config.css */

@keyframes services-enter {
  from {
    opacity: 0;
    transform: translateY(0.6rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes services-hero-drift {
  from {
    background-position: 48% 46%;
  }
  to {
    background-position: 54% 52%;
  }
}

/* —— Shared section chrome —— */

.services-section {
  width: 100%;
  padding: clamp(3rem, 8vh, 5.5rem) var(--chrome-pad-x);
  border-top: 1px solid var(--color-border);
  /* Header veil bleeds past the phone side padding; clip it at the viewport edge */
  overflow-x: clip;
}

.services-section__inner {
  max-width: 64rem;
  margin: 0 auto;
}

.services-section__inner--narrow {
  max-width: 40rem;
}

.services-section__header {
  margin: 0 0 clamp(1.75rem, 4vh, 2.5rem);
  max-width: 36rem;
}

.services-section__eyebrow {
  margin: 0 0 0.65rem;
  font-family: var(--font-ui);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-gold);
}

.services-section__title {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(1.9375rem, 3.7vw, 2.5625rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-text);
}

.services-section__lead {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 1.1875rem;
  line-height: 1.6;
  color: var(--color-text-muted);
}

/* —— Site types —— */

/* Triptych: three arched portals, each lit from within by its own brand light;
   the middle one stands a little taller. A faint horizon runs past both ends. */
.services-types__list {
  --portal-crown: 7.5rem;
  --portal-raise: 1.75rem;
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0 0 1.5rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.services-types__list::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.5rem;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    rgba(226, 201, 106, 0.45) 20%,
    rgba(226, 201, 106, 0.45) 80%,
    transparent
  );
  pointer-events: none;
}

.services-types__item {
  --portal-rgb: 155, 126, 196;
  --portal-glow: rgba(94, 58, 140, 0.42);
  --portal-ink: var(--color-amethyst-soft);
  position: relative;
  margin-top: var(--portal-raise);
  padding: 4rem 1.5rem 1.75rem;
  border: 1px solid rgba(var(--portal-rgb), 0.5);
  border-radius: 50% 50% 0.35rem 0.35rem / var(--portal-crown)
    var(--portal-crown) 0.35rem 0.35rem;
  background:
    radial-gradient(120% 60% at 50% 0%, var(--portal-glow), transparent 70%),
    linear-gradient(to bottom, rgba(20, 18, 26, 0.72), rgba(11, 10, 15, 0.88));
  text-align: center;
}

.services-types__item:nth-child(2) {
  --portal-rgb: 226, 201, 106;
  --portal-glow: rgba(212, 175, 55, 0.2);
  --portal-ink: var(--color-gold-soft);
  margin-top: 0;
  margin-bottom: var(--portal-raise);
}

.services-types__item:nth-child(3) {
  --portal-rgb: 92, 207, 245;
  --portal-glow: rgba(0, 174, 239, 0.17);
  --portal-ink: var(--color-cyan-soft);
}

/* Inner frame: a second hairline arch, so each panel reads as a window */
.services-types__item::before {
  content: "";
  position: absolute;
  inset: 0.5rem;
  border: 1px solid rgba(var(--portal-rgb), 0.18);
  border-radius: 50% 50% 0.2rem 0.2rem / calc(var(--portal-crown) - 0.5rem)
    calc(var(--portal-crown) - 0.5rem) 0.2rem 0.2rem;
  pointer-events: none;
}

/* Keystone at the crown */
.services-types__item::after {
  content: "";
  position: absolute;
  top: -0.3rem;
  left: calc(50% - 0.3rem);
  width: 0.6rem;
  height: 0.6rem;
  background: var(--portal-ink);
  box-shadow: 0 0 0 3px rgba(var(--portal-rgb), 0.14);
  transform: rotate(45deg);
  animation: services-types-keystone calc(var(--motion-ambient) * 0.15)
    ease-in-out 2 alternate forwards;
}

.services-types__item:nth-child(2)::after {
  animation-delay: -0.78s;
}

.services-types__item:nth-child(3)::after {
  animation-delay: -1.56s;
}

/* Two out-and-back breaths, then rest on the first keyframe (WCAG 2.2.2: still within ~5s) */
@keyframes services-types-keystone {
  from {
    box-shadow: 0 0 0 3px rgba(var(--portal-rgb), 0.12);
  }
  to {
    box-shadow:
      0 0 0 4px rgba(var(--portal-rgb), 0.2),
      0 0 14px rgba(var(--portal-rgb), 0.45);
  }
}

.services-types__name {
  position: relative;
  margin: 0 0 0.65rem;
  padding: 0 1rem;
  text-wrap: balance;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--portal-ink);
}

.services-types__fit {
  position: relative;
  margin: 0 0 1.25rem;
  font-family: var(--font-ui);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--color-text-muted);
}

.services-types__points {
  position: relative;
  list-style: none;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  padding: 1.1rem 0 0;
  border-top: 1px solid rgba(var(--portal-rgb), 0.22);
  display: grid;
  gap: 0.6rem;
  text-align: left;
}

.services-types__points li {
  font-family: var(--font-ui);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--color-text);
}

.services-types__points--in li {
  position: relative;
  padding-left: 1.4rem;
}

.services-types__points--in li::before {
  content: "";
  position: absolute;
  left: 0.2rem;
  top: 0.6rem;
  width: 0.45rem;
  height: 0.45rem;
  box-sizing: border-box;
  border: 1px solid var(--portal-ink);
  transform: rotate(45deg);
}

@media (max-width: 60rem) {
  .services-types__list {
    grid-template-columns: minmax(0, 1fr);
    max-width: 34rem;
    margin: 0 auto;
    gap: 2.25rem;
  }

  .services-types__item:nth-child(n) {
    margin-top: 0;
    margin-bottom: 0;
  }
}

/* —— Always included —— */

.services-included {
  background: radial-gradient(
    70% 60% at 10% 20%,
    rgba(94, 58, 140, 0.16),
    transparent 55%
  );
}

.services-included__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.services-included__item {
  position: relative;
  padding: 0.35rem 0 0.35rem 1.35rem;
  font-family: var(--font-ui);
  font-size: 1.1875rem;
  line-height: 1.65;
  color: var(--color-text);
}

.services-included__item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.85rem;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--color-cyan);
  box-shadow: 0 0 0 3px rgba(0, 174, 239, 0.18);
}

.services-included__item--emphasis {
  font-weight: 600;
  color: var(--color-gold-soft);
}

/* —— Care —— */

.services-care__paths {
  display: grid;
  gap: 2rem;
}

.services-care__path-name {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--color-gold-soft);
}

.services-care__path-fit {
  margin: 0 0 1.25rem;
  font-family: var(--font-ui);
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--color-text-muted);
  max-width: 40rem;
}

.services-care__bags {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem 1.75rem;
}

.services-care__bag {
  padding: 0 0 0 1rem;
}

.services-care__bag--in {
  border-left: 2px solid var(--color-gold-soft);
}

.services-care__bag--out {
  border-left: 2px solid var(--color-amethyst-soft);
}

.services-care__bag-label {
  margin: 0 0 0.55rem;
  font-family: var(--font-ui);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.services-care__points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.services-care__points li {
  font-family: var(--font-ui);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--color-text);
}

.services-care__bag--in .services-care__points li,
.services-care__bag--out .services-care__points li {
  position: relative;
  padding-left: 1.4rem;
}

.services-care__bag--in .services-care__points li::before,
.services-care__bag--out .services-care__points li::before {
  content: "";
  position: absolute;
  left: 0.2rem;
  top: 0.55rem;
  width: 0.45rem;
  height: 0.45rem;
  box-sizing: border-box;
  background: transparent;
  transform: rotate(45deg);
}

.services-care__bag--in .services-care__points li::before {
  border: 1px solid var(--color-gold-soft);
}

.services-care__bag--out .services-care__points li::before {
  border: 1px solid var(--color-amethyst-soft);
}

.services-care__bag--out .services-care__points li::after {
  content: "";
  position: absolute;
  left: 0.1rem;
  top: 0.75rem;
  width: 0.65rem;
  height: 1px;
  background: var(--color-amethyst-soft);
}

/* —— Grow —— */

/* Path of light: the upkeep rule is the trailhead; a rail draws down from it and
   each option is a waypoint that burns a little brighter than the one before. */
.services-grow .services-section__header {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.services-grow__rule {
  position: relative;
  max-width: 38rem;
  margin: 0 auto;
  padding: 1.1rem 1.5rem;
  border: 1px solid var(--color-border-strong);
  border-radius: 0.35rem;
  background: var(--color-obsidian-raised);
  box-shadow: inset 0 1px 0 rgba(226, 201, 106, 0.28);
  text-align: center;
  font-family: var(--font-ui);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--color-text);
}

.services-grow__list {
  --grow-gutter: 4rem;
  position: relative;
  list-style: none;
  margin: 0;
  padding: 2.75rem 0 0.5rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--grow-gutter);
  row-gap: 1rem;
}

.services-grow__list::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(50% - 1px);
  width: 2px;
  background: linear-gradient(
    to bottom,
    var(--color-border-strong),
    var(--color-gold-soft) 55%,
    var(--color-cyan-soft)
  );
  transform-origin: top;
  transform: scaleY(0);
  transition: transform calc(var(--motion-enter) * 2.5) var(--ease-out);
}

.services-grow.is-revealed .services-grow__list::before {
  transform: scaleY(1);
}

.services-grow__item {
  --step: 1;
  --marker: calc(0.45rem + var(--step) * 0.07rem);
  position: relative;
  padding: 1.1rem 1.35rem;
  border: 1px solid rgba(212, 175, 55, calc(0.1 + var(--step) * 0.05));
  border-radius: 0.35rem;
  background: linear-gradient(
    135deg,
    rgba(212, 175, 55, calc(var(--step) * 0.022)),
    rgba(0, 174, 239, calc(var(--step) * 0.012)) 60%,
    rgba(20, 18, 26, 0.6)
  );
}

.services-grow__item:nth-child(1) {
  --step: 1;
  grid-column: 1;
  grid-row: 1 / span 2;
}

.services-grow__item:nth-child(2) {
  --step: 2;
  grid-column: 2;
  grid-row: 2 / span 2;
}

.services-grow__item:nth-child(3) {
  --step: 3;
  grid-column: 1;
  grid-row: 3 / span 2;
}

.services-grow__item:nth-child(4) {
  --step: 4;
  grid-column: 2;
  grid-row: 4 / span 2;
}

.services-grow__item:nth-child(5) {
  --step: 5;
  grid-column: 1;
  grid-row: 5 / span 2;
}

.services-grow__item:nth-child(6) {
  --step: 6;
  grid-column: 2;
  grid-row: 6 / span 2;
}

/* Waypoint marker on the rail */
.services-grow__item::before {
  content: "";
  position: absolute;
  top: 1.45rem;
  width: var(--marker);
  height: var(--marker);
  border: 1px solid var(--color-gold-soft);
  background: rgba(226, 201, 106, calc(var(--step) * 0.16));
  box-shadow: 0 0 calc(var(--step) * 2px) rgba(92, 207, 245, 0.35);
  transform: rotate(45deg);
}

/* Connector from card to rail */
.services-grow__item::after {
  content: "";
  position: absolute;
  top: calc(1.45rem + var(--marker) / 2);
  width: calc(var(--grow-gutter) / 2 - var(--marker) / 2 - 0.35rem);
  height: 1px;
  background: rgba(226, 201, 106, calc(0.2 + var(--step) * 0.06));
}

.services-grow__item:nth-child(odd)::before {
  right: calc(-1 * var(--grow-gutter) / 2 - var(--marker) / 2 - 1px);
}

.services-grow__item:nth-child(odd)::after {
  left: calc(100% + 1px);
}

.services-grow__item:nth-child(even)::before {
  left: calc(-1 * var(--grow-gutter) / 2 - var(--marker) / 2 - 1px);
}

.services-grow__item:nth-child(even)::after {
  right: calc(100% + 1px);
}

.services-grow__item:last-child::before {
  background: var(--color-gold-soft);
  animation: services-grow-beacon calc(var(--motion-ambient) * 0.15) ease-in-out
    2 alternate forwards;
}

/* Two out-and-back breaths, then rest on the first keyframe (WCAG 2.2.2: still within ~5s) */
@keyframes services-grow-beacon {
  from {
    box-shadow: 0 0 6px rgba(92, 207, 245, 0.3);
  }
  to {
    box-shadow:
      0 0 0 4px rgba(212, 175, 55, 0.14),
      0 0 16px rgba(92, 207, 245, 0.5);
  }
}

.services-grow__name {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-gold-soft);
}

.services-grow__fit {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--color-text-muted);
}

@media (max-width: 52rem) {
  .services-grow__rule {
    text-align: left;
  }

  .services-grow__list {
    --grow-gutter: 2.5rem;
    grid-template-columns: minmax(0, 1fr);
    padding-left: var(--grow-gutter);
    row-gap: 1.1rem;
  }

  .services-grow__list::before {
    left: calc(var(--grow-gutter) / 2 - 1px);
  }

  .services-grow__item:nth-child(n) {
    grid-column: 1;
    grid-row: auto;
  }

  .services-grow__item:nth-child(n)::before {
    left: calc(-1 * var(--grow-gutter) / 2 - var(--marker) / 2 - 1px);
    right: auto;
  }

  .services-grow__item:nth-child(n)::after {
    left: auto;
    right: calc(100% + 1px);
  }
}

/* —— FAQ —— */

.services-faq__list {
  display: grid;
  gap: 0.65rem;
}

.services-faq__item {
  border-bottom: 1px solid var(--color-border);
}

.services-faq__item:first-child {
  border-top: 1px solid var(--color-border);
}

.services-faq__question {
  list-style: none;
  padding: 1rem 0;
  font-family: var(--font-ui);
  font-size: 1.1875rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--color-text);
  transition: color var(--motion-fast) var(--ease-out);
}

.services-faq__question::-webkit-details-marker {
  display: none;
}

.services-faq__question::marker {
  content: "";
}

.services-faq__question::after {
  content: "+";
  float: right;
  margin-left: 1rem;
  font-weight: 500;
  color: var(--color-gold-soft);
}

.services-faq__item[open] .services-faq__question::after {
  content: "–";
}

.services-faq__question:hover,
.services-faq__question:focus-visible {
  color: var(--color-gold-soft);
}

.services-faq__answer {
  margin: 0 0 1.1rem;
  padding: 0 1.5rem 0 0;
  font-family: var(--font-ui);
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--color-text-muted);
}

/* —— Soft close —— */

.services-close {
  text-align: center;
  background: radial-gradient(
    80% 70% at 50% 100%,
    rgba(212, 175, 55, 0.1),
    transparent 55%
  );
}

.services-close__inner .services-section__title,
.services-close__inner .services-section__lead {
  margin-left: auto;
  margin-right: auto;
}

.services-close__inner .services-section__title {
  margin-bottom: 0.75rem;
}

.services-close__inner .services-section__lead {
  margin-bottom: 1.75rem;
}

.services-close__cta {
  margin: 0;
}

/* .services-close__cta-link paint → .site-cta in config.css */

/* —— Responsive —— */

@media (max-width: 40rem) {
  .services-care__bags {
    grid-template-columns: 1fr;
  }

  .services-types__list {
    --portal-crown: 6rem;
  }

  .services-types__item {
    padding: 3.5rem 1.25rem 1.5rem;
  }
}

/* —— Motion: scroll reveals (same family as Home; services-* names) —— */

@keyframes services-section-veil {
  0% {
    opacity: 0;
    transform: scale(0.92);
  }
  40% {
    opacity: 0.85;
    transform: scale(1.02);
  }
  100% {
    opacity: 0.32;
    transform: scale(1);
  }
}

.page-services [data-reveal] {
  opacity: 0;
  transform: translateY(0.85rem);
  transition:
    opacity var(--motion-enter) var(--ease-out),
    transform var(--motion-enter) var(--ease-out);
}

.page-services [data-reveal].is-revealed {
  opacity: 1;
  transform: translateY(0);
}

.services-section[data-reveal] .services-section__header {
  position: relative;
  isolation: isolate;
}

.services-section[data-reveal] .services-section__header::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -1.25rem -1.5rem -0.75rem -1rem;
  border-radius: 0.35rem;
  background: radial-gradient(
    70% 80% at 20% 40%,
    rgba(94, 58, 140, 0.38),
    transparent 68%
  );
  opacity: 0;
  pointer-events: none;
}

.services-section[data-reveal].is-revealed .services-section__header::before {
  animation: services-section-veil calc(var(--motion-enter) * 1.35)
    var(--ease-out) both;
}

.page-services [data-reveal-stagger] > * {
  opacity: 0;
  transform: translateY(0.55rem);
  transition:
    opacity var(--motion-enter) var(--ease-out),
    transform var(--motion-enter) var(--ease-out);
}

.page-services
  [data-reveal].is-revealed
  [data-reveal-stagger]
  > *:nth-child(1) {
  transition-delay: 0ms;
}
.page-services
  [data-reveal].is-revealed
  [data-reveal-stagger]
  > *:nth-child(2) {
  transition-delay: 70ms;
}
.page-services
  [data-reveal].is-revealed
  [data-reveal-stagger]
  > *:nth-child(3) {
  transition-delay: 140ms;
}
.page-services
  [data-reveal].is-revealed
  [data-reveal-stagger]
  > *:nth-child(4) {
  transition-delay: 210ms;
}
.page-services
  [data-reveal].is-revealed
  [data-reveal-stagger]
  > *:nth-child(5) {
  transition-delay: 280ms;
}
.page-services
  [data-reveal].is-revealed
  [data-reveal-stagger]
  > *:nth-child(6) {
  transition-delay: 350ms;
}
.page-services
  [data-reveal].is-revealed
  [data-reveal-stagger]
  > *:nth-child(7) {
  transition-delay: 420ms;
}
.page-services
  [data-reveal].is-revealed
  [data-reveal-stagger]
  > *:nth-child(8) {
  transition-delay: 490ms;
}
.page-services
  [data-reveal].is-revealed
  [data-reveal-stagger]
  > *:nth-child(9) {
  transition-delay: 560ms;
}
.page-services
  [data-reveal].is-revealed
  [data-reveal-stagger]
  > *:nth-child(10) {
  transition-delay: 630ms;
}
.page-services
  [data-reveal].is-revealed
  [data-reveal-stagger]
  > *:nth-child(11) {
  transition-delay: 700ms;
}

.page-services [data-reveal].is-revealed [data-reveal-stagger] > * {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .services-hero::before,
  .services-hero__title,
  .services-hero__support,
  .services-hero__cta {
    animation: none;
  }

  .services-hero__title,
  .services-hero__support,
  .services-hero__cta {
    opacity: 1;
    transform: none;
  }

  .services-section[data-reveal] .services-section__header::before {
    animation: none !important;
    opacity: 0.22;
  }

  .page-services [data-reveal],
  .page-services [data-reveal].is-revealed,
  .page-services [data-reveal-stagger] > * {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .services-grow__list::before {
    transform: none;
    transition: none;
  }

  .services-grow__item:last-child::before {
    animation: none;
  }

  .services-types__item::after {
    animation: none;
  }
}
