:root {
  --bg: #0a0a0f;
  --bg-card: #111118;
  --bg-hover: #1a1a24;
  --bg-code: #0d0d14;
  --border: #1e1e2a;
  --accent: #00ff9d;
  --accent-dim: rgba(0, 255, 157, 0.15);
  --text: #e2e8f0;
  --text-soft: #8892a4;
  --text-muted: #5a6478;
  --radius: 6px;
}

[data-theme="light"] {
  --bg: #f5f5f7;
  --bg-card: #ffffff;
  --bg-hover: #f0f0f2;
  --bg-code: #f0f0f2;
  --border: #d4d4d8;
  --accent: #059669;
  --accent-dim: rgba(5, 150, 105, 0.1);
  --text: #18181b;
  --text-soft: #52525b;
  --text-muted: #a1a1aa;
}

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

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

body {
  font-family: "SF Mono", "Fira Code", "Cascadia Code", "JetBrains Mono", ui-monospace, monospace;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; transition: opacity .15s; }
a:hover { opacity: .7; }
img { max-width: 100%; height: auto; }
::selection { background: var(--accent-dim); }

/* HEADER */
.header {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 860px; margin: 0 auto;
  padding: 0 24px; height: 56px;
  display: flex; align-items: center; gap: 24px;
  position: relative;
}

.logo {
  font-size: .9rem; font-weight: 600;
  color: var(--accent); text-transform: uppercase;
  letter-spacing: 1px;
}

.nav { display: none; gap: 2px; margin-left: auto; }

.nav a {
  padding: 6px 12px; border-radius: 4px;
  font-size: .78rem; font-weight: 500;
  color: var(--text-soft);
  transition: background .15s, color .15s;
}

.nav a:hover { background: var(--accent-dim); color: var(--accent); }

.theme-toggle {
  background: none; border: 1px solid var(--border);
  border-radius: 4px; width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-soft);
  transition: background .15s, color .15s;
}

.theme-toggle:hover { background: var(--accent-dim); color: var(--accent); }

/* MOBILE MENU TOGGLE */
.menu-toggle {
  display: flex; background: none; border: none;
  width: 30px; height: 30px; cursor: pointer;
  flex-direction: column; align-items: center;
  justify-content: center; gap: 4px;
  padding: 0; position: relative;
}

.menu-toggle span {
  display: block; width: 18px; height: 2px;
  background: var(--text-soft); border-radius: 1px;
  transition: transform .2s, opacity .2s;
}

.menu-toggle.menu-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle.menu-open span:nth-child(2) { opacity: 0; }
.menu-toggle.menu-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.nav.nav-open {
  display: flex; flex-direction: column;
  position: absolute; top: 100%; right: 0;
  background: var(--bg); border: 1px solid var(--border);
  border-top: none; border-radius: 0 0 var(--radius) var(--radius);
  padding: 4px 0; gap: 0;
  z-index: 99; box-shadow: 0 8px 24px rgba(0,0,0,.3);
  animation: slideDown .2s ease;
  min-width: 160px;
}

.nav.nav-open a {
  padding: 10px 20px; font-size: .85rem;
  white-space: nowrap;
  border-radius: 0;
}

.nav.nav-open a:hover { background: var(--accent-dim); color: var(--accent); }

/* MAIN */
.main { flex: 1; padding-top: 0; }

.container {
  max-width: 860px; margin: 0 auto;
  padding: 24px 24px 40px;
}

.container-narrow {
  max-width: 660px;
}

/* POST PAGE LAYOUT */
.post-wrap {
  display: flex; gap: 24px;
  max-width: 860px; margin: 0 auto;
  padding: 24px 24px 40px;
}

.post-main { flex: 1; min-width: 0; }

.post-sidebar { width: 200px; flex-shrink: 0; }

.post-sidebar .sidebar-sticky {
  position: fixed;
  top: 80px;
  right: max(24px, calc((100vw - 860px) / 2 + 24px));
  width: 200px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

/* READING PROGRESS BAR */
.progress-bar {
  position: fixed; top: 0; left: 0; z-index: 101;
  width: 0; height: 2px;
  background: var(--accent);
  transition: width .1s linear;
}

/* POST CARDS */
.posts { max-width: 600px; }

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 12px;
  transition: border-color .2s, background .2s;
}

