* {
    box-sizing: border-box;
}

:root {
    --bg-color: #ffffff;
    --text-color: #222222;
    --muted-color: #666666;
    --link-color: #0066cc;
    --link-hover: #004499;
    --code-bg: #f4f4f5;
    --border-color: #e4e4e7;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #121212;
        --text-color: #e4e4e7;
        --muted-color: #a1a1aa;
        --link-color: #60a5fa;
        --link-hover: #93c5fd;
        --code-bg: #27272a;
        --border-color: #3f3f46;
    }
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    line-height: 1.6;
    background-color: var(--bg-color);
    color: var(--text-color);
}

a {
    color: var(--link-color);
    text-decoration: none;
}

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

/* Base Layout for Home Page */
.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    padding: 20px 0;
}

img.profile-img {
    width: 100%;
    max-width: 300px;
    height: auto;
    aspect-ratio: 4/5;
    object-fit: cover;
}

.content {
    width: 100%;
    text-align: left;
}

.content h1 {
    margin: 0;
    font-size: clamp(1.75rem, 5vw, 2.5rem);
}

.content p {
    margin: 1em auto;
    font-size: clamp(0.95rem, 2.5vw, 1.1rem);
}

.back-link {
    display: inline-block;
    margin-bottom: 20px;
    font-size: 0.95rem;
    color: var(--muted-color);
}

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

/* Blog Listing Styles */
.blog-header {
    margin-bottom: 40px;
}

.blog-header h1 {
    margin: 0 0 8px 0;
    font-size: clamp(1.75rem, 5vw, 2.25rem);
}

.blog-header p {
    color: var(--muted-color);
    margin: 0;
    font-size: 1.05rem;
}

.post-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

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

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

.post-meta {
    font-size: 0.875rem;
    color: var(--muted-color);
    margin-bottom: 4px;
}

.post-title {
    font-size: 1.35rem;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.post-summary {
    margin: 0;
    color: var(--text-color);
    font-size: 1rem;
}

/* Blog Article Styles */
article {
    margin-top: 10px;
}

article header {
    margin-bottom: 30px;
}

article h1 {
    font-size: clamp(1.75rem, 5vw, 2.25rem);
    margin: 0 0 10px 0;
    line-height: 1.25;
}

article .post-date {
    color: var(--muted-color);
    font-size: 0.9rem;
}

article h2 {
    font-size: 1.5rem;
    margin-top: 36px;
    margin-bottom: 14px;
}

article h3 {
    font-size: 1.25rem;
    margin-top: 28px;
    margin-bottom: 12px;
}

article p {
    margin-bottom: 1.4em;
    font-size: 1.05rem;
}

article ul, article ol {
    margin-bottom: 1.4em;
    padding-left: 24px;
}

article li {
    margin-bottom: 0.4em;
}

code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    background-color: var(--code-bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

pre {
    background-color: var(--code-bg);
    padding: 16px;
    border-radius: 6px;
    overflow-x: auto;
    margin-bottom: 1.4em;
}

pre code {
    background: none;
    padding: 0;
    font-size: 0.9em;
}

blockquote {
    border-left: 3px solid var(--link-color);
    margin: 1.5em 0;
    padding-left: 16px;
    color: var(--muted-color);
    font-style: italic;
}

/* Desktop Responsive Layout */
@media (min-width: 768px) {
    body {
        padding: 40px;
        margin: 60px auto;
    }
    .container {
        flex-direction: row;
        align-items: stretch;
        gap: 40px;
    }
    img.profile-img {
        width: 200px;
        height: auto;
        aspect-ratio: 4/5;
        flex-shrink: 0;
        object-fit: cover;
    }
    .content {
        flex: 1;
        text-align: left;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
    .content h1 {
        margin: 0;
        line-height: 1.2;
    }
    .content p {
        margin: 0;
        line-height: 1.5;
    }
}
