:root {
    --color-bg: #f5f8fc;
    --color-surface: #ffffff;
    --color-surface-muted: #eef4fb;
    --color-border: #d8e2f1;
    --color-border-strong: #bfd1ea;
    --color-text: #21364f;
    --color-text-soft: #5b6e86;
    --color-heading: #18314f;
    --color-accent: #1f6feb;
    --color-accent-deep: #1558bf;
    --color-code-bg: #0f1724;
    --color-code-text: #d9e7ff;
    --shadow-soft: 0 20px 40px rgba(25, 66, 133, 0.08);
    --shadow-card: 0 16px 36px rgba(17, 38, 73, 0.08);
    --radius-lg: 24px;
    --radius-md: 18px;
    --radius-sm: 12px;
    --container: 1180px;
    --reading: 780px;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--color-text);
    background:
        radial-gradient(circle at top left, rgba(31, 111, 235, 0.08), transparent 28%),
        linear-gradient(180deg, #f8fbff 0%, #f3f7fc 100%);
    font-family: "Source Serif 4", Georgia, serif;
    line-height: 1.66;
}

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

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

.site-shell {
    min-height: 100vh;
}

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

.container--reading {
    width: min(calc(100% - 40px), var(--reading));
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(18px);
    background: rgba(248, 251, 255, 0.88);
    border-bottom: 1px solid rgba(191, 209, 234, 0.7);
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 12px 0;
}

.site-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--color-heading);
}

.site-logo__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    box-shadow: 0 12px 20px rgba(31, 111, 235, 0.18);
}

.site-logo__icon {
    width: 42px;
    height: 42px;
    display: block;
}

.site-logo__text {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.site-logo__prompt {
    color: var(--color-accent);
    font-weight: 800;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
    font-family: "Manrope", sans-serif;
}

.site-nav a {
    padding: 8px 12px;
    border-radius: 10px;
    color: var(--color-text-soft);
    font-size: 1rem;
    font-weight: 700;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
    background: rgba(31, 111, 235, 0.1);
    color: var(--color-accent-deep);
    transform: translateY(-1px);
}

.hero {
    padding: 28px 0 12px;
}

.hero__inner {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.95fr);
    gap: 18px;
    align-items: stretch;
}

.hero__copy,
.hero__panel,
.archive-hero .container {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(191, 209, 234, 0.76);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}

.hero__copy {
    padding: 30px 34px;
}

.eyebrow {
    margin: 0 0 14px;
    font-family: "Manrope", sans-serif;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--color-accent);
}

.hero h1,
.archive-hero h1,
.post-page__title,
.section-heading h2,
.author-box h2 {
    margin: 0;
    color: var(--color-heading);
    font-family: "Manrope", sans-serif;
    line-height: 1.08;
}

.hero h1 {
    font-size: clamp(1.7rem, 2.45vw, 2.45rem);
    max-width: none;
    white-space: nowrap;
}

.hero__description,
.archive-hero__description,
.post-page__excerpt {
    margin: 14px 0 0;
    font-size: 1.02rem;
    color: var(--color-text-soft);
}

.hero__panel {
    padding: 24px 26px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background:
        linear-gradient(180deg, rgba(31, 111, 235, 0.07), rgba(31, 111, 235, 0.02)),
        #ffffff;
}

.hero__label {
    font-family: "Manrope", sans-serif;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-accent-deep);
}

.hero__facts {
    margin: 18px 0 0;
    padding: 0 0 0 18px;
    color: var(--color-text);
}

.hero__facts li + li {
    margin-top: 8px;
}

.feed-section {
    padding: 12px 0 48px;
}

.section-heading {
    margin-bottom: 16px;
}

.section-heading h2 {
    font-size: clamp(1.6rem, 3vw, 2rem);
}

.section-heading p,
.archive-hero__meta,
.post-page__meta,
.site-footer__text,
.site-footer__meta {
    font-family: "Manrope", sans-serif;
    color: var(--color-text-soft);
}

.post-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.post-card {
    min-height: 100%;
}

.post-card__link {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.93);
    border: 1px solid rgba(191, 209, 234, 0.82);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
}

.post-card__link:hover,
.post-card__link:focus-visible {
    transform: translateY(-6px);
    border-color: rgba(31, 111, 235, 0.32);
    box-shadow: 0 24px 50px rgba(17, 38, 73, 0.12);
}

