:root {
    --bg-paper: #f2f2ee;
    --ink: #111111;
    --line: rgba(17, 17, 17, 0.15);
    --accent: #c42900;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-paper);
    color: var(--ink);
    font-family: 'Space Mono', monospace;
    width: 100%;
}

/* --- LAYOUT --- */
.page-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 4rem 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- HEADER --- */
header {
    margin-bottom: 4rem;
    border-bottom: 2px solid var(--ink);
    padding-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

h1 {
    font-family: 'Inter', sans-serif;
    font-size: 3rem;
    letter-spacing: -0.03em;
    margin: 0;
    line-height: 1;
}

.meta {
    text-align: right;
    font-size: 0.8rem;
    opacity: 0.7;
}

/* --- BACK LINK --- */
.back-link {
    position: fixed;
    top: 2rem; 
    left: 2rem;
    text-decoration: none;
    color: var(--ink);
    font-weight: 700;
    border: 1px solid var(--ink);
    padding: 10px 20px;
    background: var(--bg-paper);
    z-index: 100;
    transition: all 0.3s;
    font-size: 0.85rem;
}

.back-link:hover { 
    background: var(--ink); 
    color: var(--bg-paper); 
}

/* --- POST LIST --- */
.post-list-header {
    margin-bottom: 2rem;
}

.post-count {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.6;
}

/* --- POST ITEMS --- */
.post-item {
    display: block;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--line);
    text-decoration: none;
    color: var(--ink);
    transition: all 0.2s;
    cursor: pointer;
}

.post-item:hover {
    padding-left: 1rem;
    background: rgba(0,0,0,0.02);
}

.post-item:first-child {
    border-top: 1px solid var(--line);
}

.post-title {
    font-family: 'Inter', sans-serif;
    font-size: 1.25rem;
    font-weight: 500;
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
}

.post-meta {
    font-size: 0.75rem;
    opacity: 0.6;
    display: flex;
    gap: 1.5rem;
}

.post-excerpt {
    font-size: 0.9rem;
    margin-top: 0.75rem;
    opacity: 0.8;
    line-height: 1.5;
}

/* --- SINGLE POST VIEW --- */
.post-view {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.back-to-list {
    background: none;
    border: none;
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
    margin-bottom: 2rem;
    color: var(--ink);
    opacity: 0.7;
    transition: opacity 0.2s;
}

.back-to-list:hover {
    opacity: 1;
}

/* --- ARTICLE CONTENT --- */
article {
    font-family: 'Inter', sans-serif;
    line-height: 1.7;
}

article h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

article .article-meta {
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    opacity: 0.6;
    margin-bottom: 3rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--line);
}

article h2 {
    font-size: 1.5rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

article h3 {
    font-size: 1.2rem;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

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

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

article a:hover {
    opacity: 0.7;
}

article ul, article ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

article li {
    margin-bottom: 0.5rem;
}

article blockquote {
    margin: 2rem 0;
    padding: 1rem 1.5rem;
    border-left: 3px solid var(--ink);
    background: rgba(0,0,0,0.03);
    font-style: italic;
}

article code {
    font-family: 'Space Mono', monospace;
    font-size: 0.9em;
    background: rgba(0,0,0,0.06);
    padding: 0.2em 0.4em;
    border-radius: 3px;
}

article pre {
    background: #1a1a1a;
    color: #f0f0f0;
    padding: 1.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    border-radius: 4px;
}

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

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

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

/* --- EMPTY STATE --- */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    opacity: 0.6;
}

.empty-state h2 {
    font-family: 'Inter', sans-serif;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

/* --- MOBILE --- */
@media (max-width: 700px) {
    h1 { font-size: 2rem; }
    
    .page-wrapper {
        padding: 4rem 1.5rem;
        padding-top: 5rem;
    }
    
    .back-link {
        top: 1rem;
        left: 1rem;
        padding: 8px 15px;
        font-size: 0.75rem;
    }
    
    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .meta {
        text-align: left;
    }
    
    .post-title {
        font-size: 1.1rem;
    }
    
    article h1 {
        font-size: 1.75rem;
    }
    
    article p {
        font-size: 1rem;
    }
}