.post-card:hover { border-color: var(--accent); background: var(--bg-hover); }

.post-meta {
  font-size: .72rem; color: var(--text-muted);
  margin-bottom: 6px;
  display: flex; align-items: center; gap: 10px;
}

.post-meta .post-category {
  display: inline-block;
  padding: 1px 8px; border-radius: 3px;
  font-size: .65rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .5px;
  background: var(--accent-dim); color: var(--accent);
}

.post-title {
  font-size: 1.05rem; font-weight: 600;
  line-height: 1.35; margin-bottom: 8px;
}

.post-title a { color: var(--text); }
.post-title a:hover { color: var(--accent); }

.post-excerpt {
  font-size: .82rem; color: var(--text-soft);
  line-height: 1.6;
}

.post-footer-meta {
  display: flex; align-items: center;
  justify-content: space-between; gap: 8px;
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--border);
}

.read-more {
  font-size: .78rem; font-weight: 500;
  color: var(--accent);
}

.post-tags { display: flex; gap: 4px; flex-wrap: wrap; }

.tag {
  display: inline-block; padding: 1px 7px;
  border-radius: 3px; font-size: .68rem;
  background: var(--accent-dim); color: var(--accent);
}

/* PAGINATION */
.pagination {
  display: flex; justify-content: center; gap: 6px;
  margin-top: 28px;
}

.pagination .page-number,
.pagination .extend {
  padding: 6px 12px; border-radius: 4px;
  font-size: .78rem; font-weight: 500;
  color: var(--text-soft);
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: border-color .2s, color .2s;
}

.pagination .page-number.current {
  background: var(--accent-dim); border-color: var(--accent);
  color: var(--accent);
}

.pagination a:hover { border-color: var(--accent); color: var(--accent); }

/* HOMEPAGE LAYOUT */
.home-wrap {
  display: flex; gap: 24px;
  max-width: 860px; margin: 0 auto;
  padding: 24px 24px 40px;
  flex-direction: row-reverse;
}

.posts-section { flex: 1; min-width: 0; }

/* SIDEBAR / PROFILE */
.sidebar { width: 200px; flex-shrink: 0; }

.sidebar-sticky {
  position: fixed;
  top: 80px;
  right: max(24px, calc((100vw - 860px) / 2 + 24px));
  width: 200px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.sidebar-sticky::-webkit-scrollbar { width: 4px; }
.sidebar-sticky::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.sidebar-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}

.sidebar-card:last-child { margin-bottom: 0; }

.profile-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px;
}

.avatar {
  width: 36px; height: 36px;
  border-radius: 50%; object-fit: cover;
  border: 1px solid var(--border);
}

.profile-info { min-width: 0; }

.profile-name {
  font-size: .82rem; font-weight: 600;
  color: var(--text);
}

.profile-id {
  font-size: .68rem; color: var(--text-muted);
  font-family: "SF Mono", "Fira Code", monospace;
}

.profile-divider {
  border: none; border-top: 1px solid var(--border);
  margin: 10px 0;
}

