:root {
  --bg-gradient: linear-gradient(135deg, #0f1724 0%, #2b2f6a 35%, #6a52b7 70%, #8e6be6 100%);
  --card-bg: rgba(255,255,255,0.98);
  --card-radius: 18px;
  --accent-start: rgba(94,92,230,0.95);
  --accent-end: rgba(134,94,230,0.85);
  --text-navy: #071133;
  --muted: rgba(7,17,51,0.55);
  --shadow-1: 0 18px 50px rgba(6,12,34,0.18);
  --transition: 0.5s cubic-bezier(.2,.9,.2,1);
  --mobile-break: 820px;
  --card-width: 520px;
  --card-height: 460px;
}

/* Section wrapper keeps your original gradient as a fallback */
.services-wrapper {
  width: 100%;
  position: relative;
  background: var(--bg-gradient);
}

/* NEW: cross-fade background layers (sit behind .services-inner) */
.services-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.services-bg-layer {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 800ms ease;
  filter: brightness(0.6); /* keep text readable on photos */
}
.services-bg-layer.is-front { opacity: 1; }

.services-pin {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.services-inner {
  position: relative; /* ensure above background layers */
  z-index: 1;
  width: min(1200px, 94%);
  height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  padding: 48px;
}

.services-left { color: white; }

.services-title {
  font-size: clamp(64px, 12vw, 128px);
  line-height: 0.9;
  font-weight: 900;
  text-shadow: 0 12px 36px rgba(10,12,25,0.28);
}

.services-right {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  height: 100%;
}

.services-cards {
  position: relative;
  width: var(--card-width);
  height: var(--card-height);
}

.service-card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--card-width);
  height: var(--card-height);
  transform: translate(-50%, -50%) translateY(100px);
  opacity: 0;
  background: var(--card-bg);
  border-radius: var(--card-radius);
  padding: 36px;
  box-shadow: var(--shadow-1);
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: transform 0.8s ease, opacity 0.8s ease;
}

.service-card.visible {
  transform: translate(-50%, -50%) translateY(0);
  opacity: 1;
  z-index: 10;
}

.card-number {
  font-size: 5rem;
  font-weight: 800;
  color: rgba(10, 20, 50, 0.08);
  position: absolute;
  top: 28px;
  left: 36px;
  pointer-events: none;
  user-select: none;
}

.card-accent {
  width: 72px;
  height: 6px;
  border-radius: 6px;
  margin-bottom: 12px;
  background: linear-gradient(90deg, var(--accent-start), var(--accent-end));
}

.card-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-navy);
}

.card-desc {
  color: var(--muted);
  line-height: 1.5;
  font-size: 1rem;
}

@media (max-width: var(--mobile-break)) {
  :root {
    --card-width: calc(100vw - 64px);
    --card-height: 56vh;
  }

  .services-inner {
    grid-template-columns: 1fr;
    padding: 28px;
  }

  .services-cards {
    width: var(--card-width);
    height: var(--card-height);
  }

  .service-card { padding: 22px; }
}
