/* ============================================
   joffeego.github.io — Editorial / Premium
   暖纸调 · 衬线标题 · 单一克制配色 · 无暗色模式
   ============================================ */

/* ---- Design Tokens ---- */
:root {
  /* Surfaces */
  --bg:          #FAF8F4;   /* warm paper */
  --bg-sunken:   #F2EFE8;
  --surface:     #FFFFFF;
  /* Ink */
  --ink:         #1C1A17;   /* near-black with warm undertone */
  --ink-soft:    #4A453D;
  --muted:       #7B756A;
  --faint:       #A8A096;
  --rule:        #E8E2D6;   /* hairline dividers */
  --rule-strong: #D8D1C2;
  /* Single restrained accent (walnut / sienna) */
  --accent:        #8B5A3C;
  --accent-hover:  #6F4630;
  --accent-soft:   #F0E6DC;
  --accent-tint:   rgba(139, 90, 60, 0.08);
  /* Code */
  --code-bg:   #F4F1EB;
  --code-ink:  #3B352D;
  /* Shadows (very subtle) */
  --shadow:    0 1px 2px rgba(28, 26, 23, 0.04);
  --shadow-lg: 0 12px 40px rgba(28, 26, 23, 0.08), 0 2px 6px rgba(28, 26, 23, 0.04);
  /* Radii */
  --r:    10px;
  --r-sm: 6px;
  /* Type */
  --font:      "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
               "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --font-serif:"Newsreader", "Source Serif Pro", "Noto Serif SC", Georgia, "Times New Roman", serif;
  --font-mono: "JetBrains Mono", "SF Mono", "Fira Code", Menlo, Consolas, monospace;
  --ease:      cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out:  cubic-bezier(0.22, 1, 0.36, 1);   /* expo-out — 入场动效 */
  --t:         0.28s var(--ease);
  --reading: 720px;
  --wide:    1080px;
}

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

html {
  font-size: 17px;
  scroll-behavior: smooth;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}

body {
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  background: var(--bg);
}
/* Ambient gaussian blobs — give the frosted glass something to blur */
body::before,
body::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: 0;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
}
body::before {
  width: 38vmax; height: 38vmax;
  top: -12vmax; right: -10vmax;
  background: radial-gradient(circle, rgba(139, 90, 60, 0.18), transparent 65%);
}
body::after {
  width: 34vmax; height: 34vmax;
  bottom: -14vmax; left: -8vmax;
  background: radial-gradient(circle, rgba(163, 122, 89, 0.14), transparent 65%);
}
.site-header, .site-footer, .page { position: relative; z-index: 1; }

::selection { background: var(--accent-soft); color: var(--ink); }

/* Scrollbar */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--rule-strong);
  border-radius: 100px;
  border: 4px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--faint); }

/* ---- Reading progress ---- */
#progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0;
  background: var(--accent);
  z-index: 9999;
  transition: width 0.1s linear;
}

/* ====================
   HEADER / TOP NAV
   ==================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 248, 244, 0.82);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--rule);
}
.nav-wrapper {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 clamp(1.1rem, 4vw, 2.5rem);
  height: 66px;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink);
  margin-right: auto;
}
.brand-mark {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.2rem;
  display: inline-flex; align-items: center; justify-content: center;
  line-height: 1;
  letter-spacing: 0;
}
.brand-name {
  font-family: var(--font-serif);
  font-size: 1.08rem;
  font-weight: 500;
  letter-spacing: -0.005em;
}

.site-nav,
.site-nav-right {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  height: 38px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  height: 100%;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.93rem;
  font-weight: 500;
  padding: 0 0.78rem;
  border-radius: 8px;
  position: relative;
  line-height: 1;
  transition: color var(--t);
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0.78rem;
  right: 0.78rem;
  bottom: 7px;
  height: 1.5px;
  background: var(--accent);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.32s var(--ease-out);
}
.nav-link:hover { color: var(--ink); }
.nav-link:hover::after { transform: scaleX(1); }
.nav-link[aria-current="page"] { color: var(--ink); }
.nav-link[aria-current="page"]::after { transform: scaleX(1); }

.nav-icon-link,
.nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border: none;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.98rem;
  transition: color var(--t), background var(--t);
}
.nav-icon-link:hover,
.nav-btn:hover {
  color: var(--ink);
  background: var(--bg-sunken);
}
.nav-btn svg { display: block; }

/* ====================
   SEARCH OVERLAY — single liquid-glass pill
   ==================== */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  flex-direction: column;
  align-items: center;
  padding: clamp(8vh, 16vh, 18vh) clamp(1.2rem, 4vw, 2rem) 2rem;
  /* 液态展开：从触发点圆形扩张 */
  clip-path: circle(0% at var(--ox, 50%) var(--oy, 50%));
  transition: clip-path 0.62s var(--ease-out);
}
.search-overlay.is-open {
  clip-path: circle(160% at var(--ox, 50%) var(--oy, 50%));
}
.search-overlay.is-closing {
  clip-path: circle(0% at var(--ox, 50%) var(--oy, 50%));
}