.profile-subtitle {
  font-size: .75rem; color: var(--text-soft);
  line-height: 1.4; margin-bottom: 10px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.sidebar-social {
  display: flex; gap: 4px; flex-wrap: wrap;
}

.sidebar-social a {
  font-size: .68rem; padding: 2px 8px;
  border-radius: 3px;
  background: var(--accent-dim); color: var(--accent);
  transition: background .15s;
}

.sidebar-social a:hover { background: rgba(0, 255, 157, .25); }

/* SIDEBAR STATS */
.profile-stats {
  display: flex; gap: 2px; margin-bottom: 2px;
}

.stat {
  flex: 1; text-align: center;
  padding: 8px 4px;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.stat-label {
  display: block; font-size: .6rem;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: .3px; margin-bottom: 2px;
}

.stat-value {
  display: block; font-size: .85rem;
  font-weight: 700; color: var(--accent);
}

/* SIDEBAR LINKS */
.profile-section-title {
  font-size: .65rem; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: .5px; margin-bottom: 6px;
}

.profile-links {
  display: flex; gap: 4px; flex-wrap: wrap;
}

.profile-links a {
  font-size: .7rem; padding: 2px 8px;
  border-radius: 3px;
  border: 1px solid var(--border);
  color: var(--text-soft);
  transition: border-color .15s, color .15s;
}

.profile-links a:hover { border-color: var(--accent); color: var(--accent); }

/* PAGE HEADING */
.page-heading {
  font-size: 1.1rem; font-weight: 700;
  color: var(--accent); margin-bottom: 24px;
  font-family: "SF Mono", "Fira Code", monospace;
}

/* ARCHIVE LIST */
.archive-list { max-width: 600px; }

.archive-year {
  font-size: .9rem; font-weight: 700;
  color: var(--text); margin: 20px 0 10px;
  font-family: "SF Mono", "Fira Code", monospace;
  letter-spacing: -.5px;
}

.archive-item {
  display: flex; align-items: baseline; gap: 10px;
  padding: 6px 10px; border-radius: 4px;
  transition: background .15s;
}

.archive-item:hover { background: var(--bg-hover); }

.archive-date {
  font-size: .72rem; color: var(--text-muted);
  flex-shrink: 0; width: 44px;
  font-family: "SF Mono", "Fira Code", monospace;
}

.archive-link {
  font-size: .85rem; font-weight: 500;
  color: var(--text); flex: 1;
}

.archive-link:hover { color: var(--accent); }

.archive-item .post-category {
  font-size: .62rem; padding: 1px 6px;
  border-radius: 3px; text-transform: uppercase;
  letter-spacing: .3px;
  background: var(--accent-dim); color: var(--accent);
  flex-shrink: 0;
}

/* SIDEBAR LIST CARDS */
.sidebar-card-list { margin-top: 12px; }

.sidebar-list-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 0; border-bottom: 1px solid var(--border);
  font-size: .8rem; color: var(--text-soft);
  transition: color .15s;
}

.sidebar-list-item:last-child { border-bottom: none; }
.sidebar-list-item:hover { color: var(--accent); }

.sidebar-count {
  font-size: .68rem; color: var(--text-muted);
  background: var(--accent-dim); padding: 0 6px;
  border-radius: 3px; line-height: 1.5;
}

.sidebar-tags {
  display: flex; gap: 4px; flex-wrap: wrap;
}

.sidebar-tags .tag {
  font-size: .7rem; padding: 2px 8px;
  border-radius: 3px; background: var(--accent-dim);
  color: var(--accent);
}

.sidebar-tags .tag:hover { opacity: .7; }

/* TABLE OF CONTENTS */
.toc { list-style: none; padding: 0; margin: 0; font-size: .78rem; }
.toc .toc-item { padding: 3px 0; }
.toc .toc-link { color: var(--text-soft); transition: color .15s; display: block; }
.toc .toc-link:hover { color: var(--accent); }
.toc .toc-link.active { color: var(--accent); font-weight: 600; }
.toc .toc-child { list-style: none; padding-left: 12px; margin: 0; }
.toc .toc-level-3 { font-size: .72rem; }
.toc .toc-level-4 { font-size: .68rem; }

/* POST UPDATED */
.post-updated {
  font-size: .68rem; color: var(--text-muted);
  padding: 1px 6px; border-radius: 3px;
  background: var(--accent-dim);
}

/* RELATED POSTS */
.related-posts {
  margin-top: 32px; padding: 20px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.related-title {
  font-size: .78rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .5px;
  color: var(--text-muted); margin-bottom: 12px;
}

.related-list { display: flex; flex-direction: column; gap: 8px; }

.related-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px; border-radius: 4px;
  border: 1px solid var(--border);
  transition: border-color .2s, background .2s;
}

.related-item:hover {
  border-color: var(--accent); background: var(--bg-hover);
}

.related-item-title {
  font-size: .82rem; font-weight: 500; color: var(--text);
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.related-item-date {
  font-size: .68rem; color: var(--text-muted); flex-shrink: 0; margin-left: 12px;
}

/* BACK TO TOP */
.back-top {
  position: fixed; bottom: 32px; right: 24px; z-index: 99;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-soft); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  transition: opacity .25s, visibility .25s, border-color .2s;
}

.back-top.visible { opacity: 1; visibility: visible; }
.back-top:hover { border-color: var(--accent); color: var(--accent); }

/* CODE COPY BUTTON */
.highlight { position: relative; }

.copy-btn {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  width: 28px; height: 28px; border-radius: 4px;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .2s, border-color .2s, color .2s;
  font-size: .72rem; padding: 0;
}

.highlight:hover .copy-btn { opacity: 1; }
.copy-btn:hover { border-color: var(--accent); color: var(--accent); }
.copy-btn.copied { border-color: var(--accent); color: var(--accent); }

/* LIGHTBOX */
.lightbox {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.85);
  align-items: center; justify-content: center;
  cursor: zoom-out;
}

