/* ── VARIABLES ── */
:root {
  --bg: #f1efe7;
  --text: #252726;
  --selection: #d0cdc3;
  --grid: 1.6667vw;
  --ease: cubic-bezier(.32,.94,.6,1);
  --underline-ease: cubic-bezier(.65,0,.35,1);
}

/* ── RESET ── */
* { margin: 0; padding: 0; box-sizing: border-box; }
::selection { background: var(--selection); }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  overflow: hidden;
  height: 100%;
  width: 100%;
}

/* ── SPLASH ── */
.splash {
  position: fixed; inset: 0;
  z-index: 10000;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s ease;
}
.splash.done { opacity: 0; pointer-events: none; }
.splash-image-wrap {
  position: absolute; inset: 0;
  clip-path: inset(22vh 38vw 22vh 38vw);
  transition: clip-path 2s var(--ease);
  overflow: hidden;
}
.splash-image-wrap.expanded { clip-path: inset(0 0 0 0); }
.splash-image {
  width: 100%; height: 100%;
  object-fit: cover; opacity: 0.12;
}
.splash-title {
  position: relative; z-index: 2;
  font-family: 'DM Serif Display', serif;
  font-size: clamp(2.5rem, 5.5vw, 4.5rem);
  font-weight: 400; letter-spacing: 0.01em;
  overflow: hidden;
}
.splash-title .char {
  display: inline-block;
  transform: translateY(1.5em);
  transition: transform 1.2s var(--ease);
  transition-delay: var(--delay);
}
.splash-title.reveal .char { transform: translateY(0); }
.splash-sub {
  position: absolute; bottom: 2rem;
  font-size: 0.65rem; font-weight: 200;
  letter-spacing: 0.25em;
  text-transform: uppercase; opacity: 0;
  transition: opacity 1s ease 1.5s; z-index: 2;
}
.splash-title.reveal ~ .splash-sub { opacity: 0.35; }

/* ── HEADER ── */
.header {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 9500;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: calc(var(--grid) * 1.5) calc(var(--grid) * 2);
  pointer-events: none;
  opacity: 0;
  transform: translateY(-100%);
  transition: opacity 0.5s ease, transform 0.5s var(--ease);
}
.header.visible {
  opacity: 1; transform: translateY(0); pointer-events: all;
}
.header a {
  color: var(--text); text-decoration: none;
  font-size: 0.75rem; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase;
  position: relative;
}
.header a::after {
  content: ''; position: absolute;
  bottom: -2px; left: 0; right: 0; height: 1px;
  background: var(--text);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.6s var(--underline-ease);
}
.header a:hover::after { transform: scaleX(1); }
.nav-links { display: flex; gap: 2rem; }

/* ── GALLERY ── */
.thumb-gallery {
  position: fixed; inset: 0;
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
}
.thumb-gallery:active { cursor: grabbing; }

.thumb-track {
  display: flex;
  flex-direction: column;
  gap: 10px;
  will-change: transform;
}

.thumb-row {
  display: flex;
  gap: 10px;
  will-change: transform;
}

.thumb-item {
  flex-shrink: 0;
  height: 95px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
}
.thumb-item .thumb-blur {
  display: block;
  height: 100%;
  width: auto;
}
.thumb-item .thumb-real {
  position: absolute;
  top: 0; left: 0;
  display: block;
  height: 100%;
  width: auto;
  opacity: 0;
  transition: transform 0.5s var(--ease), opacity 0.4s ease;
}
.thumb-item .thumb-real.loaded {
  opacity: 1;
}
.thumb-item:hover .thumb-real { transform: scale(1.08); }

/* ── MOBILE ── */
@media (max-width: 680px) {
  .thumb-track {
    flex-direction: row;
    gap: 10px;
    height: auto;
    width: 100%;
  }
  .thumb-row {
    flex-direction: column;
    gap: 10px;
    touch-action: none;
  }
  .thumb-item {
    height: auto;
    width: 80px;
    touch-action: none;
  }
  .thumb-item .thumb-blur {
    width: 100%;
    height: auto;
  }
  .thumb-item .thumb-real {
    width: 100%;
    height: auto;
  }
  /* ── MOBILE VIEWER ── */
  .viewer-overlay.active {
    background: #252726;
    opacity: 1;
  }
  .viewer {
    background: #252726;
    touch-action: none;
    display: block;
  }
  .viewer-main {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    display: block;
  }
  .viewer-image {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: contain;
    pointer-events: none;
    transform: none;
    transition: none;
  }
  .viewer.active .viewer-image {
    transform: none;
  }
  .viewer-nav { display: none; }
  .viewer-info {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    display: flex;
    align-items: center;
    gap: 0.5em;
    z-index: 1;
  }
  .viewer-cat {
    color: #f1efe7;
    opacity: 0.4;
    font-size: 0.7rem;
  }
  .viewer-counter {
    color: #f1efe7;
    opacity: 0.25;
    font-size: 0.6rem;
    margin-top: 0;
  }
  .viewer-cat::after {
    content: '·';
    margin-left: 0.5em;
  }
  .viewer-loading {
    border-color: rgba(241, 239, 231, 0.1);
    border-top-color: rgba(241, 239, 231, 0.4);
  }
}

/* ── CATEGORY INDICATOR ── */
.cat-indicator {
  position: fixed;
  bottom: calc(var(--grid) * 2);
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  text-align: center;
  pointer-events: none;
}
.cat-indicator-name {
  font-family: 'DM Serif Display', serif;
  font-size: 1.1rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  transition: opacity 0.3s;
}
.cat-indicator-count {
  font-size: 0.6rem;
  font-weight: 200;
  letter-spacing: 0.1em;
  opacity: 0.35;
  margin-top: 0.25rem;
}

