:root {
  --bg: #111318;
  --panel: #1a1f29;
  --text: #f3f4f6;
  --muted: #b7bfcc;
  --accent: #8b5cf6;
  --border: #2a3140;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --radius: 14px;
  --content-width: 1200px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: linear-gradient(180deg, #0e1015 0%, #141923 100%);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100%;
}

body.modal-open {
  overflow: hidden;
}

.page {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}

header {
  margin-bottom: 1.5rem;
}

h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1;
  font-family: "Playfair Display", serif;
  letter-spacing: 0.02em;
}

.intro {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  max-width: 48rem;
}

.status {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  align-items: start;
}

.card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.card:hover,
.card:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(139, 92, 246, 0.75);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
  outline: none;
}

.thumb-wrap {
  aspect-ratio: 4 / 3;
  background: #0b0e13;
  overflow: hidden;
}

.thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.caption {
  padding: 0.8rem 0.9rem 1rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.4;
}

.lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(5, 7, 12, 0.95);
  z-index: 999;
  padding: 1rem;
}

.lightbox.open {
  display: flex;
}

.lightbox-inner {
  position: relative;
  width: min(96vw, 1400px);
  height: min(94vh, 980px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
}

.lightbox-image-wrap {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45);
  user-select: none;
  -webkit-user-drag: none;
}

.lightbox-caption {
  flex: 0 0 auto;
  width: min(90vw, 900px);
  text-align: center;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.5;
  padding: 0.2rem 1rem 0;
}

.close-button {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  border: 0;
  border-radius: 999px;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.12);
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  backdrop-filter: blur(4px);
  z-index: 5; /* ensure above nav zones */
}

.close-button:hover,
.close-button:focus-visible {
  background: rgba(255, 255, 255, 0.2);
  outline: none;
}

.nav-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 33.333%;
  cursor: pointer;
  z-index: 2;
}

.nav-zone.left {
  left: 0;
}

.nav-zone.middle {
  left: 33.333%;
  cursor: zoom-out;
}

.nav-zone.right {
  right: 0;
}

.hint {
  position: absolute;
  bottom: calc(100% + 0.6rem);
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.85rem;
  pointer-events: none;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .page {
    padding: 1.25rem 0.8rem 2rem;
  }

  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
  }

  .caption {
    font-size: 0.9rem;
  }

  .lightbox-inner {
    width: 100%;
    height: 100%;
  }

  .lightbox-caption {
    font-size: 0.95rem;
  }

  .hint {
    display: none;
  }
}