.post-card__image-wrap {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(31, 111, 235, 0.12), rgba(79, 161, 255, 0.18));
}

.post-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.post-card__link:hover .post-card__image,
.post-card__link:focus-visible .post-card__image {
    transform: scale(1.04);
}

.post-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 18px 18px 16px;
}

.post-card__topline,
.post-card__footer,
.archive-hero__meta,
.post-page__meta,
.site-footer__inner,
.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.post-card__topline {
    justify-content: flex-start;
    margin-bottom: 10px;
    font-family: "Manrope", sans-serif;
    font-size: 0.84rem;
}

.post-card__tag,
.post-page__tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(31, 111, 235, 0.1);
    color: var(--color-accent-deep);
    font-family: "Manrope", sans-serif;
    font-size: 0.84rem;
    font-weight: 700;
}

.post-card__date,
.post-card__author {
    color: var(--color-text-soft);
}

.post-card__title {
    margin: 0;
    color: var(--color-heading);
    font-family: "Manrope", sans-serif;
    font-size: 1.28rem;
    line-height: 1.2;
}

.post-card__excerpt {
    margin: 10px 0 16px;
    color: var(--color-text-soft);
    font-size: 0.98rem;
}

.post-card__footer {
    justify-content: space-between;
    margin-top: auto;
    font-family: "Manrope", sans-serif;
}

.button-link,
.pagination__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--color-accent), #438ef4);
    color: #ffffff;
    font-size: 0.88rem;
    font-weight: 800;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    box-shadow: 0 10px 18px rgba(31, 111, 235, 0.18);
}

.post-card__link:hover .button-link,
.post-card__link:focus-visible .button-link,
.pagination__link:hover,
.pagination__link:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 14px 24px rgba(31, 111, 235, 0.25);
}

.archive-hero {
    padding: 22px 0 8px;
}

.archive-hero .container {
    padding: 24px 28px;
}

.post-page {
    padding: 28px 0 52px;
}

.post-page__header {
    margin-bottom: 18px;
}

.post-page__title {
    margin-top: 10px;
    font-size: clamp(2.1rem, 4vw, 3rem);
}

.post-page__meta {
    margin-top: 14px;
    font-size: 0.88rem;
}

.post-page__author {
    color: var(--color-accent-deep);
    font-weight: 700;
}

.post-page__media {
    margin: 0 0 20px;
}

.post-page__media img {
    width: 100%;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(191, 209, 234, 0.82);
    box-shadow: var(--shadow-card);
}

.post-page__media figcaption {
    margin-top: 12px;
    color: var(--color-text-soft);
    font-family: "Manrope", sans-serif;
    font-size: 0.9rem;
}

.gh-content {
    font-size: 1.03rem;
}

.gh-content > *:first-child {
    margin-top: 0;
}

.gh-content > *:last-child {
    margin-bottom: 0;
}

.gh-content h2,
.gh-content h3,
.gh-content h4 {
    margin: 2.1em 0 0.7em;
    color: var(--color-heading);
    font-family: "Manrope", sans-serif;
    line-height: 1.2;
}

.gh-content h2 {
    font-size: 1.74rem;
}

.gh-content h3 {
    font-size: 1.34rem;
}

.gh-content p,
.gh-content ul,
.gh-content ol,
.gh-content blockquote,
.gh-content pre,
.gh-content figure {
    margin: 0.95em 0;
}

.gh-content strong {
    color: var(--color-heading);
}

.gh-content a {
    color: var(--color-accent-deep);
    text-decoration: underline;
    text-decoration-color: rgba(31, 111, 235, 0.25);
    text-underline-offset: 0.18em;
}

.gh-content blockquote {
    padding: 24px 26px;
    border-left: 4px solid var(--color-accent);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    background: rgba(31, 111, 235, 0.06);
    color: var(--color-heading);
    font-style: italic;
}

.gh-content code,
.gh-content pre {
    font-family: "JetBrains Mono", monospace;
}

.gh-content :not(pre) > code {
    padding: 0.18em 0.45em;
    border-radius: 8px;
    background: rgba(31, 111, 235, 0.08);
    color: var(--color-accent-deep);
    font-size: 0.92em;
}

