/* =========================================================
   REFERENZEN PAGE
========================================================= */

.hero-page.referenzen-hero {
  position: relative;
  min-height: 88vh;
  padding-top: 170px;
  padding-bottom: 90px;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-page.referenzen-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 78% 24%, rgba(255, 179, 71, .18), transparent 32%),
    radial-gradient(circle at 20% 80%, rgba(255, 255, 255, .05), transparent 30%);
  pointer-events: none;
}

.hero-page.referenzen-hero .hero-content {
  position: relative;
  z-index: 2;
  max-width: 980px;
  padding-top: 40px;
}

.hero-page.referenzen-hero .lead {
  max-width: 760px;
}

.hero-page.referenzen-hero .hero-bg,
.hero-page.referenzen-hero .hero-bg picture,
.hero-page.referenzen-hero .hero-bg img {
  height: 100%;
}

.hero-page.referenzen-hero .hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 45%;
  filter: saturate(.92) contrast(1.08) brightness(.72);
  transform: scale(1.06);
}

.references-hero-badges {
  margin-top: 30px;
}

.references-hero-badges .badge {
  backdrop-filter: blur(14px);
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .14);
}


/* =========================================================
   REFERENCES SECTION
========================================================= */

.references-section {
  position: relative;
  overflow: hidden;
}

.references-section::before {
  content: "";
  position: absolute;
  top: 8%;
  right: -18%;
  width: 520px;
  height: 520px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 190, 90, .13), transparent 68%);
  pointer-events: none;
}

.references-section > .container {
  position: relative;
  z-index: 1;
}

.references-head {
  margin-bottom: 34px;
}

.references-intro {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 38px;
}

.references-intro-card {
  position: relative;
  overflow: hidden;
  padding: 22px;
  border-radius: 26px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .035));
  border: 1px solid var(--line);
  box-shadow: 0 18px 54px rgba(0, 0, 0, .12);
}

.references-intro-card::after {
  content: "";
  position: absolute;
  width: 120px;
  height: 120px;
  right: -70px;
  top: -70px;
  border-radius: 999px;
  background: rgba(255, 179, 71, .12);
  pointer-events: none;
}

.references-intro-card strong {
  position: relative;
  z-index: 1;
  display: block;
  margin-bottom: 8px;
  font-size: 1.15rem;
  color: var(--text);
  letter-spacing: -.02em;
}

.references-intro-card span {
  position: relative;
  z-index: 1;
  display: block;
  color: var(--muted);
  line-height: 1.55;
}


/* =========================================================
   GALLERY LAYOUT
========================================================= */

.editorial-gallery {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-flow: dense;
  gap: 24px;
  align-items: start;
}

.gallery-item {
  grid-column: span 4;
  margin: 0;
  min-width: 0;
}

.gallery-item-large,
.gallery-item-wide {
  grid-column: span 8;
}

.gallery-item-vertical {
  grid-column: span 4;
}


/* =========================================================
   IMAGE PREVIEWS
========================================================= */

.gallery-open {
  position: relative;
  display: block;
  width: 100%;
  height: 390px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: rgba(255, 255, 255, .045);
  cursor: pointer;
  box-shadow: 0 20px 70px rgba(0, 0, 0, .20);
  isolation: isolate;
}

.gallery-item-large .gallery-open,
.gallery-item-wide .gallery-open,
.gallery-item-vertical .gallery-open {
  height: 470px;
}

.gallery-open::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(180deg, rgba(8, 10, 12, .02), rgba(8, 10, 12, .16)),
    linear-gradient(135deg, rgba(255, 255, 255, .15), transparent 38%, transparent 72%, rgba(255, 255, 255, .08));
  opacity: .58;
  pointer-events: none;
  transition: opacity .35s ease;
}

.gallery-open::after {
  content: "Ansehen";
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 3;
  padding: 9px 13px;
  border-radius: 999px;
  background: rgba(15, 17, 20, .68);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, .16);
  backdrop-filter: blur(14px);
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: .02em;
  transform: translateY(8px);
  opacity: 0;
  transition: .28s ease;
}

.gallery-open picture,
.gallery-open img {
  display: block;
  width: 100%;
  height: 100%;
}

.gallery-open img {
  object-fit: cover;
  transform: scale(1.001);
  transition:
    transform .75s cubic-bezier(.2, .8, .2, 1),
    filter .75s cubic-bezier(.2, .8, .2, 1);
}

