.projects-hero {
  position: relative;
  min-height: min(76rem, calc(100svh - 5rem));
  display: grid;
  place-items: end start;
  overflow: hidden;
  isolation: isolate;
  background: var(--navy-dark);
}

.projects-hero__image,
.projects-hero__shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.projects-hero__image {
  z-index: -3;
  object-fit: cover;
  object-position: 50% 50%;
  transform: scale(1.035);
}

.projects-hero__shade {
  z-index: -2;
  background:
    linear-gradient(180deg, rgba(0, 18, 25, 0.08) 12%, rgba(0, 18, 25, 0.78) 100%),
    linear-gradient(90deg, rgba(0, 25, 33, 0.78), transparent 70%);
}

.projects-hero__content {
  padding-block: clamp(6rem, 13vw, 10rem);
  color: white;
}

.projects-hero__content h1 {
  max-width: 12ch;
  margin-bottom: 0.8rem;
  color: white;
  font-size: clamp(4rem, 11vw, 9.5rem);
  line-height: 0.86;
}

.projects-hero__content > p:last-child {
  max-width: 34rem;
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(1rem, 1.8vw, 1.25rem);
}

.projects-eyebrow {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
  color: white;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.projects-eyebrow::before {
  width: 2.75rem;
  height: 2px;
  background: var(--red);
  content: "";
}

.projects-eyebrow--dark {
  color: var(--red);
}

.projects-hero__scroll {
  position: absolute;
  right: clamp(1rem, 4vw, 4rem);
  bottom: clamp(1.2rem, 4vw, 3.5rem);
  display: flex;
  gap: 0.7rem;
  align-items: center;
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}

.projects-hero__scroll span:last-child {
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 50%;
}

.projects-index {
  padding: clamp(4.5rem, 9vw, 8.5rem) 0;
  background: #f8f9f9;
}

.projects-index__heading {
  display: grid;
  gap: 1.5rem;
  margin-bottom: clamp(2.5rem, 5vw, 4.5rem);
}

.projects-index__heading h2 {
  max-width: 16ch;
  margin: 0;
}

.projects-index__heading > p {
  max-width: 35rem;
  margin: 0;
  align-self: end;
  color: var(--muted);
}

.projects-grid {
  display: grid;
  gap: clamp(1.25rem, 3vw, 2.25rem);
}

.project-card-wrap {
  min-width: 0;
}

.project-card {
  position: relative;
  min-height: clamp(31rem, 72vw, 41rem);
  display: block;
  overflow: hidden;
  background: var(--navy-dark);
  color: white;
  text-decoration: none;
  isolation: isolate;
}

.project-card__image,
.project-card__veil {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.project-card__image {
  z-index: -3;
  object-fit: cover;
  transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.project-card__veil {
  z-index: -2;
  background: linear-gradient(180deg, transparent 30%, rgba(0, 24, 32, 0.78) 100%);
}

.project-card__number {
  position: absolute;
  z-index: 2;
  top: 1.25rem;
  left: 1.4rem;
  color: transparent;
  font-size: clamp(3.5rem, 8vw, 5.7rem);
  font-weight: 300;
  letter-spacing: -0.06em;
  line-height: 1;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.56);
}

.project-card__panel {
  position: absolute;
  z-index: 3;
  right: 0;
  bottom: 0;
  left: 0;
  min-height: 13.5rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(1.4rem, 4vw, 2.3rem);
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  background:
    linear-gradient(110deg, rgba(62, 43, 45, 0.62), rgba(1, 28, 37, 0.72)),
    rgba(0, 29, 37, 0.48);
  backdrop-filter: blur(17px) saturate(125%);
  -webkit-backdrop-filter: blur(17px) saturate(125%);
  box-shadow: 0 -18px 50px rgba(0, 20, 28, 0.14);
}

.project-card__category {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 0.75rem;
  font-size: 0.82rem;
  font-weight: 700;
}

.project-card__category > span {
  width: clamp(3rem, 8vw, 5rem);
  height: 2px;
  background: white;
}

.project-card__panel strong {
  color: white;
  font-size: clamp(1.8rem, 5vw, 3.1rem);
  line-height: 1.05;
}

.project-card__action {
  display: flex;
  max-height: 0;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0;
  overflow: hidden;
  opacity: 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.88rem;
  font-weight: 700;
}

.project-card:hover .project-card__image,
.project-card:focus-visible .project-card__image {
  transform: scale(1.06);
}

.project-card:hover .project-card__panel,
.project-card:focus-visible .project-card__panel {
  transform: translateY(-1.1rem);
}

.project-card:hover .project-card__action,
.project-card:focus-visible .project-card__action {
  max-height: 3rem;
  margin-top: 1rem;
  opacity: 1;
}

/* Project detail */
.project-detail-hero {
  position: relative;
  min-height: clamp(25rem, 58vw, 42rem);
  display: grid;
  align-items: end;
  overflow: hidden;
  isolation: isolate;
  background: var(--navy-dark);
}

.project-detail-hero img {
  position: absolute;
  z-index: -2;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-detail-hero::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 24, 32, 0.2), rgba(0, 24, 32, 0.9)),
    linear-gradient(90deg, rgba(0, 24, 32, 0.72), transparent 75%);
  content: "";
}

