/* ===========================================================
   Falcon Optics — Selected Work
   Editorial gallery, 2-row flow, film grain background
   =========================================================== */

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: #0a0a0a;
  color: #fff;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* ── Noise texture on background (NOT over images) ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.25;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='5' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
}

a { color: inherit; text-decoration: none; }
img { display: block; }

/* ═══════════ Top Bar ═══════════ */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 22px 28px; pointer-events: none;
}
.topbar > * { pointer-events: auto; }

.brand {
  display: block; width: 96px;
  filter: brightness(0) invert(1);
  transition: opacity 0.2s;
}
.brand:hover { opacity: 0.75; }
.brand img { width: 100%; height: auto; }

/* ═══════════ Nav ═══════════ */
.nav {
  display: flex; flex-direction: column; align-items: flex-end;
  gap: 6px; text-align: right;
}
.nav-item {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.04em;
  color: #fff; line-height: 1.2; padding: 2px 0;
  transition: color 0.2s;
}
.nav-item .label { white-space: nowrap; }
.nav-item .nav-icon {
  width: 22px; height: 22px; border-radius: 50%;
  display: block; flex-shrink: 0; object-fit: cover;
}
.nav-item.active { color: #ff2a13; }
.nav-item:hover   { color: #ff2a13; }

/* ═══════════ Burger ═══════════ */
.menu-toggle {
  display: none; background: transparent; border: 0;
  cursor: pointer; padding: 0;
}
.menu-toggle .menu-icon { display: block; width: 26px; height: 26px; transition: opacity 0.25s; }
.menu-toggle.open .menu-icon { opacity: 0.4; }

/* ── Scroll buttons ── */
.scroll-btn {
  position: fixed; top: 50%; transform: translateY(-50%);
  z-index: 80; width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12);
  color: #fff; cursor: pointer; opacity: 0;
  transition: opacity 0.25s, background 0.2s, transform 0.2s;
  pointer-events: auto;
}
.scroll-btn:hover { background: rgba(255,255,255,0.18); transform: translateY(-50%) scale(1.05); }
.scroll-prev { left: 18px; }
.scroll-next { right: 18px; }
body:hover .scroll-btn { opacity: 1; }
.gallery.dragging { cursor: grabbing; }

.menu-close { display: none; }

/* ═══════════ Gallery ═══════════ */
.gallery {
  position: absolute; top: 0; bottom: 0; left: 0; right: 0;
  display: flex; align-items: center;
  overflow-x: auto; overflow-y: hidden;
  scroll-behavior: smooth;
  cursor: grab;
  scrollbar-width: thin; scrollbar-color: #2a2a2a transparent;
  z-index: 1;
}
.gallery:active { cursor: grabbing; }
.gallery::-webkit-scrollbar { height: 4px; }
.gallery::-webkit-scrollbar-track { background: transparent; }
.gallery::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 2px; }

.gallery-swiper {
  display: flex; align-items: center;
  height: 100%; width: max-content;
  gap: 12px; padding: 0 28px;
}

/* ── Slide wrappers ── */
.img-wrap.slide {
  flex: 0 0 auto;
  height: 70vh; max-height: 680px; min-height: 320px;
  overflow: hidden; background: #0c0c0c; border-radius: 1px;
  transition: transform 0.6s ease, opacity 0.4s ease;
  opacity: 0.95;
  cursor: zoom-in;
}
.img-wrap.slide img {
  height: 100%; width: auto; display: block;
  transition: transform 0.6s ease, opacity 0.4s ease;
  pointer-events: none;
}
.img-wrap.slide:hover { opacity: 1; transform: translateY(-4px); }

/* ═══════════ Lightbox ═══════════ */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.96);
  opacity: 0; visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  padding: 40px;
}
.lightbox.open { opacity: 1; visibility: visible; }
.lightbox-img {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  transform: scale(0.96);
  transition: transform 0.3s ease;
}
.lightbox.open .lightbox-img { transform: scale(1); }
.lightbox-close {
  position: fixed; top: 22px; right: 26px;
  background: transparent; border: 0; color: #fff;
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 201; opacity: 0.85;
  transition: opacity 0.2s;
}
.lightbox-close:hover { opacity: 1; }

/* ═══════════ Footer ═══════════ */
.bottombar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px; font-size: 11px; color: #9a9a9a;
  letter-spacing: 0.03em;
  pointer-events: none;
}
.bottombar > * { pointer-events: auto; }
.copyright { font-weight: 500; }

.socials { display: flex; align-items: center; gap: 12px; }
.socials a {
  display: inline-flex; width: 22px; height: 22px;
  border-radius: 50%; opacity: 0.85;
  transition: transform 0.2s, opacity 0.2s;
}
.socials a:hover { transform: scale(1.1); opacity: 1; }
.socials img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

/* ═══════════ Mobile ── single column ═══════════ */
.gallery-mobile-list { display: none; }

@media (max-width: 720px) {
  html, body { overflow: auto; }

  .topbar { padding: 14px 18px; }
  .brand  { width: 70px; }
  .menu-toggle { display: block; }

  .nav {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: 100vw;
    background:
      linear-gradient(rgba(0,0,0,0.72), rgba(0,0,0,0.82)),
      url('img/_K8A5738.jpg') center/cover no-repeat;
    backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
    flex-direction: column; align-items: flex-end; justify-content: center;
    gap: 22px; padding: 100px 28px 28px;
    transform: translateX(100%); transition: transform 0.35s ease;
    z-index: 90;
  }
  .nav.open { transform: translateX(0); }
  .nav-item { font-size: 17px; }
  .nav-item .nav-icon { width: 26px; height: 26px; }

  .menu-close {
    position: absolute; top: 20px; right: 18px;
    background: transparent; border: 0; color: #fff;
    width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
    cursor: pointer; z-index: 95;
  }

  .scroll-btn { display: none !important; }

  .gallery-swiper { display: none; }

  .gallery {
    position: static; overflow: visible; height: auto;
    margin: 70px 14px 40px;
  }

  .gallery-mobile-list {
    display: flex; flex-direction: column;
    gap: 8px; width: 100%;
  }

  .mobile-item {
    overflow: hidden;
    background: #0c0c0c;
    border-radius: 1px;
    cursor: zoom-in;
  }
  .mobile-item img {
    width: 100%; height: auto; display: block;
    transition: transform 0.5s ease, opacity 0.3s;
    opacity: 0.96;
  }
  .mobile-item:active img { opacity: 1; }

  .bottombar { padding: 10px 16px; font-size: 10px; }
}
