.projects-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(28ch, 1fr));
  padding: 0.5rem;
}

.project-card {
  background: var(--highlight_low);
  border: 1px solid var(--highlight_high);
  border-radius: 12px;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
  transition:
    border-color 0.15s ease,
    transform 0.08s ease,
    box-shadow 0.2s ease;
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
}

.project-card:hover {
  border-color: var(--subtle);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.18);
}

.card-media {
  display: block;
  border-bottom: 1px solid var(--highlight_high);
  background: var(--surface);
  aspect-ratio: 16 / 9;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-body {
  padding: 0.9rem 1rem 1rem;
  display: grid;
  gap: 0.6rem;
  color: var(--text);
}

.card-title {
  margin: 0;
  font-size: clamp(0.95rem, 1.2vw + 0.7rem, 1.15rem);
  font-weight: 800;
  color: var(--text);
}

.card-desc {
  margin: 0;
  color: var(--text);
  opacity: 0.9;
}

.card-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.2rem;
}

.view-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.45em 0.8em;
  border: 1px solid var(--highlight_high);
  border-radius: 0.6rem;
  background: var(--overlay);
  color: var(--text);
  text-decoration: none;
  line-height: 1;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.05s ease;
}

.view-btn:hover {
  background: var(--surface);
  border-color: var(--subtle);
}

.view-btn:active {
  transform: translateY(1px);
}

.tags {
  display: flex;
  gap: 0.4rem;
  list-style: none;
  padding: 0;
  margin: 0 0 0 auto;
}

.tags li {
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--highlight_high);
  background: var(--overlay);
  border-radius: 0.5rem;
  font-size: 0.85em;
  white-space: nowrap;
}

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

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

.projects-grid {
  scrollbar-gutter: stable both-edges;
}
