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

:root {
    --text: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --bg: #ffffff;
    --bg-alt: #f8fafc;
    --border: #e2e8f0;
    --gradient-start: #6366f1;
    --gradient-end: #8b5cf6;
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --radius: 12px;
    --radius-sm: 8px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.75;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

.container { max-width: 1060px; margin: 0 auto; padding: 0 1.5rem; }
.container-narrow { max-width: 780px; margin: 0 auto; padding: 0 1.5rem; }

/* Header */
header {
    padding: 1rem 0;
    position: sticky; top: 0;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(12px);
    z-index: 100;
    border-bottom: 1px solid var(--border);
}
header .container { display: flex; justify-content: space-between; align-items: center; }
.brand {
    font-size: 1.3rem; font-weight: 900; text-decoration: none;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
header nav { display: flex; gap: 1.5rem; }
header nav a { text-decoration: none; color: var(--text-secondary); font-size: 0.9rem; font-weight: 500; transition: color 0.15s; }
header nav a:hover { color: var(--text); }

/* Main */
main { min-height: 70vh; }

/* Typography */
h1 { font-size: 2.5rem; font-weight: 900; line-height: 1.15; margin-bottom: 1rem; letter-spacing: -0.03em; }
h2 { font-size: 1.5rem; font-weight: 700; margin: 2.5rem 0 0.75rem; letter-spacing: -0.02em; }
h3 { font-size: 1.2rem; font-weight: 600; margin: 1.75rem 0 0.5rem; }
p { margin-bottom: 1.1rem; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
ul, ol { margin: 0 0 1.1rem 1.5rem; }
li { margin-bottom: 0.4rem; }
blockquote { border-left: 3px solid var(--accent); padding: 1rem 1.5rem; margin: 1.5rem 0; background: linear-gradient(135deg, rgba(99,102,241,0.04), rgba(139,92,246,0.04)); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-style: italic; color: var(--text-secondary); }

/* Hero section (homepage) */
.hero {
    text-align: center;
    padding: 5rem 1.5rem 4rem;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: white;
    margin-bottom: 3rem;
}
.hero h1 { color: white; font-size: 3rem; margin-bottom: 1rem; }
.hero p { font-size: 1.15rem; opacity: 0.9; max-width: 560px; margin: 0 auto 2rem; line-height: 1.6; }

/* Article hero with image overlay */
.article-hero {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 2.5rem;
    min-height: 380px;
    display: flex;
    align-items: flex-end;
}
.article-hero img {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
}
.article-hero-overlay {
    position: relative; z-index: 1;
    width: 100%;
    padding: 3rem 2.5rem 2.5rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.75));
    color: white;
}
.article-hero-overlay h1 { color: white; font-size: 2.2rem; margin-bottom: 0.75rem; }
.article-hero-overlay .article-meta { color: rgba(255,255,255,0.8); }
.article-hero-overlay .category { background: var(--accent); color: white; }

/* Breadcrumb */
.breadcrumb { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { margin: 0 0.4rem; }

/* Article meta */
.article-meta { display: flex; align-items: center; gap: 1rem; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 1.5rem; flex-wrap: wrap; }
.article-meta .category { background: var(--accent); color: white; padding: 0.2rem 0.65rem; border-radius: 20px; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }

/* TOC */
.toc { background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1.25rem 1.5rem; margin-bottom: 2.5rem; }
.toc-title { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-secondary); margin-bottom: 0.75rem; }
.toc ol { margin: 0; padding-left: 1.25rem; }
.toc li { margin-bottom: 0.4rem; font-size: 0.88rem; }
.toc a { color: var(--text-secondary); text-decoration: none; }
.toc a:hover { color: var(--accent); }

/* Article body */
.article-content { padding: 0 0 4rem; }
article img { max-width: 100%; height: auto; border-radius: var(--radius-sm); margin: 1.5rem 0; }

/* Glass cards */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 1.5rem; padding: 0 0 4rem; }
.card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.25s;
    position: relative;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(99,102,241,0.12); border-color: rgba(99,102,241,0.3); }
.card a { text-decoration: none; color: inherit; display: block; }
.card-image { width: 100%; height: 200px; object-fit: cover; display: block; }
.card-body { padding: 1.5rem; }
.card-category { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); margin-bottom: 0.5rem; }
.card-title { font-size: 1.1rem; font-weight: 700; line-height: 1.3; margin-bottom: 0.5rem; color: var(--text); }
.card-excerpt { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.55; margin-bottom: 0.75rem; }
.card-footer { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--text-muted); }

/* Section heading */
.section-heading { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); margin-bottom: 1.5rem; }

/* Footer */
footer { background: var(--bg-alt); border-top: 1px solid var(--border); padding: 3rem 0; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; }
.footer-brand { font-weight: 900; font-size: 1.1rem; margin-bottom: 0.5rem; background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.footer-about p { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.6; }
.footer-heading { font-weight: 700; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 0.75rem; }
.footer-links a { display: block; font-size: 0.85rem; color: var(--text-secondary); text-decoration: none; margin-bottom: 0.4rem; }
.footer-links a:hover { color: var(--accent); }
.footer-legal p { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.25rem; }

/* Animations */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
.hero { animation: slideDown 0.5s ease; }
.card { animation: fadeInUp 0.4s ease both; }
.card:nth-child(2) { animation-delay: 0.06s; }
.card:nth-child(3) { animation-delay: 0.12s; }
.card:nth-child(4) { animation-delay: 0.18s; }

/* Responsive */
@media (max-width: 700px) {
    .hero h1 { font-size: 2rem; }
    .hero { padding: 3rem 1.5rem 2.5rem; }
    h1 { font-size: 1.8rem; }
    .card-grid { grid-template-columns: 1fr; }
    .article-hero { min-height: 260px; }
    .article-hero-overlay { padding: 2rem 1.5rem 1.5rem; }
    .article-hero-overlay h1 { font-size: 1.6rem; }
    header .container { flex-direction: column; gap: 0.75rem; }
    .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
}
