* {
  box-sizing: border-box;
}

:root {
  --page-padding: 20px;
  --gap: 8px;
  --header-height: 64px;
}

html,
body {
  margin: 0;
  padding: 0;
  background: #fff;
  color: #111;
  font-family: Arial, Helvetica, sans-serif;
}

body {
  min-height: 100vh;
}

button,
a {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: var(--header-height);
  padding: 18px var(--page-padding);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
}

.brand {
  justify-self: start;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.main-nav {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.nav-link,
.about-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: #777;
  cursor: pointer;
  font-size: 11px;
  letter-spacing: 0.04em;
}

.nav-link:hover,
.nav-link.is-active,
.about-button:hover {
  color: #111;
}

.about-button {
  justify-self: end;
}

.gallery {
  padding: 0 var(--page-padding) var(--page-padding);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gap);
}

.gallery-item {
  position: relative;
  margin: 0;
  overflow: hidden;
  background: #f4f4f4;
  cursor: zoom-in;
}

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: opacity 180ms ease;
}

.gallery-item:hover img {
  opacity: 0.78;
}

.gallery-item figcaption {
  display: none;
}

.empty-message {
  padding: 40px var(--page-padding);
  color: #777;
  font-size: 12px;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  background: #fff;
}

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

.lightbox-figure {
  margin: 0;
  width: calc(100vw - 180px);
  height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.lightbox-image,
#lightboxImage {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

#lightboxCaption {
  position: absolute;
  left: 0;
  bottom: -24px;
  font-size: 10px;
  color: #777;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next,
.about-close {
  border: 0;
  background: transparent;
  cursor: pointer;
  color: #111;
}

.lightbox-close {
  position: absolute;
  top: 14px;
  right: 20px;
  z-index: 2;
  font-size: 28px;
  font-weight: 300;
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  padding: 20px;
  font-size: 20px;
}

.lightbox-prev {
  left: 4px;
}

.lightbox-next {
  right: 4px;
}

.about-panel {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 40;
  width: min(430px, 100vw);
  padding: 70px 30px 30px;
  background: #fff;
  border-left: 1px solid #eee;
  transform: translateX(100%);
  transition: transform 240ms ease;
}

.about-panel.is-open {
  transform: translateX(0);
}

.about-close {
  position: absolute;
  right: 20px;
  top: 14px;
  font-size: 28px;
}

.about-content h1 {
  margin: 0 0 30px;
  font-size: 15px;
  font-weight: 700;
}

.about-content p {
  font-size: 13px;
  line-height: 1.6;
}

body.no-scroll {
  overflow: hidden;
}

@media (max-width: 1000px) {
  .gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  :root {
    --page-padding: 10px;
    --gap: 5px;
  }

  .site-header {
    position: relative;
    grid-template-columns: 1fr auto;
    gap: 14px;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .brand {
    grid-column: 1;
  }

  .about-button {
    grid-column: 2;
  }

  .main-nav {
    grid-column: 1 / -1;
    justify-content: flex-start;
    gap: 12px;
    overflow-x: auto;
    padding-top: 4px;
  }

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

  .lightbox-figure {
    width: calc(100vw - 40px);
    height: calc(100vh - 100px);
  }

  .lightbox-prev,
  .lightbox-next {
    top: auto;
    bottom: 8px;
  }
}

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