/* ─── Variables ─────────────────────────────────────────────── */
:root {
  --bg: #080810;
  --bg-2: #0e0e1a;
  --bg-3: #13131f;
  --surface: #18182a;
  --surface-2: #1f1f35;
  --border: rgba(255,255,255,0.07);
  --border-hover: rgba(255,255,255,0.14);
  --accent: #7b5ef8;
  --accent-2: #a78bfa;
  --accent-glow: rgba(123, 94, 248, 0.25);
  --gold: #f0c060;
  --text: #e8e8f0;
  --text-2: #9898b8;
  --text-3: #5a5a7a;
  --font-display: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 8px 32px rgba(0,0,0,0.5);
  --shadow-card: 0 2px 8px rgba(0,0,0,0.4), 0 0 0 1px var(--border);
  --transition: 0.2s ease;
}

/* ─── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  font-weight: 300;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }

/* ─── Header ────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8, 8, 16, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.logo-icon {
  font-size: 1.4rem;
  color: var(--accent-2);
  display: inline-block;
  animation: spin 20s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.logo-text { background: linear-gradient(135deg, #fff 40%, var(--accent-2)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.nav-right { display: flex; align-items: center; gap: 16px; }
.nav-count { font-size: 0.8rem; color: var(--text-3); }
.nav-admin {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-2);
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 100px;
  transition: var(--transition);
}
.nav-admin:hover { border-color: var(--border-hover); color: var(--text); }

/* ─── Hero ──────────────────────────────────────────────────── */
.hero {
  position: relative;
  padding: 80px 24px 60px;
  text-align: center;
  overflow: hidden;
}
.hero-inner { position: relative; z-index: 1; }
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
  background: linear-gradient(160deg, #fff 30%, var(--accent-2) 70%, var(--gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
}
.hero-sub { color: var(--text-2); font-size: 1.1rem; font-weight: 300; max-width: 480px; margin: 0 auto 24px; }
.hero-stats { display: flex; justify-content: center; gap: 32px; }
.stat { color: var(--text-3); font-size: 0.9rem; }
.stat strong { color: var(--accent-2); font-family: var(--font-display); font-size: 1.1rem; }
.hero-glow {
  position: absolute;
  top: -60px; left: 50%; transform: translateX(-50%);
  width: 600px; height: 400px;
  background: radial-gradient(ellipse, rgba(123,94,248,0.15) 0%, transparent 70%);
  pointer-events: none;
}

/* ─── Gallery Grid ───────────────────────────────────────────── */
.gallery-section { padding: 0 24px 80px; max-width: 1400px; margin: 0 auto; }
.gallery-grid {
  columns: 4 300px;
  column-gap: 16px;
}
.image-card {
  break-inside: avoid;
  margin-bottom: 16px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  will-change: transform;
  animation: fadeUp 0.4s ease backwards;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.image-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  box-shadow: 0 16px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(123,94,248,0.2);
}
.card-img-wrap { position: relative; overflow: hidden; background: var(--bg-3); }
.card-img {
  width: 100%;
  display: block;
  transition: transform 0.4s ease;
}
.image-card:hover .card-img { transform: scale(1.03); }
.card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 12px;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.image-card:hover .card-overlay { opacity: 1; }
.btn-view {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  transition: background 0.2s;
}
.btn-view:hover { background: rgba(255,255,255,0.25); }

/* Card Body */
.card-body { padding: 16px; }
.card-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.card-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.tag {
  font-size: 0.7rem;
  padding: 2px 8px;
  background: rgba(123,94,248,0.12);
  color: var(--accent-2);
  border-radius: 100px;
  border: 1px solid rgba(123,94,248,0.2);
}
.card-prompt {
  font-size: 0.82rem;
  color: var(--text-2);
  line-height: 1.5;
  margin-bottom: 14px;
}
.card-footer { display: flex; align-items: center; justify-content: space-between; }
.copy-count { font-size: 0.72rem; color: var(--text-3); }

/* ─── Copy Button ────────────────────────────────────────────── */
.btn-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  font-family: var(--font-body);
  color: var(--text-2);
  padding: 7px 14px;
  background: var(--surface-2);
  border-radius: 100px;
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}
.btn-copy:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-copy.copied {
  background: #1a4a2e;
  color: #4ade80;
  border-color: rgba(74,222,128,0.3);
}

/* ─── Load More ──────────────────────────────────────────────── */
.load-more-wrap { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 40px 0; }
.btn-load-more {
  display: none; /* shown via JS if IntersectionObserver not supported */
  padding: 12px 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-2);
  font-size: 0.9rem;
  font-family: var(--font-body);
  transition: var(--transition);
}
.btn-load-more:hover { border-color: var(--accent); color: var(--accent-2); }
.loading-spinner {
  width: 32px; height: 32px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: rotate 0.8s linear infinite;
  display: none;
}
.loading-spinner.active { display: block; }
@keyframes rotate { to { transform: rotate(360deg); } }
.all-loaded { text-align: center; color: var(--text-3); font-size: 0.85rem; padding: 40px 0; letter-spacing: 0.1em; }

/* ─── Toast ──────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 24px;
  border-radius: 100px;
  font-size: 0.875rem;
  box-shadow: var(--shadow);
  z-index: 1000;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.success { background: #1a4a2e; border-color: rgba(74,222,128,0.3); color: #4ade80; }

/* ─── Lightbox ───────────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  backdrop-filter: blur(12px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.lightbox.open { opacity: 1; pointer-events: all; }
.lightbox-close {
  position: absolute;
  top: 20px; right: 24px;
  font-size: 1.4rem;
  color: var(--text-2);
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--surface);
  transition: var(--transition);
}
.lightbox-close:hover { color: var(--text); background: var(--surface-2); }
.lightbox-content {
  display: flex;
  gap: 24px;
  max-width: 1100px;
  width: 100%;
  max-height: 90vh;
  align-items: flex-start;
}
.lightbox-content img {
  max-height: 80vh;
  max-width: 65%;
  object-fit: contain;
  border-radius: var(--radius);
  flex-shrink: 0;
}
.lightbox-info {
  flex: 1;
  padding: 8px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  max-height: 80vh;
}
#lightboxTitle { font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; }
#lightboxPrompt { color: var(--text-2); font-size: 0.9rem; line-height: 1.7; }
.lightbox-copy { align-self: flex-start; }

/* ─── Error Page ─────────────────────────────────────────────── */
.error-page {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 60vh; gap: 16px; text-align: center; padding: 40px;
}
.error-code { font-size: 4rem; opacity: 0.3; }
.error-title { font-family: var(--font-display); font-size: 1.5rem; color: var(--text-2); }

/* ─── Footer ─────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 24px;
  color: var(--text-3);
  font-size: 0.8rem;
}

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .gallery-grid { columns: 2 160px; column-gap: 10px; }
  .image-card { margin-bottom: 10px; }
  .card-body { padding: 12px; }
  .card-title { font-size: 0.85rem; }
  .hero { padding: 48px 16px 40px; }
  .gallery-section { padding: 0 16px 60px; }
  .lightbox-content { flex-direction: column; align-items: center; }
  .lightbox-content img { max-width: 100%; max-height: 50vh; }
  .lightbox-info { max-height: none; }
  .nav-inner { padding: 0 16px; }
}
@media (max-width: 480px) {
  .gallery-grid { columns: 2 140px; }
  .btn-copy span { display: none; }
}
