:root {
  color-scheme: light dark;
  --bg: #fafafa;
  --fg: #16181d;
  --muted: #6b7280;
  --line: #e4e4e7;
  --accent: #2563eb;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0f12;
    --fg: #f2f3f5;
    --muted: #9aa0aa;
    --line: #262a30;
    --accent: #60a5fa;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }

/* Home */
.home {
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem;
}
.home h1 {
  font-size: clamp(2.4rem, 8vw, 4rem);
  letter-spacing: -0.03em;
  margin: 0 0 0.5rem;
}
.tagline { color: var(--muted); margin: 0 0 2rem; font-size: 1.1rem; }
.links a {
  display: inline-block;
  padding: 0.7rem 1.3rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  text-decoration: none;
  font-weight: 500;
}
.links a:hover { border-color: var(--accent); }

/* Gallery bar */
.bar {
  border-bottom: 1px solid var(--line);
  padding: 1.1rem 1.25rem;
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}
.bar h1 { font-size: 1.15rem; margin: 0; font-weight: 600; }
.back { text-decoration: none; font-size: 0.95rem; }

main { max-width: 1200px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }
.status { color: var(--muted); }

/* Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.cell {
  margin: 0;
  cursor: pointer;
  border-radius: 10px;
  overflow: hidden;
  background: var(--line);
}
.cell img {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
  transition: transform 0.25s ease;
}
.cell:hover img { transform: scale(1.04); }
.cell figcaption {
  padding: 0.5rem 0.7rem;
  font-size: 0.85rem;
  color: var(--muted);
  background: var(--bg);
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.lightbox[hidden] { display: none; }
.lightbox img {
  max-width: 92vw;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 4px;
}
.lb-caption {
  position: absolute;
  bottom: 1.2rem;
  left: 0;
  right: 0;
  text-align: center;
  color: #eee;
  font-size: 0.95rem;
  margin: 0;
  padding: 0 1rem;
}
.lb-close, .lb-prev, .lb-next {
  position: absolute;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 0;
  cursor: pointer;
  font-size: 1.8rem;
  line-height: 1;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lb-close:hover, .lb-prev:hover, .lb-next:hover { background: rgba(255, 255, 255, 0.25); }
.lb-close { top: 1rem; right: 1rem; }
.lb-prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: 1rem; top: 50%; transform: translateY(-50%); }

footer {
  border-top: 1px solid var(--line);
  padding: 1.5rem 1.25rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}
