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

body {
  background: #0c0a07;
  overflow: hidden;
  font-family: 'Space Grotesk', sans-serif;
  width: 100vw; height: 100vh;
  user-select: none;
}

:root {
  --cyan: #C8A84B; --cyan-l: #DEC078;
  --purple: #6A7EB5;
  --nav-h: 62px;
}

/* ── NAV ─────────────────────────────────────────────────────────────────── */
.ph-nav {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-h); z-index: 1000;
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; padding: 0 44px;
  background: rgba(12,10,7,0.82); backdrop-filter: blur(28px);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.ph-nav-back {
  justify-self: start; display: flex; align-items: center; gap: 9px;
  font-family: 'JetBrains Mono', monospace; font-size: 0.7rem;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: rgba(221,214,200,0.35); text-decoration: none;
  transition: color 0.3s, gap 0.35s ease;
}
.ph-nav-back:hover { color: rgba(221,214,200,0.8); gap: 14px; }
.ph-back-arrow { font-size: 1rem; }
.ph-nav-title {
  justify-self: center;
  font-family: 'Cormorant Garamond', serif; font-style: italic; font-weight: 300;
  font-size: 1.15rem; letter-spacing: 0.1em; color: rgba(255,255,255,0.6);
}
.ph-nav-hint {
  justify-self: end;
  font-family: 'JetBrains Mono', monospace; font-size: 0.63rem;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(255,255,255,0.18);
}

/* ── SCENE ───────────────────────────────────────────────────────────────── */
.hex-scene {
  position: fixed;
  top: var(--nav-h); left: 0; right: 0; bottom: 0;
  overflow: hidden;
  background: #0c0a07;
  cursor: crosshair;
}

/* deep center glow — like a light table underneath the contact sheet */
.hex-scene::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 48%, rgba(28,22,14,0.9) 0%, transparent 65%);
  pointer-events: none; z-index: 0;
}

.hex-grid {
  position: absolute;
  top: 50%; left: 50%;
  z-index: 1;
}

/* circular edge vignette — like an Apple Watch bezel / a lens border */
.scene-vignette {
  position: absolute; inset: 0; pointer-events: none; z-index: 5;
  background: radial-gradient(
    ellipse at 50% 50%,
    transparent 28%,
    rgba(12,10,7,0.25) 52%,
    rgba(12,10,7,0.65) 72%,
    rgba(12,10,7,0.92) 88%,
    #0c0a07 100%
  );
}

/* floating hint at bottom */
.drag-hint {
  position: absolute; bottom: 30px; left: 50%;
  transform: translateX(-50%); z-index: 6;
  font-family: 'JetBrains Mono', monospace; font-size: 0.62rem;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: rgba(255,255,255,0.22); pointer-events: none;
  animation: hintPulse 3s ease-in-out infinite;
  transition: opacity 0.8s ease;
}
.drag-hint.hidden { opacity: 0; }
@keyframes hintPulse { 0%,100%{opacity:0.22} 50%{opacity:0.45} }

/* ── BUBBLES ─────────────────────────────────────────────────────────────── */
.bubble {
  position: absolute;
  width: 0; height: 0;
  will-change: transform;
  cursor: pointer;
}

/* the photo circle itself */
.bubble-inner {
  position: absolute;
  width: 240px; height: 240px;
  top: -120px; left: -120px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.06);
  background: #111;
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
  z-index: 1;
}

/* hover: clean white ring + soft glow — nothing flashy */
.bubble:hover .bubble-inner {
  border-color: rgba(255,255,255,0.45);
  box-shadow:
    0 0 0 1.5px rgba(255,255,255,0.18),
    0 0 32px rgba(255,255,255,0.1),
    0 0 70px rgba(255,255,255,0.04);
}

/* center bubble: slightly brighter border */
.bubble.is-center .bubble-inner {
  border-color: rgba(255,255,255,0.28);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.12),
    0 0 24px rgba(255,255,255,0.06);
}

.bubble-inner img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  pointer-events: none;
  image-orientation: from-image;
  opacity: 0;
  transition: opacity 0.7s ease, transform 0.6s cubic-bezier(0.25,0.46,0.45,0.94);
}
.bubble-inner img.loaded { opacity: 1; }
.bubble:hover .bubble-inner img { transform: scale(1.06); }

/* CINEMATIC inner vignette on every photo — makes them feel shot on film */
.bubble-inner::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at center, transparent 42%, rgba(0,0,0,0.58) 100%);
  pointer-events: none; z-index: 2;
  transition: opacity 0.45s ease;
}
.bubble.is-center .bubble-inner::after,
.bubble:hover .bubble-inner::after { opacity: 0.25; }

