#esc #services {
  position: relative;
  isolation: isolate;
  overflow: clip;
}

#esc #services::before {
  content: "";
  position: absolute;
  inset: 8% -8% 4% 22%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 58% 48%, rgba(139, 92, 246, 0.13), transparent 34%),
    linear-gradient(rgba(167, 139, 250, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(167, 139, 250, 0.025) 1px, transparent 1px);
  background-size: auto, 48px 48px, 48px 48px;
  mask-image: linear-gradient(90deg, transparent, #000 18%, #000 86%, transparent);
}

#esc #services > * {
  position: relative;
  z-index: 1;
}

#esc #services .svc-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

#esc #services .svc-grid::before,
#esc #services .svc-grid::after {
  content: "";
  position: absolute;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(139, 92, 246, 0.35) 20%,
    #a78bfa 50%,
    rgba(139, 92, 246, 0.35) 80%,
    transparent
  );
  background-size: 200% 100%;
}

#esc #services .svc-grid::before {
  top: 50%;
  right: 7%;
  left: 7%;
  height: 1px;
}

#esc #services .svc-grid::after {
  top: 7%;
  bottom: 7%;
  left: 50%;
  width: 1px;
  background-image: linear-gradient(
    180deg,
    transparent,
    rgba(139, 92, 246, 0.35) 20%,
    #a78bfa 50%,
    rgba(139, 92, 246, 0.35) 80%,
    transparent
  );
  background-size: 100% 200%;
}

#esc #services .svc-card {
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 350px;
  padding: 32px 30px 28px;
  border-color: rgba(167, 139, 250, 0.2);
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(139, 92, 246, 0.07), transparent 42%),
    rgba(12, 11, 18, 0.94);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.18);
  transform: none;
  transition:
    border-color 260ms ease,
    background-color 260ms ease,
    box-shadow 260ms ease;
}

#esc #services .svc-card::before {
  right: 30px;
  left: 30px;
  opacity: 0.56;
  background: linear-gradient(90deg, var(--violet), transparent 74%);
}

#esc #services .svc-card::after {
  content: "";
  position: absolute;
  top: 60px;
  right: 25px;
  z-index: 0;
  width: 92px;
  height: 92px;
  border: 1px solid rgba(167, 139, 250, 0.18);
  border-radius: 50%;
  opacity: 0.55;
  pointer-events: none;
  transition: opacity 260ms ease, transform 420ms cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: center;
}

#esc #services .svc-card:nth-child(1)::after {
  background:
    radial-gradient(circle at 50% 50%, #a78bfa 0 3px, transparent 4px),
    radial-gradient(circle, transparent 35%, rgba(139, 92, 246, 0.6) 36% 37%, transparent 38%),
    radial-gradient(circle, transparent 53%, rgba(167, 139, 250, 0.26) 54% 55%, transparent 56%);
}

#esc #services .svc-card:nth-child(2)::after {
  border-radius: 12px;
  background:
    linear-gradient(90deg, transparent 46%, rgba(167, 139, 250, 0.5) 47% 53%, transparent 54%),
    linear-gradient(transparent 46%, rgba(167, 139, 250, 0.5) 47% 53%, transparent 54%);
  box-shadow:
    -10px 10px 0 -1px rgba(12, 11, 18, 0.9),
    -10px 10px 0 0 rgba(139, 92, 246, 0.2),
    -20px 20px 0 -1px rgba(12, 11, 18, 0.9),
    -20px 20px 0 0 rgba(139, 92, 246, 0.12);
}

#esc #services .svc-card:nth-child(3)::after {
  border: 0;
  border-radius: 10px;
  background: repeating-linear-gradient(
    160deg,
    transparent 0 13px,
    rgba(139, 92, 246, 0.48) 14px,
    transparent 15px 25px
  );
  transform: rotate(-8deg);
}

#esc #services .svc-card:nth-child(4)::after {
  background:
    linear-gradient(transparent 49%, rgba(167, 139, 250, 0.3) 50%, transparent 51%),
    linear-gradient(90deg, transparent 49%, rgba(167, 139, 250, 0.3) 50%, transparent 51%),
    radial-gradient(circle, #a78bfa 0 3px, transparent 4px 43%, rgba(139, 92, 246, 0.5) 44% 45%, transparent 46%);
}

#esc #services .svc-card > * {
  position: relative;
  z-index: 1;
}

#esc #services .svc-card:hover {
  border-color: rgba(167, 139, 250, 0.58);
  background-color: rgba(18, 15, 28, 0.98);
  box-shadow:
    0 18px 55px rgba(0, 0, 0, 0.24),
    0 0 30px rgba(139, 92, 246, 0.1);
  transform: none;
}

