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

:root {
    /* Vibrant gradient color scheme */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --accent-gradient: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    
    /* Base colors */
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --tertiary-color: #4facfe;
    --accent-color: #43e97b;
    
    /* Text colors */
    --text-color: #1a202c;
    --text-light: #718096;
    --text-on-gradient: #ffffff;
    
    /* Background colors */
    --bg-color: #ffffff;
    --bg-light: #f7fafc;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    
    /* Border colors */
    --border-color: #e2e8f0;
    
    /* Explanation level colors */
    --level-5-color: #f093fb;
    --level-5-bg: #fef5ff;
    --level-5-border: #f5c6ff;
    
    --level-15-color: #4facfe;
    --level-15-bg: #f0f9ff;
    --level-15-border: #bae6fd;
    
    --level-programmer-color: #43e97b;
    --level-programmer-bg: #f0fdf4;
    --level-programmer-border: #bbf7d0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.7;
    color: var(--text-color);
    background: linear-gradient(to bottom, #f7fafc 0%, #edf2f7 100%);
    min-height: 100vh;
}

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

/* Header */
header {
    background: var(--primary-gradient);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 2rem 0;
    margin-bottom: 3rem;
}

.logo {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--text-on-gradient);
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    letter-spacing: -0.5px;
}

.tagline {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.05rem;
    margin-bottom: 1.25rem;
    font-weight: 400;
}

nav {
    display: flex;
    gap: 2rem;
}

nav a {
    color: rgba(255, 255, 255, 0.95);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
}

nav a:hover {
    color: var(--text-on-gradient);
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Main content */
main {
    min-height: calc(100vh - 200px);
}

.intro {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    padding: 3rem;
    border-radius: 16px;
    margin-bottom: 3rem;
    border: 2px solid var(--border-color);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.intro::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.1) 0%, transparent 70%);
    animation: pulse 15s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-10%, -10%) scale(1.1); }
}

.intro h2 {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-size: 2rem;
    font-weight: 800;
    position: relative;
    z-index: 1;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.intro p {
    color: var(--text-color);
    font-size: 1.15rem;
    line-height: 1.8;
    position: relative;
    z-index: 1;
}

/* Articles list */
.articles h2 {
    margin-bottom: 2rem;
    color: var(--text-color);
    font-size: 1.75rem;
    font-weight: 700;
}

.article-card {
    background: var(--bg-color);
    padding: 2rem;
    margin-bottom: 1.5rem;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(102, 126, 234, 0.15);
    border-color: var(--primary-color);
}

.article-card h3 {
    margin-bottom: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.article-card h3 a {
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.article-card h3 a:hover {
    opacity: 0.8;
}

.article-meta {
    color: var(--text-light);
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.article-card p {
    color: var(--text-light);
    line-height: 1.6;
}

.article-keywords {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.keyword {
    background: var(--primary-gradient);
    color: var(--text-on-gradient);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    border: none;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
    transition: all 0.3s ease;
}

.keyword:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

/* Article page */
.article-content {
    background: var(--bg-color);
    padding: 3rem;
    border-radius: 16px;
    border: 2px solid var(--border-color);
    margin-bottom: 2rem;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.05);
}

.article-content h1 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    line-height: 1.2;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.article-content h2 {
    font-size: 1.75rem;
    margin-top: 3rem;
    margin-bottom: 1.25rem;
    color: var(--text-color);
    padding-bottom: 0.75rem;
    font-weight: 700;
    position: relative;
}

.article-content h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--primary-gradient);
    border-radius: 2px;
}

/* Explanation level styling */
.article-content h2:has(+ p):first-of-type,
.article-content h2:contains("Explain it like I'm 5") {
    color: var(--level-5-color);
}

.article-content h2:contains("Explain it like I'm 15") {
    color: var(--level-15-color);
}

.article-content h2:contains("Explain it like a programmer") {
    color: var(--level-programmer-color);
}

.article-content h3 {
    font-size: 1.35rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--secondary-color);
    font-weight: 700;
}

.article-content p {
    margin-bottom: 1.25rem;
    line-height: 1.8;
    font-size: 1.05rem;
}

.article-content ul,
.article-content ol {
    margin-left: 2rem;
    margin-bottom: 1.5rem;
}

.article-content li {
    margin-bottom: 0.75rem;
    line-height: 1.8;
}

.article-content code {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    padding: 0.3rem 0.6rem;
    border-radius: 5px;
    font-size: 0.95em;
    border: 1px solid var(--border-color);
    font-family: 'Monaco', 'Courier New', monospace;
    color: var(--secondary-color);
    font-weight: 600;
}

.article-content pre {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    padding: 1.5rem;
    border-radius: 12px;
    overflow-x: auto;
    margin-bottom: 1.5rem;
    border: 2px solid #4a5568;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: relative;
}

.article-content pre::before {
    content: '< / >';
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    color: rgba(255, 255, 255, 0.2);
    font-size: 0.85rem;
    font-weight: bold;
}

.article-content pre code {
    background: none;
    padding: 0;
    border: none;
    color: #e2e8f0;
    font-weight: 400;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.article-content a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    font-weight: 600;
}

.article-content a:hover {
    border-bottom-color: var(--primary-color);
    color: var(--secondary-color);
}

/* About page */
.about-content {
    background: var(--bg-color);
    padding: 3rem;
    border-radius: 16px;
    border: 2px solid var(--border-color);
    margin-bottom: 2rem;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.05);
}