.gallery-item:hover .gallery-open img {
  transform: scale(1.055);
  filter: saturate(1.06) contrast(1.04);
}

.gallery-item:hover .gallery-open::before {
  opacity: .82;
}

.gallery-item:hover .gallery-open::after {
  opacity: 1;
  transform: translateY(0);
}

.gallery-open:focus-visible {
  outline: 3px solid var(--accent2);
  outline-offset: 4px;
}


/* =========================================================
   CAPTIONS
========================================================= */

.gallery-item figcaption {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px 14px;
  padding: 15px 4px 0;
}

.gallery-item figcaption span {
  grid-column: 1 / -1;
  color: var(--accent2);
  font-size: .76rem;
  line-height: 1;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.gallery-item figcaption strong {
  color: var(--text);
  font-size: clamp(1.02rem, 1.15vw, 1.24rem);
  line-height: 1.22;
  letter-spacing: -.02em;
}

.gallery-item figcaption small {
  align-self: center;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 700;
  text-align: right;
}


/* =========================================================
   LIGHTBOX
========================================================= */

.project-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  padding: 28px;
}

.project-lightbox.is-open {
  display: block;
}

.project-lightbox-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: rgba(5, 7, 10, .78);
  backdrop-filter: blur(18px);
  cursor: pointer;
}

.project-lightbox-close {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 1003;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(20, 23, 28, .78);
  color: var(--text);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(16px);
  transition: .25s ease;
}

.project-lightbox-close:hover {
  transform: rotate(90deg) scale(1.04);
  background: rgba(255, 255, 255, .10);
  border-color: rgba(255, 255, 255, .28);
}

.project-lightbox-inner {
  position: relative;
  z-index: 1002;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
  width: min(1380px, 100%);
  height: min(840px, calc(100vh - 56px));
  margin: 0 auto;
  top: 50%;
  transform: translateY(-50%);
}

.project-lightbox-image-wrap {
  min-width: 0;
  overflow: hidden;
  border-radius: 34px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .05);
  box-shadow: 0 34px 100px rgba(0, 0, 0, .42);
}

.project-lightbox-image-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.project-lightbox-content {
  align-self: end;
  padding: 28px;
  border-radius: 30px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, .045));
  border: 1px solid rgba(255, 255, 255, .15);
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .24);
}

.project-lightbox-content h2 {
  margin: 8px 0 12px;
  font-size: clamp(1.1rem, 1.2vw, 3rem);
  line-height: 1;
  letter-spacing: -.045em;
}

.project-lightbox-content p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}


/* =========================================================
   ANIMATION
========================================================= */

.editorial-gallery .gallery-item {
  animation: galleryFadeUp .7s ease both;
}

.editorial-gallery .gallery-item:nth-child(2) { animation-delay: .04s; }
.editorial-gallery .gallery-item:nth-child(3) { animation-delay: .08s; }
.editorial-gallery .gallery-item:nth-child(4) { animation-delay: .12s; }
.editorial-gallery .gallery-item:nth-child(5) { animation-delay: .16s; }
.editorial-gallery .gallery-item:nth-child(6) { animation-delay: .20s; }
.editorial-gallery .gallery-item:nth-child(7) { animation-delay: .24s; }
.editorial-gallery .gallery-item:nth-child(8) { animation-delay: .28s; }

@keyframes galleryFadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* =========================================================
   RESPONSIVE — LARGE TABLET
========================================================= */

@media (max-width: 1180px) {
  .hero-page.referenzen-hero {
    min-height: 78vh;
    padding-top: 150px;
    padding-bottom: 78px;
  }

  .editorial-gallery {
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 22px;
  }

  .gallery-item,
  .gallery-item-vertical {
    grid-column: span 4;
  }

  .gallery-item-large,
  .gallery-item-wide {
    grid-column: span 8;
  }

  .gallery-open {
    height: 380px;
  }

  .gallery-item-large .gallery-open,
  .gallery-item-wide .gallery-open,
  .gallery-item-vertical .gallery-open {
    height: 460px;
  }

  .project-lightbox-inner {
    grid-template-columns: 1fr;
    height: calc(100vh - 56px);
  }

  .project-lightbox-content {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 18px;
    max-width: 560px;
  }
}


/* =========================================================
   RESPONSIVE — TABLET
========================================================= */

