.projects {
  position: relative;
  padding: 7rem 0;
  background: #0a0a0f;
}

/* ================= LINE ================= */

.projects-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    rgba(99,102,241,0.35),
    transparent
  );
}

/* ================= CONTAINER ================= */

.projects-container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ================= HEADER ================= */

.projects-header {
  text-align: center;
  margin-bottom: 5rem;
}

.projects-eyebrow {
  color: #818cf8;
  font-size: .7rem;
  letter-spacing: .35em;
  text-transform: uppercase;
  opacity: .9;
}

.projects-title {
  margin: 1rem 0 1.25rem;
  font-size: clamp(2.5rem, 5vw, 3.4rem);
  font-weight: 700;
  color: white;
}

.projects-title .gradient {
  background: linear-gradient(90deg, #818cf8, #22d3ee);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.projects-description {
  max-width: 620px;
  margin: 0 auto;
  color: #9ca3af;
  font-size: 1.05rem;
  line-height: 1.7;
}

/* ================= GRID (INTELIGENTE) ================= */

.projects-grid {
  display: grid;
  gap: 48px;
  justify-content: center;
}

/* 👉 quando houver APENAS 1 projeto */
.projects-grid:has(.project-card:only-child) {
  grid-template-columns: 1fr;
}

/* 👉 quando houver 2 ou mais */
.projects-grid:not(:has(.project-card:only-child)) {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

/* ================= CARD ================= */

.project-card {
  width: 100%;
  max-width: 360px;
}

/* destaque automático quando for único */
.projects-grid:has(.project-card:only-child) .project-card {
  max-width: 480px;
}

.card {
  display: flex;
  flex-direction: column;
  border-radius: 1.25rem;
  background: rgba(255,255,255,0.035);
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(10px);
  overflow: hidden;
  transition:
    transform .45s ease,
    box-shadow .45s ease,
    border-color .45s ease;
}

.project-card:hover .card {
  transform: translateY(-6px);
  border-color: rgba(99,102,241,.45);
  box-shadow: 0 26px 50px -22px rgba(99,102,241,.35);
}

/* ================= IMAGE ================= */

.card-image {
  position: relative;
  height: 180px;
  overflow: hidden;
}

.card-image::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .85;
  z-index: 1;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .45;
  transition: transform .7s ease, opacity .4s ease;
}

.project-card:hover img {
  transform: scale(1.08);
  opacity: .65;
}

/* ================= CONTENT ================= */

.card-content {
  padding: 26px;
}

.card-content h3 {
  font-size: 1.3rem;
  color: white;
  margin-bottom: 12px;
  transition: color .3s ease;
}

.project-card:hover h3 {
  color: #a5b4fc;
}

.card-content p {
  color: #9ca3af;
  margin-bottom: 18px;
  line-height: 1.65;
}

/* ================= TAG ================= */

.tags {
  display: flex;
}

.tag {
  padding: 6px 16px;
  border-radius: 999px;
  font-size: .75rem;
  color: #c7d2fe;
  border: 1px solid rgba(99,102,241,.45);
  text-decoration: none;
  transition: all .25s ease;
}

.tag:hover {
  background: rgba(99,102,241,.15);
  transform: translateY(-1px);
}

/* ================= CTA ================= */

.projects-cta {
  margin-top: 80px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
}

.projects-cta p {
  color: #9ca3af;
  font-size: 1.05rem;
  max-width: 520px;
}

.btn-primary {
  padding: 16px 36px;
  min-width: 260px;
  border-radius: 16px;
  border: none;
  background: linear-gradient(90deg, #4f46e5, #7c3aed);
  color: white;
  font-size: .95rem;
  cursor: pointer;
  transition: transform .25s ease, box-shadow .25s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(99,102,241,.45);
}

.projects-cta .btn-primary {
  width: 280px !important;
  height: 52px;

  display: inline-flex;
  align-items: center;
  justify-content: center;
}

