:root {
    --bg: #ffffff;
    --bg-alt: #fafafa;
    --text: #1a1a1a;
    --text-muted: #666;
    --accent: #007aff;
    --accent-dark: #0056b3;
    --indigo: #5856d6;
    --border: rgba(0, 0, 0, 0.08);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #1c1c1e;
        --bg-alt: #2c2c2e;
        --text: #f5f5f7;
        --text-muted: #a1a1a6;
        --border: rgba(255, 255, 255, 0.1);
    }
}

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

html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

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

nav {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border);
    z-index: 100;
}
@media (prefers-color-scheme: dark) {
    nav { background: rgba(28, 28, 30, 0.85); }
}
.nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
}
.nav-brand { font-weight: 600; font-size: 17px; color: var(--text); }
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a {
    font-size: 14px;
    color: var(--text-muted);
    transition: color 0.15s;
}
.nav-links a:hover { color: var(--text); text-decoration: none; }

.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s;
    border: none;
    cursor: pointer;
}
.btn-primary {
    background: var(--accent);
    color: white;
}
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-1px); text-decoration: none; }

/* ---- Article pages ---- */

main.post {
    max-width: 720px;
    margin: 0 auto;
    padding: 64px 24px 80px;
    color: var(--text);
}
main.post .post-meta {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 12px;
}
main.post h1 {
    font-size: 38px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin-bottom: 24px;
}
main.post h2 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-top: 44px;
    margin-bottom: 12px;
}
main.post h3 {
    font-size: 18px;
    font-weight: 600;
    margin-top: 28px;
    margin-bottom: 8px;
}
main.post p {
    font-size: 16px;
    line-height: 1.7;
    margin-bottom: 16px;
}
main.post ul, main.post ol {
    padding-left: 24px;
    margin-bottom: 16px;
}
main.post li {
    font-size: 16px;
    line-height: 1.7;
    margin-bottom: 8px;
}
main.post strong { font-weight: 600; }
main.post figure {
    margin: 28px 0;
}
main.post figure img {
    max-width: 100%;
    max-height: 520px;
    width: auto;
    height: auto;
    border-radius: 12px;
    border: 1px solid var(--border);
    display: block;
    margin: 0 auto;
}
main.post figcaption {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 10px;
    text-align: center;
}

.cta-box {
    margin-top: 48px;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--bg-alt);
}
.cta-box p {
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 14px;
}
.cta-box .cta-links {
    font-size: 15px;
    font-weight: 500;
}

/* ---- Blog listing page ---- */

main.bloglist {
    max-width: 720px;
    margin: 0 auto;
    padding: 64px 24px 80px;
}
main.bloglist h1 {
    font-size: 40px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}
main.bloglist .bloglist-sub {
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 40px;
}
main.bloglist h2.section-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 44px 0 16px;
}
main.bloglist h2.section-title:first-of-type { margin-top: 8px; }
.post-card {
    display: block;
    padding: 22px 24px;
    border: 1px solid var(--border);
    border-radius: 14px;
    margin-bottom: 16px;
    color: var(--text);
    transition: border-color 0.15s, transform 0.15s;
}
.post-card:hover {
    text-decoration: none;
    border-color: var(--accent);
    transform: translateY(-1px);
}
.post-card h2 {
    font-size: 19px;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 6px;
    color: var(--text);
}
.post-card .post-meta {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.post-card p {
    font-size: 14.5px;
    line-height: 1.6;
    color: var(--text-muted);
}

/* ---- Footer ---- */

footer {
    border-top: 1px solid var(--border);
    padding: 48px 24px;
    font-size: 13px;
    color: var(--text-muted);
}
.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 24px;
}
.footer-columns { display: flex; gap: 64px; flex-wrap: wrap; }
.footer-column h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 10px;
}
.footer-column a,
.footer-column span {
    display: block;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.footer-column a:hover { color: var(--text); }
.footer-meta { font-size: 12px; }

@media (max-width: 600px) {
    main.post, main.bloglist { padding: 40px 20px 64px; }
    main.post h1 { font-size: 30px; }
    main.bloglist h1 { font-size: 32px; }
    main.post h2 { font-size: 22px; }
    .nav-links a:not(:last-child) { display: none; }
}
