@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;800&family=JetBrains+Mono:wght@400&display=swap');

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

:root {
  --bg: #06060a;
  --bg2: #0c0c14;
  --surface: #12121e;
  --border: #1e1e30;
  --text: #e8e8f0;
  --text2: #8888aa;
  --accent: #a78bfa;
  --accent2: #c084fc;
  --gold: #f59e0b;
  --cyan: #22d3ee;
  --rose: #fb7185;
  --emerald: #34d399;
  --glow: rgba(167, 139, 250, 0.15);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ===== HERO ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 600px 600px at 50% 40%, rgba(167,139,250,0.08) 0%, transparent 70%),
    radial-gradient(ellipse 400px 400px at 30% 60%, rgba(34,211,238,0.05) 0%, transparent 70%),
    radial-gradient(ellipse 400px 400px at 70% 30%, rgba(251,113,133,0.05) 0%, transparent 70%);
  pointer-events: none;
}

.hero canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.4;
}

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

.hero h1 {
  font-size: clamp(2.5rem, 7vw, 5.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  background: linear-gradient(135deg, var(--accent) 0%, var(--cyan) 50%, var(--rose) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
}

.hero .subtitle {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  font-weight: 300;
  color: var(--text2);
  max-width: 600px;
  margin: 0 auto 2.5rem;
}

.hero .stats {
  display: flex;
  gap: 2rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

.stat { text-align: center; }

.stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
}
.stat-number.purple { color: var(--accent); }
.stat-number.cyan { color: var(--cyan); }
.stat-number.rose { color: var(--rose); }
.stat-number.gold { color: var(--gold); }
.stat-number.emerald { color: var(--emerald); }

.stat-label {
  font-size: 0.8rem;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.nav-pills {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.4rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text2);
  font-size: 0.85rem;
  text-decoration: none;
  transition: all 0.3s ease;
}

.nav-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(167, 139, 250, 0.08);
  transform: translateY(-2px);
}

.scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  animation: float 2s ease-in-out infinite;
  color: var(--text2);
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.scroll-hint svg { width: 20px; height: 20px; }

@keyframes float {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

/* ===== SECTIONS ===== */
section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 5rem 2rem;
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-header h2 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.section-header p {
  color: var(--text2);
  font-size: 1rem;
  max-width: 600px;
  margin: 0 auto;
}

.divider {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--cyan));
  margin: 1rem auto;
  border-radius: 2px;
}

/* ===== GIF GALLERY ===== */
.gif-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.gif-card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  aspect-ratio: 1;
}

.gif-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(167, 139, 250, 0.12);
}

.gif-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gif-card .overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem 1rem 1rem;
  background: linear-gradient(transparent, rgba(6, 6, 10, 0.95));
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.gif-card:hover .overlay { transform: translateY(0); }

.gif-card .overlay h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.gif-card .overlay p {
  font-size: 0.75rem;
  color: var(--text2);
}

.gif-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(6, 6, 10, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.2rem 0.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--cyan);
}

/* ===== PDF GRID ===== */
.series-group { margin-bottom: 3rem; }

.series-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 1rem;
  padding-left: 0.5rem;
  border-left: 3px solid var(--accent);
}

.pdf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.pdf-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 1.25rem;
  text-decoration: none;
  color: var(--text);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pdf-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(167, 139, 250, 0.1);
}

.pdf-number {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--accent);
  opacity: 0.7;
}

.pdf-name {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.3;
}

.pdf-concept {
  font-size: 0.75rem;
  color: var(--text2);
  line-height: 1.4;
}

.pdf-palette {
  display: flex;
  gap: 4px;
  margin-top: auto;
}

.pdf-palette .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.1);
}

.pdf-icon {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 20px;
  height: 20px;
  color: var(--text2);
  opacity: 0;
  transition: opacity 0.3s;
}

.pdf-card:hover .pdf-icon { opacity: 1; }

/* ===== STANDALONE PIECES ===== */
.standalone-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.standalone-card {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  text-decoration: none;
  color: var(--text);
  transition: all 0.3s ease;
}

.standalone-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 16px 50px rgba(167, 139, 250, 0.1);
}

.standalone-preview {
  width: 100%;
  aspect-ratio: 16/10;
  background: var(--bg2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.standalone-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.standalone-preview .format-tag {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(6, 6, 10, 0.8);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.25rem 0.6rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.format-tag.png { color: var(--emerald); }
.format-tag.gif { color: var(--cyan); }
.format-tag.pdf { color: var(--rose); }
.format-tag.html { color: var(--gold); }
.format-tag.svg { color: var(--accent2); }

.standalone-info { padding: 1.25rem; }

.standalone-info h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.standalone-info p {
  font-size: 0.8rem;
  color: var(--text2);
}

/* ===== SOURCE CODE SECTION ===== */
.source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.source-card {
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 1.5rem;
  text-decoration: none;
  color: var(--text);
  transition: all 0.3s ease;
}

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

.source-card h3 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--emerald);
  margin-bottom: 0.5rem;
}

.source-card p {
  font-size: 0.8rem;
  color: var(--text2);
}

/* ===== FOOTER ===== */
footer {
  text-align: center;
  padding: 3rem 2rem;
  border-top: 1px solid var(--border);
  color: var(--text2);
  font-size: 0.8rem;
}

footer a {
  color: var(--accent);
  text-decoration: none;
}
footer a:hover { text-decoration: underline; }

/* ===== FILTER TABS ===== */
.filter-bar {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.4rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text2);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}

.filter-btn:hover, .filter-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(167, 139, 250, 0.08);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .hero .stats { gap: 1.5rem; }
  .stat-number { font-size: 2rem; }
  .gif-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .pdf-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .standalone-grid { grid-template-columns: 1fr; }
  section { padding: 3rem 1rem; }
  .gif-card .overlay { transform: translateY(0); }
}

/* ===== ANIMATIONS ===== */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}