.lightbox.open { display: flex; }

.lightbox-img {
  max-width: 90vw; max-height: 90vh;
  border-radius: var(--radius); object-fit: contain;
}

.lightbox-close {
  position: absolute; top: 16px; right: 24px;
  font-size: 2rem; color: var(--text); cursor: pointer;
  line-height: 1; opacity: .7; transition: opacity .15s;
}

.lightbox-close:hover { opacity: 1; }

/* SEARCH */
.search-btn {
  background: none; border: 1px solid var(--border);
  border-radius: 4px; width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-soft);
  transition: background .15s, color .15s;
  margin-left: auto;
}

.search-btn:hover { background: var(--accent-dim); color: var(--accent); }

.search-overlay {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.6);
  align-items: flex-start; justify-content: center;
  padding-top: 80px;
}

.search-overlay.open { display: flex; }

.search-modal {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); width: 90%; max-width: 520px;
  max-height: 70vh; overflow-y: auto;
  animation: slideDown .2s ease;
}

.search-input {
  width: 100%; padding: 14px 16px;
  background: transparent; border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text); font-size: .9rem;
  font-family: inherit; outline: none;
}

.search-input::placeholder { color: var(--text-muted); }

.search-results { padding: 8px 0; }

.search-result-item {
  display: block; padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}

.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--bg-hover); }

.search-result-title {
  font-size: .85rem; font-weight: 500; color: var(--text);
  margin-bottom: 2px;
}

.search-result-meta {
  font-size: .68rem; color: var(--text-muted);
}

.search-empty {
  padding: 32px 16px; text-align: center;
  font-size: .82rem; color: var(--text-muted);
}

/* POST COVER IMAGES */
.post-cover {
  margin: -20px -24px 16px;
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
  max-height: 200px;
}

.post-cover img {
  width: 100%; height: auto;
  display: block;
  object-fit: cover;
}

.post-cover-full {
  margin: 0 0 20px;
  border-radius: var(--radius);
  overflow: hidden;
}

.post-cover-full img {
  width: 100%; height: auto;
  display: block;
  object-fit: cover;
  border-radius: var(--radius);
}

/* TAGS CLOUD PAGE */
.tags-cloud {
  display: flex; gap: 8px; flex-wrap: wrap;
  max-width: 600px;
}

.tag-lg {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 4px;
  font-size: .82rem; font-weight: 600;
  background: var(--accent-dim); color: var(--accent);
  border: 1px solid var(--border);
  transition: border-color .15s;
}

.tag-lg:hover { border-color: var(--accent); opacity: .8; }

.tag-count {
  font-size: .68rem; font-weight: 400;
  color: var(--text-muted);
}

/* CARD OVERFLOW FIX */
.post-card { overflow: hidden; }
.post-excerpt {
  word-wrap: break-word; overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}
.post-excerpt img { max-width: 100%; height: auto; }
.post-excerpt pre, .post-excerpt code { white-space: pre-wrap; word-break: break-all; }
.post-excerpt a { word-break: break-all; }

