:root {
  --bg: #0a0a0b;
  --surface: #131316;
  --surface-2: #1a1a1f;
  --fg: #f5f2ec;
  --muted: #8a8a90;
  --border: #26262c;
  --accent: #e8c87a;
  --accent-soft: rgba(232, 200, 122, 0.14);
  --radius-md: 6px;
  --radius-pill: 999px;
  --radius-full: 50%;
  --radius-xs: 2px;
  --font-display: Georgia, "Times New Roman", "Songti SC", serif;
  --font-body: "Helvetica Neue", "Segoe UI", system-ui, -apple-system, sans-serif;
  --motion-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --motion-base: 0.5s;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1,
h2,
h3,
.display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.02em;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

button {
  font-family: inherit;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

/* film grain overlay */
.film-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.06;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain-shift 8s steps(10) infinite;
}

@keyframes grain-shift {
  0% { background-position: 0 0; }
  100% { background-position: 100px 100px; }
}

/* reveal */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.9s var(--motion-ease),
    transform 0.9s var(--motion-ease);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* photo card hover */
.photo-card {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.55s var(--motion-ease),
    border-color 0.35s ease;
  will-change: transform;
  padding: 0;
  text-align: left;
  color: inherit;
}

/* placeholder layer: local blur fill behind the real image */
.card-media {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--surface);
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(14px) saturate(0.6) brightness(0.85);
  transform: scale(1.12);
  transition: transform 1.2s var(--motion-ease);
}

/* real image fades in on top of the placeholder */
.card-img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.45s ease, transform 0.85s var(--motion-ease), filter 0.6s ease;
  filter: saturate(0.85) contrast(1.05);
}

.photo-card:hover .card-img {
  transform: scale(1.06);
  filter: saturate(1.1) contrast(1.08);
}

.photo-card:hover,
.photo-card:focus-visible {
  border-color: var(--accent);
  transform: translateY(-6px);
}


.photo-card .card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 18px 18px 16px;
  background: linear-gradient(to top, rgba(5, 5, 7, 0.88) 0%, rgba(5, 5, 7, 0.35) 45%, transparent 75%);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s var(--motion-ease);
  pointer-events: none;
}

.photo-card:hover .card-overlay,
.photo-card:focus-visible .card-overlay {
  opacity: 1;
  transform: translateY(0);
}

/* series tabs */
.series-tab {
  position: relative;
  padding: 12px 22px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: color 0.35s ease, background 0.35s ease, border-color 0.35s ease,
    transform 0.35s var(--motion-ease);
  white-space: nowrap;
}

.series-tab:hover {
  color: var(--fg);
  transform: translateY(-2px);
}

.series-tab.active {
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
}

/* shutter pulse — subtle darkroom dim, no white flash */
.shutter-flash {
  position: fixed;
  inset: 0;
  background: var(--bg);
  pointer-events: none;
  z-index: 300;
  opacity: 0;
}

.shutter-flash.fire {
  animation: shutter-flash 0.55s var(--motion-ease) forwards;
}

@keyframes shutter-flash {
  0% { opacity: 0; }
  30% { opacity: 0.55; }
  100% { opacity: 0; }
}

/* lightbox */
.lightbox-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 4, 6, 0.94);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-figure {
  position: relative;
  width: 100%;
  max-width: min(1600px, 94vw);
  overflow: auto;
}

/* dual-image crossfade layers */
.lb-layer {
  position: relative;
  width: 100%;
  height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* placeholder blur layer — always mounted, faded via opacity only (no reflow) */
.lb-layer img.lb-blur {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(28px) saturate(0.5) brightness(0.65);
  transform: scale(1.18);
  opacity: 1;
  transition: opacity 0.5s var(--motion-ease);
}

.lb-layer img.lb-blur-hidden {
  opacity: 0;
}

.lb-layer img {
  position: absolute;
  inset: 0;
  margin: auto;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-md);
  opacity: 0;
  transition: opacity 0.45s var(--motion-ease), transform 0.45s var(--motion-ease);
  transform: scale(0.98);
}

.lb-layer img.lb-in {
  opacity: 1;
  transform: scale(1);
}

/* loading shimmer placeholder */
.lb-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--fg);
  font-size: 12px;
  letter-spacing: 0.2em;
  border-radius: var(--radius-md);
  z-index: 2;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
}

.lb-spinner {
  width: 42px;
  height: 42px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: var(--radius-full);
  animation: lb-spin 0.9s linear infinite;
}

@keyframes lb-spin {
  to { transform: rotate(360deg); }
}

.lb-layer img.zoomed {
  position: static;
  max-width: 120vw;
  max-height: none;
  transform: none;
  cursor: grab;
}

/* masonry crossfade — no longer needed (dual layer removed), keep base */



/* masonry */
.masonry {
  max-width: 1280px;
  margin-inline: auto;
  columns: 3;
  column-gap: 14px;
}

@media (max-width: 1024px) {
  .masonry { columns: 2; }
}

@media (max-width: 620px) {
  .masonry { columns: 1; }
}

.masonry-item {
  break-inside: avoid;
  margin-bottom: 14px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
  .film-grain {
    animation: none;
  }
}
