.gallery-page { background: var(--bg); overflow-x: hidden; }
.gallery-main { position: relative; max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; padding: 120px var(--gutter) 10vh; }
.gallery-head { max-width: 760px; margin-bottom: 30px; }
.gallery-head h1 { font-size: clamp(40px, 6vw, 80px); line-height: 1; letter-spacing: -0.015em; margin-top: 4px; }
.gallery-head h1 em { color: var(--ink-3); }
.gallery-sub { margin-top: 18px; color: var(--ink-2); font-size: 17px; max-width: 34em; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 28px; }
.filters button { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-3); font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase; transition: background 0.3s, color 0.3s, border-color 0.3s; }
.filters button:hover { color: var(--ink); border-color: rgba(255, 255, 255, 0.3); }
.filters button[aria-pressed="true"] { background: var(--ink); color: #0a0a0a; border-color: var(--ink); }

/* ---------- rolodex ---------- */
.rolo-wrap { position: relative; margin: 10px calc(-1 * var(--gutter)) 0; overflow: hidden; overflow-x: clip; overflow-y: visible; padding: 40px 0; }
.rolo { position: relative; height: min(62vh, 600px); perspective: 1400px; perspective-origin: 50% 45%; transform-style: preserve-3d; overflow: visible; cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.rolo:active { cursor: grabbing; }
.card { position: absolute; left: 50%; top: 50%; width: min(42vh, 400px); aspect-ratio: 4 / 5; margin: calc(-1 * min(42vh, 400px) * 5 / 8) 0 0 calc(-1 * min(42vh, 400px) / 2); padding: 0; border-radius: 18px; overflow: hidden; background: #111;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.7), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  transform-style: preserve-3d; backface-visibility: hidden; will-change: transform, opacity, filter;
  transition: transform 0.75s var(--spring), opacity 0.5s var(--ease), filter 0.5s var(--ease); }
.rolo.instant .card { transition: none; }
.card img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.card.active { cursor: zoom-in; box-shadow: 0 60px 120px rgba(0, 0, 0, 0.8), inset 0 0 0 1px rgba(255, 255, 255, 0.18); }
.card.active::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(120deg, transparent 40%, rgba(255,255,255,0.08) 50%, transparent 60%); pointer-events: none; }
.rolo-nav { position: absolute; z-index: 200; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; transition: background 0.3s, transform 0.4s var(--spring); }
.rolo-nav:hover { background: rgba(255,255,255,0.14); transform: translateY(-50%) scale(1.08); }
.rolo-nav.prev { left: var(--gutter); } .rolo-nav.next { right: var(--gutter); }
.rolo-nav svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.rolo-foot { text-align: center; margin-top: 28px; }
.rolo-cap { font-family: var(--serif); font-size: clamp(22px, 2.6vw, 34px); line-height: 1.15; min-height: 1.2em; max-width: 24em; margin: 0 auto; }
.rolo-cap.swap { animation: swap 0.5s var(--ease); }
.rolo-where { margin-top: 8px; color: var(--ink-3); font-size: 11px; text-transform: uppercase; }
.rolo-scrub { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; max-width: 640px; margin: 26px auto 0; }
.rolo-scrub .mono { font-size: 11px; color: var(--ink-3); letter-spacing: 0.12em; font-variant-numeric: tabular-nums; }
#scrub { -webkit-appearance: none; appearance: none; width: 100%; height: 2px; background: var(--line); border-radius: 2px; outline: none; }
#scrub::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--ink); border: 3px solid var(--bg); box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
#scrub::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--ink); border: 3px solid var(--bg); cursor: pointer; }
.gallery-foot { margin-top: 50px; }

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 400; display: grid; place-items: center; background: rgba(3, 3, 4, 0.92); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); opacity: 0; transition: opacity 0.4s var(--ease); }
.lightbox[hidden] { display: none; }
.lightbox.open { opacity: 1; }
.lb-fig { max-width: min(1200px, 100%); max-height: 100%; padding: 70px 20px 30px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.lb-fig img { max-width: 100%; max-height: calc(100svh - 200px); width: auto; height: auto; border-radius: 12px; box-shadow: 0 40px 100px rgba(0, 0, 0, 0.7); transition: opacity 0.3s; }
.lb-fig img.swap { opacity: 0; }
.lb-fig figcaption { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; max-width: 42em; }
.lb-fig figcaption p { font-family: var(--serif); font-size: 22px; line-height: 1.2; }
.lb-fig .mono { color: var(--ink-3); font-size: 11px; text-transform: uppercase; }
.lb-close, .lb-nav { position: absolute; z-index: 2; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; transition: background 0.3s, transform 0.4s var(--ease); }
.lb-close { top: 18px; right: 18px; }
.lb-close:hover { transform: rotate(90deg); background: rgba(255, 255, 255, 0.12); }
.lb-nav { top: 50%; transform: translateY(-50%); }
.lb-nav:hover { background: rgba(255, 255, 255, 0.12); }
.lb-prev { left: 18px; } .lb-next { right: 18px; }
.lb-close svg, .lb-nav svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

@media (max-width: 900px) {
  .gallery-main { padding-top: 100px; padding-bottom: calc(10vh + 70px); }
  .rolo-wrap { padding: 24px 0; }
  .rolo { height: calc(min(64vw, 300px) * 5 / 4 + 70px); }
  .card { width: min(64vw, 300px); margin: calc(-1 * min(64vw, 300px) * 5 / 8) 0 0 calc(-1 * min(64vw, 300px) / 2); border-radius: 14px; }
  .rolo-nav { display: none; }
  .rolo-hint { display: none; }
  .rolo-scrub { grid-template-columns: auto 1fr; }
  .lb-nav { top: auto; bottom: 18px; transform: none; }
  .lb-fig { padding: 60px 12px 80px; }
  .lb-fig img { max-height: calc(100svh - 230px); }
}

body.locked .rolo-nav { opacity: 0; pointer-events: none; }