/* POST CONTENT OVERFLOW FIX */
.post-content { overflow-wrap: break-word; word-break: break-word; }
.post-content code { word-break: break-all; white-space: pre-wrap; }
.post-content pre { max-width: 100%; white-space: pre-wrap; }
.post-content pre code { white-space: pre-wrap; word-break: break-all; }
.post-content img { max-width: 100%; height: auto; }
.post-content table { display: block; max-width: 100%; }
.post-content a { word-break: break-all; }

/* FULL POST */
.post-full { margin: 0 auto; }

.post-full-header { margin-bottom: 28px; }

.post-full-title {
  font-size: 1.5rem; font-weight: 700;
  line-height: 1.25; margin-bottom: 10px;
}

.post-full-meta {
  display: flex; gap: 10px;
  font-size: .78rem; color: var(--text-muted);
  flex-wrap: wrap;
}

.post-full-meta .post-category {
  padding: 1px 8px; border-radius: 3px;
  font-size: .68rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .5px;
  background: var(--accent-dim); color: var(--accent);
}

.post-full-tags {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin-top: 8px;
}

.post-full-tags .tag { font-size: .72rem; }

/* POST CONTENT */
.post-content {
  font-size: .88rem; line-height: 1.8;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.post-content h2 {
  font-size: 1.2rem; font-weight: 700;
  margin: 1.8rem 0 .6rem;
  color: var(--accent);
  font-family: "SF Mono", "Fira Code", monospace;
}

.post-content h3 {
  font-size: 1.05rem; font-weight: 600;
  margin: 1.5rem 0 .5rem;
}

.post-content h4 {
  font-size: .95rem; font-weight: 600;
  margin: 1.2rem 0 .4rem;
}

.post-content p { margin: .7rem 0; }
.post-content a { color: var(--accent); }
.post-content a:hover { opacity: .7; text-decoration: underline; }

.post-content blockquote {
  margin: 1rem 0; padding: .5rem 1rem;
  border-left: 2px solid var(--accent);
  background: var(--accent-dim);
  border-radius: 0 4px 4px 0;
  color: var(--text-soft);
}

.post-content code {
  font-family: "SF Mono", "Fira Code", "JetBrains Mono", monospace;
  font-size: .82em;
  padding: 2px 6px; border-radius: 3px;
  background: var(--accent-dim);
  color: var(--accent);
}

.post-content pre {
  border-radius: var(--radius);
  background: var(--bg-code);
  border: 1px solid var(--border);
  padding: 1rem;
  margin: 1rem 0;
}

.post-content pre code {
  background: none !important; color: inherit; padding: 0;
}

.post-content img { border-radius: var(--radius); margin: 1rem auto; }

.post-content table {
  width: 100%; border-collapse: collapse;
  margin: 1rem 0; font-size: .82rem;
}

.post-content th, .post-content td {
  padding: 8px 12px;
  border: 1px solid var(--border);
  text-align: left;
}

.post-content th { background: var(--accent-dim); font-weight: 600; color: var(--accent); }
.post-content ul, .post-content ol { padding-left: 1.5rem; margin: .6rem 0; }
.post-content li { margin: .3rem 0; }
.post-content hr { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }

/* POST NAV */
.post-nav {
  display: flex; justify-content: space-between; gap: 16px;
  margin-top: 36px; padding-top: 20px;
  border-top: 1px solid var(--border);
}

.post-nav a { flex: 1; max-width: 50%; }

.post-nav .nav-label {
  font-size: .72rem; color: var(--text-muted);
  display: block; margin-bottom: 3px;
  font-family: "SF Mono", "Fira Code", monospace;
}

.post-nav .nav-title {
  font-size: .82rem; font-weight: 600; color: var(--text);
}

.post-nav a:hover .nav-title { color: var(--accent); }
.post-nav .next { text-align: right; }

/* FOOTER */
.footer {
  border-top: 1px solid var(--border);
  padding: 20px 0; margin-top: auto;
}

.footer-inner {
  max-width: 860px; margin: 0 auto;
  padding: 0 24px; text-align: center;
  font-size: .72rem; color: var(--text-muted);
}

.footer-inner span { color: var(--accent); }

/* RESPONSIVE */
@media (max-width: 768px) {
  .home-wrap { flex-direction: column; padding: 24px 16px; gap: 20px; }
  .posts-section { max-width: 100%; }
  .sidebar { width: 100%; }
  .sidebar-sticky {
    position: static;
    width: auto;
    max-height: none; overflow-y: visible;
  }
  .sidebar-card { margin-bottom: 8px; }
  .profile-stats { gap: 4px; }
  .stat { padding: 6px 4px; }
  .post-sidebar .sidebar-sticky {
    position: static; width: auto;
    max-height: none; overflow-y: visible;
  }
  .post-wrap { flex-direction: column; padding: 24px 16px; gap: 20px; }
  .post-main { max-width: 100%; }
  .post-sidebar { width: 100%; }
  .post-sidebar .sidebar-sticky {
    position: static; width: auto;
    max-height: none; overflow-y: visible;
  }
  .post-full-title { font-size: 1.2rem; }
  .post-card { padding: 16px; }
  .post-nav { flex-direction: column; }
  .post-nav a { max-width: 100%; }
  .post-nav .next { text-align: left; }
  .nav.nav-open { left: 0; border-radius: 0; border-left: none; border-right: none; }
  .nav.nav-open a { padding: 10px 12px; font-size: .85rem; }
  .body-nav-open { overflow: hidden; }
  .header-inner { padding: 0 16px; }
  .container { padding: 24px 16px; }
  .back-top { right: 16px; bottom: 20px; width: 36px; height: 36px; }
  .search-overlay { padding-top: 60px; }
  .highlight .copy-btn { opacity: 1; }
  .related-posts { padding: 16px; }
  .related-item { flex-direction: column; align-items: flex-start; gap: 4px; }
  .related-item-date { margin-left: 0; }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 480px) {
  html { font-size: 14px; }
  .home-wrap { padding: 16px 12px 32px; gap: 16px; }
  .post-wrap { padding: 16px 12px 32px; gap: 16px; }
  .post-card { padding: 12px; }
  .post-title { font-size: .95rem; }
  .post-excerpt { font-size: .78rem; }
  .post-meta { font-size: .68rem; }
  .stat { padding: 6px 2px; }
  .stat-value { font-size: .78rem; }
  .stat-label { font-size: .55rem; }
  .sidebar-card { padding: 12px; }
  .profile-subtitle { font-size: .7rem; }
  .sidebar-social a { font-size: .62rem; padding: 2px 6px; }
  .profile-links a { font-size: .65rem; padding: 2px 6px; }
  .container { padding: 16px 12px; }
  .post-full-title { font-size: 1.05rem; }
  .post-content { font-size: .82rem; }
  .related-posts { padding: 12px; }
  .related-item { padding: 8px 10px; }
  .related-item-title { font-size: .78rem; }
  .search-modal { width: 95%; }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .sidebar { width: 180px; }
  .home-wrap { padding: 24px 20px 32px; gap: 20px; }
  .stat { padding: 6px 3px; }
  .post-wrap { padding: 24px 20px 32px; gap: 20px; }
  .post-sidebar { width: 180px; }
  .post-sidebar .sidebar-sticky { width: 180px; }
}

/* SYNTAX HIGHLIGHTING */
.hljs { display: block; overflow-x: auto; padding: 0; }
.hljs-keyword,.hljs-selector-tag,.hljs-literal,.hljs-section,.hljs-link { color: #ff79c6; }
.hljs-string,.hljs-title,.hljs-name,.hljs-type,.hljs-attribute,.hljs-symbol,.hljs-bullet,.hljs-addition,.hljs-variable,.hljs-template-tag,.hljs-template-variable { color: #f1fa8c; }
.hljs-comment,.hljs-quote,.hljs-deletion,.hljs-meta { color: #6272a4; }
.hljs-number,.hljs-built_in,.hljs-builtin-name,.hljs-selector-class,.hljs-selector-attr,.hljs-selector-pseudo { color: #bd93f9; }
.hljs-regexp,.hljs-strong { color: #ff5555; }
.hljs-emphasis { font-style: italic; }
.hljs-attr { color: #50fa7b; }
.hljs-params { color: #ffb86c; }