/* ===== Base ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #0a0a0f;
  --surface: #12121a;
  --surface2: #1a1a26;
  --border: #2a2a3a;
  --text: #e4e4ed;
  --text-dim: #8888a0;
  --primary: #6366f1;
  --primary-glow: rgba(99,102,241,0.3);
  --accent: #a78bfa;
  --gradient: linear-gradient(135deg, #6366f1, #a78bfa, #f472b6);
  --radius: 12px;
}
html { scroll-behavior: smooth; }
body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; }
a { color: inherit; text-decoration: none; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ===== Header ===== */
.site-header { position: fixed; top: 0; left: 0; right: 0; z-index: 100; background: rgba(10,10,15,0.85); backdrop-filter: blur(20px); border-bottom: 1px solid var(--border); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 70px; }
.logo { font-size: 1.5rem; font-weight: 800; font-family: 'Playfair Display', serif; }
.logo span { background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.nav-links { list-style: none; display: flex; gap: 32px; }
.nav-links a { font-size: 0.9rem; font-weight: 500; color: var(--text-dim); 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: 24px; height: 2px; background: var(--text); margin: 5px 0; transition: 0.3s; }

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-links { display: none; position: absolute; top: 70px; left: 0; right: 0; background: var(--surface); flex-direction: column; padding: 20px 24px; gap: 16px; border-bottom: 1px solid var(--border); }
  .nav-links.open { display: flex; }
}

