:root {
    /* Light Mode Palette: Impressionist Warmth */
    --bg-color: #fcfaf2; /* Warm Cream/Paper */
    --bg-texture: url('https://www.transparenttextures.com/patterns/canvas-orange.png'); /* Subtle canvas texture */
    --card-bg: rgba(255, 255, 255, 0.85);
    --text-primary: #2d2d2a; /* Deep charcoal with warmth */
    --text-secondary: #5c5c56;
    --accent-color: #b8860b; /* Dark Goldenrod */
    --accent-soft: #8f9779; /* Sage Green */
    --border-color: rgba(184, 134, 11, 0.15);
    --glass-blur: 8px;
    --transition: 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@media (prefers-color-scheme: dark) {
    :root {
        /* Dark Mode Palette: Nocturnal Impressionism */
        --bg-color: #1a1a18; /* Deep Sepia/Charcoal */
        --bg-texture: url('https://www.transparenttextures.com/patterns/canvas-orange.png');
        --card-bg: rgba(30, 30, 28, 0.9);
        --text-primary: #e0e0d6;
        --text-secondary: #a0a095;
        --accent-color: #d4af37; /* Brighter Gold for dark mode */
        --accent-soft: #6b7a5e; /* Muted Olive */
        --border-color: rgba(212, 175, 55, 0.1);
    }
}

/* Nav Bar */
nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent;
    transition: background 0.3s ease, padding 0.3s ease;
}

nav.scrolled {
    background: rgba(var(--bg-color), 0.8);
    backdrop-filter: blur(10px);
    padding: 15px 40px;
    border-bottom: 1px solid var(--border-color);
}

.nav-logo {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--text-primary);
    text-decoration: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

nav.scrolled .nav-logo {
    opacity: 1;
}

.lang-toggle {
    display: flex;
    gap: 15px;
}

.lang-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 5px 0;
    position: relative;
    transition: color 0.3s ease;
}

.lang-btn.active {
    color: var(--accent-color);
}

.lang-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent-color);
    transition: width 0.3s ease;
}

.lang-btn.active::after {
    width: 100%;
}

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

body {
    font-family: 'Merriweather', serif;
    background-color: var(--bg-color);
    background-image: var(--bg-texture);
    color: var(--text-primary);
    line-height: 1.8;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.5s ease, color 0.5s ease;
}

/* Typography */
h1, h2, h3 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Header Section */
header {
    height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 20px;
    position: relative;
    margin-bottom: 80px;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 150%;
    height: 150%;
    background: radial-gradient(circle, var(--accent-soft) 0%);
    opacity: 0.1;
    transform: translate(-50%, -50%);
    z-index: -1;
}

header h1 {
    font-size: clamp(3.5rem, 12vw, 7rem);
    margin-bottom: 0.1em;
    color: var(--text-primary);
    font-style: italic;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInReveal 1.2s ease forwards;
}

header p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 650px;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInReveal 1.2s ease 0.4s forwards;
}

header a {
    color: var(--accent-color);
    text-decoration: none;
    position: relative;
    padding-bottom: 2px;
}

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

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

/* Main Content */
main {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 24px 120px;
}

/* Post Styling */
article.post {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px; /* More classical, less rounded than modern glass */
    padding: 60px;
    margin-bottom: 150px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.03);
    opacity: 0;
    transform: translateY(30px) scale(0.98);
    transition: transform 1s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 1s ease;
    position: relative;
    border-radius: 12px;

}

article.post.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.post-text {
    margin-bottom: 50px;
    border-left: 2px solid var(--accent-soft);
    padding-left: 30px;
}

.post-text p {
    font-size: 1.1rem;
    margin-bottom: 1.2em;
    font-style: italic;
}

/* Image Container */
.post-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.post-footer {
    text-align: center;
    font-style: italic;
    font-size:90%
}

.post-images img {
    width: 100%;
    height: auto;
    border-radius: 2px;
    display: block;
    transition: var(--transition);
    filter: sepia(0.1) contrast(1.05); /* Painterly feel */
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.post-images img:hover {
    transform: scale(1.01) translateY(-5px);
    filter: sepia(0) contrast(1.1);
    cursor: zoom-in;
}

/* Lightbox */
#lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    cursor: zoom-out;
}

#lightbox.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

#lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
    transform: scale(0.95);
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#lightbox.active img {
    transform: scale(1);
}

/* Back to Top */
#back-to-top {
    position: fixed;
    bottom: 40px;
    right: 40px;
    width: 50px;
    height: 50px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--accent-color);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

#back-to-top:hover {
    transform: translateY(-5px);
    background: var(--accent-color);
    color: #fff;
}

/* Link Preview */
.link-preview {
    margin-bottom: 100px;
    padding: 40px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    text-align: center;
}

.link-preview a {
    font-family: 'Playfair Display', serif;
    font-size: 1.75rem;
    color: var(--accent-color);
    text-decoration: none;
    font-style: italic;
    position: relative;
    padding-bottom: 4px;
}

.link-preview a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent-color);
    transition: width 0.3s ease;
}

.link-preview a:hover::after {
    width: 100%;
}

/* Footer Decoration */
.post::after {
    content: '';
    position: absolute;
    bottom: -75px;
    left: 50%;
    width: 60px;
    height: 1px;
    background: var(--accent-soft);
    opacity: 0.3;
}

/* Animations */
@keyframes fadeInReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-soft);
    border-radius: 10px;
    border: 2px solid var(--bg-color);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    header h1 {
        font-size: 3.5rem;
    }

    article.post {
        padding: 30px 20px;
        margin-bottom: 100px;
    }

    .post-text {
        padding-left: 20px;
    }

    .post-images {
        grid-template-columns: 1fr;
    }
}
