.section-services {
  position: relative;
  overflow: hidden;
}

/* Background — never block touches */
.section-services::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 70%, rgba(0, 217, 255, 0.10) 0%, transparent 55%),
    radial-gradient(ellipse at 70% 30%, rgba(212, 175, 55, 0.12) 0%, transparent 55%),
    linear-gradient(
      180deg,
      rgba(6, 9, 14, 0.9) 0%,
      rgba(6, 9, 14, 0.95) 100%
    ),
    url('/assets/background/3.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
  /* ✅ overlay must never eat taps */
  pointer-events: none;
}

/* Services Content */
.services-content {
  position: relative;
  z-index: 2;
  text-align: center;
}

.services-content h2 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 900;
  color: var(--color-gold);
  margin-bottom: var(--spacing-sm);
  text-shadow: 0 0 30px var(--glow-gold);
}

.services-subtitle {
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-xl);
  font-size: 1rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

/* Services Grid */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-lg);
  perspective: 1000px;
}

/* Flip Card */
.service-card-flip {
  height: 220px;
  perspective: 1000px;
  cursor: pointer;
  /* ✅ removes 300ms tap delay on iOS/Android */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Unified flip state (used by JS + touch) */
.service-card-flip.is-flipped .card-inner {
  transform: rotateX(180deg);
}

/* Premium lift + glow on hover/focus */
.service-card-flip:hover .card-front,
.service-card-flip:focus-visible .card-front {
  border-color: rgba(212, 175, 55, 0.45);
  box-shadow: 0 0 22px rgba(212, 175, 55, 0.18);
}

.service-card-flip:focus-visible {
  outline: 2px solid rgba(0, 217, 255, 0.45);
  outline-offset: 6px;
  border-radius: var(--radius-lg);
}

/* Card inner */
.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s var(--easing-out);
  transform-style: preserve-3d;
  /* ✅ inner must never block taps */
  pointer-events: none;
}

.service-card-flip:hover .card-inner {
  transform: rotateX(180deg);
}

/* Front & Back shared */
.card-front,
.card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-lg);
  box-sizing: border-box;
  /* ✅ faces receive all pointer/touch events */
  pointer-events: auto;
}

/* Front */
.card-front {
  background: rgba(16, 16, 16, 0.75);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(212, 175, 55, 0.25);
  z-index: 2;
}

.card-front .service-icon-container {
  margin-bottom: var(--spacing-md);
  width: 70px;
  height: 70px;
  border: 2px solid rgba(212, 175, 55, 0.4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(212, 175, 55, 0.08);
  transition: all var(--duration-normal) var(--easing-out);
  box-shadow: 0 0 15px rgba(0, 217, 255, 0.1);
  /* ✅ icon container must never steal the tap */
  pointer-events: none;
}

.card-front .service-icon {
  font-size: 2rem;
  display: inline-block;
  transition: transform var(--duration-normal) var(--easing-out);
  pointer-events: none;
  user-select: none;
}

.service-card-flip:hover .service-icon {
  transform: scale(1.2);
}

.card-front h3 {
  color: var(--color-gold);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin: 0;
  text-align: center;
  pointer-events: none;
  user-select: none;
}

.card-front::after {
  content: "Tap to view details";
  margin-top: 10px;
  font-size: 0.75rem;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.45);
  pointer-events: none;
}

/* Back */
.card-back {
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(10px);
  border: 1px solid var(--color-teal);
  transform: rotateX(180deg);
  box-shadow: 0 0 25px var(--glow-teal);
}

.card-back p {
  color: var(--color-text-primary);
  font-size: 0.95rem;
  line-height: 1.7;
  margin: 0;
  text-align: center;
  pointer-events: none;
  user-select: none;
}

/* ============================================
   DESKTOP hover flip
   ============================================ */
@media (hover: hover) {
  .service-card-flip:hover .card-inner {
    transform: rotateX(180deg);
  }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 992px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
  }

  .service-card-flip {
    height: 200px;
  }
}

/* ============================================
   MOBILE — full 3D reset, opacity crossfade
   ============================================ */
