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

:root {
  --bg: #0a0a0b;
  --bg-elevated: #111113;
  --bg-card: #161618;
  --bg-card-hover: #1c1c1f;
  --border: #2a2a2d;
  --border-subtle: #1e1e21;
  --text: #e8e8ed;
  --text-muted: #8b8b94;
  --text-dim: #5c5c66;
  --accent: #6ee7b7;
  --accent-dim: rgba(110, 231, 183, 0.12);
  --accent-hover: #a7f3d0;
  --code-kw: #c4b5fd;
  --code-str: #6ee7b7;
  --font-body: 'Sora', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --container: 1200px;
  --radius: 12px;
  --radius-sm: 8px;
}

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent-hover);
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 2rem;
}

/* === Header === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 11, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 1rem 0;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text);
  font-weight: 600;
}

.logo:hover {
  color: var(--text);
}

.logo-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.875rem;
  border-radius: var(--radius-sm);
  letter-spacing: -0.02em;
}

.logo-label {
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.logo-tld {
  color: var(--accent);
  font-weight: 700;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-link {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-muted);
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.nav-link:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* === Hero === */
.hero {
  padding: 5rem 0 4rem;
  border-bottom: 1px solid var(--border-subtle);
  background:
    radial-gradient(ellipse 60% 50% at 50% 0%, rgba(110, 231, 183, 0.04) 0%, transparent 100%),
    var(--bg);
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 1rem;
}

.hero-title {
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 1.25rem;
}

.hero-title em {
  font-style: italic;
  color: var(--accent);
}

.hero-subtitle {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 560px;
  line-height: 1.7;
  margin-bottom: 2.5rem;
}

.hero-code {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  max-width: 520px;
  overflow-x: auto;
}

.hero-code pre {
  margin: 0;
}

.hero-code code {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.8;
  color: var(--text-muted);
}

.code-kw {
  color: var(--code-kw);
}

.code-str {
  color: var(--code-str);
}

/* === Section Tabs === */
.sections-nav {
  padding: 2rem 0;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg);
}

.section-tabs {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.section-tabs::-webkit-scrollbar {
  display: none;
}

.section-tab {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 1.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.section-tab:hover {
  color: var(--text);
  border-color: var(--border);
  background: var(--bg-card);
}

.section-tab.active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-dim);
}

.tab-label {
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: -0.01em;
}

.tab-desc {
  font-size: 0.75rem;
  opacity: 0.7;
}

/* === Listing === */
.listing-section {
  padding: 3rem 0 4rem;
}

.listing-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.listing-title {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.listing-number {
  font-family: var(--font-mono);
  color: var(--accent);
  margin-right: 0.75rem;
  font-weight: 700;
}

.listing-page-info {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-dim);
}

/* === Card Grid === */
.listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

.demo-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: all 0.25s ease;
  animation: cardIn 0.4s ease both;
}

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

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

.card-index {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 500;
}

.card-title {
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.card-title a {
  color: var(--text);
  transition: color 0.2s ease;
}

.card-title a:hover {
  color: var(--accent);
}

.card-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--accent);
  margin-top: auto;
  padding-top: 0.5rem;
  transition: gap 0.2s ease;
}

.card-link:hover {
  gap: 0.625rem;
}

.card-link .arrow {
  transition: transform 0.2s ease;
}

.card-link:hover .arrow {
  transform: translateX(2px);
}

/* === Empty State === */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-dim);
  font-size: 1rem;
  background: var(--bg-elevated);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

/* === Pagination === */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
}

.page-link {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-muted);
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.page-link:hover:not(.disabled) {
  color: var(--accent);
  border-color: var(--accent);
}

.page-link.disabled {
  opacity: 0.3;
  cursor: default;
  pointer-events: none;
}

.page-numbers {
  display: flex;
  gap: 0.375rem;
}

.page-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

a.page-number:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.page-number.active {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  font-weight: 700;
}

/* === Footer === */
.site-footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border-subtle);
  margin-top: 2rem;
}

.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.site-footer p {
  font-size: 0.8125rem;
  color: var(--text-dim);
}

.site-footer p a {
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  font-size: 0.8125rem;
  color: var(--text-dim);
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--accent);
}

/* === Responsive === */
@media (max-width: 768px) {
  .container {
    padding: 0 1.25rem;
  }

  .hero {
    padding: 3rem 0 2.5rem;
  }

  .hero-code {
    padding: 1rem 1.25rem;
  }

  .listing-grid {
    grid-template-columns: 1fr;
  }

  .listing-header {
    flex-direction: column;
    gap: 0.5rem;
  }

  .pagination {
    flex-wrap: wrap;
  }

  .site-footer .container {
    flex-direction: column;
    text-align: center;
  }
}