.project-detail-hero__content {
  padding-block: clamp(4rem, 9vw, 7rem);
}

.project-detail-hero__back {
  display: inline-flex;
  margin-bottom: 1.5rem;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-decoration: none;
  text-transform: uppercase;
}

.project-detail-hero h1 {
  max-width: 14ch;
  margin: 0;
  color: white;
  font-size: clamp(3rem, 8vw, 6.5rem);
}

.project-detail-hero__number {
  display: block;
  margin-bottom: 0.6rem;
  color: transparent;
  font-size: clamp(3rem, 7vw, 5rem);
  line-height: 1;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.5);
}

.project-story {
  padding: clamp(4rem, 8vw, 7.5rem) 0;
}

.project-story__layout {
  display: grid;
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: start;
}

.project-story__content {
  color: var(--muted);
  font-size: clamp(1rem, 1.5vw, 1.08rem);
  line-height: 1.85;
}

.project-story__content p {
  margin-bottom: 1.25rem;
}

.project-story__content strong {
  color: #49575c;
}

.project-info {
  padding: clamp(1.6rem, 4vw, 2.25rem);
  background: #ed0a2d;
  color: white;
  box-shadow: 0 22px 50px rgba(0, 29, 37, 0.12);
}

.project-info h2 {
  margin-bottom: 1.2rem;
  color: white;
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: -0.03em;
}

.project-info dl {
  margin: 0;
}

.project-info__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
}

.project-info dt {
  font-weight: 700;
}

.project-info dd {
  margin: 0;
  text-align: right;
}

.project-gallery {
  display: grid;
  gap: 1rem;
  margin-top: clamp(3rem, 7vw, 6rem);
}

.project-gallery__item {
  min-height: 20rem;
  margin: 0;
  overflow: hidden;
  background: var(--pale);
}

.project-gallery__item img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 0.7s ease;
}

.project-gallery__item:hover img {
  transform: scale(1.035);
}

.project-next {
  padding: clamp(3.5rem, 7vw, 6rem) 0;
  background: #f2f5f5;
}

.project-next__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: center;
  justify-content: space-between;
}

.project-next h2 {
  max-width: 16ch;
  margin: 0;
}

@media (min-width: 700px) {
  .projects-index__heading {
    grid-template-columns: 1.2fr 0.8fr;
  }

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

  .project-card {
    min-height: clamp(33rem, 45vw, 42rem);
  }

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

@media (min-width: 900px) {
  .project-story__layout {
    grid-template-columns: minmax(0, 2.35fr) minmax(17rem, 0.85fr);
  }

  .project-info {
    position: sticky;
    top: 7rem;
  }
}

@media (max-width: 699px) {
  .projects-hero {
    min-height: calc(100svh - 4.8rem);
  }

  .projects-hero__image {
    object-position: 58% center;
  }

  .projects-hero__content {
    padding-bottom: 7rem;
  }

  .projects-hero__scroll {
    right: auto;
    left: 1rem;
  }

  .projects-hero__scroll span:first-child {
    display: none;
  }

  .project-card__panel {
    min-height: 12rem;
  }

  .project-card__action {
    max-height: 3rem;
    margin-top: 0.8rem;
    opacity: 1;
  }

  .project-gallery__item {
    min-height: 17rem;
    aspect-ratio: 4 / 3;
  }
}

@media (prefers-reduced-motion: reduce) {
  .projects-hero__image,
  .project-card__image,
  .project-card__panel,
  .project-card__action,
  .project-gallery__item img {
    transition: none;
    transform: none !important;
  }
}
