/* VIEW TRANSITIONS */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-fold-out .55s cubic-bezier(.6,.02,.25,1) both; }
::view-transition-new(root) { animation: vt-fold-in .65s cubic-bezier(.2,.8,.3,1) .1s both; }
@keyframes vt-fold-out { from { clip-path: inset(0 0 0 0); opacity: 1; } to { clip-path: inset(0 100% 0 0); opacity: .4; } }
@keyframes vt-fold-in  { from { clip-path: inset(0 0 0 100%); opacity: .4; } to { clip-path: inset(0 0 0 0); opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none !important; }
}

:root {
  --bk: #0e0e0e;
  --wh: #f5f5f3;
  --mid: #5a5a58;
  --soft: #f7f6f1;
  --font-mono: 'IBM Plex Mono', 'SF Mono', Menlo, Consolas, monospace;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bk);
  color: var(--wh);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  cursor: none;
}
@media (pointer: coarse) { body { cursor: auto; } }

/* ── CUSTOM CURSOR ── */
#cursor {
  position: fixed; top: 0; left: 0;
  width: 6px; height: 6px;
  background: #fff;
  border-radius: 50%;
  pointer-events: none;
  translate: var(--cx, -50px) var(--cy, -50px);
  transform: translate(-50%, -50%);
  z-index: 9999;
  mix-blend-mode: difference;
  will-change: translate;
}
@media (pointer: coarse) { #cursor { display: none; } }

/* ── NAV ── */
#nav {
  position: fixed; top: 0; left: 0; right: 0;
  padding: 24px clamp(24px, 4vw, 72px);
  display: flex; align-items: center; justify-content: space-between;
  z-index: 100;
  transition: background .4s ease, padding .4s ease, backdrop-filter .4s ease;
}
#nav.scrolled {
  background: rgba(14,14,14,.82);
  backdrop-filter: blur(14px);
  padding: 16px clamp(24px, 4vw, 72px);
}
.nav-logo {
  font-size: 12px; font-weight: 500;
  letter-spacing: .24em; text-transform: uppercase;
  color: var(--wh); text-decoration: none;
}
.nav-links {
  display: flex; gap: clamp(18px, 2.6vw, 42px);
  font-size: 11px; letter-spacing: .22em; text-transform: uppercase;
}
.nav-links a {
  color: rgba(245,245,243,.7);
  text-decoration: none;
  transition: color .3s ease;
}
.nav-links a:hover, .nav-links a.active { color: var(--wh); }
.nav-right { display: flex; align-items: center; gap: 20px; }
.lang-switch {
  display: flex; gap: 6px;
  font-size: 11px; letter-spacing: .2em;
}
.lang-switch button {
  background: none; border: none; color: rgba(245,245,243,.5);
  cursor: none; font: inherit; font-family: inherit; padding: 4px 2px;
  transition: color .3s ease;
}
.lang-switch button.active { color: var(--wh); }
.lang-sep { color: rgba(245,245,243,.3); }

/* ── HERO ── */
.gallery-hero {
  padding: clamp(140px, 22vh, 220px) clamp(24px, 4vw, 72px) clamp(50px, 7vh, 90px);
  border-bottom: 1px solid rgba(245,245,243,.08);
}
.hero-label {
  font-size: 10px; letter-spacing: .35em; text-transform: uppercase;
  color: rgba(245,245,243,.4);
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 30px;
}
.hero-label::before {
  content: ''; width: 40px; height: 1px; background: rgba(245,245,243,.4);
}
.hero-title {
  font-weight: 200;
  font-size: clamp(64px, 12vw, 200px);
  line-height: .9;
  letter-spacing: -.045em;
  color: var(--wh);
}
.hero-title strong { font-weight: 600; }
.hero-sub {
  margin-top: 32px;
  max-width: 620px;
  font-size: clamp(13px, 1vw, 15px);
  line-height: 1.8;
  color: rgba(245,245,243,.55);
}
.hero-back {
  display: inline-flex; align-items: center; gap: 10px;
  margin-top: 34px;
  padding-bottom: 6px;
  font-size: 11px; letter-spacing: .22em; text-transform: uppercase;
  color: rgba(245,245,243,.6);
  text-decoration: none;
  border-bottom: 1px solid rgba(245,245,243,.2);
  transition: color .3s ease, border-color .3s ease, gap .3s ease;
}
.hero-back:hover { color: var(--wh); border-color: var(--wh); gap: 18px; }
.hero-back .arrow-l {
  display: inline-block; width: 22px; height: 1px; background: currentColor; position: relative;
}
.hero-back .arrow-l::after {
  content: ''; position: absolute; left: 0; top: -3px;
  width: 7px; height: 7px;
  border-top: 1px solid currentColor; border-left: 1px solid currentColor;
  transform: rotate(-45deg);
}