.photo-counter {
  position: fixed;
  bottom: calc(var(--grid) * 2);
  left: calc(var(--grid) * 2);
  font-size: 0.65rem;
  font-weight: 200;
  letter-spacing: 0.08em;
  opacity: 0.3;
  z-index: 200;
  pointer-events: none;
}

/* ── VIEWER ── */
.viewer-overlay {
  position: fixed; inset: 0;
  z-index: 8000;
  background: rgba(241, 239, 231, 0.92);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s;
  cursor: pointer;
}
.viewer-overlay.active { opacity: 1; pointer-events: all; }

.viewer {
  position: fixed; inset: 0;
  z-index: 8001;
  display: flex;
  align-items: stretch;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s;
}
.viewer.active { opacity: 1; pointer-events: all; }

/* Close button */
.viewer-close {
  position: absolute;
  top: 1.2rem;
  right: 1.5rem;
  z-index: 10;
  background: none;
  border: none;
  color: rgba(37, 39, 38, 0.35);
  font-size: 1.6rem;
  font-weight: 300;
  cursor: pointer;
  padding: 0.5rem;
  line-height: 1;
  transition: color 0.3s;
  pointer-events: none;
}
.viewer.active .viewer-close { pointer-events: all; }
.viewer-close:hover { color: rgba(37, 39, 38, 0.8); }

/* Left: full-size image */
.viewer-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  position: relative;
  min-width: 0;
}
.viewer-image {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  transform: scale(0.95);
  transition: transform 0.5s var(--ease);
  user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  pointer-events: none;
}
.viewer.active .viewer-image { transform: scale(1); }

.viewer-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: none; border: none;
  color: rgba(37, 39, 38, 0.25);
  font-size: 2.5rem; cursor: pointer;
  padding: 1.5rem;
  transition: color 0.3s;
  pointer-events: none;
}
.viewer.active .viewer-nav { pointer-events: all; }
.viewer-nav:hover { color: rgba(37, 39, 38, 0.7); }
.viewer-prev { left: 1rem; }
.viewer-next { right: 1rem; }

.viewer-info {
  position: absolute;
  bottom: 1.5rem; left: 3rem;
  pointer-events: none;
}
.viewer-cat {
  font-family: 'DM Serif Display', serif;
  font-size: 0.85rem;
  font-weight: 400;
  opacity: 0.6;
}
.viewer-counter {
  font-size: 0.6rem;
  font-weight: 200;
  letter-spacing: 0.1em;
  opacity: 0.3;
  margin-top: 0.2rem;
}

.viewer-loading {
  display: none;
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 24px; height: 24px;
  border: 2px solid rgba(37, 39, 38, 0.1);
  border-top-color: rgba(37, 39, 38, 0.4);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Mobile viewer close button — must come after base .viewer-close */
@media (max-width: 680px) {
  .viewer-close {
    color: #fff;
    top: 12px;
    right: 12px;
    font-size: 1.5rem;
    opacity: 0.7;
  }
  .viewer-close:hover { color: #fff; opacity: 1; }
}

/* ── ABOUT ── */
.page-about {
  position: fixed; inset: 0;
  z-index: 7000;
  background: var(--bg);
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s;
}
.page-about.active { opacity: 1; pointer-events: all; }
.about-content {
  max-width: 600px;
  margin: 0 auto;
  padding: 8rem 2rem 4rem;
}
.about-name {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(2rem, 3.5vw, 3rem);
  font-weight: 400; letter-spacing: 0.01em;
  margin-bottom: 0.5rem;
}
.about-location {
  font-size: 0.7rem;
  font-weight: 200;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.4;
  margin-bottom: 2rem;
}
.about-bio {
  font-family: 'DM Serif Display', serif;
  font-size: 1.05rem; line-height: 1.9;
  font-weight: 400; margin-bottom: 2.5rem; opacity: 0.85;
}
.about-section { margin-bottom: 2.5rem; }
.about-section h3 {
  font-size: 0.65rem; font-weight: 600;
  letter-spacing: 0.15em; text-transform: uppercase;
  margin-bottom: 1rem; opacity: 0.4;
}
.about-section a {
  color: var(--text); text-decoration: none;
  font-size: 0.85rem; font-weight: 200; display: block;
  margin-bottom: 0.5rem; transition: opacity 0.3s;
  opacity: 0.7;
}
.about-section a:hover { opacity: 0.5; }
.timeline-item {
  display: flex; gap: 1.5rem;
  margin-bottom: 0.8rem; font-size: 0.85rem; line-height: 1.6;
}
.timeline-year { flex-shrink: 0; font-weight: 400; opacity: 0.4; min-width: 3rem; }
.timeline-text { font-weight: 300; opacity: 0.7; }

/* ── PAGE TRANSITIONS ── */
.page-transition {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 9000;
  clip-path: inset(0 0 100% 0);
  transition: clip-path 0.8s var(--ease);
  pointer-events: none;
}
.page-transition.cover {
  clip-path: inset(0 0 0 0);
}
.page-transition.reveal {
  clip-path: inset(100% 0 0 0);
}

/* ── UTILITIES ── */
.copyright {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(37, 39, 38, 0.06);
  font-size: 0.6rem;
  font-weight: 200;
  opacity: 0.25;
}
