/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --text-primary: #1a1a1a;
    --text-secondary: #666;
    --text-tertiary: #999;
    --bg-primary: #fafafa;
    --bg-secondary: #fff;
    --accent: #2c3e50;
    --border-light: #e0e0e0;
    --border-ultralight: #f0f0f0;
    --shadow-subtle: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-medium: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-strong: 0 8px 32px rgba(0, 0, 0, 0.12);
}

body {
    font-family: Georgia, serif;
    line-height: 1.8;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* Header */
header {
    background: var(--bg-secondary);
    padding: 3rem 0;
    margin-bottom: 4rem;
    box-shadow: var(--shadow-subtle);
}

.header-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

header h1 {
    font-size: 3.5rem;
    font-weight: 300;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.tagline {
    font-style: italic;
    color: var(--text-secondary);
    font-size: 1.2rem;
    font-weight: 300;
}

/* Navigation */
nav {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 3rem;
    padding: 1.5rem 0;
    margin: 0;
}

nav a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 400;
    transition: color 0.2s ease;
    position: relative;
}

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

nav a:hover::after,
nav a.active::after {
    width: 100%;
}

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

/* Main content */
main {
    max-width: 800px;
    margin: 0 auto 5rem;
    padding: 0 20px;
}

/* Hero section for index */
.hero {
    text-align: center;
    margin-bottom: 5rem;
    padding: 3rem 0;
}

.hero h2 {
    font-size: 2rem;
    font-weight: 300;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

/* Articles grid */
.articles-grid {
    display: grid;
    gap: 2rem;
    margin-bottom: 3rem;
}

/* Article cards */
article.post-card {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 2.5rem;
    box-shadow: var(--shadow-subtle);
    transition: all 0.3s ease;
    border: 1px solid var(--border-ultralight);
}

article.post-card:hover {
    box-shadow: var(--shadow-medium);
    transform: translateY(-2px);
}

article.post-card h2 {
    font-size: 1.8rem;
    font-weight: 400;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

article.post-card h2 a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

article.post-card h2 a:hover {
    color: var(--accent);
}

article.post-card time {
    color: var(--text-tertiary);
    font-size: 0.9rem;
    font-weight: 300;
}

.post-excerpt {
    margin-top: 1.5rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.post-excerpt p {
    margin-bottom: 1rem;
}

.read-more {
    display: inline-flex;
    align-items: center;
    color: var(--accent);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 400;
    margin-top: 1rem;
    transition: all 0.2s ease;
}

.read-more::after {
    content: '→';
    margin-left: 0.5rem;
    transition: transform 0.2s ease;
}

.read-more:hover::after {
    transform: translateX(4px);
}

/* Post single styles */
.post-single {
    max-width: 700px;
    margin: 0 auto;
}

.post-single article {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 3rem;
    box-shadow: var(--shadow-subtle);
}

.post-single h1 {
    font-size: 2.5rem;
    font-weight: 400;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.post-meta {
    color: var(--text-tertiary);
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-light);
}

.content {
    margin-top: 2rem;
}

.content p {
    margin-bottom: 1.5rem;
}

.content h2 {
    font-size: 1.8rem;
    font-weight: 400;
    margin: 3rem 0 1.5rem;
    color: var(--accent);
}

.content h3 {
    font-size: 1.4rem;
    font-weight: 400;
    margin: 2rem 0 1rem;
}

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

.back-link {
    display: inline-flex;
    align-items: center;
    margin-top: 3rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.back-link::before {
    content: '←';
    margin-right: 0.5rem;
}

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

/* Archive page */
.archive-grid {
    display: grid;
    gap: 1.5rem;
}

.archive-entry {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: var(--shadow-subtle);
    border: 1px solid var(--border-ultralight);
    transition: all 0.2s ease;
}

.archive-entry:hover {
    box-shadow: var(--shadow-medium);
    transform: translateX(4px);
}

.archive-entry time {
    color: var(--text-tertiary);
    font-size: 0.9rem;
    font-weight: 300;
}

.archive-entry h3 {
    margin-top: 0.5rem;
    font-size: 1.3rem;
    font-weight: 400;
}

.archive-entry h3 a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.archive-entry h3 a:hover {
    color: var(--accent);
}

/* Comment exchanges */
.comment-exchange {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-subtle);
}

.comment-meta {
    color: var(--text-tertiary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.comment-content {
    margin-bottom: 1.5rem;
}

.author-response {
    background: var(--bg-primary);
    border-radius: 4px;
    padding: 1.5rem;
    margin-top: 1rem;
    border-left: 3px solid var(--accent);
}

.author-response h5 {
    color: var(--accent);
    font-weight: 400;
    margin-bottom: 1rem;
}

/* Footer */
footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-light);
    padding: 3rem 0;
    text-align: center;
}

footer p {
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

/* Legacy styles for existing pages */
.post {
    margin-bottom: 4rem;
}

.post h2 {
    font-size: 1.8rem;
    font-weight: 400;
    margin-bottom: 0.5rem;
}

.post time {
    display: block;
    color: var(--text-tertiary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.archive-list {
    list-style: none;
}

.archive-item {
    margin-bottom: 1.5rem;
    padding-left: 1rem;
    border-left: 2px solid var(--border-light);
}

.archive-item a {
    color: var(--text-primary);
    text-decoration: none;
}

.archive-item a:hover {
    color: var(--accent);
}

.archive-item time {
    display: block;
    color: var(--text-tertiary);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* Draft section styles */
.draft-section {
    margin-top: 3rem;
}

.draft-section h3 {
    font-size: 1.6rem;
    font-weight: 400;
    color: var(--accent);
    margin-bottom: 2rem;
}

/* Email section styles */
.email-collection {
    display: grid;
    gap: 2rem;
    margin-top: 3rem;
}

.email-paper {
    background: #f9f6f1;
    background-image: 
        repeating-linear-gradient(
            transparent,
            transparent 28px,
            #e8e4db 28px,
            #e8e4db 29px
        );
    border: 1px solid #d4cfc4;
    border-radius: 2px;
    padding: 3rem;
    box-shadow: 
        0 1px 3px rgba(0, 0, 0, 0.1),
        0 5px 10px rgba(0, 0, 0, 0.05);
    position: relative;
    font-family: 'Courier New', monospace;
    line-height: 29px;
    transition: all 0.3s ease;
}

.email-paper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 60px;
    bottom: 0;
    width: 1px;
    background: #f4c4c4;
    opacity: 0.5;
}

.email-paper::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 20px;
    width: 20px;
    height: 20px;
    background: #fff;
    border: 2px solid #ccc;
    border-radius: 50%;
    box-shadow: 
        0 40px 0 0 #fff,
        0 40px 0 0 #fff,
        0 80px 0 0 #fff,
        0 120px 0 0 #fff,
        0 160px 0 0 #fff,
        0 200px 0 0 #fff,
        0 240px 0 0 #fff,
        0 280px 0 0 #fff,
        0 320px 0 0 #fff,
        0 360px 0 0 #fff,
        0 400px 0 0 #fff,
        0 440px 0 0 #fff,
        0 480px 0 0 #fff,
        0 520px 0 0 #fff,
        0 40px 0 2px #ccc,
        0 80px 0 2px #ccc,
        0 120px 0 2px #ccc,
        0 160px 0 2px #ccc,
        0 200px 0 2px #ccc,
        0 240px 0 2px #ccc,
        0 280px 0 2px #ccc,
        0 320px 0 2px #ccc,
        0 360px 0 2px #ccc,
        0 400px 0 2px #ccc,
        0 440px 0 2px #ccc,
        0 480px 0 2px #ccc,
        0 520px 0 2px #ccc;
}

.email-paper:hover {
    transform: translateY(-4px) rotate(-0.5deg);
    box-shadow: 
        0 3px 6px rgba(0, 0, 0, 0.15),
        0 10px 20px rgba(0, 0, 0, 0.1);
}

.email-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #d4cfc4;
}

.email-from,
.email-to,
.email-date,
.email-subject {
    font-size: 0.9rem;
    color: #4a4a4a;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.email-subject {
    font-size: 1.1rem;
    color: #2c3e50;
    margin-top: 1rem;
}

.email-body {
    color: #333;
    font-size: 1rem;
    padding-left: 80px;
}

.email-body p {
    margin-bottom: 1rem;
}

.email-body p:first-child {
    text-indent: 2rem;
}

/* Story link styles for email page */
.story-link {
    margin-top: 1rem;
    font-style: italic;
    color: #666;
}

.story-link a {
    color: #2c3e50;
    text-decoration: none;
    font-weight: 500;
}

.story-link a:hover {
    text-decoration: underline;
}

/* Curator note styles */
.curator-note {
    margin-top: 3rem;
    padding: 2rem;
    background: #f5f4f0;
    border-left: 3px solid #d4c4b0;
    font-style: italic;
    color: #666;
}

.curator-note h3 {
    font-size: 1.1rem;
    font-weight: 500;
    color: #444;
    margin-bottom: 1rem;
    font-style: normal;
}

.curator-note p {
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 2.5rem;
    }
    
    .tagline {
        font-size: 1rem;
    }
    
    nav ul {
        gap: 1.5rem;
        padding: 1rem 0;
        font-size: 0.95rem;
    }
    
    .hero h2 {
        font-size: 1.5rem;
    }
    
    article.post-card {
        padding: 1.5rem;
    }
    
    .post-single article {
        padding: 2rem;
    }
    
    .post-single h1 {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    nav ul {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    header {
        padding: 2rem 0;
    }
    
    .articles-grid {
        gap: 1rem;
    }
}