/* ==========================================================================
   urang — Engineering Clean & Safety
   White canvas + slate ink + safety green/amber. Readability first.
   ========================================================================== */

@font-face {
    font-family: "Pretendard";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/pretendard-400.woff2") format("woff2");
}
@font-face {
    font-family: "Pretendard";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("../fonts/pretendard-600.woff2") format("woff2");
}
@font-face {
    font-family: "Pretendard";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("../fonts/pretendard-700.woff2") format("woff2");
}

:root {
    /* Surface */
    --bg-canvas: #ffffff;
    --bg-subtle: #f8fafc;
    --bg-inset: #f1f5f9;

    /* Brand */
    --brand: #154734;
    --brand-hover: #0d2f22;
    --brand-tint: #e8f2ec;
    --accent: #d97706;

    /* Ink */
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --text-inverse: #ffffff;

    /* Lines */
    --line: #e2e8f0;
    --line-strong: #cbd5e1;

    /* Type */
    --sans: "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Segoe UI", Roboto, sans-serif;
    --mono: ui-monospace, "SFMono-Regular", "Consolas", monospace;

    /* Layout */
    --max: 1080px;
    --reading: 720px;
    --gutter: clamp(20px, 4vw, 32px);
    --header-h: 60px;
    --chip-h: 48px;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { background: var(--bg-canvas); -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    color: var(--text-primary);
    background: var(--bg-canvas);
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.75;
    letter-spacing: -0.015em;
    word-break: keep-all;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}
@media (min-width: 768px) {
    body { font-size: 18px; line-height: 1.8; }
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; letter-spacing: inherit; }
h1, h2, h3, h4 {
    margin: 0;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.3;
    text-wrap: balance;
}

.skip-link {
    position: absolute;
    left: 12px;
    top: 0;
    transform: translateY(-110%);
    background: var(--brand);
    color: var(--text-inverse);
    padding: 10px 14px;
    z-index: 40;
    border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { transform: translateY(0); }

/* --------------------------------------------------------------------------
   Header — 60px sticky, hides on scroll down
   -------------------------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    background: color-mix(in srgb, var(--bg-canvas) 92%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
    transition: transform 0.25s ease;
}
.site-header.is-hidden { transform: translateY(-100%); }
.site-header-inner {
    max-width: var(--max);
    margin: 0 auto;
    height: var(--header-h);
    padding: 0 var(--gutter);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.kn-logo {
    width: 28px;
    height: 32px;
    color: var(--brand);
    flex: 0 0 auto;
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.01em;
}
.brand-sub {
    font-size: 10px;
    letter-spacing: 0.14em;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 20px;
    min-width: 0;
}
.site-nav .nav,
.footer-nav .nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 20px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.site-nav .nav a,
.nav-link {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}
.site-nav .nav a:hover,
.site-nav .nav .nav-current a,
.nav-link:hover { color: var(--brand); }
.nav-cta {
    display: inline-flex;
    align-items: center;
    height: 38px;
    padding: 0 16px;
    border-radius: 999px;
    background: var(--brand);
    color: var(--text-inverse);
    font-size: 14px;
    font-weight: 600;
}
.nav-cta:hover { background: var(--brand-hover); }
/* 모바일 메뉴용 카테고리 그룹 — 데스크톱에서는 숨김 (카테고리는 칩 바 이용) */
.nav-cats { display: none; }
.nav-group-label {
    margin: 0;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.nav-cat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 10px;
}
.nav-cat-grid a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 40px;
    padding: 0 10px;
    border-radius: var(--radius, 8px);
    background: var(--bg-subtle, #f4f6f5);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}
.nav-cat-grid a em {
    font-style: normal;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
}
.nav-cat-grid a:active { background: rgba(21, 71, 52, 0.12); }
.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: 0;
    background: none;
    padding: 0;
    cursor: pointer;
}
.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    margin: 5px auto;
    border-radius: 1px;
    background: var(--text-primary);
}

/* Category chip bar — horizontal scroll, thumb friendly */
.chip-bar {
    background: var(--bg-canvas);
    border-bottom: 1px solid var(--line);
}
.chip-bar-inner {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 var(--gutter);
    display: flex;
    align-items: center;
    gap: 8px;
    height: var(--chip-h);
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    position: relative;
}
.chip-bar-inner::-webkit-scrollbar { display: none; }
.chip {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-canvas);
    white-space: nowrap;
}
.chip em {
    font-style: normal;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-muted);
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.is-active {
    background: var(--brand);
    border-color: var(--brand);
    color: var(--text-inverse);
}
.chip.is-active em { color: color-mix(in srgb, var(--text-inverse) 70%, transparent); }

