/* ═══════════════════════════════════════════════
   SECTION: SERVICES — Vertical Timeline Conveyor
   "Exploded Product Anatomy" meets "Process Conveyor"
   creativity: 85 · layout_structure: 92 · immersivity: 88
   ═══════════════════════════════════════════════ */

/* ─── Section Base ─── */
.services {
  position: relative;
  padding: clamp(5rem, 10vw, 8rem) 0 clamp(5rem, 10vw, 7rem);
  background: var(--bg-primary);
  overflow: hidden;
}

/* Atmospheric side glows */
.services__atmosphere {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 30% 55% at 15% 35%, rgba(142,153,164,0.03) 0%, transparent 70%),
    radial-gradient(ellipse 30% 55% at 85% 65%, rgba(142,153,164,0.03) 0%, transparent 70%),
    radial-gradient(ellipse 50% 25% at 50% 90%, rgba(142,153,164,0.02) 0%, transparent 60%);
  pointer-events: none;
}

/* Subtle ruled-grid background */
.services::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(180, 172, 162, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(180, 172, 162, 0.07) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 75% 65% at 50% 50%, black 10%, transparent 60%);
  -webkit-mask-image: radial-gradient(ellipse 75% 65% at 50% 50%, black 10%, transparent 60%);
  pointer-events: none;
}

/* ─── Section Header ─── */
.services__header {
  text-align: center;
  margin-bottom: clamp(4rem, 8vw, 7rem);
  position: relative;
  z-index: 2;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding: 0 var(--container-padding);
}

.services__eyebrow {
  font-family: var(--font-body);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.5rem;
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  /* Premium: Enhanced anti-aliasing */
  -webkit-font-smoothing: antialiased;
}

.services__eyebrow::before,
.services__eyebrow::after {
  content: '';
  display: block;
  width: 30px;
  height: 1px;
  background: var(--accent-dim);
}

.services__title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 900;
  color: var(--fg-primary);
  line-height: 1.15;
  text-rendering: optimizeLegibility;
  font-optical-sizing: auto;
}

.services__title em {
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}

/* ─── Header Reveal (clip-path wipe) ─── */
.services__header[data-svc-header] .services__eyebrow,
.services__header[data-svc-header] .services__title {
  clip-path: inset(0 100% 0 0);
  opacity: 0;
  transition: clip-path 1s var(--ease-out-expo), opacity 0.6s var(--ease-out-expo);
}

.services__header[data-svc-header].svc-header-revealed .services__eyebrow {
  clip-path: inset(0 0% 0 0);
  opacity: 1;
}

.services__header[data-svc-header].svc-header-revealed .services__title {
  clip-path: inset(0 0% 0 0);
  opacity: 1;
  transition-delay: 0.2s;
}

/* ─── Conveyor Container ─── */
.services__conveyor {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

/* ─── The Spine (vertical copper rail) ─── */
.services__spine {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border);
  transform: translateX(-50%);
  z-index: 1;
}

/* Spine fill — animated by JS (scaleY 0→1) */
.services__spine-fill {
  position: absolute;
  top: 0;
  left: -1px;
  width: 3px;
  height: 100%;
  background: linear-gradient(
    180deg,
    transparent 0%,
    var(--accent-light) 8%,
    var(--accent) 25%,
    var(--accent) 75%,
    var(--accent-light) 92%,
    transparent 100%
  );
  transform-origin: top;
  transform: scaleY(0);
  will-change: transform;
}

/* ─── Station Base ─── */
.services__station {
  display: grid;
  grid-template-columns: 1fr 1fr;
  position: relative;
  padding: clamp(2rem, 4vw, 3.5rem) 0;
}

/* ─── Spine Node (copper diamond) ─── */
.services__node {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 14px;
  background: var(--accent);
  z-index: 4;
  transform: translate(-50%, -50%) rotate(45deg) scale(0);
  will-change: transform;
  box-shadow:
    0 0 0 3px var(--bg-primary),
    0 0 0 4px var(--accent-dim);
}

