* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Discourage casual copy/drag of photos */
img {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  pointer-events: auto;
}

:root {
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --gap: 10px;
}

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: #e0e0e0 transparent;
}

html, body {
  background: #ffffff;
  color: #111111;
  font-family: "Cormorant Garamond", serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---------- Sleek minimalist scrollbar ---------- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 999px;
  transition: background 0.35s var(--ease);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.28);
}

::-webkit-scrollbar-corner {
  background: transparent;
}

/* ---------- Melting title (canvas) ---------- */
.title {
  position: relative;
  z-index: 3;
  display: block;
  width: 100%;
  margin: 1.5rem 0 1.2rem;
  padding: 0 1rem;
  text-align: center;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  cursor: default;
}

.title-canvas {
  display: block;
  width: 100%;
  max-width: 520px;
  height: 140px;
  margin: 0 auto;
  overflow: visible;
  pointer-events: none;
}

/* ---------- Masonry grid (JS columns) ---------- */
.grid {
  display: flex;
  align-items: flex-start;
  gap: var(--gap);
  padding: 0 var(--gap) 20px;
}

.col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.photo-slot {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #f6f6f6;
  border-radius: 2px;
}

.photo-lqip {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(14px);
  transform: scale(1.08);
  transition: opacity 0.7s var(--ease);
  pointer-events: none;
}

.photo {
  position: relative;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  cursor: default;

  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 0.9s var(--ease),
    transform 0.9s var(--ease);
  will-change: opacity, transform;
}

.photo.loaded {
  opacity: 1;
  transform: translateY(0);
}

.photo-slot:hover .photo.loaded {
  transform: translateY(-4px) scale(1.015);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.12);
}

/* ---------- Empty state ---------- */
.empty {
  text-align: center;
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  padding: 2rem;
  color: #666;
  opacity: 0;
  animation: titleIn 1.2s var(--ease) 0.2s forwards;
}

@keyframes titleIn {
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- End-of-page label ---------- */
.status-label {
  text-align: center;
  font-size: 0.95rem;
  letter-spacing: 0.35em;
  text-indent: 0.35em;
  color: #8a8a8a;
  padding: 3rem 1rem 4.5rem;
  opacity: 0;
  transition: opacity 1.2s var(--ease);
  font-style: italic;
  font-weight: 300;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  cursor: default;
}
.status-label.show { opacity: 1; }

/* ---------- Lock the page when the lightbox is open ----------
   We lock BOTH html and body, because in most browsers html is the
   actual document scroll root — locking body alone leaves html's
   scrollbar visible. No height:100vh here, because collapsing the
   body's height is what was clamping scrollY to 0 and jumping the
   page to the top on open.
   padding-right is set dynamically in JS (measured scrollbar width)
   so the page doesn't shift when the scrollbar disappears.
--------------------------------------------------------------- */
html.lightbox-open,
body.lightbox-open {
  overflow: hidden !important;
}

/* ---------- Lightbox (column layout, no scrolling) ---------- */
.lightbox {
  display: flex;
  position: fixed;
  inset: 0;
  background: #ffffff;
  z-index: 1000;

  flex-direction: column;
  align-items: center;
  justify-content: center;

  cursor: default;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.55s var(--ease),
    visibility 0s linear 0.55s;

  padding: 6vh 4vw;
  gap: 2vh;

  /* no scrolling inside the lightbox */
  overflow: hidden;
  overscroll-behavior: contain;
}

/* Hide the lightbox's own scrollbar (all browsers) */
.lightbox::-webkit-scrollbar {
  display: none;
}
.lightbox {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.lightbox.open {
  opacity: 1;
  visibility: visible;
  transition:
    opacity 0.55s var(--ease),
    visibility 0s linear 0s;
}

/* Blurry placeholder — absolute so it sits exactly over the image */
.lightbox-lqip {
  position: absolute;
  max-width: 80vw;
  max-height: 70vh;
  object-fit: contain;
  filter: blur(18px);
  transform: scale(1.05);
  opacity: 0;
  transition: opacity 0.7s var(--ease);
  pointer-events: none;
  cursor: default;
}

/* Sharp full-res image — takes the height above the caption */
#lightbox-img {
  position: relative;
  max-width: 80vw;
  max-height: 70vh;
  object-fit: contain;
  cursor: default;
  opacity: 0;
  transform: scale(0.96);
  transition:
    opacity 0.7s var(--ease),
    transform 0.7s var(--ease);
  flex: 0 1 auto;
  min-height: 0;
}

#lightbox-img.loaded {
  opacity: 1;
  transform: scale(1);
}

/* EXIF caption — in-flow, below the image, wraps if needed */
.lightbox-caption {
  position: static;
  transform: none;
  max-width: 80vw;
  text-align: center;
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-weight: 300;
  font-size: 0.95rem;
  letter-spacing: 0.15em;
  color: #6a6a6a;
  opacity: 0;
  transition: opacity 0.5s var(--ease);
  pointer-events: none;
  user-select: none;

  white-space: normal;
  overflow-wrap: break-word;
  line-height: 1.5;
  flex: 0 0 auto;
}

.lightbox-caption.show {
  opacity: 1;
}

/* Loading percentage — absolutely positioned near the bottom */
.lightbox-loader {
  position: absolute;
  bottom: 10vh;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-weight: 300;
  font-size: 1rem;
  letter-spacing: 0.35em;
  text-indent: 0.35em;
  color: #9a9a9a;
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  pointer-events: none;
  user-select: none;
  font-variant-numeric: tabular-nums;
}

.lightbox-loader.show {
  opacity: 1;
}

/* On small screens, leave more room for the caption */
@media (max-width: 700px) {
  #lightbox-img { max-height: 60vh; }
  .lightbox-lqip { max-height: 60vh; }
  html.lightbox-open,
  body.lightbox-open { padding-right: 0; }
}

/* ---------- Fluid cursor ---------- */
html, body, * {
  cursor: default;
}

.fluid-blur {
  position: fixed;
  top: 0;
  left: 0;
  width: 200px;
  height: 200px;
  pointer-events: none;
  z-index: 99998;
  border-radius: 50%;

  backdrop-filter: blur(12px) saturate(1.15) brightness(1.04) hue-rotate(-8deg);
  -webkit-backdrop-filter: blur(12px) saturate(1.15) brightness(1.04) hue-rotate(-8deg);

  -webkit-mask-image: radial-gradient(
    circle at 50% 50%,
    rgba(0,0,0,1) 0%,
    rgba(0,0,0,0.55) 30%,
    rgba(0,0,0,0.22) 55%,
    rgba(0,0,0,0.06) 78%,
    rgba(0,0,0,0) 100%
  );
  mask-image: radial-gradient(
    circle at 50% 50%,
    rgba(0,0,0,1) 0%,
    rgba(0,0,0,0.55) 30%,
    rgba(0,0,0,0.22) 55%,
    rgba(0,0,0,0.06) 78%,
    rgba(0,0,0,0) 100%
  );

  box-shadow: none;
  border: none;

  will-change: transform;
  transform: translate3d(-300px, -300px, 0);
}

.fluid-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 99999;
  mix-blend-mode: overlay;
  opacity: 0.9;
}

@media (hover: none) {
  .fluid-blur, .fluid-canvas { display: none; }
  html, body, * { cursor: default; }
}

/* ---------- Copyright ---------- */
.copyright {
  text-align: center;
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-weight: 300;
  font-size: 0.85rem;
  letter-spacing: 0.35em;
  text-indent: 0.35em;
  color: #9a9a9a;
  padding: 1rem 1rem 2.5rem;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  cursor: default;
}