.about-content h1 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--text-color);
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.about-content h2 {
    font-size: 1.75rem;
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
    color: var(--text-color);
    font-weight: 700;
}

.about-content section {
    margin-bottom: 2.5rem;
}

.about-content p {
    margin-bottom: 1.25rem;
    line-height: 1.8;
}

.about-content ul {
    margin-left: 2rem;
    margin-bottom: 1.25rem;
}

.about-content li {
    margin-bottom: 0.75rem;
}

.about-content a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.about-content a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* Footer */
footer {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    border-top: none;
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
}

footer a {
    color: var(--text-on-gradient);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

footer a:hover {
    color: var(--accent-color);
    text-decoration: none;
}

/* Loading state */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
    font-size: 1.1rem;
}

/* Error state */
.error {
    background: linear-gradient(135deg, #fee 0%, #fdd 100%);
    border: 2px solid #fcc;
    padding: 1.25rem;
    border-radius: 12px;
    color: #c33;
    font-weight: 600;
}

/* Explanation level sections */
.explanation-section {
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2.5rem;
    border-left: 5px solid;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.explanation-section:hover {
    transform: translateX(5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.explanation-section.level-5 {
    background: var(--level-5-bg);
    border-left-color: var(--level-5-color);
}

.explanation-section.level-15 {
    background: var(--level-15-bg);
    border-left-color: var(--level-15-color);
}

.explanation-section.level-programmer {
    background: var(--level-programmer-bg);
    border-left-color: var(--level-programmer-color);
}

.explanation-section h2::before {
    margin-right: 0.75rem;
    font-size: 1.5rem;
}

.explanation-section.level-5 h2::before {
    content: '👶';
}

.explanation-section.level-15 h2::before {
    content: '🎓';
}

.explanation-section.level-programmer h2::before {
    content: '💻';
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    header {
        padding: 1.5rem 0;
    }
    
    .logo {
        font-size: 1.75rem;
    }
    
    .tagline {
        font-size: 0.95rem;
    }
    
    nav {
        gap: 1rem;
    }
    
    nav a {
        padding: 0.4rem 0.75rem;
        font-size: 0.9rem;
    }
    
    .intro {
        padding: 2rem 1.5rem;
    }
    
    .intro h2 {
        font-size: 1.5rem;
    }
    
    .intro p {
        font-size: 1rem;
    }
    
    .article-content,
    .about-content {
        padding: 2rem 1.5rem;
    }
    
    .article-content h1 {
        font-size: 1.75rem;
    }
    
    .article-content h2 {
        font-size: 1.35rem;
        margin-top: 2rem;
    }
    
    .article-content h3 {
        font-size: 1.15rem;
    }
    
    .explanation-section {
        padding: 1.5rem;
    }
    
    .article-card {
        padding: 1.5rem;
    }
    
    .article-card h3 {
        font-size: 1.25rem;
    }
}
