/*
Theme Name: Forge
Theme URI: https://www.wuyukun.site
Author: Hermes Agent
Description: An editorial engineering field-notes theme for Typecho.
Version: 2.0.0
*/

:root {
    --paper: #f7f8f4;
    --surface: #ffffff;
    --ink: #102019;
    --ink-soft: #31453c;
    --muted: #65746d;
    --line: #d9dfda;
    --line-strong: #b9c4bd;
    --forest: #0b281f;
    --forest-light: #174a38;
    --signal: #c7f36b;
    --signal-strong: #a6e33d;
    --coral: #ef6a4c;
    --code: #0b1511;
    --code-ink: #e8f2eb;
    --focus: #20735a;
    --sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
    --serif: "Noto Serif SC", "Songti SC", STSong, serif;
    --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
    --shell: 1220px;
    --radius: 8px;
    --shadow: 0 16px 44px rgba(16, 32, 25, 0.08);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 90px;
}

body {
    margin: 0;
    color: var(--ink);
    background:
        linear-gradient(var(--line), var(--line)) top / 100% 1px no-repeat,
        var(--paper);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body::selection,
body *::selection {
    color: var(--ink);
    background: var(--signal);
}

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

a:hover {
    color: var(--forest-light);
}

img,
video,
canvas,
iframe {
    max-width: 100%;
}

img {
    height: auto;
}

button,
input,
textarea,
select {
    font: inherit;
}

button,
a,
input,
textarea {
    -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(32, 115, 90, 0.28);
    outline-offset: 3px;
}

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

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

.nowrap {
    white-space: nowrap;
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: 76px;
    color: var(--ink);
    background: rgba(247, 248, 244, 0.94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
}

.nav-shell {
    height: 100%;
    display: grid;
    grid-template-columns: minmax(250px, 1fr) auto 220px;
    align-items: center;
    gap: 36px;
}

.brand {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    width: fit-content;
}

.brand:hover {
    color: var(--ink);
}

.brand-mark {
    display: grid;
    place-items: center;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    color: var(--signal);
    background: var(--forest);
    border: 1px solid var(--forest);
    border-radius: 4px;
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 500;
}

.brand-copy {
    display: grid;
    min-width: 0;
    line-height: 1.2;
}

.brand-copy strong {
    overflow: hidden;
    color: var(--ink);
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-copy small {
    overflow: hidden;
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-menu {
    display: flex;
    align-items: stretch;
    gap: 28px;
    height: 100%;
}

.nav-menu a {
    position: relative;
    display: grid;
    place-items: center;
    min-width: 44px;
    color: var(--ink-soft);
    font-size: 14px;
    font-weight: 600;
}

.nav-menu a::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 3px;
    background: transparent;
}

.nav-menu a:hover,
.nav-menu a.current {
    color: var(--ink);
}

.nav-menu a.current::after {
    background: var(--coral);
}

.site-search {
    position: relative;
    width: 220px;
}

.site-search input {
    width: 100%;
    height: 40px;
    padding: 0 42px 0 13px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 5px;
    font-size: 13px;
}

.site-search input::placeholder {
    color: #849089;
}

.site-search input:focus {
    border-color: var(--focus);
    outline: 3px solid rgba(32, 115, 90, 0.12);
}

.search-submit {
    position: absolute;
    top: 0;
    right: 0;
    width: 40px;
    height: 40px;
    padding: 0;
    color: var(--ink);
    background: transparent;
    border: 0;
    cursor: pointer;
}

.search-submit span {
    position: absolute;
    top: 11px;
    left: 10px;
    width: 13px;
    height: 13px;
    border: 1.5px solid currentColor;
    border-radius: 50%;
}

.search-submit span::after {
    content: "";
    position: absolute;
    right: -5px;
    bottom: -3px;
    width: 6px;
    height: 1.5px;
    background: currentColor;
    transform: rotate(45deg);
    transform-origin: left center;
}

/* Real-image hero */
.hero {
    position: relative;
    min-height: 440px;
    margin: 34px 0 0;
    overflow: hidden;
    color: #f4f8f5;
    background-color: var(--forest);
    background-image:
        linear-gradient(90deg, rgba(7, 27, 21, 0.14) 0%, rgba(7, 27, 21, 0.28) 42%, rgba(7, 27, 21, 0.94) 64%, rgba(7, 27, 21, 0.99) 100%),
        var(--hero-image);
    background-position: center;
    background-size: cover;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    isolation: isolate;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(90deg, transparent, #000 58%);
}

.hero::after {
    content: none;
}

.hero-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 51%;
    min-height: 440px;
    margin-left: auto;
    padding: 50px 54px 54px;
}

.hero-kicker,
.section-kicker,
.side-label {
    color: var(--signal);
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.hero-kicker::before {
    content: "";
    display: inline-block;
    width: 28px;
    height: 2px;
    margin: 0 10px 3px 0;
    background: var(--coral);
}

.hero h1 {
    max-width: 700px;
    margin: 22px 0 20px;
    color: #fff;
    font-family: var(--serif);
    font-size: 56px;
    font-weight: 700;
    line-height: 1.18;
    text-wrap: balance;
}

.hero-copy > p {
    max-width: 610px;
    margin: 0;
    color: rgba(244, 248, 245, 0.82);
    font-size: 18px;
    line-height: 1.75;
    text-wrap: pretty;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 34px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button-primary,
.button-dark {
    color: var(--forest);
    background: var(--signal);
    border-color: var(--signal);
}

.button-primary:hover,
.button-dark:hover {
    color: var(--forest);
    background: var(--signal-strong);
    border-color: var(--signal-strong);
}

.button-ghost {
    color: #fff;
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.36);
}

.button-ghost:hover {
    color: #fff;
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.7);
}

.button-light {
    color: var(--ink);
    background: var(--surface);
    border-color: var(--line-strong);
}

/* Main content */
.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 72px;
    padding: 72px 0 96px;
}

.article-list,
.post-detail {
    min-width: 0;
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 32px;
    padding: 0 0 26px;
    border-bottom: 2px solid var(--ink);
}

.section-kicker {
    color: var(--coral);
}

.section-heading h2,
.archive-heading h1 {
    margin: 7px 0 0;
    font-family: var(--serif);
    font-size: 36px;
    line-height: 1.3;
}

.section-heading > p {
    max-width: 300px;
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    text-align: right;
}

.post-card {
    position: relative;
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr);
    gap: 24px;
    padding: 34px 0 36px;
    border-bottom: 1px solid var(--line-strong);
}

.post-card::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 2px;
    background: var(--forest);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 220ms ease;
}

