/* CSS Custom Properties for Theme */
:root {
    --bg-color: #fff;
    --text-color: #333;
    --text-light: #666;
    --text-lighter: #999;
    --text-dark: #000;
    --border-color: #eee;
    --border-light: #f0f0f0;
    --code-bg: #f5f5f5;
    --pre-bg: #f8f8f8;
    --pre-border: #eee;
    --tag-bg: #f0f0f0;
    --blockquote-border: #ddd;
    --link-underline: #ddd;
}

[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --text-color: #e4e4e4;
    --text-light: #b4b4b4;
    --text-lighter: #8a8a8a;
    --text-dark: #f0f0f0;
    --border-color: #333;
    --border-light: #2a2a2a;
    --code-bg: #2a2a2a;
    --pre-bg: #242424;
    --pre-border: #333;
    --tag-bg: #2a2a2a;
    --blockquote-border: #444;
    --link-underline: #555;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Container */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.site-header {
    padding: 40px 0 80px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 80px;
}

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

.nav-logo {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-dark);
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 30px;
}


.nav-link {
    color: var(--text-light);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: var(--text-dark);
}

/* Theme toggle button */
.theme-toggle {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-light);
    transition: all 0.2s ease;
    margin-left: auto;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    color: var(--text-dark);
    border-color: var(--text-light);
}

.theme-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--border-color);
}

/* GitHub icon */
.github-link {
    display: flex;
    align-items: center;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.github-link:hover {
    background-color: var(--border-color);
}

.github-link svg {
    transition: transform 0.2s ease;
}

.github-link:hover svg {
    transform: scale(1.1);
}

/* Main content */
.main-content {
    min-height: 60vh;
}

/* Home page sections */
.hero {
    margin-bottom: 100px;
}

.hero-title {
    font-size: 48px;
    font-weight: 300;
    line-height: 1.2;
    margin-bottom: 20px;
    color: var(--text-dark);
}

.hero-subtitle {
    font-size: 20px;
    color: var(--text-light);
    margin-bottom: 40px;
    font-weight: 300;
}

.hero-description {
    font-size: 16px;
    color: var(--text-light);
    line-height: 1.7;
    max-width: 600px;
}

.section {
    margin-bottom: 80px;
}

.section-title {
    font-size: 28px;
    font-weight: 400;
    margin-bottom: 30px;
    color: var(--text-dark);
}

.section-content {
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-light);
}

.section-content p {
    margin-bottom: 20px;
}

.section-content h3 {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-dark);
    margin: 30px 0 15px;
}

.section-content ul {
    margin: 20px 0;
    padding-left: 20px;
}

.section-content li {
    margin-bottom: 8px;
}

/* Writing section */
.posts-list {
    list-style: none;
    padding: 0;
}

.post-item {
    margin-bottom: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--border-light);
}

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

.post-item-title {
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 8px;
}

.post-item-title a {
    color: var(--text-dark);
    text-decoration: none;
}

.post-item-title a:hover {
    color: var(--text-light);
}

.post-item-date {
    font-size: 14px;
    color: var(--text-lighter);
    margin-bottom: 12px;
}

.post-item-excerpt {
    font-size: 15px;
    color: var(--text-light);
    line-height: 1.6;
}

/* Post page */
.post {
    max-width: 700px;
    margin: 0 auto;
}

.post-header {
    margin-bottom: 50px;
    text-align: center;
}

.post-meta {
    font-size: 14px;
    color: var(--text-lighter);
    margin-bottom: 20px;
}

.post-title {
    font-size: 36px;
    font-weight: 500;
    line-height: 1.3;
    margin-bottom: 20px;
    color: var(--text-dark);
}

.post-excerpt {
    font-size: 18px;
    color: var(--text-light);
    font-weight: 300;
    line-height: 1.5;
}

.post-content {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-color);
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4 {
    color: var(--text-dark);
    margin: 40px 0 20px;
    font-weight: 500;
}

.post-content h1 { font-size: 32px; }
.post-content h2 { font-size: 24px; }
.post-content h3 { font-size: 20px; }
.post-content h4 { font-size: 18px; }

.post-content p {
    margin-bottom: 20px;
}

.post-content ul, .post-content ol {
    margin: 20px 0;
    padding-left: 30px;
}

.post-content li {
    margin-bottom: 8px;
}

.post-content blockquote {
    border-left: 3px solid var(--blockquote-border);
    margin: 30px 0;
    padding-left: 20px;
    font-style: italic;
    color: var(--text-light);
}

.post-content code {
    background: var(--code-bg);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 14px;
    font-family: 'Monaco', 'Consolas', monospace;
}