@media (max-width: 768px) {
  .services-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin: 0 auto;
    /* ✅ no perspective on mobile — breaks tap hit zones on iOS */
    perspective: none;
  }

  .service-card-flip {
    height: 180px;
    /* ✅ shell is flat — no 3D stacking context */
    perspective: none;
  }

  /* ✅ kill 3D on inner — use opacity swap instead */
  .card-inner {
    transform-style: flat;
    transform: none !important;
    transition: none;
    pointer-events: auto;
  }

  /* ✅ both faces visible in layout flow, no 3D rotation */
  .card-front,
  .card-back {
    backface-visibility: visible;
    -webkit-backface-visibility: visible;
    transition: opacity 0.35s ease;
  }

  /* back hidden by default */
  .card-back {
    transform: none;
    opacity: 0;
    pointer-events: none;
  }

  /* front visible by default */
  .card-front {
    opacity: 1;
    pointer-events: auto;
  }

  /* ✅ flipped state — swap opacity, no rotation */
  .service-card-flip.is-flipped .card-front {
    opacity: 0;
    pointer-events: none;
  }

  .service-card-flip.is-flipped .card-back {
    opacity: 1;
    pointer-events: auto;
  }

  /* ✅ disable hover-triggered rotation on mobile */
  .service-card-flip:hover .card-inner {
    transform: none;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .card-inner {
    transition: none !important;
  }
  .card-front,
  .card-back {
    transition: none !important;
  }
}
.section-services {
  position: relative;
  overflow: hidden;
}

/* Background — never block touches */
.section-services::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 70%, rgba(0, 217, 255, 0.10) 0%, transparent 55%),
    radial-gradient(ellipse at 70% 30%, rgba(212, 175, 55, 0.12) 0%, transparent 55%),
    linear-gradient(
      180deg,
      rgba(6, 9, 14, 0.9) 0%,
      rgba(6, 9, 14, 0.95) 100%
    ),
    url('/assets/background/3.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
  pointer-events: none;
}

/* Services Content */
.services-content {
  position: relative;
  z-index: 2;
  text-align: center;
}

.services-content h2 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 900;
  color: var(--color-gold);
  margin-bottom: var(--spacing-sm);
  text-shadow: 0 0 30px var(--glow-gold);
}

.services-subtitle {
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-xl);
  font-size: 1rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

/* Services Grid */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-lg);
  perspective: 1000px;
}

/* ============================================
   ✅ POP-IN ANIMATION — cards start hidden
   ============================================ */
.service-card-flip {
  height: 220px;
  perspective: 1000px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;

  /* ✅ start invisible and shifted down — same as betting cards */
  opacity: 0;
  transform: translate3d(0, 18px, 0);
  transition:
    opacity 650ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 650ms cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: var(--card-delay, 0ms);
}

/* ✅ JS adds .cards-in to .section-services on scroll → cards pop in */
.section-services.cards-in .service-card-flip {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* Unified flip state */
.service-card-flip.is-flipped .card-inner {
  transform: rotateX(180deg);
}

/* Premium lift + glow on hover/focus */
.service-card-flip:hover .card-front,
.service-card-flip:focus-visible .card-front {
  border-color: rgba(212, 175, 55, 0.45);
  box-shadow: 0 0 22px rgba(212, 175, 55, 0.18);
}

.service-card-flip:focus-visible {
  outline: 2px solid rgba(0, 217, 255, 0.45);
  outline-offset: 6px;
  border-radius: var(--radius-lg);
}

/* Card inner */
.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s var(--easing-out);
  transform-style: preserve-3d;
  pointer-events: none;
}

/* Desktop hover flip */
@media (hover: hover) {
  .service-card-flip:hover .card-inner {
    transform: rotateX(180deg);
  }
}

/* Front & Back shared */
.card-front,
.card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-lg);
  box-sizing: border-box;
  pointer-events: auto;
}

/* Front */
.card-front {
  background: rgba(16, 16, 16, 0.75);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(212, 175, 55, 0.25);
  z-index: 2;
}