/* ── FILTERS ── */
.filters {
  position: sticky; top: 0;
  z-index: 50;
  display: flex; flex-wrap: wrap; gap: 10px;
  padding: 22px clamp(24px, 4vw, 72px);
  background: rgba(14,14,14,.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(245,245,243,.06);
}
.filter-btn {
  background: transparent;
  border: 1px solid rgba(245,245,243,.18);
  color: rgba(245,245,243,.68);
  padding: 10px 22px;
  font: inherit;
  font-size: 10px;
  letter-spacing: .25em;
  text-transform: uppercase;
  cursor: none;
  border-radius: 999px;
  transition: all .35s cubic-bezier(.25,.46,.45,.94);
  display: inline-flex; align-items: center; gap: 8px;
}
.filter-btn:hover { color: var(--wh); border-color: rgba(245,245,243,.4); }
.filter-btn.active {
  background: var(--wh);
  color: var(--bk);
  border-color: var(--wh);
}
.filter-count {
  font-size: 9px;
  opacity: .6;
  font-variant-numeric: tabular-nums;
}

/* ── GRID (masonry via CSS columns) ── */
.gallery-grid {
  padding: clamp(30px, 5vh, 60px) clamp(24px, 4vw, 72px) clamp(60px, 10vh, 120px);
  column-count: 4;
  column-gap: clamp(8px, 1vw, 16px);
}
@media (max-width: 1100px) { .gallery-grid { column-count: 3; } }
@media (max-width: 760px)  { .gallery-grid { column-count: 2; } }
@media (max-width: 480px)  { .gallery-grid { column-count: 1; } }

.gallery-item {
  position: relative;
  margin: 0 0 clamp(8px, 1vw, 16px);
  break-inside: avoid;
  overflow: hidden;
  background: #141414;
  border-radius: 2px;
  cursor: none;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .9s cubic-bezier(.25,.46,.45,.94), transform .9s cubic-bezier(.25,.46,.45,.94);
}
.gallery-item.revealed { opacity: 1; transform: translateY(0); }
.gallery-item img {
  width: 100%; height: auto; display: block;
  transition: transform 1.1s cubic-bezier(.25,.46,.45,.94), filter .6s ease;
}
.gallery-item:hover img { transform: scale(1.04); }
.gallery-item::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(14,14,14,0) 55%, rgba(14,14,14,.65) 100%);
  opacity: 0;
  transition: opacity .5s ease;
  pointer-events: none;
}
.gallery-item:hover::after { opacity: 1; }
.gallery-item-tag {
  position: absolute;
  left: 14px; bottom: 14px;
  font-size: 9px; letter-spacing: .3em; text-transform: uppercase;
  color: var(--wh);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .5s ease, transform .5s ease;
  z-index: 2;
}
.gallery-item:hover .gallery-item-tag { opacity: 1; transform: translateY(0); }
.gallery-item.hidden { display: none; }

.empty-state {
  padding: 80px 40px;
  text-align: center;
  color: rgba(245,245,243,.4);
  font-size: 12px; letter-spacing: .22em; text-transform: uppercase;
}
.empty-state em {
  display: block;
  font-style: normal;
  font-weight: 200;
  font-size: 34px;
  letter-spacing: -.02em;
  text-transform: none;
  color: rgba(245,245,243,.75);
  margin-bottom: 14px;
}

