/* ══════════════════════════════════════
   Photos — viewport-filling mosaic
   ══════════════════════════════════════ */

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

:root {
  --bg:       #0a0a0a;
  --text:     rgba(255, 255, 255, 0.35);
  --text-hi:  rgba(255, 255, 255, 0.80);
  --mono:     'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --header-h: 44px;
  --strip-h:  30px;
  --gap:      2px;
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  height: 100%;
  overflow: hidden; /* no scroll, ever */
  -webkit-font-smoothing: antialiased;
}


/* ══════════════════════════════════════
   HEADER
   ══════════════════════════════════════ */

.ph-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 100;
  pointer-events: none;
}

.ph-back, .ph-title { pointer-events: all; }

.ph-back {
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s;
}

.ph-back:hover { color: var(--text-hi); }

.ph-title {
  font-size: 0.65rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text);
}


/* ══════════════════════════════════════
   MOSAIC GRID
   Columns + rows set by JS to fill exactly 100vh.
   ══════════════════════════════════════ */

.ph-gallery {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  bottom: var(--strip-h);
  display: grid;
  gap: var(--gap);
  background: var(--bg); /* gap colour */
  /* grid-template-columns / rows set by JS */
}

.ph-item {
  overflow: hidden;
  cursor: pointer;
  background: #111;
  position: relative;
}

.ph-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0.88;
  transition: opacity 0.35s ease, filter 0.35s ease, transform 0.4s ease;
}

.ph-item:hover img {
  opacity: 1;
  transform: scale(1.03);
}

/* ── Spotlight: dim + desaturate everything except the hovered photo ── */
.ph-gallery:has(.ph-item:hover) .ph-item:not(:hover) img {
  opacity: 0.24;
  filter: grayscale(70%);
  transform: scale(1);
}

/* ── Frame number (contact-sheet aesthetic) ── */
.ph-frame {
  position: absolute;
  bottom: 7px;
  left: 9px;
  font-family: var(--mono);
  font-size: 0.52rem;
  letter-spacing: 0.16em;
  color: #fff;
  mix-blend-mode: difference;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  user-select: none;
}

.ph-item:hover .ph-frame { opacity: 1; }



/* ── Roll strip — film frame indicator at bottom ── */
.ph-strip {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--strip-h);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  z-index: 100;
  padding: 0 20px;
}

.ph-tick {
  width: 5px;
  height: 11px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: none;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: background 0.15s, border-color 0.15s;
}

.ph-tick:hover,
.ph-tick.active {
  background: rgba(255, 255, 255, 0.65);
  border-color: rgba(255, 255, 255, 0.65);
}


/* ── Shuffle transition ── */
.ph-item {
  transition: opacity 0.08s ease;
}


.ph-empty {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  color: var(--text);
  opacity: 0.4;
}


/* ══════════════════════════════════════
   LIGHTBOX
   ══════════════════════════════════════ */

.ph-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.96);
  z-index: 500;
  align-items: center;
  justify-content: center;
}

.ph-lightbox.open { display: flex; }

.ph-lb-img {
  max-width: 92vw;
  max-height: 92vh;
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

.ph-lb-btn {
  position: fixed;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  font-family: var(--mono);
  line-height: 1;
  padding: 14px 18px;
  transition: color 0.15s;
  z-index: 10;
}

.ph-lb-btn:hover { color: var(--text-hi); }

.ph-lb-close { top: 12px; right: 14px; font-size: 0.72rem; letter-spacing: 0.06em; }
.ph-lb-prev  { left: 12px; top: 50%; transform: translateY(-50%); font-size: 1.3rem; }
.ph-lb-next  { right: 12px; top: 50%; transform: translateY(-50%); font-size: 1.3rem; }

.ph-lb-counter {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.58rem;
  letter-spacing: 0.22em;
  color: var(--text);
  pointer-events: none;
}


/* ══════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════ */

@media (max-width: 520px) {
  .ph-header  { padding: 0 14px; }
  .ph-strip   { gap: 2px; padding: 0 12px; }
  .ph-tick    { width: 4px; height: 9px; }
  .ph-lb-prev { left: 4px; }
  .ph-lb-next { right: 4px; }
}
