:root {
  --bg: #141414;
  --fg: #f2f2f2;
  --fg-dim: #9a9a9a;
  --accent: #7fb3b3;
  --header-h: 64px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  min-height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

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

/* Header */

.site-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 22px 40px;
  min-height: var(--header-h);
  transition: opacity 0.3s ease;
}

body.lightbox-open .site-header,
body.lightbox-open .site-footer {
  opacity: 0.25;
  pointer-events: none;
}

.nav-link {
  font-size: 15px;
  letter-spacing: 0.02em;
  color: var(--fg);
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-link.active {
  color: var(--accent);
}

.nav-link:hover {
  color: var(--accent);
}

.header-logo {
  flex: 0 1 auto;
  max-width: min(340px, 100%);
  width: auto;
  height: auto;
}

/* Home page */

.home {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 40px 100px;
  min-height: calc(100vh - var(--header-h) - 44px);
}

.home-title {
  font-family: Georgia, serif;
  font-weight: 400;
  font-size: 40px;
  letter-spacing: 0.03em;
  color: var(--fg);
  margin: 0 0 30px;
  text-align: center;
}

.home-image-link {
  display: block;
  max-width: 440px;
  width: 100%;
}

.home-image {
  display: block;
  width: 100%;
  height: auto;
}

/* Gallery / Index page */

.gallery-page {
  padding: 20px 60px 20px;
  max-width: 1240px;
  margin: 0 auto;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px 16px;
}

.gallery-item {
  overflow: hidden;
  cursor: pointer;
  background: #1e1e1e;
  aspect-ratio: 4 / 3;
}

.gallery-item.hidden {
  display: none;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.gallery-item:hover img {
  transform: scale(1.04);
  opacity: 0.9;
}

.more-link {
  display: block;
  margin: 40px auto 20px;
  background: none;
  border: none;
  color: var(--accent);
  font-size: 15px;
  text-decoration: underline;
  cursor: pointer;
  font-family: inherit;
}

.more-link:hover {
  opacity: 0.75;
}

.more-link.hidden {
  display: none;
}

@media (max-width: 900px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 520px) {
  .site-header {
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
    padding: 18px 20px;
    gap: 14px;
  }
  .header-logo {
    order: 3;
    max-width: 260px;
  }
  .gallery-page {
    padding: 20px 24px;
  }
}

/* Video page */

.video-page {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 60px 60px;
}

.video-player {
  display: block;
  width: 100%;
  height: auto;
  background: #000;
}

.video-close {
  position: absolute;
  top: -6px;
  right: 60px;
  width: 48px;
  height: 48px;
  background: #fff;
  color: #111;
  font-size: 26px;
  line-height: 48px;
  text-align: center;
  z-index: 10;
}

.video-close:hover {
  opacity: 0.85;
}

@media (max-width: 700px) {
  .video-page {
    padding: 16px 20px 40px;
  }
  .video-close {
    right: 20px;
  }
}

/* Footer */

.site-footer {
  text-align: center;
  padding: 60px 20px 50px;
  transition: opacity 0.3s ease;
}

.photo-credits {
  font-family: Georgia, serif;
  font-size: 16px;
  color: var(--fg-dim);
  margin: 0 0 30px;
}

.footer-logo-img {
  max-width: 300px;
  width: 60%;
  height: auto;
}

/* Lightbox */

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.97);
  align-items: center;
  justify-content: center;
  z-index: 500;
}

.lightbox.open {
  display: flex;
}

.lightbox img {
  max-width: 85vw;
  max-height: 85vh;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 34px;
  color: var(--fg);
  font-size: 34px;
  cursor: pointer;
  line-height: 1;
  opacity: 0.8;
}

.lightbox-close:hover {
  opacity: 1;
  color: var(--accent);
}

.lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--fg);
  font-size: 56px;
  line-height: 1;
  cursor: pointer;
  padding: 10px 18px;
  opacity: 0.6;
}

.lightbox-arrow:hover {
  opacity: 1;
  color: var(--accent);
}

.lightbox-prev {
  left: 10px;
}

.lightbox-next {
  right: 10px;
}

@media (max-width: 600px) {
  .lightbox-arrow {
    font-size: 40px;
    padding: 8px 10px;
  }
}