/* shimmer while loading */
.bubble-inner.loading { background: #141210; }
.bubble-inner.loading::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(
    90deg, transparent 30%,
    rgba(255,255,255,0.03) 50%,
    transparent 70%
  );
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
  border-radius: 50%;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* label — appears only for center/hovered bubble */
.bubble-label {
  position: absolute;
  top: 130px; left: 0;
  transform: translateX(-50%);
  font-family: 'JetBrains Mono', monospace; font-size: 0.58rem;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: rgba(255,255,255,0.38); white-space: nowrap;
  opacity: 0; transition: opacity 0.35s ease;
  pointer-events: none; z-index: 3;
}
.bubble.is-center .bubble-label,
.bubble:hover .bubble-label { opacity: 1; }

/* ── LIGHTBOX ────────────────────────────────────────────────────────────── */
.lightbox {
  position: fixed; inset: 0; z-index: 10000;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.4s ease;
  cursor: default;
}
.lightbox.open { opacity: 1; pointer-events: all; }

.lb-backdrop {
  position: absolute; inset: 0;
  background: rgba(8,6,4,0.96); backdrop-filter: blur(24px);
}

.lb-close {
  position: absolute; top: 20px; right: 26px; z-index: 2;
  background: none; border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.4); font-size: 0.95rem; cursor: pointer;
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.3s;
}
.lb-close:hover { border-color: rgba(255,255,255,0.4); color: #fff; }

.lb-prev, .lb-next {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  background: none; border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.5); font-size: 2.2rem; cursor: pointer;
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.3s; line-height: 1; padding-bottom: 2px;
}
.lb-prev { left: 18px; }
.lb-next { right: 18px; }
.lb-prev:hover, .lb-next:hover {
  border-color: rgba(255,255,255,0.35); color: #fff;
  background: rgba(255,255,255,0.04);
}

.lb-stage {
  position: relative; z-index: 1;
  max-width: 88vw; max-height: 80vh;
  display: flex; align-items: center; justify-content: center;
}
.lb-img {
  max-width: 100%; max-height: 80vh;
  object-fit: contain; border-radius: 4px; display: block;
  box-shadow: 0 50px 120px rgba(0,0,0,0.9);
  transition: opacity 0.2s ease;
}

.lb-footer {
  position: absolute; bottom: 26px; left: 0; right: 0; z-index: 2;
  display: flex; align-items: center; justify-content: center; gap: 20px;
}
.lb-title {
  font-family: 'JetBrains Mono', monospace; font-size: 0.68rem;
  letter-spacing: 0.2em; text-transform: uppercase; color: rgba(255,255,255,0.3);
}
.lb-counter {
  font-family: 'JetBrains Mono', monospace; font-size: 0.64rem;
  letter-spacing: 0.1em; color: rgba(255,255,255,0.15);
}

/* ── MOBILE ──────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .ph-nav { padding: 0 20px; }
  .ph-nav-hint { display: none; }
  .lb-prev { left: 8px; }
  .lb-next { right: 8px; }
  .lb-stage { max-width: 96vw; }
  .bubble-inner { width: 190px; height: 190px; top: -95px; left: -95px; }
  .bubble-label { top: 104px; }
}
@media (max-width: 480px) {
  .ph-nav-back span:last-child { display: none; }
  .bubble-inner { width: 155px; height: 155px; top: -77px; left: -77px; }
  .bubble-label { top: 86px; }
}

/* ── IDLE EFFECTS ────────────────────────────────────────────────────────────── */

/* Center glow breathes slowly when idle */
body.is-idle .hex-scene::before {
  animation: idleGlow 5s ease-in-out infinite;
}
@keyframes idleGlow {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

/* Center bubble glows warm gold when idle */
body.is-idle .bubble.is-center .bubble-inner {
  border-color: rgba(200, 168, 75, 0.55);
  box-shadow:
    0 0 0 1.5px rgba(200, 168, 75, 0.22),
    0 0 28px rgba(200, 168, 75, 0.14),
    0 0 72px rgba(200, 168, 75, 0.07);
  transition: border-color 1.2s ease, box-shadow 1.2s ease;
}

/* Hint text turns gold and pulses faster during auto-explore */
body.is-idle .drag-hint {
  color: rgba(200, 168, 75, 0.6);
  animation: idleHintPulse 2s ease-in-out infinite;
}
@keyframes idleHintPulse {
  0%, 100% { opacity: 0.5; }
  50%       { opacity: 1; }
}
