.works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

.work-card {
  display: flex;
  flex-direction: column;
  padding: 18px;
  font-size: 15px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--text);
  border-radius: var(--radius);
  cursor: pointer;
  font-family: "DM Sans", monospace, sans-serif;
  transition: 0.2s ease;
  width: 100%;
  min-height: 260px;
}

.work-card:hover {
  box-shadow: 0 10px 22px rgba(127, 67, 124, 0.2);
  border-color: var(--accent);
  transform: translateY(-4px) rotate(-0.6deg);
}

.works-grid a:nth-child(even) .work-card:hover {
  transform: translateY(-4px) rotate(0.6deg);
}

.work-card .content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
}

.work-card h1,
.work-card h2,
.work-card h3 {
  font-size: 18px;
  margin: 0;
  letter-spacing: 0.4px;
  font-weight: 600;
}

.work-card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}

.work-card img {
  max-width: 80%;
  max-height: 140px;
  align-self: center;
  border-radius: 8px;
  object-fit: contain;
  border: 1px solid var(--line);
}

.works-grid a {
  text-decoration: none;
}

@media (max-width: 768px) {
  .works-grid {
    gap: 16px;
  }

  .work-card {
    min-height: auto;
    padding: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .work-card:hover,
  .works-grid a:nth-child(even) .work-card:hover {
    transform: none;
  }
}

@media (max-width: 480px) {
  .work-card {
    font-size: 14px;
    min-height: 220px;
  }
}
