@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&family=Space+Grotesk:wght@300;400;500;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --bg-main: #0a0a0c;
    --bg-card: #151518;
    --accent: #6366f1;
    /* Indigo */
    --accent-glow: rgba(99, 102, 241, 0.3);
    --text-primary: #f4f4f5;
    --text-secondary: #a1a1aa;
    --border: rgba(255, 255, 255, 0.08);
    --glass: rgba(255, 255, 255, 0.03);
    --radius: 16px;
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Outfit', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Background Gradients */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(139, 92, 246, 0.05) 0%, transparent 40%);
    pointer-events: none;
    z-index: -1;
}

/* Sidebar Navigation */
aside#sidebar {
    width: 280px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background: var(--glass);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border);
    padding: 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Premium Scrollbar for Sidebar */
aside#sidebar::-webkit-scrollbar {
    width: 8px;
}

aside#sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
    margin: 10px 0;
}

aside#sidebar::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.4) 0%, rgba(129, 140, 248, 0.6) 100%);
    border-radius: 10px;
    border: 2px solid rgba(15, 23, 42, 0.3);
}

aside#sidebar::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.6) 0%, rgba(129, 140, 248, 0.8) 100%);
    border-color: rgba(99, 102, 241, 0.2);
}

/* Firefox scrollbar */
aside#sidebar {
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 102, 241, 0.5) rgba(255, 255, 255, 0.02);
}

.site-brand {
    margin-bottom: 3rem;
}

.site-brand .avatar {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    margin-bottom: 1rem;
    border: 2px solid var(--border);
    padding: 2px;
}

.site-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 0%, #a1a1aa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-menu {
    flex-grow: 0;
}

.nav-menu ul {
    list-style: none;
}

.nav-menu li {
    margin-bottom: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.nav-link:hover,
.nav-link.active {
    background: var(--glass);
    color: #fff;
    transform: translateX(5px);
}

/* Main Content Area */
main#content {
    margin-left: 280px;
    padding: 4rem;
    min-height: 100vh;
}

.content-inner {
    max-width: 1100px;
    margin: 0 auto;
}

/* Post Cards */
.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 2rem;
}

.post-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 20px var(--accent-glow);
}

.post-card-image {
    height: 200px;
    overflow: hidden;
    position: relative;
}

.post-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.post-card:hover .post-card-image img {
    transform: scale(1.1);
}

.post-card-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.post-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.post-title-link {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: #fff;
}

.post-excerpt {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-footer {
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Single Post Specifics */
.single-post-container {
    max-width: 800px;
    margin: 0 auto;
}

.post-hero {
    margin-bottom: 3rem;
    text-align: center;
}

.post-head-title {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.post-hero-image {
    width: 100%;
    height: 450px;
    border-radius: 24px;
    object-fit: cover;
    margin-bottom: 3rem;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}

.meta-row {
    display: flex;
    justify-content: center;
    gap: 2rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 1rem;
}

/* Article Content Styling */
.article-body {
    font-size: 1.15rem;
    line-height: 1.8;
}

.article-body p {
    margin-bottom: 2rem;
}

.article-body h2,
.article-body h3 {
    font-family: var(--font-heading);
    margin: 3rem 0 1.5rem;
    color: #fff;
}

.article-body h2 {
    font-size: 2rem;
}

/* Code Blocks refined */
pre {
    background: #0d0d0f;
    border: 1px solid var(--border);
    padding: 2rem;
    border-radius: 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.95rem;
    margin: 2.5rem 0;
    overflow-x: auto;
    position: relative;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.3);
}

pre::before {
    content: 'CODE';
    position: absolute;
    top: 0;
    right: 2rem;
    background: var(--accent);
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 0 0 6px 6px;
    font-weight: 700;
    opacity: 0.5;
}

code {
    background: var(--glass);
    padding: 0.2rem 0.4rem;
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent);
}

/* Progress Bar */
#progress-bar {
    position: fixed;
    top: 0;
    left: 280px;
    height: 4px;
    background: linear-gradient(to right, var(--accent), #8b5cf6);
    z-index: 1000;
    width: 0%;
    transition: width 0.1s ease;
}

/* Responsive and Micro-interactions */
@media (max-width: 1024px) {
    aside#sidebar {
        width: 80px;
        padding: 2rem 0.5rem;
    }

    .site-title,
    .site-description,
    .nav-link span {
        display: none;
    }

    main#content {
        margin-left: 80px;
        padding: 2rem;
    }

    #progress-bar {
        left: 80px;
    }
}

@media (max-width: 768px) {
    aside#sidebar {
        display: none;
    }

    main#content {
        margin-left: 0;
    }

    #progress-bar {
        left: 0;
    }

    .post-head-title {
        font-size: 2.5rem;
    }
}