.search-overlay-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(250, 248, 244, 0.65);
  backdrop-filter: blur(30px) saturate(160%);
  -webkit-backdrop-filter: blur(30px) saturate(160%);
}

.search-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 640px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s var(--ease-out) 0.18s, transform 0.5s var(--ease-out) 0.18s;
}
.search-overlay.is-open .search-panel {
  opacity: 1;
  transform: translateY(0);
}

.search-close {
  position: absolute;
  top: clamp(1.4rem, 4vh, 2.2rem);
  right: clamp(1.2rem, 4vw, 2.2rem);
  z-index: 2;
  width: 38px; height: 38px;
  display: inline-flex;
  align-items: center; justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  background: none;
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  color: var(--ink-soft);
  cursor: pointer;
  font-family: inherit;
  font-size: 1.4rem;
  line-height: 1;
  transition: color var(--t), border-color var(--t), transform var(--t);
}
.search-close:hover {
  color: var(--ink);
  transform: rotate(90deg);
  border-color: var(--rule-strong);
}

.search-hint {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.82rem;
  color: var(--faint);
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.search-hint kbd {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  padding: 0.05em 0.42em;
  border: 1px solid var(--rule);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
}

/* 唯一的玻璃元素：搜索框 */
.search-panel .search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0 1.4rem;
  height: 64px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow:
    0 8px 32px rgba(28, 26, 23, 0.08),
    0 1px 0 rgba(255, 255, 255, 0.6) inset;
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  transition: border-color var(--t), box-shadow var(--t);
}
.search-panel .search-input-wrapper:focus-within {
  border-color: rgba(139, 90, 60, 0.4);
  box-shadow:
    0 0 0 4px var(--accent-tint),
    0 12px 36px rgba(28, 26, 23, 0.1),
    0 1px 0 rgba(255, 255, 255, 0.6) inset;
}
.search-panel .search-icon {
  position: static;
  flex: none;
  font-size: 1.25rem;
  color: var(--accent);
  opacity: 0.7;
  pointer-events: none;
  font-family: var(--font-serif);
}
.search-panel #search-input {
  flex: 1;
  width: 100%;
  min-width: 0;
  padding: 0;
  font-size: 1.25rem;
  font-family: var(--font-serif);
  font-weight: 500;
  background: transparent;
  border: none;
  outline: none;
  color: var(--ink);
  line-height: 1.4;
}
.search-panel #search-input::placeholder {
  color: var(--faint);
  font-style: italic;
  font-weight: 400;
}

/* 结果列表：朴素文本，仅分隔线 */
.search-panel #search-results {
  list-style: none;
  max-height: 56vh;
  overflow-y: auto;
  margin-top: 1.2rem;
  padding: 0 0.4rem;
}
.search-panel .search-result-item {
  padding: 0.85rem 0.6rem;
  border: none;
  background: none;
  box-shadow: none;
  border-bottom: 1px solid rgba(232, 226, 214, 0.5);
  transition: padding-left var(--t), color var(--t);
}
.search-panel .search-result-item:last-child { border-bottom: none; }
.search-panel .search-result-item:hover {
  padding-left: 1rem;
  background: none;
  border-color: var(--accent);
  box-shadow: none;
}
.search-panel .search-result-item a {
  font-family: var(--font-serif);
  font-size: 1.08rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
}
.search-panel .search-result-item a:hover { color: var(--accent); }
.search-panel .search-result-meta {
  font-size: 0.76rem; color: var(--faint); margin-top: 0.2rem;
}
.search-panel .search-result-excerpt {
  margin-top: 0.35rem; font-size: 0.9rem; color: var(--muted); line-height: 1.6;
}
.search-panel #no-results {
  text-align: center;
  padding: 2.5rem 0;
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--faint);
}