#esc #services .svc-card:hover::after {
  opacity: 0.92;
}

#esc #services .svc-tier {
  width: fit-content;
  margin-bottom: 22px;
  border-color: rgba(167, 139, 250, 0.24);
  background: rgba(139, 92, 246, 0.045);
}

#esc #services .svc-num {
  color: rgba(167, 139, 250, 0.72);
}

#esc #services .svc-name {
  max-width: calc(100% - 74px);
  font-size: clamp(23px, 1.8vw, 29px);
}

#esc #services .svc-desc {
  margin-top: 4px;
  color: rgba(236, 236, 241, 0.65);
}

#esc #services .svc-meta {
  margin-top: auto;
  color: #a78bfa;
}

@media (min-width: 1101px) {
  #esc #services {
    display: grid;
    grid-template-columns: minmax(290px, 0.72fr) minmax(670px, 1.58fr);
    grid-template-rows: 1fr auto auto auto 1fr;
    column-gap: clamp(62px, 6vw, 108px);
    max-width: 1440px;
    padding-right: clamp(48px, 5vw, 76px);
    padding-left: clamp(48px, 5vw, 76px);
  }

  #esc #services > .sec-label {
    grid-column: 1;
    grid-row: 2;
  }

  #esc #services > h2 {
    grid-column: 1;
    grid-row: 3;
    font-size: clamp(48px, 4.4vw, 68px);
  }

  #esc #services > .sec-sub {
    grid-column: 1;
    grid-row: 4;
    max-width: 420px;
  }

  #esc #services > .svc-grid {
    grid-column: 2;
    grid-row: 1 / 6;
    align-self: center;
    margin-top: 0;
  }
}

@media (max-width: 1100px) {
  #esc #services .svc-grid {
    margin-top: 48px;
  }
}

@media (max-width: 720px) {
  #esc #services::before {
    inset: 5% -30% 0 10%;
  }

  #esc #services .svc-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 38px;
  }

  #esc #services .svc-grid::before,
  #esc #services .svc-grid::after {
    display: none;
  }

  #esc #services .svc-card {
    min-height: 0;
    padding: 28px 24px 24px;
    transform: none;
  }

  #esc #services .svc-card::before {
    right: 24px;
    left: 24px;
  }

  #esc #services .svc-card::after {
    top: 62px;
    right: 20px;
    width: 76px;
    height: 76px;
    opacity: 0.34;
  }

  #esc #services .svc-name {
    max-width: calc(100% - 68px);
    font-size: 25px;
  }

  #esc #services .svc-desc {
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  @media (hover: hover) and (pointer: fine) {
    #esc #services .svc-card:nth-child(1):hover::after {
      animation: svc-icon-pulse 720ms cubic-bezier(0.16, 1, 0.3, 1);
    }

    #esc #services .svc-card:nth-child(2):hover::after {
      animation: svc-icon-assemble 720ms cubic-bezier(0.16, 1, 0.3, 1);
    }

    #esc #services .svc-card:nth-child(3):hover::after {
      animation: svc-icon-sweep 760ms cubic-bezier(0.16, 1, 0.3, 1);
    }

    #esc #services .svc-card:nth-child(4):hover::after {
      animation: svc-icon-lock 720ms cubic-bezier(0.16, 1, 0.3, 1);
    }
  }

  @keyframes svc-icon-pulse {
    0% { transform: scale(0.9); opacity: 0.5; }
    48% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 0.92; }
  }

  @keyframes svc-icon-assemble {
    0% { transform: translate(0, 0); }
    40% { transform: translate(-5px, 5px); }
    72% { transform: translate(3px, -3px); }
    100% { transform: translate(0, 0); }
  }

  @keyframes svc-icon-sweep {
    0% { transform: rotate(-8deg); background-position: 0 0; }
    58% { transform: rotate(-3deg); background-position: 0 28px; }
    100% { transform: rotate(-8deg); background-position: 0 50px; }
  }

  @keyframes svc-icon-lock {
    0% { transform: scale(0.9) rotate(-10deg); opacity: 0.5; }
    55% { transform: scale(1.07) rotate(6deg); opacity: 1; }
    100% { transform: scale(1) rotate(0); opacity: 0.92; }
  }
}

@media (prefers-reduced-motion: reduce) {
  #esc #services .svc-card::after {
    animation: none;
  }

  #esc #services .svc-card {
    transition: border-color 180ms ease, background-color 180ms ease;
  }
}
