:root {
    --bg: #f8f7f4;
    --white: #ffffff;
    --ink: #0f0e0c;
    --ink2: #3a3834;
    --muted: #8c8880;
    --border: #e4e2dc;
    --accent: #1a6bff;
    --accent-light: #eff4ff;
    --accent-dark: #1258d4;
    --green: #00a878;
    --green-light: #edfaf5;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.10), 0 4px 12px rgba(0,0,0,0.05);
    --r: 12px;
    --r-lg: 20px;
}

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

body {
    background: var(--bg);
    color: var(--ink);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

footer { margin-top: auto; }

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

/* ─── BG GLOW ─── */
.bg-glow {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none; z-index: 0; overflow: hidden;
}
.bg-glow::before {
    content: '';
    position: absolute; top: -200px; right: -200px;
    width: 700px; height: 700px; border-radius: 50%;
    background: radial-gradient(circle, rgba(26,107,255,0.07) 0%, transparent 65%);
}
.bg-glow::after {
    content: '';
    position: absolute; bottom: -150px; left: -150px;
    width: 500px; height: 500px; border-radius: 50%;
    background: radial-gradient(circle, rgba(245,200,66,0.06) 0%, transparent 65%);
}

/* ─── NAV ─── */
nav {
    position: sticky; top: 0; z-index: 100;
    background: rgba(248,247,244,0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
}
.nav-inner {
    max-width: 1100px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
    font-size: 1.15rem; font-weight: 800;
    letter-spacing: -0.02em; color: var(--ink);
    display: flex; align-items: center; gap: 0.4rem;
}
.nav-cta {
    display: flex; align-items: center; gap: 0.75rem;
}
.btn {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.6rem 1.25rem; border-radius: 10px;
    font-size: 0.88rem; font-weight: 700; cursor: pointer;
    transition: all 0.15s; border: none;
    font-family: 'Plus Jakarta Sans', sans-serif;
}
.btn-ghost { background: transparent; color: var(--ink2); border: 1.5px solid var(--border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(26,107,255,0.3); }

/* ─── BLOG SHELL ─── */
.blog-wrap {
    position: relative; z-index: 1;
    max-width: 1100px;
    margin: 0 auto;
    padding: 4.5rem 2rem 6rem;
}

/* ─── BLOG HEADER ─── */
.blog-header {
    margin-bottom: 3rem;
}
.blog-eyebrow {
    display: inline-block;
    font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em;
    text-transform: uppercase; color: var(--accent);
    margin-bottom: 0.75rem;
}
.blog-header h1 {
    font-size: clamp(2rem, 5vw, 2.75rem);
    font-weight: 800; letter-spacing: -0.03em; line-height: 1.1;
    margin-bottom: 0.6rem;
}
.blog-header p {
    font-size: 1rem; color: var(--ink2); line-height: 1.7;
}

/* ─── SHARED CARD TOKENS ─── */
.blog-tag {
    display: inline-block;
    font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em;
    text-transform: uppercase; color: var(--accent);
    background: var(--accent-light);
    padding: 0.25rem 0.7rem; border-radius: 999px;
    margin-bottom: 0.85rem;
}
.blog-meta {
    display: flex; align-items: center; gap: 0.6rem;
    font-size: 0.78rem; color: var(--muted); font-weight: 600;
}
.blog-meta-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--border); }
.blog-read-more {
    display: inline-flex; align-items: center; gap: 0.4rem;
    font-size: 0.85rem; font-weight: 700; color: var(--accent);
}
.blog-read-more svg { transition: transform 0.15s; }
.blog-card:hover .blog-read-more svg { transform: translateX(3px); }

/* ─── CARD (used for all posts including featured) ─── */
.blog-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
    display: flex; flex-direction: column;
    text-decoration: none;
    transition: box-shadow 0.2s, transform 0.2s;
}
.blog-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}
.blog-card-body {
    padding: 1.5rem;
    display: flex; flex-direction: column; flex: 1;
}
.blog-card-body h2 {
    font-size: 1rem; font-weight: 800;
    letter-spacing: -0.01em; line-height: 1.35;
    color: var(--ink); margin-bottom: 0.5rem;
}
.blog-card-body p {
    font-size: 0.875rem; color: var(--ink2);
    line-height: 1.7; margin-bottom: 1.25rem; flex: 1;
}
.blog-card-footer {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: auto;
}

/* ─── CARD GRID ─── */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 1.5rem;
}

/* ─── EMPTY STATE ─── */
.blog-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 5rem 2rem;
    color: var(--muted);
}
.blog-empty-icon { font-size: 2.5rem; margin-bottom: 1rem; opacity: 0.5; }
.blog-empty h2 { font-size: 1.1rem; font-weight: 700; color: var(--ink2); margin-bottom: 0.4rem; }
.blog-empty p { font-size: 0.9rem; }

