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

body { 
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    background: linear-gradient(to bottom, #0a0a0a, #1a1a2e);
    color: #e0e0e0;
    min-height: 100vh;
    padding-top: 60px; /* Space for fixed nav */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Main Navigation */
.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    padding: 0.75rem 0;
}

.main-nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand a {
    font-size: 1.2rem;
    font-weight: 600;
    color: #e0e0e0;
    text-decoration: none;
    transition: color 0.3s ease;
}

.nav-brand a:hover {
    color: #667eea;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    color: #e0e0e0;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #667eea;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: #e0e0e0;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

/* Hero */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
    margin-bottom: 3rem;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.tagline {
    font-size: 1.2rem;
    opacity: 0.95;
    margin-bottom: 2rem;
    font-weight: 300;
}

.quick-nav {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.quick-nav a {
    background: rgba(255,255,255,0.2);
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
}

.quick-nav a:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Categories */
.category {
    margin: 4rem 0;
    padding: 2rem;
    background: rgba(255,255,255,0.03);
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.05);
}

.navigation-inline {
    margin-bottom: 1.5rem;
    padding: 1rem 1.25rem;
    background: rgba(255,255,255,0.04);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.06);
    font-size: 1rem;
    line-height: 1.8;
}

.navigation-inline a {
    color: #7aa5f2;
    text-decoration: none;
    margin: 0 0.35rem;
}

.navigation-inline a:hover {
    text-decoration: underline;
}

.navigation-inline span {
    opacity: 0.5;
}

.category h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.category > p {
    font-size: 1.1rem;
    opacity: 0.8;
    margin-bottom: 2rem;
}

/* Subcategories */
.subcategories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.subcategory {
    background: rgba(102, 126, 234, 0.1);
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
}

.subcategory:hover {
    background: rgba(102, 126, 234, 0.15);
    transform: translateX(5px);
}

.subcategory h3 {
    margin-top: 0;
    color: #9cdf8d;
    font-size: 1.3rem;
}

.subcategory p {
    opacity: 0.8;
    margin-bottom: 1rem;
}

.view-posts {
    color: #7aa5f2;
    text-decoration: none;
    font-weight: 500;
    display: inline-block;
}

.view-posts:hover {
    text-decoration: underline;
}

/* Graph */
.graph-container {
    min-height: 500px;
    background: rgba(255,255,255,0.02);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

#graph-canvas {
    width: 100%;
    height: 500px;
    cursor: pointer;
}

/* Timeline */
.timeline {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.timeline-entry {
    background: rgba(255,255,255,0.05);
    padding: 1rem;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

.timeline-entry:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-2px);
}

.timeline-date {
    font-size: 0.9rem;
    color: #7aa5f2;
    margin-bottom: 0.5rem;
}

.timeline-title {
    font-weight: 500;
    line-height: 1.4;
}

/* Tables / docs */
.table-wrap {
    overflow-x: auto;
    margin-top: 1rem;
}

.table-wrap table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255,255,255,0.03);
    border-radius: 12px;
    overflow: hidden;
}

.table-wrap th,
.table-wrap td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    text-align: left;
    vertical-align: top;
}

.table-wrap th {
    background: rgba(102, 126, 234, 0.18);
    color: #fff;
}

.table-wrap td code,
.subcategory code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    background: rgba(255,255,255,0.08);
    padding: 0.15rem 0.35rem;
    border-radius: 6px;
    word-break: break-word;
}

.checklist {
    margin-left: 1.2rem;
    display: grid;
    gap: 0.8rem;
}

.checklist li {
    padding-left: 0.2rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 3rem 0;
    opacity: 0.7;
    font-size: 0.9rem;
}

footer a {
    color: #7aa5f2;
    text-decoration: none;
    margin: 0 0.5rem;
}

footer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 { font-size: 2rem; }
    .subcategories { grid-template-columns: 1fr; }
    .quick-nav { flex-direction: column; align-items: stretch; }
    .quick-nav a { text-align: center; }
    
    /* Mobile nav */
    .nav-toggle { display: block; }
    
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(10, 10, 10, 0.98);
        padding: 1rem 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .nav-links a {
        padding: 0.75rem 2rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
}

/* New elements */
.stats {
    font-size: 1rem;
    opacity: 0.9;
    margin-top: 1rem;
}

.category-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.view-all {
    color: #7aa5f2;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    display: inline-block;
    transition: all 0.3s ease;
}

.view-all:hover {
    color: #667eea;
    transform: translateX(5px);
}

.reading-hero {
    margin-bottom: 2rem;
}

.reading-internal-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

.reading-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.25rem;
}

.reading-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 1rem 1.1rem;
}

.reading-card h3 {
    margin: 0.4rem 0 0.7rem;
    font-size: 1.05rem;
    line-height: 1.35;
}

.reading-card h3 a {
    color: #eaeaea;
    text-decoration: none;
}

.reading-card h3 a:hover {
    color: #7aa5f2;
}

.reading-card p {
    opacity: 0.82;
    font-size: 0.96rem;
}

.reading-meta {
    color: #aab3d6;
    font-size: 0.86rem;
}

.tag {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    background: rgba(102, 126, 234, 0.18);
    color: #bcd0ff;
    font-size: 0.8rem;
}