.card-front .service-icon-container {
  margin-bottom: var(--spacing-md);
  width: 70px;
  height: 70px;
  border: 2px solid rgba(212, 175, 55, 0.4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(212, 175, 55, 0.08);
  transition: all var(--duration-normal) var(--easing-out);
  box-shadow: 0 0 15px rgba(0, 217, 255, 0.1);
  pointer-events: none;
}

.card-front .service-icon {
  font-size: 2rem;
  display: inline-block;
  transition: transform var(--duration-normal) var(--easing-out);
  pointer-events: none;
  user-select: none;
}

.service-card-flip:hover .service-icon {
  transform: scale(1.2);
}

.card-front h3 {
  color: var(--color-gold);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin: 0;
  text-align: center;
  pointer-events: none;
  user-select: none;
}

.card-front::after {
  content: "Tap to view details";
  margin-top: 10px;
  font-size: 0.75rem;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.45);
  pointer-events: none;
}

/* Back */
.card-back {
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(10px);
  border: 1px solid var(--color-teal);
  transform: rotateX(180deg);
  box-shadow: 0 0 25px var(--glow-teal);
}

.card-back p {
  color: var(--color-text-primary);
  font-size: 0.95rem;
  line-height: 1.7;
  margin: 0;
  text-align: center;
  pointer-events: none;
  user-select: none;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 992px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
  }

  .service-card-flip {
    height: 200px;
  }
}

/* ============================================
   MOBILE — full 3D reset, opacity crossfade
   ============================================ */
@media (max-width: 768px) {
  .services-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin: 0 auto;
    perspective: none;
  }

  .service-card-flip {
    height: 180px;
    perspective: none;
  }

  .card-inner {
    transform-style: flat;
    transform: none !important;
    transition: none;
    pointer-events: auto;
  }

  .card-front,
  .card-back {
    backface-visibility: visible;
    -webkit-backface-visibility: visible;
    transition: opacity 0.35s ease;
  }

  .card-back {
    transform: none;
    opacity: 0;
    pointer-events: none;
  }

  .card-front {
    opacity: 1;
    pointer-events: auto;
  }

  .service-card-flip.is-flipped .card-front {
    opacity: 0;
    pointer-events: none;
  }

  .service-card-flip.is-flipped .card-back {
    opacity: 1;
    pointer-events: auto;
  }

  .service-card-flip:hover .card-inner {
    transform: none;
  }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  /* ✅ skip pop-in entirely */
  .service-card-flip {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .card-inner {
    transition: none !important;
  }
  .card-front,
  .card-back {
    transition: none !important;
  }
}
/* Cards start hidden */
.service-card-flip {
  opacity: 0;
  transform: translate3d(0, 18px, 0);
  transition:
    opacity 650ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 650ms cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: var(--card-delay, 0ms);
}

