
.blog-page { padding-top: var(--header-height); }
.blog-header .desktop-nav { margin-left: auto; }
.blog-hero { padding: 120px 0 78px; overflow: hidden; }
.blog-hero::before { content: ""; position: absolute; width: 620px; height: 620px; right: -290px; top: -180px; border-radius: 50%; background: var(--primary); filter: blur(170px); opacity: .1; pointer-events: none; }
.blog-hero-inner { position: relative; z-index: 1; max-width: 880px; }
.blog-hero h1 { margin: 18px 0 22px; font-family: "Space Grotesk", sans-serif; font-size: clamp(3rem, 7vw, 6.3rem); line-height: .96; letter-spacing: -.065em; }
.blog-hero p { max-width: 720px; margin: 0; color: var(--muted); font-size: 1.08rem; }
.blog-index-section { padding-top: 40px; }
.blog-index-section .articles-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.blog-index-section .article-card { height: 100%; }
.blog-subscribe { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 28px; margin-top: 44px; padding: 32px; border: 1px solid var(--line); border-radius: 28px; background: linear-gradient(135deg, var(--surface), rgba(139,92,246,.06)); }
.blog-subscribe h2 { margin: 0 0 7px; font-family: "Space Grotesk", sans-serif; font-size: 1.6rem; }
.blog-subscribe p { margin: 0; color: var(--muted); }

.article-page { padding-top: var(--header-height); }
.article-hero { position: relative; padding: 105px 0 72px; overflow: hidden; }
.article-hero::before { content: ""; position: absolute; width: 620px; height: 620px; right: -300px; top: -280px; border-radius: 50%; background: var(--primary); filter: blur(170px); opacity: .1; }
.article-breadcrumbs { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: .74rem; }
.article-breadcrumbs a { text-decoration: none; }
.article-breadcrumbs a:hover { color: var(--primary-2); }
.article-hero h1 { max-width: 970px; margin: 24px 0 20px; font-family: "Space Grotesk", sans-serif; font-size: clamp(2.7rem, 6vw, 5.5rem); line-height: .98; letter-spacing: -.06em; }
.article-deck { max-width: 830px; color: var(--muted); font-size: clamp(1rem, 1.6vw, 1.2rem); }
.article-byline { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin-top: 30px; color: var(--muted); font-size: .78rem; }
.article-byline strong { color: var(--text); }
.article-byline span { display: inline-flex; align-items: center; gap: 7px; }
.article-hero-cover { min-height: 430px; margin-top: 52px; border-radius: 34px; box-shadow: var(--shadow); }
.article-layout { display: grid; grid-template-columns: 250px minmax(0, 760px); justify-content: center; align-items: start; gap: clamp(42px, 7vw, 86px); padding: 82px 0 110px; }
.article-toc { position: sticky; top: calc(var(--header-height) + 28px); padding: 22px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); }
.article-toc strong { display: block; margin-bottom: 13px; font-family: "Space Grotesk", sans-serif; font-size: .84rem; }
.article-toc nav { display: grid; gap: 5px; }
.article-toc a { padding: 8px 10px; color: var(--muted); border-radius: 10px; text-decoration: none; font-size: .72rem; line-height: 1.4; transition: .2s ease; }
.article-toc a:hover { color: var(--text); background: var(--surface-soft); }
.article-body { min-width: 0; }
.article-body > p:first-child { margin-top: 0; color: var(--text); font-size: 1.18rem; line-height: 1.8; }
.article-body h2 { scroll-margin-top: calc(var(--header-height) + 28px); margin: 64px 0 18px; font-family: "Space Grotesk", sans-serif; font-size: clamp(1.75rem, 3vw, 2.45rem); line-height: 1.15; letter-spacing: -.035em; }
.article-body p, .article-body li { color: var(--muted); font-size: .96rem; line-height: 1.86; }
.article-body strong { color: var(--text); }
.article-body ul, .article-body ol { display: grid; gap: 9px; padding-left: 24px; }
.article-body code { padding: 2px 7px; border: 1px solid var(--line); border-radius: 7px; color: var(--primary-2); background: var(--surface-soft); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em; }
.article-body pre { overflow-x: auto; margin: 26px 0; padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: #080b15; box-shadow: 0 20px 50px rgba(0,0,0,.14); }
.article-body pre code { padding: 0; border: 0; color: #dfe6ff; background: transparent; line-height: 1.65; }
.article-callout { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; margin: 28px 0; padding: 24px; border: 1px solid rgba(34,211,238,.22); border-radius: 20px; background: rgba(34,211,238,.045); }
.article-callout strong { color: var(--primary-2); }
.article-callout span { color: var(--muted); }
.check-list { padding: 0 !important; list-style: none; }
.check-list li { position: relative; padding-left: 30px; }
.check-list li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--success); font-weight: 800; }
.article-references { margin-top: 60px; padding-top: 30px; border-top: 1px solid var(--line); }
.article-references h2 { margin-top: 0; }
.article-references a { color: var(--primary-2); }
.author-box { display: flex; align-items: center; gap: 18px; margin-top: 66px; padding: 26px; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); }
.author-avatar { flex: 0 0 auto; width: 62px; height: 62px; display: grid; place-items: center; border-radius: 20px; color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-3)); font-family: "Space Grotesk", sans-serif; font-size: 1.2rem; font-weight: 800; }
.author-box h3 { margin: 0 0 3px; font-family: "Space Grotesk", sans-serif; }
.author-box p { margin: 0; color: var(--muted); font-size: .8rem; line-height: 1.6; }
.related-section { padding: 92px 0 110px; background: var(--surface-soft); }
.related-section h2 { margin: 0 0 34px; font-family: "Space Grotesk", sans-serif; font-size: clamp(2rem, 4vw, 3.5rem); letter-spacing: -.045em; }
.related-section .articles-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.related-section .article-cover { min-height: 185px; }
.article-back { margin-top: 38px; }

@media (max-width: 980px) {
    .blog-index-section .articles-grid, .related-section .articles-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .article-layout { grid-template-columns: 1fr; }
    .article-toc { position: static; }
}
@media (max-width: 640px) {
    .blog-hero { padding-top: 85px; }
    .blog-index-section .articles-grid, .related-section .articles-grid { grid-template-columns: 1fr; }
    .blog-subscribe { grid-template-columns: 1fr; }
    .article-hero { padding-top: 76px; }
    .article-hero-cover { min-height: 280px; border-radius: 24px; }
    .article-layout { padding-top: 50px; }
    .article-callout { grid-template-columns: 1fr; }
    .author-box { align-items: flex-start; }
}

/* Keep blog content readable if JavaScript is unavailable. */
@media (scripting: none) {
    .blog-page .reveal,
    .article-page .reveal {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* Keep the full article index balanced at tablet widths. */
.blog-index-section .articles-grid .article-card:last-child { grid-column: auto; max-width: none; width: auto; justify-self: stretch; }


/* Crawlable article hero images improve sharing, accessibility and image discovery. */
.article-hero-image { min-height: 0; padding: 0; display: block; overflow: hidden; background: #111827; }
.article-hero-image::before, .article-hero-image::after { display: none; }
.article-hero-image img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.author-box h3 a { color: inherit; text-decoration: none; }
.author-box h3 a:hover { color: var(--primary-2); }
.article-byline a { color: inherit; text-decoration: none; }
.article-byline a:hover { color: var(--primary-2); }
