/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Dark mode (default) */
    --bg-primary: #0d0d0d;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #252525;
    --text-primary: #e8e8e8;
    --text-secondary: #a0a0a0;
    --text-tertiary: #707070;
    --accent: #4a9eff;
    --accent-hover: #6bb0ff;
    --border: #2a2a2a;
    --code-bg: #1e1e1e;
    --code-border: #333;
}

html.light-mode {
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --bg-tertiary: #e8e8e8;
    --text-primary: #1a1a1a;
    --text-secondary: #4a4a4a;
    --text-tertiary: #707070;
    --accent: #0066cc;
    --accent-hover: #0052a3;
    --border: #d0d0d0;
    --code-bg: #f5f5f5;
    --code-border: #d0d0d0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 18px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; margin-top: 2rem; }
h3 { font-size: 1.5rem; margin-top: 1.5rem; }

p {
    margin-bottom: 1.5rem;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

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

/* Header */
.site-header {
    padding: 2rem 0;
    border-bottom: 1px solid var(--border);
    background-color: var(--bg-primary);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.site-logo {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
}

.site-logo:hover {
    color: var(--accent);
    text-decoration: none;
}

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

.nav-links a {
    color: var(--text-secondary);
    font-size: 1rem;
    transition: color 0.2s ease;
}

.nav-links a:hover {
    color: var(--text-primary);
    text-decoration: none;
}

.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    border-color: var(--accent);
    background-color: var(--bg-secondary);
}

/* Main Content */
.site-main {
    min-height: calc(100vh - 200px);
    padding: 4rem 0;
}

/* Hero Section */
.hero {
    padding: 3rem 0 4rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 4rem;
}

.hero-title {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    max-width: 700px;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 650px;
    line-height: 1.7;
}

/* Page Header */
.page-header {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.page-header h1 {
    margin-bottom: 0.5rem;
}

.page-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-header h2 {
    margin: 0;
}

.view-all {
    color: var(--accent);
    font-size: 1rem;
}

/* Post Cards */
.post-list {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.post-card {
    padding-bottom: 3rem;
    border-bottom: 1px solid var(--border);
}

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

.post-date {
    display: block;
    font-size: 0.9rem;
    color: var(--text-tertiary);
    margin-bottom: 0.5rem;
    font-family: 'JetBrains Mono', monospace;
}

.post-title {
    margin-bottom: 1rem;
    font-size: 1.75rem;
}

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

.post-title a:hover {
    color: var(--accent);
}

.post-excerpt {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.7;
}

.post-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    background-color: var(--bg-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    border: 1px solid var(--border);
    font-family: 'JetBrains Mono', monospace;
}

/* Individual Post */
.post {
    max-width: 700px;
}

.post-header {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.post-header .post-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.post-content {
    font-size: 1.1rem;
    line-height: 1.8;
}

.post-content h2 {
    margin-top: 3rem;
    margin-bottom: 1rem;
}

.post-content h3 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

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

.post-content li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.post-content li strong {
    color: var(--text-primary);
}

.post-content code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9em;
    background-color: var(--code-bg);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    border: 1px solid var(--code-border);
}

.post-content pre {
    background-color: var(--code-bg);
    border: 1px solid var(--code-border);
    border-radius: 6px;
    padding: 1.5rem;
    overflow-x: auto;
    margin: 2rem 0;
}

.post-content pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

.post-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.back-link {
    color: var(--text-secondary);
    font-size: 1rem;
}

.back-link:hover {
    color: var(--accent);
}

/* Work Page */
.work-section {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.work-item {
    padding: 2rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.work-item h2 {
    margin-top: 0;
    margin-bottom: 1rem;
}

.work-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.work-status {
    font-size: 0.9rem;
    color: var(--text-tertiary);
    font-style: italic;
    margin-bottom: 1rem;
}

.work-links {
    display: flex;
    gap: 1rem;
}

.work-link {
    color: var(--accent);
}

/* About Page */
.about-content {
    max-width: 700px;
}

.about-text ul {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.about-text li {
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

.about-text li strong {
    color: var(--text-primary);
}

/* Contact Page */
.contact-content {
    max-width: 600px;
}

.contact-intro {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
}

.contact-methods {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.contact-method h2 {
    margin-bottom: 1rem;
}

.contact-email {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.contact-email a {
    font-family: 'JetBrains Mono', monospace;
}

.contact-note {
    color: var(--text-tertiary);
    font-size: 0.95rem;
}

.social-links {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.social-links a {
    font-size: 1.1rem;
}

/* CTA */
.cta {
    margin-top: 4rem;
    padding: 2rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    text-align: center;
}

.cta p {
    margin: 0;
    font-size: 1.1rem;
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 3rem 0;
    margin-top: 4rem;
}

.site-footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.site-footer p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-tertiary);
}

.site-footer a {
    color: var(--text-secondary);
}

.site-footer a:hover {
    color: var(--accent);
}

/* No Posts Message */
.no-posts {
    color: var(--text-tertiary);
    font-style: italic;
    text-align: center;
    padding: 3rem 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        font-size: 16px;
    }

    .container {
        padding: 0 1.5rem;
    }

    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }

    .site-header {
        padding: 1.5rem 0;
    }

    .site-nav {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        gap: 1.5rem;
        font-size: 0.9rem;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .site-main {
        padding: 2rem 0;
    }

    .post-header .post-title {
        font-size: 2rem;
    }

    .post-content {
        font-size: 1rem;
    }

    .post-content pre {
        padding: 1rem;
        margin: 1.5rem -0.5rem;
    }

    .site-footer .container {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .nav-links {
        gap: 1rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}
