.project-directory-hero h1 {
  max-width: 13ch;
}

.project-directory-hero .editorial-hero-media,
.project-case-hero .editorial-hero-media {
  object-position: 65% 54%;
}

.project-directory-heading {
  flex-wrap: wrap;
}

.project-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.project-filters button,
.project-gallery-arrow {
  display: inline-grid;
  min-height: 44px;
  place-items: center;
  padding: 5px 13px;
  border: 1px solid #36516e;
  border-radius: 4px;
  background: #121e30;
  color: #d6e7fb;
  font-weight: 700;
}

.project-filters button:hover,
.project-filters button[aria-pressed="true"],
.project-gallery-arrow:hover {
  border-color: #7ab9ff;
  background: #1d416c;
  color: #fff;
}

.project-directory-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.project-directory-card[hidden] {
  display: none;
}

.project-directory-card {
  min-height: clamp(275px, 26vw, 365px);
}

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

.project-directory-grid .project-directory-card {
  min-height: 0;
  padding: 0;
  justify-content: flex-start;
  background: #111a28;
}

.project-directory-grid .project-directory-card::after {
  display: none;
}

.project-directory-grid .project-directory-card img {
  position: static;
  z-index: auto;
  display: block;
  height: auto;
  aspect-ratio: 16 / 9;
  transition: filter .25s;
}

.project-directory-grid .project-directory-card:hover img {
  transform: none;
  filter: brightness(1.1);
}

.project-directory-grid .project-directory-card-copy {
  flex: 1;
  padding: clamp(16px, 2vw, 27px);
}

.project-directory-grid .project-directory-card-copy > p {
  margin-bottom: 16px;
}

.project-directory-grid .project-card-link {
  margin-top: auto;
}

.project-card-link {
  align-self: start;
  margin-top: 15px;
  padding-bottom: 2px;
  border-bottom: 1px solid #8ebdff;
  color: #c8e3ff;
  font-size: .84rem;
  font-weight: 700;
}

.project-card-link span {
  margin-inline-start: 3px;
}

.project-case-hero h1 {
  max-width: 16ch;
  font-size: clamp(2.75rem, 5.5vw, 5.7rem);
}

.project-wide-cover .editorial-hero-media {
  inset-inline-start: auto;
  width: 74%;
  object-position: 64% 62%;
}

