:root {
  --brand-primary: #2563eb;
  --brand-dark: #1e293b;
  --brand-muted: #64748b;
  --brand-light: #f8fafc;
  --brand-border: #e2e8f0;
  --category-practical: #059669;
  --category-decision: #d97706;
  --category-tutorial: #7c3aed;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--brand-dark);
  background-color: #fff;
}

/* Navbar */
.navbar-brand {
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 1.15rem;
}

.navbar-brand span {
  color: var(--brand-primary);
}

.site-domain {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  letter-spacing: -0.01em;
}

/* Hero */
.hero-section {
  background: linear-gradient(135deg, #1e293b 0%, #334155 50%, #1e40af 100%);
  color: #fff;
  padding: 4rem 0 5rem;
}

@media (max-width: 767.98px) {
  .hero-section {
    padding: 2.5rem 0 3rem;
  }
}

.hero-section h1 {
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.hero-section .lead {
  color: rgba(255, 255, 255, 0.85);
  max-width: 36rem;
}

.hero-badge {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.8rem;
  font-weight: 500;
}

/* Category badges */
.badge-practical {
  background-color: var(--category-practical);
}

.badge-decision {
  background-color: var(--category-decision);
}

.badge-tutorial {
  background-color: var(--category-tutorial);
}

/* Article cards */
.article-card {
  border: 1px solid var(--brand-border);
  border-radius: 0.75rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  height: 100%;
  overflow: hidden;
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

.article-card .card-img-top {
  height: 180px;
  object-fit: cover;
  background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
}

.article-card .card-body {
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.5rem 1.75rem;
}

.article-card .card-text {
  flex-grow: 1;
  color: var(--brand-muted);
  font-size: 0.925rem;
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.article-meta {
  font-size: 0.8rem;
  color: var(--brand-muted);
  margin-top: 1rem;
}

/* Category section */
.category-header {
  border-left: 4px solid var(--brand-primary);
  padding-left: 1rem;
  margin-bottom: 3rem;
}

.category-header h2 {
  margin-bottom: 0.75rem;
}

.category-header p {
  margin-bottom: 0;
  line-height: 1.5;
}

.category-header.practical {
  border-color: var(--category-practical);
}

.category-header.decision {
  border-color: var(--category-decision);
}

.category-header.tutorial {
  border-color: var(--category-tutorial);
}

/* Featured article */
.featured-card {
  border: none;
  border-radius: 1rem;
  overflow: hidden;
  background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
}

.featured-card .featured-img {
  min-height: 220px;
  background: linear-gradient(135deg, #3b82f6, #10b981);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 3rem;
}

@media (min-width: 768px) {
  .featured-card .featured-img {
    min-height: 100%;
  }
}

/* Detail page */
.article-detail {
  max-width: 720px;
  margin: 0 auto;
}

.article-detail h1 {
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.article-detail .article-content h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.article-detail .article-content h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.article-detail .article-content p {
  line-height: 1.75;
  color: #334155;
  margin-bottom: 1rem;
}

.article-detail .article-content ul,
.article-detail .article-content ol {
  line-height: 1.75;
  color: #334155;
  margin-bottom: 1rem;
}

.article-detail .article-content blockquote {
  border-left: 4px solid var(--brand-primary);
  padding: 0.75rem 1.25rem;
  background: var(--brand-light);
  border-radius: 0 0.5rem 0.5rem 0;
  margin: 1.5rem 0;
  color: var(--brand-muted);
  font-style: italic;
}

.article-detail .article-content pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 1rem 1.25rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.article-detail .article-content code {
  background: #f1f5f9;
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
  font-size: 0.875em;
  color: #be185d;
}

.article-detail .article-content pre code {
  background: none;
  padding: 0;
  color: inherit;
}

.toc-card {
  background: var(--brand-light);
  border: 1px solid var(--brand-border);
  border-radius: 0.75rem;
}

/* Comparison table */
.comparison-table th {
  background: var(--brand-light);
  font-weight: 600;
}

/* Footer */
.site-footer {
  background: var(--brand-dark);
  color: rgba(255, 255, 255, 0.7);
  padding: 3rem 0 2rem;
  margin-top: 4rem;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
}

.site-footer a:hover {
  color: #fff;
}

/* Breadcrumb */
.breadcrumb-item a {
  color: var(--brand-primary);
  text-decoration: none;
}

/* Related articles */
.related-card {
  border: 1px solid var(--brand-border);
  border-radius: 0.5rem;
  transition: border-color 0.2s;
}

.related-card:hover {
  border-color: var(--brand-primary);
}

/* Section spacing */
.section-padding {
  padding: 5rem 0;
}

.section-padding .row.g-4 {
  --bs-gutter-x: 2rem;
  --bs-gutter-y: 2.5rem;
}

@media (max-width: 767.98px) {
  .section-padding {
    padding: 3.5rem 0;
  }

  .category-header {
    margin-bottom: 2.25rem;
  }

  .section-padding .row.g-4 {
    --bs-gutter-y: 2rem;
  }
}

/* Sticky sidebar on detail (desktop) */
@media (min-width: 992px) {
  .detail-sidebar {
    position: sticky;
    top: 5rem;
  }
}
