:root {
    --ink: #1a1a1a;
    --paper: #fafafa;
    --accent: #ff4444;
    --mid: #666;
    --border: #d0d0d0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'IBM Plex Mono', monospace;
    background-color: var(--paper);
    color: var(--ink);
    line-height: 1.6;
    position: relative;
}

/* Grain texture overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.03;
    z-index: 1000;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

a {
    color: var(--ink);
    text-decoration: none;
    border-bottom: 1px solid var(--accent);
    transition: border-color 0.2s ease, color 0.2s ease;
}

a:hover {
    color: var(--accent);
    border-color: transparent;
}

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

/* Header */
header {
    padding: 2rem 0;
    border-bottom: 1px solid var(--border);
}

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

.logo {
    font-family: 'DM Serif Display', serif;
    font-size: 1.5rem;
    border: none;
}

.logo:hover {
    color: var(--ink);
}

nav {
    display: flex;
    gap: 2rem;
}

nav a {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: none;
    position: relative;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--accent);
    transition: width 0.2s ease;
}

nav a:hover::after {
    width: 100%;
}

nav a:hover {
    color: var(--ink);
}

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

.hero h1 {
    font-family: 'DM Serif Display', serif;
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 400;
    line-height: 1.1;
    margin-bottom: 2rem;
}

.hero-intro {
    font-size: 1.125rem;
    color: var(--mid);
    max-width: 600px;
}

.hero-intro .accent {
    color: var(--accent);
}

/* Projects */
.projects {
    padding: 4rem 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 3rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.section-header h2 {
    font-family: 'DM Serif Display', serif;
    font-size: 1.75rem;
    font-weight: 400;
}

.section-header span {
    font-size: 0.75rem;
    color: var(--mid);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.projects-grid {
    display: grid;
    gap: 2rem;
}

.project-card {
    padding: 2rem 0;
    border-bottom: 1px solid var(--border);
    transition: transform 0.2s ease;
}

.project-card:hover {
    transform: translateX(8px);
}

.project-meta {
    font-size: 0.75rem;
    color: var(--mid);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.project-card h3 {
    font-family: 'DM Serif Display', serif;
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 0.75rem;
}

.project-card p {
    color: var(--mid);
    margin-bottom: 1rem;
}

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

.tag {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    background-color: var(--ink);
    color: var(--paper);
    border-radius: 2px;
}

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

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 2rem;
}

.footer-info h3 {
    font-family: 'DM Serif Display', serif;
    font-size: 1.25rem;
    font-weight: 400;
    margin-bottom: 0.5rem;
}

.footer-info p {
    font-size: 0.875rem;
    color: var(--mid);
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    font-size: 0.875rem;
}

.copyright {
    width: 100%;
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--mid);
}

/* Blog - Article typography */
.article {
    padding: 4rem 0;
}

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

.article-header h1 {
    font-family: 'DM Serif Display', serif;
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 400;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.article-meta {
    font-size: 0.75rem;
    color: var(--mid);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.article-content h2 {
    font-family: 'DM Serif Display', serif;
    font-size: 1.5rem;
    font-weight: 400;
    margin: 2.5rem 0 1rem;
}

.article-content h3 {
    font-family: 'DM Serif Display', serif;
    font-size: 1.25rem;
    font-weight: 400;
    margin: 2rem 0 0.75rem;
}

.article-content p {
    margin-bottom: 1.25rem;
    color: var(--mid);
}

.article-content ul,
.article-content ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
    color: var(--mid);
}

.article-content li {
    margin-bottom: 0.5rem;
}

.article-content blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    color: var(--mid);
    font-style: italic;
}

.article-content code {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.875em;
    background-color: rgba(0, 0, 0, 0.05);
    padding: 0.15rem 0.4rem;
    border-radius: 2px;
}

.article-content pre {
    margin-bottom: 1.25rem;
    padding: 1.5rem;
    background-color: var(--ink);
    color: var(--paper);
    border-radius: 2px;
    overflow-x: auto;
}

.article-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.article-content a {
    color: var(--ink);
    border-bottom: 1px solid var(--accent);
}

.article-content img {
    max-width: 100%;
    height: auto;
    margin: 1.5rem 0;
}

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

.article-footer a {
    font-size: 0.875rem;
}

/* Blog - Post listing */
.post-list {
    padding: 4rem 0;
}

.post-item {
    padding: 2rem 0;
    border-bottom: 1px solid var(--border);
    transition: transform 0.2s ease;
}

.post-item:hover {
    transform: translateX(8px);
}

.post-item a {
    border: none;
}

.post-item a:hover {
    color: var(--ink);
}

.post-item-meta {
    font-size: 0.75rem;
    color: var(--mid);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.post-item h3 {
    font-family: 'DM Serif Display', serif;
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 0.5rem;
}

.post-item p {
    color: var(--mid);
    margin-bottom: 0.75rem;
}

/* Responsive */
@media (max-width: 600px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    nav {
        gap: 1.5rem;
    }

    .hero {
        padding: 4rem 0;
    }

    .footer-content {
        flex-direction: column;
    }

    .footer-links {
        flex-direction: column;
        gap: 1rem;
    }
}
