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

:root {
  --bg: #fcfcfd;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --purple: #7c3aed;
  --purple-bg: #ede8ff;
  --border: #e5e7eb;
  --text: #111827;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  --radius: 12px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

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

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

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

/* ── Nav ─────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.80);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-logo {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.nav-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
}

.nav-section {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

.nav-badge {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  padding: 5px 12px;
  border-radius: 20px;
  letter-spacing: 0.01em;
}

/* ── Hero ────────────────────────────────────────── */
.hero {
  max-width: 800px;
  margin: 0 auto;
  padding: 48px 24px 32px;
  background: linear-gradient(180deg, #eff6ff 0%, #fcfcfd 100%);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--purple);
  background: var(--purple-bg);
  padding: 6px 14px;
  border-radius: 20px;
  margin-bottom: 16px;
}

.hero h1 {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.2;
}

.hero p {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 520px;
}

.hero-timestamp {
  margin-top: 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

/* ── Stats Bar ───────────────────────────────────── */
.stats-bar {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px 24px;
  display: flex;
  gap: 24px;
}

.stat {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

.stat-value {
  font-weight: 700;
  color: var(--text);
}

/* ── Filters ─────────────────────────────────────── */
.filters {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

#category-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-pill {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  padding: 7px 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.filter-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-pill.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.filter-source {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-secondary);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  transition: all 0.15s ease;
}

.filter-source:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-source:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ── Article Feed ────────────────────────────────── */
.feed {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px 64px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.article-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 20px 24px;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.article-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-color: #d1d5db;
}

.article-category {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 10px;
  border-radius: 6px;
  margin-bottom: 10px;
}

.category-events {
  color: #b45309;
  background: #fef3c7;
}

.category-team-news {
  color: #7c3aed;
  background: #ede8ff;
}

.category-rule-changes {
  color: #dc2626;
  background: #fef2f2;
}

.category-build-logs {
  color: #059669;
  background: #ecfdf5;
}

.category-recaps {
  color: #2563eb;
  background: #eff6ff;
}

.category-tech-analysis {
  color: #0891b2;
  background: #ecfeff;
}

.article-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

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

.article-summary {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-muted);
}

.article-source {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
  color: var(--text-secondary);
}

.meta-dot {
  color: var(--border);
}

/* ── Empty State ─────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.empty-state p {
  font-size: 14px;
}

/* ── Footer ──────────────────────────────────────── */
.footer {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px 24px 48px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer p {
  font-size: 13px;
  color: var(--text-muted);
}

.footer a {
  color: var(--accent);
  font-weight: 500;
}

.footer a:hover {
  text-decoration: underline;
}

/* ── Loading ─────────────────────────────────────── */
.loading {
  text-align: center;
  padding: 64px 24px;
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading p {
  font-size: 14px;
  color: var(--text-muted);
}

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 640px) {
  .hero h1 {
    font-size: 24px;
  }

  .hero p {
    font-size: 14px;
  }

  .nav-inner {
    padding: 0 16px;
  }

  .hero,
  .stats-bar,
  .filters,
  .feed,
  .footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .article-card {
    padding: 16px;
  }

  .stats-bar {
    gap: 16px;
  }

  .filters {
    gap: 8px;
  }

  .filter-pill {
    padding: 6px 12px;
    font-size: 12px;
  }
}
