:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #ec4899;
    --accent: #8b5cf6;
    --bg: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --nav-bg: rgba(15, 23, 42, 0.8);
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Background Gradients */
.bg-blob {
    position: fixed;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
    filter: blur(100px);
    opacity: 0.15;
    z-index: -1;
    animation: move 20s infinite alternate;
}

@keyframes move {
    from { transform: translate(-20%, -20%); }
    to { transform: translate(120%, 120%); }
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 5%;
}

.nav-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 12px;
}

.logo-img {
    height: 100px;
    width: 100px;
    object-fit: contain;
    border-radius: 12px;
}

.logo-text {
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

nav {
    display: flex;
    gap: 24px;
}

nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

nav a:hover, nav a.active {
    color: var(--text);
    text-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

/* Menu Toggle (Desktop Hidden) */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1001;
}

.menu-toggle span {
    width: 100%;
    height: 3px;
    background: var(--text);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}
.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Main Content */
main {
    padding-top: 160px;
    padding-bottom: 100px;
    min-height: 100vh;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
}

.hero {
    text-align: center;
    margin-bottom: 60px;
    animation: fadeInUp 1s ease;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    background: linear-gradient(to bottom, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    color: var(--text-muted);
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Cards Grid */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

.article-card {
    background: var(--card-bg);
    backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 30px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.article-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: var(--primary);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.card-category {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 12px;
    letter-spacing: 1px;
}

.card-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: #fff;
}

.card-excerpt {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 20px;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--glass-border);
    padding-top: 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Modal / Article Viewer */
.modal {
    position: fixed;
    top: 120px;
    bottom: 70px;
    left: 0;
    width: 100%;
    height: auto;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    z-index: 900;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow-y: auto;
}

.modal.active {
    display: block;
    opacity: 1;
}

.modal-content {
    max-width: 1200px;
    width: 90%;
    margin: 40px auto;
    padding: 40px;
    background: var(--card-bg);
    border-radius: 30px;
    border: 1px solid var(--glass-border);
    position: relative;
}

.close-modal {
    position: absolute;
    top: 40px;
    right: 40px;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 2.5rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 901;
}

.close-modal:hover {
    color: var(--secondary);
    transform: scale(1.1) rotate(90deg);
}

/* Footer */
footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    padding: 10px 20px;
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    color: var(--text-muted);
    border-top: 1px solid var(--glass-border);
    font-size: 0.9rem;
    height: 70px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    z-index: 1000;
}

.footer-primary {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

.footer-secondary {
    margin: 4px 0 0 0;
    font-size: 0.8rem;
    line-height: 1.4;
    opacity: 0.8;
}

/* Markdown Styling */
.markdown-body h1:first-child {
    margin-top: 0;
    padding-right: 50px;
    font-size: 2.5rem;
}

.markdown-body h1, .markdown-body h2, .markdown-body h3 {
    margin-top: 24px;
    margin-bottom: 16px;
    font-weight: 700;
}

.markdown-body p {
    margin-bottom: 16px;
}

.markdown-body pre {
    background: rgba(0,0,0,0.3);
    padding: 16px;
    border-radius: 12px;
    overflow-x: auto;
    margin-bottom: 16px;
}

.markdown-body code {
    font-family: 'Fira Code', monospace;
    color: var(--secondary);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    header {
        height: 80px;
        padding: 0 20px;
    }
    .nav-container {
        flex-direction: row;
        gap: 0;
    }
    .logo-img {
        height: 40px;
        width: 40px;
    }
    .logo-text {
        font-size: 1.5rem;
    }
    .menu-toggle {
        display: flex;
    }
    nav {
        position: fixed;
        top: 80px;
        left: 0;
        right: 0;
        background: var(--nav-bg);
        backdrop-filter: blur(20px);
        flex-direction: column;
        align-items: center;
        padding: 20px 0;
        border-bottom: 1px solid var(--glass-border);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    nav.active {
        opacity: 1;
        visibility: visible;
    }
    .hero h1 {
        font-size: 2.5rem;
    }
    .modal {
        top: 80px;
    }
    footer {
        height: auto;
        padding: 15px 20px;
        gap: 6px;
    }
    .footer-primary {
        font-size: 0.75rem;
    }
    .footer-secondary {
        font-size: 0.65rem;
        margin-top: 0;
    }
}
