/**
 * services.css — Services page specific styles
 * Elevated to match the home design language: navy hero with blueprint wash +
 * warm copper glow, bone-deep services ground hosting elevated cards with a
 * dual-layer shadow + growing copper hairline, sticky scroll-spy sidebar
 * (reuses global .section-nav + .eyebrow), refined activity lists.
 * Depends on: tokens.css, base.css, layout.css, card.css, link-arrow.css
 * Reuses global tokens only — no hard-coded hex/px/durations.
 */

/* ============================================================
 * PAGE HEADER (navy hero, on-dark)
 * ============================================================ */

.services-header {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--c-navy-deep);
  padding: calc(var(--sp-9) + var(--sp-7)) 0 var(--sp-8);
}

/* Whisper-quiet blueprint grid wash (echoes the home hero technical language) */
.services-header::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(184, 115, 51, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(184, 115, 51, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(120% 90% at 70% 0%, #000 35%, transparent 100%);
          mask-image: radial-gradient(120% 90% at 70% 0%, #000 35%, transparent 100%);
}

/* External blueprint asset (S1) layered faintly above the grid */
.services-header::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: url('../../assets/patterns/S1-pattern.svg');
  background-size: 480px 480px;
  background-repeat: repeat;
  opacity: 0.06;
  pointer-events: none;
}

/* Warm copper glow pocket (bottom-left), mirroring the home hero overlay */
.services-header__glow {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(60% 60% at 12% 100%, var(--hero-warm-glow), transparent 70%);
}

.services-header__inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-6);
  position: relative;
}

.services-header__text {
  flex: 1 1 auto;
  max-width: 58%;
}

/* Scrim eyebrow chip — copper-bright on dark, leading copper hairline */
.services-header__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  font-family: var(--font-sans);
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--c-copper-bright);
  margin-bottom: var(--sp-4);
  padding: var(--sp-2) var(--sp-4);
  border: 1px solid rgba(184, 115, 51, 0.35);
  border-radius: var(--radius-pill);
  background: rgba(6, 20, 41, 0.55);
  -webkit-backdrop-filter: blur(6px);
          backdrop-filter: blur(6px);
}

.services-header__eyebrow::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--c-copper);
}

.services-header__title {
  font-family: var(--font-serif);
  font-size: var(--fs-h1);
  font-weight: 600;
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
  color: var(--c-white);
  max-width: 18ch;
}

.services-header__subtitle {
  font-size: var(--fs-body);
  color: var(--c-fog);
  max-width: 52ch;
  line-height: var(--leading-body);
  margin-top: var(--sp-4);
}

/* Right-side editorial visual — reveals from the right once ready */
.services-header__visual {
  flex: 0 0 38%;
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  pointer-events: none;
  opacity: 0;
  transform: translateX(20px);
  transition:
    opacity var(--dur-long) var(--ease-out) 0.5s,
    transform var(--dur-long) var(--ease-out) 0.5s;
}

.services-header__visual.is-ready {
  opacity: 1;
  transform: translateX(0);
}

