/* Standalone CSS for:
   <section class="section services" id="services">...</section>
*/

#services {
  --navy: #03182d;
  --navy-2: #062d50;
  --blue: #07579a;
  --cyan: #26d7e8;
  --cyan-2: #8bf4ff;
  --white: #f7fbff;
  --muted: #718297;

  position: relative;
  padding: 110px 0;
  overflow: hidden;
  background: var(--navy);
  color: #000;
}

#services *,
#services *::before,
#services *::after {
  box-sizing: border-box;
}

#services .container {
  width: min(1240px, calc(100% - 40px));
  margin-inline: auto;
}

#services .services-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 52px;
}

#services .eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .22em;
  text-transform: uppercase;
}

#services .eyebrow::before {
  content: "";
  width: 34px;
  height: 2px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--cyan);
}

#services .section-title {
  margin-top: 18px;
  color: #fff;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(38px, 5vw, 72px);
  line-height: .98;
  letter-spacing: -.045em;
}

#services .section-copy {
  max-width: 620px;
  margin-top: 20px;
  color: rgba(255, 255, 255, .58);
  font-size: 17px;
  line-height: 1.8;
}

#services .reveal {
  opacity: 0;
  transform: translateY(34px);
  filter: blur(10px);
  transition:
    opacity .85s ease,
    transform .85s cubic-bezier(.16, 1, .3, 1),
    filter .85s ease;
}

#services .reveal.show {
  opacity: 1;
  transform: none;
  filter: blur(0);
}

#services .service-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  perspective: 1200px;
}

#services .service-card {
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  --mx: 50%;
  --my: 50%;

  position: relative;
  min-height: 420px;
  overflow: hidden;
  isolation: isolate;
  border-radius: 26px;
  outline: 0;
  background: var(--navy-2);
  cursor: pointer;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  transition:
    transform .45s cubic-bezier(.16, 1, .3, 1),
    box-shadow .45s ease,
    filter .45s ease;
}

/* Only the direct image is the card background. */
#services .service-card > img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(.55);
  transition: transform .7s ease, filter .7s ease;
}

#services .service-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    to top,
    rgba(3, 24, 45, .96),
    rgba(3, 24, 45, .08)
  );
  transition: background .42s ease;
}

#services .service-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(
    circle at var(--mx) var(--my),
    rgba(139, 244, 255, .24),
    transparent 34%
  );
  transition: opacity .35s ease;
}

#services .service-num {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 4;
  color: var(--cyan);
  font-family: "Space Grotesk", sans-serif;
  font-size: 14px;
  transform: translateZ(38px);
  backface-visibility: hidden;
}

#services .service-content {
  position: absolute;
  right: 24px;
  bottom: 24px;
  left: 24px;
  z-index: 4;
  transform: translateZ(38px);
  backface-visibility: hidden;
}

#services .service-content h3 {
  margin: 0 0 16px;
  color: #000;
  font-family: "Space Grotesk", sans-serif;
  font-size: 24px;
  line-height: 1.15;
  transition: transform .35s ease;
}

#services .service-content p {
  max-height: 0;
  margin: 0;
  overflow: hidden;
  opacity: 0;
  color: rgba(255, 255, 255, .58);
  font-size: 14px;
  line-height: 1.7;
  transition:
    max-height .4s ease,
    opacity .4s ease,
    margin .4s ease;
}

/* The second image inside <p>. */
#services .service-content p img {
  position: static;
  display: block;
  width: 100%;
  height: 150px;
  margin: 0;
  border-radius: 14px;
  object-fit: cover;
  filter: none;
  transform: none;
}

#services .service-arrow {
  position: relative;
  display: grid;
  width: 44px;
  height: 44px;
  margin-top: 16px;
  overflow: hidden;
  place-items: center;
  border-radius: 50%;
  background: var(--cyan);
  color: var(--navy);
  font-size: 22px;
  transition: transform .35s ease;
}

#services .service-arrow::after {
  content: "";
  position: absolute;
  inset: -40%;
  opacity: 0;
  background: conic-gradient(
    from 90deg,
    transparent,
    rgba(255, 255, 255, .55),
    transparent 28%
  );
  transition: opacity .25s ease;
  animation: servicesSpinGlow 1.4s linear infinite;
}

@keyframes servicesSpinGlow {
  to { transform: rotate(1turn); }
}

@media (hover: hover) and (pointer: fine) {
  #services .service-card:hover,
  #services .service-card:focus-within {
    transform:
      perspective(1000px)
      translateY(-12px)
      rotateX(var(--tilt-x))
      rotateY(var(--tilt-y))
      scale(1.015);
    box-shadow: 0 34px 78px rgba(0, 0, 0, .36);
  }

  #services .service-card:hover::before,
  #services .service-card:focus-within::before {
    opacity: 1;
  }

  #services .service-card:hover::after,
  #services .service-card:focus-within::after {
    background: linear-gradient(
      to top,
      rgba(3, 24, 45, .96),
      rgba(3, 24, 45, .18) 52%,
      rgba(38, 215, 232, .13)
    );
  }

  #services .service-card:hover > img,
  #services .service-card:focus-within > img {
    transform: scale(1.13);
    filter: brightness(.72) saturate(1.04);
  }

  #services .service-card:hover .service-content h3,
  #services .service-card:focus-within .service-content h3 {
    transform: translateY(-4px);
  }

  #services .service-card:hover .service-content p,
  #services .service-card:focus-within .service-content p {
    max-height: 180px;
    margin-bottom: 16px;
    opacity: 1;
  }

  #services .service-card:hover .service-arrow,
  #services .service-card:focus-within .service-arrow {
    transform: translateX(8px) rotate(-12deg);
  }

  #services .service-card:hover .service-arrow::after,
  #services .service-card:focus-within .service-arrow::after {
    opacity: .55;
  }
}

@media (max-width: 1050px) {
  #services .service-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  #services {
    padding: 78px 0;
  }

  #services .container {
    width: min(100% - 26px, 1240px);
  }

  #services .services-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 34px;
  }

  #services .section-title {
    font-size: clamp(34px, 11vw, 54px);
    line-height: 1.02;
  }

  #services .section-copy {
    font-size: 15px;
    line-height: 1.72;
  }

  #services .service-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  #services .service-card {
    min-height: 410px;
    border-radius: 22px;
    transform: none !important;
    animation: none !important;
  }

  #services .service-card::before {
    display: none;
  }

  #services .service-content {
    right: 20px;
    bottom: 20px;
    left: 20px;
    transform: none !important;
  }

  #services .service-content h3 {
    font-size: 22px;
  }

  #services .service-content p {
    max-height: 180px;
    margin-bottom: 16px;
    opacity: 1;
  }

  #services .service-card > img {
    transform: none;
  }

  #services .service-card:active > img {
    transform: scale(1.035);
  }
}

@media (prefers-reduced-motion: reduce) {
  #services *,
  #services *::before,
  #services *::after {
    animation: none !important;
    transition-duration: .01ms !important;
  }

  #services .reveal {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
}
