/* ==========================================================================
   bzantium — minimal, content-first blog theme
   Light and dark tokens, Geist (Pretendard for Korean), reading-focused typography
   ========================================================================== */

:root {
  --bg: #ffffff;
  --bg-soft: #f7f7f9;
  --surface: #ffffff;
  --border: #e7e7ec;
  --border-strong: #d4d4dc;
  --text: #16161d;
  --text-2: #4a4a57;
  --text-3: #80808f;
  --accent: #4f46e5;
  --accent-2: #0ea5e9;
  --accent-soft: rgba(79, 70, 229, 0.08);
  --accent-text: #4338ca;
  --code-bg: #f6f7fb;
  --code-border: #e7e8f0;
  --inline-code-bg: rgba(79, 70, 229, 0.07);
  --inline-code-text: #4338ca;
  --shadow: 0 1px 2px rgba(16, 16, 24, 0.04), 0 8px 24px -12px rgba(16, 16, 24, 0.12);
  --shadow-lg: 0 2px 4px rgba(16, 16, 24, 0.04), 0 24px 48px -16px rgba(16, 16, 24, 0.18);
  --header-bg: rgba(255, 255, 255, 0.78);

  --font-sans: Geist, "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --radius: 14px;
  --radius-sm: 8px;
  --container: 1120px;
  --narrow: 720px;
  --header-h: 64px;
  --gutter: 20px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0d12;
    --bg-soft: #11141b;
    --surface: #12151d;
    --border: #232733;
    --border-strong: #313646;
    --text: #ececf1;
    --text-2: #b4b6c3;
    --text-3: #7d8193;
    --accent: #818cf8;
    --accent-2: #38bdf8;
    --accent-soft: rgba(129, 140, 248, 0.12);
    --accent-text: #a5b4fc;
    --code-bg: #10131a;
    --code-border: #232733;
    --inline-code-bg: rgba(129, 140, 248, 0.14);
    --inline-code-text: #c7d2fe;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.3), 0 24px 48px -16px rgba(0, 0, 0, 0.7);
    --header-bg: rgba(11, 13, 18, 0.72);
  }
}
:root[data-theme="dark"] {
  --bg: #0b0d12;
  --bg-soft: #11141b;
  --surface: #12151d;
  --border: #232733;
  --border-strong: #313646;
  --text: #ececf1;
  --text-2: #b4b6c3;
  --text-3: #7d8193;
  --accent: #818cf8;
  --accent-2: #38bdf8;
  --accent-soft: rgba(129, 140, 248, 0.12);
  --accent-text: #a5b4fc;
  --code-bg: #10131a;
  --code-border: #232733;
  --inline-code-bg: rgba(129, 140, 248, 0.14);
  --inline-code-text: #c7d2fe;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.3), 0 24px 48px -16px rgba(0, 0, 0, 0.7);
  --header-bg: rgba(11, 13, 18, 0.72);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 24px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  letter-spacing: -0.005em;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.container.narrow { max-width: calc(var(--narrow) + var(--gutter) * 2); }
.container.wide { max-width: calc(960px + var(--gutter) * 2); }
.site-main { flex: 1; padding-bottom: 96px; }

.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--accent); color: #fff; padding: 8px 14px; border-radius: var(--radius-sm); }
.skip-link:focus { left: 8px; }