.post-card:hover::after {
    transform: scaleX(1);
}

.post-date {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    align-self: stretch;
    padding: 3px 20px 0 0;
    color: var(--muted);
    border-right: 1px solid var(--line-strong);
    font-family: var(--mono);
    line-height: 1.35;
}

.post-date::after {
    content: "";
    position: absolute;
    top: 9px;
    right: -5px;
    width: 9px;
    height: 9px;
    background: var(--paper);
    border: 2px solid var(--coral);
    border-radius: 50%;
}

.post-date strong {
    color: var(--ink);
    font-size: 13px;
    font-weight: 500;
}

.post-date span {
    margin-top: 5px;
    color: var(--muted);
    font-size: 11px;
}

.post-card-body {
    min-width: 0;
}

.post-meta-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px 16px;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 12px;
    line-height: 1.5;
}

.post-meta-line > *:not(:first-child)::before {
    content: "/";
    margin-right: 16px;
    color: var(--line-strong);
}

.post-meta-line a:hover,
.post-categories a:hover {
    color: var(--coral);
}

.post-card h2 {
    margin: 13px 0 12px;
    font-family: var(--serif);
    font-size: 27px;
    font-weight: 700;
    line-height: 1.42;
    text-wrap: pretty;
}

.post-card h2 a {
    background-image: linear-gradient(var(--signal), var(--signal));
    background-position: 0 92%;
    background-repeat: no-repeat;
    background-size: 0 8px;
    transition: background-size 220ms ease;
}

