/* ==========================================================================
   Services — "Just About" (reference: 10. Services / motion 7. Other sections)
   Mobile-first; desktop composition from 768px.
   [data-reveal] elements (title, stem, list, icon) never get a CSS transform.
   ========================================================================== */

.services {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 1rem 2.25rem;
  text-align: center;
  overflow: hidden; /* fallback; the rotating ring's box must never widen the page */
}
@supports (overflow: clip) {
  .services { overflow: visible; overflow-x: clip; }
}

/* --------------------------------------------------------------------------
   Head: starburst, title, stem
   -------------------------------------------------------------------------- */
.services__head {
  position: relative;
  z-index: 1; /* title stays above the ring, which sits behind the DOM in the reference */
  display: flex;
  flex-direction: column;
  align-items: center;
}

.services__title {
  margin: 1.5rem 0 2.25rem;
  font-family: var(--serif);
  font-size: 2.4rem;
  line-height: 1;
  color: var(--champagne);
  white-space: nowrap;
}

.services__stem { display: none; }

/* --------------------------------------------------------------------------
   List + circle-text ring
   -------------------------------------------------------------------------- */
.services__list {
  position: relative;
  isolation: isolate; /* keeps the ring's z-index:-1 inside the list */
  padding: 1rem 1rem 2.25rem;
}

.services__group {
  font-family: var(--serif);
  font-size: min(9vw, 2.4rem); /* widest line (kerned) is 8.33em: 270px at 360px */
  line-height: 1.02;
  letter-spacing: -.005em;
  text-transform: uppercase;
  color: var(--pearl);
}
.services__group li { white-space: nowrap; }
.services__group + .services__group { margin-top: 2.25rem; }
.services__group--dim { color: var(--ash); opacity: .55; }

/* Ring box carries the placement (no data-reveal on it); the svg child spins.
   Parent scale is applied over the child's rotation, so text crawls an ellipse. */
.services__ring {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: -1;
  width: 150%;
  color: var(--pearl);
  opacity: .4;
  transform: translate(-50%, -50%); /* true circle on mobile: clears the horizontal title */
  pointer-events: none;
}
.services__ring svg {
  width: 100%;
  height: auto;
  animation: nct-rotate 36s linear infinite;
}
.services__ring text {
  font-family: var(--sans);
  fill: var(--pearl);
}

/* --------------------------------------------------------------------------
   Tag icon (spacing is margin only: padding would move the rotate-fade pivot)
   -------------------------------------------------------------------------- */
.services__icon {
  width: 4.5rem;
  margin-top: 3.5rem;
  color: var(--pearl);
  line-height: 0;
}
.services__icon svg { width: 100%; height: auto; }

/* --------------------------------------------------------------------------
   Desktop
   -------------------------------------------------------------------------- */
@media (min-width: 768px) {
  .services { padding: 0 var(--gutter); }

  /* writing-mode turns the glyphs 90deg clockwise without a transform, so the
     fade-up reveal keeps full control of this element's transform.
     Margins reproduce the reference's rotated span visually: sun mb 2.25rem +
     h2 mt 5rem above, span mb 1.5em below, minus the rotation overhang
     ("Just About" = 3.44em long) -> ~2.6rem above, ~1.06rem to the stem. */
  .services__title {
    margin: .69em 0 .28em;
    font-size: 3.8rem;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    inline-size: max-content; /* height = text length, independent of flex orthogonal sizing */
  }

  .services__stem {
    display: block;
    flex: none;
    width: 2px;
    height: 7vw;
  }
  .services__stem::after {
    content: "";
    display: block;
    width: 100%;
    height: 100%;
    background: var(--hair-strong);
    transform: rotate(15deg);
  }

  .services__list { padding: 1rem 2.25rem 2.25rem; }
  .services__group { font-size: 2.2rem; }

  .services__ring { transform: translate(-50%, -55%) scaleY(1.32); }

  /* reference: 4rem box at scale(1.5) under pt 8rem + mt 8rem + mb 2.25rem;
     a real 6rem box needs 1rem less on each side for the same visual gaps */
  .services__icon {
    width: 6rem;
    margin: 15rem 0 1.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .services__ring svg { animation: none; }
}
