/* The header occupies its own row. Grow beyond the viewport when enlarged text needs room. */
.project-masthead {
  position: relative;
  isolation: isolate;
  display: grid;
  align-content: end;
  min-height: calc(100vh - var(--header));
  min-height: calc(100dvh - var(--header));
  padding: clamp(5rem, 14vh, 9rem) var(--page-rail) max(clamp(2rem, 7vh, 5.5rem), env(safe-area-inset-bottom));
  background: #252a2d;
  color: #fff;
}
#main .project-masthead-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fff;
  cursor: zoom-in;
}
.project-masthead-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.project-masthead-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(10, 14, 17, .86), rgba(10, 14, 17, .58) 19%, rgba(10, 14, 17, .13) 48%, transparent 70%);
}
.project-masthead-content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 2rem;
  pointer-events: none;
}
.project-masthead-heading { width: fit-content; max-width: 100%; pointer-events: auto; }
.project-masthead .project-masthead-label {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 0 0 .75rem;
  font-size: .75rem;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.project-masthead-label::before { content: ""; width: 1.75rem; height: 2px; background: #ef3340; }
#main .project-masthead h1 {
  margin: 0;
  max-width: 21ch;
  font-size: clamp(3rem, min(7.2vw, 13vh), 7.5rem);
  font-weight: 600;
  letter-spacing: -.054em;
  line-height: 1.04;
  hyphens: none;
  text-wrap: balance;
}
.project-masthead .project-masthead-details {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .2em .7em;
  margin: .9rem 0 0;
  font-size: clamp(.9375rem, 1.1vw, 1.125rem);
  line-height: 1.5;
  font-weight: 500;
}
.project-masthead-details [aria-hidden] { opacity: .8; }
.project-masthead-explore, .project-masthead-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  min-height: 2.75rem;
  padding: .65rem 1rem;
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 999px;
  background: rgba(20, 25, 28, .72);
  color: #fff;
  font: 600 .875rem/1.4 var(--sans);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.project-masthead-explore { pointer-events: auto; min-height: 3rem; padding-inline: 1.25rem; }
.project-masthead-explore svg, .project-masthead-count svg { width: 1.05rem; height: 1.05rem; fill: none; stroke: currentColor; stroke-width: 1.6; }
.project-masthead-count {
  position: absolute;
  z-index: 1;
  inset: clamp(1rem, 3.5vh, 2.25rem) var(--page-rail) auto auto;
  gap: .7rem;
  font-variant-numeric: tabular-nums;
}
.project-masthead-explore:hover, .project-masthead-photo:hover .project-masthead-count { background: #202528; border-color: white; }
.project-masthead-explore:focus-visible, .project-masthead-photo:focus-visible .project-masthead-count { outline: 3px solid white; outline-offset: 3px; box-shadow: 0 0 0 6px #23282b; }
@media (max-width: 640px) {
  .project-masthead-content { grid-template-columns: 1fr; gap: 1.35rem; justify-items: start; }
  #main .project-masthead h1 { font-size: clamp(2.75rem, 11.8vw, 4.5rem); }
  .project-masthead-photo::after { background: linear-gradient(0deg, rgba(10, 14, 17, .88), rgba(10, 14, 17, .65) 28%, rgba(10, 14, 17, .1) 63%, transparent 78%); }
}
@media (max-height: 540px) {
  .project-masthead { padding-block: 4.25rem max(1rem, env(safe-area-inset-bottom)); }
  .project-masthead .project-masthead-label { margin-bottom: .4rem; }
  #main .project-masthead h1 { font-size: clamp(2rem, 8vh, 3.25rem); }
  .project-masthead .project-masthead-details { margin-top: .4rem; }
  .project-masthead-content { gap: .75rem 1rem; }
}
@media (forced-colors: active) {
  .project-masthead-heading, .project-masthead-count, .project-masthead-explore { background: Canvas; color: CanvasText; }
}