.post-card:hover h2 a {
    color: var(--ink);
    background-size: 100% 8px;
}

.post-excerpt {
    display: -webkit-box;
    overflow: hidden;
    max-width: 760px;
    margin: 0;
    color: var(--ink-soft);
    font-size: 15px;
    line-height: 1.85;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.post-excerpt p,
.post-excerpt pre,
.post-excerpt figure,
.post-excerpt blockquote {
    display: inline;
    margin: 0;
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 44px;
    margin-top: 18px;
    color: var(--forest-light);
    font-size: 14px;
    font-weight: 700;
}

.read-more span {
    color: var(--coral);
    font-family: var(--mono);
    transition: transform 160ms ease;
}

.read-more:hover span {
    transform: translate(2px, -2px);
}

/* Sidebar: index, not card stack */
.sidebar {
    position: sticky;
    top: 100px;
    min-width: 0;
    align-self: start;
}

.profile-card {
    position: relative;
    padding: 27px 26px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-top: 4px solid var(--forest);
    border-radius: var(--radius);
    overflow: hidden;
}

.profile-card::after {
    content: none;
}

.profile-card .side-label {
    color: var(--coral);
}

.profile-monogram {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    margin: 22px 0 18px;
    color: #fff;
    background: var(--forest);
    border-radius: 50%;
    font-family: var(--serif);
    font-size: 24px;
    font-weight: 700;
}

.profile-card h3 {
    margin: 0;
    color: var(--ink);
    font-family: var(--serif);
    font-size: 25px;
}

.profile-card p {
    position: relative;
    z-index: 1;
    margin: 10px 0 18px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.75;
}

.profile-link {
    position: relative;
    z-index: 1;
    display: inline-flex;
    gap: 7px;
    min-height: 44px;
    align-items: center;
    color: var(--forest-light);
    font-family: var(--mono);
    font-size: 12px;
}

.profile-link:hover {
    color: var(--coral);
}

.side-section {
    padding: 30px 0;
    border-bottom: 1px solid var(--line-strong);
}

.side-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 17px;
}

.side-heading h3 {
    margin: 0;
    font-family: var(--serif);
    font-size: 18px;
}

.side-heading span {
    color: var(--muted);
    font-family: var(--mono);
    font-size: 10px;
    text-transform: uppercase;
}

.side-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.side-list li {
    margin: 0;
}

.side-list a {
    display: flex;
    align-items: center;
    min-height: 42px;
    color: var(--ink-soft);
    border-bottom: 1px solid rgba(185, 196, 189, 0.55);
    font-size: 13px;
    line-height: 1.5;
}

.side-list li:last-child a {
    border-bottom: 0;
}

.side-list a:hover {
    color: var(--ink);
}

.recent-list {
    counter-reset: recent;
}

.recent-list li {
    counter-increment: recent;
}

.recent-list a::before {
    content: "0" counter(recent);
    flex: 0 0 31px;
    margin-right: 9px;
    color: var(--coral);
    font-family: var(--mono);
    font-size: 10px;
}

.category-card .side-list,
.archive-list,
.utility-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.category-card .side-list li,
.archive-list li,
.utility-list li {
    display: contents;
}

.category-card .side-list a,
.archive-list a,
.utility-list a {
    min-height: 34px;
    padding: 0 11px;
    color: var(--ink-soft);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 4px;
    font-family: var(--mono);
    font-size: 11px;
}

.category-card .side-list a:hover,
.archive-list a:hover,
.utility-list a:hover {
    color: var(--forest);
    background: var(--signal);
    border-color: var(--signal-strong);
}

/* Archive */
.archive-heading {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: end;
    gap: 24px;
    padding: 64px 0 0;
}

.archive-heading .section-kicker {
    grid-column: 1 / -1;
}

.archive-heading h1 {
    margin: 0;
    font-size: 48px;
}

