.portfolio-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -30px 0 38px;
}

.portfolio-filter button {
  appearance: none;
  border: 1px solid #d6dbd5;
  background: transparent;
  padding: 10px 14px;
  color: #66716b;
  font: 700 10px "DM Sans", sans-serif;
  letter-spacing: .04em;
  cursor: pointer;
  transition: .2s;
}

.portfolio-filter button:hover,
.portfolio-filter button.active {
  background: var(--forest);
  border-color: var(--forest);
  color: white;
}

.project {
  border: 0;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 16px 46px rgba(19, 45, 35, .09);
  transition: opacity .25s, transform .25s;
}

.project.hidden {
  display: none;
}

.project-visual {
  position: relative;
  min-height: 0;
  aspect-ratio: 1 / 1;
  padding: 0;
  background: linear-gradient(145deg, #eef3ef, #f8faf7);
  border-bottom: 1px solid #e5eae5;
}

.project-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
}

.project.featured {
  grid-column: auto;
  display: block;
}

.project.featured .project-visual {
  min-height: 0;
}

.project-visual::after {
  display: none;
}

.project-visual img {
  width: calc(100% - 24px);
  height: calc(100% - 24px);
  position: absolute;
  inset: 12px;
  object-fit: contain;
  border-radius: 14px;
  box-shadow: 0 8px 26px rgba(15, 37, 29, .08);
  transition: transform .55s ease;
}

.project:hover .project-visual img {
  transform: translateY(-4px) scale(1.01);
}

.project:hover {
  transform: translateY(-5px);
  box-shadow: 0 22px 60px rgba(19, 45, 35, .14);
}

.project-copy {
  padding: 27px;
}

.project-copy h3 {
  font-size: 24px;
}

@media (max-width: 1180px) {
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 800px) {
  .portfolio-filter { margin-top: -20px; }
  .project-grid { grid-template-columns: 1fr; }
  .project.featured .project-visual { min-height: 0; }
}