@media (max-width: 768px) {
  .search-panel .search-input-wrapper { height: 56px; padding: 0 1.1rem; }
  .search-panel #search-input { font-size: 1.05rem; }
  .search-overlay { padding-top: 8vh; }
  .search-close { top: 1.1rem; right: 1.1rem; width: 34px; height: 34px; }
}

/* ====================
   PAGE LAYOUT
   ==================== */
.page {
  flex: 1;
  padding: clamp(2.5rem, 6vw, 5rem) clamp(1.1rem, 4vw, 2.5rem) 4rem;
  animation: page-enter 0.7s var(--ease-out) both;
}
@keyframes page-enter {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page-inner {
  max-width: var(--reading);
  margin: 0 auto;
}

/* ---- Page header (used on inner pages) ---- */
.page-header {
  margin-bottom: 2.8rem;
  padding-bottom: 1.6rem;
  border-bottom: 1px solid var(--rule);
  animation: fade-up 0.7s var(--ease-out) both;
}
.page-eyebrow {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.7rem;
}
.page-heading {
  font-family: var(--font-serif);
  font-size: clamp(1.9rem, 4.5vw, 2.6rem);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.2;
  color: var(--ink);
}
.page-subtitle {
  font-size: 0.98rem;
  color: var(--muted);
  margin-top: 0.6rem;
}

/* ====================
   HOME — Hero
   ==================== */
.hero {
  text-align: center;
  padding: clamp(1.5rem, 4vw, 2.6rem) 0 2.4rem;
  margin-bottom: 2.6rem;
  border-bottom: 1px solid var(--rule);
}
.hero-eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.1rem;
  animation: fade-up 0.85s var(--ease-out) 0.05s both;
}
.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  font-weight: 500;
  line-height: 1.18;
  letter-spacing: -0.022em;
  color: var(--ink);
  margin-bottom: 0.9rem;
  animation: fade-up 0.85s var(--ease-out) 0.16s both;
}
.hero-title-name {
  font-style: italic;
  color: var(--accent);
  font-weight: 500;
}
.hero-subtitle {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-style: italic;
  color: var(--muted);
  max-width: 540px;
  margin: 0 auto;
  line-height: 1.7;
  animation: fade-up 0.85s var(--ease-out) 0.28s both;
}

/* ---- Home: post list (editorial) ---- */
.post-feed-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.4rem;
  animation: fade-up 0.7s var(--ease-out) 0.38s both;
}
.post-feed-heading {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}
.post-feed-count {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.92rem;
  color: var(--faint);
}

.post-list { list-style: none; }

.post-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 1.5rem;
  align-items: baseline;
  padding: 1.7rem 0;
  border-top: 1px solid var(--rule);
  transition: background var(--t);
}
.post-item:last-child { border-bottom: 1px solid var(--rule); }
.post-list:hover .post-item:not(:hover) { opacity: 0.5; transition: opacity var(--t); }

.post-item-date {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--faint);
  padding-top: 0.15rem;
}

.post-item-body { min-width: 0; }
.post-item-title {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.012em;
  color: var(--ink);
  text-decoration: none;
  transition: color var(--t);
}
.post-item-title:hover { color: var(--accent); }

