/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #2c3e50;
    background-color: #ffffff;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: #2c3e50;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: #2c3e50;
}

h2 {
    font-size: 1.5rem;
    margin-top: 3rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

p {
    margin-bottom: 1.5rem;
    font-size: 1rem;
    color: #5a6c7d;
    line-height: 1.7;
}

a {
    color: #3498db;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

a:hover {
    color: #2980b9;
    border-bottom-color: #3498db;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
    margin-left: 320px; /* Account for fixed sidebar */
}

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background-color: #f8f9fa;
    border-right: 1px solid #e9ecef;
    padding: 1.5rem;
    overflow-y: auto;
    z-index: 50;
}

.main-content {
    max-width: 700px;
    margin: 0 auto;
}

/* Header */
header {
    border-bottom: 1px solid #e9ecef;
    position: sticky;
    top: 0;
    background-color: #ffffff;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-left: 320px; /* Account for fixed sidebar */
    gap: 3rem;
}

.nav-brand {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #2c3e50;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
}

.nav-links a {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    color: #5a6c7d;
}

.nav-links a:hover {
    color: #3498db;
    border-bottom-color: #3498db;
}

/* Sidebar */
.sidebar-profile {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

.profile-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #6c757d;
    margin-right: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 500;
    font-size: 0.9rem;
}

.profile-name {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    color: #2c3e50;
    line-height: 1.2;
}

.nav-item {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    margin: 0.25rem 0;
    border-radius: 6px;
    text-decoration: none;
    color: #5a6c7d;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-item:hover {
    background-color: #e9ecef;
    color: #2c3e50;
}

.nav-item.active {
    background-color: #e9ecef;
    color: #2c3e50;
}

.nav-item-icon {
    width: 16px;
    height: 16px;
    margin-right: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-item-count {
    background-color: #dee2e6;
    color: #6c757d;
    font-size: 0.75rem;
    padding: 0.125rem 0.375rem;
    border-radius: 10px;
    margin-left: auto;
}

.sidebar-section {
    margin-bottom: 1.5rem;
}

.sidebar-section:last-child {
    margin-bottom: 0;
}

.section-header {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    margin: 0.25rem 0;
    color: #5a6c7d;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.section-header:hover {
    color: #2c3e50;
}

.section-chevron {
    width: 12px;
    height: 12px;
    transition: transform 0.2s ease;
}

.section-header.collapsed .section-chevron {
    transform: rotate(-90deg);
}

.section-content {
    margin-left: 0.5rem;
}

.section-content.collapsed {
    display: none;
}

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

.intro {
    margin-bottom: 4rem;
}

.intro h1 {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    margin-bottom: 3rem;
    font-size: 2.8rem;
    font-weight: 700;
    line-height: 1.2;
    color: #2c3e50;
}

.intro p {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    margin-bottom: 2rem;
    font-size: 1.1rem;
    line-height: 1.7;
    color: #5a6c7d;
}

.links h2 {
    margin-top: 2rem;
    margin-bottom: 0.5rem;
}

.links p {
    margin-bottom: 2rem;
}

.contact-links {
    list-style: none;
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
}

.contact-links li a {
    font-size: 1rem;
    color: #b3b3b3;
}

/* Writing page styles */
.writing-categories {
    margin-top: 3rem;
}

.writing-category {
    margin-bottom: 4rem;
}

.writing-category h3 {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #2c3e50;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
}

.writing-list {
    margin-top: 1rem;
}

.writing-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid #e9ecef;
}

.writing-item:last-child {
    border-bottom: none;
}

.writing-date {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    color: #5a6c7d;
    font-size: 0.85rem;
    font-weight: 400;
    white-space: nowrap;
    margin-left: 2rem;
}

.writing-title {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-size: 1rem;
    color: #2c3e50;
    font-weight: 500;
}

/* Article styles */
.article-header {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #2a2a2a;
}

.article-title {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.article-meta {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    color: #5a6c7d;
    font-size: 0.95rem;
    font-weight: 400;
}

.article-content {
    max-width: 700px;
    margin: 0 auto;
}

.article-content h2 {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-size: 1.4rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: #2c3e50;
    font-weight: 600;
}

.article-content h3 {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-size: 1.2rem;
    margin-top: 2rem;
    margin-bottom: 0.8rem;
    color: #2c3e50;
    font-weight: 600;
}

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

.article-content li {
    margin-bottom: 0.5rem;
}

.article-content blockquote {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    border-left: 3px solid #e9ecef;
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: #5a6c7d;
    font-weight: 400;
}

.article-content code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    background-color: #f8f9fa;
    color: #2c3e50;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-size: 0.9rem;
    font-weight: 400;
}

.article-content pre {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    background-color: #f8f9fa;
    color: #2c3e50;
    padding: 1rem;
    border-radius: 5px;
    overflow-x: auto;
    margin: 1.5rem 0;
    font-weight: 400;
}

.article-content pre code {
    background: none;
    padding: 0;
}

/* Project styles */
.project-list {
    margin-top: 3rem;
}

.project-item {
    margin-bottom: 4rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid #e9ecef;
}

.project-item:last-child {
    border-bottom: none;
}

.project-item h2 {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    color: #2c3e50;
    font-weight: 600;
}

.project-item p {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    margin-bottom: 1.5rem;
    color: #5a6c7d;
    font-weight: 400;
}

/* Timeline styles */
.timeline {
    margin-top: 2rem;
    position: relative;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 2rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #2a2a2a;
}

.timeline-item {
    position: relative;
    margin-bottom: 3rem;
    padding-left: 5rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 1.5rem;
    top: 0.5rem;
    width: 1rem;
    height: 1rem;
    background: #ffffff;
    border-radius: 50%;
    border: 3px solid #2a2a2a;
}

.timeline-date {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.timeline-content h3 {
    font-size: 1.2rem;
    color: #ffffff;
    margin-bottom: 0.3rem;
    font-weight: 500;
}

.timeline-content h4 {
    font-size: 1rem;
    color: #b3b3b3;
    margin-bottom: 0.8rem;
    font-weight: 400;
}

.timeline-content p {
    color: #b3b3b3;
    line-height: 1.6;
    margin-bottom: 0;
}

/* Footer */
footer {
    border-top: 1px solid #e9ecef;
    padding: 3rem 0;
    margin-top: 6rem;
    margin-left: 320px; /* Account for fixed sidebar */
}

footer p {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    text-align: center;
    color: #5a6c7d;
    font-size: 0.9rem;
    font-weight: 400;
}

/* Responsive design */
@media (max-width: 1024px) {
    .container {
        margin-left: 0;
        padding: 2rem 1rem;
    }
    
    .nav-container {
        margin-left: 0;
        padding: 1.5rem;
        gap: 2rem;
    }
    
    .sidebar {
        position: static;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #e9ecef;
        padding: 2rem;
        margin-bottom: 2rem;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    footer {
        margin-left: 0;
        margin-top: 4rem;
    }
}

@media (max-width: 768px) {
    .container {
        margin-left: 0;
        padding: 0 1rem;
    }
    
    .nav-container {
        margin-left: 0;
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    .sidebar {
        margin-bottom: 1rem;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    footer {
        margin-left: 0;
    }
    
    .nav-links {
        gap: 1.5rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .intro h1 {
        font-size: 2.2rem;
    }
    
    .article-title {
        font-size: 1.8rem;
    }
    
    .writing-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .writing-date {
        margin-left: 0;
    }
    
    .contact-links {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        margin-left: 0;
    }
    
    .nav-container {
        margin-left: 0;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    footer {
        margin-left: 0;
    }
    
    .nav-links {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .intro h1 {
        font-size: 2rem;
    }
    
    p {
        font-size: 1rem;
    }
}