/* --------------------------------------------------------------------------
   Home
   -------------------------------------------------------------------------- */
.intro {
    background: linear-gradient(180deg, var(--bg-subtle) 0%, var(--bg-canvas) 100%);
    border-bottom: 1px solid var(--line);
}
.intro-inner {
    max-width: var(--max);
    margin: 0 auto;
    padding: clamp(44px, 7vw, 80px) var(--gutter);
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    gap: clamp(28px, 5vw, 64px);
    align-items: end;
}
.kicker {
    margin: 0 0 14px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
}
.intro-title {
    font-size: clamp(28px, 4.4vw, 44px);
    font-weight: 700;
    line-height: 1.28;
    letter-spacing: -0.03em;
}
.intro-body {
    margin: 18px 0 0;
    color: var(--text-secondary);
    max-width: 36em;
}
.intro-side {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-bottom: 4px;
}
.intro-sign strong {
    display: block;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.04em;
}
.intro-sign span {
    display: block;
    margin-top: 2px;
    font-size: 11.5px;
    letter-spacing: 0.14em;
    color: var(--text-muted);
}
.intro-stats {
    display: flex;
    gap: 24px;
}
.stat b {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: var(--brand);
    line-height: 1.2;
}
.stat span {
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 0.06em;
}

.topics {
    max-width: var(--max);
    margin: 0 auto;
    padding: clamp(28px, 4vw, 48px) var(--gutter) 0;
}
.topic-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}
.topic-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 18px 18px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-canvas);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.topic-card:hover {
    border-color: var(--brand);
    box-shadow: var(--shadow);
}
.topic-card h3 {
    font-size: 16.5px;
    font-weight: 700;
    color: var(--text-primary);
}
.topic-card span {
    font-size: 12.5px;
    color: var(--text-muted);
}
.topic-card .topic-count {
    margin-top: 8px;
    font-size: 12px;
    font-weight: 700;
    color: var(--brand);
}

.section-label {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 8px;
}
.section-label span {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: var(--accent);
}
.section-label h2 {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.home-feed {
    max-width: var(--max);
    margin: 0 auto;
    padding: clamp(36px, 5vw, 56px) var(--gutter) clamp(48px, 6vw, 72px);
}

.post-list { list-style: none; margin: 0; padding: 0; }
.post-item + .post-item { border-top: 1px solid var(--line); }
.post-item a {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: start;
    padding: 18px 0;
    min-width: 0;
}
.post-item-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 6px;
    font-size: 12.5px;
    color: var(--text-muted);
}
.post-item-meta .tag-badge {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 8px;
    border-radius: 4px;
    background: var(--brand-tint);
    color: var(--brand);
    font-size: 11.5px;
    font-weight: 600;
}
.post-item h3 {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
}
.post-item p {
    margin: 6px 0 0;
    color: var(--text-secondary);
    font-size: 14.5px;
    line-height: 1.65;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.post-item time {
    font-size: 12.5px;
    color: var(--text-muted);
    flex: 0 0 auto;
    white-space: nowrap;
}
.post-item a:hover h3 { color: var(--brand); }

.vision-band {
    background: var(--brand);
    color: var(--text-inverse);
    padding: clamp(48px, 7vw, 80px) var(--gutter);
}
.vision-band blockquote {
    max-width: 680px;
    margin: 0 auto;
    text-align: center;
}
.vision-band p {
    font-size: clamp(21px, 3vw, 30px);
    font-weight: 600;
    line-height: 1.5;
    margin: 0;
    text-wrap: balance;
}
.vision-band cite {
    display: block;
    margin-top: 18px;
    font-style: normal;
    font-size: 13px;
    letter-spacing: 0.16em;
    opacity: 0.75;
}

/* --------------------------------------------------------------------------
   Archive / list pages
   -------------------------------------------------------------------------- */
.archive {
    max-width: var(--reading);
    margin: 0 auto;
    padding: clamp(36px, 5vw, 56px) var(--gutter) 72px;
    min-width: 0;
}
.archive-head { margin-bottom: 24px; }
.archive-head h1 {
    font-size: clamp(26px, 4vw, 36px);
    font-weight: 700;
}
.archive-desc {
    margin: 10px 0 0;
    color: var(--text-secondary);
}
.archive-count, .archive-meta {
    margin: 8px 0 0;
    font-size: 13.5px;
    color: var(--text-muted);
}
.author-photo {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 50%;
    margin-bottom: 14px;
}
.post-list.is-page { border-top: 2px solid var(--text-primary); }
.post-list.is-page .post-item a { padding: 20px 0; }
.post-list.is-page h3 { font-size: 19px; }

/* --------------------------------------------------------------------------
   Article (post / page)
   -------------------------------------------------------------------------- */
.reading {
    padding: clamp(32px, 5vw, 56px) var(--gutter) 72px;
}
.article {
    max-width: var(--reading);
    margin: 0 auto;
    min-width: 0;
}
.article-head { margin-bottom: 28px; }
.article-head h1 {
    font-size: clamp(26px, 4.5vw, 38px);
    font-weight: 700;
    line-height: 1.3;
}
.article-head .kicker { margin-bottom: 12px; }
.article-dek {
    margin: 14px 0 0;
    font-size: clamp(16.5px, 2vw, 19px);
    line-height: 1.6;
    color: var(--text-secondary);
}
.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin: 18px 0 0;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--line);
    font-size: 13.5px;
    color: var(--text-muted);
}
.article-hero { margin: 0 0 32px; }
.article-hero figcaption {
    margin-top: 10px;
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
}

