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

:root {
  --bg: #111;
  --gap: 6px;
  --header-height: 48px;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: #eee;
  font-family: system-ui, sans-serif;
}

/* ── Header ─────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: var(--bg);
  border-bottom: 1px solid #222;
}

.site-title {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ── Social links ────────────────────────────────────── */
.social-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: #aaa;
  text-decoration: none;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

.social-link:hover {
  color: #fff;
  background: #222;
}

.social-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.social-divider {
  width: 1px;
  height: 16px;
  background: #333;
  margin: 0 4px;
  flex-shrink: 0;
}

.social-text-link {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: #aaa;
  text-decoration: none;
  padding: 4px 6px;
  border-radius: 4px;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}

.social-text-link:hover {
  color: #fff;
  background: #222;
}

/* ── Masonry grid (CSS columns) ──────────────────────── */
.gallery {
  columns: 5 160px;   /* at least 5 cols, each min 160px wide */
  column-gap: var(--gap);
  padding: var(--gap);
}

.gallery-item {
  break-inside: avoid;
  margin-bottom: var(--gap);
  overflow: hidden;
  background: #000;
  background-size: cover;
  background-position: center;
  cursor: zoom-in;
  /* width: 100% lets the browser resolve aspect-ratio to a concrete height
     before the image loads, eliminating layout shift */
  width: 100%;
}

.gallery-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

.gallery-img.loaded:hover {
  opacity: 0.88;
}

/* ── Lightbox ────────────────────────────────────────── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.92);
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}

.lightbox.open {
  display: flex;
}

.lightbox img {
  max-width: 92vw;
  max-height: 92vh;
  object-fit: contain;
  box-shadow: 0 0 60px rgba(0,0,0,0.8);
  cursor: default;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.4s;
  line-height: 1;
  user-select: none;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  opacity: 1;
}

/* Auto-hide controls after inactivity */
.lightbox.controls-hidden .lightbox-close,
.lightbox.controls-hidden .lightbox-prev,
.lightbox.controls-hidden .lightbox-next {
  opacity: 0;
  pointer-events: none;
}

.lightbox-close {
  position: fixed;
  top: 16px;
  right: 20px;
  font-size: 2rem;
}

.lightbox-prev,
.lightbox-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2.5rem;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 8px;
  z-index: 101;
}

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

/* Zoom hint */
.lightbox-hint {
  position: fixed;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 0.8rem;
  padding: 6px 14px;
  border-radius: 20px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s;
  white-space: nowrap;
  z-index: 102;
}

.lightbox-hint.visible {
  opacity: 1;
}

/* ── Availability pill ───────────────────────────────── */
.cta-pill {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 18px;
  background: #fff;
  border-radius: 999px;
  color: #111;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-decoration: none;
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.8), 0 1px 8px rgba(0, 0, 0, 0.6);
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.cta-pill:hover {
  background: #f0f0f0;
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

.cta-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #16a34a;
  flex-shrink: 0;
  position: relative;
}

.cta-dot::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: #4ade80;
  opacity: 0;
  animation: ripple 2.4s ease-out infinite;
}

@keyframes ripple {
  0%   { transform: scale(0.6); opacity: 0.6; }
  100% { transform: scale(2);   opacity: 0;   }
}

@media (max-width: 480px) {
  .cta-pill {
    bottom: max(16px, env(safe-area-inset-bottom, 16px));
    right: 16px;
    left: auto;
    padding: 8px 14px;
    font-size: 0.75rem;
  }
}

/* ── Responsive tweaks ───────────────────────────────── */
@media (max-width: 480px) {
  .gallery {
    columns: 2;
  }
}
