/* ============================================
   Custom Properties
   ============================================ */
:root {
  --bg: #0c0c0c;
  --bg-elevated: #131313;
  --bg-card: #181818;
  --border: #222222;
  --border-hover: #333333;
  --text-primary: #e5e5e5;
  --text-secondary: #777777;
  --accent: #c9a87c;
  --accent-hover: #d4b88c;
  --nav-height: 60px;
  --radius: 5px;
  --transition: 0.2s ease;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
}

body.no-scroll {
  overflow: hidden;
}

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

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

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

/* ============================================
   Navigation
   ============================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 100;
  background: rgba(12, 12, 12, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 4vw, 48px);
}

.nav-logo {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: var(--text-primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-link {
  font-size: 13px;
  font-weight: 450;
  color: var(--text-secondary);
  transition: color var(--transition);
  letter-spacing: 0.01em;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
}

.nav-discord {
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 450;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.nav-discord:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
  z-index: 110;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--text-secondary);
  transition: all 0.25s ease;
  transform-origin: center;
}

.nav-toggle.active span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 500;
  padding: 11px 24px;
  border-radius: var(--radius);
  transition: all var(--transition);
  letter-spacing: 0.01em;
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #0c0c0c;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-primary);
}

.btn-secondary:hover {
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.03);
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding-top: var(--nav-height);
}

#grid-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 540px;
  padding: 0 24px;
}

.hero-content h1 {
  font-size: clamp(28px, 4.5vw, 44px);
  font-weight: 600;
  letter-spacing: -0.5px;
  line-height: 1.15;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.hero-content p {
  font-size: clamp(14px, 1.8vw, 16px);
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 32px;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================================
   Gallery Page
   ============================================ */
.gallery-page {
  padding-top: calc(var(--nav-height) + 48px);
  padding-bottom: 80px;
  padding-left: clamp(20px, 4vw, 48px);
  padding-right: clamp(20px, 4vw, 48px);
  max-width: 960px;
  margin: 0 auto;
}

.gallery-header {
  margin-bottom: 40px;
}

.gallery-header h1 {
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 600;
  letter-spacing: -0.3px;
  margin-bottom: 6px;
}

.gallery-header p {
  font-size: 14px;
  color: var(--text-secondary);
}

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

/* ============================================
   Gallery Card
   ============================================ */
.gallery-card {
  cursor: pointer;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: border-color var(--transition), transform var(--transition);
}

.gallery-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.gallery-card-image {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #111111;
}

.gallery-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.gallery-card:hover .gallery-card-image img {
  transform: scale(1.02);
}

.gallery-card-info {
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.gallery-card-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: -0.1px;
}

.gallery-card-price {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ============================================
   Lightbox
   ============================================ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.lightbox.active {
  opacity: 1;
  pointer-events: all;
}

.lightbox-image-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  height: fit-content;
  max-width: 88vw;
  max-height: 82vh;
}

.lightbox-image {
  max-width: 100%;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 3px;
  user-select: none;
  -webkit-user-drag: none;
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  color: #666;
  font-size: 28px;
  line-height: 1;
  padding: 8px;
  transition: color var(--transition);
  z-index: 210;
}

.lightbox-close:hover {
  color: #ccc;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: #999;
  font-size: 22px;
  line-height: 0;
  padding: 10px;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all var(--transition);
  z-index: 210;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.lightbox-nav:hover {
  color: #fff;
  background: rgba(0, 0, 0, 0.7);
  border-color: rgba(255, 255, 255, 0.2);
}

.lightbox-prev {
  left: -52px;
}

.lightbox-next {
  right: -52px;
}

.lightbox-counter {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  color: #e5e5e5;
  letter-spacing: 0.5px;
  font-variant-numeric: tabular-nums;
  background: rgba(0, 0, 0, 0.5);
  padding: 3px 8px;
  border-radius: var(--radius);
}

.lightbox-title {
  position: absolute;
  top: 20px;
  left: 24px;
  font-size: 14px;
  font-weight: 500;
  color: #555;
}

/* ============================================
   Empty State
   ============================================ */
.gallery-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 24px;
  color: var(--text-secondary);
  font-size: 14px;
}

/* ============================================
   Responsive — Tablet
   ============================================ */
@media (max-width: 860px) {
  .gallery-grid {
    gap: 20px;
  }
}

/* ============================================
   Responsive — Mobile
   ============================================ */
@media (max-width: 720px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: rgba(12, 12, 12, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 20px 24px;
    gap: 0;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: all 0.25s ease;
  }

  .nav-links.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
  }

  .nav-link {
    font-size: 15px;
    padding: 12px 0;
    width: 100%;
    display: block;
  }

  .nav-discord {
    margin-left: 0;
    margin-top: 8px;
    width: 100%;
    text-align: center;
    padding: 10px 14px;
    font-size: 15px;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .gallery-page {
    padding-top: calc(var(--nav-height) + 32px);
  }

  .lightbox-nav {
    width: 38px;
    height: 38px;
    font-size: 18px;
  }

  .lightbox-prev {
    left: -46px;
  }

  .lightbox-next {
    right: -46px;
  }

  .lightbox-image {
    max-width: 84vw;
    max-height: 75vh;
  }

  .lightbox-title {
    top: 16px;
    bottom: auto;
    left: 24px;
    transform: none;
    font-size: 13px;
  }
}

@media (max-width: 400px) {
  .hero-content h1 {
    font-size: 24px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
  }

  .hero-actions .btn {
    width: 100%;
    max-width: 240px;
  }

  .gallery-card-info {
    padding: 12px 14px;
  }
}

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

  html {
    scroll-behavior: auto;
  }

  .gallery-card:hover {
    transform: none;
  }

  .gallery-card:hover .gallery-card-image img {
    transform: none;
  }
}
