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

:root {
    --color-bg: #ffffff;
    --color-bg-alt: #f8fafc;
    --color-text: #0f172a;
    --color-text-muted: #64748b;
    --color-primary: #2563eb;
    --color-primary-hover: #1d4ed8;
    --color-border: #e2e8f0;
    --color-card: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius: 12px;
    --radius-sm: 8px;
    --container: 1200px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html {
    scroll-behavior: smooth;
}

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

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}

/* Typography */
h1, h2, h3 {
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--color-primary-hover);
}

/* Header */
.header {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border);
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 20px;
    color: var(--color-text);
}

.logo:hover {
    color: var(--color-text);
}

.logo-icon {
    font-size: 24px;
}

.nav {
    display: flex;
    gap: 32px;
}

.nav-link {
    font-weight: 500;
    color: var(--color-text-muted);
    font-size: 15px;
    transition: color 0.2s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--color-text);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    gap: 6px;
}

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

.btn-primary:hover {
    background: var(--color-primary-hover);
    color: white;
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--color-text);
    border: 1.5px solid var(--color-border);
}

.btn-outline:hover {
    border-color: var(--color-text);
    color: var(--color-text);
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
    border-radius: var(--radius);
}

/* Hero */
.hero {
    padding: 100px 0 80px;
    text-align: center;
    background: linear-gradient(180deg, var(--color-bg) 0%, var(--color-bg-alt) 100%);
}

.hero-title {
    font-size: clamp(40px, 6vw, 64px);
    margin-bottom: 24px;
    background: linear-gradient(135deg, var(--color-text) 0%, var(--color-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 20px;
    color: var(--color-text-muted);
    max-width: 640px;
    margin: 0 auto 40px;
    line-height: 1.6;
}

.hero-cta {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Sections */
section {
    padding: 80px 0;
}

.section-header {
    text-align: center;
    max-width: 640px;
    margin: 0 auto 60px;
}

.section-title {
    font-size: 36px;
    margin-bottom: 16px;
}

.section-desc {
    font-size: 18px;
    color: var(--color-text-muted);
}

.section-link {
    font-weight: 600;
}

/* Features */
.features {
    background: var(--color-bg-alt);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.feature-card {
    background: var(--color-card);
    padding: 32px;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    transition: all 0.3s;
}

.feature-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    border-color: transparent;
}

.feature-icon {
    font-size: 40px;
    margin-bottom: 20px;
}

.feature-title {
    font-size: 22px;
    margin-bottom: 12px;
}

.feature-desc {
    color: var(--color-text-muted);
    margin-bottom: 20px;
    line-height: 1.6;
}

.feature-link {
    font-weight: 600;
    font-size: 15px;
}

/* Latest Posts */
.latest .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: none;
    text-align: left;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 24px;
}

.post-card {
    background: var(--color-card);
    padding: 28px;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    transition: all 0.2s;
}

.post-card:hover {
    box-shadow: var(--shadow);
    border-color: var(--color-primary);
}

.post-meta {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 13px;
}

.post-category {
    background: var(--color-bg-alt);
    color: var(--color-primary);
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
}

.post-date {
    color: var(--color-text-muted);
}

.post-title {
    font-size: 20px;
    margin-bottom: 12px;
    line-height: 1.3;
}

.post-excerpt {
    color: var(--color-text-muted);
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 16px;
}

.post-link {
    font-weight: 600;
    font-size: 14px;
}

/* CTA Section */
.cta-section {
    background: var(--color-bg-alt);
}

.cta-box {
    background: linear-gradient(135deg, var(--color-primary) 0%, #4f46e5 100%);
    color: white;
    padding: 64px;
    border-radius: var(--radius);
    text-align: center;
}

.cta-title {
    font-size: 32px;
    margin-bottom: 16px;
}

.cta-desc {
    font-size: 18px;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 32px;
}

.cta-box .btn-primary {
    background: white;
    color: var(--color-primary);
}

.cta-box .btn-primary:hover {
    background: var(--color-bg-alt);
}

/* Footer */
.footer {
    background: var(--color-text);
    color: white;
    padding: 48px 0 24px;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 32px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
}

.footer-links {
    display: flex;
    gap: 32px;
}

.footer-link {
    color: rgba(255, 255, 255, 0.7);
    font-size: 15px;
}

.footer-link:hover {
    color: white;
}

.social-link {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.social-link:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 24px;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
}

.footer-bottom a {
    color: rgba(255, 255, 255, 0.7);
}

.footer-bottom a:hover {
    color: white;
}

/* Mobile */
@media (max-width: 768px) {
    .nav {
        display: none;
    }
    
    .header .btn {
        display: none;
    }
    
    .hero {
        padding: 60px 0 50px;
    }
    
    .hero-subtitle {
        font-size: 18px;
    }
    
    .hero-cta {
        flex-direction: column;
    }
    
    .hero-cta .btn {
        width: 100%;
    }
    
    section {
        padding: 60px 0;
    }
    
    .features-grid,
    .posts-grid {
        grid-template-columns: 1fr;
    }
    
    .latest .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .cta-box {
        padding: 40px 24px;
    }
    
    .cta-title {
        font-size: 24px;
    }
    
    .footer-inner {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Page Header for subpages */
.page-header {
    background: linear-gradient(180deg, var(--color-bg-alt) 0%, var(--color-bg) 100%);
    padding: 80px 0 40px;
    text-align: center;
}

.page-title {
    font-size: clamp(32px, 5vw, 48px);
    margin-bottom: 16px;
}

.page-desc {
    font-size: 18px;
    color: var(--color-text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* Case/Story cards */
.case-card {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.3s;
}

.case-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.case-image {
    height: 200px;
    background: linear-gradient(135deg, var(--color-bg-alt) 0%, var(--color-border) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
}

.case-content {
    padding: 24px;
}

.case-title {
    font-size: 20px;
    margin-bottom: 12px;
}

.case-desc {
    color: var(--color-text-muted);
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.case-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--color-text-muted);
}

.case-author {
    display: flex;
    align-items: center;
    gap: 8px;
}

.author-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--color-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

/* Filter tags */
.filter-tags {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.filter-tag {
    padding: 8px 20px;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: 24px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.filter-tag:hover,
.filter-tag.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

/* Article page */
.article {
    max-width: 720px;
    margin: 0 auto;
    padding: 60px 0;
}

.article-header {
    margin-bottom: 48px;
}

.article-title {
    font-size: 40px;
    margin-bottom: 24px;
    line-height: 1.2;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--color-text-muted);
    font-size: 15px;
}

.article-content {
    font-size: 18px;
    line-height: 1.8;
}

.article-content p {
    margin-bottom: 24px;
}

.article-content h2 {
    font-size: 28px;
    margin: 48px 0 24px;
}

.article-content h3 {
    font-size: 22px;
    margin: 36px 0 16px;
}

.article-content ul,
.article-content ol {
    margin-bottom: 24px;
    padding-left: 24px;
}

.article-content li {
    margin-bottom: 8px;
}

.article-content blockquote {
    border-left: 4px solid var(--color-primary);
    padding-left: 24px;
    margin: 32px 0;
    font-style: italic;
    color: var(--color-text-muted);
}

.article-content code {
    background: var(--color-bg-alt);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: 'Monaco', 'Consolas', monospace;
}

.article-content pre {
    background: var(--color-text);
    color: white;
    padding: 24px;
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 24px 0;
}

.article-content pre code {
    background: none;
    padding: 0;
}
