:root {
    --blog-paper: #f7f4ee;
    --blog-ink: #242331;
    --blog-walnut: #533e2d;
    --blog-earth: #a27035;
    --blog-camel: #b88b4a;
    --blog-sand: #ddca7d;
    --blog-muted: #6d6861;
    --blog-line: rgba(83, 62, 45, 0.18);
    --blog-gutter: clamp(24px, 6vw, 92px);
    --blog-max-width: 1352px;
    --blog-font: "Geist", "SF Pro Display", "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
    --blog-ease: cubic-bezier(0.2, 0.72, 0.18, 1);
}

* {
    box-sizing: border-box;
}

html,
body.blog-index-page {
    min-height: 100%;
    margin: 0;
    background: var(--blog-paper) !important;
    color: var(--blog-ink) !important;
    font-family: var(--blog-font) !important;
    font-synthesis: none;
}

body.blog-index-page {
    overflow-x: hidden;
}

body.blog-index-page::before,
body.blog-index-page::after {
    display: none !important;
}

body.blog-index-page button,
body.blog-index-page a,
body.blog-index-page input {
    font-family: inherit;
}

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

.blog-page {
    width: 100%;
    padding-top: var(--public-nav-height, 96px);
}

.blog-hero,
.blog-archive {
    width: min(calc(100% - (2 * var(--blog-gutter))), var(--blog-max-width));
    margin-inline: auto;
}

.blog-hero-stage {
    position: relative;
    height: 512px;
}

.blog-hero-copy {
    position: absolute;
    z-index: 2;
    top: 198px;
    left: 10px;
    width: min(520px, 42vw);
}

.blog-title {
    margin: 0;
    color: var(--blog-ink);
    font-size: clamp(4.75rem, 6vw, 5.75rem);
    font-weight: 800;
    line-height: 0.98;
    letter-spacing: -0.065em;
}

.blog-intro {
    max-width: 520px;
    margin: 30px 0 0;
    color: #2e2c2a;
    font-size: clamp(1rem, 1.3vw, 1.25rem);
    font-weight: 520;
    line-height: 1.55;
    letter-spacing: -0.018em;
}

.blog-hero-visual {
    position: absolute;
    z-index: 1;
    top: 31px;
    right: 0;
    width: min(820px, 59vw);
    height: auto;
    display: block;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
}

.blog-category-row {
    min-height: 122px;
    display: flex;
    align-items: flex-start;
    padding-top: 25px;
    border-bottom: 1px solid var(--blog-line);
}

.category-nav {
    display: flex;
    align-items: center;
    gap: clamp(34px, 4vw, 68px);
    max-width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.category-nav::-webkit-scrollbar {
    display: none;
}

.category-nav-item {
    position: relative;
    min-height: 42px;
    flex: 0 0 auto;
    padding: 0 8px 12px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--blog-ink);
    font-size: 1rem;
    font-weight: 650;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    transition: color 180ms ease;
}

.category-nav-item::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 2px;
    background: var(--blog-earth);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 240ms var(--blog-ease);
}

.category-nav-item:hover,
.category-nav-item.active {
    color: var(--blog-earth);
}

.category-nav-item.active::after {
    transform: scaleX(1);
}

.blog-archive {
    min-height: 320px;
    padding: 58px 0 92px;
}

.post-list {
    display: grid;
    gap: 0;
}

.post-item {
    margin: 0;
    padding: 0 0 62px;
    border-bottom: 1px solid var(--blog-line);
}

.post-item + .post-item {
    padding-top: 62px;
}

.post-link {
    display: grid;
    grid-template-columns: minmax(300px, 410px) minmax(0, 1fr);
    align-items: start;
    gap: clamp(36px, 4vw, 52px);
    color: inherit;
    text-decoration: none;
}

.post-media {
    position: relative;
    width: 100%;
    aspect-ratio: 1.74 / 1;
    overflow: hidden;
    border: 1px solid var(--blog-line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.16);
}

