/* ==========================================================================
   Projects Index
   ========================================================================== */

.projects-index {
  background-color: var(--paper);
  padding-top: 0;
  padding-bottom: clamp(4rem, 8vw, 7rem);
}

/* Header
   ========================================================================== */

.projects-index__header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  padding-top: clamp(2rem, 5vw, 4rem);
  padding-bottom: clamp(2.5rem, 6vw, 4.5rem);
}

.projects-index__heading {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.25rem, 6.5vw, 5rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
  color: var(--ink);
  max-width: 22ch;
  margin: 0 0 1.5rem;
  text-wrap: balance;
}

.projects-index__description {
  font-family: var(--font-body);
  font-size: clamp(0.9375rem, 1.1vw, 1rem);
  line-height: 1.65;
  color: var(--ink-muted);
  max-width: 64ch;
  margin: 0;
}

/* Grid
   ========================================================================== */

.projects-index__grid {
  list-style: none;
  margin: 0;
  /* Generous block padding above and below the list so the grid reads as
     a distinct, refined block — clamps match the section-padding scale
     used elsewhere (e.g. .projects-index padding-bottom). */
  padding: clamp(4rem, 8vw, 7rem) 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2.5rem, 5vw, 4rem) 1.75rem;
}

@media (min-width: 700px) {
  .projects-index__grid {
    grid-template-columns: 1fr 1fr;
    gap: clamp(3rem, 6vw, 5rem) 2.25rem;
  }
}

.projects-index__item {
  margin: 0;
}

/* Card
   ========================================================================== */

.projects-index__card {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  text-decoration: none;
  color: inherit;
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.projects-index__card:hover {
  transform: translateY(-6px);
  filter: none;
  opacity: 1;
}

.projects-index__preview {
  display: flex;
  justify-content: center;
  padding: 1rem 0 0.5rem;
}

.projects-index__preview .project-preview {
  max-width: clamp(220px, 40vw, 320px);
}

.projects-index__meta {
  display: grid;
  gap: 0.5rem;
  padding: 0;
}

.projects-index__index {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0;
}

.projects-index__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.75rem, 3.2vw, 2.5rem);
  line-height: 1;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0;
}

.projects-index__tag {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--ink-muted);
  margin: 0;
  max-width: 50ch;
}

.projects-index__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin: 0.5rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.projects-index__row span {
  display: inline-flex;
  align-items: center;
}

.projects-index__row span + span:not(.projects-index__cta)::before {
  content: "·";
  margin-right: 0.75rem;
  color: var(--ink-faint);
}

.projects-index__cta {
  margin-left: auto;
  color: var(--ink);
  transition: color 0.2s ease, transform 0.3s ease;
}

.projects-index__card:hover .projects-index__cta {
  color: var(--brand-purple);
  transform: translateX(3px);
}

/* ==========================================================================
   Dark mode
   ========================================================================== */

@media (prefers-color-scheme: dark) {
  .projects-index {
    background-color: #0A0B1B;
  }

  .projects-index__heading { color: var(--paper); }
  .projects-index__description { color: rgba(245, 241, 232, 0.72); }

  .projects-index__index { color: rgba(245, 241, 232, 0.45); }
  .projects-index__title { color: var(--paper); }
  .projects-index__tag { color: rgba(245, 241, 232, 0.72); }

  .projects-index__row {
    border-top-color: rgba(245, 241, 232, 0.14);
    color: rgba(245, 241, 232, 0.6);
  }

  .projects-index__row span + span:not(.projects-index__cta)::before {
    color: rgba(245, 241, 232, 0.32);
  }

  .projects-index__cta { color: var(--paper); }

  .projects-index__card:hover .projects-index__cta {
    color: var(--brand-blue);
  }
}
