:root {
  --bg-base: #0f0a84;
  --bg-top: #2218b3;
  --bg-mid: #130d96;
  --bg-bottom: #08064f;
  --grid: rgba(255, 255, 255, 0.05);
  --card: rgba(255, 255, 255, 0.08);
  --line: rgba(255, 255, 255, 0.12);
  --text: #f7f6ff;
  --muted: rgba(247, 246, 255, 0.72);
  --shadow: rgba(2, 4, 28, 0.52);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 194, 46, 0.1), transparent 26%),
    radial-gradient(circle at 80% 14%, rgba(118, 149, 255, 0.16), transparent 28%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 48%, var(--bg-bottom) 100%);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
}

.gallery-page {
  position: relative;
  min-height: 100vh;
  padding: 1.25rem 1.5rem 2rem;
  overflow: hidden;
}

.gallery-page__aurora {
  position: absolute;
  border-radius: 50%;
  filter: blur(88px);
  opacity: 0.9;
  pointer-events: none;
}

.gallery-page__aurora--left {
  left: -4rem;
  bottom: 8rem;
  width: 22rem;
  height: 22rem;
  background: radial-gradient(circle, rgba(255, 194, 46, 0.18), transparent 70%);
}

.gallery-page__aurora--right {
  right: -3rem;
  top: 5rem;
  width: 18rem;
  height: 18rem;
  background: radial-gradient(circle, rgba(118, 149, 255, 0.24), transparent 72%);
}

.gallery-page__header,
.gallery-grid,
.gallery-overview,
.gallery-toolbar,
.gallery-pagination {
  position: relative;
  z-index: 1;
}

.gallery-page__header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin: 0 auto 1rem;
  max-width: 88rem;
}

.gallery-page__back {
  display: inline-flex;
  width: fit-content;
  padding: 0.45rem 0.8rem;
  color: rgba(247, 246, 255, 0.82);
  text-decoration: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gallery-page__copy h1 {
  margin: 0.15rem 0 0;
  font-size: clamp(1.25rem, 2vw, 1.7rem);
  line-height: 1;
  letter-spacing: 0.01em;
}

.gallery-page__eyebrow,
.gallery-page__lead {
  margin: 0;
}

.gallery-page__eyebrow {
  color: rgba(247, 246, 255, 0.56);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.68rem;
}

.gallery-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  max-width: 88rem;
  margin: 0 auto 0.9rem;
}

.gallery-overview__stat {
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(8px);
}

.gallery-overview__label {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.gallery-overview__value {
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  line-height: 1;
}

.gallery-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  max-width: 88rem;
  margin: 0 auto 1rem;
}

.gallery-toolbar__summary {
  margin: 0;
  color: rgba(247, 246, 255, 0.64);
  font-size: 0.9rem;
}

.gallery-toolbar__actions,
.gallery-pagination {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.gallery-toolbar__button,
.gallery-pagination__button,
.gallery-pagination__page,
.lightbox__close,
.lightbox__nav-button {
  padding: 0.7rem 1rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.gallery-toolbar__button:disabled,
.gallery-pagination__button:disabled,
.gallery-pagination__page:disabled,
.lightbox__nav-button:disabled {
  opacity: 0.35;
}

.gallery-grid {
  max-width: 88rem;
  margin: 0 auto;
}

.gallery-grid__items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 0.8rem;
}

.gallery-empty {
  display: grid;
  place-items: center;
  min-height: 18rem;
  padding: 2rem;
  text-align: center;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
}

.gallery-empty p {
  margin: 0.3rem 0;
}

.gallery-card {
  display: grid;
  gap: 0.35rem;
  padding: 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.035);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    transform 220ms ease,
    border-color 220ms ease,
    background 220ms ease,
    box-shadow 220ms ease;
}

.gallery-card:hover {
  transform: translateY(-0.2rem);
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.055);
  box-shadow: 0 1rem 2.4rem rgba(0, 0, 0, 0.16);
}

.gallery-card__image {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.06);
}

.gallery-card__meta {
  display: block;
}

.gallery-card__stamp {
  color: rgba(247, 246, 255, 0.58);
  font-size: 0.76rem;
}

.gallery-pagination {
  justify-content: center;
  flex-wrap: wrap;
  max-width: 88rem;
  margin: 1.5rem auto 0;
}

.gallery-pagination__pages {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  justify-content: center;
}

.gallery-pagination__page--active {
  background: rgba(255, 200, 77, 0.18);
  border-color: rgba(255, 200, 77, 0.45);
}

.lightbox {
  width: min(92vw, 78rem);
  border: 0;
  padding: 0;
  background: transparent;
}

.lightbox::backdrop {
  background: rgba(4, 6, 24, 0.78);
  backdrop-filter: blur(6px);
}

.lightbox__backdrop {
  display: grid;
  gap: 1rem;
}

.lightbox__close {
  justify-self: end;
}

.lightbox__figure {
  margin: 0;
}

.lightbox__image {
  display: block;
  width: 100%;
  max-height: 82vh;
  object-fit: contain;
}

.lightbox__caption {
  margin-top: 0.65rem;
  color: var(--muted);
  text-align: center;
}

.lightbox__nav {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
}

@media (max-width: 720px) {
  .gallery-page {
    padding: 0.9rem 0.9rem 1.3rem;
  }

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

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

  .gallery-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .gallery-toolbar__actions {
    justify-content: stretch;
  }

  .gallery-toolbar__button,
  .gallery-pagination__button {
    flex: 1 1 0;
  }

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