.project-index {
  --project-index-copy: #4b4c44;
  --project-index-surface: #f8f7f2;
  --project-index-accent: #a52b20;
  --project-index-tint: #f5e7e0;
  padding-bottom: clamp(40px, 5vw, 72px);
}

.project-index-heading {
  margin: clamp(22px, 2.8vw, 42px) 0 clamp(22px, 3vw, 38px);
}

.project-index-heading h1 {
  font-size: var(--type-heading-page);
  line-height: 1.08;
  letter-spacing: -.05em;
}

.project-index-heading p {
  max-width: 66ch;
  margin: 14px 0 0;
  color: var(--project-index-copy);
  font-size: var(--type-lead);
  line-height: 1.65;
}

.project-category-nav {
  display: flex;
  gap: 6px;
  margin-bottom: clamp(19px, 2.6vw, 34px);
  padding: 4px;
  width: fit-content;
  max-width: 100%;
  border: 1px solid var(--line);
  background: var(--project-index-surface);
}

.project-category-nav a {
  display: grid;
  place-items: center;
  min-height: 44px;
  padding: 9px clamp(12px, 2vw, 24px);
  text-align: center;
  font-size: var(--type-control);
  font-weight: 700;
  line-height: 1.3;
}

.project-category-nav a:hover { background: var(--soft); }
.project-category-nav a[aria-current="page"] {
  background: var(--project-index-tint);
  color: var(--project-index-accent);
  box-shadow: inset 0 -2px var(--red);
}

.project-index-grid,
.project-categories {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: clamp(17px, 2.5vw, 32px);
}

.project-index-card,
.project-category-card {
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--project-index-surface);
}

.project-index-card {
  display: flex;
  flex-direction: column;
}

.project-category-card {
  display: grid;
  grid-template-rows: auto 1fr;
}

.project-index-image {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--soft);
}

.project-index-image img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .25s ease;
}

.project-index-card .project-index-image,
.project-category-card .project-index-image { aspect-ratio: 1; }

.project-category-copy {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: center;
  gap: 4px 12px;
  padding: clamp(16px, 2vw, 28px);
  border-top: 2px solid var(--red);
}

.project-category-copy h2 {
  font-size: var(--type-card-title);
  line-height: 1.18;
}

.project-category-copy p {
  color: var(--project-index-copy);
  font-size: var(--type-control);
}

.project-index-copy {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: start;
  flex: 1;
  gap: 7px 12px;
  padding: clamp(14px, 1.55vw, 24px);
}

.project-index-copy h2 {
  margin: 0;
  font-size: var(--type-card-title);
  line-height: 1.2;
  letter-spacing: -.035em;
}

.project-index-copy p {
  grid-column: 1;
  margin: 0;
  color: var(--project-index-copy);
  font-size: var(--type-card-copy);
  line-height: 1.6;
}

.project-index-arrow {
  grid-area: 1 / 2;
  align-self: start;
  color: var(--red);
  font: 25px/1 Arial, sans-serif;
}

.project-category-card .project-index-arrow {
  grid-row: 1 / 3;
  align-self: center;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--project-index-tint);
  color: var(--project-index-accent);
  font-size: 19px;
}

@media (hover: hover) {
  .project-index :is(.project-index-card, .project-category-card):hover {
    border-color: var(--red);
  }
  .project-index :is(.project-index-card, .project-category-card):hover h2 {
    color: var(--project-index-accent);
  }
  .project-index :is(.project-index-card, .project-category-card):hover img { transform: scale(1.025); }
}

.project-index a:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 4px;
}

.project-index-contact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: clamp(29px, 4vw, 50px);
  padding: clamp(20px, 3vw, 36px);
  background: #e9e7dd;
}

.project-index-contact h2 {
  font-size: var(--type-heading-section);
  line-height: 1.14;
  letter-spacing: -.04em;
}

.project-index-contact p {
  margin: 9px 0 0;
  color: var(--project-index-copy);
  font-size: 16px;
  line-height: 1.6;
}
.project-index-contact .button { flex: none; }

@media (max-width: 900px) {
  .project-index-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 651px) {
  .project-index-heading {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, .8fr);
    align-items: end;
    gap: 20px;
  }
  .project-index-heading p {
    justify-self: end;
    width: 100%;
    max-width: 345px;
    margin: 0;
    padding: 2px 0 2px 18px;
    border-inline-start: 2px solid var(--red);
  }
}

@media (max-width: 650px) {
  .project-index--overview .project-index-heading {
    margin-bottom: 22px;
  }
  .project-index--overview .project-index-heading p {
    margin-top: 10px;
    padding: 2px 0 2px 12px;
    border-inline-start: 2px solid var(--red);
  }
  .project-category-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    gap: 3px;
  }
  .project-category-nav a { padding: 8px 4px; }
  .project-index-grid,
  .project-categories {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }
  .project-index-card .project-index-image { aspect-ratio: 6 / 5; }
  .project-category-card .project-index-image { aspect-ratio: 3 / 2; }
  .project-category-card--obje img { object-position: center 38%; }
  .project-index-copy {
    gap: 6px;
    padding: 15px 16px 17px;
  }
  .project-index-copy p { grid-column: 1 / -1; }
  .project-index-copy .project-index-arrow { font-size: 21px; }
  .project-category-card .project-index-arrow { width: 34px; height: 34px; font-size: 17px; }
  .project-index-contact { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .project-index-image img { transition: none; }
  .project-index :is(.project-index-card, .project-category-card):hover img { transform: none; }
}
