:root {
    --brand: #059669;
    --brand-bright: #61f6b6;
    --brand-deep: #047857;
    --ink: #151718;
    --muted: #62686f;
    --surface: #fff;
    --surface-soft: #f7f8f8;
    --border: #e4e7e7;
    --code: #f1f3f3;
    --shadow: 0 18px 45px rgba(21, 23, 24, .07);
    --radius: 12px;
    color-scheme: light;
}

[data-theme="dark"] {
    --ink: #f2f5f4;
    --muted: #a7b0ad;
    --surface: #101413;
    --surface-soft: #171c1a;
    --border: #29312e;
    --code: #1b211f;
    --shadow: 0 18px 45px rgba(0, 0, 0, .28);
    color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--surface); color: var(--ink); font-family: var(--gh-font-body, Figtree), -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, h5, h6 { font-family: var(--gh-font-heading, Figtree), -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; }
.shell { width: min(1120px, calc(100% - 48px)); margin-inline: auto; }
.shell-narrow { width: min(760px, calc(100% - 48px)); margin-inline: auto; }
.shell-wide { width: min(1040px, calc(100% - 48px)); margin-inline: auto; }
.site-header { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid color-mix(in srgb, var(--border) 88%, transparent); background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(14px); }
.nav-shell { min-height: 64px; display: flex; align-items: center; gap: 34px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-size: 1.05rem; font-weight: 650; letter-spacing: -.02em; white-space: nowrap; }
.brand img { width: 28px; height: 28px; }
.primary-nav, .utility-nav { display: flex; align-items: center; gap: 25px; font-size: .875rem; font-weight: 550; }
.primary-nav a, .utility-nav a { color: var(--muted); transition: color .15s ease; }
.primary-nav a:hover, .utility-nav a:hover, .primary-nav .active { color: var(--ink); }
.primary-nav .active { position: relative; }
.primary-nav .active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -22px; height: 2px; background: var(--brand); }
.utility-nav { margin-left: auto; gap: 20px; }
.icon-link, .icon-button { width: 34px; height: 34px; display: inline-grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.icon-link:hover, .icon-button:hover { color: var(--ink); background: var(--surface-soft); }
.icon-link svg, .icon-button svg { width: 19px; height: 19px; }
.moon { display: none; }
[data-theme="dark"] .sun { display: none; }
[data-theme="dark"] .moon { display: block; }
.hero { border-bottom: 1px solid var(--border); background-color: var(--surface); background-image: linear-gradient(to right, color-mix(in srgb, var(--border) 55%, transparent) 1px, transparent 1px), linear-gradient(to bottom, color-mix(in srgb, var(--border) 55%, transparent) 1px, transparent 1px), radial-gradient(circle at 50% 15%, color-mix(in srgb, var(--brand-bright) 18%, transparent), transparent 43%); background-size: 40px 40px, 40px 40px, 100% 100%; }
.hero-inner { min-height: 570px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding-block: 84px; text-align: center; }
.eyebrow { margin: 0 0 17px; color: var(--brand-deep); font-family: "JetBrains Mono", monospace; font-size: .75rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; }
.hero h1, .listing-header h1 { max-width: 850px; margin: 0; font-size: clamp(3rem, 7vw, 5.5rem); font-weight: 700; line-height: .98; letter-spacing: -.055em; }
.hero h1 span, .listing-header h1 span { color: var(--brand); }
.hero-copy { max-width: 670px; margin: 28px auto 0; color: var(--muted); font-size: 1.2rem; line-height: 1.65; }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 34px; }
.button { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 19px; border: 1px solid var(--border); border-radius: 8px; font-size: .925rem; font-weight: 650; transition: transform .15s ease, background .15s ease, border-color .15s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { border-color: var(--brand); background: var(--brand); color: #fff; }
.button-primary:hover { border-color: var(--brand-deep); background: var(--brand-deep); }
.button-secondary { background: var(--surface); }
.feed { padding-block: 82px 100px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 30px; padding-bottom: 22px; border-bottom: 1px solid var(--border); }
.section-heading .eyebrow { margin-bottom: 5px; }
.section-heading h2 { margin: 0; font-size: 2rem; letter-spacing: -.035em; }
.rss-link, .back-link { color: var(--brand-deep); font-size: .875rem; font-weight: 650; }
.post-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.post-card { overflow: hidden; display: flex; flex-direction: column; min-height: 330px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.post-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); box-shadow: var(--shadow); }
.card-image { aspect-ratio: 16 / 8.5; overflow: hidden; border-bottom: 1px solid var(--border); background: var(--surface-soft); }
.card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.post-card:hover .card-image img { transform: scale(1.02); }
.card-body { flex: 1; display: flex; flex-direction: column; padding: 25px; }
.card-meta, .card-footer, .article-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; color: var(--muted); font-size: .825rem; }
.tag { color: var(--brand-deep); font-family: "JetBrains Mono", monospace; font-size: .72rem; font-weight: 500; letter-spacing: .055em; text-transform: uppercase; }
.card-body h3 { margin: 14px 0 9px; font-size: 1.45rem; line-height: 1.2; letter-spacing: -.025em; }
.card-body h3 a:hover { color: var(--brand-deep); }
.card-body p { margin: 0; color: var(--muted); }
.card-footer { justify-content: space-between; margin-top: auto; padding-top: 25px; border-top: 1px solid var(--border); }
.pagination { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin-top: 44px; color: var(--muted); font-size: .875rem; }
.pagination a { color: var(--brand-deep); font-weight: 650; }
.pagination a:last-child { text-align: right; }
.listing-page, .listing-header { padding-block: 90px 45px; }
.listing-header { text-align: center; }
.listing-header h1 { margin-inline: auto; font-size: clamp(2.8rem, 6vw, 4.8rem); }
.listing-header > p:last-child { max-width: 650px; margin: 22px auto 0; color: var(--muted); font-size: 1.1rem; }
.listing-page .post-grid { margin-top: 48px; }
.compact-feed { padding-top: 20px; }
.author-avatar { width: 82px; height: 82px; margin: 0 auto 24px; border-radius: 50%; object-fit: cover; }
.article { padding: 90px 0 110px; }
.article-header { text-align: center; }
.article-header h1 { margin: 18px 0 22px; font-size: clamp(2.6rem, 6vw, 4.6rem); line-height: 1.04; letter-spacing: -.052em; }
.article-excerpt { margin: 0 auto 25px; color: var(--muted); font-size: 1.2rem; line-height: 1.6; }
.article-meta { justify-content: center; }
.article-image { margin-top: 55px; }
.article-image img { width: 100%; max-height: 650px; border-radius: 16px; object-fit: cover; }
.article-image figcaption { margin-top: 9px; color: var(--muted); font-size: .8rem; text-align: center; }
.gh-content { margin-top: 55px; font-size: 1.08rem; line-height: 1.78; }
.gh-content > * + * { margin-top: 1.45em; }
.gh-content h2, .gh-content h3, .gh-content h4 { margin-top: 2.1em; margin-bottom: -.55em; line-height: 1.2; letter-spacing: -.025em; }
.gh-content h2 { font-size: 2rem; }
.gh-content h3 { font-size: 1.5rem; }
.gh-content a { color: var(--brand-deep); text-decoration: underline; text-underline-offset: 3px; }
.gh-content blockquote { margin-inline: 0; padding: 4px 0 4px 24px; border-left: 3px solid var(--brand); color: var(--muted); font-size: 1.15rem; }
.gh-content pre { overflow-x: auto; padding: 22px; border: 1px solid var(--border); border-radius: 10px; background: var(--code); font-family: "JetBrains Mono", monospace; font-size: .86rem; line-height: 1.65; }
.gh-content code { padding: .12em .35em; border-radius: 4px; background: var(--code); font-family: "JetBrains Mono", monospace; font-size: .88em; }
.gh-content pre code { padding: 0; background: transparent; }
.gh-content img { height: auto; margin-inline: auto; border-radius: 10px; }
.gh-content .kg-width-wide { width: min(980px, calc(100vw - 48px)); max-width: none; margin-left: 50%; transform: translateX(-50%); }
.gh-content .kg-width-full { width: min(1200px, 100vw); max-width: none; margin-left: 50%; transform: translateX(-50%); }
.gh-content hr { margin-block: 3em; border: 0; border-top: 1px solid var(--border); }
.article-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 70px; padding-top: 25px; border-top: 1px solid var(--border); }
.article-tags { display: flex; flex-wrap: wrap; gap: 14px; }
.site-footer { border-top: 1px solid var(--border); background: var(--surface-soft); }
.footer-grid { display: grid; grid-template-columns: 1fr auto; gap: 50px; padding-block: 55px 42px; }
.footer-grid p { max-width: 390px; margin: 15px 0 0; color: var(--muted); }
.footer-links { display: grid; grid-template-columns: repeat(2, minmax(110px, 1fr)); gap: 12px 34px; align-content: start; color: var(--muted); font-size: .9rem; }
.footer-links a:hover { color: var(--brand-deep); }
.footer-bottom { display: flex; justify-content: space-between; gap: 30px; padding-block: 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: .78rem; }
.error-page { min-height: 65vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding-block: 80px; text-align: center; }
.error-page h1 { margin: 0; font-size: clamp(2.6rem, 7vw, 5rem); letter-spacing: -.05em; }
.error-page > p:not(.eyebrow) { margin: 12px 0 28px; color: var(--muted); }
.empty-state { grid-column: 1 / -1; color: var(--muted); }

@media (max-width: 860px) {
    .utility-nav > a:not(.icon-link) { display: none; }
    .nav-shell { gap: 22px; }
    .primary-nav { gap: 18px; }
    .hero-inner { min-height: 510px; }
}

@media (max-width: 680px) {
    .shell, .shell-narrow, .shell-wide { width: min(100% - 32px, 1120px); }
    .nav-shell { min-height: 58px; }
    .primary-nav a:first-child, .icon-link { display: none; }
    .utility-nav { gap: 4px; }
    .primary-nav .active::after { bottom: -19px; }
    .hero-inner { min-height: 470px; padding-block: 64px; }
    .hero h1 { font-size: clamp(2.65rem, 14vw, 4rem); }
    .hero-copy { font-size: 1.05rem; }
    .feed { padding-block: 62px 75px; }
    .post-grid { grid-template-columns: 1fr; }
    .section-heading { align-items: center; }
    .article { padding-block: 65px 80px; }
    .article-header h1 { font-size: clamp(2.4rem, 12vw, 3.4rem); }
    .article-footer, .footer-bottom { align-items: flex-start; flex-direction: column; }
    .footer-grid { grid-template-columns: 1fr; }
}
