:root {
    /* "Ethereal Aurora" Light Theme v2 */
    --bg-primary: #f3f4f6;
    --bg-secondary: #ffffff;
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    
    /* Brand Colors */
    --accent-primary: #7c3aed; /* Violet 600 */
    --accent-hover: #6d28d9;   /* Violet 700 */
    --accent-light: #ddd6fe;   /* Violet 200 */
    --accent-gradient: linear-gradient(135deg, #7c3aed 0%, #c026d3 100%);
    
    /* UI Elements */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
    
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --card-shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);

    --container-width: 1240px; /* Increased for sidebar comfort */
}

/* --- Base Reset & Typography --- */
*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    line-height: 1.2;
    margin-top: 0;
    font-weight: 800;
    letter-spacing: -0.025em;
}

h1 { font-size: 3rem; margin-bottom: 1rem; }
h2 { font-size: 1.8rem; margin-bottom: 0.75rem; }

p {
    font-family: 'Lora', serif;
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: all 0.2s ease;
}
a:hover { color: var(--accent-hover); }

/* --- Particles & Layout --- */
#tsparticles {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: -1;
    pointer-events: none;
}

.content-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-top: 80px;
}

.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* --- Layout with Sidebar --- */
.main-layout {
    width: 100%;
}

.main-layout.with-sidebar {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 4rem;
    align-items: start;
}

/* --- Sidebar Styling --- */
.site-sidebar {
    position: sticky;
    top: 100px;
    height: calc(100vh - 140px);
    overflow-y: auto;
    padding-right: 1.5rem;
    border-right: 1px solid var(--glass-border);
    scrollbar-width: thin;
    scrollbar-color: var(--accent-light) transparent;
}

.sidebar-group { margin-bottom: 2rem; }
.sidebar-group h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-weight: 800;
    opacity: 0.6;
}
.sidebar-group ul { list-style: none; padding: 0; margin: 0; }
.sidebar-group li { margin-bottom: 0.4rem; }
.sidebar-group a {
    display: block;
    font-size: 0.9rem;
    color: var(--text-primary);
    padding: 6px 10px;
    border-radius: 8px;
    transition: all 0.2s ease;
    line-height: 1.4;
}
.sidebar-group a:hover { background: rgba(124, 58, 237, 0.05); color: var(--accent-primary); }
.sidebar-group a.active {
    background: var(--accent-primary);
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.2);
}

/* --- Glassmorphism Header --- */
.site-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 70px;
    z-index: 1000;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
}

.header-content {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.main-nav { display: flex; gap: 2rem; }
.main-nav a { font-weight: 600; color: var(--text-secondary); font-size: 0.95rem; }
.main-nav a:hover { color: var(--accent-primary); }

/* --- Hero Section (Homepage) --- */
.hero-section {
    padding: 2rem 0 4rem;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 2rem;
    align-items: center;
    min-height: 500px;
}
.hero-text h1 {
    font-size: 4rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.1;
}

.hero-visual { position: relative; width: 100%; height: 450px; }
#nexus-canvas { width: 100%; height: 100%; border-radius: 20px; }

/* Tooltip */
.nexus-tooltip {
    position: absolute;
    top: 50%; left: 50%;
    width: 280px;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 10;
}
.nexus-tooltip.active { opacity: 1; pointer-events: auto; transform: translate(-50%, -60%); }

/* --- Breadcrumbs --- */
.breadcrumbs {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    display: flex;
    gap: 0.5rem;
    opacity: 0.7;
}

/* --- Post Navigation (Next/Prev) --- */
.post-navigation { margin-top: 5rem; padding-top: 2rem; border-top: 1px solid var(--glass-border); }
.nav-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.nav-card {
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    transition: all 0.2s ease;
}
.nav-card:hover { transform: translateY(-3px); box-shadow: var(--card-shadow-hover); }

/* --- Posts Grid --- */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}
.post-card {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
}
.post-card:hover { transform: translateY(-5px); box-shadow: var(--card-shadow-hover); }

/* --- Footer --- */
.site-footer { border-top: 1px solid #e5e7eb; background: white; padding: 3rem 0; margin-top: auto; }
.footer-meta { display: flex; justify-content: space-between; color: #9ca3af; font-size: 0.8rem; }

/* --- Responsive --- */
@media (max-width: 1100px) {
    .main-layout.with-sidebar { grid-template-columns: 1fr; }
    .site-sidebar { display: none; }
    .hero-section { grid-template-columns: 1fr; text-align: center; }
}
@media (max-width: 768px) {
    h1 { font-size: 2.5rem; }
    .hero-text h1 { font-size: 3rem; }
    .nav-grid { grid-template-columns: 1fr; }
}
