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

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --bg: #fafafa;
    --surface: #fff;
    --surface-raised: #f5f5f5;
    --border: #e8e8e8;
    --text: #1a1a1a;
    --text-secondary: #555;
    --text-muted: #999;
    --accent: #e63946;
    --accent-hover: #c5303c;
    --link: #2563eb;
    --link-hover: #1d4ed8;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --max-width: 680px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
    --radius: 8px;
}

html { font-size: 17px; }

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.75;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

/* Header */
header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0.875rem 2rem;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: var(--shadow-sm);
}

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

.logo {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.03em;
}

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

.lang-toggle {
    display: flex;
    gap: 0.125rem;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    background: var(--surface-raised);
    border-radius: 6px;
    padding: 2px;
}

.lang-toggle a {
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.25rem 0.625rem;
    border-radius: 4px;
    transition: all 0.15s;
}

.lang-toggle a:hover {
    color: var(--text);
    background: var(--surface);
}

.lang-active {
    color: var(--text);
    font-weight: 600;
    padding: 0.25rem 0.625rem;
    background: var(--surface);
    border-radius: 4px;
    box-shadow: var(--shadow-sm);
}

/* Main */
main {
    flex: 1;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 3rem 2rem;
    width: 100%;
}

/* Article content */
.article-content h1 {
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 0.5rem;
    color: var(--text);
    letter-spacing: -0.035em;
}

.article-content h1 + p {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
}

.article-content h2 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-top: 2.75rem;
    margin-bottom: 0.75rem;
    color: var(--text);
    letter-spacing: -0.02em;
}

.article-content h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 0.5rem;
    color: var(--accent);
}

.article-content p {
    margin-bottom: 1.25rem;
    color: var(--text-secondary);
}

.article-content a {
    color: var(--link);
    text-decoration: none;
    border-bottom: 1px solid rgba(37, 99, 235, 0.25);
    transition: border-color 0.15s;
}

.article-content a:hover {
    border-color: var(--link);
}

.article-content strong {
    color: var(--text);
    font-weight: 600;
}

.article-content em {
    font-style: italic;
}

.article-content blockquote {
    border-left: 3px solid var(--accent);
    padding: 1rem 1.5rem;
    margin: 1.75rem 0;
    background: var(--surface);
    border-radius: 0 var(--radius) var(--radius) 0;
    box-shadow: var(--shadow-sm);
}

.article-content blockquote p {
    margin-bottom: 0;
    color: var(--text-secondary);
    font-style: italic;
}

.article-content ul, .article-content ol {
    margin: 1rem 0 1.5rem 1.5rem;
    color: var(--text-secondary);
}

.article-content li {
    margin-bottom: 0.5rem;
}

.article-content li strong {
    color: var(--text);
}

.article-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2.5rem 0;
}

.article-content code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    background: var(--surface-raised);
    padding: 0.15em 0.4em;
    border-radius: 4px;
    border: 1px solid var(--border);
}

.article-content pre {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    box-shadow: var(--shadow-sm);
}

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

/* Home page */
.home {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 55vh;
    padding-top: 4rem;
}

.home h1 {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.05em;
    margin-bottom: 1rem;
    line-height: 1;
}

.home h1 span {
    color: var(--accent);
}

.home .tagline {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 440px;
    line-height: 1.65;
    margin-bottom: 3rem;
}

.home-articles {
    width: 100%;
    max-width: 480px;
}

.home-articles h2 {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.article-link {
    display: block;
    padding: 1rem 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    transition: all 0.15s;
    box-shadow: var(--shadow-sm);
}

.article-link:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.article-link .arrow {
    color: var(--text-muted);
    transition: color 0.15s;
    float: right;
}

.article-link:hover .arrow {
    color: var(--accent);
}

/* Footer */
footer {
    border-top: 1px solid var(--border);
    padding: 1.5rem 2rem;
    margin-top: auto;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 600px) {
    html { font-size: 16px; }
    main { padding: 2rem 1.25rem; }
    header { padding: 0.75rem 1.25rem; }
    .article-content h1 { font-size: 1.75rem; }
    .home { padding-top: 2rem; }
    .home h1 { font-size: 2.5rem; }
}
