:root {
    --bg-color: #0a0a0f;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-main: #f0f0f5;
    --text-muted: #9ba1a6;
    --primary: #6366f1;
    --primary-hover: #4f46e5;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
}

/* Navbar */
.blog-nav {
    border-bottom: 1px solid var(--card-border);
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: white;
}

.nav-brand .nav-logo {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    margin-right: 12px;
}

.nav-brand .nav-title {
    font-weight: 700;
    font-size: 1.25rem;
}

.gradient-text {
    background: linear-gradient(135deg, #a855f7 0%, #6366f1 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.btn-ghost {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s;
}

.btn-ghost:hover {
    color: white;
    background: var(--card-bg);
}

/* Layout */
.blog-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 60px 24px;
}

.blog-header {
    text-align: center;
    margin-bottom: 60px;
}

.blog-header h1 {
    font-size: 2.5rem;
    margin-bottom: 16px;
    color: white;
}

.blog-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Grid */
.blog-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
}

/* Cards */
.post-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.2s;
}

.post-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.15);
}

.post-image {
    width: 100%;
    height: 240px;
    object-fit: cover;
}

.post-content {
    padding: 24px;
}

.post-category {
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.post-content h2 {
    margin: 8px 0 16px 0;
    font-size: 1.5rem;
    line-height: 1.3;
}

.post-content h2 a {
    color: white;
    text-decoration: none;
}

.post-content h2 a:hover {
    color: var(--primary);
}

.post-excerpt {
    color: var(--text-muted);
    margin-bottom: 24px;
}

.post-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Footer */
.blog-footer {
    border-top: 1px solid var(--card-border);
    padding: 40px 24px;
    text-align: center;
    color: var(--text-muted);
}

/* Bài viết chi tiết (Post template) */
.post-article {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 40px;
}

.post-article h1 {
    font-size: 2rem;
    margin-top: 0;
}

.post-article img {
    max-width: 100%;
    border-radius: 8px;
    margin: 24px 0;
}

.post-article p {
    margin-bottom: 1.5em;
}

.post-back-link {
    display: inline-block;
    margin-bottom: 24px;
    color: var(--text-muted);
    text-decoration: none;
}

.post-back-link:hover {
    color: white;
}

/* ---- Nebula Background & Blobs ---- */
.nebula-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    z-index: -1;
    background: #020205;
}

.nebula-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(124, 58, 237, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(67, 56, 202, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.05) 0%, transparent 60%);
    filter: blur(60px);
    animation: nebulaFloat 30s infinite alternate ease-in-out;
    z-index: 1;
}

@keyframes nebulaFloat {
    0% {
        transform: scale(1) translate(0, 0);
    }

    100% {
        transform: scale(1.1) translate(20px, 10px);
    }
}

.starfield {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: transparent;
}

.starfield::before,
.starfield::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 2px;
    background: #fff;
    border-radius: 50%;
    opacity: 0.5;
}

.starfield::before {
    box-shadow: 10vw 20vh #fff, 30vw 15vh #fff, 50vw 40vh #fff, 70vw 60vh #fff, 90vw 25vh #fff, 15vw 80vh #fff, 40vw 90vh #fff, 65vw 10vh #fff, 85vw 55vh #fff, 5vw 45vh #fff, 25vw 35vh #fff, 45vw 75vh #fff, 75vw 15vh #fff, 95vw 85vh #fff, 12vw 12vh #fff, 88vw 92vh #fff, 33vw 66vh #fff, 66vw 33vh #fff, 44vw 44vh #fff, 22vw 22vh #fff;
    animation: twinkle 4s infinite alternate;
}

.starfield::after {
    width: 1px;
    height: 1px;
    box-shadow: 5vw 10vh #fff, 25vw 30vh #fff, 45vw 20vh #fff, 65vw 50vh #fff, 85vw 70vh #fff, 10vw 85vh #fff, 35vw 95vh #fff, 60vw 5vh #fff, 80vw 40vh #fff, 0vw 55vh #fff, 20vw 15vh #fff, 40vw 65vh #fff, 70vw 90vh #fff, 90vw 10vh #fff, 55vw 55vh #fff, 18vw 48vh #fff, 72vw 28vh #fff, 38vw 78vh #fff, 82vw 18vh #fff, 11vw 81vh #fff;
    animation: twinkle 6s infinite alternate-reverse;
}

@keyframes twinkle {
    0% {
        opacity: 0.3;
        transform: scale(0.8);
    }

    100% {
        opacity: 0.8;
        transform: scale(1.2);
    }
}

.grid-overlay {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-image:
        linear-gradient(rgba(139, 92, 246, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(139, 92, 246, 0.03) 1px, transparent 1px);
    background-size: 80px 80px;
    transform: perspective(1000px) rotateX(75deg);
    animation: gridMove 100s linear infinite;
    z-index: 2;
}

@keyframes gridMove {
    0% {
        transform: perspective(1000px) rotateX(75deg) translateY(0);
    }

    100% {
        transform: perspective(1000px) rotateX(75deg) translateY(80px);
    }
}

.shooting-stars {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
}

.shooting-stars::before {
    content: '';
    position: absolute;
    top: -50px;
    left: 50%;
    width: 150px;
    height: 1px;
    background: linear-gradient(90deg, #fff, transparent);
    transform: rotate(135deg);
    animation: shootingStar 12s infinite ease-in;
    filter: drop-shadow(0 0 5px #fff);
}

@keyframes shootingStar {
    0% {
        transform: translateX(0) translateY(0) rotate(135deg);
        opacity: 1;
    }

    10% {
        transform: translateX(-500px) translateY(500px) rotate(135deg);
        opacity: 0;
    }

    100% {
        transform: translateX(-500px) translateY(500px) rotate(135deg);
        opacity: 0;
    }
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.3;
    animation: moveBlob 20s infinite alternate ease-in-out;
    z-index: 1;
}

.blob-1 {
    width: 600px;
    height: 600px;
    background: rgba(139, 92, 246, 0.15);
    top: -100px;
    left: -100px;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: rgba(99, 102, 241, 0.12);
    bottom: -50px;
    right: -50px;
    animation-delay: -5s;
}

.blob-3 {
    width: 400px;
    height: 400px;
    background: rgba(236, 72, 153, 0.08);
    top: 40%;
    left: 60%;
    animation-duration: 25s;
    animation-delay: -10s;
}

@keyframes moveBlob {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(100px, 50px) scale(1.1);
    }
}