.icon { width: 1.1em; height: 1.1em; flex-shrink: 0; }
.sep { display: inline-block; width: 1px; height: 0.9em; margin: 0 4px; background: var(--border-strong); vertical-align: middle; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--border); }
.header-inner { height: 100%; display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: -0.02em; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: #000; box-shadow: inset 0 0 0 1px var(--border); }
.site-nav { margin-left: auto; display: flex; gap: 4px; }
.site-nav a { padding: 6px 12px; border-radius: 999px; font-size: 15px; font-weight: 500; color: var(--text-2); transition: color .15s, background .15s; }
.site-nav a:hover { color: var(--text); background: var(--bg-soft); }
.site-nav a[aria-current="page"] { color: var(--text); background: var(--bg-soft); }
.header-actions { display: flex; gap: 4px; }

.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  background: transparent; border: 1px solid transparent; color: var(--text-2); cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.icon-btn:hover { background: var(--bg-soft); color: var(--text); border-color: var(--border); }
.only-dark { display: none; }
:root[data-theme="dark"] .only-dark { display: contents; }
:root[data-theme="dark"] .only-light { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .only-dark { display: contents; }
  :root:not([data-theme="light"]) .only-light { display: none; }
}
.menu-btn { display: none; }

.progress {
  position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%;
  transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

@media (max-width: 720px) {
  .menu-btn { display: inline-grid; }
  .site-nav {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; gap: 0; padding: 8px var(--gutter) 16px;
    background: var(--bg); border-bottom: 1px solid var(--border);
    display: none;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 12px 8px; border-radius: 8px; font-size: 16px; }
  .header-actions { margin-left: auto; }
}

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 32px 0; color: var(--text-3); font-size: 14px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.copyright { margin: 0; }
.social { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; }
.social a { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: var(--text-3); transition: color .15s, background .15s; }
.social a:hover { color: var(--text); background: var(--bg-soft); }

.to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 40;
  background: var(--surface); border-color: var(--border); box-shadow: var(--shadow);
  opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .2s, transform .2s;
}
.to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }

/* ---------- Hero (home) ---------- */
.hero { display: flex; gap: 32px; align-items: flex-start; padding-top: 72px; padding-bottom: 56px; }
.hero-text { flex: 1; min-width: 0; }
.hero-avatar { width: 88px; height: 88px; border-radius: 50%; border: 1px solid var(--border); flex-shrink: 0; }
.eyebrow { margin: 0 0 10px; font-size: 14px; font-weight: 600; color: var(--accent-text); letter-spacing: 0; }
.hero-title { margin: 0 0 16px; font-size: clamp(30px, 5vw, 44px); line-height: 1.25; letter-spacing: -0.035em; font-weight: 800; }
.grad { background: linear-gradient(120deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-bio { text-wrap: pretty; margin: 0 0 20px; max-width: 880px; font-size: 17px; line-height: 1.8; color: var(--text-2); }
.hero .social { margin-left: -8px; }
@media (max-width: 640px) {
  .hero { flex-direction: column; gap: 20px; padding-top: 48px; padding-bottom: 32px; }
  .hero-text { flex: 1; min-width: 0; }
.hero-avatar { width: 72px; height: 72px; }
}

/* ---------- Sections & cards ---------- */
.section { margin-top: 24px; margin-bottom: 48px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 18px; }
.section-title { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); font-weight: 700; }
.more { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; color: var(--text-2); }
.more:hover { color: var(--accent-text); }

.post-list { display: grid; gap: 4px; }
.post-card { position: relative; border-radius: var(--radius); transition: background .2s; }
.post-list .post-card { padding: 20px; margin: 0 -20px; }
.post-list .post-card:hover { background: var(--bg-soft); }
.post-card .meta { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--text-3); }
.post-card-title { margin: 8px 0 6px; font-size: 20px; line-height: 1.4; letter-spacing: -0.025em; font-weight: 700; }
.post-card-title a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.post-card-excerpt { margin: 0; color: var(--text-2); font-size: 15.5px; line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-card .tags { position: relative; z-index: 1; margin-top: 14px; }

.post-card.is-featured {
  display: grid; grid-template-columns: 1.15fr 1fr; overflow: hidden;
  border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow);
  transition: box-shadow .25s, transform .25s, border-color .25s;
}
.post-card.is-featured:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); border-color: var(--border-strong); }
.post-card-media { display: block; overflow: hidden; background: var(--bg-soft); min-height: 260px; }
.post-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.post-card.is-featured:hover .post-card-media img { transform: scale(1.03); }
.post-card.is-featured .post-card-body { padding: 32px; display: flex; flex-direction: column; justify-content: center; }
.post-card.is-featured .post-card-title { font-size: clamp(22px, 2.6vw, 28px); line-height: 1.35; margin: 12px 0 12px; }
.post-card.is-featured .post-card-excerpt { -webkit-line-clamp: 3; }
@media (max-width: 820px) {
  .post-card.is-featured { grid-template-columns: 1fr; }
  .post-card-media { min-height: 0; aspect-ratio: 16 / 9; }
  .post-card.is-featured .post-card-body { padding: 24px; }
}

