:root {
  --gallery-bg: #050505;
  --gallery-panel: #131314;
  --gallery-line: rgba(255, 255, 255, 0.08);
  --gallery-line-strong: rgba(255, 255, 255, 0.14);
  --gallery-text: #ffffff;
  --gallery-muted: rgba(255, 255, 255, 0.74);
  --gallery-silver-soft: #b9bcc3;
  --gallery-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  --gallery-shadow-soft: 0 14px 34px rgba(0, 0, 0, 0.18);
}

.gallery-hero {
  position: relative;
  min-height: 46vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 170px 0 90px;
  background:
    linear-gradient(180deg, rgba(4, 4, 5, 0.58) 0%, rgba(4, 4, 5, 0.82) 100%),
    url("images/hero-1.jpg") center center / cover no-repeat;
}

.gallery-hero::before {
  content: "";
  position: absolute;
  inset: auto auto -140px -60px;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0) 72%);
  pointer-events: none;
}

.gallery-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0, rgba(255, 255, 255, 0.04) 1px, transparent 1px, transparent 100%),
    linear-gradient(rgba(255, 255, 255, 0.03) 0, rgba(255, 255, 255, 0.03) 1px, transparent 1px, transparent 100%);
  background-size: 80px 80px;
  opacity: 0.18;
  pointer-events: none;
}

.gallery-hero-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 20%, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0) 36%);
  pointer-events: none;
}

.gallery-hero-inner {
  position: relative;
  z-index: 2;
  max-width: 900px;
  text-align: center;
  margin: 0 auto;
}

.gallery-hero-kicker {
  margin: 0 0 16px;
  font-size: 0.92rem;
  line-height: 1.4;
  letter-spacing: 0.12em;
  color: var(--gallery-silver-soft);
  font-weight: 700;
}

.gallery-hero h1 {
  margin: 0 0 18px;
  font-family: "DM Sans", sans-serif;
  font-size: clamp(2.8rem, 6vw, 5.6rem);
  line-height: 0.94;
  letter-spacing: -0.05em;
  color: var(--gallery-text);
  text-transform: none;
}

.gallery-hero-text {
  max-width: 800px;
  margin: 0 auto;
  font-size: 1.07rem;
  line-height: 1.85;
  color: var(--gallery-muted);
}

.gallery-featured-project-section {
  background: #050505;
  color: #fff;
  padding-top: 20px;
  padding-bottom: 26px;
}

.gallery-featured-project-card {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(0, 1.05fr);
  gap: 22px;
  align-items: stretch;
}

.gallery-featured-project-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 34px;
  border-radius: 28px;
  background: linear-gradient(180deg, #171819 0%, #101112 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--gallery-shadow-soft);
}

.gallery-featured-label {
  margin: 0 0 12px;
  color: var(--gallery-silver-soft);
  font-size: 0.9rem;
  letter-spacing: 0.12em;
  font-weight: 700;
}

.gallery-featured-project-copy h2 {
  margin: 0 0 14px;
  font-size: clamp(2.1rem, 4vw, 4rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
  color: #fff;
}

.gallery-featured-project-copy p {
  margin: 0 0 18px;
  color: var(--gallery-muted);
  line-height: 1.85;
}

.gallery-featured-project-image {
  position: relative;
  display: block;
  width: 100%;
  min-height: 520px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  background: #111;
  box-shadow: var(--gallery-shadow);
  padding: 0;
  cursor: pointer;
}

.gallery-featured-project-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.gallery-featured-project-image:hover img {
  transform: scale(1.04);
}

.gallery-mosaic-section {
  background: #050505;
  color: #fff;
  padding-top: 8px;
}

.gallery-mosaic-head {
  max-width: 760px;
  margin-bottom: 28px;
}

.gallery-mosaic-head h2 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 1;
  letter-spacing: -0.04em;
  color: #fff;
}

.gallery-mosaic-head p {
  margin: 0;
  color: var(--gallery-muted);
  line-height: 1.8;
}

/* 3 across */
.gallery-mosaic {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.gallery-card {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  background: var(--gallery-panel);
  border: 1px solid var(--gallery-line);
  box-shadow: var(--gallery-shadow-soft);
  padding: 0;
  cursor: pointer;
  appearance: none;
  min-height: 290px;
  transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.gallery-card:hover {
  transform: translateY(-4px);
  border-color: var(--gallery-line-strong);
  box-shadow: var(--gallery-shadow);
}

.gallery-card:focus-visible,
.gallery-featured-project-image:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.75);
  outline-offset: 3px;
}

.gallery-card img {
  width: 100%;
  height: 100%;
  display: block;
  min-height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.gallery-card:hover img {
  transform: scale(1.04);
}

.gallery-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 7, 8, 0.02) 30%, rgba(7, 7, 8, 0.18) 100%);
  pointer-events: none;
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(3, 3, 4, 0.94);
}

.gallery-lightbox.is-open {
  display: flex;
}

.gallery-lightbox-content {
  position: relative;
  width: min(1120px, 100%);
  display: grid;
  justify-items: center;
  gap: 14px;
}

.gallery-lightbox-content img {
  display: block;
  max-width: 100%;
  max-height: 78vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 20px;
  box-shadow: var(--gallery-shadow);
}

.gallery-lightbox-caption {
  text-align: center;
}

.gallery-lightbox-caption p {
  margin: 0 0 6px;
  color: #fff;
  font-size: 1.15rem;
  line-height: 1.3;
  font-weight: 700;
}

.gallery-lightbox-caption span {
  color: var(--gallery-muted);
  font-size: 0.96rem;
  line-height: 1.6;
}

.gallery-lightbox-close,
.gallery-lightbox-arrow {
  position: absolute;
  z-index: 5;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  cursor: pointer;
}

.gallery-lightbox-close:hover,
.gallery-lightbox-arrow:hover {
  background: rgba(255, 255, 255, 0.16);
}

.gallery-lightbox-close {
  top: 22px;
  right: 22px;
  width: 48px;
  height: 48px;
}

.gallery-lightbox-arrow {
  top: 50%;
  transform: translateY(-50%);
  width: 54px;
  height: 54px;
}

.gallery-lightbox-prev {
  left: 22px;
}

.gallery-lightbox-next {
  right: 22px;
}

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

@media (max-width: 1100px) {
  .gallery-featured-project-card {
    grid-template-columns: 1fr;
  }

  .gallery-featured-project-image {
    min-height: 380px;
  }

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

@media (max-width: 760px) {
  .gallery-hero {
    min-height: auto;
    padding: 138px 0 62px;
  }

  .gallery-hero h1 {
    font-size: 2.7rem;
    line-height: 0.98;
  }

  .gallery-hero-text {
    font-size: 1rem;
    line-height: 1.75;
  }

  .gallery-featured-project-copy,
  .gallery-mosaic-head {
    text-align: center;
  }

  .gallery-featured-project-copy {
    padding: 26px;
  }

  .gallery-featured-project-image {
    min-height: 300px;
  }

  .gallery-mosaic {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .gallery-card {
    min-height: 260px;
  }

  .gallery-lightbox {
    padding: 14px;
  }

  .gallery-lightbox-close {
    top: 10px;
    right: 10px;
    width: 42px;
    height: 42px;
  }

  .gallery-lightbox-arrow {
    width: 42px;
    height: 42px;
  }

  .gallery-lightbox-prev {
    left: 8px;
  }

  .gallery-lightbox-next {
    right: 8px;
  }

  .gallery-lightbox-content img {
    max-height: 68vh;
  }
}
