.gallery-page {
  background:
    linear-gradient(110deg, rgba(255, 255, 255, .28), transparent 38%),
    repeating-linear-gradient(94deg, rgba(65, 50, 34, .018) 0 1px, transparent 1px 5px),
    var(--linen-light);
}

.gallery-page .header {
  color: var(--ink);
  border-color: var(--line);
  background: rgba(250, 248, 243, .88);
  backdrop-filter: blur(18px) saturate(.8);
}

.gallery-page main { padding-top: 80px; }

.realisations-hero {
  min-height: 610px;
  padding: clamp(80px, 10vw, 150px) clamp(18px, 8vw, 158px) 80px;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, .55fr);
  grid-template-rows: auto 1fr;
  column-gap: clamp(50px, 10vw, 190px);
  border-bottom: 1px solid var(--line);
}

.realisations-hero__eyebrow,
.gallery-toolbar__overline,
.lightbox__overline {
  grid-column: 1 / -1;
  margin: 0 0 32px;
  font-family: var(--mono);
  font-size: .62rem;
  font-weight: 500;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.realisations-hero__eyebrow::before,
.gallery-toolbar__overline::before,
.lightbox__overline::before {
  width: 30px;
  height: 1px;
  margin-right: 14px;
  display: inline-block;
  vertical-align: middle;
  background: currentColor;
  content: "";
}

.realisations-hero h1 {
  max-width: 950px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(5rem, 8vw, 9.7rem);
  font-weight: 400;
  line-height: .84;
  letter-spacing: -.045em;
}

.realisations-hero h1 em,
.gallery-cta em {
  color: var(--copper-dark);
  font-weight: 400;
}

.realisations-hero__aside { align-self: end; padding-bottom: 14px; }
.realisations-hero__aside > p { max-width: 370px; margin: 0 0 54px; color: #4f4c45; font-size: .94rem; line-height: 1.65; }
.realisations-hero__count { padding-top: 24px; display: flex; align-items: flex-end; gap: 18px; border-top: 1px solid var(--line); }
.realisations-hero__count strong { font-family: var(--serif); font-size: 5rem; font-weight: 400; line-height: .7; }
.realisations-hero__count span { font-family: var(--mono); font-size: .6rem; font-weight: 500; letter-spacing: .13em; line-height: 1.45; text-transform: uppercase; }

.gallery-shell { padding: clamp(70px, 8vw, 128px) clamp(18px, 8vw, 158px) clamp(100px, 11vw, 180px); }
.gallery-toolbar { margin-bottom: 70px; display: flex; justify-content: space-between; align-items: flex-end; gap: 60px; }
.gallery-toolbar__overline { margin-bottom: 20px; }
.gallery-toolbar h2 { margin: 0; font-family: var(--serif); font-size: clamp(3.2rem, 5.4vw, 6rem); font-weight: 400; line-height: .95; letter-spacing: -.035em; }
.filters { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
.filter { padding: 12px 14px; display: flex; gap: 12px; color: var(--muted); border: 1px solid var(--line); background: transparent; cursor: pointer; font-family: var(--mono); font-size: .62rem; font-weight: 500; letter-spacing: .05em; text-transform: uppercase; transition: .25s ease; }
.filter span { opacity: .5; }
.filter:hover,
.filter.is-active { color: var(--white); border-color: var(--ink); background: var(--ink); }

.gallery-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(20px, 2vw, 36px); row-gap: clamp(58px, 7vw, 112px); }
.project-card { grid-column: span 4; min-width: 0; }
.project-card:nth-child(8n + 1) { grid-column: span 7; }
.project-card:nth-child(8n + 2) { grid-column: span 5; padding-top: 12vw; }
.project-card:nth-child(8n + 5) { grid-column: span 5; }
.project-card:nth-child(8n + 6) { grid-column: span 7; padding-top: 5vw; }
.project-card[hidden] { display: none; }
.project-card__button { width: 100%; padding: 0; color: inherit; border: 0; background: transparent; text-align: left; cursor: pointer; }
.project-card__visual { aspect-ratio: 4 / 5; display: block; overflow: hidden; background: var(--linen); }
.project-card:nth-child(8n + 1) .project-card__visual,
.project-card:nth-child(8n + 6) .project-card__visual { aspect-ratio: 16 / 10; }
.project-card__visual img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .7s var(--ease), filter .4s ease; }
.project-card__button:hover img { transform: scale(1.025); filter: saturate(1.06); }
.project-card__meta { min-height: 115px; padding: 22px 0 0; display: grid; grid-template-columns: 34px 1fr 28px; gap: 14px; border-top: 1px solid var(--ink); }
.project-card__number,
.project-card__categories,
.project-card__photos { font-family: var(--mono); font-size: .57rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; }
.project-card__number { color: var(--copper-dark); }
.project-card__categories { display: block; color: var(--muted); }
.project-card__title { margin-top: 8px; display: block; font-family: var(--serif); font-size: clamp(1.8rem, 2.35vw, 2.9rem); font-weight: 400; line-height: 1.03; letter-spacing: -.025em; }
.project-card__photos { margin-top: 12px; display: block; color: var(--muted); }
.project-card__arrow { justify-self: end; font-size: 1.3rem; transition: transform .25s ease; }
.project-card__button:hover .project-card__arrow { transform: translate(3px, -3px); }
.empty-state { padding: 80px 0; text-align: center; color: var(--muted); }

.gallery-cta { min-height: 520px; padding: 100px clamp(18px, 8vw, 158px); color: var(--white); background: var(--green); }
.gallery-cta > p { margin: 0 0 38px; font-family: var(--mono); font-size: .62rem; font-weight: 500; letter-spacing: .15em; text-transform: uppercase; }
.gallery-cta h2 { max-width: 900px; margin: 0 0 40px; font-family: var(--serif); font-size: clamp(4rem, 7vw, 8rem); font-weight: 400; line-height: .9; letter-spacing: -.04em; }
.gallery-cta__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; }
.gallery-cta__phone { border-bottom: 1px solid rgba(255, 255, 255, .52); padding-bottom: 5px; font-family: var(--mono); font-size: .72rem; }