.post-item-meta {
  margin-top: 0.5rem;
  font-size: 0.82rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.post-item-meta .meta-dot { color: var(--rule-strong); }

.post-item-excerpt {
  margin-top: 0.7rem;
  font-size: 0.96rem;
  color: var(--ink-soft);
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Category tag pill — refined */
.category-tag, .post-cat {
  display: inline-block;
  color: var(--accent);
  background: transparent;
  padding: 0.1em 0.55em;
  border: 1px solid var(--accent-soft);
  border-radius: 100px;
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: all var(--t);
}
.category-tag:hover, .post-cat:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.empty-state {
  text-align: center;
  padding: 5rem 0;
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--faint);
  font-size: 1.1rem;
}

/* ====================
   ARTICLE PAGE
   ==================== */
.post-article {
  animation: fade-up 0.7s var(--ease-out) both;
}

.post-header {
  margin-bottom: 2.6rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--rule);
}
.post-cats {
  display: flex; gap: 0.45rem; flex-wrap: wrap;
  margin-bottom: 1rem;
}
.post-cat { font-size: 0.76rem; }

.post-title {
  font-family: var(--font-serif);
  font-size: clamp(1.9rem, 5vw, 2.7rem);
  font-weight: 500;
  line-height: 1.18;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.post-meta {
  margin-top: 1.1rem;
  font-size: 0.86rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.post-meta .meta-dot { color: var(--rule-strong); }

/* Post content typography */
.post-content {
  font-size: 1.06rem;
  line-height: 1.85;
  color: var(--ink-soft);
  font-weight: 400;
}

.post-content h1, .post-content h2, .post-content h3,
.post-content h4, .post-content h5 {
  color: var(--ink);
  font-family: var(--font-serif);
  font-weight: 500;
  letter-spacing: -0.012em;
  line-height: 1.3;
}
.post-content h1 { font-size: 1.7rem; margin: 2.6rem 0 0.9rem; }
.post-content h2 {
  font-size: 1.42rem; margin: 2.4rem 0 0.7rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--rule);
}
.post-content h3 { font-size: 1.18rem; margin: 1.9rem 0 0.5rem; }
.post-content h2:first-child, .post-content h3:first-child { margin-top: 0; }

.post-content p { margin-bottom: 1.2rem; }

.post-content ul, .post-content ol {
  margin: 0.7rem 0 1.2rem;
  padding-left: 1.4rem;
}
.post-content li { margin-bottom: 0.45rem; }
.post-content li::marker { color: var(--accent); }

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

.post-content a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(139, 90, 60, 0.3);
  transition: color var(--t), border-color var(--t);
}
.post-content a:hover {
  color: var(--accent-hover);
  border-bottom-color: var(--accent-hover);
}

.post-content blockquote {
  margin: 1.8rem 0;
  padding: 0.5rem 1.4rem;
  border-left: 2px solid var(--accent);
  color: var(--ink-soft);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.08rem;
}
.post-content blockquote p { margin-bottom: 0.6rem; }
.post-content blockquote p:last-child { margin-bottom: 0; }

/* Inline code */
.post-content code {
  background: var(--code-bg);
  color: var(--code-ink);
  padding: 0.14em 0.42em;
  border-radius: 5px;
  font-size: 0.86em;
  font-family: var(--font-mono);
  border: 1px solid var(--rule);
}
.post-content pre code {
  background: none; border: none; padding: 0;
  font-size: inherit; color: inherit;
}

/* Code blocks */
.pre-wrapper, .code-block-wrapper {
  position: relative;
  margin: 1.6rem 0;
  border-radius: var(--r);
  overflow: hidden;
  border: 1px solid var(--rule);
  box-shadow: var(--shadow);
  background: var(--surface);
}
.code-block-wrapper:has(.code-lang) pre { padding-top: 2.3rem; }

.post-content pre {
  background: var(--surface);
  color: var(--code-ink);
  padding: 1.4rem 1.6rem;
  overflow-x: auto;
  font-size: 0.86rem;
  line-height: 1.65;
  margin: 0;
  font-family: var(--font-mono);
}

.code-lang {
  position: absolute;
  top: 0.65rem; left: 0.95rem;
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  font-family: var(--font-mono);
  font-weight: 500;
  pointer-events: none;
  z-index: 1;
}

