:root {
    --primary-color: #b32d2d;
    --primary-hover: #8b2222;
    --bg-color: #fdfdfd;
    --section-bg: #f8f9fa;
    --text-color: #333;
    --text-muted: #666;
    --card-bg: #ffffff;
    --border-color: #eee;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    font-weight: 300;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    margin: 0;
}

/* Layout Container */
.container {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px 0;
}

/* Sidebar Navigation */
.sidenav {
    width: 200px;
    position: sticky;
    top: 40px;
    height: fit-content;
    margin-right: 60px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.brand {
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: -0.02em;
    color: var(--text-color);
    margin-bottom: 4px;
}

.sidenav-links {
    display: contents;
}

.sidenav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 16px;
    font-weight: 400;
    transition: var(--transition);
    padding: 8px 0 8px 15px;
    border-left: 2px solid transparent;
}

.sidenav-links a:hover,
.sidenav-links a.active {
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.sidenav-links a .ext {
    font-size: 0.75em;
    color: var(--text-muted);
}

.headshot {
    width: 100%;
    height: auto;
    border-radius: 12px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 0 0 40px;
    min-width: 0;
}

.section {
    margin-bottom: 80px;
}

h1 {
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 20px;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--text-color);
    letter-spacing: -0.02em;
    margin: 0 0 20px;
}

p {
    margin-bottom: 20px;
    font-weight: 300;
}

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

a:hover {
    color: var(--primary-hover);
}

/* Hero / intro */
.eyebrow {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.hero-text h1 {
    margin-bottom: 16px;
}

.lead {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 720px;
}

/* Section headers with a "see all" link */
.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.section-head h2 {
    margin: 0;
}

.see-all {
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
}

/* Projects Grid */
.projects-intro {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 40px;
    max-width: 800px;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.project-card {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

.project-name {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 12px;
    display: block;
}

.project-desc {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    flex-grow: 1;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tags span {
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--section-bg);
    color: var(--primary-color);
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

/* Blog post list */
.post-list {
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--border-color);
}

.post-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 4px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
}

.post-row:hover {
    color: var(--primary-color);
}

.post-row-title {
    font-weight: 500;
}

.post-row time {
    font-size: 0.85rem;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Single post */
.post .back-link {
    display: inline-block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 16px;
}

.post-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: -8px;
    margin-bottom: 32px;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.post-tags span {
    font-size: 0.7rem;
    font-weight: 500;
    background: var(--section-bg);
    color: var(--primary-color);
    padding: 3px 9px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.post-body {
    max-width: 720px;
}

.post-body h2 {
    font-size: 1.35rem;
    margin: 40px 0 14px;
}

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

.post-body ul,
.post-body ol {
    padding-left: 22px;
    margin-bottom: 20px;
}

.post-body li {
    margin: 6px 0;
}

.post-body code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.88em;
    background: var(--section-bg);
    padding: 2px 6px;
    border-radius: 5px;
    color: var(--primary-hover);
}

.post-body pre {
    background: #0d1117;
    color: #e6edf3;
    border-radius: 10px;
    padding: 16px 18px;
    overflow: auto;
    font-size: 0.82rem;
    line-height: 1.55;
    margin-bottom: 24px;
}

.post-body pre code {
    background: none;
    padding: 0;
    color: inherit;
}

/* Contact Section */
.contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.contact-link {
    padding: 12px 24px;
    background: var(--primary-color);
    color: white !important;
    border-radius: 8px;
    font-weight: 500;
    border: none;
}

.contact-link:hover {
    background: var(--primary-hover);
}

/* Footer */
footer {
    text-align: center;
    padding: 60px 0;
    margin-top: 40px;
    border-top: 1px solid var(--border-color);
}

.footer_text {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.footer_text a {
    color: var(--text-muted);
}

.footer_text a:hover {
    color: var(--primary-color);
}

/* Responsive Design */
@media (max-width: 900px) {
    .container {
        flex-direction: column;
        padding-top: 20px;
    }
    .sidenav {
        width: 100%;
        position: relative;
        top: 0;
        margin-right: 0;
        flex-direction: row;
        align-items: center;
        gap: 16px;
        margin-bottom: 16px;
        flex-wrap: wrap;
    }
    .sidenav > a:first-child {
        flex-shrink: 0;
        padding: 0;
        border: none;
    }
    .brand {
        margin-bottom: 0;
    }
    .sidenav-links {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        flex: 1;
        gap: 4px;
        overflow-x: auto;
    }
    .sidenav-links a {
        border-left: none;
        border-bottom: 2px solid transparent;
        padding: 6px 8px;
        font-size: 13px;
        white-space: nowrap;
    }
    .sidenav-links a:hover,
    .sidenav-links a.active {
        border-left-color: transparent;
        border-bottom-color: var(--primary-color);
    }
    .headshot {
        display: block;
        width: 56px;
        height: 56px;
        object-fit: cover;
        border-radius: 14px;
        margin: 0;
    }
    .section {
        margin-bottom: 48px;
    }
}

@media (max-width: 600px) {
    h1 {
        font-size: 2rem;
    }
    .lead {
        font-size: 1.05rem;
    }
    .contact-links {
        flex-direction: column;
    }
    .contact-link {
        text-align: center;
    }
    .post-row {
        flex-direction: column;
        gap: 4px;
    }
}