.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 500;
  color: var(--accent-text); background: var(--accent-soft); transition: background .15s;
}
.tag:hover { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.tag .count { color: var(--text-3); font-weight: 500; }

/* ---------- Page ---------- */
.page { padding-top: 64px; }
.page-header { margin-bottom: 40px; }
.page-title { margin: 0 0 8px; font-size: clamp(30px, 5vw, 40px); letter-spacing: -0.035em; font-weight: 800; line-height: 1.25; }
.page-desc { margin: 0; color: var(--text-2); font-size: 17px; }

.archive { display: grid; gap: 40px; }
.archive-year-title { margin: 0 0 8px; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; display: flex; align-items: center; gap: 10px; }
.archive-year-title .count { font-size: 13px; font-weight: 600; color: var(--text-3); background: var(--bg-soft); border: 1px solid var(--border); padding: 0 8px; border-radius: 999px; }
.prose .archive-list, .archive-list { list-style: none; margin: 0; padding: 0; }
.prose .archive-list li { margin: 0; padding: 0; }
.prose .archive-list li::before { display: none; }
.archive-list a {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 14px 0; border-bottom: 1px dashed var(--border); text-decoration: none; color: var(--text);
}
.archive-list a:hover .archive-title { color: var(--accent-text); }
.archive-title { font-weight: 600; transition: color .15s; }
.archive-list time { flex-shrink: 0; color: var(--text-3); font-size: 14px; font-variant-numeric: tabular-nums; }
.tag-cloud { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0 0 48px; }
.prose .tag-cloud li { margin: 0; padding: 0; }
.prose .tag-cloud li::before { display: none; }
.prose .tag-cloud a { text-decoration: none; }

.about-intro { display: flex; gap: 24px; align-items: center; padding: 24px; margin-bottom: 40px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-soft); }
.about-intro .avatar { width: 96px; height: 96px; border-radius: 50%; flex-shrink: 0; }
.prose .about-intro p { margin: 0; }
.prose .about-intro .avatar { margin: 0; border-radius: 50%; }
.prose .about-intro .social a { color: var(--text-3); text-decoration: none; }
.prose .about-intro .social a:hover { color: var(--text); }
.about-name { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.about-role { color: var(--text-2); font-size: 15px; margin: 2px 0 8px !important; }
.about-intro .social { margin-left: -8px; }
@media (max-width: 560px) { .about-intro { flex-direction: column; align-items: flex-start; } }

.prose .timeline { list-style: none; margin: 8px 0 32px; padding: 0 0 0 20px; border-left: 2px solid var(--border); }
.prose .timeline li { position: relative; margin: 0 0 24px; padding: 0; }
.prose .timeline li::before {
  content: ""; position: absolute; left: -27px; top: 7px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent);
}
.prose .timeline li:first-child::before { background: var(--accent); }
.timeline .when { font-size: 13px; font-weight: 600; color: var(--text-3); font-variant-numeric: tabular-nums; }
.prose .timeline .what { margin: 2px 0 0; font-weight: 700; font-size: 17px; }
.prose .timeline .where { margin: 0; color: var(--text-2); font-size: 15px; font-weight: 500; }
.prose .timeline .desc { margin: 2px 0 0; color: var(--text-3); font-size: 15px; line-height: 1.6; }

.not-found { text-align: center; padding: 64px 0; }
.not-found-code { font-size: 96px; font-weight: 900; letter-spacing: -0.05em; margin: 0; line-height: 1; }
.button { display: inline-flex; padding: 10px 18px; border-radius: 999px; background: var(--text); color: var(--bg) !important; font-weight: 600; text-decoration: none !important; }
.layout-page .page:has(.not-found) .page-header { display: none; }