.services__node.svc-node-visible {
  transform: translate(-50%, -50%) rotate(45deg) scale(1);
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.services__node.svc-node-pulse {
  animation: svcNodePulse 0.6s var(--ease-out-expo);
}

@keyframes svcNodePulse {
  0%   { transform: translate(-50%, -50%) rotate(45deg) scale(1); box-shadow: 0 0 0 3px var(--bg-primary), 0 0 0 4px var(--accent-dim); }
  50%  { transform: translate(-50%, -50%) rotate(45deg) scale(1.5); box-shadow: 0 0 0 4px var(--bg-primary), 0 0 0 6px var(--accent), 0 0 20px rgba(142,153,164,0.2); }
  100% { transform: translate(-50%, -50%) rotate(45deg) scale(1); box-shadow: 0 0 0 3px var(--bg-primary), 0 0 0 4px var(--accent-dim); }
}

/* Node glow on station hover */
.services__station:hover .services__node {
  box-shadow:
    0 0 0 3px var(--bg-primary),
    0 0 0 5px var(--accent),
    0 0 15px rgba(142,153,164,0.15);
  transition: box-shadow 0.4s var(--ease-out-expo);
}

/* ─── Connector Line (spine → content) ─── */
.services__connector {
  position: absolute;
  top: 50%;
  height: 1px;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  opacity: 0.35;
  z-index: 2;
  transform: scaleX(0);
  will-change: transform;
}

.services__connector.svc-connector-visible {
  transform: scaleX(1);
  transition: transform 0.7s var(--ease-out-expo) 0.2s;
}

/* Left station: connector goes LEFT from node */
.services__station--left .services__connector {
  right: 50%;
  width: 4rem;
  transform-origin: right center;
}

/* Right station: connector goes RIGHT from node */
.services__station--right .services__connector {
  left: 50%;
  width: 4rem;
  transform-origin: left center;
}

/* ─── Visual Zone (watermark number + enlarged icon + ornament) ─── */
.services__visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  overflow: visible;
}

/* LEFT station → visual on RIGHT (column 2) */
.services__station--left .services__visual {
  grid-column: 2;
  grid-row: 1;
  padding-left: 4.5rem;
}

/* RIGHT station → visual on LEFT (column 1) */
.services__station--right .services__visual {
  grid-column: 1;
  grid-row: 1;
  padding-right: 4.5rem;
  justify-self: end;
}

/* ─── Watermark Number ─── */
.services__number {
  position: absolute;
  font-family: var(--font-display);
  font-size: clamp(5rem, 10vw, 9rem);
  font-weight: 900;
  color: var(--fg-primary);
  opacity: 0.035;
  line-height: 1;
  user-select: none;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
  will-change: transform;
}

.services__station--left .services__number {
  left: 10%;
}

.services__station--right .services__number {
  right: 10%;
}

/* Hero station: dramatically larger number */
.services__station--hero .services__number {
  font-size: clamp(7rem, 14vw, 13rem);
  opacity: 0.05;
}

/* ─── Enlarged Decorative Icon ─── */
.services__icon {
  position: relative;
  z-index: 1;
}

.services__icon svg {
  width: 52px;
  height: 52px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 1;
  transition: stroke 0.4s ease, transform 0.5s var(--ease-out-expo);
}

.services__station:hover .services__icon svg {
  stroke: var(--accent-light);
  transform: scale(1.12);
}

/* Hero station — even larger icon */
.services__station--hero .services__icon svg {
  width: 74px;
  height: 74px;
  stroke-width: 0.8;
}

/* ─── Station Ornaments (unique per service) ─── */
.services__ornament {
  position: absolute;
  pointer-events: none;
}

/* Station 1 — circle frame */
.services__station[data-station="1"] .services__ornament {
  width: 70px;
  height: 70px;
  border: 1px solid rgba(142,153,164,0.1);
  border-radius: 50%;
  top: -12px;
  right: 8px;
}

/* Station 2 — dotted line + dot */
.services__station[data-station="2"] .services__ornament {
  width: 50px;
  height: 1px;
  background: repeating-linear-gradient(90deg, var(--accent-dim) 0, var(--accent-dim) 3px, transparent 3px, transparent 7px);
  opacity: 0.25;
  bottom: 12px;
  left: 20%;
}

/* Station 3 — small diamond outline */
.services__station[data-station="3"] .services__ornament {
  width: 22px;
  height: 22px;
  border: 1px solid rgba(142,153,164,0.12);
  top: 8px;
  left: 12px;
  transform: rotate(45deg);
}

/* Station 4 — vertical hairline */
.services__station[data-station="4"] .services__ornament {
  width: 1px;
  height: 45px;
  background: linear-gradient(180deg, transparent, var(--accent-dim) 50%, transparent);
  opacity: 0.25;
  bottom: 8px;
  right: 25%;
}

/* Station 5 — concentric rings */
.services__station[data-station="5"] .services__ornament {
  width: 24px;
  height: 24px;
  border: 1px solid rgba(142,153,164,0.1);
  border-radius: 50%;
  bottom: 18px;
  left: 15px;
}

.services__station[data-station="5"] .services__ornament::after {
  content: '';
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(142,153,164,0.08);
  border-radius: 50%;
}