.archive-heading p {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 14px;
}

.is-archive .content-grid {
    padding-top: 42px;
}

/* Pagination */
.page-nav {
    padding-top: 34px;
}

.page-nav ol,
.page-navigator {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.page-nav li {
    margin: 0;
    padding: 0;
    background: transparent;
}

.page-nav a {
    display: grid;
    place-items: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0 13px;
    color: var(--ink-soft);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 4px;
    font-family: var(--mono);
    font-size: 12px;
}

.page-nav a:hover,
.page-nav .current a,
.page-navigator .current a {
    color: var(--forest);
    background: var(--signal);
    border-color: var(--signal-strong);
}

.page-nav .current,
.page-navigator li.current {
    color: inherit;
    background: transparent;
    box-shadow: none;
}

/* Article */
.article-layout {
    grid-template-columns: minmax(0, 840px) 280px;
    justify-content: space-between;
    padding-top: 62px;
}

.article-head {
    padding-bottom: 34px;
    border-bottom: 2px solid var(--ink);
}

.article-back {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    margin-bottom: 24px;
    color: var(--forest-light);
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 500;
}

.article-back:hover {
    color: var(--coral);
}

.article-head h1 {
    max-width: 820px;
    margin: 18px 0 0;
    font-family: var(--serif);
    font-size: 50px;
    font-weight: 700;
    line-height: 1.28;
    text-wrap: balance;
}

.post-content {
    padding: 36px 0 8px;
    color: #203129;
    font-size: 17px;
    line-height: 1.95;
    overflow-wrap: anywhere;
}

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

.post-content p {
    margin: 0 0 1.35em;
}

.post-content h2,
.post-content h3,
.post-content h4 {
    color: var(--ink);
    font-family: var(--serif);
    line-height: 1.42;
    text-wrap: pretty;
}

.post-content h2 {
    margin: 2.2em 0 0.8em;
    padding-top: 0.8em;
    border-top: 1px solid var(--line);
    font-size: 30px;
}

.post-content h3 {
    margin: 1.8em 0 0.65em;
    font-size: 23px;
}

.post-content h4 {
    margin: 1.6em 0 0.55em;
    font-size: 19px;
}

.post-content a {
    color: var(--forest-light);
    text-decoration: underline;
    text-decoration-color: rgba(23, 74, 56, 0.34);
    text-underline-offset: 4px;
}

.post-content a:hover {
    color: #b5422b;
    text-decoration-color: var(--coral);
}

.post-content strong {
    color: var(--ink);
    font-weight: 700;
}

.post-content ul,
.post-content ol {
    margin: 0 0 1.5em;
    padding-left: 1.4em;
}

.post-content li {
    margin: 0.38em 0;
    padding-left: 0.28em;
}

.post-content blockquote {
    margin: 1.8em 0;
    padding: 20px 24px;
    color: var(--ink-soft);
    background: #eef3ef;
    border-left: 4px solid var(--coral);
}

.post-content blockquote p:last-child {
    margin-bottom: 0;
}

.post-content hr {
    height: 1px;
    margin: 48px 0;
    background: var(--line-strong);
    border: 0;
}

.post-content img {
    display: block;
    max-width: 100%;
    margin: 30px auto;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 5px;
    box-shadow: 0 12px 34px rgba(16, 32, 25, 0.08);
}

.post-content table {
    display: block;
    width: 100%;
    margin: 28px 0;
    overflow-x: auto;
    border-collapse: collapse;
    font-size: 14px;
}

.post-content th,
.post-content td {
    min-width: 120px;
    padding: 11px 13px;
    border: 1px solid var(--line);
    text-align: left;
}

.post-content th {
    color: var(--ink);
    background: #edf2ee;
    font-weight: 700;
}

.post-content :not(pre) > code {
    padding: 2px 6px;
    color: #a83e2b;
    background: #f1eee8;
    border: 1px solid #e3ddd3;
    border-radius: 3px;
    font-family: var(--mono);
    font-size: 0.88em;
}

.post-content pre,
.post-detail .post-content pre,
.article-layout .post-content pre {
    position: relative;
    width: 100%;
    max-width: 100%;
    max-height: none !important;
    height: auto !important;
    margin: 28px 0;
    padding: 48px 22px 22px !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    color: var(--code-ink) !important;
    background: var(--code) !important;
    border: 1px solid #263a31 !important;
    border-radius: 6px;
    box-shadow: 0 16px 36px rgba(7, 21, 17, 0.14);
    font-family: var(--mono) !important;
    font-size: 13px;
    line-height: 1.75;
    white-space: normal !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    tab-size: 4;
}

.post-content pre::before {
    content: "";
    position: absolute;
    top: 18px;
    left: 20px;
    width: 8px;
    height: 8px;
    background: var(--coral);
    border-radius: 50%;
    box-shadow: 14px 0 #e6b94f, 28px 0 #74bb62;
}

.post-content pre code,
.post-detail .post-content pre code,
.article-layout .post-content pre code {
    display: block !important;
    width: max-content !important;
    min-width: 100% !important;
    max-height: none !important;
    height: auto !important;
    padding: 0 !important;
    overflow: visible !important;
    color: inherit !important;
    background: transparent !important;
    border: 0 !important;
    font-family: inherit !important;
    font-size: inherit !important;
    line-height: inherit !important;
    white-space: pre !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
}

.post-content pre code ul {
    width: max-content !important;
    min-width: calc(100% - 35px) !important;
    white-space: pre !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
}

.post-content pre code ul li {
    white-space: pre !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
}

.btn-copy-code {
    position: absolute !important;
    top: 9px !important;
    right: 10px !important;
    z-index: 4 !important;
    min-width: 70px;
    min-height: 30px;
    padding: 0 10px !important;
    opacity: 1 !important;
    color: #d9e7dd !important;
    background: #17271f !important;
    border: 1px solid #40554a !important;
    border-radius: 4px !important;
    font-family: var(--mono) !important;
    font-size: 10px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    cursor: pointer;
}

.btn-copy-code:hover {
    color: var(--forest) !important;
    background: var(--signal) !important;
    border-color: var(--signal) !important;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 34px 0 0;
    padding-top: 22px;
    border-top: 1px solid var(--line);
}

.tags a {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 11px;
    color: var(--ink-soft);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 4px;
    font-family: var(--mono);
    font-size: 11px;
}

.tags a:hover {
    color: var(--forest);
    background: var(--signal);
    border-color: var(--signal);
}

.post-near {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 42px;
    border-top: 1px solid var(--line-strong);
    border-bottom: 1px solid var(--line-strong);
}

.post-near > div {
    min-width: 0;
    padding: 22px 24px 24px 0;
}

.post-near > div + div {
    padding: 22px 0 24px 24px;
    border-left: 1px solid var(--line-strong);
    text-align: right;
}

.post-near span {
    display: block;
    margin-bottom: 7px;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 10px;
    text-transform: uppercase;
}

.post-near a {
    display: inline-block;
    color: var(--ink);
    font-family: var(--serif);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.5;
}

/* Comments and forms */
.comments {
    margin-top: 52px;
    padding-top: 34px;
    border-top: 2px solid var(--ink);
}

.comments h2,
.respond h2 {
    margin: 0 0 24px;
    font-family: var(--serif);
    font-size: 24px;
}

.respond {
    margin-top: 22px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

#comment-form p {
    margin: 0 0 16px;
}

#comment-form label {
    display: block;
    margin-bottom: 7px;
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 11px;
}

