:root {
  --services-navy: #071b33;
  --services-ink: #12253f;
  --services-gold: #c89a3a;
  --services-gold-soft: rgba(200, 154, 58, 0.14);
  --services-sand: #f7f3eb;
  --services-cloud: #f8fafc;
  --services-line: rgba(7, 27, 51, 0.12);
  --services-text: #445569;
}

.services-section {
  position: relative;
  padding: 84px 0 104px;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(200, 154, 58, 0.12), transparent 28%),
    radial-gradient(circle at top right, rgba(7, 27, 51, 0.07), transparent 30%),
    radial-gradient(circle at bottom right, rgba(7, 27, 51, 0.08), transparent 32%),
    linear-gradient(180deg, #f8f6f1 0%, #eef3f8 100%);
}

.services-section::before,
.services-section::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(24px);
  opacity: 0.5;
}

.services-section::before {
  width: 230px;
  height: 230px;
  top: 40px;
  left: -85px;
  background: rgba(200, 154, 58, 0.2);
}

.services-section::after {
  width: 300px;
  height: 300px;
  right: -110px;
  bottom: 70px;
  background: rgba(7, 27, 51, 0.08);
}

.services-shell {
  position: relative;
  z-index: 1;
  max-width: 1380px;
}

.services-header-block {
  text-align: center;
  max-width: 900px;
  margin: 0 auto 44px;
}

.services-badge {
  display: inline-flex;
  align-items: center;
  margin: 0 0 16px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(7, 27, 51, 0.06);
  color: var(--services-navy);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.74rem;
}

.main-title {
  margin: 0 0 16px;
  color: var(--services-navy);
  font-family: "Source Serif 4", serif;
  font-size: clamp(2.4rem, 4vw, 4rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
}

.intro-text {
  margin: 0 auto;
  max-width: 760px;
  color: var(--services-text);
  font-size: 1.08rem;
  line-height: 1.85;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  align-items: stretch;
}

.service-card {
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
  border: 1px solid rgba(7, 27, 51, 0.08);
  box-shadow:
    0 18px 44px rgba(7, 27, 51, 0.08),
    0 1px 0 rgba(255, 255, 255, 0.8) inset;
  min-height: 510px;
  transform: translateY(12px);
  opacity: 0;
  animation: riseUp 0.8s ease forwards;
  animation-delay: var(--card-delay, 0ms);
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

.service-card:hover {
  transform: translateY(0);
  border-color: rgba(200, 154, 58, 0.24);
  box-shadow:
    0 30px 66px rgba(7, 27, 51, 0.14),
    0 1px 0 rgba(255, 255, 255, 0.92) inset;
}

.service-card-link {
  display: flex;
  position: relative;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.service-image-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #dce5ee;
}

.service-image-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.14), transparent 24%),
    linear-gradient(180deg, rgba(7, 27, 51, 0) 0%, rgba(7, 27, 51, 0.02) 56%, rgba(7, 27, 51, 0.16) 100%);
  pointer-events: none;
  z-index: 1;
}

.service-image-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(7, 27, 51, 0) 0%, rgba(7, 27, 51, 0.05) 58%, rgba(7, 27, 51, 0.22) 100%),
    linear-gradient(90deg, rgba(7, 27, 51, 0.08), transparent 24%, transparent 76%, rgba(7, 27, 51, 0.08));
  pointer-events: none;
}

.service-image-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1);
  opacity: 1;
  transition: transform 0.45s ease, opacity 0.45s ease;
  animation: serviceImageReveal 1.1s ease both;
}

.service-card:hover .service-image-wrap img {
  transform: scale(1.07);
  opacity: 1;
}

.card-content {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: flex-start;
  min-height: 0;
  margin-top: 0;
  padding: 136px 0 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(248, 250, 252, 0.03) 100%);
}

.card-content::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 148px;
  background:
    linear-gradient(180deg, rgba(7, 27, 51, 0) 0%, rgba(7, 27, 51, 0.02) 70%, rgba(7, 27, 51, 0.16) 100%);
  opacity: 0.16;
  pointer-events: none;
}

.card-copy {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  padding: 16px 24px 26px;
  margin-top: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.04) 0%, rgba(248, 250, 252, 0.7) 36%, rgba(248, 250, 252, 0.92) 100%);
  backdrop-filter: blur(12px) saturate(1.04);
}

.service-card-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(7, 27, 51, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 10px 24px rgba(7, 27, 51, 0.18);
  backdrop-filter: blur(10px);
}

.card-content h2 {
  margin: 0;
  width: 100%;
  box-sizing: border-box;
  padding: 14px 24px 15px;
  color: #fff;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: clamp(1.25rem, 1.55vw, 1.75rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.28);
  background:
    linear-gradient(90deg, rgba(7, 27, 51, 0.9) 0%, rgba(13, 55, 104, 0.72) 48%, rgba(7, 27, 51, 0.9) 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px) saturate(1.06);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 10px 20px rgba(7, 27, 51, 0.12);
}

.card-content p {
  margin: 0;
  color: rgba(10, 24, 42, 0.94);
  font-size: 0.98rem;
  line-height: 1.7;
  font-weight: 500;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.38);
}

.card-cta {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  background:
    linear-gradient(135deg, #071b33 0%, #0b2d56 55%, #0b6efd 100%);
  border: 1px solid rgba(11, 110, 253, 0.22);
  color: #fff;
  font-weight: 800;
  box-shadow:
    0 12px 24px rgba(7, 27, 51, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
  transition: transform 0.28s ease, box-shadow 0.28s ease, filter 0.28s ease, border-color 0.28s ease;
}

.card-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 18%, rgba(255, 255, 255, 0.22) 48%, transparent 78%);
  transform: translateX(-120%);
  transition: transform 0.7s ease;
  z-index: -1;
}

.service-card:hover .card-cta {
  border-color: rgba(11, 110, 253, 0.38);
  color: #fff;
  transform: translateY(-2px);
  box-shadow:
    0 18px 34px rgba(7, 27, 51, 0.22),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  filter: saturate(1.04);
}

.service-card:hover .card-cta::before {
  transform: translateX(120%);
}

.service-card:focus-within .card-cta {
  border-color: rgba(11, 110, 253, 0.48);
  box-shadow:
    0 18px 34px rgba(7, 27, 51, 0.22),
    0 0 0 3px rgba(11, 110, 253, 0.14);
}

@keyframes riseUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes serviceImageReveal {
  from {
    opacity: 0;
    transform: scale(1.03);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes buttonPulseSoft {
  0%,
  100% {
    box-shadow:
      0 12px 24px rgba(7, 27, 51, 0.18),
      inset 0 1px 0 rgba(255, 255, 255, 0.16);
  }
  50% {
    box-shadow:
      0 14px 28px rgba(7, 27, 51, 0.22),
      inset 0 1px 0 rgba(255, 255, 255, 0.18);
  }
}

.card-cta {
  animation: buttonPulseSoft 4.8s ease-in-out infinite;
}

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

@media (max-width: 768px) {
  .services-section {
    padding: 68px 0 86px;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .main-title {
    font-size: 2.2rem;
  }

  .card-content {
    padding: 126px 0 0;
  }

  .card-content::before {
    height: 138px;
  }

  .card-content h2,
  .card-copy {
    padding-left: 20px;
    padding-right: 20px;
  }
}
