:root {
  --gallery-panel: #10151a;
  --gallery-panel-2: #151b21;
  --gallery-border: rgba(255,255,255,.09);
  --gallery-muted: #9fa9b4;
  --gallery-accent: #00aeef;
  --gallery-accent-soft: rgba(0,174,239,.14);
}

.gallery-page {
  background: #090b0d;
  min-height: 100vh;
}

.gallery-page .topbar {
  position: relative;
  background: #080a0c;
  border-bottom: 1px solid var(--gallery-border);
}

.gallery-page .topbar + main {
  padding-top: 0;
}

.gallery-hero {
  padding: 74px 0 42px;
  background:
    radial-gradient(circle at 78% 12%, rgba(0,174,239,.12), transparent 30%),
    linear-gradient(180deg, #0c1014 0%, #090b0d 100%);
  border-bottom: 1px solid var(--gallery-border);
}

.gallery-hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 28px;
}

.gallery-hero-copy {
  max-width: 760px;
}

.gallery-hero h1 {
  margin: 10px 0 14px;
  font-size: clamp(2.8rem, 6vw, 5.4rem);
  line-height: .98;
  letter-spacing: -.05em;
}

.gallery-hero p {
  max-width: 680px;
  margin: 0;
  color: var(--gallery-muted);
  font-size: 1.05rem;
}

.gallery-back-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--gallery-border);
  border-radius: 999px;
  color: #d8dde3;
  font-weight: 800;
  background: rgba(255,255,255,.025);
  transition: border-color .2s ease, transform .2s ease, color .2s ease;
}

.gallery-back-link:hover {
  color: white;
  border-color: rgba(99,212,255,.34);
  transform: translateY(-1px);
}

.gallery-section {
  padding: 52px 0 92px;
}

.gallery-shell {
  display: grid;
  grid-template-columns: minmax(330px, .9fr) minmax(0, 1.35fr);
  gap: 22px;
  align-items: start;
}

.feature-panel,
.gallery-browser {
  min-width: 0;
}

.feature-panel {
  position: sticky;
  top: 20px;
}

.feature-card {
  border: 1px solid var(--gallery-border);
  border-radius: 24px;
  background: linear-gradient(180deg, #11161b, #0d1115);
  overflow: hidden;
  box-shadow: 0 22px 70px rgba(0,0,0,.34);
}

.feature-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 640px;
  padding: 18px;
  background:
    radial-gradient(circle at center, rgba(0,174,239,.08), transparent 42%),
    #050709;
}

.feature-media-frame {
  position: relative;
  width: min(100%, 390px);
  aspect-ratio: 9 / 16;
  border-radius: 22px;
  overflow: hidden;
  background: #050607;
  border: 1px solid rgba(255,255,255,.08);
}

.feature-media-frame img,
.feature-media-frame video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  background: #050607;
}

.feature-media-frame img.is-landscape {
  object-fit: contain;
}

.feature-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(5,8,10,.78);
  border: 1px solid rgba(255,255,255,.12);
  color: #fff;
  font-size: .75rem;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

.feature-badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gallery-accent);
  box-shadow: 0 0 0 4px rgba(0,174,239,.12);
}

.feature-info {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px 22px;
}

.feature-info h2 {
  margin: 0 0 5px;
  font-size: 1.15rem;
  letter-spacing: -.02em;
}

.feature-info p {
  margin: 0;
  color: var(--gallery-muted);
  font-size: .9rem;
}

.feature-count {
  flex: 0 0 auto;
  color: var(--gallery-accent);
  font-size: .8rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.gallery-browser {
  border: 1px solid var(--gallery-border);
  border-radius: 24px;
  background: linear-gradient(180deg, #11161b, #0d1115);
  padding: 22px;
}

.gallery-browser-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.gallery-browser-head h2 {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2rem);
  letter-spacing: -.03em;
}

.gallery-browser-head p {
  margin: 5px 0 0;
  color: var(--gallery-muted);
  font-size: .92rem;
}

.gallery-filter {
  display: inline-flex;
  gap: 7px;
  padding: 5px;
  border-radius: 999px;
  border: 1px solid var(--gallery-border);
  background: #0a0d10;
}

.gallery-filter button {
  min-height: 38px;
  padding: 8px 13px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #abb4bd;
  font: inherit;
  font-size: .82rem;
  font-weight: 850;
  cursor: pointer;
}

.gallery-filter button.is-active {
  background: var(--gallery-accent-soft);
  color: #8de0ff;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.gallery-thumb {
  position: relative;
  min-width: 0;
  padding: 0;
  border: 1px solid var(--gallery-border);
  border-radius: 16px;
  overflow: hidden;
  background: #080b0e;
  cursor: pointer;
  aspect-ratio: 4 / 3;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.gallery-thumb:hover {
  transform: translateY(-2px);
  border-color: rgba(99,212,255,.36);
}

.gallery-thumb.is-active {
  border-color: var(--gallery-accent);
  box-shadow: 0 0 0 2px rgba(0,174,239,.14);
}

.gallery-thumb img,
.gallery-thumb video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.gallery-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(0,0,0,.45));
  pointer-events: none;
}

.gallery-thumb-label {
  position: absolute;
  z-index: 2;
  left: 10px;
  bottom: 9px;
  right: 10px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #fff;
  font-size: .72rem;
  font-weight: 800;
  text-align: left;
  text-shadow: 0 1px 8px rgba(0,0,0,.65);
}

.gallery-thumb-type {
  position: absolute;
  z-index: 3;
  top: 9px;
  right: 9px;
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border-radius: 999px;
  color: white;
  background: rgba(5,8,10,.76);
  border: 1px solid rgba(255,255,255,.12);
  font-size: .67rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
  backdrop-filter: blur(6px);
}

.gallery-empty {
  display: none;
  padding: 42px 18px;
  text-align: center;
  color: var(--gallery-muted);
  border: 1px dashed var(--gallery-border);
  border-radius: 16px;
}

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

.gallery-note {
  margin: 18px 0 0;
  padding: 14px 16px;
  border-left: 3px solid var(--gallery-accent);
  border-radius: 0 12px 12px 0;
  background: rgba(0,174,239,.06);
  color: #b8c1ca;
  font-size: .86rem;
}

.gallery-page .footer {
  margin-top: 0;
}

@media (max-width: 980px) {
  .gallery-shell {
    grid-template-columns: 1fr;
  }

  .feature-panel {
    position: relative;
    top: auto;
  }

  .feature-stage {
    min-height: 600px;
  }

  .feature-media-frame {
    width: min(100%, 360px);
  }

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

@media (max-width: 720px) {
  .gallery-hero {
    padding: 50px 0 34px;
  }

  .gallery-hero-inner {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .gallery-back-link {
    justify-self: start;
  }

  .gallery-section {
    padding: 34px 0 72px;
  }

  .feature-stage {
    min-height: 0;
    padding: 12px;
  }

  .feature-media-frame {
    width: min(100%, 330px);
  }

  .gallery-browser {
    padding: 16px;
  }

  .gallery-browser-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .gallery-filter {
    width: 100%;
  }

  .gallery-filter button {
    flex: 1;
  }

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

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

  .gallery-thumb {
    border-radius: 13px;
  }

  .feature-info {
    padding: 17px 17px 19px;
  }
}
