.projects {
  padding: 108px 0;
  background: #fff;
}
.projects-container {
  width: min(92%, 970px);
  margin: auto;
}
.projects-heading {
  text-align: center;
}
.projects-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 15px;
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  background: #eef2ff;
  color: #4264f5;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.65px;
}
.projects-heading h2 {
  margin: 14px 0 8px;
  color: #0f172a;
  font-size: clamp(33px, 4vw, 42px);
  font-weight: 800;
  letter-spacing: -0.8px;
  line-height: 1.15;
}
.projects-heading h2 span {
  background: linear-gradient(90deg, #2563eb, #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.projects-heading p {
  margin: 0;
  color: #64748b;
  font-size: 13px;
}
.project-filters {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 31px 0 25px;
}
.project-filters button {
  padding: 8px 15px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #fff;
  color: #334155;
  font-family: inherit;
  font-size: 9px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.25s;
}
.project-filters button.active,
.project-filters button:hover {
  border-color: transparent;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  box-shadow: 0 7px 15px rgba(79, 70, 229, 0.2);
}
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.project-card {
  overflow: hidden;
  border: 1px solid #eaf0f7;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 7px 16px rgba(15, 23, 42, 0.05);
  transition:
    transform 0.25s,
    box-shadow 0.25s;
}
.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 17px 28px rgba(15, 23, 42, 0.12);
}
.project-card.is-hidden {
  display: none;
}
.project-image {
  position: relative;
  height: 120px;
  background-image:
    linear-gradient(130deg, var(--project-tint), transparent 65%),
    url("../images/projects-sprite.png");
  background-size:
    100% 100%,
    300% auto;
  background-position:
    0 0,
    var(--project-position);
}
.project-category,
.project-industry {
  position: absolute;
  top: 9px;
  padding: 4px 7px;
  border-radius: 5px;
  font-size: 8px;
  font-weight: 700;
  line-height: 1;
}
.project-category {
  left: 9px;
  background: var(--project-color);
  color: #fff;
}
.project-industry {
  right: 9px;
  background: #fff;
  color: #475569;
}
.project-content {
  padding: 12px 13px;
}
.project-content h3 {
  margin: 0 0 8px;
  color: #0f172a;
  font-size: 11px;
  font-weight: 700;
}
.project-content > p {
  display: -webkit-box;
  overflow: hidden;
  min-height: 32px;
  margin: 0;
  color: #64748b;
  font-size: 9px;
  line-height: 1.55;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.project-tags {
  display: flex;
  gap: 5px;
  overflow: hidden;
  margin: 10px 0;
}
.project-tags span {
  flex: 0 0 auto;
  padding: 4px 6px;
  border-radius: 4px;
  background: #f8fafc;
  color: #64748b;
  font-size: 7px;
}
.project-stats {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 9px;
  border-top: 1px solid #edf2f7;
}
.project-stats span {
  display: grid;
  gap: 1px;
}
.project-stats strong {
  color: var(--project-color);
  font-size: 9px;
}
.project-stats small {
  color: #94a3b8;
  font-size: 7px;
}
.project-stats > i {
  margin-left: auto;
  color: #94a3b8;
  font-size: 13px;
}
.project-card--red {
  --project-color: #f43f5e;
  --project-tint: rgba(244, 63, 94, 0.18);
}
.project-card--orange {
  --project-color: #f97316;
  --project-tint: rgba(249, 115, 22, 0.18);
}
.project-card--blue {
  --project-color: #2563eb;
  --project-tint: rgba(37, 99, 235, 0.16);
}
.project-card--purple {
  --project-color: #7c3aed;
  --project-tint: rgba(124, 58, 237, 0.17);
}
.project-card--amber {
  --project-color: #f59e0b;
  --project-tint: rgba(245, 158, 11, 0.16);
}
.project-card--pink {
  --project-color: #ec4899;
  --project-tint: rgba(236, 72, 153, 0.16);
}
.projects-more {
  display: flex;
  width: max-content;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 26px auto 0;
  padding: 0 17px;
  border: 1px solid #2563eb;
  border-radius: 8px;
  color: #2563eb;
  font-size: 10px;
  font-weight: 700;
  transition: 0.25s;
}
.projects-more:hover {
  background: #2563eb;
  color: #fff;
  transform: translateY(-2px);
}
@media (max-width: 760px) {
  .projects {
    padding: 80px 0;
  }
  .projects-container {
    width: min(90%, 610px);
  }
  .projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .project-image {
    height: 130px;
  }
}
@media (max-width: 500px) {
  .projects-heading p {
    font-size: 12px;
  }
  .project-filters {
    gap: 7px;
    margin: 25px 0 20px;
  }
  .project-filters button {
    padding: 7px 11px;
    font-size: 8px;
  }
  .projects-grid {
    grid-template-columns: 1fr;
  }
  .project-image {
    height: 155px;
  }
  .project-content {
    padding: 14px;
  }
  .project-content h3 {
    font-size: 13px;
  }
  .project-content > p {
    font-size: 10px;
  }
  .project-stats strong {
    font-size: 10px;
  }
}

/* Keep featured work aligned with the 1320px content width. */
.projects-container { width: min(92%, 1320px); }
.project-image { height: 160px; }
.project-content { padding: 14px 15px; }
.project-content h3 { font-size: 12px; }
.project-content > p { font-size: 10px; }
.project-tags span { font-size: 8px; }
.project-stats { gap: 22px; }
.project-stats strong { font-size: 10px; }
.project-stats small { font-size: 8px; }
.projects-more { border: 1px solid #2563eb; background: #fff; font-family: inherit; cursor: pointer; }

/* Four columns preserve the card proportions inside the 1320px container. */
.projects-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.project-image { height: auto; aspect-ratio: 2 / 1; }

@media (max-width: 1100px) {
  .projects-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .projects-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-image { height: auto; aspect-ratio: 2 / 1; }
}

@media (max-width: 500px) {
  .project-image { height: auto; aspect-ratio: 2 / 1; }
}

/* Phone-first refinements: avoid cramped cards and wrapped filter controls. */
@media (max-width: 500px) {
  .projects { padding: 68px 0; }
  .projects-container { width: min(92%, 430px); }
  .projects-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .projects-heading h2 { font-size: 32px; line-height: 1.2; }
  .projects-heading p { padding: 0 12px; line-height: 1.55; }

  .project-filters {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    margin: 24px -4% 22px;
    padding: 4px 4%;
    scrollbar-width: none;
  }

  .project-filters::-webkit-scrollbar { display: none; }
  .project-filters button { flex: 0 0 auto; padding: 8px 14px; font-size: 9px; }

  .projects-grid { gap: 15px; }
  .project-card { border-radius: 14px; }
  .project-image { aspect-ratio: 1.45 / 1; }
  .project-content { padding: 13px; }
  .project-content h3 { margin-bottom: 8px; font-size: 12px; }
  .project-content > p { min-height: 0; font-size: 10px; line-height: 1.55; }
  .project-tags { margin: 12px 0; }
  .project-tags span { padding: 5px 7px; font-size: 8px; }
  .project-stats { justify-content: space-between; gap: 8px; padding-top: 11px; }
  .project-stats strong { font-size: 10px; }
  .project-stats small { font-size: 7px; }
  .project-stats > i { margin-left: 4px; }
  .projects-more { width: 100%; min-height: 44px; margin-top: 22px; border-radius: 10px; font-size: 11px; }
}