.project-wide-cover .editorial-shade {
  background: linear-gradient(90deg, #080c14 14%, #080c14f5 29%, #080c14a8 43%, #080c140a 72%),
    linear-gradient(0deg, #080c1485, transparent 28%);
}

.project-wide-cover .editorial-intro {
  max-width: 42ch;
}

.project-facts {
  display: grid;
  grid-template-columns: minmax(120px, .68fr) minmax(0, 2fr);
  align-items: center;
  gap: 15px 26px;
  padding-block: clamp(25px, 4vw, 45px);
}

.project-facts h2 {
  color: #edf5ff;
  font-size: clamp(1.45rem, 2.65vw, 2.3rem);
  line-height: 1.12;
}

.project-facts dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
  margin: 0;
}

.project-facts dl > div {
  padding-inline-start: 13px;
  border-left: 1px solid #4378b3;
}

.project-facts dt {
  color: #9ecbff;
  font-size: .79rem;
  font-weight: 700;
  text-transform: uppercase;
}

.project-facts dd {
  margin: 3px 0 0;
  color: #e3eaf3;
  line-height: 1.38;
}

.project-gallery-band,
.project-detail-band {
  border-block: 1px solid #293e5c;
  background: #101824;
}

.project-gallery-band {
  background: radial-gradient(ellipse at 75% 0, #162c48 0, transparent 55%), #0d1521;
}

.project-gallery {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(100px, .24fr);
  align-items: start;
  gap: 12px;
}

.project-gallery:not(:has(.project-gallery-thumbs)) {
  grid-template-columns: minmax(0, 1fr);
}

.project-gallery-feature,
.project-lightbox figure {
  min-width: 0;
  margin: 0;
  border: 1px solid #324c6e;
  border-radius: 5px;
  background: #111b29;
}

.project-gallery-open {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 4px 4px 0 0;
  background: #0b111b;
  text-align: end;
}

.project-gallery-open:focus-visible {
  z-index: 1;
  outline-offset: 1px;
}

.project-gallery-open img {
  width: 100%;
  height: auto;
  aspect-ratio: 1.95;
  object-fit: cover;
}

.project-gallery-mixed .project-gallery-open img {
  display: block;
  aspect-ratio: 1.55;
  object-fit: contain;
}

.project-gallery-open > span {
  position: absolute;
  inset: auto 12px 10px auto;
  padding: 5px 9px;
  border: 1px solid #739bc8;
  border-radius: 4px;
  background: #080f1be8;
  color: #e9f5ff;
  font-size: .8rem;
  font-weight: 700;
}

.project-gallery-caption {
  display: flex;
  min-height: 63px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 7px 14px;
  padding: 8px 13px;
  color: #e3edf9;
  font-size: .93rem;
  line-height: 1.4;
}

.project-gallery-caption > span:first-child {
  flex: 1 1 230px;
}

.project-gallery-controls {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 8px;
}

.project-gallery-controls output {
  min-width: 5ch;
  color: #c4d6ed;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.project-gallery-arrow {
  width: 44px;
  padding: 0;
  font-size: 1.15rem;
}

.project-gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.project-gallery-thumbs button {
  display: block;
  min-width: 0;
  padding: 2px;
  border: 1px solid #496482;
  border-radius: 4px;
  background: #152235;
}

.project-gallery-thumbs button:hover,
.project-gallery-thumbs button[aria-pressed="true"] {
  border-color: #8ec7ff;
  background: #2b6eb5;
}

.project-gallery-thumbs img {
  width: 100%;
  height: auto;
  aspect-ratio: 1.4;
  object-fit: cover;
  border-radius: 2px;
}

.project-lightbox {
  width: min(1120px, calc(100% - 28px));
  max-width: none;
  max-height: calc(100dvh - 20px);
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #edf5ff;
}

.project-lightbox::backdrop {
  background: #05080eea;
}

.project-lightbox-body {
  position: relative;
}

.project-lightbox figure img {
  width: 100%;
  max-height: calc(100dvh - 135px);
  min-height: 100px;
  margin-inline: auto;
  object-fit: contain;
  background: #0a111b;
}

.project-lightbox-close {
  position: absolute;
  z-index: 1;
  inset: 8px 8px auto auto;
  display: grid;
  width: 45px;
  height: 45px;
  place-items: center;
  padding: 0;
  border: 1px solid #7899c1;
  border-radius: 4px;
  background: #102037eb;
  color: #fff;
  font-size: 1.7rem;
  line-height: 1;
}

.project-lightbox-close:focus-visible {
  outline-offset: 2px;
}

html:has(.project-lightbox[open]) {
  overflow: hidden;
}

.project-phases {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: project-phase;
}

.project-phases li {
  padding: clamp(12px, 1.6vw, 20px);
  border: 1px solid #2d405a;
  border-top: 2px solid #5a99e7;
  border-radius: 4px;
  background: #111a28;
  counter-increment: project-phase;
}

.project-phases li::before {
  display: block;
  margin-bottom: 9px;
  color: #9bccff;
  font-size: 1.15rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  content: counter(project-phase, decimal-leading-zero);
}

.project-phases h3,
.project-writeup h3,
.project-sources h3,
.project-detail-aside h3,
.project-links h3 {
  margin-bottom: 8px;
  color: #edf5ff;
  line-height: 1.24;
}

.project-phases h3 {
  font-size: 1.05rem;
}

.project-phases p {
  color: #c2d2e6;
  font-size: .92rem;
  line-height: 1.5;
}

.project-detail-grid {
  display: grid;
  grid-template: "writeup contents" / minmax(0, 1fr) minmax(215px, .33fr);
  align-items: start;
  gap: clamp(19px, 4vw, 52px);
}

.project-detail-aside {
  grid-area: contents;
  position: sticky;
  top: 100px;
  padding: 17px;
  border: 1px solid #3e5678;
  border-radius: 4px;
  background: #101f33;
}

.project-detail-copy {
  grid-area: writeup;
  max-width: 74ch;
}

.project-writeup + .project-writeup,
.project-sources {
  margin-top: 27px;
  padding-top: 23px;
  border-top: 1px solid #30445f;
}

.project-writeup h3 {
  font-size: clamp(1.24rem, 2.4vw, 1.72rem);
}

.project-writeup p {
  color: #d3deec;
  font-size: clamp(1rem, 1.5vw, 1.08rem);
  line-height: 1.68;
}

.project-writeup p + p {
  margin-top: 12px;
}

.project-writeup a,
.project-phases a {
  color: #a9d7ff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.project-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.project-links > section {
  padding: 18px;
  border: 1px solid #304661;
  border-radius: 4px;
  background: #111b29;
}

.project-related-grid .project-card {
  min-height: clamp(225px, 20vw, 310px);
}

.project-return {
  margin-top: 22px;
}

@media (max-width: 1000px) {
  .project-phases {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

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

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

  .project-detail-grid {
    grid-template: "contents" "writeup" / minmax(0, 1fr);
  }

  .project-gallery-thumbs {
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  }

  .project-wide-cover {
    min-height: auto;
  }

  .project-wide-cover .editorial-hero-inner {
    grid-row: 1;
    padding-block: 24px 26px;
  }

  .project-wide-cover .breadcrumb {
    margin-bottom: 26px;
  }

  .project-wide-cover .editorial-hero-media {
    position: relative;
    grid-row: 2;
    width: 100%;
    height: auto;
    z-index: 0;
    aspect-ratio: 16 / 9;
  }

  .project-wide-cover .editorial-shade {
    display: none;
  }

  .project-detail-aside {
    position: static;
  }
}

@media (max-width: 480px) {
  .project-directory-grid,
  .project-links,
  .project-phases {
    grid-template-columns: minmax(0, 1fr);
  }

  .project-case-hero h1 {
    max-width: 100%;
    font-size: clamp(2rem, 9vw, 3.25rem);
  }

  .project-directory-hero .editorial-hero-media,
  .project-case-hero .editorial-hero-media {
    object-position: 61% 44%;
  }

  .project-facts dl {
    grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  }

  .project-gallery-open img {
    aspect-ratio: 1.5;
  }

  .project-gallery-mixed .project-gallery-open img {
    aspect-ratio: 1.16;
  }

  .project-phases li {
    display: grid;
    grid-template-columns: 27px minmax(0, 1fr);
    gap: 8px;
  }
}