.article-body {
    font-size: 17px;
    line-height: 1.78;
    overflow-wrap: anywhere;
}
@media (min-width: 768px) {
    .article-body { font-size: 18px; line-height: 1.8; }
}
.article-body > * { margin: 0 0 1.25em; }
.article-body h2 {
    margin: 1.8em 0 0.6em;
    font-size: clamp(21px, 2.6vw, 25px);
    line-height: 1.35;
}
.article-body h3 {
    margin: 1.5em 0 0.5em;
    font-size: clamp(18px, 2.2vw, 20px);
    line-height: 1.4;
}
.article-body a {
    color: var(--brand);
    text-decoration: underline;
    text-underline-offset: 3px;
    word-break: break-all;
}
.article-body ul, .article-body ol { padding-left: 1.4em; }
.article-body li { margin: 0.3em 0; }
.article-body li::marker { color: var(--accent); }
.article-body hr {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 2.5em 0;
}
.article-body blockquote {
    margin: 2em 0;
    padding: 16px 20px;
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius) var(--radius) 0;
    background: #fffbeb;
    color: var(--text-primary);
    font-size: 0.95em;
    line-height: 1.7;
}
.article-body blockquote p:last-child { margin-bottom: 0; }

/* ── Editorial components (hand-styled posts) ── */
.article-body .exam-question {
    margin: 1.5em 0 1.75em;
    padding: 18px 20px;
    border: 1.5px solid var(--brand);
    border-radius: var(--radius);
    background: #f4f8f6;
    font-size: 1.02em;
    font-weight: 600;
    line-height: 1.65;
}
.article-body .exam-question::before {
    content: "QUESTION";
    display: block;
    margin-bottom: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: var(--brand);
}
.article-body .exam-question p:last-child { margin-bottom: 0; }

.article-body .check-card {
    margin: 1.75em 0;
    padding: 18px 20px 14px;
    border: 1px solid var(--line);
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius) var(--radius) 0;
    background: #fffdf7;
}
.article-body .check-card .check-label {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--accent);
}
.article-body .check-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.article-body .check-card li {
    position: relative;
    padding-left: 26px;
    margin: 8px 0;
    line-height: 1.6;
}
.article-body .check-card li::before {
    content: "✓";
    position: absolute;
    left: 2px;
    top: 0;
    font-weight: 700;
    color: var(--accent);
}

.article-body .note-card {
    margin: 1.75em 0;
    padding: 16px 20px;
    border: 1px solid rgba(21, 71, 52, 0.18);
    border-radius: var(--radius);
    background: #f4f8f6;
    line-height: 1.7;
}
.article-body .note-card .note-label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--brand);
}
.article-body .note-card p:last-child { margin-bottom: 0; }

