.project-gallery {
  position: relative;
  isolation: isolate;
  --gallery-bg: #11120f;
  --gallery-ink: #f4f1e8;
  --gallery-muted: rgba(244, 241, 232, 0.66);
  --gallery-line: rgba(244, 241, 232, 0.18);
  padding: clamp(4.5rem, 7vw, 7rem) 0 clamp(3.5rem, 6vw, 6rem);
  overflow: hidden;
  color: var(--gallery-ink);
  background:
    radial-gradient(circle at 50% 44%, rgba(188, 67, 39, 0.09), transparent 38%),
    var(--gallery-bg);
}

.project-gallery::before {
  position: absolute;
  z-index: 0;
  inset: 0;
  content: "";
  pointer-events: none;
  opacity: 0.28;
  background:
    linear-gradient(180deg, rgba(17, 18, 15, 0.9) 0%, rgba(17, 18, 15, 0.72) 48%, rgba(17, 18, 15, 0.96) 100%),
    url("/assets/images/redoak-after-black-modern-garage-doors.jpg") center 46% / cover no-repeat;
  mix-blend-mode: screen;
}

.project-gallery > * {
  position: relative;
  z-index: 1;
}

.project-gallery__header {
  width: min(calc(100% - 3rem), 64rem);
  margin: 0 auto clamp(2rem, 4vw, 3.5rem);
  text-align: left;
}

.project-gallery__eyebrow {
  margin: 0 0 0.75rem;
  color: #d8a34f;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.17em;
  line-height: 1;
  text-transform: uppercase;
}

.project-gallery__header :is(h1, h2) {
  max-width: 14ch;
  margin: 0;
  color: var(--gallery-ink);
  font-family: "Cabinet Grotesk", "Outfit", sans-serif;
  font-size: clamp(3rem, 6vw, 5.8rem);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.04em;
}

.hero--project-actions {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 0;
  background: #11120f url("/assets/images/redoak-garage-door-service-hero.webp") center / cover no-repeat;
}

.hero--project-actions::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  background:
    linear-gradient(90deg, rgba(17, 18, 15, 0.96) 0%, rgba(17, 18, 15, 0.82) 44%, rgba(17, 18, 15, 0.46) 100%),
    linear-gradient(180deg, rgba(17, 18, 15, 0.2), rgba(17, 18, 15, 0.6));
}

.hero--project-actions .hero-content {
  position: relative;
  z-index: 1;
  padding: clamp(7.25rem, 9vw, 9.5rem) 0 clamp(1.1rem, 2vw, 1.75rem);
}

.hero--project-actions .hero-actions {
  margin-top: 0;
}

.hero--project-actions .hero-project-copy {
  margin-top: clamp(3.25rem, 6vw, 6.5rem);
}

.hero-call-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  min-width: min(100%, 26rem);
  min-height: 5.9rem;
  padding: 0.9rem 1rem 0.9rem 1.5rem;
  border-radius: 1.35rem;
  font-size: clamp(1.35rem, 2.6vw, 1.8rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1;
  text-align: left;
}

.hero-call-button > span:first-child {
  grid-column: 1;
  grid-row: 1;
}

.hero-call-button > small {
  grid-column: 1;
  grid-row: 2;
  margin-top: 0.42rem;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.2;
}

.hero-call-button > .button-icon {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 52px;
  height: 52px;
}

.hero--project-actions .hero-note {
  margin-top: 0.8rem;
}

.project-gallery--hero {
  padding-top: 0;
}

.project-gallery--hero .project-gallery__header {
  margin-bottom: clamp(1.9rem, 3vw, 2.75rem);
}

.project-gallery__header > p:last-child {
  max-width: 39rem;
  margin: 1.25rem 0 0;
  color: var(--gallery-muted);
  font-size: clamp(0.95rem, 1.4vw, 1.1rem);
  line-height: 1.5;
}

