/* ── Reset & base ────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg:        #0e0e0e;
  --surface:   #161616;
  --border:    #2a2a2a;
  --text:      #e8e8e8;
  --muted:     #666;
  --accent:    #fff;
  --gap:       16px;
  --radius:    8px;
  --font:      'Helvetica Neue', Helvetica, Arial, sans-serif;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ──────────────────────────────────────────────────────── */
header {
  padding: 2rem 2rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1rem;
}

.site-logo {
  width: 70px;
  height: 70px;
  object-fit: contain;
  flex-shrink: 0;
}

header .tagline {
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── Main ────────────────────────────────────────────────────────── */
main {
  flex: 1;
  padding: 2rem;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

/* ── Masonry gallery ─────────────────────────────────────────────── */
.gallery {
  columns: 4 220px;       /* 4 cols on desktop, fewer on narrower screens */
  column-gap: var(--gap);
}

.gallery-item {
  break-inside: avoid;
  margin-bottom: var(--gap);
  overflow: hidden;
  border-radius: var(--radius);
  background-color: var(--surface);
  cursor: zoom-in;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  transition: box-shadow 0.35s ease;
}

.gallery-item img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  transition: transform 0.35s ease, opacity 0.3s ease;
  opacity: 0.85;
}

.gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0);
  transition: background 0.3s ease;
  pointer-events: none;
}

.gallery-item:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.gallery-item:hover img {
  transform: scale(1.05);
  opacity: 1;
}

.gallery-item:hover::after {
  background: rgba(255, 255, 255, 0.03);
}

/* Responsive column count overrides */
@media (max-width: 640px) {
  .gallery {
    columns: unset;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--gap);
  }
  .gallery-item {
    margin-bottom: 0;
    aspect-ratio: 1 / 1;
  }
  .gallery-item img {
    height: 100%;
    object-fit: cover;
  }
  main {
    padding: 1.25rem;
  }
}

@media (min-width: 641px) and (max-width: 900px) {
  .gallery {
    columns: 3;
  }
}

/* ── Footer ──────────────────────────────────────────────────────── */
footer {
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}

.footer-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  opacity: 0.5;
  flex-shrink: 0;
}

/* ── Lightbox ────────────────────────────────────────────────────── */
.lightbox {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.95);
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

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

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

.lightbox-content img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius);
  user-select: none;
  box-shadow: 0 8px 60px rgba(0,0,0,0.7);
}

/* Lightbox controls */
.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s ease;
  padding: 0.5rem;
  z-index: 1001;
}

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

.lightbox-close {
  top: 1.25rem;
  right: 1.5rem;
  font-size: 2.2rem;
}

.lightbox-prev {
  left: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 3rem;
}

.lightbox-next {
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 3rem;
}

@media (max-width: 640px) {
  .lightbox-prev { left: 0.5rem; }
  .lightbox-next { right: 0.5rem; }
}

/* ── Scroll reveal ───────────────────────────────────────────────── */
.gallery-item.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.5s ease, transform 0.5s ease, box-shadow 0.35s ease;
}

.gallery-item.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
