/* Homepage card grid and back-to-top control matched to the approved reference — 2026-07-29 */
:root {
  --portfolio-dark: #2d2d2d;
  --portfolio-white: #ffffff;
  --portfolio-green: #cccc33;
}

/* Wide, balanced three-column project grid. */
.page-home .projects {
  padding-right: clamp(24px, 5.8vw, 106px) !important;
  padding-bottom: clamp(72px, 7vw, 110px) !important;
  padding-left: clamp(24px, 5.8vw, 106px) !important;
  background: var(--portfolio-white) !important;
}

.page-home .project-filter,
.page-home .project-grid {
  width: min(100%, 1590px) !important;
  margin-right: auto !important;
  margin-left: auto !important;
}

.page-home .project-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  column-gap: clamp(32px, 3.15vw, 58px) !important;
  row-gap: clamp(44px, 4vw, 62px) !important;
  align-items: start !important;
}

.page-home .project-card,
.page-home .project-card__link {
  width: 100% !important;
  min-width: 0 !important;
  height: auto !important;
}

.page-home .project-card {
  align-self: start !important;
  background: transparent !important;
}

.page-home .project-card__link {
  display: flex !important;
  overflow: hidden !important;
  flex-direction: column !important;
  border-radius: 2px !important;
  background: var(--portfolio-dark) !important;
  box-shadow: 0 12px 28px rgba(45, 45, 45, 0.12) !important;
}

.page-home .project-card__link:hover,
.page-home .project-card__link:focus-visible {
  transform: translateY(-3px) !important;
  box-shadow: 0 18px 34px rgba(45, 45, 45, 0.17) !important;
}

.page-home .project-card__media {
  position: relative !important;
  display: block !important;
  width: 100% !important;
  aspect-ratio: 4 / 3 !important;
  overflow: hidden !important;
  flex: 0 0 auto !important;
  background: #f1f1f1 !important;
}

.page-home .project-card__cover,
.page-home .project-card__cover:nth-child(n) {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  aspect-ratio: auto !important;
  object-fit: cover !important;
  object-position: center !important;
}

.page-home .project-card__link[href="progeny-health.html"] .project-card__cover {
  object-fit: contain !important;
}

.page-home .project-card__link[href="silversneakers.html"] .project-card__cover,
.page-home .project-card__link[href="cornerstone.html"] .project-card__cover {
  object-position: center top !important;
}

/* Compact title bar, left aligned and vertically centered. */
.page-home .project-card__content {
  display: flex !important;
  min-height: 64px !important;
  height: 64px !important;
  padding: 0 16px !important;
  align-items: center !important;
  justify-content: flex-start !important;
  flex: 0 0 64px !important;
  background: var(--portfolio-dark) !important;
  color: var(--portfolio-white) !important;
  text-align: left !important;
}

.page-home .project-card__title {
  width: 100% !important;
  margin: 0 !important;
  color: var(--portfolio-white) !important;
  font-family: "Raleway", Arial, sans-serif !important;
  font-size: clamp(1rem, 1vw, 1.125rem) !important;
  font-weight: 400 !important;
  line-height: 1.2 !important;
  letter-spacing: 0 !important;
  text-align: left !important;
}

.page-home .project-card__meta {
  display: none !important;
}

/* Approved circular up button: green fill, white outline, white chevron. */
.back-to-top {
  right: 22px !important;
  bottom: 20px !important;
  display: grid !important;
  width: 60px !important;
  height: 60px !important;
  padding: 0 !important;
  place-items: center !important;
  border: 2px solid var(--portfolio-white) !important;
  border-radius: 50% !important;
  background: var(--portfolio-green) !important;
  color: transparent !important;
  font-size: 0 !important;
  line-height: 0 !important;
  box-shadow: 0 10px 28px rgba(45, 45, 45, 0.18) !important;
}

.back-to-top.is-visible {
  opacity: 1 !important;
}

.back-to-top:hover,
.back-to-top:focus-visible {
  background: var(--portfolio-green) !important;
  opacity: 1 !important;
  transform: translateY(-2px) !important;
}

.back-to-top__icon {
  display: block !important;
  width: 14px !important;
  height: 14px !important;
  margin-top: 7px !important;
  border-top: 3px solid var(--portfolio-white) !important;
  border-left: 3px solid var(--portfolio-white) !important;
  transform: rotate(45deg) !important;
}

.back-to-top__icon::before,
.back-to-top__icon::after {
  content: none !important;
}

@media (max-width: 980px) {
  .page-home .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    column-gap: clamp(24px, 4vw, 38px) !important;
    row-gap: 40px !important;
  }
}

@media (max-width: 600px) {
  .page-home .projects {
    padding-right: 18px !important;
    padding-left: 18px !important;
  }

  .page-home .project-grid {
    grid-template-columns: 1fr !important;
    width: min(100%, 430px) !important;
    row-gap: 28px !important;
  }

  .page-home .project-card__content {
    min-height: 58px !important;
    height: 58px !important;
    padding: 0 15px !important;
    flex-basis: 58px !important;
  }

  .page-home .project-card__title {
    font-size: 1rem !important;
  }

  .back-to-top {
    right: 16px !important;
    bottom: 16px !important;
    width: 52px !important;
    height: 52px !important;
  }

  .back-to-top__icon {
    width: 12px !important;
    height: 12px !important;
    border-top-width: 2.5px !important;
    border-left-width: 2.5px !important;
  }
}