/* ===== Hero ===== */
.hero { padding: 160px 0 80px; text-align: center; position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 600px; height: 600px; background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%); pointer-events: none; }
.hero-content { position: relative; }
.hero-tag { display: inline-block; font-size: 0.85rem; font-weight: 600; color: var(--primary); background: rgba(99,102,241,0.1); border: 1px solid rgba(99,102,241,0.2); padding: 6px 16px; border-radius: 50px; margin-bottom: 24px; text-transform: uppercase; letter-spacing: 1px; }
.hero h1 { font-family: 'Playfair Display', serif; font-size: clamp(2.5rem, 6vw, 4.5rem); font-weight: 800; line-height: 1.1; margin-bottom: 20px; }
.gradient-text { background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero-desc { font-size: 1.15rem; color: var(--text-dim); max-width: 600px; margin: 0 auto 36px; }
.hero-search { display: flex; max-width: 500px; margin: 0 auto; gap: 8px; }
.hero-search input { flex: 1; padding: 14px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font-size: 1rem; outline: none; transition: border-color 0.2s; }
.hero-search input:focus { border-color: var(--primary); }
.hero-search button { padding: 14px 28px; background: var(--primary); color: #fff; border: none; border-radius: var(--radius); font-weight: 600; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; }
.hero-search button:hover { transform: translateY(-1px); box-shadow: 0 4px 20px var(--primary-glow); }

/* ===== Categories ===== */
.categories-bar { padding: 20px 0; border-bottom: 1px solid var(--border); position: sticky; top: 70px; z-index: 50; background: rgba(10,10,15,0.9); backdrop-filter: blur(12px); }
.categories { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.categories::-webkit-scrollbar { height: 0; }
.cat-btn { padding: 8px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 50px; color: var(--text-dim); font-size: 0.85rem; font-weight: 500; cursor: pointer; white-space: nowrap; transition: all 0.2s; }
.cat-btn:hover { border-color: var(--primary); color: var(--text); }
.cat-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ===== Posts Grid ===== */
.posts-section { padding: 60px 0; }
.posts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 28px; }
@media (max-width: 768px) { .posts-grid { grid-template-columns: 1fr; } }

.post-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s; display: flex; flex-direction: column; }
.post-card:hover { transform: translateY(-4px); border-color: var(--primary); box-shadow: 0 12px 40px rgba(0,0,0,0.4); }
.post-card-img { height: 200px; background-size: cover; background-position: center; background-color: var(--surface2); display: flex; align-items: center; justify-content: center; }
.no-img { font-size: 2rem; font-weight: 800; color: var(--text-dim); opacity: 0.3; font-family: 'Playfair Display', serif; }
.post-card-body { padding: 24px; flex: 1; display: flex; flex-direction: column; }
.post-card-cat { font-size: 0.75rem; font-weight: 600; color: var(--primary); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.post-card-body h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 8px; line-height: 1.3; }
.post-card-body p { font-size: 0.9rem; color: var(--text-dim); flex: 1; margin-bottom: 16px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-card-meta { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--text-dim); border-top: 1px solid var(--border); padding-top: 12px; }

/* ===== Loading & Pagination ===== */
.loading { display: flex; justify-content: center; padding: 60px; }
.spinner { width: 40px; height: 40px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.no-posts { text-align: center; padding: 80px 20px; }
.no-posts h3 { font-size: 1.5rem; margin-bottom: 8px; }
.no-posts p { color: var(--text-dim); }
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 40px; }
.pagination button { padding: 8px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; color: var(--text); cursor: pointer; font-size: 0.9rem; transition: all 0.2s; }
.pagination button:hover, .pagination button.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ===== Newsletter ===== */
.newsletter { padding: 80px 0; }
.newsletter-card { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 60px 40px; text-align: center; position: relative; overflow: hidden; }
.newsletter-card::before { content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; background: radial-gradient(circle at center, rgba(99,102,241,0.05) 0%, transparent 50%); }
.newsletter-content { position: relative; }
.newsletter h2 { font-family: 'Playfair Display', serif; font-size: 2rem; margin-bottom: 12px; }
.newsletter p { color: var(--text-dim); max-width: 500px; margin: 0 auto 28px; }
.subscribe-form { display: flex; max-width: 440px; margin: 0 auto; gap: 8px; }
.subscribe-form input { flex: 1; padding: 14px 20px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font-size: 1rem; outline: none; }
.subscribe-form input:focus { border-color: var(--primary); }
.subscribe-form button { padding: 14px 28px; background: var(--gradient); color: #fff; border: none; border-radius: var(--radius); font-weight: 600; cursor: pointer; transition: transform 0.2s; }
.subscribe-form button:hover { transform: translateY(-1px); }
.sub-msg { margin-top: 12px; font-size: 0.9rem; }
.sub-msg.success { color: #34d399; }
.sub-msg.error { color: #f87171; }

@media (max-width: 520px) { .subscribe-form { flex-direction: column; } }

/* ===== Post Page ===== */
.post-page { padding: 100px 0 60px; max-width: 800px; margin: 0 auto; }
.post-cover { width: 100%; max-height: 400px; object-fit: cover; border-radius: var(--radius); margin-bottom: 24px; }
.post-meta-top { display: flex; gap: 16px; font-size: 0.85rem; color: var(--text-dim); margin-bottom: 12px; flex-wrap: wrap; }
.post-cat { color: var(--primary); font-weight: 600; text-transform: uppercase; }
.post-page h1 { font-family: 'Playfair Display', serif; font-size: clamp(1.8rem, 4vw, 2.8rem); line-height: 1.2; margin-bottom: 16px; }
.post-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 32px; }
.tag { font-size: 0.8rem; padding: 4px 12px; background: var(--surface2); border: 1px solid var(--border); border-radius: 50px; color: var(--text-dim); }
.post-body { font-size: 1.05rem; line-height: 1.8; color: var(--text); }
.post-body h2, .post-body h3 { margin: 32px 0 12px; font-family: 'Playfair Display', serif; }
.post-body p { margin-bottom: 16px; }
.post-body img { max-width: 100%; border-radius: 8px; margin: 20px 0; }
.post-body blockquote { border-left: 4px solid var(--primary); padding: 12px 20px; margin: 20px 0; background: var(--surface); border-radius: 0 8px 8px 0; color: var(--text-dim); }
.post-body pre { background: var(--surface); padding: 20px; border-radius: 8px; overflow-x: auto; margin: 20px 0; }
.post-body code { font-family: 'Courier New', monospace; font-size: 0.9em; }
.post-body table { width: 100%; border-collapse: collapse; margin: 20px 0; }
.post-body th, .post-body td { border: 1px solid var(--border); padding: 10px 14px; text-align: left; }
.post-body th { background: var(--surface); font-weight: 600; }

/* ===== Footer ===== */
.site-footer { border-top: 1px solid var(--border); padding: 60px 0 30px; }
.footer-content { display: flex; justify-content: space-between; gap: 40px; margin-bottom: 40px; }
.footer-brand p { color: var(--text-dim); margin-top: 8px; max-width: 300px; font-size: 0.9rem; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links h4 { margin-bottom: 8px; font-weight: 600; }
.footer-links a { color: var(--text-dim); font-size: 0.9rem; transition: color 0.2s; }
.footer-links a:hover { color: var(--text); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 20px; text-align: center; color: var(--text-dim); font-size: 0.85rem; }

@media (max-width: 600px) { .footer-content { flex-direction: column; gap: 24px; } }
