:root {
    --bg: #f8fafc;
    --surface: #ffffff;
    --surface-soft: #f1f5f9;
    --text: #0f172a;
    --muted: #475569;
    --border: #e2e8f0;
    --accent: #0f172a;
    --radius-lg: 20px;
    --radius-md: 14px;
    --shadow: 0 16px 38px rgba(15, 23, 42, 0.08);
    --container: 1160px;
}

body.theme-width-comfortable {
    --container: 1160px;
}

body.theme-width-readable {
    --container: 760px;
}

body.theme-width-wide {
    --container: 1320px;
}

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

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--gh-font-body, "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
    background: linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
    color: var(--text);
    font-size: 16px;
    line-height: 1.65;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    width: min(var(--container), calc(100% - 3rem));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.82);
    border-bottom: 1px solid rgba(226, 232, 240, 0.7);
}

.nav-shell {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.site-logo {
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: -0.02em;
}

.site-logo img {
    max-height: 34px;
    width: auto;
}

.site-nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

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

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

.hero {
    padding: 6.5rem 0 3rem;
}

.hero-compact {
    padding: 4.5rem 0 2.2rem;
}

.hero-kicker {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.11em;
    color: #64748b;
    margin-bottom: 0.8rem;
    font-weight: 700;
}

.hero-title {
    margin: 0;
    font-size: clamp(2rem, 6vw, 4rem);
    line-height: 1.06;
    letter-spacing: -0.04em;
}

.hero-description {
    margin: 1.2rem 0 0;
    max-width: 720px;
    color: var(--muted);
    font-size: clamp(1rem, 2vw, 1.25rem);
}

.post-feed-wrap {
    padding: 1.4rem 0 5.5rem;
}

.post-feed {
    display: grid;
    gap: 1.6rem;
}

.post-feed--grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.post-feed--grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.post-feed--list {
    grid-template-columns: 1fr;
}

.post-feed--list .post-card-link {
    display: grid;
    grid-template-columns: minmax(160px, 260px) 1fr;
    align-items: stretch;
    gap: 0;
}

.post-feed--list .post-card-image {
    aspect-ratio: 4 / 3;
    height: 100%;
    min-height: 100%;
}

.post-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    min-height: 100%;
}

.post-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: #cbd5e1;
}

.post-card-link {
    display: block;
}

.post-card-image {
    aspect-ratio: 16 / 10;
    object-fit: cover;
    width: 100%;
    background: #e2e8f0;
}

.post-card-content {
    padding: 1.2rem 1.2rem 1.3rem;
}

.post-card-tag {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #334155;
    font-weight: 700;
}