/* ---------- Post ---------- */
.post-header { padding-top: 56px; padding-bottom: 36px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text-3); margin-bottom: 28px; transition: color .15s; }
.back-link:hover { color: var(--text); }
.post-header .tags { margin-bottom: 16px; }
.post-title { margin: 0; font-size: clamp(30px, 5.2vw, 46px); line-height: 1.25; letter-spacing: -0.04em; font-weight: 800; }
.post-subtitle { margin: 14px 0 0; font-size: clamp(17px, 2.2vw, 20px); color: var(--text-2); line-height: 1.6; font-weight: 500; }
.post-byline { display: flex; align-items: center; gap: 12px; margin-top: 28px; }
.post-byline .avatar { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border); }
.byline-name { font-weight: 600; font-size: 15px; line-height: 1.3; }
.post-byline .meta { display: flex; gap: 6px; color: var(--text-3); font-size: 14px; }

.post-cover { margin: 0 auto 56px; }
.post-cover img { width: 100%; border-radius: var(--radius); aspect-ratio: 16 / 9; object-fit: cover; border: 1px solid var(--border); }
.post-cover figcaption { text-align: center; color: var(--text-3); font-size: 14px; margin-top: 10px; }

.post-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 56px; max-width: calc(var(--narrow) + var(--gutter) * 2); }
.post-main { min-width: 0; }
.toc { display: none; }
@media (min-width: 1180px) {
  .post-layout, .post-header.container, .post-cover.container { max-width: calc(var(--narrow) + 240px + 56px + var(--gutter) * 2); }
  .post-layout { grid-template-columns: minmax(0, var(--narrow)) 240px; }
  .post-header > * { max-width: var(--narrow); }
  .toc { display: block; }
}
.toc-inner { position: sticky; top: calc(var(--header-h) + 32px); max-height: calc(100vh - var(--header-h) - 64px); overflow-y: auto; padding-left: 16px; border-left: 1px solid var(--border); }
.toc-title { margin: 0 0 12px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc ol ol { padding-left: 12px; }
.toc a { display: block; padding: 5px 0; font-size: 13.5px; line-height: 1.45; color: var(--text-3); transition: color .15s; }
.toc a:hover { color: var(--text); }
.toc a.is-active { color: var(--accent-text); font-weight: 600; }

/* ---------- Prose (article body) ---------- */
.prose { font-size: 18px; line-height: 1.8; color: var(--text); }
.prose > * + * { margin-top: 1.25em; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose pre, .prose table, .prose figure { margin: 0 0 1.4em; }
.prose h2, .prose h3, .prose h4 { position: relative; letter-spacing: -0.03em; line-height: 1.4; font-weight: 800; }
.prose h2 { font-size: 1.6em; margin: 2.4em 0 0.8em; padding-top: 0.2em; }
.prose h3 { font-size: 1.3em; margin: 2em 0 0.6em; font-weight: 700; }
.prose h4 { font-size: 1.1em; margin: 1.8em 0 0.5em; font-weight: 700; }
.prose > h2:first-child, .prose > h3:first-child { margin-top: 0; }
.prose .anchor { position: absolute; left: -1.1em; padding-right: 0.3em; color: var(--text-3); opacity: 0; text-decoration: none; font-weight: 400; transition: opacity .15s; }
.prose h2:hover .anchor, .prose h3:hover .anchor, .prose h4:hover .anchor, .prose .anchor:focus { opacity: 1; }
.prose a { color: var(--accent-text); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent); text-underline-offset: 3px; text-decoration-thickness: 1px; transition: text-decoration-color .15s; }
.prose a:hover { text-decoration-color: var(--accent); }
.prose strong { font-weight: 700; color: var(--text); }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin: 0.4em 0; padding-left: 0.2em; }
.prose li > p { margin: 0.4em 0; }
.prose ul > li::marker { color: var(--text-3); }
.prose ol > li::marker { color: var(--text-3); font-weight: 600; }
.prose li > ul, .prose li > ol { margin: 0.4em 0; }
.prose hr { border: 0; height: 1px; width: 64px; margin: 3.5em auto; background: var(--border-strong); }
.prose blockquote { padding: 4px 0 4px 20px; border-left: 3px solid var(--accent); color: var(--text-2); }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose img { border-radius: var(--radius-sm); margin: 0 auto; }
.prose figure.photo { margin: 2em 0; }
.prose figure.photo img { width: 100%; border: 1px solid var(--border); }
.prose figure.photo.portrait img { width: auto; max-height: 560px; }
.prose figure.photo .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.prose figure.photo figcaption { text-align: center; color: var(--text-3); font-size: 14px; line-height: 1.5; margin-top: 10px; }
@media (max-width: 560px) { .prose figure.photo .pair { grid-template-columns: 1fr; } }
.prose img.zoomable { cursor: zoom-in; }
.prose img.zoomable:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.lightbox { padding: 0; border: 0; background: transparent; max-width: 100vw; max-height: 100vh; max-height: 100dvh; width: 100vw; height: 100vh; height: 100dvh; cursor: zoom-out; }
.lightbox::backdrop { background: rgba(0, 0, 0, .88); }
.lightbox img { width: 100%; height: 100%; object-fit: contain; padding: 16px; box-sizing: border-box; }
html { scrollbar-gutter: stable; }
html.has-lightbox { overflow: hidden; }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.92em; display: block; overflow-x: auto; }
.prose th, .prose td { border-bottom: 1px solid var(--border); padding: 10px 12px; text-align: left; }
.prose th { font-weight: 700; border-bottom-color: var(--border-strong); }