.lightbox { width: 100vw; max-width: none; height: 100vh; max-height: none; margin: 0; padding: 0; color: var(--white); border: 0; background: rgba(15, 18, 17, .97); }
.lightbox::backdrop { background: rgba(12, 12, 10, .82); }
.lightbox[open] { animation: gallery-reveal .28s ease both; }
@keyframes gallery-reveal { from { opacity: 0; } }
.lightbox__panel { min-height: 100%; display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(340px, .65fr); }
.lightbox__close { position: fixed; z-index: 5; top: 22px; right: 28px; width: 48px; aspect-ratio: 1; color: var(--white); border: 1px solid rgba(255,255,255,.4); border-radius: 50%; background: rgba(0,0,0,.25); cursor: pointer; font-size: 1.75rem; }
.lightbox__visual { min-height: 100vh; position: relative; display: grid; place-items: center; touch-action: pan-y; background: #0c0e0d; }
.lightbox__visual > img { width: 100%; height: 100vh; display: block; object-fit: contain; }
.lightbox__arrow { position: absolute; z-index: 2; top: 50%; width: 50px; aspect-ratio: 1; color: var(--white); border: 1px solid rgba(255,255,255,.4); border-radius: 50%; background: rgba(0,0,0,.35); cursor: pointer; transform: translateY(-50%); }
.lightbox__arrow--previous { left: 24px; }
.lightbox__arrow--next { right: 24px; }
.lightbox__index { position: absolute; right: 24px; bottom: 22px; font-family: var(--mono); font-size: .62rem; letter-spacing: .15em; }
.lightbox__content { padding: 120px clamp(35px, 4vw, 76px) 60px; overflow-y: auto; background: var(--green); }
.lightbox__overline { margin-bottom: 40px; color: rgba(255,255,255,.65); }
.lightbox__content h2 { margin: 0 0 28px; font-family: var(--serif); font-size: clamp(2.8rem, 4vw, 5rem); font-weight: 400; line-height: .94; letter-spacing: -.035em; }
.lightbox__categories { display: flex; flex-wrap: wrap; gap: 8px; }
.lightbox__categories span { padding: 8px 10px; border: 1px solid rgba(255,255,255,.28); font-family: var(--mono); font-size: .56rem; font-weight: 500; letter-spacing: .09em; text-transform: uppercase; }
.lightbox__thumbs { margin-top: 70px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.lightbox__thumbs button { padding: 0; aspect-ratio: 1; border: 2px solid transparent; background: transparent; cursor: pointer; opacity: .55; }
.lightbox__thumbs button.is-active { border-color: #f09a75; opacity: 1; }
.lightbox__thumbs img { width: 100%; height: 100%; display: block; object-fit: cover; }

@media (max-width: 1050px) {
  .realisations-hero { grid-template-columns: 1fr; }
  .realisations-hero__aside { margin-top: 70px; display: grid; grid-template-columns: 1fr 1fr; gap: 50px; }
  .realisations-hero__aside > p { margin: 0; }
  .gallery-toolbar { align-items: flex-start; flex-direction: column; }
  .filters { justify-content: flex-start; }
  .project-card,
  .project-card:nth-child(n) { grid-column: span 6; padding-top: 0; }
  .project-card:nth-child(5n + 1) { grid-column: span 12; }
  .project-card:nth-child(5n + 1) .project-card__visual { aspect-ratio: 16 / 9; }
  .lightbox__panel { grid-template-columns: 1fr; }
  .lightbox__visual { min-height: 68vh; }
  .lightbox__visual > img { height: 68vh; }
}

@media (max-width: 700px) {
  .gallery-page main { padding-top: 68px; }
  .realisations-hero { min-height: auto; padding-top: 75px; }
  .realisations-hero h1 { font-size: clamp(4rem, 19vw, 6rem); }
  .realisations-hero__aside { margin-top: 60px; display: block; }
  .realisations-hero__aside > p { margin-bottom: 45px; }
  .gallery-shell { padding-top: 70px; }
  .gallery-toolbar { margin-bottom: 46px; gap: 35px; }
  .filters { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .filter { justify-content: space-between; text-align: left; }
  .gallery-grid { display: block; }
  .project-card,
  .project-card:nth-child(n) { margin-bottom: 64px; }
  .project-card__visual,
  .project-card:nth-child(n) .project-card__visual { aspect-ratio: 4 / 5; }
  .project-card:nth-child(3n + 1) .project-card__visual { aspect-ratio: 4 / 3; }
  .project-card__title { font-size: 2rem; }
  .gallery-cta { min-height: 430px; }
  .lightbox__content { padding: 70px 22px 45px; }
  .lightbox__content h2 { font-size: 3rem; }
  .lightbox__thumbs { margin-top: 45px; }
  .lightbox__close { top: 12px; right: 12px; }
  .lightbox__arrow { width: 42px; }
  .lightbox__arrow--previous { left: 12px; }
  .lightbox__arrow--next { right: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .project-card__visual img { transition: none; }
  .lightbox[open] { animation: none; }
}