@media (max-width: 980px) {
  .hero-page.referenzen-hero {
    min-height: 76vh;
    padding-top: 128px;
    padding-bottom: 66px;
    align-items: flex-end;
  }

  .hero-page.referenzen-hero .hero-content {
    max-width: 100%;
    padding-top: 0;
  }

  .hero-page.referenzen-hero .hero-bg img {
    object-position: center center;
    transform: scale(1.035);
  }

  .references-intro {
    grid-template-columns: 1fr;
  }

  .references-head {
    margin-bottom: 30px;
  }
}


/* =========================================================
   RESPONSIVE — MOBILE / TABLET PORTRAIT
========================================================= */

@media (max-width: 820px) {
  .editorial-gallery {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .gallery-item,
  .gallery-item-large,
  .gallery-item-wide,
  .gallery-item-vertical {
    grid-column: auto;
  }

  .gallery-open,
  .gallery-item-large .gallery-open,
  .gallery-item-wide .gallery-open,
  .gallery-item-vertical .gallery-open {
    height: auto;
    aspect-ratio: 4 / 3;
    border-radius: 28px;
  }

  .gallery-item figcaption {
    padding-top: 13px;
  }

  .project-lightbox {
    padding: 14px;
  }

  .project-lightbox-close {
    top: 14px;
    right: 14px;
  }

  .project-lightbox-inner {
    height: calc(100vh - 28px);
  }

  .project-lightbox-image-wrap {
    border-radius: 26px;
  }

  .project-lightbox-content {
    left: 10px;
    right: 10px;
    bottom: 10px;
    padding: 20px;
    border-radius: 24px;
  }

  .project-lightbox-content p {
    font-size: .96rem;
  }
}


/* =========================================================
   RESPONSIVE — MOBILE
========================================================= */

@media (max-width: 620px) {
  .hero-page.referenzen-hero {
    min-height: 88vh;
    padding-top: 106px;
    padding-bottom: 52px;
    align-items: flex-end;
  }

  .hero-page.referenzen-hero .hero-bg img {
    object-position: center center;
    transform: scale(1.015);
    filter: saturate(.92) contrast(1.06) brightness(.66);
  }

  .references-hero-badges {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 24px;
  }

  .references-hero-badges .badge {
    width: 100%;
  }

  .references-head {
    margin-bottom: 24px;
  }

  .references-intro {
    margin-bottom: 26px;
  }

  .references-intro-card {
    padding: 18px;
    border-radius: 22px;
  }

  .editorial-gallery {
    gap: 24px;
  }

  .gallery-open,
  .gallery-item-large .gallery-open,
  .gallery-item-wide .gallery-open,
  .gallery-item-vertical .gallery-open {
    aspect-ratio: 4 / 3;
    border-radius: 24px;
  }

  .gallery-open::after {
    display: none;
  }

  .gallery-item figcaption {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 13px 2px 0;
  }

  .gallery-item figcaption small {
    text-align: left;
  }

  .project-lightbox-content {
    max-height: 42vh;
    overflow-y: auto;
  }
}


/* =========================================================
   RESPONSIVE — SMALL MOBILE
========================================================= */

@media (max-width: 420px) {
  .hero-page.referenzen-hero {
    min-height: 84vh;
    padding-top: 96px;
    padding-bottom: 44px;
  }

  .hero-page.referenzen-hero .hero-bg img {
    object-position: center center;
  }

  .references-intro-card {
    padding: 17px;
    border-radius: 20px;
  }

  .gallery-open,
  .gallery-item-large .gallery-open,
  .gallery-item-wide .gallery-open,
  .gallery-item-vertical .gallery-open {
    border-radius: 22px;
  }

  .gallery-item figcaption strong {
    font-size: 1rem;
  }

  .gallery-item figcaption small {
    font-size: .82rem;
  }

  .project-lightbox {
    padding: 10px;
  }

  .project-lightbox-inner {
    height: calc(100vh - 20px);
  }

  .project-lightbox-image-wrap {
    border-radius: 22px;
  }

  .project-lightbox-content {
    left: 8px;
    right: 8px;
    bottom: 8px;
    padding: 18px;
    border-radius: 20px;
  }
}


/* =========================================================
   RESPONSIVE — EXTRA SMALL MOBILE
========================================================= */

@media (max-width: 360px) {
  .hero-page.referenzen-hero {
    min-height: 82vh;
    padding-top: 88px;
  }

  .references-intro-card {
    padding: 16px;
  }

  .gallery-item figcaption span {
    font-size: .7rem;
  }

  .project-lightbox-content {
    padding: 16px;
  }
}