html {
  scroll-padding-top: 104px;
}

.hero {
  min-height: 620px;
  display: flex;
  align-items: end;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: url("images/portfolio-charlestown-kitchen.webp") center 58% / cover no-repeat;
  color: var(--color-white);
}

.hero::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(7, 19, 33, 0.92), rgba(7, 19, 33, 0.5));
  content: "";
}

.hero-content {
  max-width: 820px;
  padding: 110px 0 90px;
}

.category-nav,
.gallery-section,
.contact-cta {
  padding: var(--section-spacing) 0;
  scroll-margin-top: 96px;
}

.category-nav {
  background: var(--color-cream);
}

.section-intro {
  max-width: 820px;
  margin-bottom: 44px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}

.category-card {
  min-height: 330px;
  display: flex;
  align-items: end;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: var(--radius-medium);
  box-shadow: var(--shadow-soft);
  color: var(--color-white);
}

.category-card::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to top, rgba(7, 17, 29, 0.92), rgba(7, 17, 29, 0.05) 72%);
  content: "";
}

.category-card img {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  z-index: -2;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.category-card:hover img {
  transform: scale(1.035);
}

.category-card-content {
  width: 100%;
  padding: 24px;
}

.category-card h2 {
  margin-bottom: 8px;
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: -0.025em;
  line-height: 1;
  text-transform: uppercase;
}

.category-card span {
  color: #e7edf4;
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.gallery-section {
  border-top: 1px solid var(--color-border);
}

.gallery-section.surface-light {
  background: var(--color-surface);
}

.gallery-section.surface-alt {
  background: var(--color-surface-alt);
}

.gallery-heading {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 42px;
  align-items: end;
  margin-bottom: 30px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: 245px;
  gap: 18px;
}

.gallery-grid figure {
  grid-column: span 4;
  overflow: hidden;
  border-radius: var(--radius-medium);
  background: #dedbd4;
  box-shadow: 0 10px 24px rgba(11, 23, 38, 0.07);
}

.gallery-grid figure.feature {
  grid-column: span 8;
  grid-row: span 2;
}

.gallery-grid figure.tall {
  grid-row: span 2;
}

.gallery-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.gallery-grid figure:hover img {
  transform: scale(1.025);
}

.gallery-grid figcaption {
  padding: 12px 14px;
  background: var(--color-surface);
  color: var(--color-muted);
  font-size: 14px;
}

.gallery-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 24px;
}

.gallery-footer a {
  color: var(--color-blue-dark);
  font-size: 13px;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.contact-cta {
  background:
    linear-gradient(rgba(11, 23, 38, 0.97), rgba(11, 23, 38, 0.97)),
    radial-gradient(circle at top right, rgba(183, 121, 56, 0.25), transparent 42%);
  color: var(--color-white);
  text-align: center;
}

.contact-cta h2 {
  color: var(--color-white);
}

.contact-cta p {
  max-width: 680px;
  margin: 0 auto 28px;
  color: #cbd5df;
  font-size: 17px;
}

@media (max-width: 980px) {
  .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .category-card {
    min-height: 360px;
  }

  .gallery-grid figure,
  .gallery-grid figure.feature {
    grid-column: span 6;
  }
}

@media (max-width: 760px) {
  .hero {
    min-height: 560px;
    background-position: 62% center;
  }

  .hero-content {
    padding: 90px 0 72px;
  }

  .gallery-heading {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .gallery-grid {
    grid-auto-rows: 290px;
  }

  .gallery-grid figure,
  .gallery-grid figure.feature,
  .gallery-grid figure.tall {
    grid-column: 1 / -1;
    grid-row: span 1;
  }
}

@media (max-width: 520px) {
  .category-grid {
    grid-template-columns: 1fr;
  }

  .category-card {
    min-height: 310px;
  }
}