#comment-form input,
#comment-form textarea {
    width: 100%;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 4px;
}

#comment-form input {
    height: 44px;
    padding: 0 12px;
}

#comment-form textarea {
    min-height: 170px;
    padding: 12px;
    resize: vertical;
}

#comment-form input:focus,
#comment-form textarea:focus {
    border-color: var(--focus);
    outline: 3px solid rgba(32,115,90,0.12);
}

.comment-list,
.comment-list ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

.comment-list > li {
    padding: 22px 0;
    border-top: 1px solid var(--line);
}

.comment-list .comment-children {
    margin: 16px 0 0 28px;
    padding-left: 20px;
    border-left: 2px solid var(--line);
}

.comment-author,
.comment-meta {
    font-size: 13px;
}

.comment-content {
    margin-top: 10px;
    color: var(--ink-soft);
}

/* 404 */
.empty-state {
    display: grid;
    grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1fr);
    align-items: center;
    min-height: 560px;
    padding: 70px 0;
}

.error-code {
    color: var(--forest);
    font-family: var(--mono);
    font-size: 120px;
    font-weight: 500;
}

.empty-state h1 {
    margin: 12px 0;
    font-family: var(--serif);
    font-size: 44px;
    line-height: 1.25;
}

.empty-state p {
    margin: 0 0 24px;
    color: var(--muted);
}

