.projects-page {
  min-height: 100vh;
  background: #f7f4ef;
}

.projects-page main { min-height: calc(100vh - var(--nav-height)); }

.project-gallery {
  position: relative;
  display: flex;
  min-height: calc(100vh - var(--nav-height));
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding: calc(var(--nav-height) + 2rem) clamp(1.5rem, 3vw, 3.5rem) clamp(4.5rem, 8vw, 7rem);
  background-color: #f7f4ef;
  background-image:
    linear-gradient(rgba(119, 98, 72, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(119, 98, 72, 0.055) 1px, transparent 1px),
    linear-gradient(rgba(119, 98, 72, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(119, 98, 72, 0.025) 1px, transparent 1px);
  background-size: 32px 32px, 32px 32px, 8px 8px, 8px 8px;
}

.project-gallery__heading {
  position: absolute;
  top: calc(var(--nav-height) + 1.5rem);
  left: clamp(1.5rem, 3vw, 3.5rem);
  z-index: 2;
}

.project-gallery__heading p {
  margin-bottom: 0.25rem;
  color: #98928a;
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.project-gallery__heading h1 {
  font-family: var(--font-sans);
  font-size: clamp(1.15rem, 1.5vw, 1.55rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.technical-marks {
  position: absolute;
  inset: 0;
  color: rgba(112, 101, 87, 0.085);
  font-family: Georgia, serif;
  font-size: clamp(1.25rem, 2vw, 2.2rem);
  pointer-events: none;
  user-select: none;
}
.technical-marks span { position: absolute; }
.technical-marks span:nth-child(1) { top: 44%; left: 13%; }
.technical-marks span:nth-child(2) { top: 22%; left: 38%; }
.technical-marks span:nth-child(3) { top: 51%; left: 68%; }
.technical-marks span:nth-child(4) { top: 25%; right: 4%; }

.project-gallery__grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(2rem, 5vw, 7rem);
  align-items: start;
  width: 100%;
}

.gallery-project {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  color: #292724;
  text-align: center;
  text-decoration: none;
}

.gallery-project__image {
  position: relative;
  display: flex;
  width: clamp(9rem, 12vw, 13rem);
  max-width: 100%;
  aspect-ratio: 1;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #ebe6de;
  box-shadow: 0 8px 25px rgba(52, 42, 31, 0.08);
  transition: transform 240ms ease, box-shadow 240ms ease;
}

.gallery-project__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.gallery-project--liminal .gallery-project__image { border-radius: 2.75rem 1.1rem 3.2rem 1.25rem; }
.gallery-project--magnitai .gallery-project__image { border-radius: 3.7rem 1.4rem 3.2rem 2rem; }
.gallery-project--pending .gallery-project__image { border-radius: 3.2rem 2rem 3rem 1.3rem; }
.gallery-project--kodara .gallery-project__image { border-radius: 3.7rem 1.2rem 3.5rem 1.6rem; }

a.gallery-project:hover .gallery-project__image,
a.gallery-project:focus-visible .gallery-project__image {
  transform: translateY(-4px);
  box-shadow: 0 14px 32px rgba(52, 42, 31, 0.14);
}

.gallery-project__copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.8rem;
}

.gallery-project__copy strong {
  font-size: clamp(0.68rem, 0.78vw, 0.82rem);
  font-weight: 500;
  line-height: 1.25;
}

.gallery-project__copy small {
  color: #a09a93;
  font-size: clamp(0.6rem, 0.7vw, 0.72rem);
  font-weight: 400;
  line-height: 1.3;
}

.gallery-project__placeholder {
  border: 1px solid rgba(54, 48, 41, 0.2);
  background: rgba(185, 232, 121, 0.72);
}
.gallery-project__placeholder i { position: absolute; border: 1px solid rgba(17,17,17,.45); }
.gallery-project__placeholder i:nth-child(1) { width: 55%; aspect-ratio: 1; border-radius: 50%; }
.gallery-project__placeholder i:nth-child(2) { width: 80%; height: 30%; border-radius: 999px; transform: rotate(-18deg); }
.gallery-project__placeholder b { position: relative; padding: 0.4rem; background: #c9ee98; font-size: 1.25rem; font-weight: 500; }

.site-footer { background: #f7f4ef; }

@media (max-width: 820px) {
  .project-gallery { justify-content: flex-start; padding-top: calc(var(--nav-height) + 7rem); }
  .project-gallery__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 3.5rem; }
  .gallery-project__image { width: clamp(9rem, 30vw, 12rem); }
}

@media (max-width: 480px) {
  .project-gallery { padding-inline: 1.25rem; }
  .project-gallery__grid { gap: 3rem 1.25rem; }
  .gallery-project__image { width: min(100%, 9.5rem); border-radius: 2rem !important; }
  .gallery-project__copy small { max-width: 9rem; }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-project__image { transition: none; }
}
