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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background-color: #fafafa;
    color: #333;
    line-height: 1.6;
    overflow-y: scroll; /* Always show scrollbar to maintain consistent width */
}

.container {
    position: relative;
    min-height: 100vh;
}

/* Left Sidebar */
.sidebar {
    position: fixed;
    left: calc(50% - 560px);
    top: 0;
    width: 200px;
    height: 100vh;
    background-color: #fafafa;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e0e0e0;
}

.avatar {
    margin-bottom: 40px;
}

.avatar img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: block;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: block;
    padding: 8px 12px;
    text-decoration: none;
    color: #666;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.nav-item:hover {
    background-color: #e8e8e8;
}

.nav-item.active {
    background-color: #e0e0e0;
    color: #333;
    font-weight: 500;
}

.nav-item:nth-child(4)::after {
    content: "";
    opacity: 0;
    transition: opacity 0.2s;
}

.nav-item:nth-child(4):hover::after {
    content: " RSS";
    opacity: 1;
}

/* Sidebar Footer */
.sidebar-footer {
    margin-top: auto;
    font-size: 12px;
    color: #888;
    line-height: 1.4;
    padding-top: 20px;
}

.sidebar-footer a {
    color: #888;
    text-decoration: none;
}

.sidebar-footer a:hover {
    color: #666;
    text-decoration: underline;
}



/* Main Content */
.main-content {
    width: 720px;
    margin: 0 auto;
    padding: 40px 60px;
    background-color: white;
}

.projects {
    margin-bottom: 60px;
}

.projects h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #222;
}

.project-item {
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 12px;
}

.project-item:last-child {
    margin-bottom: 0;
}

.project-item a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
}

.project-item a:hover {
    text-decoration: underline;
}

.essays h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #222;
}

.essay-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.essay-item {
    display: block;
    color: #2563eb;
    text-decoration: none;
    font-size: 16px;
    line-height: 1.5;
    padding: 4px 0;
    transition: color 0.2s;
}

.essay-item:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* About Page */
.about {
    margin-bottom: 60px;
}

.about h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #222;
}

/* Reads Page */
.reads {
    margin-bottom: 60px;
}

.reads h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #222;
}

.reads-subtitle {
    font-size: 16px;
    color: #666;
    margin-bottom: 30px;
    line-height: 1.5;
}



/* Blog Post Styles */
.blog-post {
    margin-bottom: 60px;
}

.blog-header {
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.blog-header h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #222;
    line-height: 1.3;
}

.blog-date {
    font-size: 14px;
    color: #666;
    font-style: italic;
}

.blog-content h2 {
    font-size: 24px;
    font-weight: 600;
    margin: 40px 0 20px 0;
    color: #222;
}

.blog-content h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 30px 0 16px 0;
    color: #333;
}

.blog-content p {
    font-size: 16px;
    line-height: 1.7;
    margin-bottom: 16px;
    color: #444;
}

.blog-content ul, .blog-content ol {
    margin: 16px 0;
    padding-left: 24px;
}

.blog-content li {
    font-size: 16px;
    line-height: 1.7;
    margin-bottom: 8px;
    color: #444;
}

.blog-content li li {
    margin-bottom: 4px;
}

.section-divider {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 40px 0;
}

/* Code Styles */
code {
    background-color: #f6f8fa;
    border: 1px solid #e1e4e8;
    border-radius: 4px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 14px;
    padding: 2px 6px;
    color: #d73a49;
}

pre {
    background-color: #f6f8fa;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    padding: 16px;
    margin: 16px 0;
    overflow-x: auto;
    line-height: 1.45;
}

pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: 13px;
    color: #333;
}

/* Table Styles */
.table-container {
    margin: 20px 0;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
}

th {
    background-color: #f6f8fa;
    font-weight: 600;
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid #e0e0e0;
    color: #333;
    font-size: 14px;
}

td {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    color: #444;
}

td code {
    font-size: 13px;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover {
    background-color: #f9f9f9;
}

/* Greentext styling */
.greentext {
    background-color: #f8f9fa;
    border-left: 4px solid #28a745;
    padding: 20px;
    margin: 20px 0;
    border-radius: 0 4px 4px 0;
}

.greentext p {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    margin: 4px 0;
    color: #28a745;
}

/* Writing section - non-link styling for blog post */
.essay-item.blog-post-link {
    color: #333;
    font-weight: 500;
    text-decoration: none;
    padding: 4px 8px;
    margin: -4px -8px;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
}

.essay-item.blog-post-link:hover {
    color: #222;
    text-decoration: none;
    background-color: #f5f5f5;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        position: relative;
        left: auto;
        width: 100%;
        height: auto;
        flex-direction: row;
        align-items: center;
        padding: 20px;
        gap: 20px;
    }
    
    .avatar {
        margin-bottom: 0;
    }
    
    .avatar img {
        width: 30px;
        height: 30px;
    }
    
    .nav-menu {
        flex-direction: row;
        margin-bottom: 0;
    }
    
    .sidebar-footer {
        display: none;
    }
    
    .main-content {
        width: 100%;
        padding: 30px 20px;
    }
}