.prose :not(pre) > code {
  font-family: var(--font-mono); font-size: 0.85em; padding: 0.15em 0.4em; border-radius: 6px;
  background: var(--inline-code-bg); color: var(--inline-code-text); word-break: break-word;
}

/* Code blocks */
.prose div.highlighter-rouge, .prose figure.highlight { position: relative; margin: 1.6em 0 2em; }
.code-block { position: relative; border: 1px solid var(--code-border); border-radius: 12px; background: var(--code-bg); overflow: hidden; }
.code-header {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px 8px 16px; border-bottom: 1px solid var(--code-border);
  font-family: var(--font-mono); font-size: 12px; color: var(--text-3); text-transform: lowercase;
}
.code-copy {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 6px; border: 1px solid transparent;
  background: transparent; color: var(--text-3); font-family: var(--font-sans); font-size: 12px; cursor: pointer; transition: all .15s;
}
.code-copy:hover { color: var(--text); background: var(--bg); border-color: var(--code-border); }
.code-copy.is-copied { color: #16a34a; }
.prose pre {
  margin: 0; padding: 18px 20px; overflow-x: auto; background: transparent;
  font-family: var(--font-mono); font-size: 13.5px; line-height: 1.7; tab-size: 4;
}
.prose pre code { font-family: inherit; background: none; padding: 0; color: var(--text); font-size: inherit; }
.prose .highlight { background: transparent; }

/* Syntax (Rouge) — light */
.highlight .c, .highlight .c1, .highlight .cm, .highlight .cs, .highlight .cp, .highlight .ch, .highlight .cd { color: #8a8fa3; font-style: italic; }
.highlight .k, .highlight .kd, .highlight .kn, .highlight .kp, .highlight .kr, .highlight .kt, .highlight .kc, .highlight .ow { color: #8b2fc9; }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sb, .highlight .sc, .highlight .sd, .highlight .se, .highlight .sh, .highlight .si, .highlight .sx, .highlight .sr, .highlight .ss, .highlight .sa, .highlight .dl { color: #0f7b4a; }
.highlight .m, .highlight .mi, .highlight .mf, .highlight .mh, .highlight .mo, .highlight .il { color: #c2410c; }
.highlight .nf, .highlight .fm { color: #2563eb; }
.highlight .nc, .highlight .nn { color: #b45309; }
.highlight .nb, .highlight .bp { color: #0e7490; }
.highlight .nd { color: #be185d; }
.highlight .o { color: #52525b; }
.highlight .p { color: #52525b; }
.highlight .err { color: inherit; background: none; }

/* Syntax (Rouge) — dark */
:root[data-theme="dark"] .highlight .c, :root[data-theme="dark"] .highlight .c1, :root[data-theme="dark"] .highlight .cm, :root[data-theme="dark"] .highlight .sd { color: #6b7089; }
:root[data-theme="dark"] .highlight .k, :root[data-theme="dark"] .highlight .kd, :root[data-theme="dark"] .highlight .kn, :root[data-theme="dark"] .highlight .kc, :root[data-theme="dark"] .highlight .ow { color: #c792ea; }
:root[data-theme="dark"] .highlight .s, :root[data-theme="dark"] .highlight .s1, :root[data-theme="dark"] .highlight .s2, :root[data-theme="dark"] .highlight .si, :root[data-theme="dark"] .highlight .sa, :root[data-theme="dark"] .highlight .dl { color: #a5e075; }
:root[data-theme="dark"] .highlight .m, :root[data-theme="dark"] .highlight .mi, :root[data-theme="dark"] .highlight .mf { color: #f78c6c; }
:root[data-theme="dark"] .highlight .nf, :root[data-theme="dark"] .highlight .fm { color: #82aaff; }
:root[data-theme="dark"] .highlight .nc, :root[data-theme="dark"] .highlight .nn { color: #ffcb6b; }
:root[data-theme="dark"] .highlight .nb, :root[data-theme="dark"] .highlight .bp { color: #89ddff; }
:root[data-theme="dark"] .highlight .nd { color: #f07178; }
:root[data-theme="dark"] .highlight .o, :root[data-theme="dark"] .highlight .p { color: #a6accd; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .highlight .c, :root:not([data-theme="light"]) .highlight .c1, :root:not([data-theme="light"]) .highlight .cm, :root:not([data-theme="light"]) .highlight .sd { color: #6b7089; }
  :root:not([data-theme="light"]) .highlight .k, :root:not([data-theme="light"]) .highlight .kd, :root:not([data-theme="light"]) .highlight .kn, :root:not([data-theme="light"]) .highlight .kc, :root:not([data-theme="light"]) .highlight .ow { color: #c792ea; }
  :root:not([data-theme="light"]) .highlight .s, :root:not([data-theme="light"]) .highlight .s1, :root:not([data-theme="light"]) .highlight .s2, :root:not([data-theme="light"]) .highlight .si, :root:not([data-theme="light"]) .highlight .sa, :root:not([data-theme="light"]) .highlight .dl { color: #a5e075; }
  :root:not([data-theme="light"]) .highlight .m, :root:not([data-theme="light"]) .highlight .mi, :root:not([data-theme="light"]) .highlight .mf { color: #f78c6c; }
  :root:not([data-theme="light"]) .highlight .nf, :root:not([data-theme="light"]) .highlight .fm { color: #82aaff; }
  :root:not([data-theme="light"]) .highlight .nc, :root:not([data-theme="light"]) .highlight .nn { color: #ffcb6b; }
  :root:not([data-theme="light"]) .highlight .nb, :root:not([data-theme="light"]) .highlight .bp { color: #89ddff; }
  :root:not([data-theme="light"]) .highlight .nd { color: #f07178; }
  :root:not([data-theme="light"]) .highlight .o, :root:not([data-theme="light"]) .highlight .p { color: #a6accd; }
}

/* ---------- Post footer ---------- */
.post-footer { margin-top: 64px; display: grid; gap: 32px; }
.share { display: flex; align-items: center; gap: 4px; padding-bottom: 32px; border-bottom: 1px solid var(--border); }
.share-label { font-size: 14px; color: var(--text-3); margin-right: 8px; }
.author-card { display: flex; gap: 20px; padding: 24px; border-radius: var(--radius); background: var(--bg-soft); border: 1px solid var(--border); }
.author-card .avatar { width: 64px; height: 64px; border-radius: 50%; flex-shrink: 0; }
.author-card p { margin: 0; }
.author-card .social a { width: 32px; height: 32px; }
.author-name { font-weight: 700; font-size: 17px; }
.author-bio { color: var(--text-2); font-size: 15px; line-height: 1.7; margin: 6px 0 8px !important; }
.author-card .social { margin-left: -8px; }
@media (max-width: 560px) { .author-card { flex-direction: column; } }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.post-nav-item { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; border: 1px solid var(--border); border-radius: var(--radius); transition: border-color .15s, background .15s; }
.post-nav-item:hover { border-color: var(--accent); background: var(--accent-soft); }
.post-nav-item .label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-3); }
.post-nav-item .title { font-weight: 600; line-height: 1.45; }
.post-nav-item.next { text-align: right; align-items: flex-end; grid-column: 2; }
@media (max-width: 560px) { .post-nav { grid-template-columns: 1fr; } .post-nav-item.next { grid-column: auto; } }
.comments { margin-top: 16px; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 12px); z-index: 60;
  padding: 10px 16px; border-radius: 999px; background: var(--text); color: var(--bg); font-size: 14px; font-weight: 500;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* Components placed inside .prose keep their own spacing */
.prose ul.social { padding: 0; margin: 0 0 0 -8px; }
.prose ul.social li { margin: 0; padding: 0; }

/* ---------- Talks ---------- */
.talk-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.talk {
  position: relative; padding: 20px 22px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); transition: border-color .2s, box-shadow .2s, transform .2s;
}
.talk:hover { border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-1px); }
.talk-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-right: 84px; font-size: 13.5px; color: var(--text-3); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; color: var(--accent-text); background: var(--accent-soft); }
.badge-alt { color: #0e7490; background: rgba(14, 165, 233, 0.1); }
:root[data-theme="dark"] .badge-alt { color: #7dd3fc; background: rgba(56, 189, 248, 0.14); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge-alt { color: #7dd3fc; background: rgba(56, 189, 248, 0.14); } }
.talk-title { margin: 8px 0 4px; font-size: 18px; line-height: 1.45; letter-spacing: -0.02em; font-weight: 700; }
.talk-title a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.talk-summary { margin: 0; color: var(--text-2); font-size: 15px; line-height: 1.65; }
.talk-link { position: absolute; top: 20px; right: 22px; display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--text-3); transition: color .15s; }
.talk:hover .talk-link { color: var(--accent-text); }

/* ---------- Projects ---------- */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.project-card {
  position: relative; display: flex; flex-direction: column; padding: 22px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface); transition: border-color .2s, box-shadow .2s, transform .2s;
}
.project-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-1px); }
.project-role { margin: 0; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); }
.project-name { margin: 6px 0 8px; font-size: 19px; letter-spacing: -0.02em; font-weight: 800; }
.project-name a { display: inline-flex; align-items: center; gap: 4px; }
.project-name a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.project-name .icon { width: 0.9em; height: 0.9em; color: var(--text-3); transition: color .15s, transform .15s; }
.project-card:hover .project-name .icon { color: var(--accent-text); transform: translate(2px, -2px); }
.project-summary { margin: 0 0 14px; color: var(--text-2); font-size: 15px; line-height: 1.65; flex: 1; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.chips li { font-size: 12.5px; color: var(--text-2); padding: 2px 8px; border-radius: 6px; background: var(--bg-soft); border: 1px solid var(--border); }

.section-block { margin-top: 56px; }
.block-title { margin: 0 0 12px; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.contrib-list { list-style: none; margin: 0; padding: 0; }
.contrib-list li { padding: 16px 0; border-bottom: 1px dashed var(--border); }
.contrib-list a { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; }
.contrib-list a:hover { color: var(--accent-text); }
.contrib-list a .icon { width: 0.9em; height: 0.9em; color: var(--text-3); }
.contrib-list p { margin: 4px 0 0; color: var(--text-2); font-size: 15px; line-height: 1.65; }

/* ---------- Contact CTA ---------- */
.cta {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  margin: 48px 0; padding: 24px 28px; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent-soft), rgba(14, 165, 233, 0.08)); border: 1px solid var(--border);
}
.prose .cta { margin: 40px 0; }
.cta-title { margin: 0 0 4px !important; font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }
.cta-text { margin: 0 !important; color: var(--text-2); font-size: 15px; line-height: 1.65; max-width: 520px; }
.cta .button { gap: 8px; align-items: center; flex-shrink: 0; }