.post-card-title {
    margin: 0.7rem 0 0.55rem;
    font-size: 1.28rem;
    line-height: 1.25;
    letter-spacing: -0.02em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-excerpt {
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-meta {
    margin-top: 1rem;
    color: #64748b;
    font-size: 0.84rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.article {
    padding: 4rem 0 5rem;
}

.article-header {
    max-width: 860px;
}

.article-title {
    margin: 0 0 1rem;
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.08;
    letter-spacing: -0.035em;
}

.article-tag {
    display: inline-block;
    margin-bottom: 1rem;
    color: #334155;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.article-excerpt {
    margin-top: 0;
    color: var(--muted);
}

.article-meta {
    color: #64748b;
    font-size: 0.92rem;
    margin-bottom: 1.25rem;
    display: flex;
    gap: 0.45rem;
    align-items: center;
}

.article-feature-figure {
    margin: 1.2rem 0 0;
}

.article-feature-image {
    width: 100%;
    border-radius: 18px;
    border: 1px solid var(--border);
}

.article-feature-caption {
    margin-top: 0.55rem;
    font-size: 0.92rem;
    color: var(--muted);
    text-align: center;
}

.article-content {
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 1.5rem;
    width: 100%;
    font-size: 1.1rem;
    position: relative;
}

.gh-content > * + * {
    margin-top: 1.25rem;
}

.article-content .kg-width-wide {
    position: relative;
    width: min(1100px, 92vw);
    max-width: none;
    margin-left: auto;
    margin-right: auto;
}

.article-content .kg-width-wide img {
    width: 100%;
}

.article-content .kg-width-full {
    position: relative;
    width: 100vw;
    max-width: none;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

.article-content .kg-width-full img {
    width: 100%;
}

.article-content h2,
.article-content h3,
.article-content h4 {
    margin-top: 2.1rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.article-content p,
.article-content ul,
.article-content ol,
.article-content blockquote {
    margin: 1.15rem 0;
}

.article-content a {
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 3px;
    color: var(--accent);
}

.article-content pre,
.article-content code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.article-content pre {
    background: #0b1220;
    color: #f8fafc;
    border-radius: 14px;
    padding: 1.1rem;
    overflow: auto;
}

.article-footer {
    max-width: 760px;
    padding-top: 1rem;
}

.author-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.author-pill {
    padding: 0.35rem 0.72rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-soft);
    font-size: 0.84rem;
    color: #334155;
}

.author-pill-text {
    cursor: default;
}

.pagination {
    margin-top: 2.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    color: #64748b;
    font-size: 0.92rem;
}

.pagination a {
    color: var(--accent);
    font-weight: 600;
}

.site-footer {
    border-top: 1px solid var(--border);
    margin-top: 2rem;
}

.footer-shell {
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #64748b;
    font-size: 0.9rem;
}

.footer-copy p {
    margin: 0;
}

.footer-note {
    margin: 0.35rem 0 0;
    font-size: 0.85rem;
    color: #94a3b8;
}

.btn-primary {
    display: inline-flex;
    margin-top: 1rem;
    background: var(--accent);
    color: #fff;
    border-radius: 12px;
    padding: 0.75rem 1.15rem;
    font-weight: 600;
}

.btn-nav {
    margin-top: 0;
    white-space: nowrap;
    font-size: 0.88rem;
    padding: 0.55rem 1rem;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.post-feed .post-card-link {
    height: 100%;
}

.gh-content .kg-card,
.gh-content figure {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

.gh-content .kg-width-full + *,
.gh-content * + .kg-width-full {
    margin-top: 2rem;
}

.home-section {
    padding: 2.5rem 0;
}

.home-section + .home-section {
    border-top: 1px solid var(--border);
}

.home-section-title {
    margin: 0 0 1rem;
    font-size: clamp(1.35rem, 2.5vw, 1.85rem);
    letter-spacing: -0.02em;
}

.home-intro {
    background: var(--surface-soft);
}

.home-intro-inner {
    max-width: 720px;
}

.home-section-body,
.home-pillar-body {
    color: var(--muted);
    font-size: 1.05rem;
}

.home-pillar-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
}

.home-pillar-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.35rem 1.4rem;
}

.home-pillar-title {
    margin: 0 0 0.75rem;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
}

.home-cta-band {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #e2e8f0;
}

.home-cta-band .kg-width-full,
.home-cta-band .kg-width-wide {
    margin-left: 0;
    margin-right: 0;
    width: 100%;
    left: auto;
}

.home-cta-inner {
    max-width: 880px;
    margin: 0 auto;
}

.home-cta-band a {
    color: #fff;
}

.home-cta-band .gh-content {
    color: #e2e8f0;
}

.home-feed-title {
    margin: 0 0 1.5rem;
    font-size: clamp(1.25rem, 2vw, 1.65rem);
    letter-spacing: -0.02em;
}

.home-newsletter {
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.home-newsletter-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
}

.home-newsletter-title {
    margin: 0 0 0.4rem;
    font-size: 1.45rem;
    letter-spacing: -0.02em;
}

.home-newsletter-sub {
    margin: 0;
    color: var(--muted);
    max-width: 420px;
}

.home-newsletter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
}

.home-newsletter-input {
    min-width: 220px;
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    font: inherit;
}

.home-newsletter-submit {
    margin-top: 0;
}

.home-newsletter-feedback {
    flex-basis: 100%;
    font-size: 0.9rem;
    margin: 0;
}

.home-newsletter-feedback-error {
    color: #b91c1c;
}

.footer-portal-links {
    margin: 0.5rem 0 0;
    font-size: 0.85rem;
}

.footer-portal-links a {
    color: #64748b;
    font-weight: 600;
}

.footer-portal-links a:hover {
    color: var(--accent);
}

.footer-dot {
    margin: 0 0.35rem;
    opacity: 0.5;
}

.archive-intro {
    padding: 3rem 0 1rem;
}

.archive-intro-title {
    margin: 0 0 0.5rem;
    font-size: clamp(1.6rem, 3vw, 2.25rem);
    letter-spacing: -0.03em;
}

.archive-intro-text {
    margin: 0;
    color: var(--muted);
}

.hero-archive .hero-kicker {
    color: #94a3b8;
}

.hero-description-muted {
    opacity: 0.85;
}

.tag-archive,
.author-archive {
    padding-bottom: 0.5rem;
}

.article-custom-landing .custom-landing-hero {
    padding-top: 2rem;
    padding-bottom: 1rem;
}

.custom-landing-cover {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.custom-landing-title {
    margin: 0 0 0.75rem;
    font-size: clamp(2rem, 4vw, 3rem);
    letter-spacing: -0.03em;
}

.custom-landing-lead {
    margin: 0;
    font-size: 1.15rem;
    color: var(--muted);
    max-width: 640px;
}

.custom-landing-body {
    padding-top: 1rem;
    padding-bottom: 3rem;
}

.article-custom-focus .article-content {
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 1024px) {
    .post-feed--grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .home-pillar-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .container {
        width: min(var(--container), calc(100% - 1.5rem));
    }

    .nav-actions {
        width: 100%;
        justify-content: space-between;
    }

    .home-pillar-grid {
        grid-template-columns: 1fr;
    }

    .home-newsletter-inner {
        flex-direction: column;
        align-items: stretch;
    }

    .home-newsletter-form {
        width: 100%;
    }

    .home-newsletter-input {
        flex: 1;
        min-width: 0;
    }

    .nav-shell {
        min-height: 64px;
        gap: 1rem;
    }

    .site-nav ul {
        gap: 0.85rem;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .hero {
        padding-top: 4rem;
    }

    .post-feed--grid-2,
    .post-feed--grid-3,
    .post-feed--list {
        grid-template-columns: 1fr;
    }

    .post-feed--list .post-card-link {
        grid-template-columns: 1fr;
    }

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

    .footer-shell {
        flex-direction: column;
        justify-content: center;
        gap: 0.3rem;
        padding: 0.7rem 0;
    }
}
