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

:root {
  --bg: #080b14;
  --surface: #0f1420;
  --surface2: #161c2d;
  --accent: #6c63ff;
  --accent2: #00e5ff;
  --text: #e8eaf6;
  --muted: #6b7499;
  --radius: 16px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Stars ── */
.stars {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
}
.star {
  position: absolute;
  border-radius: 50%;
  background: white;
  animation: twinkle var(--dur, 3s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
  opacity: 0;
}
@keyframes twinkle {
  0%, 100% { opacity: 0; transform: scale(0.8); }
  50% { opacity: var(--max-op, 0.8); transform: scale(1); }
}

/* ── Hero ── */
.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px;
}

.hero::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 600px; height: 600px;
  background: radial-gradient(ellipse, rgba(108,99,255,0.15) 0%, transparent 70%);
  pointer-events: none;
}

.hero-inner { position: relative; z-index: 1; }

.badge {
  display: inline-block;
  padding: 6px 18px;
  border: 1px solid rgba(108,99,255,0.4);
  border-radius: 100px;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 32px;
  background: rgba(108,99,255,0.08);
  animation: fadeUp 0.8s ease both;
}

.hero-title {
  font-size: clamp(3rem, 10vw, 7rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
}

.word {
  display: inline-block;
  animation: fadeUp 0.8s ease both;
}
.word:nth-child(1) { animation-delay: 0.1s; }
.word:nth-child(2) { animation-delay: 0.2s; margin: 0 0.2em; }
.word:nth-child(3) { animation-delay: 0.3s; }

.accent {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--muted);
  max-width: 560px;
  line-height: 1.7;
  animation: fadeUp 0.8s ease 0.4s both;
}

.scroll-hint {
  position: absolute;
  bottom: 32px;
  font-size: 1.4rem;
  color: var(--muted);
  animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); opacity: 0.4; }
  50% { transform: translateY(8px); opacity: 1; }
}

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

/* ── Gallery ── */
.gallery-section {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 24px 120px;
}

.gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 40px;
}

.gallery-header h2 {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.count {
  font-size: 0.9rem;
  color: var(--muted);
  background: var(--surface);
  padding: 4px 14px;
  border-radius: 100px;
}

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

/* ── Cards ── */
.demo-card {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  animation: fadeUp 0.6s ease both;
  display: block;
}
.demo-card:hover {
  transform: translateY(-6px);
  border-color: rgba(108,99,255,0.4);
  box-shadow: 0 20px 60px rgba(0,0,0,0.4), 0 0 0 1px rgba(108,99,255,0.15);
}

.card-thumb {
  height: 180px;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  position: relative;
  overflow: hidden;
}
.card-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 50%, var(--surface));
}
.card-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.card-body {
  padding: 20px 24px 24px;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.card-desc {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--muted);
}

.card-tag {
  background: rgba(108,99,255,0.12);
  color: var(--accent);
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
}

/* ── States ── */
.loading-spinner {
  grid-column: 1/-1;
  width: 36px; height: 36px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 40px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
  grid-column: 1/-1;
  text-align: center;
  padding: 80px 20px;
  color: var(--muted);
}
.empty-icon { font-size: 3rem; margin-bottom: 16px; }
.hidden { display: none !important; }

/* ── Footer ── */
.site-footer {
  position: relative; z-index: 1;
  text-align: center;
  padding: 24px;
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid rgba(255,255,255,0.04);
}
.site-footer a { color: var(--accent); text-decoration: none; }

/* ── Responsive ── */
@media (max-width: 600px) {
  .gallery-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .gallery { grid-template-columns: 1fr; }
}
