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

:root {
  --brand:      #4c5fd9;
  --brand-dark: #3d4fb5;
  --brand-dim:  #eef0fd;
  --text:       #1a202c;
  --muted:      #5d6f85;
  --border:     #e2e8f0;
  --bg:         #f7f8fc;
  --white:      #ffffff;
  --radius:     12px;
}

html { scroll-behavior: smooth; }

body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background: var(--white);
  line-height: 1.6;
}

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

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

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

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--brand);
  letter-spacing: -.02em;
}
.nav-logo span { color: var(--text); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}
.nav-links a {
  font-size: .9rem;
  font-weight: 500;
  color: var(--muted);
  transition: color .15s;
}
.nav-links a:hover { color: var(--text); }

.nav-actions { display: flex; align-items: center; gap: .75rem; }

@media (max-width: 680px) { .nav-links { display: none; } }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .7rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: background .15s, transform .1s;
  text-decoration: none;
}
.btn:active { transform: scale(.97); }

.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 2px 12px rgba(76,95,217,.35);
}
.btn-primary:hover { background: var(--brand-dark); }

.btn-outline {
  background: transparent;
  color: var(--brand);
  border: 2px solid var(--brand);
}
.btn-outline:hover { background: var(--brand-dim); }

.btn-white {
  background: #fff;
  color: var(--brand);
  box-shadow: 0 4px 18px rgba(0,0,0,.15);
}
.btn-white:hover { background: #f0f4ff; }

.btn-sm { padding: .45rem 1rem; font-size: .85rem; }
.btn-lg { padding: .9rem 2rem; font-size: 1.05rem; border-radius: 10px; }

/* ── Breadcrumb ───────────────────────────────────────────────────────────── */
.breadcrumb {
  font-size: .82rem;
  color: var(--muted);
  padding: 1.5rem 0 0;
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--brand); }
.breadcrumb a:hover { text-decoration: underline; }

/* ── Article layout ──────────────────────────────────────────────────────── */
.article-wrap {
  max-width: 740px;
  margin: 0 auto;
  padding: 0 1.5rem 5rem;
}

.article-header {
  padding: 2rem 0 2.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}

.article-tag {
  display: inline-block;
  background: var(--brand-dim);
  color: var(--brand);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .25rem .75rem;
  border-radius: 100px;
  margin-bottom: 1rem;
}

.article-header h1 {
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.2;
  margin-bottom: .75rem;
}

.article-meta {
  font-size: .82rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}
.article-meta .sep { opacity: .5; }

/* ── Article body typography ─────────────────────────────────────────────── */
.article-body { line-height: 1.8; }

.article-body h2 {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -.02em;
  margin: 2.75rem 0 .75rem;
  color: var(--text);
}

.article-body h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 2rem 0 .5rem;
  color: var(--text);
}

.article-body p { margin-bottom: 1.25rem; }

.article-body ul,
.article-body ol {
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.article-body li { font-size: .975rem; line-height: 1.65; }

.article-body strong { font-weight: 700; }

.article-body a {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.article-body a:hover { color: var(--brand-dark); }

/* Code blocks */
.article-body pre {
  background: #1a202c;
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}
.article-body pre code {
  font-family: 'Fira Code', 'Cascadia Code', Consolas, monospace;
  font-size: .82rem;
  line-height: 1.85;
  color: #a0f0a0;
  background: none;
  padding: 0;
  border-radius: 0;
}

.article-body :not(pre) > code {
  background: #f0f2f8;
  color: #4c5fd9;
  padding: .15rem .45rem;
  border-radius: 4px;
  font-size: .875em;
  font-family: 'Fira Code', Consolas, monospace;
}

/* Callout box */
.callout {
  background: var(--brand-dim);
  border-left: 3px solid var(--brand);
  border-radius: 0 8px 8px 0;
  padding: 1rem 1.25rem;
  margin: 1.75rem 0;
  font-size: .925rem;
  line-height: 1.7;
}
.callout strong { color: var(--brand); }

/* Ordered steps */
.steps-list {
  list-style: none;
  padding: 0;
  counter-reset: steps;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}
.steps-list li {
  counter-increment: steps;
  padding-left: 3rem;
  position: relative;
  font-size: .975rem;
  line-height: 1.65;
}
.steps-list li::before {
  content: counter(steps);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.9rem;
  height: 1.9rem;
  background: var(--brand);
  color: #fff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  font-weight: 800;
}

/* ── CTA banner ───────────────────────────────────────────────────────────── */
.article-cta {
  background: linear-gradient(135deg, #4c5fd9 0%, #764ba2 100%);
  border-radius: 16px;
  padding: 2.75rem 2rem;
  text-align: center;
  color: #fff;
  margin-top: 3.5rem;
}
.article-cta h2 {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -.02em;
  margin-bottom: .5rem;
  color: #fff;
}
.article-cta p {
  font-size: .95rem;
  opacity: .88;
  margin-bottom: 1.5rem;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Footer ──────────────────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-logo { font-size: 1rem; font-weight: 800; color: var(--brand); }
.footer-copy { font-size: .82rem; color: var(--muted); }
.footer-links { display: flex; gap: 1rem 1.5rem; flex-wrap: wrap; }
.footer-links a { font-size: .82rem; color: var(--muted); transition: color .15s; }
.footer-links a:hover { color: var(--text); }

@media (max-width: 600px) {
  .footer-inner { flex-direction: column; align-items: center; text-align: center; }
}

/* ── Blog index ───────────────────────────────────────────────────────────── */
.blog-hero {
  padding: 3.5rem 0 3rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3rem;
}
.blog-hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -.02em;
  margin-bottom: .5rem;
}
.blog-hero p { color: var(--muted); font-size: 1.05rem; max-width: 520px; }

.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.75rem;
  margin-bottom: 5rem;
}

.article-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: box-shadow .2s, transform .2s;
  display: flex;
  flex-direction: column;
}
.article-card:hover {
  box-shadow: 0 4px 24px rgba(0,0,0,.08);
  transform: translateY(-2px);
}
.article-card .article-tag { margin-bottom: .75rem; }
.article-card h2 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.4;
  margin-bottom: .5rem;
  color: var(--text);
}
.article-card p {
  font-size: .875rem;
  color: var(--muted);
  line-height: 1.65;
  flex: 1;
  margin-bottom: 1.25rem;
}
.article-card .read-more {
  font-size: .85rem;
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
}
.article-card .read-more:hover { text-decoration: underline; }