/* Footer */
.site-footer {
    color: #d8e3dc;
    background: var(--forest);
    border-top: 5px solid var(--signal);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: start;
    gap: 40px;
    padding: 48px 0 42px;
}

.footer-brand {
    display: flex;
    gap: 14px;
    align-items: center;
}

.footer-brand strong {
    color: #fff;
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 500;
}

.footer-brand p {
    margin: 3px 0 0;
    color: rgba(216,227,220,0.62);
    font-size: 12px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: end;
    gap: 24px;
    min-height: 44px;
    align-items: center;
}

.footer-links a {
    color: rgba(255,255,255,0.78);
    font-size: 13px;
}

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

.footer-meta {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    gap: 24px;
    padding-top: 24px;
    color: rgba(216,227,220,0.68);
    border-top: 1px solid rgba(255,255,255,0.14);
    font-family: var(--mono);
    font-size: 10px;
}

/* Tablet */
@media (max-width: 1040px) {
    .nav-shell {
        grid-template-columns: minmax(220px, 1fr) auto 180px;
        gap: 22px;
    }

    .site-search,
    .site-search input {
        width: 180px;
    }

    .hero h1 {
        font-size: 48px;
    }

    .hero-copy {
        width: 65%;
        padding: 48px 46px 52px;
    }

    .content-grid,
    .article-layout {
        grid-template-columns: minmax(0, 1fr) 260px;
        gap: 46px;
    }

    .article-head h1 {
        font-size: 43px;
    }
}

@media (max-width: 820px) {
    .shell {
        width: min(calc(100% - 36px), var(--shell));
    }

    .site-header {
        height: auto;
    }

    .nav-shell {
        grid-template-columns: minmax(0, 1fr) auto;
        min-height: 70px;
        gap: 14px;
    }

    .brand-copy small {
        display: none;
    }

    .nav-menu {
        gap: 18px;
        height: 70px;
    }

    .site-search {
        grid-column: 1 / -1;
        width: 100%;
        margin: -4px 0 12px;
    }

    .site-search input {
        width: 100%;
    }

    .hero {
        min-height: 450px;
        margin-top: 22px;
        background-position: center;
    }

    .hero-copy {
        width: 75%;
        min-height: 450px;
        padding: 48px 34px 54px;
    }

    .hero h1 {
        font-size: 46px;
    }

    .hero-copy > p {
        font-size: 16px;
    }

    .content-grid,
    .article-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 64px;
        padding: 58px 0 76px;
    }

    .sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0 30px;
    }

    .profile-card,
    .recent-card {
        grid-row: span 2;
    }

    .article-head h1 {
        font-size: 40px;
    }

    .archive-heading {
        padding-top: 48px;
    }

    .archive-heading h1 {
        font-size: 40px;
    }
}