.services-header__visual img,
.services-header__visual picture {
  display: block;
  width: 100%;
  height: auto;
  max-width: 380px;
  opacity: 0.9;
  /* Feather the rectangular blueprint edges into the navy hero so the image
   * blends instead of reading as a pasted card (no drop-shadow, same reason). */
  -webkit-mask-image: radial-gradient(78% 82% at 50% 48%, #000 56%, transparent 100%);
          mask-image: radial-gradient(78% 82% at 50% 48%, #000 56%, transparent 100%);
}

@media (max-width: 900px) {
  .services-header__text { max-width: 72%; }
  .services-header__visual { flex-basis: 30%; }
}

@media (max-width: 768px) {
  .services-header__visual { display: none; }
  .services-header__inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .services-header__text { max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .services-header__visual { transition: none; }
}

/* ============================================================
 * SERVICES LAYOUT — bone-deep ground + sticky sidebar
 * ============================================================ */

.services-layout {
  position: relative;
  isolation: isolate;
  background: var(--c-bone-deep);
  /* Tightened so the last cards sit close to the diagonal seam into the CTA
   * (avoids a large flat bone gap before the navy band). */
  padding-bottom: var(--sp-6);
}

/* Whisper-quiet blueprint grid wash so white cards separate on the ground */
.services-layout::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(11, 30, 63, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11, 30, 63, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(120% 70% at 50% 0%, #000 40%, transparent 100%);
          mask-image: radial-gradient(120% 70% at 50% 0%, #000 40%, transparent 100%);
}

.services-layout__inner {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--sp-7);
  align-items: start;
}

@media (max-width: 1024px) {
  .services-layout__inner { grid-template-columns: 1fr; }
  .services-sidebar { display: none; }
}

/* Sticky scroll-spy sidebar (reuses global .section-nav scroll-spy + .eyebrow) */
.services-sidebar {
  position: sticky;
  top: calc(var(--sp-9) + var(--sp-1));
}

.services-sidebar__title {
  margin-bottom: var(--sp-4);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--c-fog-2);
}

.services-sidebar__list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.services-sidebar__item {
  padding: 0;
}

.services-sidebar__link {
  display: block;
  font-family: var(--font-sans);
  font-size: var(--fs-small);
  color: var(--c-steel);
  text-decoration: none;
  padding: var(--sp-2) var(--sp-3);
  border-left: 2px solid transparent;
  line-height: var(--leading-snug);
  transition:
    color var(--dur-short) var(--ease-out),
    border-color var(--dur-short) var(--ease-out),
    background-color var(--dur-short) var(--ease-out);
}

.services-sidebar__link:hover,
.services-sidebar__link:focus-visible,
.services-sidebar__link.is-active {
  color: var(--c-navy);
  border-left-color: var(--c-copper);
  background-color: rgba(184, 115, 51, 0.05);
}

@media (prefers-reduced-motion: reduce) {
  .services-sidebar__link { transition: none; }
}

/* ============================================================
 * SERVICES WALL GRID (2-up) + elevated cards
 * ============================================================ */

.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-5);
}

@media (max-width: 768px) {
  .services-grid { grid-template-columns: 1fr; }
}

/* Service card — echoes the global .card / .card--pillar depth language:
 * white on the bone-deep ground, navy-tint border, dual-layer shadow,
 * resting copper top-hairline that grows on hover. */
.service-card {
  position: relative;
  isolation: isolate;
  background: var(--c-white);
  border: 1px solid rgba(11, 30, 63, 0.08);
  border-radius: var(--radius-lg);
  padding: var(--sp-6) var(--sp-5) var(--sp-5);
  overflow: hidden;
  /* Anchor clicks scroll the card under the ~80px sticky header.
   * scroll-margin pushes the landing position below it so the title shows. */
  scroll-margin-top: calc(var(--sp-9) + var(--sp-1));
  box-shadow:
    0 1px 2px rgb(11 30 63 / 0.06),
    0 12px 40px rgb(11 30 63 / 0.06);
  transition:
    transform var(--dur-short) var(--ease-out),
    box-shadow var(--dur-short) var(--ease-out),
    border-color var(--dur-short) var(--ease-out);
}

/* Resting copper top-hairline (grows on hover) */
.service-card::before {
  content: '';
  position: absolute;
  left: var(--sp-5);
  top: 0;
  height: 3px;
  width: 32px;
  background: var(--c-copper);
  transform-origin: left;
  transition: width var(--dur-medium) var(--ease-out);
  z-index: 2;
}

/* Whisper-quiet blueprint texture inside the card */
.service-card::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(11, 30, 63, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11, 30, 63, 0.022) 1px, transparent 1px);
  background-size: 40px 40px;
  -webkit-mask-image: radial-gradient(120% 80% at 100% 0%, #000 0%, transparent 60%);
          mask-image: radial-gradient(120% 80% at 100% 0%, #000 0%, transparent 60%);
}

.service-card:hover {
  transform: translateY(-4px) scale(1.005);
  border-color: var(--c-fog);
  box-shadow:
    0 1px 2px rgb(11 30 63 / 0.06),
    0 20px 56px rgb(11 30 63 / 0.14),
    0 0 0 1px rgb(184 115 51 / 0.22);
}

.service-card:hover::before {
  width: 64px;
}

.service-card > * { position: relative; z-index: 1; }

/* Oversized copper numeral behind the card title */
.service-card__numeral {
  position: absolute;
  top: var(--sp-3);
  right: -8px;
  font-family: var(--font-serif);
  font-size: clamp(5rem, 9vw, 9rem);
  font-weight: 800;
  color: var(--c-copper);
  opacity: 0.07;
  line-height: 1;
  user-select: none;
  pointer-events: none;
  z-index: 0;
  transition:
    opacity var(--dur-short) var(--ease-out),
    transform var(--dur-short) var(--ease-out);
}

.service-card:hover .service-card__numeral {
  opacity: 0.12;
  transform: translateY(-4px);
}

.service-card__icon {
  width: 40px;
  height: 40px;
  display: block;
  margin-bottom: var(--sp-3);
  opacity: 0.85;
  transition:
    opacity var(--dur-short) var(--ease-out),
    transform var(--dur-medium) var(--ease-out);
}

.service-card:hover .service-card__icon {
  opacity: 1;
  transform: translateY(-3px) scale(1.03);
}

.service-card__title {
  font-family: var(--font-serif);
  font-size: var(--fs-h3);
  font-weight: 600;
  color: var(--c-navy);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-snug);
  margin-bottom: var(--sp-2);
}

