:root {
    --primary-color: #2c3e50;
    --secondary-color: #546e7a;
    --text-color: #2c3e50;
    --background-color: #f8f9fa;
    --background-gradient: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --max-width: 800px;
    --card-background: rgba(255, 255, 255, 0.95);
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    --border-color: rgba(0, 0, 0, 0.05);
    --accent-color: #3498db;
}

.dark-theme {
    --primary-color: #e0e0e0;
    --secondary-color: #a0a0a0;
    --text-color: #d4d4d4;
    --background-color: #121212;
    --background-gradient: linear-gradient(135deg, #1a1c20 0%, #0f1012 100%);
    --card-background: rgba(30, 30, 30, 0.95);
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    --border-color: rgba(255, 255, 255, 0.05);
    --accent-color: #64b5f6;
}

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

body {
    font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--background-color);
    background-image: var(--background-gradient);
    background-attachment: fixed;
    min-height: 100vh;
    transition: background-color 0.5s ease, color 0.3s ease;
}

body:not(.dark-theme) {
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --text-color: #333;
    --background-color: #f8f9fa;
    --card-background: white;
    --card-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    --border-color: #eee;
}

body.dark-theme {
    --primary-color: #ebeaed;
    --secondary-color: #B0B0B0;
    --text-color: #E0E0E0;
    --background-color: #121212;
    --card-background: #1e1e1e;
    --card-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    --border-color: #444444;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 3rem 2rem;
    opacity: 0;
    animation: fadeIn 1.2s ease-out forwards;
}

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

header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem 0;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.header-content {
    text-align: center;
    width: 100%;
}

#theme-toggle {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.8rem;
    color: var(--secondary-color);
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
}

#theme-toggle:hover {
    color: var(--primary-color);
    background-color: rgba(0,0,0,0.05);
}

body.dark-theme #theme-toggle:hover {
    background-color: rgba(255,255,255,0.1);
}

#theme-toggle svg {
    width: 24px;
    height: 24px;
}

.sun-icon {
    display: none;
}

.moon-icon {
    display: block;
}

body:not(.dark-theme) .sun-icon {
    display: block;
}

body:not(.dark-theme) .moon-icon {
    display: none;
}

body.dark-theme .sun-icon {
    display: none;
}

body.dark-theme .moon-icon {
    display: block;
}

h1 {
    font-family: 'Merriweather', serif;
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
    letter-spacing: -0.02em;
}

.subtitle {
    font-family: 'Source Sans Pro', sans-serif;
    font-size: 1rem;
    color: var(--secondary-color);
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    opacity: 0.8;
}

.letter {
    background: var(--card-background);
    padding: 4rem;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    margin-bottom: 3rem;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    transition: box-shadow 0.3s ease;
}

.letter:hover {
    box-shadow: 0 15px 40px rgba(0,0,0,0.08);
}

.letter p {
    margin-bottom: 2rem;
    font-size: 1.2rem;
    line-height: 2;
    color: var(--text-color);
}

.letter .opening {
    font-family: 'Merriweather', serif;
    font-size: 1.5rem;
    font-style: italic;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 3rem;
    padding: 0 1rem;
    position: relative;
    line-height: 1.4;
}

.letter .opening::after {
    content: '';
    display: block;
    width: 40px;
    height: 2px;
    background-color: var(--accent-color);
    margin: 1.5rem auto 0;
    opacity: 0.5;
}

.letter .closing {
    font-family: 'Merriweather', serif;
    font-size: 1.3rem;
    font-style: italic;
    color: var(--primary-color);
    text-align: right;
    margin-top: 3rem;
    padding-right: 1rem;
    opacity: 0.9;
}

footer {
    text-align: center;
    padding: 3rem 0 2rem;
    color: var(--secondary-color);
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

footer:hover {
    opacity: 1;
}

.view-source {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--secondary-color);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.view-source:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background-color: var(--card-background);
}

.view-source svg {
    width: 16px;
    height: 16px;
}

@media (min-width: 769px) {
    header {
        flex-direction: row;
        gap: 0;
    }
    
    .header-content {
        margin-bottom: 0;
    }
    
    #theme-toggle {
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        width: auto;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 1.5rem 1rem;
    }
    
    h1 {
        font-size: 2.2rem;
    }
    
    h2 {
        font-size: 1.5rem;
        margin: 2rem 0 1rem;
    }
    
    .letter {
        padding: 2.5rem 2rem;
    }
    
    .letter .opening {
        font-size: 1.2rem;
        padding: 0 1rem;
    }
    
    .letter .closing {
        font-size: 1.1rem;
        padding-right: 1rem;
    }
    
    #theme-toggle {
        margin: 0 auto;
    }
} 