.fmd-gallery-page {
  --fmd-dark: #09080d;
  --fmd-panel: #201f24;
  --fmd-panel-deep: #111019;
  --fmd-text: #ffffff;
  --fmd-muted: #d7d2c8;
  --fmd-soft: #a7a09a;
  --fmd-gold: #b39563;
  --fmd-gold-soft: rgba(179, 149, 99, 0.42);
  --fmd-line: rgba(179, 149, 99, 0.22);
  --fmd-shell: min(1180px, calc(100vw - 48px));
  background: var(--fmd-dark);
  color: var(--fmd-text);
  overflow: hidden;
}

.fmd-gallery-page a {
  color: inherit;
}

.fmd-gallery-hero {
  position: relative;
  min-height: clamp(560px, 72vh, 780px);
  display: grid;
  align-items: end;
  border-bottom: 1px solid rgba(179, 149, 99, 0.34);
  isolation: isolate;
}

.fmd-gallery-hero-media,
.fmd-gallery-hero-media img,
.fmd-gallery-hero-shade {
  position: absolute;
  inset: 0;
}

.fmd-gallery-hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fmd-gallery-hero-shade {
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(9, 8, 13, 0.95) 0%, rgba(9, 8, 13, 0.72) 38%, rgba(9, 8, 13, 0.42) 68%, rgba(9, 8, 13, 0.78) 100%),
    linear-gradient(180deg, rgba(9, 8, 13, 0.24) 0%, rgba(9, 8, 13, 0.92) 100%);
}

.fmd-gallery-hero-inner {
  position: relative;
  z-index: 2;
  width: var(--fmd-shell);
  margin: 0 auto;
  padding: clamp(120px, 15vh, 180px) 0 clamp(64px, 9vh, 96px);
  display: grid;
  grid-template-columns: minmax(0, 620px) minmax(260px, 360px);
  gap: clamp(32px, 5vw, 96px);
  align-items: end;
}

.fmd-gallery-eyebrow,
.fmd-gallery-section-kicker {
  position: relative;
  margin: 0 0 18px;
  padding-left: 42px;
  color: var(--fmd-gold);
  font-size: 0.78rem;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0;
}

.fmd-gallery-eyebrow::before,
.fmd-gallery-section-kicker::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.58em;
  width: 28px;
  height: 1px;
  background: var(--fmd-gold);
}

.fmd-gallery-hero h1 {
  max-width: 680px;
  margin: 0;
  font-size: clamp(2.65rem, 7vw, 6.2rem);
  line-height: 0.94;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0;
}

.fmd-gallery-lead {
  max-width: 640px;
  margin: 24px 0 0;
  color: var(--fmd-muted);
  font-size: clamp(1rem, 1.22vw, 1.16rem);
  line-height: 1.8;
}

.fmd-gallery-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.fmd-gallery-btn {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: 1px solid rgba(179, 149, 99, 0.58);
  border-radius: 999px;
  text-decoration: none;
  color: var(--fmd-text);
  background: rgba(9, 8, 13, 0.48);
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.fmd-gallery-btn:hover,
.fmd-gallery-btn:focus-visible {
  color: var(--fmd-text);
  border-color: var(--fmd-gold);
  background: rgba(53, 46, 39, 0.72);
  transform: translateY(-1px);
}

.fmd-gallery-btn-primary {
  color: var(--fmd-dark);
  background: var(--fmd-gold);
  border-color: var(--fmd-gold);
}

.fmd-gallery-btn-primary:hover,
.fmd-gallery-btn-primary:focus-visible {
  color: var(--fmd-dark);
  background: #c7aa76;
}

.fmd-gallery-hero-card {
  justify-self: end;
  width: min(100%, 360px);
  min-height: 210px;
  display: grid;
  align-content: end;
  gap: 12px;
  padding: 26px;
  border: 1px solid var(--fmd-gold-soft);
  background:
    linear-gradient(135deg, rgba(32, 31, 36, 0.86), rgba(17, 16, 25, 0.72)),
    linear-gradient(90deg, rgba(179, 149, 99, 0.12), transparent);
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.36);
}

