:root {
    --bg: #ffffff;
    --text: #202124;
    --muted: #6b7280;
    --border: #e5e7eb;
    --link: #2563eb;
    --link-hover: #1d4ed8;
    --code-bg: #f6f7f9;
    --max-width: 900px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;
    line-height: 1.7;
}

a {
    color: var(--link);
    text-decoration: none;
}

a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

/* Site header */

.site-header {
    border-bottom: 1px solid var(--border);
    background: #ffffff;
}

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

.site-title {
    color: var(--text);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.site-title:hover {
    text-decoration: none;
}

.site-nav {
    display: flex;
    gap: 20px;
}

.site-nav a {
    color: var(--muted);
    font-size: 0.95rem;
}

.site-nav a:hover {
    color: var(--text);
}

/* Main content */

main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 60px 24px 100px;
}

/* Homepage */

.hero {
    margin-bottom: 70px;
}

.hero h1 {
    margin: 0 0 16px;
    font-size: clamp(2.4rem, 6vw, 4rem);
    line-height: 1.1;
    letter-spacing: -0.045em;
}

.hero p {
    max-width: 650px;
    margin: 0;
    color: var(--muted);
    font-size: 1.2rem;
}

.section-title {
    margin: 0 0 25px;
    font-size: 1.5rem;
    letter-spacing: -0.02em;
}

.article-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.article-card {
    padding: 28px 0;
    border-top: 1px solid var(--border);
}

.article-card:last-child {
    border-bottom: 1px solid var(--border);
}

.article-card h2 {
    margin: 0 0 6px;
    font-size: 1.35rem;
    line-height: 1.3;
}

.article-card h2 a {
    color: var(--text);
}

.article-card h2 a:hover {
    color: var(--link);
    text-decoration: none;
}

.article-date {
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.article-excerpt {
    color: #4b5563;
    margin: 0;
}

/* Article pages */

.article {
    max-width: 760px;
    margin: 0 auto;
}

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

.article-header h1 {
    margin: 0 0 12px;
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    line-height: 1.12;
    letter-spacing: -0.04em;
}

.article-content {
    font-size: 1.05rem;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4 {
    margin-top: 2em;
    margin-bottom: 0.7em;
    line-height: 1.3;
    letter-spacing: -0.025em;
}

.article-content h2 {
    font-size: 1.7rem;
}

.article-content h3 {
    font-size: 1.35rem;
}

.article-content p {
    margin: 1.2em 0;
}

.article-content ul,
.article-content ol {
    padding-left: 1.5rem;
}

.article-content li {
    margin: 0.4rem 0;
}

/* Images */

.article-content img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 30px auto;
    border-radius: 8px;
}

/* Code */

.article-content code {
    padding: 0.15em 0.35em;
    background: var(--code-bg);
    border-radius: 4px;
    font-family:
        "SFMono-Regular",
        Consolas,
        "Liberation Mono",
        monospace;
    font-size: 0.9em;
}

.article-content pre {
    overflow-x: auto;
    padding: 20px;
    background: #f6f7f9;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin: 25px 0;
}

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

/* Quotes */

.article-content blockquote {
    margin: 25px 0;
    padding: 5px 20px;
    border-left: 4px solid var(--border);
    color: var(--muted);
}

/* Tables */

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 30px 0;
}

.article-content th,
.article-content td {
    padding: 10px 12px;
    border: 1px solid var(--border);
    text-align: left;
}

.article-content th {
    background: #f9fafb;
}

/* Horizontal rules */

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

/* Footer */

.site-footer {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 30px 24px 50px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.9rem;
}

/* Mobile */

@media (max-width: 600px) {
    .header-inner {
        padding: 18px 20px;
    }

    .site-nav {
        gap: 12px;
    }

    main {
        padding: 45px 20px 70px;
    }

    .hero {
        margin-bottom: 50px;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .article-header h1 {
        font-size: 2.3rem;
    }
}