.project-gallery__signals {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 1.25rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--gallery-line);
  color: rgba(244, 241, 232, 0.84);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-transform: uppercase;
}

.project-gallery__signals span {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.project-gallery__signals span::before {
  width: 0.38rem;
  height: 0.38rem;
  flex: 0 0 auto;
  border-radius: 50%;
  content: "";
  background: #d8a34f;
  box-shadow: 0 0 0 0.25rem rgba(216, 163, 79, 0.1);
}

.project-gallery__track {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(0.5rem, 1vw, 0.85rem);
  width: min(calc(100% - 9rem), 66rem);
  margin-inline: auto;
}

.project-gallery__item {
  --hive-x: 0%;
  --hive-y: 0%;
  position: relative;
  aspect-ratio: 1 / 1.08;
  min-width: 0;
  margin: 0;
  padding: 3px;
  transform: translate(var(--hive-x), var(--hive-y));
  clip-path: polygon(25% 1%, 75% 1%, 100% 50%, 75% 99%, 25% 99%, 0 50%);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.05) 46%, rgba(216, 163, 79, 0.34));
  box-shadow: 0 1.2rem 2.8rem rgba(0, 0, 0, 0.24);
}

.project-gallery__item:nth-child(n + 6) {
  --hive-x: 50%;
  --hive-y: -12%;
}

.project-gallery__media {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  cursor: default;
  clip-path: polygon(25% 1%, 75% 1%, 100% 50%, 75% 99%, 25% 99%, 0 50%);
  background: #292a26;
}

.project-gallery__media::before {
  position: absolute;
  z-index: 1;
  inset: 0;
  content: "";
  pointer-events: none;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.13), transparent 35%, rgba(0, 0, 0, 0.22));
}

.project-gallery__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: project-gallery-breathe 10s ease-in-out infinite alternate;
  transform-origin: center center;
  will-change: transform;
}

.project-gallery__item:nth-child(2n) img {
  animation-duration: 12s;
  animation-delay: -2.5s;
}

.project-gallery__item:nth-child(3n) img {
  animation-duration: 14s;
  animation-delay: -5s;
}

.project-gallery__item:nth-child(2) img,
.project-gallery__item:nth-child(3) img,
.project-gallery__item:nth-child(4) img,
.project-gallery__item:nth-child(8) img,
.project-gallery__item:nth-child(10) img {
  object-position: center 32%;
}

.project-gallery__item figcaption {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .project-gallery__item {
      animation: project-hive-enter both cubic-bezier(0.32, 0.72, 0, 1);
      animation-timeline: view();
      animation-range: entry 3% cover 26%;
    }
  }
}

@keyframes project-hive-enter {
  from {
    opacity: 0;
    transform: translate(var(--hive-x), calc(var(--hive-y) + 2rem)) scale(0.86);
  }
  to {
    opacity: 1;
    transform: translate(var(--hive-x), var(--hive-y)) scale(1);
  }
}

@keyframes project-gallery-breathe {
  from {
    filter: saturate(0.98) contrast(1);
    transform: scale(1.02) rotate(-0.25deg);
  }
  to {
    filter: saturate(1.08) contrast(1.04);
    transform: scale(1.07) rotate(0.25deg);
  }
}

