:root {
  --bg: #000;
  --fg: #f2f2f2;
  --muted: #8a8a8a;
  --gap: 8px;
  --thumb: 240px; /* target min column width on desktop */
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Age gate ---------- */
.agegate {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
}
.agegate[hidden] { display: none; }
.agegate-box { max-width: 440px; }
.agegate-title {
  margin: 0 0 14px;
  font-size: clamp(1.5rem, 6vw, 2.2rem);
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.agegate-text {
  margin: 0 0 30px;
  color: var(--muted);
  font-size: .95rem;
  letter-spacing: .03em;
}
.agegate-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.age-btn {
  cursor: pointer;
  border: 1px solid #333;
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 1rem;
  letter-spacing: .06em;
  padding: 15px 20px;
  border-radius: 2px;
  transition: background .2s ease, border-color .2s ease;
  -webkit-tap-highlight-color: transparent;
}
.age-yes { background: #fff; color: #000; border-color: #fff; }
.age-yes:hover { background: #ddd; }
.age-no:hover { border-color: #666; }

/* Keep photos out of view until a choice is made. */
body.gated main { display: none; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  text-align: center;
  padding: 26px 16px 18px;
  background: rgba(0, 0, 0, 0.82);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: padding .25s ease;
}
.site-header.shrink { padding: 11px 16px; }
.site-title {
  margin: 0;
  font-size: clamp(1.2rem, 4vw, 1.9rem);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: font-size .25s ease, letter-spacing .25s ease;
}
.site-header.shrink .site-title {
  font-size: clamp(0.9rem, 3vw, 1.2rem);
  letter-spacing: 0.1em;
}

/* ---------- Grid (justified rows) ---------- */
.grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap);
  padding: 0 var(--gap) var(--gap);
  max-width: 1800px;
  margin: 0 auto;
}
@media (max-width: 640px) { :root { --gap: 4px; } }

.cell {
  position: relative;
  overflow: hidden;
  background: #111;
  cursor: pointer;
  border: none;
  padding: 0;
  margin: 0;
  flex: 0 0 auto; /* exact width/height set inline by the layout engine */
}
.cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s ease;
}
@media (hover: hover) {
  .cell:hover img { transform: scale(1.06); }
}
.cell:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }

/* ---------- Status / sentinel ---------- */
.sentinel { height: 1px; }
.status {
  text-align: center;
  color: var(--muted);
  padding: 24px 16px 48px;
  font-size: .85rem;
  letter-spacing: .05em;
}
.spinner-dot {
  display: inline-block;
  width: 8px; height: 8px;
  margin: 0 3px;
  border-radius: 50%;
  background: var(--muted);
  animation: pulse 1.2s infinite ease-in-out;
}
.spinner-dot:nth-child(2) { animation-delay: .2s; }
.spinner-dot:nth-child(3) { animation-delay: .4s; }
@keyframes pulse { 0%, 80%, 100% { opacity: .2; } 40% { opacity: 1; } }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .96);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease;
  z-index: 100;
  touch-action: pan-y;
}
.lightbox.open { opacity: 1; visibility: visible; }

.lb-figure {
  margin: 0;
  max-width: 100vw;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.lb-img {
  max-width: 96vw;
  max-height: 88vh;
  max-height: 88dvh;
  object-fit: contain;
  opacity: 0;
  transition: opacity .3s ease;
  user-select: none;
  -webkit-user-drag: none;
}
.lb-img.loaded { opacity: 1; }
.lb-caption {
  color: var(--fg);
  font-size: .85rem;
  letter-spacing: .04em;
  padding: 12px 16px;
  text-align: center;
  max-width: 90vw;
  min-height: 1.2em;
}

.lb-btn {
  position: absolute;
  background: rgba(0, 0, 0, .35);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s ease, opacity .2s ease;
  z-index: 2;
  -webkit-tap-highlight-color: transparent;
}
.lb-btn:hover { background: rgba(255, 255, 255, .15); }
.lb-close {
  top: 0;
  right: 0;
  width: 56px; height: 56px;
  font-size: 2rem;
  line-height: 1;
}
.lb-prev, .lb-next {
  top: 50%;
  transform: translateY(-50%);
  width: 56px; height: 84px;
  font-size: 2.6rem;
  line-height: 1;
}
.lb-prev { left: 0; }
.lb-next { right: 0; }
/* Hide arrows on touch — swipe instead */
@media (hover: none) and (pointer: coarse) {
  .lb-prev, .lb-next { display: none; }
  .lb-close { background: transparent; }
}

.lb-spinner {
  position: absolute;
  width: 40px; height: 40px;
  border: 3px solid rgba(255, 255, 255, .2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .8s linear infinite;
  opacity: 0;
  transition: opacity .2s ease;
  pointer-events: none;
}
.lb-spinner.show { opacity: 1; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