.fmd-gallery-hero-card span {
  color: var(--fmd-gold);
  font-size: 2.2rem;
  line-height: 1;
}

.fmd-gallery-hero-card strong {
  font-size: 1.05rem;
  line-height: 1.35;
  text-transform: uppercase;
  font-weight: 500;
}

.fmd-gallery-hero-card small {
  color: var(--fmd-soft);
  font-size: 0.86rem;
}

.fmd-gallery-content {
  display: block;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  background: var(--fmd-dark);
}

.fmd-gallery-content > * {
  min-width: 0;
}

.fmd-gallery-intro,
.fmd-gallery-filter-shell,
.fmd-gallery-text-band,
.fmd-gallery-cta {
  width: var(--fmd-shell);
  margin: 0 auto;
}

.fmd-gallery-intro {
  padding: clamp(58px, 8vw, 96px) 0 42px;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(280px, 1.05fr);
  gap: clamp(34px, 6vw, 86px);
  align-items: start;
}

.fmd-gallery-intro h2,
.fmd-gallery-text-band h2,
.fmd-gallery-cta h2 {
  margin: 0;
  font-size: clamp(1.95rem, 3.4vw, 3.8rem);
  line-height: 1.02;
  text-transform: uppercase;
  font-weight: 400;
  letter-spacing: 0;
}

.fmd-gallery-intro-copy {
  display: grid;
  gap: 18px;
  color: var(--fmd-muted);
  font-size: 1rem;
  line-height: 1.78;
}

.fmd-gallery-intro-copy p {
  margin: 0;
}

.fmd-gallery-proof {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  width: var(--fmd-shell);
  margin: 0 auto clamp(58px, 7vw, 86px);
}

.fmd-gallery-proof-card {
  min-height: 104px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  padding: 18px 20px;
  border: 1px solid rgba(179, 149, 99, 0.18);
  background: linear-gradient(180deg, rgba(32, 31, 36, 0.94), rgba(10, 9, 14, 0.96));
}

.fmd-gallery-proof-card span {
  color: var(--fmd-gold);
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  line-height: 1;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.fmd-gallery-proof-card strong {
  display: block;
  color: var(--fmd-text);
  font-size: 0.86rem;
  line-height: 1.22;
  text-transform: uppercase;
  font-weight: 500;
}

.fmd-gallery-proof-card small {
  display: block;
  margin-top: 4px;
  color: var(--fmd-gold);
  font-size: 0.78rem;
  line-height: 1.2;
}

.fmd-gallery-filter-shell {
  padding: 28px;
  border: 1px solid rgba(179, 149, 99, 0.2);
  background:
    linear-gradient(180deg, rgba(32, 31, 36, 0.92), rgba(13, 12, 18, 0.96));
}

.fmd-gallery-filter-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 20px;
  align-items: end;
}

.fmd-gallery-filter-top h2 {
  margin: 0;
  font-size: clamp(1.55rem, 2.7vw, 2.55rem);
  line-height: 1.08;
  text-transform: uppercase;
  font-weight: 400;
}

.fmd-gallery-filter-top p {
  max-width: 680px;
  margin: 14px 0 0;
  color: var(--fmd-muted);
  line-height: 1.7;
}

.fmd-gallery-search {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(179, 149, 99, 0.35);
  border-radius: 0;
  background: rgba(9, 8, 13, 0.78);
  color: var(--fmd-text);
  padding: 12px 14px;
}

.fmd-gallery-search::placeholder {
  color: rgba(215, 210, 200, 0.58);
}

