/* ==================== CSS VARIABLES ==================== */
:root {
    --color-bg: #FAFAF8;
    --color-text: #1a1a1a;
    --color-text-secondary: #4a4a4a;
    --color-accent: #0066CC;
    --color-accent-hover: #0052A3;
    --color-highlight: #FFF3CD;
    --color-border: #E8E8E4;
    --color-code-bg: #F4F4F0;
    --color-extreme: #FF6B35;
    --color-grounded: #2D8A6B;
    --font-display: 'Fraunces', Georgia, serif;
    --font-body: 'Source Sans 3', -apple-system, sans-serif;
    --max-width: 720px;
    --max-width-wide: 1200px;
    --spacing-unit: 1.5rem;
}

/* ==================== RESET & BASE ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 18px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

/* ==================== HEADER ==================== */
.site-header {
    padding: var(--spacing-unit) 0;
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    background: var(--color-bg);
    z-index: 100;
}

.site-header nav {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-unit);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-logo {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--color-text);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.logo-tagline {
    font-family: var(--font-body);
    font-size: 0.65rem;
    font-weight: 400;
    color: var(--color-text-secondary);
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
}

.nav-links a {
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}

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

/* ==================== CONTAINER ==================== */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-unit);
}

/* ==================== HERO SECTION ==================== */
.hero {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: calc(var(--spacing-unit) * 4) 0;
    text-align: center;
    border-bottom: 1px solid var(--color-border);
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 var(--spacing-unit);
}

.hero h1 {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.hero p {
    font-size: 1.25rem;
    color: var(--color-text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* ==================== SECTIONS ==================== */
.featured-section,
.recent-posts,
.newsletter-section {
    padding: calc(var(--spacing-unit) * 3) 0;
}

.section-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: calc(var(--spacing-unit) * 2);
    color: var(--color-text);
}

/* ==================== FEATURED POST ==================== */
.featured-post {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.post-header-image {
    height: 300px;
    position: relative;
    overflow: hidden;
}

.featured-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 40%;
}

.fractal-background {
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(135deg, rgba(0,102,204,0.1) 0%, rgba(45,138,107,0.1) 100%),
        repeating-linear-gradient(45deg, transparent, transparent 20px, rgba(0,102,204,0.05) 20px, rgba(0,102,204,0.05) 40px),
        repeating-linear-gradient(-45deg, transparent, transparent 20px, rgba(45,138,107,0.05) 20px, rgba(45,138,107,0.05) 40px);
}

.fractal-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(0,102,204,0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(45,138,107,0.15) 0%, transparent 50%);
}

.post-content-preview {
    padding: calc(var(--spacing-unit) * 1.5);
}

.post-category {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-accent);
    margin-bottom: 1rem;
}

.featured-post h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
}

.featured-post h2 a {
    color: var(--color-text);
    text-decoration: none;
    transition: color 0.2s;
}

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

.post-excerpt {
    font-size: 1.1rem;
    color: var(--color-text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.post-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    margin-bottom: 1rem;
}

.read-more {
    display: inline-block;
    color: var(--color-accent);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

.read-more:hover {
    color: var(--color-accent-hover);
}

/* ==================== POSTS GRID ==================== */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.post-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid var(--color-border);
    transition: transform 0.2s, box-shadow 0.2s;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.post-card h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
    margin: 1rem 0;
}

.post-card h3 a {
    color: var(--color-text);
    text-decoration: none;
    transition: color 0.2s;
}

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

.post-card p {
    color: var(--color-text-secondary);
    margin-bottom: 1rem;
}

/* ==================== NEWSLETTER ==================== */
.newsletter-section {
    background: var(--color-text);
    color: white;
}

.newsletter-box {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.newsletter-box h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    margin-bottom: 1rem;
    color: white;
}

.newsletter-box p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.newsletter-form {
    display: flex;
    gap: 1rem;
    max-width: 500px;
    margin: 0 auto;
}

.newsletter-form input {
    flex: 1;
    padding: 0.85rem 1.25rem;
    border: none;
    border-radius: 100px;
    font-size: 1rem;
}

.newsletter-form button {
    padding: 0.85rem 2rem;
    background: white;
    color: var(--color-text);
    border: none;
    border-radius: 100px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.newsletter-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(255,255,255,0.2);
}

/* ==================== FOOTER ==================== */
.site-footer {
    background: #f8f9fa;
    padding: calc(var(--spacing-unit) * 2) 0;
    border-top: 1px solid var(--color-border);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    font-family: var(--font-display);
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-section a:hover {
    color: var(--color-accent);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    font-size: 0.9rem;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    html {
        font-size: 16px;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .posts-grid {
        grid-template-columns: 1fr;
    }
    
    .newsletter-form {
        flex-direction: column;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
}
