/* ===========================
   CSS Variables - Brand Colors
   =========================== */
:root {
    /* Brand Colors from Style Guide */
    --color-green: #4A7C2C;
    --color-green-dark: #2D5016;
    --color-gold: #D4AF37;
    --color-burgundy: #6D2932;
    --color-black: #2C2C2C;
    --color-silver: #A8A8A8;
    
    /* Neutrals */
    --color-bg: #FDFDF8;
    --color-bg-alt: #F5F5F0;
    --color-text: #2C2C2C;
    --color-text-light: #5A5A5A;
    
    /* Accent & Effects */
    --color-accent: var(--color-green);
    --shadow-sm: 0 2px 8px rgba(74, 124, 44, 0.08);
    --shadow-md: 0 4px 16px rgba(74, 124, 44, 0.12);
    --shadow-lg: 0 8px 32px rgba(74, 124, 44, 0.16);
    
    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 4rem;
    --space-xl: 6rem;
    
    /* Typography */
    --font-display: 'Fraunces', 'Georgia', serif;
    --font-body: 'IBM Plex Sans', -apple-system, sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;
}

/* ===========================
   Font Imports
   =========================== */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,400;0,9..144,600;0,9..144,700;1,9..144,400&family=IBM+Plex+Sans:wght@300;400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

/* ===========================
   Reset & Base
   =========================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    min-height: 100%;
}

body {
    font-family: var(--font-body);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* Organic texture background - extends to all content */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-bg);
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(74, 124, 44, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(212, 175, 55, 0.02) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(109, 41, 50, 0.02) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* ===========================
   Typography
   =========================== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.2;
    color: var(--color-text);
}

h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: 1.25rem; }

p {
    margin-bottom: 1rem;
    font-size: 1.125rem;
    line-height: 1.8;
}

.lead {
    font-size: 1.375rem;
    font-weight: 500;
    color: var(--color-green-dark);
    margin-bottom: var(--space-md);
}

a {
    color: var(--color-green);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--color-green-dark);
}

/* ===========================
   Container & Layout
   =========================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

section {
    padding: var(--space-xl) 0;
    position: relative;
}

/* ===========================
   Navigation
   =========================== */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(253, 253, 248, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(74, 124, 44, 0.1);
    z-index: 1000;
    animation: slideDown 0.6s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.25rem var(--space-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-green-dark);
}

.leaf-icon {
    font-size: 1.5rem;
    animation: breathe 3s ease-in-out infinite;
}

@keyframes breathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.nav-links {
    display: flex;
    gap: var(--space-md);
    list-style: none;
}

.nav-links a {
    font-weight: 500;
    color: var(--color-text);
    position: relative;
}

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

.nav-links a:hover::after {
    width: 100%;
}

/* ===========================
   Hero Section
   =========================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding-top: 80px;
    overflow: hidden;
    background: linear-gradient(135deg, 
        rgba(45, 80, 22, 0.95) 0%,
        rgba(74, 124, 44, 0.85) 50%,
        rgba(109, 41, 50, 0.75) 100%);
}

.hero-content {
    text-align: center;
    max-width: 900px;
    padding: var(--space-md);
    position: relative;
    z-index: 2;
    animation: fadeInUp 0.8s ease 0.3s both;
    color: white;
}

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

.hero-title {
    margin-bottom: var(--space-md);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: white;
    text-shadow: 2px 2px 12px rgba(0,0,0,0.3);
    line-height: 1.1;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: var(--space-lg);
    animation: fadeInUp 0.8s ease 0.6s both;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    text-shadow: 1px 1px 8px rgba(0,0,0,0.3);
    line-height: 1.6;
}

.hero-cta {
    display: flex;
    gap: var(--space-sm);
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 0.8s ease 0.9s both;
}

.btn-primary {
    background: white;
    color: var(--color-green-dark);
    border: 2px solid white;
    font-weight: 600;
}

.btn-primary:hover {
    background: var(--color-green-dark);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.btn-secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
    font-weight: 600;
}

.btn-secondary:hover {
    background: white;
    color: var(--color-green-dark);
    transform: translateY(-2px);
}

/* ===========================
   Buttons
   =========================== */
.btn {
    display: inline-block;
    padding: 1rem 2rem;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-family: var(--font-body);
    font-size: 1.0625rem;
    cursor: pointer;
    border: 2px solid transparent;
}

.btn-primary {
    background: var(--color-green);
    color: white;
    border-color: var(--color-green);
}