.fmd-gallery-filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.fmd-gallery-filter-button {
  min-height: 42px;
  border: 1px solid rgba(179, 149, 99, 0.3);
  border-radius: 999px;
  background: rgba(9, 8, 13, 0.56);
  color: var(--fmd-muted);
  padding: 10px 15px;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.fmd-gallery-filter-button:hover,
.fmd-gallery-filter-button:focus-visible,
.fmd-gallery-filter-button.is-active {
  color: var(--fmd-dark);
  border-color: var(--fmd-gold);
  background: var(--fmd-gold);
}

.fmd-real-gallery {
  width: var(--fmd-shell);
  margin: 30px auto 0;
  padding-bottom: clamp(70px, 9vw, 112px);
}

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

.fmd-gallery-item {
  grid-column: span 4;
  min-height: 0;
}

.fmd-gallery-item.is-wide {
  grid-column: span 6;
}

.fmd-gallery-card {
  position: relative;
  display: block;
  height: auto;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(179, 149, 99, 0.18);
  background: var(--fmd-panel-deep);
  text-decoration: none;
}

.fmd-gallery-card picture {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.fmd-gallery-item.is-wide .fmd-gallery-card picture {
  aspect-ratio: 16 / 9;
}

.fmd-gallery-item.is-tall .fmd-gallery-card picture {
  aspect-ratio: 3 / 4;
}

.fmd-gallery-card img {
  display: block;
  width: 100%;
  height: 100%;
}

.fmd-gallery-card img {
  object-fit: cover;
  transform: scale(1.01);
  transition: transform 320ms ease, filter 320ms ease;
}

.fmd-gallery-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(9, 8, 13, 0.04) 20%, rgba(9, 8, 13, 0.86) 100%);
  pointer-events: none;
}

.fmd-gallery-card:hover img,
.fmd-gallery-card:focus-visible img {
  transform: scale(1.045);
  filter: contrast(1.04);
}

.fmd-gallery-card:focus-visible {
  outline: 2px solid var(--fmd-gold);
  outline-offset: 3px;
}

.fmd-gallery-card-caption {
  position: absolute;
  z-index: 2;
  left: 16px;
  right: 16px;
  bottom: 16px;
  display: grid;
  gap: 7px;
}

.fmd-gallery-card-caption span {
  color: var(--fmd-gold);
  font-size: 0.75rem;
  text-transform: uppercase;
}

.fmd-gallery-card-caption strong {
  color: var(--fmd-text);
  font-size: 1.02rem;
  line-height: 1.24;
  text-transform: uppercase;
  font-weight: 500;
}

.fmd-gallery-card-caption small {
  color: var(--fmd-muted);
  line-height: 1.42;
}

.fmd-gallery-item[hidden] {
  display: none;
}

.fmd-gallery-empty {
  display: none;
  margin: 24px 0 0;
  color: var(--fmd-muted);
}

.fmd-gallery-empty.is-visible {
  display: block;
}

.fmd-gallery-text-band {
  padding: clamp(70px, 9vw, 120px) 0;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(34px, 6vw, 86px);
  border-top: 1px solid rgba(179, 149, 99, 0.22);
}

.fmd-gallery-text-panel {
  display: grid;
  gap: 20px;
  color: var(--fmd-muted);
  line-height: 1.78;
}

.fmd-gallery-text-panel p {
  margin: 0;
}

.fmd-gallery-link-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.fmd-gallery-service-link {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 15px;
  border: 1px solid rgba(179, 149, 99, 0.22);
  background: rgba(32, 31, 36, 0.56);
  color: var(--fmd-text);
  text-decoration: none;
  transition: border-color 160ms ease, background 160ms ease;
}

.fmd-gallery-service-link::after {
  content: "›";
  color: var(--fmd-gold);
  font-size: 1.2rem;
}

.fmd-gallery-service-link:hover,
.fmd-gallery-service-link:focus-visible {
  color: var(--fmd-text);
  border-color: var(--fmd-gold);
  background: rgba(53, 46, 39, 0.58);
}