/* Mobile */
@media (max-width: 600px) {
    .shell {
        width: min(calc(100% - 28px), var(--shell));
    }

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

    .brand-mark {
        flex-basis: 34px;
        width: 34px;
        height: 34px;
    }

    .brand-copy strong {
        font-size: 11px;
    }

    .nav-menu {
        gap: 12px;
        height: 64px;
    }

    .nav-menu a {
        font-size: 13px;
    }

    .hero {
        min-height: 450px;
        margin-top: 14px;
        background-image:
            linear-gradient(180deg, rgba(7,27,21,0.82) 0%, rgba(7,27,21,0.92) 55%, rgba(7,27,21,0.99) 100%),
            var(--hero-image);
        background-position: center, 55% top;
        background-size: cover, auto 60%;
        background-repeat: no-repeat;
    }

    .hero::before {
        background-size: 36px 36px;
    }

    .hero::after {
        display: none;
    }

    .hero-copy {
        justify-content: end;
        width: 100%;
        min-height: 450px;
        padding: 126px 22px 38px;
    }

    .hero-kicker {
        font-size: 10px;
    }

    .hero h1 {
        margin: 15px 0 13px;
        font-size: 38px;
        line-height: 1.22;
    }

    .hero-copy > p {
        font-size: 14px;
        line-height: 1.7;
    }

    .hero-actions {
        gap: 8px;
        margin-top: 22px;
    }

    .button {
        min-height: 44px;
        padding: 0 14px;
        font-size: 13px;
    }

    .content-grid,
    .article-layout {
        gap: 52px;
        padding: 48px 0 66px;
    }

    .section-heading {
        display: block;
    }

    .section-heading h2 {
        font-size: 31px;
    }

    .section-heading > p {
        margin-top: 10px;
        text-align: left;
    }

    .post-card {
        grid-template-columns: 58px minmax(0, 1fr);
        gap: 12px;
        padding: 28px 0 30px;
    }

    .post-date {
        padding-right: 12px;
    }

    .post-date strong {
        font-size: 12px;
    }

    .post-date span {
        font-size: 11px;
    }

    .post-card h2 {
        font-size: 23px;
    }

    .post-meta-line {
        gap: 5px 10px;
        font-size: 12px;
    }

    .post-meta-line > *:not(:first-child)::before {
        margin-right: 10px;
    }

    .post-excerpt {
        font-size: 14px;
        -webkit-line-clamp: 4;
    }

    .side-list a,
    .category-card .side-list a,
    .archive-list a,
    .utility-list a,
    .tags a,
    .footer-links a {
        min-height: 44px;
    }

    .footer-links a {
        display: inline-flex;
        align-items: center;
    }

    .sidebar {
        display: block;
    }

    .profile-card {
        padding: 24px;
    }

    .article-head {
        padding-bottom: 26px;
    }

    .article-back {
        margin-bottom: 16px;
    }

    .article-head h1 {
        margin-top: 14px;
        font-size: 34px;
        line-height: 1.32;
    }

    .post-content {
        padding-top: 28px;
        font-size: 16px;
        line-height: 1.9;
    }

    .post-content h2 {
        font-size: 25px;
    }

    .post-content h3 {
        font-size: 21px;
    }

    .post-content pre,
    .post-detail .post-content pre,
    .article-layout .post-content pre {
        margin-right: 0;
        margin-left: 0;
        padding: 46px 16px 18px !important;
        font-size: 12px;
    }

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

    .post-near > div,
    .post-near > div + div {
        padding: 18px 0;
        border-left: 0;
        text-align: left;
    }

    .post-near > div + div {
        border-top: 1px solid var(--line);
    }

    .form-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .archive-heading {
        display: block;
        padding-top: 40px;
    }

    .archive-heading h1 {
        margin-top: 8px;
        font-size: 34px;
    }

    .archive-heading p {
        margin-top: 10px;
    }

    .empty-state {
        display: block;
        min-height: 500px;
        padding: 70px 0;
    }

    .error-code {
        font-size: 76px;
    }

    .empty-state h1 {
        font-size: 34px;
    }

    .footer-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 24px;
        padding: 38px 0 34px;
    }

    .footer-links {
        justify-content: start;
    }

    .footer-meta {
        display: grid;
        gap: 5px;
    }
}

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

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
