/* Project pages: split hero, build stages, galleries, scroll-scrubbed and in-view video */

.project-hero {
  padding-top: var(--nav-h);
  background: var(--green);
  color: var(--cream);
}
.project-hero__grid {
  display: grid;
  gap: 0;
}
.project-hero__text {
  padding: 3rem 1rem 2.5rem;
}
.project-hero__text h1 { color: var(--white); margin-bottom: 1rem; }
.project-hero__text .lead { color: rgba(245,243,240,0.8); }
.project-hero__media { position: relative; }
.project-hero__media img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}
@media (min-width: 900px) {
  .project-hero__grid {
    grid-template-columns: 1fr 1fr;
    align-items: center;
    max-width: var(--max-w);
    margin: 0 auto;
  }
  .project-hero__text { padding: 4rem 3rem 4rem 2rem; }
  .project-hero__media img { aspect-ratio: 4 / 5; max-height: calc(100vh - var(--nav-h)); }
}

.crumbs {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(245,243,240,0.65);
  margin-bottom: 1.5rem;
}
.crumbs a { color: var(--gold-light); }
.crumbs a:hover, .crumbs a:focus-visible { text-decoration: underline; }

.facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem 1.5rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(212,175,106,0.3);
}
.facts dt {
  font-family: var(--font-sc);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-light);
}
.facts dd { font-size: 0.95rem; color: var(--cream); }

/* Photo gallery: CSS columns keep portrait and landscape photos at their own ratio */
.gallery {
  column-count: 2;
  column-gap: 6px;
}
@media (min-width: 900px) { .gallery { column-count: 3; } }
.gallery__item {
  break-inside: avoid;
  margin: 0 0 6px;
  position: relative;
}
.gallery__btn {
  display: block;
  width: 100%;
  padding: 0;
  cursor: zoom-in;
  overflow: hidden;
}
.gallery__btn img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.6s var(--ease-out);
}
.gallery__btn:hover img { transform: scale(1.04); }
.gallery__btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.gallery__item figcaption {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 0.4rem 0.1rem 0.6rem;
}
.section--dark .gallery__item figcaption { color: rgba(245,243,240,0.7); }

/* Build stages */
.stages { display: grid; gap: clamp(3rem, 7vw, 6rem); }
.stage { display: grid; gap: 1.5rem; }
.stage__num {
  font-family: var(--font-serif);
  font-size: 3rem;
  line-height: 1;
  color: var(--gold);
  font-style: italic;
}
.stage h3 { margin: 0.25rem 0 0.75rem; }
.stage p { color: var(--text-muted); }
.stage__media {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.stage__media .gallery__item:only-child { grid-column: 1 / -1; }
.stage__media img { aspect-ratio: 3 / 4; object-fit: cover; }
@media (min-width: 900px) {
  .stage { grid-template-columns: 5fr 7fr; gap: 4rem; align-items: start; }
  .stage__text { position: sticky; top: calc(var(--nav-h) + 2rem); }
  .stage__media { grid-template-columns: repeat(3, 1fr); }
  .stage__media--2 { grid-template-columns: repeat(2, 1fr); }
}

/* Scroll-scrubbed film: the clip advances as the reader scrolls through the section */
.scroll-film { position: relative; height: 260vh; }
.scroll-film__sticky {
  position: sticky;
  top: var(--nav-h);
  height: calc(100svh - var(--nav-h));
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 1rem;
  padding: 1rem;
}
.scroll-film__video {
  height: min(68svh, 640px);
  width: auto;
  max-width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  background: var(--green-dark);
}
.scroll-film__copy { max-width: 36rem; text-align: center; }
.scroll-film__copy p { color: rgba(245,243,240,0.8); font-size: 0.95rem; }
.scroll-film__bar {
  width: min(320px, 70vw);
  height: 2px;
  background: rgba(212,175,106,0.25);
  overflow: hidden;
}
.scroll-film__bar span {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--gold-light);
  transform: scaleX(0);
  transform-origin: left;
}
@media (min-width: 900px) {
  .scroll-film__sticky {
    grid-template-columns: auto minmax(0, 28rem);
    justify-content: center;
    align-content: center;
    column-gap: 4rem;
  }
  .scroll-film__copy { text-align: left; }
}
.scroll-film--static { height: auto; }
.scroll-film--static .scroll-film__sticky { position: static; height: auto; padding: 0; }

/* Swipeable strip of short clips that play only while on screen */
.clip-strip {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 1rem;
  padding: 0 1rem 1rem;
  margin: 0 -1rem;
  scrollbar-width: thin;
  scrollbar-color: var(--gold) transparent;
}
.clip {
  flex: 0 0 min(72vw, 300px);
  scroll-snap-align: start;
  margin: 0;
}
.clip video {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  background: var(--green-dark);
}
.clip figcaption { font-size: 0.85rem; color: var(--text-muted); padding-top: 0.6rem; }
.clip figcaption strong { display: block; color: var(--text); font-weight: 500; }
.section--dark .clip figcaption { color: rgba(245,243,240,0.7); }
.section--dark .clip figcaption strong { color: var(--white); }
.clip-strip__nav { display: flex; gap: 0.5rem; justify-content: flex-end; margin-bottom: 1rem; }
.clip-strip__nav button {
  width: 44px;
  height: 44px;
  border: 1px solid var(--gold);
  color: var(--gold-dark);
  font-size: 1.25rem;
  line-height: 1;
}
.section--dark .clip-strip__nav button { color: var(--gold-light); }
.clip-strip__nav button:hover, .clip-strip__nav button:focus-visible { background: var(--gold); color: var(--white); }

/* Featured project card used on service, portfolio and home pages */
.feature-project {
  display: grid;
  gap: 2rem;
  align-items: center;
}
.feature-project__media { display: grid; grid-template-columns: 2fr 1fr; gap: 6px; }
.feature-project__media img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 3 / 4; }
.feature-project__media img:first-child { grid-row: span 2; aspect-ratio: auto; }
@media (max-width: 899px) {
  .feature-project > :first-child { order: 2; }
}
@media (min-width: 900px) {
  .feature-project { grid-template-columns: 7fr 5fr; gap: 5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .gallery__btn img, .gallery__btn:hover img { transition: none; transform: none; }
}