.post-thumbnail,
.post-fallback-visual {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.post-thumbnail {
    z-index: 2;
    display: block;
    object-fit: cover;
    opacity: 0;
    transition: opacity 220ms ease;
}

.post-media.has-thumbnail .post-thumbnail {
    opacity: 1;
}

.post-fallback-visual {
    display: grid;
    place-items: center;
    padding: 11% 8%;
    background: rgba(255, 255, 255, 0.08);
}

.post-fallback-visual svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.post-fallback-visual .diagram-line,
.post-fallback-visual .diagram-box,
.post-fallback-visual .diagram-node {
    fill: none;
    stroke: #35343a;
    stroke-width: 1.2;
    vector-effect: non-scaling-stroke;
}

.post-fallback-visual .diagram-arrow {
    fill: #35343a;
}

.post-fallback-visual .diagram-accent {
    fill: none;
    stroke: var(--blog-camel);
    stroke-width: 1.8;
    vector-effect: non-scaling-stroke;
}

.post-fallback-visual text {
    fill: #35343a;
    font-family: var(--blog-font);
    font-size: 15px;
    font-weight: 560;
    text-anchor: middle;
}

.post-copy {
    min-width: 0;
    padding: 8px 0 0;
}

.post-date {
    display: block;
    color: var(--blog-earth);
    font-size: 1rem;
    font-weight: 680;
    line-height: 1.25;
}

.post-title {
    max-width: 760px;
    margin: 24px 0 0;
    color: var(--blog-ink);
    font-size: clamp(1.45rem, 2vw, 1.75rem);
    font-weight: 760;
    line-height: 1.22;
    letter-spacing: -0.035em;
    transition: color 180ms ease;
}

.post-summary {
    max-width: 650px;
    margin: 17px 0 0;
    color: var(--blog-muted);
    font-size: 1.05rem;
    font-weight: 520;
    line-height: 1.52;
}

.post-tags {
    display: flex;
    align-items: center;
    gap: 0;
    margin-top: 32px;
    overflow: hidden;
}

.post-tag {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    color: var(--blog-earth);
    font-size: 0.94rem;
    font-weight: 560;
    line-height: 1.3;
    white-space: nowrap;
}

.post-tag + .post-tag::before {
    content: "·";
    padding: 0 10px;
    color: var(--blog-camel);
}

.post-item.is-reversed .post-media {
    grid-column: 2;
    grid-row: 1;
}

.post-item.is-reversed .post-link {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 410px);
}

.post-item.is-reversed .post-copy {
    grid-column: 1;
    grid-row: 1;
    padding-left: clamp(0px, 2vw, 28px);
}

.post-link:hover .post-title,
.post-link:focus-visible .post-title {
    color: var(--blog-earth);
}

.post-link:focus-visible {
    outline: 2px solid var(--blog-earth);
    outline-offset: 10px;
}

.post-reveal {
    opacity: 0;
    transform: translateY(28px);
    animation: blog-post-reveal 720ms var(--blog-ease) var(--reveal-delay, 0ms) forwards;
}

.post-reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes blog-post-reveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.loading,
.no-posts {
    margin: 0;
    padding: 72px 0;
    color: var(--blog-muted);
    font-size: 1rem;
    font-weight: 560;
    text-align: center;
}

.blog-reference-footer {
    width: min(calc(100% - (2 * var(--blog-gutter))), var(--blog-max-width));
    min-height: 132px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 48px;
    margin: 0 auto;
    padding: 34px 0;
    border-top: 1px solid var(--blog-line);
    background: transparent !important;
    color: var(--blog-ink);
}

.blog-footer-copy {
    display: grid;
    gap: 7px;
    flex: 0 0 auto;
    color: var(--blog-muted);
    font-size: 0.78rem;
    font-weight: 540;
}

.blog-footer-copy strong {
    color: var(--blog-ink);
    font-size: 0.82rem;
    font-weight: 680;
}

