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

:root {
  --bg: #fafafa;
  --text: #1a1a1a;
  --text-light: #666;
  --accent: #1a1a1a;
  --header-height: 80px;
  --gutter: 8px;
  --side-padding: 40px;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 300;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

/* ── Header ── */

header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.header-inner {
  max-width: 100%;
  padding: 0 var(--side-padding);
  height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 40px;
}

.site-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 300;
  letter-spacing: 0.02em;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.nav-link {
  font-size: 0.8rem;
  font-weight: 300;
  letter-spacing: 0.04em;
  color: var(--text-light);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 3px;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}

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

.nav-link.active {
  color: var(--text);
  background: rgba(0, 0, 0, 0.05);
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin-left: auto;
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--text);
  transition: transform 0.3s, opacity 0.3s;
}

/* ── Gallery ── */

main {
  padding-top: var(--header-height);
}

.gallery {
  padding: var(--gutter);
  column-count: 3;
  column-gap: var(--gutter);
}

.gallery-item {
  break-inside: avoid;
  margin-bottom: var(--gutter);
  cursor: pointer;
  overflow: hidden;
  border-radius: 2px;
  line-height: 0;
}

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.4s ease;
}

.gallery-item img.loaded {
  opacity: 1;
}

.gallery-item:hover img {
  transform: scale(1.02);
}

/* ── Pages ── */

.page-content {
  padding: 80px var(--side-padding);
  max-width: 640px;
}

.page-content.hidden {
  display: none;
}

.page-inner h2 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 2rem;
  font-weight: 300;
  margin-bottom: 24px;
}

.page-inner p {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-light);
}

.page-inner a {
  color: var(--text);
}

/* ── Lightbox ── */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lightbox.open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-img-wrap {
  max-width: 92vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-img-wrap img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: color 0.2s;
  font-family: inherit;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  color: #fff;
}

.lightbox-close {
  top: 20px;
  right: 24px;
  font-size: 2rem;
  line-height: 1;
  padding: 8px;
}

.lightbox-prev,
.lightbox-next {
  top: 50%;
  transform: translateY(-50%);
  font-size: 3rem;
  padding: 16px;
}

.lightbox-prev { left: 12px; }
.lightbox-next { right: 12px; }

.lightbox-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
}

/* ── Responsive ── */

@media (max-width: 1024px) {
  .gallery { column-count: 2; }
}

@media (max-width: 768px) {
  :root {
    --header-height: 60px;
    --side-padding: 16px;
    --gutter: 6px;
  }

  .header-inner {
    flex-wrap: wrap;
    height: auto;
    padding-top: 16px;
    padding-bottom: 16px;
  }

  .site-title {
    font-size: 1.25rem;
  }

  .menu-toggle {
    display: flex;
  }

  nav {
    display: none;
    width: 100%;
    padding: 12px 0 4px;
    gap: 2px;
  }

  nav.open {
    display: flex;
  }

  .nav-link {
    padding: 8px 10px;
  }

  .gallery { column-count: 2; }
}

@media (max-width: 480px) {
  .gallery { column-count: 1; }
}
