:root {
  --bg: #000000;
  --text: #eceae7;
  --muted: #7a7874;
  --accent: #b8a078;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --hero-fade: 0.85s var(--ease);
  --page-max: 1300px;
  --page-pad: clamp(1rem, 4vw, 1.75rem);
  --gallery-gap-x: 0.75rem;
  --gallery-gap-y: 0.5rem;
}

@keyframes hero-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes hero-filters-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes gallery-item-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  background: var(--bg);
}

.page {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 var(--page-pad);
}

.hero {
  text-align: center;
  padding: clamp(2.5rem, 5.5vw, 3.5rem) 0 clamp(1.65rem, 3.5vw, 2.35rem);
  background: transparent;
}

.hero__inner {
  max-width: 40rem;
  margin: 0 auto;
}

.hero__title {
  margin: 0;
  font-size: clamp(2.25rem, 6.5vw, 3.25rem);
  font-weight: 400;
  letter-spacing: 0.18em;
  text-indent: 0.18em;
  text-transform: uppercase;
  color: var(--text);
  opacity: 0;
}

.hero__tagline {
  margin: clamp(1.35rem, 2.8vw, 1.65rem) 0 clamp(1.15rem, 2.6vw, 1.7rem);
  font-size: clamp(0.88rem, 2vw, 1rem);
  letter-spacing: 0.1em;
  color: var(--muted);
  opacity: 0;
}

body.site-ready .hero__title {
  animation: hero-rise var(--hero-fade) 0.08s both;
}

body.site-ready .hero__tagline {
  animation: hero-rise var(--hero-fade) 0.28s both;
}

.filters-shell {
  display: flex;
  justify-content: center;
  margin-top: clamp(0.2rem, 0.8vw, 0.45rem);
  margin-bottom: clamp(2.25rem, 4.5vw, 3.25rem);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.45rem;
  justify-content: center;
  align-items: center;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  opacity: 0;
}

body.site-ready .filters {
  animation: hero-filters-in 0.75s var(--ease) 0.38s both;
}

body.site-error .hero__title,
body.site-error .hero__tagline,
body.site-error .filters {
  opacity: 1;
  transform: none;
  animation: none;
}

body.site-error .gallery__item {
  opacity: 1;
  animation: none;
}

@media (prefers-reduced-motion: reduce) {
  body.site-ready .hero__title,
  body.site-ready .hero__tagline,
  body.site-ready .filters {
    animation: none;
    opacity: 1;
    transform: none;
  }

  body.site-ready .gallery__item {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

.filters__btn {
  font: inherit;
  font-size: 0.8rem;
  font-weight: 400;
  padding: 0.48rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.filters__btn:hover {
  color: rgba(236, 234, 231, 0.92);
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
}

.filters__btn.is-active {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.24);
  font-weight: 500;
}

.main {
  margin: 0;
  padding: 0 0 clamp(3rem, 6vw, 4.5rem);
}

.gallery__status {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 1.35rem;
}

.gallery {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: var(--gallery-gap-y) var(--gallery-gap-x);
  width: 100%;
}

.gallery__item {
  flex: 1 1 100%;
  max-width: 100%;
  min-width: 0;
}

@media (min-width: 768px) {
  .gallery__item {
    flex: 0 1 calc((100% - 2 * var(--gallery-gap-x)) / 3);
    max-width: calc((100% - 2 * var(--gallery-gap-x)) / 3);
  }
}

.gallery__item[hidden] {
  display: none;
}

body.site-ready .gallery__item {
  opacity: 0;
  animation: gallery-item-in 0.4s var(--ease) var(--enter-delay, 0s) forwards;
}

.gallery__thumb {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  overflow: hidden;
  cursor: zoom-in;
  background: #0d0d0d;
  aspect-ratio: 4 / 3;
}

.gallery__thumb:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1) translateY(0);
  filter: brightness(1);
  transition:
    transform 0.45s var(--ease),
    filter 0.45s var(--ease);
}

.gallery__thumb:hover img {
  transform: scale(1.02) translateY(-3px);
  filter: brightness(1.05);
}

@keyframes lightbox-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem min(5rem, 12vw);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.32s var(--ease),
    visibility 0.32s;
}

.lightbox[hidden] {
  display: none;
}

.lightbox.is-open:not([hidden]) {
  display: flex;
  opacity: 1;
  visibility: visible;
  animation: lightbox-fade-in 0.38s var(--ease) both;
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(2, 2, 3, 0.94);
  cursor: zoom-out;
}

.lightbox__close,
.lightbox__nav {
  position: absolute;
  z-index: 2;
  font: inherit;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}

.lightbox__close:hover,
.lightbox__nav:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.lightbox__close {
  top: 1rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.5rem;
  line-height: 1;
}

.lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
  width: 2.75rem;
  height: 2.75rem;
  font-size: 1.65rem;
  line-height: 1;
  padding-bottom: 0.1rem;
}

.lightbox__nav--prev {
  left: min(1rem, 3vw);
}

.lightbox__nav--next {
  right: min(1rem, 3vw);
}

.lightbox__frame {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: min(100%, 1400px);
  max-height: min(100vh - 6rem, 100dvh - 6rem);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

.lightbox__img {
  max-width: 100%;
  max-height: min(100vh - 6rem, 100dvh - 6rem);
  width: auto;
  height: auto;
  object-fit: contain;
  cursor: default;
  border-radius: 2px;
}

body.lightbox-open {
  overflow: hidden;
}

@media (max-width: 640px) {
  .lightbox {
    padding: 3rem 2.75rem;
  }

  .lightbox__nav {
    width: 2.4rem;
    height: 2.4rem;
    font-size: 1.45rem;
  }

  .lightbox__nav--prev {
    left: 0.35rem;
  }

  .lightbox__nav--next {
    right: 0.35rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lightbox {
    transition: none;
  }

  .lightbox.is-open:not([hidden]) {
    animation: none;
    opacity: 1;
  }

  .gallery__thumb img {
    transition: none;
  }

  .gallery__thumb:hover img {
    transform: none;
    filter: none;
  }
}

.footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: clamp(2rem, 4vw, 2.75rem) var(--page-pad) clamp(2.5rem, 5vw, 3.5rem);
}

.footer__inner {
  max-width: var(--page-max);
  margin: 0 auto;
  text-align: center;
}

.footer__line {
  margin: 0;
  font-size: 0.875rem;
}

.footer__line--muted {
  margin-top: 0.4rem;
  font-size: 0.8125rem;
  color: var(--muted);
}

.footer__builder {
  margin: 2rem 0 0;
  padding-top: 1.35rem;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 0.6875rem;
  letter-spacing: 0.03em;
  color: var(--muted);
  opacity: 0.55;
}

.footer__builder a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer__builder a:hover {
  opacity: 0.9;
  color: rgba(236, 234, 231, 0.85);
}
