/* ============================================
   Gallery K7th — Style Sheet
   Mobile-first, dark theme
   ============================================ */

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #111111;
  --bg-elevated: #1a1a1a;
  --bg-card: #141414;
  --text-primary: #f0f0f0;
  --text-secondary: #888888;
  --text-muted: #555555;
  --accent: #c084fc;
  --accent-dim: #a855f7;
  --accent-glow: rgba(168, 85, 247, 0.25);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-light: rgba(255, 255, 255, 0.1);
  --shadow-lg: 0 25px 60px rgba(0, 0, 0, 0.5);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --timing-smooth: cubic-bezier(0.25, 0.1, 0.25, 1);
  --timing-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --font-display: 'Bebas Neue', 'Arial Black', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

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

/* ---------- HERO CAROUSEL ---------- */
.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background-color: var(--bg-primary);
}

.hero-track {
  position: absolute;
  inset: 0;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.4s var(--timing-smooth);
  will-change: opacity;
}

.hero-slide.active {
  opacity: 1;
}

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}

.hero-slide.active img {
  animation: kenburns 18s var(--timing-smooth) forwards;
}

@keyframes kenburns {
  0% {
    transform: scale(1.0) translate(0, 0);
  }
  100% {
    transform: scale(1.12) translate(-1.5%, -1%);
  }
}

/* Hero overlay gradient + title */
.hero-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    to bottom,
    rgba(10, 10, 10, 0.15) 0%,
    rgba(10, 10, 10, 0.0) 30%,
    rgba(10, 10, 10, 0.0) 50%,
    rgba(10, 10, 10, 0.4) 80%,
    rgba(10, 10, 10, 0.85) 100%
  );
  z-index: 2;
  pointer-events: none;
}

.hero-title {
  text-align: center;
  user-select: none;
  animation: titleFadeIn 1.8s var(--timing-smooth) 0.3s both;
}

.title-gallery {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 10vw, 5.5rem);
  font-weight: 400;
  letter-spacing: 0.35em;
  line-height: 1;
  color: var(--text-primary);
  text-transform: uppercase;
  margin-right: -0.35em; /* compensate letter-spacing */
}

.title-k7th {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(4.5rem, 18vw, 10rem);
  font-weight: 400;
  letter-spacing: 0.12em;
  line-height: 0.85;
  color: var(--text-primary);
  text-transform: uppercase;
  margin-right: -0.12em;
  text-shadow: 0 0 60px var(--accent-glow), 0 0 120px rgba(168, 85, 247, 0.1);
}

@keyframes titleFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Hero carousel indicators */
.hero-indicators {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 3;
}

.hero-dot {
  width: 28px;
  height: 3px;
  background: rgba(255, 255, 255, 0.25);
  border: none;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.5s var(--timing-smooth);
  padding: 0;
}

.hero-dot.active {
  background: var(--text-primary);
  width: 44px;
}

/* Scroll cue animation */
.scroll-cue {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.scroll-cue-line {
  width: 1px;
  height: 32px;
  background: linear-gradient(to bottom, transparent, var(--text-secondary));
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% {
    opacity: 0.3;
    transform: scaleY(0.6);
    transform-origin: top;
  }
  50% {
    opacity: 1;
    transform: scaleY(1);
  }
}

/* ---------- GALLERY SECTION ---------- */
.gallery-section {
  padding: 60px 16px 80px;
  max-width: 1400px;
  margin: 0 auto;
}

.gallery-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  margin-bottom: 40px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 400;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-primary);
  margin-right: -0.25em;
}

/* Filter bar */
.filter-bar {
  display: flex;
  gap: 4px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 100px;
  padding: 4px;
}

.filter-btn {
  padding: 8px 20px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
  border-radius: 100px;
  transition: all 0.35s var(--timing-smooth);
}

.filter-btn:hover {
  color: var(--text-primary);
}

.filter-btn.active {
  background: var(--bg-elevated);
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Gallery grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

/* Gallery item */
.gallery-item {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-card);
  transition: opacity 0.45s var(--timing-smooth), transform 0.45s var(--timing-smooth);
}

.gallery-item.filtered-out {
  opacity: 0;
  transform: scale(0.92);
  pointer-events: none;
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--timing-smooth);
}

.gallery-item-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(10, 10, 10, 0.75) 0%,
    rgba(10, 10, 10, 0) 50%
  );
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.35s var(--timing-smooth);
}

.gallery-item-title {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.gallery-item-category {
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* Scroll reveal animation */
.gallery-item.reveal {
  opacity: 0;
  transform: translateY(30px);
}

.gallery-item.reveal.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.7s var(--timing-smooth), transform 0.7s var(--timing-smooth);
}

/* ---------- LIGHTBOX ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s var(--timing-smooth), visibility 0.4s;
}

.lightbox.open {
  opacity: 1;
  visibility: visible;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.lightbox-content {
  position: relative;
  z-index: 1;
  max-width: 92vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: scale(0.92);
  transition: transform 0.4s var(--timing-smooth);
}

.lightbox.open .lightbox-content {
  transform: scale(1);
}

.lightbox-image {
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}

.lightbox-info {
  margin-top: 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lightbox-info .lightbox-title {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-primary);
}

.lightbox-info .lightbox-category {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: var(--text-secondary);
  border-radius: 50%;
  transition: color 0.3s, background 0.3s;
}

.lightbox-close:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  border-radius: 50%;
  transition: color 0.3s, background 0.3s;
}

.lightbox-prev { left: 12px; }
.lightbox-next { right: 12px; }

.lightbox-prev:hover,
.lightbox-next:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

/* ---------- FOOTER ---------- */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 40px 16px;
}

.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.footer-social {
  display: flex;
  gap: 20px;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--text-muted);
  border-radius: 50%;
  transition: color 0.3s var(--timing-smooth), background 0.3s;
}

.social-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.footer-copy {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

/* ---------- RESPONSIVE — Tablet ---------- */
@media (min-width: 640px) {
  body { font-size: 16px; }

  .gallery-section { padding: 80px 24px 100px; }

  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }

  .gallery-item { border-radius: var(--radius-md); }

  .lightbox-prev { left: 24px; }
  .lightbox-next { right: 24px; }
}

/* ---------- RESPONSIVE — Desktop ---------- */
@media (min-width: 1024px) {
  .gallery-section { padding: 100px 40px 120px; }

  .gallery-header {
    flex-direction: row;
    justify-content: space-between;
  }

  .gallery-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
  }

  .gallery-item:hover img {
    transform: scale(1.05);
  }

  .gallery-item:hover .gallery-item-overlay {
    opacity: 1;
  }

  .lightbox-content {
    max-width: 70vw;
  }

  .lightbox-prev { left: 40px; }
  .lightbox-next { right: 40px; }

  .site-footer { padding: 48px 40px; }

  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
  }
}

/* ---------- RESPONSIVE — Large Desktop ---------- */
@media (min-width: 1440px) {
  .gallery-grid {
    gap: 16px;
  }
}

/* ---------- Utilities ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Prevent body scroll when lightbox open */
body.lightbox-open {
  overflow: hidden;
}
