:root {
  --accent: #8B9DFF;
  --accent-soft: rgba(139, 157, 255, 0.15);
  --accent-glow: rgba(139, 157, 255, 0.35);
  --teal: #7FD8C9;
  --bg-deep: #07080f;
  --bg-mid: #0d0f1e;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --text-primary: #E8E8F0;
  --text-secondary: rgba(232, 232, 240, 0.6);
  --text-muted: rgba(232, 232, 240, 0.35);
  --border: rgba(255, 255, 255, 0.07);
  --border-accent: rgba(139, 157, 255, 0.3);
  --radius-md: 16px;
  --radius-lg: 24px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

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

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(60% 50% at 50% 0%, rgba(139, 157, 255, 0.08) 0%, transparent 60%),
    radial-gradient(50% 40% at 85% 80%, rgba(127, 216, 201, 0.05) 0%, transparent 60%),
    linear-gradient(160deg, #07080f 0%, #0d0a1a 50%, #07080f 100%);
  z-index: -1;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: 'DM Serif Display', Georgia, serif; font-weight: 400; line-height: 1.2; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: 720px; margin: 0 auto; padding: 0 24px; }

/* Nav */
nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(16px);
  background: rgba(7, 8, 15, 0.55);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}
nav.scrolled { border-bottom-color: var(--border); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 1.05rem; }
.brand-dot {
  width: 26px; height: 26px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--accent), #5b6bd6 70%);
  box-shadow: 0 0 18px var(--accent-glow);
}
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a { font-size: 0.9rem; color: var(--text-secondary); transition: color 0.2s; }
.nav-links a:hover { color: var(--text-primary); }
.nav-cta {
  font-size: 0.9rem; font-weight: 600;
  padding: 9px 18px; border-radius: 999px;
  background: var(--accent); color: #07080f;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.nav-cta:hover { transform: translateY(-1px); box-shadow: 0 8px 24px var(--accent-glow); }

/* Blog index */
.blog-hero { padding: 72px 0 56px; text-align: center; }
.blog-hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); margin-bottom: 18px; }
.blog-hero p { color: var(--text-secondary); font-size: 1.1rem; max-width: 520px; margin: 0 auto; }

.category-tag {
  display: inline-block;
  font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent); font-weight: 600;
  padding: 4px 12px; border: 1px solid var(--border-accent);
  border-radius: 999px; background: var(--accent-soft);
  margin-bottom: 0;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  padding-bottom: 80px;
}

.post-card {
  display: flex; flex-direction: column;
  padding: 32px 28px; border-radius: var(--radius-lg);
  background: var(--bg-card); border: 1px solid var(--border);
  transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease;
  text-decoration: none;
}
.post-card:hover { transform: translateY(-4px); background: var(--bg-card-hover); border-color: var(--border-accent); }
.post-card .meta { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.post-card .date { font-size: 0.82rem; color: var(--text-muted); }
.post-card .read-time { font-size: 0.82rem; color: var(--text-muted); }
.post-card h2 { font-size: 1.35rem; margin-bottom: 12px; color: var(--text-primary); line-height: 1.25; }
.post-card p { color: var(--text-secondary); font-size: 0.95rem; flex: 1; line-height: 1.6; }
.post-card .read-more { margin-top: 22px; font-size: 0.88rem; font-weight: 600; color: var(--accent); }

/* Article page */
.article-header { padding: 72px 0 48px; border-bottom: 1px solid var(--border); margin-bottom: 56px; }
.article-header .meta { display: flex; align-items: center; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.article-header h1 { font-size: clamp(2rem, 5vw, 3rem); margin-bottom: 22px; max-width: 680px; }
.article-header .excerpt { font-size: 1.15rem; color: var(--text-secondary); max-width: 620px; line-height: 1.65; }

.article-body { padding-bottom: 80px; }
.article-body h2 { font-size: 1.7rem; margin: 52px 0 18px; }
.article-body h3 { font-size: 1.25rem; margin: 36px 0 14px; font-family: 'Inter', sans-serif; font-weight: 600; }
.article-body p { margin-bottom: 22px; font-size: 1.05rem; color: var(--text-secondary); }
.article-body p strong { color: var(--text-primary); font-weight: 600; }
.article-body ul, .article-body ol { margin: 0 0 22px 22px; }
.article-body li { color: var(--text-secondary); font-size: 1.05rem; margin-bottom: 10px; padding-left: 6px; }
.article-body li strong { color: var(--text-primary); }
.article-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.article-body a:hover { text-decoration: none; }

.callout {
  margin: 40px 0;
  padding: 28px 32px;
  border-radius: var(--radius-lg);
  background: var(--accent-soft);
  border: 1px solid var(--border-accent);
}
.callout p { margin: 0; color: var(--text-primary); font-size: 1rem; }
.callout p + p { margin-top: 12px; color: var(--text-secondary); font-size: 0.95rem; }

.app-cta {
  margin: 56px 0;
  padding: 36px 40px;
  border-radius: var(--radius-lg);
  background: linear-gradient(140deg, rgba(139,157,255,0.10), rgba(127,216,201,0.05));
  border: 1px solid var(--border-accent);
  text-align: center;
}
.app-cta h3 { font-size: 1.5rem; margin-bottom: 12px; }
.app-cta p { color: var(--text-secondary); font-size: 0.97rem; margin-bottom: 24px; }
.app-cta a {
  display: inline-block;
  font-size: 0.97rem; font-weight: 600;
  padding: 14px 32px; border-radius: 999px;
  background: var(--accent); color: #07080f;
  box-shadow: 0 10px 30px var(--accent-glow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.app-cta a:hover { transform: translateY(-2px); box-shadow: 0 16px 44px var(--accent-glow); text-decoration: none; }

/* Related posts */
.related { padding: 56px 0 80px; border-top: 1px solid var(--border); }
.related h2 { font-size: 1.6rem; margin-bottom: 32px; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }

/* Footer */
footer { border-top: 1px solid var(--border); padding: 40px 0; }
.foot-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.foot-links { display: flex; gap: 26px; font-size: 0.9rem; }
.foot-links a { color: var(--text-muted); transition: color 0.2s ease; }
.foot-links a:hover { color: var(--text-primary); }
.foot-copy { font-size: 0.85rem; color: var(--text-muted); }
.disclaimer { font-size: 0.78rem; color: var(--text-muted); margin-top: 22px; max-width: 620px; line-height: 1.5; }

@media (max-width: 640px) {
  .blog-hero { padding: 48px 0 36px; }
  .article-header { padding: 48px 0 36px; margin-bottom: 36px; }
  .app-cta { padding: 28px 24px; }
  .posts-grid { grid-template-columns: 1fr; }
}