.copy-btn {
  position: absolute;
  top: 0.5rem; right: 0.5rem;
  background: var(--bg-sunken);
  border: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.72rem;
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0;
  font-family: var(--font);
  transition: all var(--t);
}
.code-block-wrapper:hover .copy-btn,
.copy-btn:focus-visible { opacity: 1; }
.copy-btn:hover { color: var(--ink); border-color: var(--rule-strong); }
.copy-btn.copied {
  background: var(--accent); border-color: var(--accent); color: #fff; opacity: 1;
}

/* Tables */
.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.6rem 0;
  font-size: 0.94rem;
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--surface);
}
.post-content th, .post-content td {
  border: 1px solid var(--rule);
  border-collapse: collapse;
  padding: 0.6rem 0.95rem;
  text-align: left;
}
.post-content th {
  background: var(--accent-soft);
  font-weight: 600;
  color: var(--ink);
}
.post-content tr:nth-child(even) td { background: var(--bg-sunken); }

.post-content hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 2.8rem 0;
}
.post-content img {
  border-radius: var(--r);
  max-width: 100%;
  box-shadow: var(--shadow);
}
.post-content figure { margin: 1.8rem 0; }
.post-content figcaption {
  text-align: center;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.88rem;
  color: var(--faint);
  margin-top: 0.6rem;
}

/* Post nav */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
}
.post-nav-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1.1rem 1.4rem;
  border: 1px solid var(--rule);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--ink-soft);
  text-decoration: none;
  transition: all var(--t);
}
.post-nav-card.next { text-align: right; }
.post-nav-card:hover {
  border-color: var(--rule-strong);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.post-nav-label {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.post-nav-title {
  font-family: var(--font-serif);
  font-size: 1.02rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.4;
}
.post-nav-card:only-child { grid-column: span 2; }

/* ====================
   SEARCH PAGE
   ==================== */
.search-container { max-width: 640px; }

/* ====================
   LEGACY SEARCH PAGE (/search/) — shared result styling
   ==================== */
.search-input-wrapper {
  position: relative;
  margin-bottom: 2rem;
}
#search-input {
  width: 100%;
  padding: 1rem 1.2rem 1rem 2.9rem;
  font-size: 1rem;
  font-family: var(--font);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  color: var(--ink);
  outline: none;
  box-shadow: var(--shadow);
  transition: all var(--t);
}
#search-input::placeholder { color: var(--faint); }
#search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-tint), var(--shadow);
}
.search-icon {
  position: absolute;
  left: 1.1rem; top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 0.95rem;
  opacity: 0.6;
}
#search-results { list-style: none; display: flex; flex-direction: column; gap: 0.6rem; }
.search-result-item {
  padding: 1.1rem 1.4rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  transition: all var(--t);
}
.search-result-item:hover {
  border-color: var(--rule-strong);
  box-shadow: var(--shadow-lg);
}
.search-result-item a {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
}
.search-result-item a:hover { color: var(--accent); }
.search-result-meta {
  font-size: 0.78rem; color: var(--muted); margin-top: 0.35rem;
}
.search-result-excerpt {
  margin-top: 0.5rem; font-size: 0.92rem; color: var(--ink-soft);
}
#no-results {
  text-align: center; padding: 3rem 0;
  font-family: var(--font-serif); font-style: italic;
  color: var(--faint);
}

/* ====================
   CATEGORIES PAGE
   ==================== */
.categories-list {
  display: flex; flex-wrap: wrap; gap: 0.55rem;
  margin-bottom: 2.4rem;
  padding-bottom: 1.8rem;
  border-bottom: 1px solid var(--rule);
}
.categories-list .category-tag {
  font-size: 0.86rem; padding: 0.3em 0.95em; font-weight: 500;
}