.article-body .takeaway {
    margin: 2.25em 0 1.75em;
    padding: 22px 24px;
    border-radius: var(--radius);
    background: var(--brand);
    color: #fff;
    line-height: 1.75;
}
.article-body .takeaway .takeaway-label {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.16em;
    color: rgba(255, 255, 255, 0.72);
}
.article-body .takeaway p { color: #fff; }
.article-body .takeaway p:last-child { margin-bottom: 0; }

.article-body .pull-quote {
    margin: 2.25em auto;
    padding: 0 8px;
    max-width: 560px;
    text-align: center;
    font-size: 1.12em;
    font-weight: 600;
    line-height: 1.75;
    color: var(--brand);
}
.article-body .pull-quote p:last-child { margin-bottom: 0; }

.article-body .divider-mark {
    border: 0;
    margin: 2.5em auto;
    text-align: center;
    border-top: 0;
}
.article-body .divider-mark::before {
    content: "· · ·";
    display: block;
    color: var(--text-muted);
    letter-spacing: 0.5em;
    font-size: 15px;
}

.article-body .hash-line {
    margin-top: 2.5em;
    padding-top: 14px;
    border-top: 1px dashed var(--line);
    font-size: 13.5px;
    color: var(--text-muted);
    word-break: keep-all;
}

.article-body .info-card {
    margin: 1.75em 0;
    padding: 4px 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-subtle);
}
.article-body .info-card dl {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 0;
    margin: 0;
}
.article-body .info-card dt {
    padding: 10px 0;
    font-weight: 600;
    font-size: 0.85em;
    color: var(--brand);
    border-bottom: 1px solid var(--line);
}
.article-body .info-card dd {
    margin: 0;
    padding: 10px 0;
    font-size: 0.92em;
    border-bottom: 1px solid var(--line);
}
.article-body .info-card dl dt:last-of-type,
.article-body .info-card dl dd:last-of-type { border-bottom: 0; }

.article-body .clean-table th { white-space: nowrap; }
.article-body .clean-table td { white-space: normal; }
.article-body .clean-table td ul { margin: 0; padding-left: 1.1em; }

/* ── Flow diagram (절차/순서 다이어그램) ── */
.article-body .flow-diagram {
    margin: 2.25em 0;
    padding: 20px 20px 18px;
    border: 1px solid rgba(21, 71, 52, 0.18);
    border-radius: var(--radius);
    background: linear-gradient(180deg, #f4f8f6 0%, #fbfdfc 100%);
}
.article-body .flow-diagram .flow-title {
    margin: 0 0 14px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: var(--brand);
}
.article-body .flow-steps {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 22px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.article-body .flow-step {
    position: relative;
    margin: 0;
    padding: 12px 10px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-canvas);
    box-shadow: var(--shadow);
    text-align: center;
}
.article-body .flow-step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 50%;
    right: -16px;
    width: 9px;
    height: 9px;
    border-top: 2px solid var(--accent);
    border-right: 2px solid var(--accent);
    transform: translateY(-50%) rotate(45deg);
}
.article-body .flow-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--brand);
    color: var(--text-inverse);
    font-size: 12px;
    font-weight: 700;
}
.article-body .flow-label {
    display: block;
    margin-top: 8px;
    font-size: 14.5px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text-primary);
    word-break: keep-all;
}
.article-body .flow-note {
    display: block;
    margin-top: 4px;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--text-muted);
    word-break: keep-all;
}
@media (max-width: 640px) {
    .article-body .flow-steps { grid-auto-flow: row; gap: 18px; }
    .article-body .flow-step { text-align: left; padding: 12px 14px; }
    .article-body .flow-step .flow-num {
        position: absolute;
        left: 14px;
        top: 12px;
    }
    .article-body .flow-step .flow-label { margin-top: 0; padding-left: 32px; }
    .article-body .flow-step .flow-note { padding-left: 32px; }
    .article-body .flow-step:not(:last-child)::after {
        top: auto;
        right: auto;
        bottom: -14px;
        left: 24px;
        border-top: 0;
        border-right: 0;
        border-bottom: 2px solid var(--accent);
        border-left: 2px solid var(--accent);
        transform: rotate(-45deg);
    }
}

/* ── Tree groups (유형/원인 분류 다이어그램) ── */
.article-body .tree-groups {
    margin: 2.25em 0;
}
.article-body .tree-groups .tree-title {
    margin: 0 0 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: var(--brand);
}
.article-body .tree-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}
.article-body .tree-group {
    padding: 14px 16px 10px;
    border: 1px solid var(--line);
    border-top: 3px solid var(--brand);
    border-radius: 0 0 var(--radius) var(--radius);
    background: var(--bg-subtle);
}
.article-body .tree-group-label {
    margin: 0 0 8px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--brand);
}
.article-body .tree-group ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.article-body .tree-group li {
    position: relative;
    margin: 6px 0;
    padding-left: 14px;
    font-size: 14px;
    line-height: 1.55;
}
.article-body .tree-group li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.62em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
}
@media (max-width: 480px) {
    .article-body .tree-cols { grid-template-columns: 1fr; }
}