.blog-footer-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: clamp(20px, 2.5vw, 40px);
    flex-wrap: wrap;
}

.blog-footer-nav a {
    color: var(--blog-ink);
    font-size: 0.84rem;
    font-weight: 620;
    text-decoration: none;
    transition: color 180ms ease;
}

.blog-footer-nav a:hover,
.blog-footer-nav a.is-current {
    color: var(--blog-earth);
}

@media (max-width: 1120px) {
    .blog-hero-stage {
        height: 470px;
    }

    .blog-hero-copy {
        top: 168px;
        left: 0;
    }

    .blog-title {
        font-size: clamp(4rem, 7vw, 5rem);
    }

    .blog-hero-visual {
        top: 40px;
        right: -56px;
        width: min(730px, 66vw);
    }

    .blog-category-row {
        min-height: 108px;
    }

    .post-link {
        grid-template-columns: minmax(280px, 38%) minmax(0, 1fr);
        gap: 40px;
    }
}

@media (max-width: 820px) {
    :root {
        --blog-gutter: 20px;
    }

    .desktop-only {
        display: none;
    }

    .blog-hero-stage {
        height: 540px;
    }

    .blog-hero-copy {
        top: 58px;
        left: 0;
        width: min(100%, 520px);
    }

    .blog-title {
        font-size: clamp(3.65rem, 16vw, 4.8rem);
    }

    .blog-intro {
        max-width: 35ch;
        margin-top: 20px;
        font-size: 0.98rem;
        line-height: 1.5;
    }

    .blog-hero-visual {
        top: 185px;
        right: 50%;
        width: min(570px, 130vw);
        max-width: none;
        transform: translateX(55%);
    }

    .blog-category-row {
        min-height: 92px;
        padding-top: 20px;
    }

    .category-nav {
        width: 100%;
        gap: 28px;
    }

    .category-nav-item {
        min-height: 40px;
        padding-inline: 2px;
        font-size: 0.92rem;
    }

    .blog-archive {
        padding: 38px 0 68px;
    }

    .post-item {
        padding-bottom: 42px;
    }

    .post-item + .post-item {
        padding-top: 42px;
    }

    .post-link,
    .post-item.is-reversed .post-link {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 26px;
    }

    .post-item.is-reversed .post-copy,
    .post-item.is-reversed .post-media {
        grid-column: auto;
        grid-row: auto;
        padding-left: 0;
    }

    .post-item.is-reversed .post-media {
        order: 0;
    }

    .post-item.is-reversed .post-copy {
        order: 1;
    }

    .post-title {
        margin-top: 17px;
        font-size: clamp(1.35rem, 6.2vw, 1.7rem);
    }

    .post-summary {
        margin-top: 13px;
        font-size: 0.96rem;
    }

    .post-tags {
        margin-top: 24px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .post-tags::-webkit-scrollbar {
        display: none;
    }

    .blog-reference-footer {
        min-height: 0;
        align-items: flex-start;
        flex-direction: column;
        gap: 24px;
        padding: 30px 0 38px;
    }

    .blog-footer-nav {
        justify-content: flex-start;
        gap: 16px 25px;
    }
}

@media (max-width: 480px) {
    .blog-hero-stage {
        height: 530px;
    }

    .blog-hero-copy {
        top: 48px;
    }

    .blog-title {
        font-size: clamp(3.4rem, 18vw, 4.25rem);
    }

    .blog-hero-visual {
        top: 202px;
        width: 520px;
        transform: translateX(57%);
    }

    .post-media {
        aspect-ratio: 1.58 / 1;
    }

    .post-fallback-visual {
        padding: 10% 5%;
    }

    .post-tag {
        font-size: 0.83rem;
    }

    .post-tag + .post-tag::before {
        padding-inline: 7px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .post-reveal {
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
        transition: none !important;
    }

    .category-nav-item::after,
    .post-thumbnail,
    .post-title {
        transition: none !important;
    }
}
