@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Space+Grotesk:wght@500;600;700;800&display=swap');

:root {
  --bg: #FAFBFF;
  --text-dark: #111827;
  --text-body: #374151;
  --text-muted: #6B7280;
  --card-bg: #FFFFFF;
  --border: rgba(0, 0, 0, 0.06);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.06), 0 2px 6px rgba(0,0,0,0.04);
  --blue: #3B82F6;
  --indigo: #6366F1;
  --emerald: #10B981;
  --red: #EF4444;
  --violet: #8B5CF6;
  --amber: #F59E0B;
  --pink: #EC4899;
  --cyan: #06B6D4;
  --radius: 16px;
  --tag-color: var(--blue);
  --tag-bg: rgba(59, 130, 246, 0.1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: 'Space Grotesk', sans-serif;
  color: var(--text-dark);
  margin: 0;
}

body::before,
body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
  opacity: 0.5;
}
body::before {
  width: 500px;
  height: 500px;
  top: -120px;
  right: -180px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.12), transparent 70%);
}
body::after {
  width: 400px;
  height: 400px;
  bottom: 10%;
  left: -150px;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.1), transparent 70%);
}

/* ---- Navigation ---- */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(250, 251, 255, 0.85);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.navInner {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  text-decoration: none;
  color: var(--text-dark);
  display: flex;
  gap: 0.75rem;
  align-items: center;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
}
.logo { height: 28px; }
.navLinks { display: flex; align-items: center; gap: 0.5rem; }
.navLinks a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.5rem 0.9rem;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: color 0.2s, background 0.2s;
}
.navLinks a:hover { color: var(--text-dark); background: rgba(0,0,0,0.04); }
.navLinks .btn-nav {
  background: var(--text-dark);
  color: #fff;
}
.navLinks .btn-nav:hover { color: #fff; background: #1F2937; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,0.15); }

/* ---- Article Container ---- */
.article-container {
  width: min(740px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 3.5rem 0 4rem;
}

/* ---- Article Header ---- */
.article-header { margin-bottom: 2.5rem; }
.tag {
  display: inline-block;
  padding: 0.3rem 0.7rem;
  border-radius: 8px;
  background: var(--tag-bg);
  color: var(--tag-color);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.article-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--text-dark) 60%, var(--tag-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.article-meta {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  color: var(--text-muted);
  font-size: 0.88rem;
}
.article-meta span { display: flex; align-items: center; gap: 0.35rem; }
.meta-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--text-muted); opacity: 0.5; }

/* ---- Article Body ---- */
.article-body { line-height: 1.75; font-size: 1.02rem; }
.article-body h2 {
  font-size: 1.5rem;
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--tag-bg);
}
.article-body h3 {
  font-size: 1.2rem;
  margin: 2rem 0 0.8rem;
}
.article-body p { margin: 0 0 1.2rem; }
.article-body ul, .article-body ol {
  margin: 0 0 1.4rem;
  padding-left: 1.5rem;
}
.article-body li {
  margin-bottom: 0.5rem;
  line-height: 1.7;
}
.article-body strong { color: var(--text-dark); }

/* Callout / Tip box */
.callout {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--tag-color);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.2rem 1.4rem;
  margin: 1.5rem 0;
  box-shadow: var(--shadow-sm);
}
.callout p { margin: 0; }
.callout strong { color: var(--tag-color); }

/* Checklist */
.checklist {
  list-style: none;
  padding-left: 0;
  margin: 0 0 1.4rem;
}
.checklist li {
  padding: 0.5rem 0;
  padding-left: 1.8rem;
  position: relative;
}
.checklist li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.7rem;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 2px solid var(--tag-color);
  opacity: 0.5;
}

/* Code-like blocks */
.code-block {
  background: #1E293B;
  color: #E2E8F0;
  border-radius: 12px;
  padding: 1.2rem 1.4rem;
  margin: 1.2rem 0 1.4rem;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.88rem;
  line-height: 1.7;
  overflow-x: auto;
}
.code-block code { color: #E2E8F0; }

/* Inline code */
.article-body code {
  background: rgba(99, 102, 241, 0.08);
  color: var(--indigo);
  padding: 0.15rem 0.4rem;
  border-radius: 5px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.88em;
}
.code-block code {
  background: none;
  color: #E2E8F0;
  padding: 0;
}

/* Comparison table */
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2rem 0 1.6rem;
  font-size: 0.92rem;
}
.comparison-table th {
  background: var(--tag-bg);
  color: var(--tag-color);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  text-align: left;
  padding: 0.75rem 1rem;
}
.comparison-table th:first-child { border-radius: 10px 0 0 0; }
.comparison-table th:last-child { border-radius: 0 10px 0 0; }
.comparison-table td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
}
.comparison-table tr:last-child td { border-bottom: none; }
.comparison-table tr:hover td { background: rgba(0,0,0,0.015); }

/* ---- Article CTA ---- */
.article-cta {
  margin: 3rem 0 0;
  text-align: center;
  padding: 2.5rem 1.5rem;
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--text-dark) 0%, #1E293B 100%);
  color: #fff;
}
.article-cta::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.3), transparent 70%);
  pointer-events: none;
}
.article-cta h2 {
  color: #fff;
  font-size: 1.4rem;
  margin-bottom: 0.6rem;
  position: relative;
  z-index: 1;
}
.article-cta p {
  margin: 0 0 1.3rem;
  color: rgba(255,255,255,0.7);
  font-size: 0.95rem;
  position: relative;
  z-index: 1;
}
.article-cta .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.65rem 1.15rem;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  background: #fff;
  color: var(--text-dark);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  position: relative;
  z-index: 1;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.article-cta .btn:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(0,0,0,0.25); }

/* ---- Back link ---- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 2rem;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}
.back-link:hover { color: var(--tag-color); }
.back-link svg { width: 16px; height: 16px; }

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .navInner { flex-direction: column; padding: 0.7rem 0; }
  .article-container { padding: 2.5rem 0 3rem; }
  .article-header h1 { font-size: 1.6rem; }
  .article-body h2 { font-size: 1.3rem; }
  .article-meta { flex-wrap: wrap; gap: 0.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  .btn, .article-cta .btn { transition: none; }
  .btn:hover, .article-cta .btn:hover { transform: none; }
}