/* ── Table caption (표 제목) ── */
.article-body .table-caption {
    margin: 1.75em 0 -0.9em;
    padding-left: 10px;
    border-left: 3px solid var(--brand);
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1.5;
    color: var(--brand);
}

/* ── Section labels for restyled posts ── */
.article-body h3 {
    padding-left: 12px;
    border-left: 4px solid var(--brand);
}
.article-body h4 {
    margin: 1.3em 0 0.45em;
    font-size: 16.5px;
    line-height: 1.5;
    color: var(--brand);
}

/* ── List label (리스트 앞 라벨 문단) ── */
.article-body .list-label {
    margin: 1.2em 0 0.35em;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Images: naver captures are white-background — hairline border to seat them */
.article-body img {
    margin: 1.75em auto;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: var(--radius);
}
.article-body figure { margin: 0 0 1.5em; }
.article-body figcaption {
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
}

/* Tables: horizontal scroll on mobile */
.article-body table,
.gh-content table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-collapse: collapse;
    margin: 1.75em 0;
    font-size: 14.5px;
    line-height: 1.6;
}
.article-body th, .article-body td,
.gh-content th, .gh-content td {
    padding: 10px 14px;
    border: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
    white-space: nowrap;
}
.article-body th, .gh-content th {
    background: var(--bg-subtle);
    font-weight: 600;
    color: var(--text-primary);
}

/* Code */
.article-body pre, .article-body code {
    font-family: var(--mono);
    letter-spacing: 0;
    word-break: normal;
}
.article-body pre {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px;
    background: var(--bg-inset);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-size: 14px;
    line-height: 1.6;
}
.article-body code {
    font-size: 0.875em;
    background: var(--bg-inset);
    padding: 2px 6px;
    border-radius: 4px;
}
.article-body pre code { background: none; padding: 0; }

.gh-content .kg-width-wide { max-width: calc(var(--reading) + 160px); margin-left: auto; margin-right: auto; }
.gh-content .kg-width-full { width: 100%; max-width: 100%; }
.gh-content .kg-width-full img,
.gh-content .kg-width-wide img { width: 100%; }

.article-foot {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    font-size: 13.5px;
    color: var(--text-muted);
}
.more-reading { max-width: var(--reading); margin: 56px auto 0; }

.article-comments {
    max-width: var(--reading);
    margin: 56px auto 0;
}

.article-comments #remark42 iframe {
    width: 100% !important;
    max-width: 100%;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 36px;
    font-size: 14.5px;
    font-weight: 600;
}
.pagination a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    color: var(--text-secondary);
}
.pagination a:hover {
    border-color: var(--brand);
    color: var(--brand);
}
.pagination span { color: var(--text-muted); font-weight: 400; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
    background: var(--bg-subtle);
    border-top: 1px solid var(--line);
    color: var(--text-secondary);
    padding: clamp(40px, 6vw, 64px) var(--gutter) 24px;
}
.footer-grid {
    max-width: var(--max);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.2fr 0.8fr 1fr;
    gap: 36px;
}
.footer-brand .kn-logo { width: 36px; height: 42px; }
.footer-name {
    margin: 12px 0 2px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}
.footer-role, .footer-line, .footer-bottom, .footer-nav a {
    font-size: 13px;
    color: var(--text-muted);
}
.footer-line { margin: 2px 0 0; }
.footer-nav { display: flex; flex-direction: column; gap: 10px; padding-top: 6px; }
.footer-nav .nav { gap: 10px 18px; }
.footer-nav a:hover { color: var(--brand); }
.footer-subscribe label { display: block; margin-bottom: 10px; font-size: 14px; color: var(--text-primary); font-weight: 600; }
.subscribe-row { display: flex; flex-wrap: wrap; gap: 8px; }
.subscribe-row input {
    flex: 1 1 180px;
    min-width: 0;
    height: 44px;
    padding: 0 14px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--bg-canvas);
    color: var(--text-primary);
}
.subscribe-row input:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
.subscribe-row button {
    height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: var(--radius);
    background: var(--brand);
    color: var(--text-inverse);
    font-weight: 600;
    cursor: pointer;
}
.form-message { display: none; font-size: 13px; }
.success .form-success, .error .form-error { display: block; }
.footer-bottom {
    max-width: var(--max);
    margin: 40px auto 0;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
}