/* ── LIGHTBOX ── */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(8,8,8,.97);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  z-index: 1000;
  transition: opacity .45s ease;
}
.lightbox.active { opacity: 1; pointer-events: auto; }
.lightbox-img {
  max-width: 90vw; max-height: 86vh;
  object-fit: contain;
  user-select: none;
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
}
.lightbox-close, .lightbox-prev, .lightbox-next {
  position: absolute;
  background: none; border: 1px solid rgba(245,245,243,.3);
  color: var(--wh);
  width: 50px; height: 50px;
  cursor: none;
  font-size: 22px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  transition: all .3s ease;
}
.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover {
  background: var(--wh); color: var(--bk);
}
.lightbox-close { top: 28px; right: 28px; }
.lightbox-prev  { left: 28px; top: 50%; transform: translateY(-50%); }
.lightbox-next  { right: 28px; top: 50%; transform: translateY(-50%); }
.lightbox-counter {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  font-size: 11px; letter-spacing: .28em;
  color: rgba(245,245,243,.6);
}
.lightbox-cat {
  position: absolute; top: 28px; left: 28px;
  font-size: 10px; letter-spacing: .3em; text-transform: uppercase;
  color: rgba(245,245,243,.65);
}

/* ── FOOTER ── */
footer {
  padding: 36px clamp(24px, 4vw, 72px);
  display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid rgba(245,245,243,.08);
  font-size: 10px; letter-spacing: .24em; text-transform: uppercase;
  color: rgba(245,245,243,.4);
}
footer a { color: rgba(245,245,243,.7); text-decoration: none; }
footer a:hover { color: var(--wh); }

/* Nav toggle (hamburger) */
.nav-toggle { display: none; background: none; border: none; cursor: none; padding: 8px; margin-left: 4px; }
.nav-toggle span { display: block; width: 22px; height: 1.5px; background: var(--wh); margin: 5px 0; transition: transform .4s ease, opacity .4s ease; }
.nav-toggle.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Responsive */
@media (max-width: 900px) {
  .nav-links {
    display: none;
    position: fixed; top: 62px; left: 0; right: 0; bottom: 0;
    flex-direction: column; gap: 22px;
    padding: 40px clamp(24px, 6vw, 56px);
    background: rgba(14,14,14,.96);
    backdrop-filter: blur(18px);
    z-index: 99;
    font-size: 13px;
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
  #nav { padding: 18px clamp(20px, 4vw, 40px); }
  #nav.scrolled { padding: 14px clamp(20px, 4vw, 40px); }
  .gallery-hero { padding: clamp(110px, 18vh, 160px) clamp(20px, 5vw, 48px) clamp(40px, 6vh, 70px); }
  .hero-title { font-size: clamp(56px, 16vw, 120px); }
  .filters { gap: 8px; padding: 16px clamp(20px, 4vw, 48px); overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .filters::-webkit-scrollbar { display: none; }
  .filter-btn { padding: 9px 16px; font-size: 9px; white-space: nowrap; flex-shrink: 0; }
  .gallery-grid { padding: clamp(24px, 4vh, 48px) clamp(16px, 4vw, 40px) clamp(60px, 10vh, 120px); }
  .lightbox-prev, .lightbox-next { width: 44px; height: 44px; }
  .lightbox-close { top: 20px; right: 20px; width: 44px; height: 44px; }
  footer { flex-direction: column; gap: 10px; text-align: center; padding: 28px 20px; }
}
@media (max-width: 520px) {
  .hero-title { font-size: clamp(52px, 18vw, 88px); }
  .hero-sub { font-size: 12px; line-height: 1.75; }
}
@media (pointer: coarse) {
  body, a, button, .gallery-item, .filter-btn, .nav-links a, .nav-toggle { cursor: auto !important; }
}