/* Station 6 — small cross */
.services__station[data-station="6"] .services__ornament {
  width: 16px;
  height: 16px;
  top: 12px;
  right: 22px;
}

.services__station[data-station="6"] .services__ornament::before,
.services__station[data-station="6"] .services__ornament::after {
  content: '';
  position: absolute;
  background: var(--accent-dim);
  opacity: 0.2;
}

.services__station[data-station="6"] .services__ornament::before {
  top: 50%;
  left: 0;
  width: 100%;
  height: 1px;
  transform: translateY(-50%);
}

.services__station[data-station="6"] .services__ornament::after {
  left: 50%;
  top: 0;
  width: 1px;
  height: 100%;
  transform: translateX(-50%);
}

/* ─── Content Zone ─── */
.services__content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  padding: clamp(1.5rem, 2.5vw, 2.5rem);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  transition:
    border-color 0.5s var(--ease-out-expo),
    box-shadow 0.5s var(--ease-out-expo),
    transform 0.4s var(--ease-out-expo),
    background 0.5s var(--ease-out-expo);
  will-change: transform;
    box-shadow: var(--shadow-card);
  }

  /* Premium: Subtle inner glow at top */
  .services__content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255,255,255,0.3) 0%, transparent 100%);
    pointer-events: none;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

/* LEFT station → content on LEFT (column 1) */
.services__station--left .services__content {
  grid-column: 1;
  grid-row: 1;
  text-align: right;
  margin-right: 4rem;
}

/* RIGHT station → content on RIGHT (column 2) */
.services__station--right .services__content {
  grid-column: 2;
  grid-row: 1;
  text-align: left;
  margin-left: 4rem;
}

/* Hero station content — elevated surface */
.services__station--hero .services__content {
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-primary));
  border-color: var(--border);
  padding: clamp(2rem, 3vw, 3rem);
  box-shadow: var(--shadow-elevated);
}

/* ─── Station Hover ─── */
.services__station:hover .services__content {
  border-color: var(--accent);
  box-shadow: var(--shadow-card-hover),
    0 0 0 1px rgba(142,153,164,0.08);
  background: var(--bg-secondary);
}

.services__station--left:hover .services__content {
  transform: translateX(-4px);
}

.services__station--right:hover .services__content {
  transform: translateX(4px);
}

.services__station--hero:hover .services__content {
  background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary));
  box-shadow: var(--shadow-elevated),
    0 0 0 1px rgba(142,153,164,0.12),
    0 0 40px rgba(142,153,164,0.06);
}

/* ─── Content: Station Index ─── */
.services__station-index {
  font-family: var(--font-body);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent-dim);
  margin-bottom: 0.5rem;
  font-variant-numeric: tabular-nums;
}

/* ─── Content: Service Name ─── */
.services__name {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--fg-primary);
  line-height: 1.2;
  margin-bottom: 0.5rem;
  /* Premium: Optical sizing for headlines */
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
}

.services__station:not(.services__station--hero) .services__name {
  font-size: clamp(1.15rem, 1.8vw, 1.5rem);
}

.services__station--hero .services__name {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  margin-bottom: 0.7rem;
}

/* ─── Content: Rule Line ─── */
.services__rule {
  width: 35px;
  height: 1px;
  background: var(--accent-dim);
  margin-bottom: 0.6rem;
  transition: width 0.5s var(--ease-out-expo);
}

.services__station:hover .services__rule {
  width: 55px;
}

.services__station--left .services__rule {
  margin-left: auto;
}

/* ─── Content: Description ─── */
.services__desc {
  font-family: var(--font-accent);
  font-size: clamp(0.8rem, 1vw, 0.92rem);
  font-weight: 300;
  line-height: 1.75;
  color: var(--fg-muted);
  margin-bottom: 1rem;
}

.services__station--hero .services__desc {
  font-size: clamp(0.9rem, 1.2vw, 1.05rem);
  max-width: 420px;
}

.services__station--left .services__desc {
  margin-left: auto;
}

/* ─── Content: Meta (price + duration) ─── */
.services__meta {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-body);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.services__station--left .services__meta {
  justify-content: flex-end;
}

.services__price {
  color: var(--accent);
}

.services__duration {
  color: var(--fg-muted);
  padding-left: 0.75rem;
  border-left: 1px solid var(--border);
  font-weight: 400;
}

/* ─── Station Reveal (hidden initial state) ─── */
.services__station[data-station-reveal] {
  opacity: 0;
  transition: none;
}

.services__station--left[data-station-reveal] {
  transform: translateX(-60px);
}

.services__station--right[data-station-reveal] {
  transform: translateX(60px);
}