.fmd-gallery-cta {
  margin-bottom: clamp(70px, 9vw, 120px);
  padding: clamp(34px, 5vw, 58px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: center;
  border: 1px solid rgba(179, 149, 99, 0.38);
  background:
    linear-gradient(135deg, rgba(32, 31, 36, 0.94), rgba(9, 8, 13, 0.98)),
    radial-gradient(circle at 100% 0%, rgba(179, 149, 99, 0.18), transparent 32%);
}

.fmd-gallery-cta p {
  max-width: 720px;
  margin: 18px 0 0;
  color: var(--fmd-muted);
  line-height: 1.75;
}

.fmd-gallery-lightbox {
  position: fixed;
  z-index: 99999;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(5, 5, 8, 0.92);
}

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

.fmd-gallery-lightbox-frame {
  position: relative;
  width: min(1180px, 100%);
  max-height: calc(100vh - 48px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  border: 1px solid rgba(179, 149, 99, 0.32);
  background: var(--fmd-panel-deep);
  box-shadow: 0 28px 120px rgba(0, 0, 0, 0.58);
}

.fmd-gallery-lightbox-image {
  min-height: min(68vh, 780px);
  background: #050508;
}

.fmd-gallery-lightbox-image img {
  width: 100%;
  height: 100%;
  max-height: calc(100vh - 52px);
  object-fit: contain;
}

.fmd-gallery-lightbox-copy {
  padding: 28px;
  display: grid;
  align-content: end;
  gap: 14px;
}

.fmd-gallery-lightbox-copy span {
  color: var(--fmd-gold);
  text-transform: uppercase;
  font-size: 0.78rem;
}

.fmd-gallery-lightbox-copy h2 {
  margin: 0;
  font-size: clamp(1.25rem, 2.1vw, 2rem);
  line-height: 1.08;
  text-transform: uppercase;
}

.fmd-gallery-lightbox-copy p {
  margin: 0;
  color: var(--fmd-muted);
  line-height: 1.65;
}

.fmd-gallery-lightbox-controls {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.fmd-gallery-lightbox button {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid rgba(179, 149, 99, 0.38);
  background: rgba(9, 8, 13, 0.76);
  color: var(--fmd-text);
  cursor: pointer;
}

.fmd-gallery-lightbox button:hover,
.fmd-gallery-lightbox button:focus-visible {
  border-color: var(--fmd-gold);
  color: var(--fmd-gold);
}

.fmd-gallery-lightbox-close {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 3;
}

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

@media (max-width: 1180px) {
  .fmd-gallery-proof {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fmd-gallery-item,
  .fmd-gallery-item.is-wide {
    grid-column: span 6;
  }
}

@media (max-width: 860px) {
  .fmd-gallery-page {
    --fmd-shell: min(100% - 32px, 720px);
  }

  .fmd-gallery-hero {
    min-height: 680px;
  }

  .fmd-gallery-hero-inner,
  .fmd-gallery-intro,
  .fmd-gallery-filter-top,
  .fmd-gallery-text-band,
  .fmd-gallery-cta {
    grid-template-columns: 1fr;
  }

  .fmd-gallery-hero-card {
    justify-self: stretch;
    min-height: 150px;
  }

  .fmd-gallery-proof {
    grid-template-columns: 1fr;
  }

  .fmd-gallery-grid {
    gap: 12px;
  }

  .fmd-gallery-item,
  .fmd-gallery-item.is-wide {
    grid-column: 1 / -1;
  }

  .fmd-gallery-card {
    min-height: 0;
  }

  .fmd-gallery-link-grid {
    grid-template-columns: 1fr;
  }

  .fmd-gallery-lightbox-frame {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .fmd-gallery-lightbox-image {
    min-height: 48vh;
  }
}

@media (min-width: 641px) and (max-width: 860px) {
  .fmd-gallery-item,
  .fmd-gallery-item.is-wide {
    grid-column: span 6;
  }

  .fmd-gallery-card {
    min-height: 0;
  }
}

@media (max-width: 520px) {
  .fmd-gallery-page {
    --fmd-shell: min(100% - 24px, 480px);
  }

  .fmd-gallery-hero {
    min-height: 620px;
  }

  .fmd-gallery-hero-inner {
    padding-top: 110px;
    padding-bottom: 44px;
  }

  .fmd-gallery-actions,
  .fmd-gallery-filter-buttons,
  .fmd-gallery-lightbox-controls {
    flex-direction: column;
  }

  .fmd-gallery-btn,
  .fmd-gallery-filter-button,
  .fmd-gallery-service-link {
    width: 100%;
  }

  .fmd-gallery-filter-shell {
    padding: 22px 16px;
  }

  .fmd-gallery-card {
    min-height: 0;
  }

  .fmd-gallery-lightbox {
    padding: 12px;
  }

  .fmd-gallery-lightbox-copy {
    padding: 22px 16px;
  }
}