.category-section {
  padding: 1.6rem 0;
  border-top: 1px solid var(--rule);
}
.category-section:first-of-type { border-top: none; }
.category-section h2 {
  font-family: var(--font-serif);
  font-size: 1.3rem; font-weight: 500;
  margin-bottom: 1rem;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.category-section h2 .count {
  font-style: italic; font-size: 0.9rem; color: var(--faint); margin-left: 0.4rem;
}
.category-section ul { list-style: none; }
.category-section li {
  padding: 0.55rem 0;
  font-size: 0.96rem;
  border-bottom: 1px dashed var(--rule);
  display: flex; align-items: baseline; gap: 0.8rem;
}
.category-section li:last-child { border-bottom: none; }
.category-section li a {
  color: var(--ink); text-decoration: none;
  flex: 1;
  transition: color var(--t);
}
.category-section li a:hover { color: var(--accent); }
.category-section li time {
  font-family: var(--font-serif); font-style: italic;
  font-size: 0.82rem; color: var(--faint);
  white-space: nowrap;
}

/* ====================
   ABOUT PAGE
   ==================== */
.page-content {
  animation: fade-up 0.7s var(--ease-out) both;
}
.page-content h1 {
  font-family: var(--font-serif);
  font-size: 1.7rem; font-weight: 500;
  margin: 0 0 1.4rem;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.page-content h2 {
  font-family: var(--font-serif);
  font-size: 1.2rem; font-weight: 500;
  margin: 2.2rem 0 0.6rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--rule);
}
.page-content p {
  margin-bottom: 1.1rem; line-height: 1.85; color: var(--ink-soft);
}
.page-content ul {
  margin: 0.6rem 0 1.1rem; padding-left: 1.3rem;
}
.page-content li { margin-bottom: 0.35rem; color: var(--ink-soft); }
.page-content a {
  color: var(--accent); text-decoration: none;
  border-bottom: 1px solid rgba(139, 90, 60, 0.3);
  transition: color var(--t), border-color var(--t);
}
.page-content a:hover { color: var(--accent-hover); border-bottom-color: var(--accent-hover); }
.page-content strong { font-weight: 600; color: var(--ink); }
.page-content blockquote {
  border-left: 2px solid var(--accent);
  margin: 1.6rem 0;
  padding: 0.4rem 1.3rem;
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--muted);
  font-size: 1.06rem;
}
.page-content hr {
  border: none; border-top: 1px solid var(--rule); margin: 2.4rem 0;
}

/* ====================
   FOOTER
   ==================== */
.site-footer {
  margin-top: auto;
  padding: 2.4rem clamp(1.1rem, 4vw, 2.5rem);
  border-top: 1px solid var(--rule);
  background: var(--bg);
}
.footer-inner {
  max-width: var(--wide);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  font-size: 0.82rem;
  color: var(--faint);
}
.footer-built a {
  color: var(--muted); text-decoration: none;
  border-bottom: 1px solid var(--rule);
  transition: color var(--t);
}
.footer-built a:hover { color: var(--accent); }

/* ====================
   BACK TO TOP
   ==================== */