/* JS adds .cards-in to section → cards pop in */
.section-services.cards-in .service-card-flip {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* Reduced motion — skip animation */
@media (prefers-reduced-motion: reduce) {
  .service-card-flip {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ============================================================
   SERVICES SECTION — SCROLL ANIMATION ADDITIONS
   ============================================================ */

/* ── SECTION BASE ───────────────────────────────────────────── */
.section-services::before {
  opacity: 0;
  transition: opacity 1.4s ease 0.1s;
}

.section-services.is-visible::before {
  opacity: 1;
}

/* ── HEADER — hidden base state ─────────────────────────────── */
.services-content h2 {
  opacity: 0;
  transform: translateY(40px) scale(0.97);
  transition:
    opacity   0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.services-subtitle {
  opacity: 0;
  transform: translateY(25px);
  transition:
    opacity   0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transition-delay: 0.15s;
}

/* ── HEADER GLOW PULSE — loops after title enters ───────────── */
.section-services.is-visible .services-content h2 {
  animation: servicesTitleGlow 3.5s ease-in-out infinite;
  animation-delay: 1s;
}

@keyframes servicesTitleGlow {
  0%, 100% {
    text-shadow: 0 0 30px rgba(212, 175, 55, 0.3);
  }
  50% {
    text-shadow:
      0 0 60px rgba(212, 175, 55, 0.8),
      0 0 120px rgba(212, 175, 55, 0.2);
  }
}

/* ── GRID CONTAINER — fades in as wrapper ───────────────────── */
.services-grid {
  opacity: 0;
  transform: translateY(15px);
  transition:
    opacity   0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.2s,
    transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.2s;
}

.section-services.is-visible .services-grid {
  opacity: 1;
  transform: translateY(0);
}

/* ── SERVICE CARDS — hidden base state ──────────────────────── */
.service-card-flip {
  opacity: 0;
  transform: translateY(50px) scale(0.9);
  transition:
    opacity    0.65s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    transform  0.65s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition-delay: var(--card-delay, 0ms);
  will-change: transform, opacity;
}

/* ── CARD ENTERED STATE ──────────────────────────────────────── */
.service-card-flip.card-entered {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ── CARD BORDER GLOW FLASH ON ENTER ────────────────────────── */
@keyframes serviceCardFlashGold {
  0%   {
    box-shadow: 0 0 0px rgba(212, 175, 55, 0),
                inset 0 0 0px rgba(212, 175, 55, 0);
  }
  35%  {
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.6),
                inset 0 0 20px rgba(212, 175, 55, 0.1);
  }
  100% {
    box-shadow: 0 0 0px rgba(212, 175, 55, 0),
                inset 0 0 0px rgba(212, 175, 55, 0);
  }
}

@keyframes serviceCardFlashTeal {
  0%   {
    box-shadow: 0 0 0px rgba(0, 217, 255, 0),
                inset 0 0 0px rgba(0, 217, 255, 0);
  }
  35%  {
    box-shadow: 0 0 30px rgba(0, 217, 255, 0.5),
                inset 0 0 20px rgba(0, 217, 255, 0.08);
  }
  100% {
    box-shadow: 0 0 0px rgba(0, 217, 255, 0),
                inset 0 0 0px rgba(0, 217, 255, 0);
  }
}

.service-card-flip.card-entered.flash-gold .card-front {
  animation: serviceCardFlashGold 1.1s ease forwards;
}

.service-card-flip.card-entered.flash-teal .card-front {
  animation: serviceCardFlashTeal 1.1s ease forwards;
}

/* ── ICON SPIN-IN ON CARD ENTER ─────────────────────────────── */
.service-icon-container {
  opacity: 0;
  transform: scale(0) rotate(-120deg);
  transition:
    opacity   0.5s ease,
    transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.service-card-flip.card-entered .service-icon-container {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

/* ── CARD TITLE SLIDE UP ON ENTER ───────────────────────────── */
.card-front h3 {
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity   0.5s ease,
    transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.service-card-flip.card-entered .card-front h3 {
  opacity: 1;
  transform: translateY(0);
}

/* ── SHIMMER SWEEP ON CARD ENTER ────────────────────────────── */
.card-front::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  background: linear-gradient(
    105deg,
    transparent 20%,
    rgba(212, 175, 55, 0.1) 50%,
    transparent 80%
  );
  transform: translateX(-120%);
  pointer-events: none;
  z-index: 3;
  transition: transform 0s;
}

.service-card-flip.shimmer-active .card-front::before {
  transition: transform 0.85s ease;
  transform: translateX(120%);
}

/* ── CARDS-IN CLASS — existing pop-in compat ────────────────── */
/* keep your existing .cards-in behaviour intact */
.section-services.cards-in .service-card-flip {
  /* handled by .card-entered now — no conflict */
}

/* ── SECTION EXIT — dims when scrolled past ─────────────────── */
.section-services.section-exit .services-content h2,
.section-services.section-exit .services-subtitle {
  opacity: 0.3;
  transition: opacity 0.5s ease;
}

.section-services.section-exit .service-card-flip.card-entered {
  opacity: 0.35;
  transition: opacity 0.5s ease;
}

/* ── REDUCED MOTION ──────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .section-services::before,
  .services-content h2,
  .services-subtitle,
  .services-grid,
  .service-card-flip,
  .service-icon-container,
  .card-front h3,
  .card-front::before {
    transition:  none !important;
    animation:   none !important;
    opacity:     1    !important;
    transform:   none !important;
  }
}