/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0a0a0f;
  --bg-card: #12121a;
  --bg-hover: #1a1a2e;
  --text: #e0e0e8;
  --text-muted: #8888a0;
  --accent: #7c3aed;
  --accent-light: #a78bfa;
  --accent-glow: rgba(124, 58, 237, 0.15);
  --green: #10b981;
  --border: #1e1e30;
  --radius: 12px;
  --max-width: 1100px;
  --content-width: 780px;
}

html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 17px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }

a { color: var(--accent-light); text-decoration: none; transition: color 0.2s; }
a:hover { color: #c4b5fd; }

img { max-width: 100%; height: auto; border-radius: var(--radius); }

h1, h2, h3, h4 { line-height: 1.3; font-weight: 700; }
h1 { font-size: 2.4rem; }
h2 { font-size: 1.8rem; margin-top: 2rem; }
h3 { font-size: 1.4rem; margin-top: 1.5rem; }

/* ===== NAV ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.8rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}
.nav-logo:hover { color: var(--accent-light); }
.nav-links { display: flex; gap: 2rem; }
.nav-links a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 4px; }
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  margin: 5px 0;
  transition: 0.3s;
}

/* ===== HERO ===== */
.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 5rem 1.5rem 3rem;
  text-align: center;
}
.hero-badge {
  display: inline-block;
  background: var(--accent-glow);
  color: var(--accent-light);
  padding: 0.4rem 1rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(124, 58, 237, 0.3);
}
.hero h1 {
  font-size: 3rem;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 2rem;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s;
}
.btn-primary {
  background: var(--accent);
  color: white;
}
.btn-primary:hover {
  background: #6d28d9;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--accent-glow);
}
.btn-secondary {
  background: transparent;
  color: var(--accent-light);
  border: 1px solid var(--accent);
}
.btn-secondary:hover {
  background: var(--accent-glow);
  color: white;
}
.hero-buttons { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ===== POST GRID ===== */
.section { max-width: var(--max-width); margin: 0 auto; padding: 2rem 1.5rem 4rem; }
.section-title {
  font-size: 1.6rem;
  margin-bottom: 2rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}
.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: all 0.25s;
  display: flex;
  flex-direction: column;
}
.post-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}
.post-card time {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.post-card h3 {
  margin: 0.75rem 0 0.5rem;
  font-size: 1.2rem;
}
.post-card h3 a { color: var(--text); }
.post-card h3 a:hover { color: var(--accent-light); }
.post-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  flex: 1;
}
.post-card .read-more {
  margin-top: 1rem;
  font-size: 0.9rem;
  font-weight: 600;
}

/* ===== SINGLE POST ===== */
.post { max-width: var(--content-width); margin: 0 auto; padding: 3rem 1.5rem 4rem; }
.post-header { margin-bottom: 2.5rem; }
.post-header h1 { margin-bottom: 0.5rem; }
.post-meta { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 0.5rem; }
.post-subtitle { color: var(--text-muted); font-size: 1.1rem; margin-top: 0.75rem; }
.post-readtime { color: var(--text-muted); }

.post-content p { margin-bottom: 1.25rem; }
.post-content h2 { margin-top: 2.5rem; margin-bottom: 1rem; }
.post-content h3 { margin-top: 2rem; margin-bottom: 0.75rem; }
.post-content ul, .post-content ol {
  margin: 1rem 0 1.25rem 1.5rem;
}
.post-content li { margin-bottom: 0.5rem; }
.post-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  background: var(--bg-card);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-muted);
  font-style: italic;
}
.post-content code {
  background: var(--bg-card);
  padding: 0.2em 0.5em;
  border-radius: 4px;
  font-size: 0.9em;
}
.post-content pre {
  background: var(--bg-card);
  padding: 1.25rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--border);
}
.post-content pre code { background: none; padding: 0; }
.post-content strong { color: var(--text); }

/* ===== POST CTA ===== */
.post-cta {
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 2rem;
  margin: 3rem 0 2rem;
  text-align: center;
}
.post-cta h3 { margin: 0 0 0.5rem; }
.post-cta p { color: var(--text-muted); margin-bottom: 1.25rem; }
.cta-buttons { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.back-link {
  display: inline-block;
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 1rem;
}
.back-link:hover { color: var(--accent-light); }

/* ===== PAGE ===== */
.page { max-width: var(--content-width); margin: 0 auto; padding: 3rem 1.5rem 4rem; }
.page h1 { margin-bottom: 2rem; }
.page-content p { margin-bottom: 1.25rem; }
.page-content h2 { margin-top: 2.5rem; margin-bottom: 1rem; }
.page-content ul { margin: 1rem 0 1.25rem 1.5rem; }
.page-content li { margin-bottom: 0.5rem; }

/* ===== BLOG INDEX ===== */
.blog-index { max-width: var(--max-width); margin: 0 auto; padding: 3rem 1.5rem 4rem; }
.blog-index h1 { margin-bottom: 0.5rem; }
.blog-index > p { color: var(--text-muted); margin-bottom: 2rem; }

/* ===== FOOTER ===== */
.footer {
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 1.5rem 2rem;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
}
.footer-logo {
  font-size: 1.15rem;
  font-weight: 700;
}
.footer-brand p { color: var(--text-muted); margin-top: 0.5rem; font-size: 0.95rem; }
.footer-links h4 { font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 0.75rem; }
.footer-links a { display: block; color: var(--text-muted); font-size: 0.95rem; margin-bottom: 0.5rem; }
.footer-links a:hover { color: var(--text); }
.footer-bottom {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ===== MOBILE ===== */
@media (max-width: 768px) {
  body { font-size: 16px; }
  .hero h1 { font-size: 2rem; }
  .hero { padding: 3rem 1.5rem 2rem; }
  h1 { font-size: 1.8rem; }
  .post-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 1.5rem; }

  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 1rem 1.5rem;
    gap: 0.75rem;
  }
  .nav-inner.open .nav-links { display: flex; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 1.7rem; }
  .hero-buttons { flex-direction: column; align-items: center; }
  .cta-buttons { flex-direction: column; align-items: center; }
}