.post-content pre {
    background: var(--pre-bg);
    border: 1px solid var(--pre-border);
    border-radius: 4px;
    padding: 20px;
    overflow-x: auto;
    margin: 30px 0;
}

.post-content pre code {
    background: none;
    padding: 0;
    border-radius: 0;
}

.post-footer {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid var(--border-color);
}

.post-tags {
    margin-bottom: 30px;
}

.post-tag {
    display: inline-block;
    background: var(--tag-bg);
    color: var(--text-light);
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    margin-right: 8px;
    margin-bottom: 8px;
}

.post-navigation {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.prev-post, .next-post {
    color: var(--text-light);
    text-decoration: none;
    font-size: 14px;
    max-width: 45%;
}

.prev-post:hover, .next-post:hover {
    color: var(--text-dark);
}

.next-post {
    text-align: right;
}

.back-to-writing {
    margin-top: 40px;
    text-align: center;
}

.back-to-writing a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 14px;
}

.back-to-writing a:hover {
    color: var(--text-dark);
}

/* Contact section */
.contact-info {
    font-size: 16px;
    line-height: 1.7;
}

.contact-info a {
    color: var(--text-dark);
    text-decoration: none;
    border-bottom: 1px solid var(--link-underline);
}

.contact-info a:hover {
    border-bottom-color: var(--text-dark);
}

/* Footer */
.site-footer {
    margin-top: 120px;
    padding: 40px 0 60px;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    text-align: center;
    font-size: 14px;
    color: var(--text-lighter);
}

.footer-content p {
    margin-bottom: 8px;
}

.footer-links {
    margin-bottom: 20px;
}

.footer-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.footer-link:hover {
    color: var(--text-dark);
    background-color: var(--border-light);
}

.footer-link svg {
    transition: transform 0.2s ease;
}

.footer-link:hover svg {
    transform: scale(1.1);
}

/* Hamburger menu styles */
.nav-toggle {
    display: none;
}

.nav-toggle-label {
    position: relative;
    height: 44px;
    width: 44px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
}

.nav-toggle-label span,
.nav-toggle-label span::before,
.nav-toggle-label span::after {
    display: block;
    background: var(--text-color);
    height: 2px;
    width: 20px;
    border-radius: 2px;
    position: relative;
    transition: background 0.3s ease;
}

.nav-toggle-label span::before,
.nav-toggle-label span::after {
    content: '';
    position: absolute;
    left: 0;
    transition: all 0.3s ease;
}

.nav-toggle-label span::before {
    top: 6px;
}

.nav-toggle-label span::after {
    top: -6px;
}

/* Hamburger animation when checked */
.nav-toggle:checked + .nav-toggle-label span {
    background: transparent;
}

.nav-toggle:checked + .nav-toggle-label span::before {
    transform: rotate(45deg);
    top: 0;
}

.nav-toggle:checked + .nav-toggle-label span::after {
    transform: rotate(-45deg);
    top: 0;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .site-header {
        padding: 20px 0;
        margin-bottom: 40px;
    }
    
    .nav {
        position: relative;
        justify-content: space-between;
        align-items: center;
    }
    
    .nav-toggle-label {
        display: flex;
        order: 1;
        margin-right: 60px; /* Space for theme toggle */
    }
    
    .theme-toggle {
        position: fixed;
        top: 16px;
        right: 16px;
        transform: none;
        margin-left: 0;
        min-width: 44px;
        min-height: 44px;
        padding: 10px;
        z-index: 1001;
    }
    
    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-color);
        border-top: 1px solid var(--border-color);
        transform: scale(1, 0);
        transform-origin: top;
        transition: transform 0.3s ease;
        z-index: 1000;
    }
    
    .nav-toggle:checked ~ .nav-menu {
        transform: scale(1, 1);
    }
    
    .nav-links {
        flex-direction: column;
        gap: 0;
        padding: 20px 0;
    }
    
    .nav-link {
        display: block;
        padding: 15px 0;
        font-size: 16px;
        border-bottom: 1px solid var(--border-light);
    }
    
    .nav-link:last-child {
        border-bottom: none;
    }
    
    .hero-title {
        font-size: 36px;
    }
    
    .hero-subtitle {
        font-size: 18px;
    }
    
    .section-title {
        font-size: 24px;
    }
    
    .post-title {
        font-size: 28px;
    }
    
    .post-navigation {
        flex-direction: column;
    }
    
    .prev-post, .next-post {
        max-width: 100%;
        text-align: left;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 28px;
    }
    
    .section {
        margin-bottom: 60px;
    }
    
    .site-footer {
        margin-top: 80px;
    }
}