/* Accessible, animated homepage service cards. */
.eh-services {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 0 22%, rgba(255, 173, 8, .075), transparent 28rem),
    radial-gradient(circle at 100% 78%, rgba(49, 94, 76, .07), transparent 32rem),
    #fff;
}

.eh-service-grid {
  gap: 34px;
  align-items: stretch;
}

.eh-service-card {
  --card-accent: #315e4c;
  isolation: isolate;
  min-width: 0;
  height: 100%;
  padding: clamp(30px, 3vw, 46px);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(49, 94, 76, .13);
  border-radius: 34px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.76), rgba(226,245,229,.92)),
    #e3f4e6;
  box-shadow: 0 22px 55px rgba(41, 76, 57, .10);
  transition: transform .45s cubic-bezier(.2,.75,.2,1), box-shadow .45s ease, border-color .35s ease;
}

.eh-service-card:nth-child(4n+2),
.eh-service-card:nth-child(4n+3) {
  background:
    linear-gradient(145deg, rgba(255,255,255,.88), rgba(255,246,223,.88)),
    #fff7e5;
}

.eh-service-card::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 220px;
  height: 220px;
  right: -100px;
  bottom: -110px;
  border: 1px solid rgba(49, 94, 76, .16);
  border-radius: 50%;
  box-shadow: 0 0 0 28px rgba(49, 94, 76, .035), 0 0 0 56px rgba(255, 173, 8, .025);
  animation: serviceOrb 9s ease-in-out infinite;
}

.eh-service-card:nth-child(even)::before {
  right: auto;
  left: -100px;
  animation-delay: -4.5s;
}

.eh-service-card::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 7px;
  background: linear-gradient(90deg, #315e4c 0 62%, #ffad08 62% 78%, transparent 78%);
  transform-origin: left;
  transition: transform .45s ease;
}

.eh-service-card:nth-child(even)::after {
  background: linear-gradient(90deg, #ffad08 0 18%, #315e4c 18% 80%, transparent 80%);
}

.eh-service-card:hover {
  transform: translateY(-12px);
  border-color: rgba(49, 94, 76, .28);
  box-shadow: 0 34px 75px rgba(42, 78, 58, .17);
}

.eh-service-card:hover::after {
  transform: scaleX(1.15);
}

.eh-service-card .service-number {
  z-index: 1;
  right: 30px;
  top: 24px;
  color: rgba(49, 94, 76, .10);
  font-size: 68px;
  font-weight: 700;
  transition: color .35s ease, transform .45s ease;
}

.eh-service-card:hover .service-number {
  color: rgba(255, 173, 8, .24);
  transform: translateY(-5px) rotate(3deg);
}

.eh-service-card .service-photo {
  position: relative;
  z-index: 1;
  width: min(245px, 72%);
  height: 245px;
  margin: 2px auto 34px;
  padding: 10px;
  border: 1px solid rgba(49, 94, 76, .12);
  border-radius: 30px 30px 30px 8px;
  background: rgba(255,255,255,.9);
  box-shadow: 0 18px 38px rgba(43, 76, 59, .13);
  transform: rotate(-1.5deg);
  transition: transform .55s cubic-bezier(.2,.75,.2,1), box-shadow .45s ease;
}

.eh-service-card:nth-child(even) .service-photo {
  border-radius: 30px 30px 8px 30px;
  transform: rotate(1.5deg);
}

.eh-service-card:hover .service-photo {
  transform: translateY(-7px) rotate(0deg);
  box-shadow: 0 26px 48px rgba(43, 76, 59, .2);
}

.eh-service-card .service-photo img {
  border-radius: 21px 21px 21px 5px;
  object-fit: contain;
  background: #fff;
}

.eh-service-card:nth-child(even) .service-photo img {
  border-radius: 21px 21px 5px 21px;
}

.eh-service-card:hover .service-photo img {
  transform: scale(1.025);
}

.eh-service-card h3 {
  position: relative;
  z-index: 1;
  margin: 4px 0 22px;
  padding-left: 22px;
  color: #214b3b;
  font-size: clamp(31px, 2.4vw, 43px);
  line-height: 1.14;
}

.eh-service-card h3::before {
  content: "";
  position: absolute;
  left: 0;
  top: .16em;
  width: 6px;
  height: 1.2em;
  border-radius: 8px;
  background: #ffad08;
  box-shadow: 0 0 0 5px rgba(255, 173, 8, .11);
}

.eh-service-card p {
  position: relative;
  z-index: 1;
  flex: 1 0 auto;
  margin-bottom: 28px;
  color: #46564e;
  font-size: 16px;
  line-height: 1.78;
}

.eh-service-card > a {
  position: relative;
  z-index: 2;
  align-items: center;
  width: fit-content;
  min-width: 225px;
  margin-top: auto;
  padding: 14px 16px 14px 20px;
  border: 0;
  border-radius: 999px;
  background: #315e4c;
  color: #fff;
  font-size: 15px;
  box-shadow: 0 12px 28px rgba(49, 94, 76, .19);
  transition: background .3s ease, transform .3s ease, box-shadow .3s ease;
}

.eh-service-card > a b {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-left: 18px;
  border-radius: 50%;
  background: #ffad08;
  color: #173d2e;
  font-size: 17px;
}

.eh-service-card > a:hover,
.eh-service-card > a:focus-visible {
  background: #214b3b;
  transform: translateX(4px);
  box-shadow: 0 16px 34px rgba(49, 94, 76, .27);
}

/* Alternating entrance makes the rows arrive from the right and left. */
.eh-service-card.reveal:not(.is-visible):nth-child(odd) {
  transform: translateX(-70px) rotate(-1deg);
}

.eh-service-card.reveal:not(.is-visible):nth-child(even) {
  transform: translateX(70px) rotate(1deg);
}

.eh-service-card.reveal.is-visible {
  transform: translateX(0) rotate(0);
}

.eh-service-card.reveal.is-visible:hover {
  transform: translateY(-12px);
}

@keyframes serviceOrb {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-18px, -15px, 0) scale(1.08); }
}

@media (max-width: 760px) {
  .eh-service-grid { gap: 24px; }

  .eh-service-card {
    padding: 28px 23px;
    border-radius: 25px;
  }

  .eh-service-card .service-photo {
    width: min(220px, 78%);
    height: 220px;
    margin-bottom: 28px;
  }

  .eh-service-card h3 {
    padding-left: 18px;
    font-size: 32px;
  }

  .eh-service-card p { font-size: 16px; }

  .eh-service-card > a {
    width: 100%;
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .eh-service-card,
  .eh-service-card::before,
  .eh-service-card::after,
  .eh-service-card .service-photo,
  .eh-service-card .service-photo img,
  .eh-service-card .service-number {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}
