.portfolio {
  padding: 110px 0;
  background: #eee9dc;
}
.portfolio-heading {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 100px;
  align-items: end;
  margin-bottom: 72px;
}
.portfolio-heading h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.8rem, 4.8vw, 5rem);
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 1.02;
  margin: 0;
}
.portfolio-heading h2 em {
  color: #8b6a2e;
  font-weight: 400;
}
.portfolio-links { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.portfolio-links a { color: #183127; font-size: .86rem; text-decoration: none; }
.portfolio-links a:hover { color: #8b6a2e; }
.home-project-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.home-project-card { display: flex; flex-direction: column; min-width: 0; color: inherit; background: #f7f4eb; text-decoration: none; }
.home-project-card figure { aspect-ratio: 1.28 / 1; margin: 0; overflow: hidden; background: #bec7c1; }
.home-project-card img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.home-project-card:hover img { transform: scale(1.025); }
.home-project-card > div { position: relative; flex: 1; padding: 18px 36px 20px 16px; }
.home-project-card h3 { margin: 0 0 8px; font-family: Georgia, "Times New Roman", serif; font-size: 1.12rem; font-weight: 600; line-height: 1.2; }
.home-project-card p { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.5; }
.home-project-card div > span { position: absolute; right: 15px; bottom: 18px; color: #a96d42; font-size: 1.15rem; }
.project-block {
  margin-top: 60px;
}
.project-meta {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid #b9c4bd;
  padding: 18px 0 24px;
}
.project-meta span {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.7rem;
  color: #65726b;
}
.project-meta strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.25rem;
  font-weight: 400;
}
.gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 240px;
  gap: 12px;
}
.gallery figure {
  position: relative;
  overflow: hidden;
  margin: 0;
  background: #bec7c1;
}
.gallery figure.feature {
  grid-column: span 2;
  grid-row: span 2;
}
.gallery img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 0.55s ease;
}
.gallery figure:hover img {
  transform: scale(1.025);
}
.gallery figcaption {
  position: absolute;
  left: 14px;
  bottom: 14px;
  background: #0b1511dc;
  color: #fff;
  padding: 7px 10px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}
.roof-project {
  margin-top: 100px;
}
.roof-gallery {
  grid-template-columns: 0.7fr 0.7fr 1.6fr;
  grid-auto-rows: 500px;
}
.roof-gallery figure.feature {
  grid-column: auto;
  grid-row: auto;
}
.roof-gallery figure.feature img {
  object-position: center;
}
.roof-gallery figure:not(.feature) img {
  object-position: center 35%;
}
@media (max-width: 860px) {
  .portfolio {
    padding: 80px 0;
  }
  .portfolio-heading {
    grid-template-columns: 1fr;
    gap: 24px;
    margin-bottom: 52px;
  }
  .portfolio-links { align-items: flex-start; }
  .home-project-row { grid-template-columns: 1fr 1fr; }
  .gallery {
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: 210px;
  }
  .gallery figure.feature {
    grid-column: span 2;
  }
  .roof-gallery {
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: 350px;
  }
  .roof-gallery figure.feature {
    grid-column: span 2;
    height: 320px;
  }
  .project-meta {
    flex-direction: column;
    gap: 5px;
  }
  .roof-project {
    margin-top: 72px;
  }
}
@media (max-width: 530px) {
  .home-project-row { grid-template-columns: 1fr; }
  .gallery {
    grid-template-columns: 1fr;
    grid-auto-rows: 220px;
  }
  .gallery figure.feature,
  .roof-gallery figure.feature {
    grid-column: auto;
    grid-row: auto;
    height: 240px;
  }
  .roof-gallery {
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: 300px;
  }
  .roof-gallery figure.feature {
    grid-column: span 2;
  }
  .portfolio-heading h2 {
    font-size: 3.2rem;
  }
}