/* ─── POST HERO ─── */
.post-hero {
    position: relative; z-index: 1;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 4rem 2rem 3rem;
    text-align: center;
}
.post-back {
    display: inline-flex; align-items: center; gap: 0.4rem;
    font-size: 0.82rem; font-weight: 700; color: var(--muted);
    margin-bottom: 2rem;
    transition: color 0.15s;
}
.post-back:hover { color: var(--accent); }
.post-back svg { transition: transform 0.15s; }
.post-back:hover svg { transform: translateX(-3px); }
.post-hero-inner {
    max-width: 720px;
    margin: 0 auto;
}
.post-hero-emoji {
    font-size: 3.5rem;
    line-height: 1;
    margin-bottom: 1.5rem;
    display: block;
}
.post-hero h1 {
    font-size: clamp(1.75rem, 4.5vw, 2.5rem);
    font-weight: 800; letter-spacing: -0.03em; line-height: 1.15;
    color: var(--ink); margin-bottom: 1.25rem;
}
.post-hero-meta {
    display: flex; align-items: center; justify-content: center;
    gap: 0.6rem; flex-wrap: wrap;
    font-size: 0.8rem; color: var(--muted); font-weight: 600;
}

/* ─── POST BODY ─── */
.post-body {
    position: relative; z-index: 1;
    max-width: 720px;
    margin: 0 auto;
    padding: 3.5rem 2rem 6rem;
}
.post-body h2 {
    font-size: 1.3rem; font-weight: 800;
    letter-spacing: -0.02em; line-height: 1.3;
    color: var(--ink);
    margin-top: 2.5rem; margin-bottom: 0.75rem;
    display: flex; align-items: center; gap: 0.6rem;
}
.post-body h2::before {
    content: '';
    display: inline-block; width: 3px; height: 1.1em;
    background: var(--accent); border-radius: 2px; flex-shrink: 0;
}
.post-body h3 {
    font-size: 1.05rem; font-weight: 800;
    letter-spacing: -0.01em; color: var(--ink);
    margin-top: 1.75rem; margin-bottom: 0.5rem;
}
.post-body p {
    font-size: 1rem; color: var(--ink2);
    line-height: 1.85; margin-bottom: 1.25rem;
}
.post-body ul, .post-body ol {
    padding-left: 1.5rem; margin-bottom: 1.25rem;
}
.post-body li {
    font-size: 1rem; color: var(--ink2);
    line-height: 1.8; margin-bottom: 0.4rem;
}
.post-body a {
    color: var(--accent); font-weight: 600;
    text-decoration: underline; text-underline-offset: 3px;
    text-decoration-color: rgba(26,107,255,0.3);
    transition: text-decoration-color 0.15s;
}
.post-body a:hover { text-decoration-color: var(--accent); }
.post-body blockquote {
    border-left: 3px solid var(--accent);
    margin: 1.75rem 0; padding: 0.75rem 1.5rem;
    background: var(--accent-light); border-radius: 0 var(--r) var(--r) 0;
}
.post-body blockquote p {
    font-style: italic; color: var(--accent-dark);
    margin-bottom: 0;
}
.post-body code {
    font-family: 'Fira Code', 'Cascadia Code', monospace;
    font-size: 0.85em; background: var(--border);
    padding: 0.15em 0.4em; border-radius: 5px; color: var(--ink);
}
.post-body pre {
    background: var(--ink); border-radius: var(--r);
    padding: 1.5rem; overflow-x: auto; margin-bottom: 1.5rem;
}
.post-body pre code {
    background: none; color: #e2e8f0; font-size: 0.875rem; padding: 0;
}
.post-body hr {
    border: none; border-top: 1px solid var(--border);
    margin: 2.5rem 0;
}
.post-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--r);
    display: block;
    margin: 1.75rem auto;
}
.post-footer-cta {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 1rem;
    padding-top: 2.5rem;
    margin-top: 2.5rem;
    border-top: 1px solid var(--border);
}
.post-footer-cta p {
    font-size: 0.88rem; color: var(--muted);
    margin-bottom: 0;
}
.post-footer-cta a {
    display: inline-flex; align-items: center; gap: 0.4rem;
    font-size: 0.88rem; font-weight: 700; color: var(--accent);
    text-decoration: none;
    transition: gap 0.15s;
}
.post-footer-cta a:hover { gap: 0.65rem; }

/* ─── FOOTER ─── */
footer {
    position: relative; z-index: 1;
    background: var(--ink);
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 2rem;
}
.footer-inner {
    max-width: 1100px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 1rem;
}
.footer-logo { font-size: 1rem; font-weight: 800; color: rgba(255,255,255,0.8); display: flex; align-items: center; gap: 0.4rem; }
.footer-links { display: flex; gap: 1.5rem; list-style: none; }
.footer-links a { font-size: 0.8rem; color: rgba(255,255,255,0.4); transition: color 0.2s; }
.footer-links a:hover { color: rgba(255,255,255,0.8); }
.footer-copy { font-size: 0.75rem; color: rgba(255,255,255,0.3); }

/* ─── ANIMATIONS ─── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.6s ease both; }

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
    .btn-ghost { display: none; }
    .blog-wrap { padding: 3rem 1.25rem 4rem; }
    .post-hero { padding: 3rem 1.25rem 2rem; }
    .post-body { padding: 2.5rem 1.25rem 4rem; }
    .post-footer-cta { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 500px) {
    .footer-inner { flex-direction: column; align-items: flex-start; }
    .blog-grid { grid-template-columns: 1fr; }
}