.btn-primary:hover {
    background: var(--color-green-dark);
    border-color: var(--color-green-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: transparent;
    color: var(--color-green);
    border-color: var(--color-green);
}

.btn-secondary:hover {
    background: var(--color-green);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ===========================
   Section Titles
   =========================== */
.section-title {
    text-align: center;
    margin-bottom: var(--space-md);
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60%;
    height: 3px;
    background: linear-gradient(90deg, var(--color-green), var(--color-gold));
    border-radius: 2px;
}

.section-intro {
    text-align: center;
    font-size: 1.25rem;
    color: var(--color-text-light);
    margin-bottom: var(--space-lg);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ===========================
   About Section
   =========================== */
.about {
    background: var(--color-bg-alt);
    position: relative;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
}

.about-text h3 {
    margin-top: var(--space-lg);
    margin-bottom: var(--space-sm);
    color: var(--color-green-dark);
}

.about-text em {
    font-style: italic;
    color: var(--color-green);
}

.about-text .thanks {
    text-align: center;
    font-size: 1.25rem;
    margin-top: var(--space-lg);
    color: var(--color-green);
}

/* ===========================
   Writing Section
   =========================== */
.writing {
    background: var(--color-bg);
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

.post-card {
    background: white;
    padding: var(--space-md);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border: 1px solid rgba(74, 124, 44, 0.1);
    cursor: pointer;
}

.post-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-green);
}

.post-tag {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    background: linear-gradient(135deg, var(--color-green), var(--color-gold));
    color: white;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: var(--space-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.post-title {
    margin-bottom: var(--space-sm);
    font-size: 1.5rem;
    color: var(--color-text);
}

.post-excerpt {
    color: var(--color-text-light);
    margin-bottom: var(--space-sm);
    line-height: 1.6;
}

.post-link {
    color: var(--color-green);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: gap 0.3s ease;
}

.post-link:hover {
    gap: 0.5rem;
}

/* ===========================
   Individual Post Pages
   =========================== */
.post-page {
    min-height: 100vh;
    padding-top: 80px;
}

.post-header {
    background: var(--color-bg-alt);
    padding: var(--space-lg) 0 var(--space-md);
    border-bottom: 1px solid rgba(74, 124, 44, 0.1);
}

.container-narrow {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.back-link {
    display: inline-flex;
    align-items: center;
    color: var(--color-green);
    font-weight: 500;
    margin-bottom: var(--space-sm);
    transition: all 0.3s ease;
}

.back-link:hover {
    transform: translateX(-4px);
}

.post-header .post-tag {
    margin-bottom: var(--space-sm);
}

.post-header h1 {
    color: var(--color-green-dark);
    margin-bottom: 0;
}

.post-body {
    padding: var(--space-xl) 0;
}

.post-body h2 {
    color: var(--color-green-dark);
    margin-top: var(--space-lg);
    margin-bottom: var(--space-sm);
}

.post-body h3 {
    color: var(--color-green);
    margin-top: var(--space-md);
    margin-bottom: var(--space-sm);
}

.post-body p {
    margin-bottom: var(--space-sm);
}

.post-body strong {
    color: var(--color-green-dark);
    font-weight: 600;
}

.post-body ul, .post-body ol {
    margin-left: var(--space-md);
    margin-bottom: var(--space-sm);
}

.post-body li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

    margin-top: var(--space-xl);
    padding-top: var(--space-md);
    border-top: 2px solid rgba(74, 124, 44, 0.2);
    text-align: center;
}

/* ===========================
   Contact Section
   =========================== */
.contact {
    background: linear-gradient(135deg, var(--color-green-dark), var(--color-green));
    color: white;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: var(--space-lg);
    padding-top: var(--space-md);
    border-top: 2px solid rgba(74, 124, 44, 0.2);
}

.tag {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    background: var(--color-bg-alt);
    color: var(--color-green);
    border-radius: 20px;
    font-size: 0.875rem;
    border: 1px solid var(--color-green);
    font-weight: 500;
}

.contact .section-title {
    color: white;
}

.contact .section-title::after {
    background: linear-gradient(90deg, var(--color-gold), white);
}

.contact-intro {
    text-align: center;
    font-size: 1.25rem;
    margin-bottom: var(--space-lg);
    color: rgba(255, 255, 255, 0.9);
}

.contact-content {
    max-width: 600px;
    margin: 0 auto;
}

.contact-info h3 {
    color: white;
    margin-bottom: var(--space-sm);
}

.contact-info p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: var(--space-md);
}

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

.contact-tags .tag {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-color: rgba(255, 255, 255, 0.4);
}

/* ===========================
   Footer
   =========================== */
.footer {
    background: var(--color-text);
    color: white;
    text-align: center;
    padding: var(--space-md);
}

.footer p {
    font-size: 0.9375rem;
    margin-bottom: 0.5rem;
}

.footer-note {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
}

/* ===========================
   Responsive Design
   =========================== */
@media (max-width: 768px) {
    :root {
        --space-lg: 3rem;
        --space-xl: 4rem;
    }
    
    .nav-links {
        gap: var(--space-sm);
    }
    
    .hero {
        min-height: 80vh;
    }
    
    .hero-cta {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 280px;
        text-align: center;
    }
    
    .posts-grid {
        grid-template-columns: 1fr;
    }
    
    .post-container {
        padding: var(--space-md);
        margin: var(--space-sm);
        border-radius: 8px;
    }
    
    .post-close {
        top: var(--space-sm);
        right: var(--space-sm);
    }
}

@media (max-width: 480px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .nav-links {
        justify-content: center;
    }
    
    .hero-decoration {
        width: 200px;
        height: 200px;
    }
}

/* ===========================
   Accessibility
   =========================== */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
a:focus,
button:focus {
    outline: 2px solid var(--color-gold);
    outline-offset: 2px;
}