/* Copper TEXT on a white surface → AA-safe --c-copper-text (never --c-copper) */
.service-card__subtitle {
  font-family: var(--font-sans);
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--c-copper-text);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  margin-bottom: var(--sp-4);
}

.service-card__intro {
  font-size: clamp(0.875rem, 1.1vw, 0.9375rem);
  line-height: var(--leading-body);
  color: var(--c-steel);
  margin-bottom: var(--sp-5);
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--c-fog-2);
}

.service-card__activities {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: var(--sp-2);
}

/* Activities unconditionally visible — no observer dependency (a11y) */
.service-card__activity {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  font-size: var(--fs-small);
  color: var(--c-ink);
  line-height: var(--leading-snug);
  opacity: 1;
  transform: none;
}

.service-card__activity::before {
  content: '';
  display: block;
  width: 5px;
  height: 5px;
  min-width: 5px;
  border-radius: 50%;
  background: var(--c-copper);
  margin-top: 0.5em;
}

@media (prefers-reduced-motion: reduce) {
  .service-card,
  .service-card::before,
  .service-card__numeral,
  .service-card__icon { transition: none; }
  .service-card:hover { transform: none; }
  .service-card:hover .service-card__numeral,
  .service-card:hover .service-card__icon { transform: none; }
}

/* CTA band styles live in css/components/cta-band.css (shared component). */

/* ============================================================
 * DIAGONAL SECTION SEAM (replicated from the home language with
 * tokens — home.css is not loaded on this page, so redeclare locally).
 * ============================================================ */
.section-divider--diagonal {
  position: relative;
  height: 80px;
  background: var(--c-bone-deep);
  clip-path: polygon(0 40%, 100% 0, 100% 100%, 0 100%);
  margin-top: -2px;
}

/* Light → dark seam (cards bone ground → navy CTA band). */
.section-divider--diagonal-dark {
  height: 80px;
  background: var(--c-navy);
  clip-path: polygon(0 0, 100% 40%, 100% 100%, 0 100%);
  margin-top: -2px;
}
