.project-page {
  padding-top: clamp(1.75rem, 4vw, 3rem);
}

.project-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 5rem;
}

.project-header .logo {
  width: 145px;
  margin: 0;
}

.home-link {
  width: fit-content;
  color: #65635f;
  font-size: 0.85rem;
  text-decoration: none;
}

.home-link::before {
  content: "←";
  margin-right: 0.45rem;
}

.home-link:hover,
.home-link:focus-visible {
  color: #171717;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.project-overview {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(220px, 0.72fr);
  gap: clamp(2rem, 8vw, 7rem);
  margin-top: clamp(2.5rem, 6vw, 4.75rem);
}

.project-kicker {
  margin-bottom: 0.3rem;
  color: #716f6a;
  font-size: 0.9rem;
  font-weight: 300;
}

.project-copy h1 {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  letter-spacing: -0.035em;
}

.project-description {
  display: grid;
  gap: 1rem;
  max-width: 90ch;
  margin-top: 1.2rem;
  color: #4f4e4b;
  font-size: 0.96rem;
  font-weight: 300;
  line-height: 1.65;
  text-align: justify;
  hyphens: auto;
}

.project-facts {
  padding-top: 0.25rem;
}

.project-facts dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem 1rem;
  margin: 0;
}

.project-facts dl > div {
  min-width: 0;
}

.project-facts .project-fact--wide {
  grid-column: 1 / -1;
}

.project-facts dt {
  margin-bottom: 0.2rem;
  color: #77746f;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-facts dd {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 300;
  line-height: 1.5;
}

.project-gallery {
  margin-top: clamp(3rem, 7vw, 5.5rem);
}

.project-gallery h2 {
  margin-bottom: 1.1rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(0.7rem, 2vw, 1.25rem);
}

.gallery-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 1.5 / 1;
  overflow: hidden;
  padding: 0;
  border: 0;
  background: #ebe9e4;
  cursor: zoom-in;
}

.gallery-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 700ms ease-in-out;
}

.gallery-thumb:hover img,
.gallery-thumb:focus-visible img {
  transform: scale(1.025);
}

.gallery-thumb:focus-visible {
  outline: 2px solid #4e4b45;
  outline-offset: 3px;
}

.gallery-thumb--plan img {
  padding: 0.35rem;
  object-fit: contain;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.photo-viewer {
  position: fixed;
  inset: 0;
  width: 100vw;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 3.75rem 4rem 2.5rem;
  border: 0;
  background: #151513;
  color: #fff;
}

.photo-viewer[open] {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr) 3.5rem;
  align-items: center;
  justify-items: center;
}

.photo-viewer::backdrop {
  background: rgb(15 15 14 / 94%);
}

.viewer-figure {
  display: grid;
  justify-items: center;
  gap: 1rem;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
}

.viewer-image {
  display: block;
  width: auto;
  height: auto;
  max-width: min(78vw, 1200px);
  max-height: 78vh;
  object-fit: contain;
}

.viewer-figure figcaption {
  color: #e8e6e1;
  font-size: 0.9rem;
  text-align: center;
}

.viewer-close,
.viewer-arrow {
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
}

.viewer-close {
  position: absolute;
  top: 1.1rem;
  right: 1.4rem;
  width: 2.75rem;
  height: 2.75rem;
  font-size: 2rem;
}

.viewer-arrow {
  width: 3.25rem;
  height: 3.25rem;
  border: 1px solid rgb(255 255 255 / 55%);
  border-radius: 50%;
  font-size: 2rem;
  line-height: 1;
}

.viewer-close:hover,
.viewer-arrow:hover {
  color: #d8d4cc;
}

.viewer-close:focus-visible,
.viewer-arrow:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
}

@media (max-width: 700px) {
  .project-header .logo {
    width: 125px;
  }

  .project-overview {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .project-facts dl {
    gap: 1rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .photo-viewer {
    padding: 4rem 1rem 2rem;
  }

  .photo-viewer[open] {
    grid-template-columns: 2.75rem minmax(0, 1fr) 2.75rem;
  }

  .viewer-image {
    max-width: 72vw;
    max-height: 76vh;
  }

  .viewer-arrow {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.6rem;
  }
}

@media (max-width: 420px) {
  .home-link {
    font-size: 0.8rem;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .gallery-thumb {
    aspect-ratio: 1.55 / 1;
  }

  .photo-viewer {
    padding-right: 0.25rem;
    padding-left: 0.25rem;
  }

  .photo-viewer[open] {
    grid-template-columns: 2.25rem minmax(0, 1fr) 2.25rem;
  }

  .viewer-image {
    max-width: 70vw;
    max-height: 70vh;
  }
}
