/* Base styles */
:root {
    --bg: #ffffff;
    --text: #37352f;
    --text-secondary: #6b6b6b;
    --link: #2b6cb0;
    --border: #e2e2e2;
    --code-bg: #f5f5f5;
    --accent: #37352f;
    --nav-bg: #fafafa;
    --blockquote-border: #37352f;
    --callout-bg: #f7f6f3;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.7;
    font-size: 16px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.5rem 3rem;
}

/* Navigation */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

nav .site-title {
    font-weight: 700;
    font-size: 1.1rem;
    text-decoration: none;
    color: var(--text);
}

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

nav .nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

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

/* Theme toggle button */
.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.3rem 0.6rem;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text);
    transition: all 0.2s;
}

.theme-toggle:hover {
    background: var(--code-bg);
}

/* Typography */
h1, h2, h3, h4 {
    font-weight: 600;
    line-height: 1.3;
    margin-top: 2rem;
    margin-bottom: 0.5rem;
}

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

a {
    color: var(--link);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

a:hover {
    text-decoration-thickness: 2px;
}

p {
    margin: 0.75em 0;
}

hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2rem 0;
}

/* Images */
img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

figure {
    margin: 1.5em 0;
    text-align: center;
}

figcaption {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 0.5em;
}

/* Code */
code {
    background: var(--code-bg);
    padding: 0.15em 0.35em;
    border-radius: 3px;
    font-size: 0.9em;
    font-family: "SFMono-Regular", Menlo, Consolas, monospace;
}

pre {
    background: var(--code-bg);
    padding: 1em 1.2em;
    border-radius: 6px;
    overflow-x: auto;
    line-height: 1.5;
}

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

/* Blockquotes */
blockquote {
    margin: 1em 0;
    padding: 0 0 0 1em;
    border-left: 3px solid var(--blockquote-border);
    color: var(--text-secondary);
}

/* Lists */
ul, ol {
    padding-left: 1.5em;
    margin: 0.5em 0;
}

li {
    margin: 0.3em 0;
}

/* Tables */
table {
    border-collapse: collapse;
    width: 100%;
    margin: 1em 0;
}

th, td {
    border: 1px solid var(--border);
    padding: 0.5em 0.75em;
    text-align: left;
}

th {
    background: var(--code-bg);
    font-weight: 600;
}

/* Homepage layout */
.homepage-header {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    margin: 1.5rem 0;
}

.homepage-header img {
    width: 144px;
    border-radius: 6px;
    flex-shrink: 0;
}

.homepage-header .bio {
    flex: 1;
}

/* Blog index */
.blog-list {
    list-style: none;
    padding: 0;
}

.blog-list li {
    margin: 0;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.blog-list li:last-child {
    border-bottom: none;
}

.blog-list .post-title {
    font-size: 1.15rem;
    font-weight: 600;
    display: block;
    margin-bottom: 0.25rem;
}

.blog-list .post-date {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.blog-list .post-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.blog-list .post-icon {
    margin-right: 0.3em;
}

/* Blog post */
.post-header {
    margin-bottom: 2rem;
}

.post-header h1 {
    margin-top: 0.5rem;
    margin-bottom: 0.25rem;
}

.post-meta {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Callout */
.callout {
    background: var(--callout-bg);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin: 1em 0;
    display: flex;
    gap: 0.75rem;
}

.callout-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

/* Footer */
footer {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-align: center;
}

/* Responsive */
@media (max-width: 600px) {
    .homepage-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    nav {
        flex-direction: column;
        gap: 0.5rem;
    }
}