/* --------------------------------------------------------------------------
   Misc
   -------------------------------------------------------------------------- */
.error-wrap {
    min-height: 70vh;
    display: grid;
    place-content: center;
    text-align: center;
    gap: 16px;
    padding: 40px;
}

/* About page */
.about .archive-head { margin-bottom: 32px; }
.about-lead {
    margin: 12px 0 0;
    font-size: clamp(19px, 2.4vw, 23px);
    font-weight: 600;
    line-height: 1.55;
    color: var(--text-primary);
}
.about .archive-meta { margin-top: 14px; }
.about-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.8fr);
    gap: clamp(28px, 5vw, 56px);
    align-items: start;
    padding-bottom: 56px;
}
.about-main section + section { margin-top: 44px; }
.about-main .section-label { margin-bottom: 14px; }
.about-list {
    margin: 0;
    padding: 0;
    list-style: none;
}
.about-list li {
    padding: 9px 0 9px 18px;
    border-bottom: 1px solid var(--line);
    position: relative;
    font-size: 15.5px;
    line-height: 1.7;
    color: var(--text-secondary);
}
.about-list li::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 1.05em;
    width: 6px;
    height: 2px;
    border-radius: 1px;
    background: var(--accent);
}
.about-photo { margin: 0 0 16px; }
.about-photo img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    object-position: 62% 28%;
    border-radius: var(--radius);
}
.about-photo figcaption {
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
}
.about-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px 20px;
    background: var(--bg-canvas);
    margin-bottom: 12px;
}
.about-card .kn-logo { width: 36px; height: 42px; }
.about-card-name {
    margin: 12px 0 2px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--text-primary);
}
.about-card-role {
    font-size: 12px;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}
.about-card p { margin: 0; font-size: 13.5px; color: var(--text-secondary); }
.about-card .about-card-line { margin-top: 8px; color: var(--brand); font-weight: 600; }
.about-card.is-dark {
    background: var(--brand);
    border-color: var(--brand);
}
.about-card.is-dark .about-card-name,
.about-card.is-dark p { color: var(--text-inverse); }
.about-card.is-dark .about-card-role { color: color-mix(in srgb, var(--text-inverse) 70%, transparent); }
.about-card.is-dark .about-card-line { color: #f5d9a8; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
    .topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .about-grid { grid-template-columns: 1fr; }
}

@media (max-width: 800px) {
    .intro-inner { grid-template-columns: 1fr; align-items: start; }
    .intro-side {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        padding: 16px;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        background: var(--bg-canvas);
    }
    .footer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
    .site-header-inner { height: 56px; }
    .nav-toggle { display: block; }
    .site-nav {
        display: none;
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        padding: 12px var(--gutter) 16px;
        background: var(--bg-canvas);
        border-bottom: 1px solid var(--line);
        box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
    }
    .site-header.is-open .site-nav { display: flex; }
    .site-nav .nav { flex-direction: column; align-items: stretch; gap: 2px; }
    .nav-cats {
        display: grid;
        gap: 6px;
        margin-top: 6px;
        padding-top: 12px;
        border-top: 1px solid var(--line);
    }
    .site-nav .nav a,
    .nav-link {
        display: flex;
        align-items: center;
        min-height: 44px;
        font-size: 16px;
    }
    .nav-cta { justify-content: center; margin-top: 8px; }
    .post-item a { grid-template-columns: 1fr; gap: 4px; }
    .post-item time { order: -1; }
}

@media (max-width: 420px) {
    .intro-stats { gap: 20px; }

    /* 카테고리 블록: 좁은 화면에서도 2열 유지 + 컴팩트 카드 */
    .topic-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }
    .topic-card {
        padding: 12px 12px 10px;
        gap: 2px;
    }
    .topic-card h3 { font-size: 14px; }
    .topic-card span:not(.topic-count) { display: none; }
    .topic-card .topic-count {
        margin-top: 4px;
        font-size: 11px;
    }
}

/* Touch targets */
button, .nav-link, .chip, .pagination a {
    touch-action: manipulation;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}