@media (max-width: 899px) {
  .project-gallery::before {
    opacity: 0.2;
    background-position: center top;
  }

  .hero--project-actions {
    background-position: 62% center;
  }

  .hero--project-actions::before {
    background:
      linear-gradient(90deg, rgba(17, 18, 15, 0.94) 0%, rgba(17, 18, 15, 0.8) 62%, rgba(17, 18, 15, 0.56) 100%),
      linear-gradient(180deg, rgba(17, 18, 15, 0.28), rgba(17, 18, 15, 0.68));
  }

  .project-gallery {
    padding: 4.25rem 0 2.75rem;
  }

  .project-gallery__header {
    width: min(calc(100% - 2rem), 40rem);
    margin-bottom: 1.8rem;
    text-align: left;
  }

  .project-gallery__header :is(h1, h2) {
    max-width: 11ch;
    font-size: clamp(2.8rem, 13vw, 4.2rem);
  }

  .project-gallery__header > p:last-child {
    max-width: 31rem;
    margin: 0.85rem 0 0;
    font-size: 0.95rem;
  }

  .project-gallery__signals {
    gap: 0.65rem 1rem;
    margin-top: 1.25rem;
    font-size: 0.68rem;
  }

  .project-gallery__track {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: min(calc(100% - 5rem), 38rem);
  }

  .project-gallery__item:nth-child(n) {
    --hive-x: 0%;
    --hive-y: 0%;
  }

  .project-gallery__item:nth-child(n + 5):nth-child(-n + 8) {
    --hive-x: 50%;
    --hive-y: -12%;
  }

  .project-gallery__item:nth-child(n + 9) {
    --hive-y: -24%;
  }

  .project-gallery__item:nth-child(9) {
    grid-column: 2;
  }
}

@media (max-width: 599px) {
  .project-gallery__track {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.3rem;
    width: calc(100% - 2rem);
  }

  .project-gallery__item:nth-child(n) {
    --hive-x: 0%;
    --hive-y: 0%;
    grid-column: auto;
  }

  .project-gallery__item:nth-child(n + 5):nth-child(-n + 8) {
    --hive-x: 50%;
    --hive-y: -13%;
  }

  .project-gallery__item:nth-child(n + 9) {
    --hive-y: -26%;
  }

  .project-gallery__item:nth-child(9) {
    grid-column: 2;
  }
}

@media (prefers-reduced-motion: reduce) {
  .project-gallery__media img {
    animation: none;
    filter: none;
    transform: none;
    will-change: auto;
  }
}

/* Keep gallery storytelling comfortable to scan on every viewport. */
.project-gallery__header > p:last-child,
.project-gallery__card p,
.project-gallery__caption {
  font-size: clamp(1.08rem, 1.4vw, 1.2rem);
  line-height: 1.7;
}

.project-gallery__eyebrow,
.project-gallery__signals { font-size: 0.84rem; }


/* Hero homeowner review */
.hero-review {
  display: grid;
  grid-template-columns: minmax(220px, 0.72fr) minmax(0, 1.28fr);
  width: min(100%, 820px);
  margin: clamp(2rem, 4vw, 3.5rem) auto 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 1.4rem;
  color: #171815;
  background: rgba(247, 244, 235, 0.96);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
  text-align: left;
}

.hero-review__media {
  min-height: 220px;
  overflow: hidden;
  background: #252620;
}

.hero-review__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.88) contrast(1.04);
  transition: transform 900ms cubic-bezier(0.32, 0.72, 0, 1);
}

.hero-review:hover .hero-review__media img {
  transform: scale(1.045);
}

.hero-review__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: clamp(1.35rem, 3vw, 2.3rem);
}

.hero-review__eyebrow,
.review-modal__eyebrow {
  color: #9a3a25;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  line-height: 1;
  text-transform: uppercase;
}

.hero-review blockquote,
.review-modal blockquote {
  margin: 0.9rem 0 1.25rem;
  font-family: "Cabinet Grotesk", "Outfit", sans-serif;
  font-size: clamp(2.75rem, 5vw, 4.5rem);
  font-weight: 900;
  line-height: 0.94;
  letter-spacing: -0.035em;
}

.hero-review__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(17, 18, 15, 0.14);
}