.back-to-top {
  position: fixed;
  bottom: 1.8rem; right: 1.8rem;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(232, 226, 214, 0.8);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  opacity: 0; visibility: hidden;
  transform: translateY(10px) scale(0.92);
  transition: opacity var(--t), transform var(--t), visibility var(--t), border-color var(--t), background var(--t);
  box-shadow:
    0 4px 14px rgba(28, 26, 23, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  z-index: 90;
  padding: 0;
}
.back-to-top.visible {
  opacity: 1; visibility: visible;
  transform: translateY(0) scale(1);
}
.back-to-top:hover {
  border-color: var(--accent);
  transform: translateY(-2px) scale(1.04);
  color: var(--accent);
}
.back-to-top svg { display: block; }

/* ====================
   404
   ==================== */
.error-page {
  text-align: center;
  padding: 4rem 0;
  animation: fade-up 0.7s var(--ease-out) both;
}
.error-page h1 {
  font-family: var(--font-serif);
  font-size: clamp(5rem, 18vw, 9rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--ink);
}
.error-page h1 span { color: var(--accent); font-style: italic; }
.error-page p {
  margin-top: 1.2rem;
  font-family: var(--font-serif); font-style: italic;
  color: var(--muted); font-size: 1rem;
}
.error-page a {
  margin-top: 2.2rem;
  display: inline-block;
  font-weight: 500;
  color: #fff;
  background: var(--accent);
  padding: 0.7rem 1.7rem;
  border-radius: 100px;
  text-decoration: none;
  transition: all var(--t);
}
.error-page a:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* ---- Entrance animation ---- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }
@keyframes fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- Code highlighting (light, warm) ---- */
.highlight .hll { background-color: var(--accent-soft) }
.highlight .c  { color: #9A938A; font-style: italic }
.highlight .cm { color: #9A938A; font-style: italic }
.highlight .cp { color: #9A938A }
.highlight .c1 { color: #9A938A; font-style: italic }
.highlight .cs { color: #9A938A }
.highlight .err { color: #B23A48 }
.highlight .k  { color: #8B5A3C; font-weight: 600 }
.highlight .kc { color: #8B5A3C; font-weight: 600 }
.highlight .kd { color: #8B5A3C; font-weight: 600 }
.highlight .kn { color: #8B5A3C; font-weight: 600 }
.highlight .kp { color: #8B5A3C }
.highlight .kr { color: #8B5A3C; font-weight: 600 }
.highlight .kt { color: #2F6B5E }
.highlight .o  { color: #5A5249 }
.highlight .ow { color: #8B5A3C; font-weight: 600 }
.highlight .m  { color: #6B5335 }
.highlight .mf { color: #6B5335 }
.highlight .mh { color: #6B5335 }
.highlight .mi { color: #6B5335 }
.highlight .mo { color: #6B5335 }
.highlight .s  { color: #4F7B53 }
.highlight .sb { color: #4F7B53 }
.highlight .sc { color: #4F7B53 }
.highlight .sd { color: #4F7B53 }
.highlight .s2 { color: #4F7B53 }
.highlight .se { color: #6B5335 }
.highlight .sh { color: #4F7B53 }
.highlight .si { color: #4F7B53 }
.highlight .sx { color: #4F7B53 }
.highlight .sr { color: #4F7B53 }
.highlight .s1 { color: #4F7B53 }
.highlight .ss { color: #4F7B53 }
.highlight .na { color: #2F6B5E }
.highlight .nb { color: #3B352D }
.highlight .nc { color: #2F6B5E; font-weight: 500 }
.highlight .no { color: #2F6B5E }
.highlight .nd { color: #2F6B5E }
.highlight .ni { color: #3B352D }
.highlight .ne { color: #B23A48 }
.highlight .nf { color: #2F6B5E }
.highlight .nl { color: #3B352D }
.highlight .nn { color: #3B352D }
.highlight .nx { color: #2F6B5E }
.highlight .py { color: #3B352D }
.highlight .nt { color: #8B5A3C }
.highlight .nv { color: #3B352D }
.highlight .vc { color: #3B352D }
.highlight .vg { color: #3B352D }
.highlight .vi { color: #3B352D }
.highlight .bp { color: #3B352D }
.highlight .l  { color: #6B5335 }
.highlight .ld { color: #4F7B53 }
.highlight .p  { color: #3B352D }
.highlight .w  { color: #9A938A }
.highlight .il { color: #6B5335 }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .nav-wrapper { gap: 0.6rem; height: 58px; }
  .brand-name { display: none; }
  .site-nav { gap: 0.05rem; }
  .nav-link { padding: 0.45rem 0.6rem; font-size: 0.88rem; }
  .nav-link::after { bottom: 8px; }

  .page { padding: clamp(1.8rem, 5vw, 3rem) 1.2rem 2.5rem; }

  .post-item {
    grid-template-columns: 1fr;
    gap: 0.6rem;
    padding: 1.5rem 0;
  }
  .post-item-date { order: 2; font-size: 0.82rem; }
  .post-item-title { font-size: 1.28rem; }

  .post-content { font-size: 1rem; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav-card.next { text-align: left; }

  .footer-inner { flex-direction: column; align-items: flex-start; }
  .back-to-top { bottom: 1.2rem; right: 1.2rem; width: 42px; height: 42px; }
}

@media (max-width: 480px) {
  html { font-size: 16px; }
  .nav-icon-link { display: none; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* Print */
@media print {
  .site-header, .back-to-top, #progress-bar { display: none; }
  body { background: #fff; }
  .page { padding: 0; }
}
</content>
</invoke>