:root {
    --primary: #3b82f6;
    --primary-glow: rgba(59, 130, 246, 0.5);
    --bg-dark: #0f172a;
    --bg-card: rgba(255, 255, 255, 0.03);
    --border-card: rgba(255, 255, 255, 0.05);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-blur: blur(12px);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.7;
    color: var(--text-main);
    margin: 0;
    padding: 0;
    background: var(--bg-dark);
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header & Nav */
header {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-card);
    padding: 1.25rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-weight: 900;
    font-size: 1.75rem;
    color: var(--primary);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: -0.05em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #fff;
}

.btn-primary {
    background: var(--primary);
    color: white !important;
    padding: 0.75rem 1.5rem;
    border-radius: 1rem;
    font-weight: 800 !important;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    box-shadow: 0 0 20px var(--primary-glow);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px var(--primary-glow);
    background: #4f46e5;
}

/* Articles Grid */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2.5rem;
    padding: 1rem 0;
}

article {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    /* Changed from var(--border) to var(--border-card) to match existing variables */
    border-radius: 1.5rem;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

article::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 1.5rem;
    padding: 1px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

article:hover {
    transform: translateY(-8px);
    background: var(--bg-card);
    /* Changed from var(--bg-hover) to var(--bg-card) to match existing variables */
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.4);
}

.article-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.6s ease;
}

article:hover .article-image {
    transform: scale(1.05);
}

.article-content {
    padding: 2rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.article-content h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.article-content h3 a {
    text-decoration: none;
    color: inherit;
    background: linear-gradient(to right, var(--text-main), var(--text-main));
    /* Changed from var(--text-primary) to var(--text-main) to match existing variables */
    background-repeat: no-repeat;
    background-size: 0% 2px;
    background-position: 0 100%;
    transition: background-size 0.3s ease;
}

article:hover .article-content h3 a {
    background-size: 100% 2px;
    color: var(--primary);
}

.article-content p {
    color: var(--text-muted);
    /* Changed from var(--text-secondary) to var(--text-muted) to match existing variables */
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.read-more {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: auto;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: gap 0.3s ease;
}

.read-more:hover {
    gap: 0.8rem;
}

/* Individual Post Page Styles */
.post-container {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-card);
    border-radius: 3rem;
    padding: 4rem;
    margin: 4rem 0;
    position: relative;
    overflow: hidden;
}

h1 {
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 2rem;
    line-height: 1;
    color: #fff;
    letter-spacing: -0.04em;
}

h2 {
    font-size: 2.25rem;
    font-weight: 800;
    margin-top: 4rem;
    margin-bottom: 1.5rem;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

h2::before {
    content: '';
    display: block;
    width: 8px;
    height: 2rem;
    background: var(--primary);
    border-radius: 999px;
}

h3 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-top: 3rem;
    color: var(--primary);
}

p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 400;
}

strong {
    color: #fff;
    font-weight: 700;
}

ul,
ol {
    margin-bottom: 2rem;
    padding-left: 1.5rem;
    color: var(--text-muted);
}

li {
    margin-bottom: 0.75rem;
}

.breadcrumbs {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.breadcrumbs a {
    color: var(--primary);
    text-decoration: none;
}

.hero-image {
    width: 100%;
    height: 500px;
    object-fit: cover;
    border-radius: 2rem;
    margin-bottom: 3rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.table-of-contents {
    background: rgba(255, 255, 255, 0.02);
    padding: 2.5rem;
    border-radius: 2rem;
    margin: 3rem 0;
    border: 1px solid var(--border-card);
}

.table-of-contents h2 {
    font-size: 1.5rem;
    margin-top: 0;
    margin-bottom: 1.5rem;
}

.table-of-contents h2::before {
    height: 1.5rem;
}

.table-of-contents ul {
    margin-bottom: 0;
    list-style: none;
    padding-left: 0;
}

.table-of-contents li {
    margin-bottom: 0.75rem;
}

.table-of-contents a {
    text-decoration: none;
    color: var(--text-muted);
    transition: color 0.2s;
    font-weight: 600;
}

.table-of-contents a:hover {
    color: var(--primary);
}

.faq-item {
    margin-bottom: 3rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.01);
    border-radius: 1.5rem;
    border: 1px solid var(--border-card);
}

.faq-item h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: #fff;
}

.keywords-list {
    margin-top: 5rem;
    padding-top: 3rem;
    border-top: 1px solid var(--border-card);
}

footer {
    padding: 6rem 0;
    background: #000;
    color: var(--text-muted);
    text-align: center;
}

footer a {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
}

.btn-cta {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary), #4f46e5);
    color: white !important;
    padding: 1.25rem 2.5rem;
    border-radius: 1.5rem;
    font-weight: 900;
    text-transform: uppercase;
    font-size: 1rem;
    text-decoration: none;
    box-shadow: 0 10px 40px rgba(59, 130, 246, 0.3);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-cta:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 50px rgba(59, 130, 246, 0.4);
}

@media (max-width: 768px) {
    .post-container {
        padding: 2rem;
        margin: 2rem 0;
    }

    h1 {
        font-size: 2.5rem;
    }

    .hero-image {
        height: 300px;
    }
}