.hero-review__stars {
  color: #b4771b;
  font-size: 0.9rem;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.hero-review__trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0;
  border: 0;
  color: #171815;
  background: none;
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

.hero-review__trigger span {
  color: #9a3a25;
  font-size: 1.1rem;
  text-decoration: none;
  transition: transform 500ms cubic-bezier(0.32, 0.72, 0, 1);
}

.hero-review__trigger:hover span,
.hero-review__trigger:focus-visible span {
  transform: translate(2px, -2px);
}

.review-modal {
  width: min(calc(100% - 2rem), 900px);
  max-width: 900px;
  max-height: min(88vh, 760px);
  padding: 0;
  border: 0;
  border-radius: 1.5rem;
  color: #171815;
  background: transparent;
  box-shadow: 0 30px 120px rgba(0, 0, 0, 0.46);
}

.review-modal::backdrop {
  background: rgba(7, 9, 8, 0.78);
  backdrop-filter: blur(12px);
}

.review-modal__surface {
  position: relative;
  display: grid;
  grid-template-columns: minmax(240px, 0.9fr) minmax(0, 1.1fr);
  overflow: auto;
  max-height: min(88vh, 760px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 1.5rem;
  background: #f7f4eb;
}

.review-modal__media {
  min-height: 100%;
  background: #272923;
}

.review-modal__media img {
  width: 100%;
  height: 100%;
  min-height: 360px;
  object-fit: cover;
}

.review-modal__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: clamp(2rem, 5vw, 4.5rem);
}

.review-modal__body h2 {
  max-width: 10ch;
  margin: 0.85rem 0 0;
  font-family: "Cabinet Grotesk", "Outfit", sans-serif;
  font-size: clamp(2.5rem, 5vw, 5rem);
  line-height: 0.9;
  letter-spacing: -0.055em;
}

.review-modal__body p {
  margin: 0 0 1.5rem;
  color: #55574e;
  font-size: 1.05rem;
}

.review-modal__link {
  align-self: flex-start;
}

.review-modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  display: grid;
  width: 2.8rem;
  height: 2.8rem;
  place-items: center;
  border: 1px solid rgba(17, 18, 15, 0.15);
  border-radius: 50%;
  color: #171815;
  background: rgba(247, 244, 235, 0.82);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.review-modal__close:hover,
.review-modal__close:focus-visible {
  color: #fff;
  background: #9a3a25;
}

@media (max-width: 760px) {
  .hero-review {
    grid-template-columns: 1fr;
    margin-top: 2rem;
  }

  .hero--project-actions .hero-project-copy {
    margin-top: 4rem;
  }

  .hero-review__media {
    min-height: 0;
    aspect-ratio: 16 / 8;
  }

  .hero-review__footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-review blockquote {
    font-size: clamp(2.5rem, 12vw, 3.6rem);
  }

  .review-modal {
    width: min(calc(100% - 1rem), 900px);
    max-height: 92vh;
  }

  .review-modal__surface {
    grid-template-columns: 1fr;
    max-height: 92vh;
  }

  .review-modal__media img {
    min-height: 0;
    aspect-ratio: 16 / 8;
  }

  .review-modal__body {
    padding: 2rem 1.35rem 1.5rem;
  }

  .review-modal__body h2 {
    font-size: clamp(2.65rem, 13vw, 4.4rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-review__media img,
  .hero-review__trigger span {
    transition: none;
  }
}

body.review-modal-open {
  overflow: hidden;
}

/* Small, distinct finished-door thumbnails under the verified reviews. */
.new-door-gallery {
  padding: clamp(4.5rem, 8vw, 7.5rem) 0 clamp(5rem, 9vw, 8rem);
  color: var(--ink);
  background: var(--paper-bright);
}

.new-door-gallery__intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: clamp(1.8rem, 4vw, 3.25rem);
}

.new-door-gallery__intro h2 {
  max-width: 9ch;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.8rem, 6vw, 5.8rem);
  line-height: 0.88;
  letter-spacing: -0.065em;
}

.new-door-gallery__intro > p {
  max-width: 23rem;
  margin: 0 0 0.2rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.45;
}

.new-door-gallery__eyebrow {
  margin: 0 0 0.8rem;
  color: var(--oak);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  line-height: 1;
  text-transform: uppercase;
}

.new-door-gallery__grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-rows: clamp(90px, 10vw, 145px);
  gap: 0.7rem;
}