.services__station[data-station-reveal].svc-revealed {
  opacity: 1;
  transform: translateX(0);
  transition:
    opacity 0.9s var(--ease-out-expo),
    transform 0.9s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ─── Responsive — Tablet ─── */
@media (max-width: 1024px) {
  .services__station--left .services__content {
    margin-right: 3rem;
  }

  .services__station--right .services__content {
    margin-left: 3rem;
  }

  .services__station--left .services__visual {
    padding-left: 3.5rem;
  }

  .services__station--right .services__visual {
    padding-right: 3.5rem;
  }

  .services__number {
    font-size: clamp(4rem, 8vw, 6rem);
  }

  .services__connector {
    width: 2.5rem;
  }

  .services__icon svg {
    width: 44px;
    height: 44px;
  }

  .services__station--hero .services__icon svg {
    width: 60px;
    height: 60px;
  }
}

/* ─── Responsive — Mobile (single-column stack, spine on left) ─── */
@media (max-width: 768px) {
  .services {
    padding: clamp(3rem, 8vw, 4rem) 0;
  }

  .services__header {
    margin-bottom: clamp(3rem, 6vw, 4.5rem);
  }

  .services__conveyor {
    max-width: 100%;
    padding-left: clamp(2.5rem, 8vw, 4rem);
    padding-right: clamp(1rem, 4vw, 2rem);
  }

  /* Move spine to left side */
  .services__spine {
    left: clamp(1rem, 3vw, 1.5rem);
    transform: none;
  }

  .services__spine-fill {
    left: -1px;
    width: 3px;
  }

  /* Single column */
  .services__station {
    grid-template-columns: 1fr;
    padding: clamp(1.5rem, 3vw, 2.5rem) 0;
  }

  /* All content on the right of spine */
  .services__station--left .services__content,
  .services__station--right .services__content {
    grid-column: 1;
    grid-row: 1;
    text-align: left;
    margin: 0;
    margin-left: 0.5rem;
  }

  /* Hide visual zone on mobile */
  .services__visual {
    display: none;
  }

  /* Reposition nodes to left spine */
  .services__node {
    left: clamp(1rem, 3vw, 1.5rem);
  }

  /* Connectors from left spine */
  .services__station--left .services__connector,
  .services__station--right .services__connector {
    left: clamp(1rem, 3vw, 1.5rem);
    right: auto;
    width: 1.5rem;
    transform-origin: left center;
  }

  /* Reset left-side alignment to left */
  .services__station--left .services__rule,
  .services__station--left .services__desc {
    margin-left: 0;
  }

  .services__station--left .services__desc {
    margin-left: 0;
    max-width: none;
  }

  .services__station--left .services__meta {
    justify-content: flex-start;
  }

  /* Hide hover transforms */
  .services__station--left:hover .services__content,
  .services__station--right:hover .services__content {
    transform: none;
  }

  /* Scale down hero */
  .services__station--hero .services__name {
    font-size: clamp(1.4rem, 4vw, 1.8rem);
  }

  .services__station:not(.services__station--hero) .services__name {
    font-size: clamp(1.05rem, 3vw, 1.3rem);
  }

  .services__station--hero .services__content {
    padding: clamp(1.5rem, 3vw, 2rem);
  }

  /* Reveal — simpler on mobile */
  .services__station--left[data-station-reveal],
  .services__station--right[data-station-reveal] {
    transform: translateY(30px);
  }

  .services__station[data-station-reveal].svc-revealed {
    transform: translateY(0);
  }
}

/* ─── Responsive — Small mobile ─── */
@media (max-width: 480px) {
  .services__conveyor {
    padding-left: clamp(2rem, 6vw, 3rem);
  }

  .services__connector {
    width: 1rem;
  }
}

/* ─── Reduced Motion ─── */
@media (prefers-reduced-motion: reduce) {
  .services__station[data-station-reveal] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .services__station:hover .services__content {
    transform: none !important;
  }

  .services__header[data-svc-header] .services__eyebrow,
  .services__header[data-svc-header] .services__title {
    clip-path: none !important;
    opacity: 1 !important;
    transition: none !important;
  }

  .services__node {
    transform: translate(-50%, -50%) rotate(45deg) scale(1) !important;
    transition: none !important;
    animation: none !important;
  }

  .services__connector {
    transform: scaleX(1) !important;
    transition: none !important;
  }

  .services__spine-fill {
    transform: scaleY(1) !important;
  }

  .services__icon svg {
    transition: none !important;
  }

  .services__content {
    transition: border-color 0.2s ease, background 0.2s ease !important;
  }

  .services__rule {
    transition: none !important;
  }
}
