:root {
    --bg-main: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --accent-blue: #0ea5e9;
    --accent-dark: #0369a1;
    --header-bg: rgba(255, 255, 255, 0.95);
    --border-color: #e2e8f0;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { 
    background: var(--bg-main); 
    color: var(--text-main); 
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; 
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Header Navigation */
header { 
    background: var(--header-bg); 
    border-bottom: 1px solid var(--border-color); 
    position: sticky; 
    top: 0; 
    z-index: 100; 
    backdrop-filter: blur(12px);
}
.header-container { 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 1rem 2rem; 
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img { height: 32px; width: auto; display: block; }

.main-nav ul { list-style: none; display: flex; gap: 2.5rem; }
.main-nav ul li a { 
    color: var(--text-main); 
    text-decoration: none; 
    font-weight: 600; 
    font-size: 0.9rem;
    transition: var(--transition); 
    position: relative;
    padding: 0.5rem 0;
}
.main-nav ul li a:hover { color: var(--accent-blue); }
.main-nav ul li a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-blue);
    transition: var(--transition);
}
.main-nav ul li a:hover::after { width: 100%; }

/* Main Container & Article Styling */
.container { 
    max-width: 1100px; /* Increased to match homepage grid for consistent width */
    margin: 0 auto; 
    padding: 0 1.5rem; /* Slightly tighter outer padding */
}

/* Homepage specific override for wide grid */
main > .container:has(.feature-grid), 
main > .hero + .container,
main > .container:has(.post-grid) {
    max-width: 1100px;
    background: transparent;
    box-shadow: none;
    padding: 0 1.5rem;
}

/* The Article Card - Maximized space utilization */
main > .container:not(:has(.feature-grid)):not(:has(.post-grid)):not(.hero-inner) {
    background: #ffffff;
    padding: 3rem 3.5rem; /* Drastically reduced internal padding */
    border-radius: 32px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 10px 15px -3px rgba(0, 0, 0, 0.03);
    border: 1px solid var(--border-color);
    margin-top: 3rem;
    margin-bottom: 6rem;
}

/* Article Content Typography */
.container h1 {
    font-size: clamp(2.2rem, 6vw, 3.6rem);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -0.05em;
    margin: 0 0 2rem 0;
    color: var(--text-main);
}

.container h1::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--accent-blue);
    margin-top: 1.5rem;
    border-radius: 2px;
}

.container h2 {
    font-size: 1.75rem;
    font-weight: 850;
    margin: 3.5rem 0 1.5rem;
    letter-spacing: -0.02em;
    color: var(--text-main);
    border-left: 4px solid var(--accent-blue);
    padding-left: 1.5rem;
}

.container p {
    font-size: 1.15rem;
    line-height: 1.85;
    color: #334155;
    margin-bottom: 1.75rem;
}

.container blockquote {
    margin: 3rem 0;
    padding: 2rem;
    background: #f8fafc;
    border-radius: 24px;
    font-style: italic;
    font-size: 1.2rem;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.container ul, .container ol {
    margin-bottom: 2.5rem;
    padding-left: 1.5rem;
}

.container li {
    font-size: 1.15rem;
    line-height: 1.7;
    margin-bottom: 0.75rem;
    color: #475569;
}

.container img {
    max-width: 100%;
    height: auto;
    border-radius: 24px;
    margin: 2.5rem 0;
}

.container a:not(.post-card):not(.feature-card):not(.btn-primary):not(.btn-hero-primary):not(.btn-hero-secondary) {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 700;
    box-shadow: inset 0 -4px 0 rgba(14, 165, 233, 0.15);
    transition: var(--transition);
}

.container a:not(.post-card):not(.feature-card):not(.btn-primary):not(.btn-hero-primary):not(.btn-hero-secondary):hover {
    box-shadow: inset 0 -25px 0 rgba(14, 165, 233, 0.1);
}

/* Page Title override (for list pages) */
.page-title {
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 3rem;
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    main > .container:not(:has(.feature-grid)):not(:has(.post-grid)) {
        padding: 2.5rem 2rem;
    }
}

@media (max-width: 768px) {
    .header-container { flex-direction: column; gap: 1rem; padding: 1rem; }
    .main-nav ul { gap: 1.25rem; flex-wrap: wrap; justify-content: center; }
    .container { padding: 0 1rem; }
    
    main > .container:not(:has(.feature-grid)):not(:has(.post-grid)) {
        padding: 2rem 1rem; /* Minimized padding for edge-to-edge feel */
        border-radius: 0;
        border: none;
        margin: 0;
    }
    
    .container h1 { font-size: 2.2rem; }
    .container h2 { padding-left: 1rem; }
}

/* Homepage Hero */
.hero {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    padding: 4rem 1.5rem;
    text-align: center;
    background: #ffffff;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid #f1f5f9;
}
.hero h1 { 
    font-size: clamp(2rem, 5vw, 3.5rem); 
    font-weight: 800; 
    letter-spacing: -0.02em; 
    margin-bottom: 1.5rem;
    line-height: 1.1;
}
.hero p { 
    font-size: clamp(1rem, 2vw, 1.2rem); 
    color: #94a3b8; 
    max-width: 700px; 
    margin: 0 auto 3rem; 
}

/* Section Titles */
h2.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
h2.section-title::after {
    content: '';
    flex-grow: 1;
    height: 1px;
    background: var(--border-color);
}

/* Feature Grid */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 4rem;
}

.feature-card {
    background: white;
    padding: 2.5rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}
.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.05);
    border-color: var(--accent-blue);
}
.feature-card h3 { font-size: 1.5rem; margin-bottom: 1rem; font-weight: 700; }
.feature-card p { color: var(--text-muted); font-size: 1rem; flex-grow: 1; }

/* Fixed & Beautiful Footer */
.site-footer {
    background: #ffffff;
    border-top: 1px solid var(--border-color);
    padding-top: 4rem;
    margin-top: 6rem;
}
.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 3rem;
}
.footer-brand { flex: 1; min-width: 280px; max-width: 400px; }
.footer-logo { height: 32px; margin-bottom: 1.25rem; }
.footer-brand p { color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; }

.footer-links {
    flex: 2;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2rem;
    min-width: 300px;
}
.footer-col { min-width: 140px; }
.footer-col h4 {
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1.25rem;
    color: var(--text-main);
}
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 0.5rem; }
.footer-col ul li a { 
    color: var(--text-muted); 
    text-decoration: none; 
    font-size: 0.9rem; 
    transition: var(--transition);
}
.footer-col ul li a:hover { color: var(--accent-blue); }

.footer-bottom {
    margin-top: 4rem;
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 0;
    background: #f8fafc;
}
.footer-bottom .footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Buttons */
.btn-primary {
    display: inline-block;
    background: var(--accent-blue);
    color: white;
    padding: 0.75rem 1.75rem;
    border-radius: 99px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}
.btn-primary:hover { background: var(--accent-dark); transform: scale(1.02); }
