/* Frosted-glass service cards: title-led scanning with a supporting visual. */
html body.home-page main#top #services#services .area-grid {
  align-items: stretch;
}

html body.home-page main#top #services#services .service-package-card {
  display: flex !important;
  min-height: 0 !important;
  height: 100% !important;
  flex-direction: column !important;
  gap: 0 !important;
  overflow: hidden !important;
  border: 1px solid rgba(109, 143, 161, 0.48) !important;
  border-radius: 22px !important;
  padding: 0 !important;
  background: var(--card-bg) !important;
  background-image: none !important;
  box-shadow: 0 18px 46px rgba(25, 54, 64, 0.09) !important;
  filter: none !important;
  isolation: isolate;
  transition:
    transform 360ms cubic-bezier(0.22, 1, 0.36, 1),
    border-color 280ms ease,
    box-shadow 320ms ease;
}

/* Legacy homepage overrides deliberately square every card with several ID-level
 * guards. This service-specific selector wins only for the new visual cards. */
html body.home-page:not(#service-card-square-1):not(#service-card-square-2):not(#service-card-square-3):not(#service-card-square-4) main#top #services#services .service-package-card.service-card-family {
  border-radius: 22px !important;
}

html body.home-page main#top #services#services .service-package-card::before,
html body.home-page main#top #services#services .service-package-card::after,
html body.home-page main#top #services#services .service-package-card > .package-card-logo {
  display: none !important;
}

html body.home-page main#top #services#services .service-card-media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  flex: 0 0 auto;
  overflow: hidden;
  border: 0;
  border-radius: 15px;
  background: transparent;
}

html body.home-page main#top #services#services .service-card-media::after {
  display: none;
}

html body.home-page main#top #services#services .service-card-media img {
  display: block;
  width: 100%;
  height: 100%;
  filter: none !important;
  object-fit: cover;
  transform: scale(1.01);
  transition: transform 440ms cubic-bezier(0.22, 1, 0.36, 1);
}

html[data-theme="light"] body.home-page main#top #services#services .service-card-media.theme-visual-dark,
html:not([data-theme="light"]) body.home-page main#top #services#services .service-card-media.theme-visual-light {
  display: none !important;
}

html body.home-page main#top #services#services .service-card-content {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100%;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 16px;
  padding: clamp(22px, 2.2vw, 28px);
}

html body.home-page main#top #services#services .service-card-content .package-heading {
  display: block !important;
  min-height: 3.4em;
}

html body.home-page main#top #services#services .service-card-content .package-heading h3 {
  max-width: 100% !important;
  color: var(--text) !important;
  font-size: clamp(1.16rem, 1.45vw, 1.42rem) !important;
  line-height: 1.2 !important;
}

html body.home-page main#top #services#services .service-package-description {
  max-width: 48ch !important;
  margin: 0 !important;
  color: var(--text-muted) !important;
  font-size: 0.94rem !important;
  line-height: 1.58 !important;
}

html body.home-page main#top #services#services .service-card-content .package-link {
  width: 100%;
  margin-top: auto !important;
}

@media (hover: hover) and (pointer: fine) {
  html body.home-page main#top #services#services .service-package-card:hover,
  html body.home-page main#top #services#services .service-package-card:focus-within {
    border-color: rgba(173, 103, 66, 0.5) !important;
    box-shadow:
      0 24px 56px rgba(25, 54, 64, 0.15),
      0 0 24px rgba(207, 116, 61, 0.18) !important;
    filter: none !important;
    transform: translateY(-3px);
  }

  html body.home-page main#top #services#services .service-package-card:hover .service-card-media img,
  html body.home-page main#top #services#services .service-package-card:focus-within .service-card-media img {
    transform: scale(1.045);
  }
}

html.light[data-theme="light"] body.home-page main#top #services#services .service-package-card {
  background: rgba(255, 255, 255, 0.96) !important;
}

/* Keep every Popular services card on the same surface as the service cards.
 * Package accent colors still remain available to icons and other details. */
html body.home-page main#top #popular#popular .service-package-card {
  background: var(--card-bg) !important;
  background-image: none !important;
}

html.light[data-theme="light"] body.home-page main#top #popular#popular .service-package-card {
  background: rgba(255, 255, 255, 0.96) !important;
  background-image: none !important;
}

html.light[data-theme="light"] body.home-page main#top #services#services .service-card-content .package-heading h3 {
  color: #24323a !important;
}

html.light[data-theme="light"] body.home-page main#top #services#services .service-package-description {
  color: #5d6b73 !important;
}

@media (min-width: 1101px) {
  html body.home-page main#top #services#services .area-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 24px !important;
  }
}

@media (min-width: 681px) and (max-width: 1100px) {
  html body.home-page main#top #services#services .area-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 22px !important;
  }
}

@media (max-width: 680px) {
  html body.home-page main#top #services#services .area-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 18px !important;
  }

  html body.home-page main#top #services#services .service-package-card {
    border-radius: 16px !important;
  }

  html body.home-page:not(#service-card-square-1):not(#service-card-square-2):not(#service-card-square-3):not(#service-card-square-4) main#top #services#services .service-package-card.service-card-family {
    border-radius: 16px !important;
  }

  html body.home-page main#top #services#services .service-card-content {
    min-height: 0;
    gap: 14px;
    padding: 20px;
  }

  html body.home-page main#top #services#services .service-card-content .package-heading {
    min-height: 2.75em;
  }

  html body.home-page main#top #services#services .service-card-media {
    border-radius: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html body.home-page main#top #services#services .service-package-card,
  html body.home-page main#top #services#services .service-card-media img {
    transition: none;
  }

  html body.home-page main#top #services#services .service-package-card:hover,
  html body.home-page main#top #services#services .service-package-card:focus-within {
    transform: none;
  }
}

/* Compact glass marks for the denser "Popular services" cards. */
html body.home-page main#top #popular#popular .popular-package-heading {
  display: flex !important;
  min-height: 76px;
  align-items: center !important;
  gap: 16px !important;
}

html body.home-page main#top #popular#popular .popular-card-icon {
  display: grid;
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  place-items: center;
}

html body.home-page main#top #popular#popular .popular-card-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

html[data-theme="light"] body.home-page main#top #popular#popular .popular-card-icon.theme-visual-dark,
html:not([data-theme="light"]) body.home-page main#top #popular#popular .popular-card-icon.theme-visual-light {
  display: none !important;
}

html body.home-page main#top #popular#popular .popular-package-heading h3 {
  min-width: 0;
  margin: 0 !important;
}

@media (max-width: 680px) {
  html body.home-page main#top #popular#popular .popular-package-heading {
    min-height: 64px;
    gap: 13px !important;
  }

  html body.home-page main#top #popular#popular .popular-card-icon {
    width: 58px;
    height: 58px;
    flex-basis: 58px;
  }
}