.gh-content pre {
    overflow-x: auto;
    padding: 22px 24px;
    border: 1px solid rgba(117, 149, 204, 0.2);
    border-radius: 22px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent),
        var(--color-code-bg);
    color: var(--color-code-text);
    box-shadow: 0 16px 32px rgba(6, 14, 26, 0.18);
    line-height: 1.65;
    font-size: 0.92rem;
}

.gh-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

.gh-content .kg-embed-card {
    margin: 1.4em 0;
    width: 100%;
    max-width: 100%;
}

.gh-content .kg-embed-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 18px;
    background: #dfeaf8;
    box-shadow: var(--shadow-soft);
}

.gh-content .kg-embed-card iframe,
.gh-content .kg-embed-card video,
.gh-content .kg-embed-card embed {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    border: 0;
    border-radius: 18px;
}

.gh-content .kg-embed-card > iframe {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9;
    min-height: 0;
}

.gh-content .kg-embed-card figcaption {
    margin-top: 10px;
    color: var(--color-text-soft);
    font-family: "Manrope", sans-serif;
    font-size: 0.9rem;
}

.gh-content img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 18px;
}

.gh-content .kg-image-card,
.gh-content .kg-image-card img,
.gh-content .kg-image {
    max-width: 100%;
}

.gh-content .kg-image-card img,
.gh-content .kg-image {
    width: 100%;
    height: auto !important;
    aspect-ratio: auto;
    object-fit: contain;
}

.gh-content hr {
    margin: 2.4em 0;
    border: 0;
    border-top: 1px solid var(--color-border);
}

.post-page__footer {
    margin-top: 20px;
    padding-top: 14px;
    border-top: 1px solid var(--color-border);
}

.post-page__footer:empty {
    display: none;
}

.post-page__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 28px;
}

.post-page__tags a {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--color-surface-muted);
    color: var(--color-text-soft);
    font-family: "Manrope", sans-serif;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.post-page__tags a:hover,
.post-page__tags a:focus-visible {
    background: rgba(31, 111, 235, 0.12);
    color: var(--color-accent-deep);
}

.author-box {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 18px;
    padding: 24px;
    border: 1px solid rgba(191, 209, 234, 0.82);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow-soft);
}

.author-box__avatar {
    width: 72px;
    height: 72px;
    border-radius: 22px;
    object-fit: cover;
}

.author-box__avatar--placeholder {
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--color-accent), #4fa1ff);
    color: #ffffff;
    font-family: "Manrope", sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
}

.author-box__label,
.pagination__status,
.site-footer__title {
    margin: 0;
    font-family: "Manrope", sans-serif;
}

.author-box__label {
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-accent);
}

.author-box h2 {
    margin-top: 8px;
    font-size: 1.45rem;
}

.author-box p:last-child {
    margin-bottom: 0;
}

.pagination {
    justify-content: center;
    margin-top: 22px;
}

.site-footer {
    margin-top: auto;
    padding: 14px 0 28px;
}

.site-footer__inner {
    justify-content: center;
    padding: 16px 20px;
    border: 1px solid rgba(191, 209, 234, 0.82);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow-soft);
}

.site-footer__meta {
    justify-content: center;
    font-weight: 700;
}

@media (max-width: 980px) {
    .hero__inner,
    .post-grid {
        grid-template-columns: 1fr;
    }

    .site-header__inner,
    .site-footer__inner {
        align-items: flex-start;
        flex-direction: column;
    }

    .site-nav {
        justify-content: flex-start;
    }
}

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

    .hero {
        padding-top: 28px;
    }

    .hero__copy,
    .hero__panel,
    .archive-hero .container,
    .post-card__body,
    .author-box,
    .site-footer__inner {
        padding: 18px;
    }

    .site-header__inner {
        padding: 14px 0;
    }

    .site-nav {
        gap: 6px;
    }

    .site-nav a {
        padding: 8px 12px;
    }

    .hero h1,
    .post-page__title,
    .archive-hero h1 {
        max-width: none;
    }

    .hero h1 {
        white-space: normal;
    }

    .site-logo {
        font-size: 0.8rem;
    }

    .gh-content {
        font-size: 1.03rem;
    }

    .gh-content h2 {
        font-size: 1.72rem;
    }

    .gh-content .kg-embed-container {
        border-radius: 14px;
    }

    .author-box {
        grid-template-columns: 1fr;
    }
}