.new-door-gallery__item {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border-radius: 1rem;
  background: #d8d6cc;
}

.new-door-gallery__item--feature {
  grid-column: span 2;
  grid-row: span 2;
}

.new-door-gallery__item:nth-child(4),
.new-door-gallery__item:nth-child(7) {
  grid-column: span 2;
}

.new-door-gallery__item a,
.new-door-gallery__item img {
  display: block;
  width: 100%;
  height: 100%;
}

.new-door-gallery__item a {
  position: relative;
  overflow: hidden;
}

.new-door-gallery__item a::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(145deg, rgba(255,255,255,0.16), transparent 42%, rgba(17,18,15,0.22));
  pointer-events: none;
  transition: opacity 500ms var(--curve);
}

.new-door-gallery__item img {
  object-fit: cover;
  filter: saturate(0.9) contrast(1.03);
  transition: transform 700ms var(--curve), filter 700ms var(--curve);
}

.new-door-gallery__item a:hover img,
.new-door-gallery__item a:focus-visible img {
  transform: scale(1.06);
  filter: saturate(1.05) contrast(1.05);
}

.new-door-gallery__item a:hover::after,
.new-door-gallery__item a:focus-visible::after {
  opacity: 0.45;
}

@media (max-width: 700px) {
  .new-door-gallery__intro {
    display: block;
  }

  .new-door-gallery__intro > p {
    margin-top: 1rem;
  }

  .new-door-gallery__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: 110px;
    gap: 0.5rem;
  }

  .new-door-gallery__item--feature {
    grid-column: span 2;
    grid-row: span 2;
  }

  .new-door-gallery__item:nth-child(4),
  .new-door-gallery__item:nth-child(7) {
    grid-column: span 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .new-door-gallery__item img,
  .new-door-gallery__item a::after {
    transition: none;
  }
}

.gallery-lightbox {
  width: min(92vw, 980px);
  max-width: none;
  padding: 0;
  border: 0;
  border-radius: 1.25rem;
  color: var(--ink);
  background: transparent;
  box-shadow: 0 2rem 7rem rgba(0, 0, 0, 0.42);
}

.gallery-lightbox::backdrop {
  background: rgba(12, 14, 12, 0.84);
  backdrop-filter: blur(10px);
}

.gallery-lightbox__surface {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: inherit;
  background: #f4f1e8;
}

.gallery-lightbox__media {
  display: grid;
  min-height: min(68vh, 720px);
  place-items: center;
  padding: clamp(1rem, 3vw, 2rem);
  background: #171914;
}

.gallery-lightbox__media img {
  display: block;
  width: 100%;
  max-height: 68vh;
  object-fit: contain;
  border-radius: 0.65rem;
}

.gallery-lightbox__caption {
  padding: 1rem clamp(1.1rem, 3vw, 2rem) 1.25rem;
}

.gallery-lightbox__caption span {
  color: var(--oak);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.gallery-lightbox__caption h2 {
  margin: 0.35rem 0 0;
  font-family: var(--display);
  font-size: clamp(1.25rem, 3vw, 2rem);
  line-height: 1;
}

.gallery-lightbox__close {
  position: absolute;
  z-index: 1;
  top: 0.8rem;
  right: 0.8rem;
  display: grid;
  width: 2.7rem;
  height: 2.7rem;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  color: #fff;
  background: rgba(17, 18, 15, 0.72);
  font-size: 1.65rem;
  line-height: 1;
  cursor: pointer;
}

body.gallery-lightbox-open {
  overflow: hidden;
}

@media (max-width: 700px) {
  .gallery-lightbox {
    width: calc(100vw - 1.25rem);
    border-radius: 1rem;
  }

  .gallery-lightbox__media {
    min-height: 0;
    padding: 0.6rem;
  }

  .gallery-lightbox__media img {
    max-height: 67vh;
  }
}
