@import url('https://fonts.googleapis.com/css2?family=Gaegu:wght@400;700&family=JetBrains+Mono:wght@400;500&family=Noto+Sans+KR:wght@400;500;700&display=swap');

:root {
  --paper: #f7f4ea;
  --paper-deep: #eee9db;
  --surface: #fffdf8;
  --surface-soft: #f1eee4;
  --ink: #23251f;
  --ink-soft: #666b61;
  --ink-faint: #92968d;
  --rule: #d8d8cf;
  --rule-dark: #bfc2b8;
  --forest: #506b4b;
  --forest-soft: #e3ebdf;
  --banana: #efc84a;
  --banana-soft: #fff1b8;
  --cocoa: #5b4132;
  --blue: #496b86;
  --red: #a55546;
  --amber: #9b6b19;
  --teal: #46766f;
  --purple: #755c82;
  --green: #5d7647;
  --shadow: 0 14px 36px rgba(57, 48, 34, .09);
  --paper-dot: rgba(91, 65, 50, .08);
  --paper-sheen-a: rgba(255, 255, 255, .18);
  --paper-sheen-b: rgba(255, 255, 255, .1);
  --header-bg: rgba(255, 253, 248, .96);
  --header-shadow: 0 8px 24px rgba(57, 48, 34, .06);
  --small-shadow: rgba(91, 65, 50, .13);
  --card-shadow: rgba(91, 65, 50, .08);
  --card-shadow-hover: rgba(91, 65, 50, .12);
  --sticker-shadow: rgba(91, 65, 50, .18);
  --tape: rgba(239, 200, 74, .72);
  --post-hover: rgba(255, 241, 184, .42);
  --vault-top: rgba(255, 255, 255, .34);
  --vault-bottom: rgba(255, 241, 184, .36);
  --modal-backdrop: rgba(31, 36, 32, .78);
  --photo-frame: #fff;
  --body-copy: #454940;
  --code-text: #e8eee5;
  --code-bg: #1f2420;
  --code-border: #343c35;
  --inline-code-bg: #eee9df;
  --inline-code-border: #d8cfc4;
  --link-underline: rgba(80, 107, 75, .35);
  --tag-blue-bg: #e9f0f4;
  --tag-blue-border: #bdcdd7;
  --tag-red-bg: #f5e9e5;
  --tag-red-border: #d8bdb5;
  --tag-amber-bg: #f7efda;
  --tag-amber-border: #dec88f;
  --tag-teal-bg: #e7f0ee;
  --tag-teal-border: #b9d0cb;
  --tag-purple-bg: #eee8f1;
  --tag-purple-border: #cec0d3;
  --tag-green-bg: #e9efe3;
  --tag-green-border: #c2ceb6;
  --tag-forest-border: #bccdb7;
  --tag-cocoa-bg: #f1e9e3;
  --tag-cocoa-border: #d2c0b3;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --sans: 'Noto Sans KR', system-ui, sans-serif;
  --hand: 'Gaegu', 'Noto Sans KR', sans-serif;
}

html[data-theme="dark"] {
  --paper: #161815;
  --paper-deep: #10120f;
  --surface: #1e211d;
  --surface-soft: #272b25;
  --ink: #eef0e8;
  --ink-soft: #b9bfb4;
  --ink-faint: #899187;
  --rule: #383e36;
  --rule-dark: #50584d;
  --forest: #a6c497;
  --forest-soft: #283727;
  --banana: #e6bd43;
  --banana-soft: #4a3f1d;
  --cocoa: #d8b7a0;
  --blue: #8fb5d0;
  --red: #d88f80;
  --amber: #e0b765;
  --teal: #87b9b0;
  --purple: #bca2c8;
  --green: #a5bd83;
  --shadow: 0 14px 36px rgba(0, 0, 0, .24);
  --paper-dot: rgba(230, 189, 67, .055);
  --paper-sheen-a: rgba(255, 255, 255, .025);
  --paper-sheen-b: rgba(255, 255, 255, .012);
  --header-bg: rgba(30, 33, 29, .96);
  --header-shadow: 0 8px 24px rgba(0, 0, 0, .24);
  --small-shadow: rgba(0, 0, 0, .28);
  --card-shadow: rgba(0, 0, 0, .22);
  --card-shadow-hover: rgba(0, 0, 0, .34);
  --sticker-shadow: rgba(0, 0, 0, .38);
  --tape: rgba(230, 189, 67, .58);
  --post-hover: rgba(74, 63, 29, .5);
  --vault-top: rgba(255, 255, 255, .018);
  --vault-bottom: rgba(74, 63, 29, .34);
  --modal-backdrop: rgba(5, 7, 5, .84);
  --photo-frame: #d9d2c5;
  --body-copy: #d2d8cf;
  --code-text: #e7eee4;
  --code-bg: #0e110f;
  --code-border: #30372f;
  --inline-code-bg: #292e28;
  --inline-code-border: #41483f;
  --link-underline: rgba(166, 196, 151, .45);
  --tag-blue-bg: #24323d;
  --tag-blue-border: #3d586a;
  --tag-red-bg: #392925;
  --tag-red-border: #664139;
  --tag-amber-bg: #3b321e;
  --tag-amber-border: #64502c;
  --tag-teal-bg: #233632;
  --tag-teal-border: #3d5d57;
  --tag-purple-bg: #332b37;
  --tag-purple-border: #57475e;
  --tag-green-bg: #2d3525;
  --tag-green-border: #4c5d3d;
  --tag-forest-border: #4a6045;
  --tag-cocoa-bg: #352b26;
  --tag-cocoa-border: #5c473b;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(var(--paper-dot) .7px, transparent .7px),
    linear-gradient(90deg, var(--paper-sheen-a), transparent 24%, var(--paper-sheen-b));
  background-size: 13px 13px, 100% 100%;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

body,
.site-header,
.paper-panel,
.hero,
.cat-card,
.category-hero,
.banana-vault,
.site-footer,
.search-input,
.theme-toggle {
  transition: color .2s ease, background-color .2s ease, border-color .2s ease, box-shadow .2s ease;
}

a { color: inherit; }
img { display: block; }
::selection { color: var(--ink); background: var(--banana-soft); }
:focus-visible { outline: 3px solid var(--banana); outline-offset: 3px; }

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--paper-deep); }
::-webkit-scrollbar-thumb { background: var(--cocoa); border: 3px solid var(--paper-deep); border-radius: 999px; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  border-bottom: 1px solid var(--rule);
  box-shadow: var(--header-shadow);
  backdrop-filter: blur(12px);
}

.header-top {
  max-width: 1240px;
  min-height: 72px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav-logo {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
}

.nav-monkey {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--banana);
  box-shadow: 2px 3px 0 var(--small-shadow);
}

.nav-logo > span { display: flex; flex-direction: column; }
.logo-text { font-family: var(--hand); font-size: 1.45rem; line-height: 1; letter-spacing: .02em; }
.nav-logo small { margin-top: 3px; color: var(--ink-soft); font-family: var(--mono); font-size: 9px; letter-spacing: .08em; }

.utility-nav { display: flex; align-items: center; gap: 20px; }
.utility-nav a { color: var(--ink-soft); font-family: var(--mono); font-size: 11px; text-decoration: none; }
.utility-nav a:hover { color: var(--cocoa); text-decoration: underline; text-decoration-color: var(--banana); text-decoration-thickness: 3px; text-underline-offset: 4px; }
.theme-toggle {
  min-width: 58px;
  padding: 5px 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: var(--ink-soft);
  background: var(--surface-soft);
  border: 1px dashed var(--rule-dark);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 10px;
  cursor: pointer;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--banana); }
.theme-icon { color: var(--banana); font-size: 14px; line-height: 1; }

.category-nav {
  max-width: 1240px;
  margin: 0 auto;
  padding: 11px 24px 13px;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 7px;
  border-top: 1px solid var(--rule);
}

.category-nav a {
  min-width: 0;
  padding: 8px 5px;
  overflow: hidden;
  color: var(--ink-soft);
  background: var(--surface-soft);
  border: 1px dashed var(--rule-dark);
  border-radius: 6px;
  font-size: 12px;
  text-align: center;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: transform .16s ease, border-color .16s ease, color .16s ease;
}

.category-nav a:nth-child(odd) { transform: rotate(-.3deg); }
.category-nav a:nth-child(even) { transform: rotate(.3deg); }
.category-nav a:hover { color: var(--ink); border-color: var(--banana); transform: translateY(-2px) rotate(0); }
.category-nav a.is-current { color: var(--ink); background: var(--banana-soft); border-color: var(--banana); box-shadow: inset 0 -3px 0 var(--banana); }

/* Overall layout */
.shell {
  width: min(1220px, 100%);
  margin: 0 auto;
  padding: 34px 24px 70px;
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 34px;
  align-items: start;
}

.shell--solo { display: block; width: 100%; max-width: none; padding: 0; }
.shell > main { min-width: 0; }

.sidebar {
  position: sticky;
  top: 160px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.paper-panel {
  position: relative;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 5px;
  box-shadow: 4px 5px 0 var(--card-shadow);
}

.profile-card { transform: rotate(-.25deg); }
.tape {
  position: absolute;
  top: -8px;
  left: 50%;
  width: 62px;
  height: 17px;
  background: var(--tape);
  transform: translateX(-50%) rotate(-1deg);
}

.panel-kicker {
  margin-bottom: 14px;
  color: var(--forest);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
}

.profile-avatar {
  width: 70px;
  height: 70px;
  margin-bottom: 13px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--banana);
  box-shadow: 3px 4px 0 var(--small-shadow);
}

.profile-name { font-weight: 700; }
.profile-name span { margin-left: 4px; color: var(--ink-faint); font-size: 12px; font-weight: 400; }
.profile-role { color: var(--forest); font-family: var(--mono); font-size: 11px; }
.profile-tagline { margin: 12px 0; color: var(--cocoa); font-family: var(--hand); font-size: 1.2rem; }
.profile-affil { display: flex; flex-direction: column; gap: 2px; color: var(--ink-soft); font-size: 12px; }
.profile-affil span::before { content: '↳ '; color: var(--banana); }
.profile-links { margin-top: 15px; display: flex; flex-wrap: wrap; gap: 8px 13px; }

.text-link,
.btn-neon {
  display: inline-block;
  color: var(--forest);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--banana);
  text-decoration-thickness: 3px;
  text-underline-offset: 4px;
}

.text-link:hover,
.btn-neon:hover { color: var(--cocoa); }

.search-box {
  display: flex;
  align-items: stretch;
  gap: 7px;
}

.search-input {
  width: 100%;
  min-width: 0;
  padding: 10px 11px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule-dark);
  border-radius: 5px;
  font-family: var(--sans);
  font-size: 13px;
}

.search-go {
  flex: 0 0 auto;
  padding: 8px 11px;
  color: var(--ink);
  background: var(--banana-soft);
  border: 1px solid var(--banana);
  border-radius: 5px;
  font-family: var(--sans);
  font-size: 12px;
  cursor: pointer;
}

.search-box--lg { max-width: 620px; margin-bottom: 18px; }
.search-box--lg .search-input { padding: 13px 14px; font-size: 14px; background: var(--surface); }
.search-prompt { display: none; }

.side-list { display: flex; flex-direction: column; }
.side-item {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 5px;
  color: var(--ink-soft);
  border-top: 1px solid var(--rule);
  font-size: 12px;
  text-decoration: none;
}
.side-item:last-child { border-bottom: 1px solid var(--rule); }
.side-item:hover { color: var(--ink); background: var(--banana-soft); }
.si-icon { color: var(--forest); text-align: center; }
.si-count { color: var(--ink-faint); font-family: var(--mono); font-size: 10px; }

.mood-card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 6px;
  box-shadow: var(--shadow);
}
.mood-card img { width: 100%; aspect-ratio: 1 / 1; object-fit: contain; object-position: center; background: var(--surface-soft); filter: saturate(.72) contrast(1.04); }
.mood-card figcaption { padding: 10px 12px; color: var(--cocoa); font-family: var(--hand); font-size: 1.08rem; text-align: center; }

/* Home hero */
.hero {
  min-height: 390px;
  margin-bottom: 52px;
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(260px, .72fr);
  background: var(--surface);
  border: 1px solid var(--rule);
  box-shadow: var(--shadow);
}

.hero-copy {
  min-width: 0;
  padding: clamp(40px, 6vw, 72px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-label,
.section-label {
  color: var(--forest);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .13em;
}

.hero h1 {
  max-width: 700px;
  margin: 13px 0 22px;
  font-family: var(--hand);
  font-size: clamp(1.75rem, 3.1vw, 2.45rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -.025em;
  word-break: keep-all;
  overflow-wrap: normal;
  text-decoration: underline wavy var(--banana) 5px;
  text-underline-offset: 10px;
}
.hero-title-line { display: block; white-space: nowrap; }

.hero-desc { max-width: 650px; color: var(--ink-soft); font-size: 15px; }
.hero-stats { margin-top: 25px; display: flex; flex-wrap: wrap; gap: 9px; }
.hero-stats span,
.hero-stats a { padding: 7px 10px; color: var(--ink-soft); background: var(--surface-soft); border: 1px solid var(--rule); border-radius: 4px; font-family: var(--mono); font-size: 10px; text-decoration: none; }
.hero-stats strong { color: var(--forest); }

.hero-photo { position: relative; min-height: 390px; overflow: hidden; display: flex; align-items: center; background: var(--surface-soft); border-left: 1px solid var(--rule); }
.hero-photo > img { width: 100%; height: 100%; object-fit: contain; object-position: center; filter: saturate(.7) sepia(.06) contrast(1.05); }
.monkey-sticker {
  position: absolute;
  left: 16px;
  bottom: 16px;
  padding: 7px 12px 7px 7px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  background: var(--banana-soft);
  border: 1px solid var(--banana);
  border-radius: 7px;
  box-shadow: 4px 5px 0 var(--sticker-shadow);
  transform: rotate(-2deg);
  font-family: var(--hand);
  font-size: 1.12rem;
}
.monkey-sticker img { width: 43px; height: 43px; border-radius: 50%; object-fit: cover; }

/* Sections and category notes */
.section { padding-bottom: 46px; }
.section-header { margin: 0 0 17px; display: flex; align-items: end; gap: 16px; }
.section-header > div:first-child { flex: 0 1 auto; }
.section-header h2 { margin-top: 3px; font-family: var(--hand); font-size: 1.72rem; line-height: 1.1; }
.section-line { height: 1px; flex: 1; margin-bottom: 5px; background: linear-gradient(90deg, var(--banana), var(--rule), transparent); }
.section-action { margin: 15px 0 42px; }

.categories-grid {
  margin-bottom: 52px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.cat-card {
  --cat: var(--forest);
  position: relative;
  min-height: 170px;
  padding: 25px 22px 20px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 5px;
  box-shadow: 4px 5px 0 var(--card-shadow);
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease;
}

.cat-card::before {
  content: '';
  position: absolute;
  top: -7px;
  left: 50%;
  width: 55px;
  height: 15px;
  background: var(--tape);
  transform: translateX(-50%) rotate(-1deg);
}
.cat-card:nth-child(3n+1) { transform: rotate(-.35deg); }
.cat-card:nth-child(3n+2) { transform: rotate(.35deg); }
.cat-card:hover { transform: translateY(-4px) rotate(0); box-shadow: 7px 9px 0 var(--card-shadow-hover); }
.cat-card[data-color="blue"] { --cat: var(--blue); }
.cat-card[data-color="red"] { --cat: var(--red); }
.cat-card[data-color="amber"] { --cat: var(--amber); }
.cat-card[data-color="teal"] { --cat: var(--teal); }
.cat-card[data-color="purple"] { --cat: var(--purple); }
.cat-card[data-color="green"] { --cat: var(--green); }
.cat-card[data-color="forest"] { --cat: var(--forest); }
.cat-card[data-color="cocoa"] { --cat: var(--cocoa); }
.cat-index { position: absolute; top: 15px; right: 16px; color: var(--ink-faint); font-family: var(--mono); font-size: 10px; }
.cat-icon { display: inline-block; margin-bottom: 5px; color: var(--cat); font-size: 20px; }
.cat-name { color: var(--cat); font-family: var(--hand); font-size: 1.55rem; font-weight: 700; }
.cat-desc { margin: 4px 0 12px; color: var(--ink-soft); font-size: 12px; line-height: 1.65; }
.cat-count { color: var(--cat); font-family: var(--mono); font-size: 10px; }

/* Post lists and category pages */
.posts-list { display: flex; flex-direction: column; border-top: 1px solid var(--rule); }
.post-item {
  position: relative;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  gap: 17px;
  align-items: center;
  padding: 17px 7px;
  color: var(--ink);
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  transition: padding-left .16s ease, background .16s ease;
}
.post-item:hover { padding-left: 13px; background: var(--post-hover); }
.post-date { color: var(--ink-faint); font-family: var(--mono); font-size: 10px; white-space: nowrap; }
.post-title { min-width: 0; color: var(--ink); font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.post-item:hover .post-title { color: var(--cocoa); }

/* Home easter egg */
.banana-vault {
  margin: 10px 0 42px;
  padding: 46px 24px 38px;
  color: var(--ink-soft);
  background: linear-gradient(180deg, var(--vault-top), var(--vault-bottom));
  border: 1px dashed var(--rule-dark);
  border-radius: 8px;
  text-align: center;
}
.banana-vault h2 { margin: 6px 0 13px; color: var(--ink); font-family: var(--hand); font-size: 1.8rem; }
.banana-trigger {
  width: 156px;
  margin: 4px auto 0;
  padding: 0;
  display: block;
  background: transparent;
  border: 0;
  cursor: pointer;
  filter: drop-shadow(5px 8px 0 var(--card-shadow-hover));
  transform: rotate(-7deg);
  transform-origin: 50% 80%;
}
.banana-trigger img { width: 100%; height: auto; display: block; pointer-events: none; }
.banana-trigger:hover { transform: translateY(-4px) rotate(-3deg); }
.banana-trigger.is-tapped { animation: banana-tap .18s ease; }
.banana-trigger.is-unlocked { filter: drop-shadow(0 0 15px rgba(239, 200, 74, .9)); }
.banana-hint { min-height: 1.5em; margin-top: 3px; color: var(--ink-faint); font-family: var(--hand); font-size: 1.05rem; }

.banana-reward {
  width: min(520px, calc(100% - 34px));
  max-height: calc(100dvh - 34px);
  padding: 0;
  overflow: auto;
  color: var(--ink);
  background: transparent;
  border: 0;
}
.banana-reward::backdrop { background: var(--modal-backdrop); backdrop-filter: blur(5px); }
.banana-reward-card {
  position: relative;
  padding: 24px 28px 30px;
  background: var(--surface);
  border: 2px solid var(--banana);
  border-radius: 10px;
  box-shadow: 12px 14px 0 rgba(0, 0, 0, .24);
  text-align: center;
}
.banana-keeper {
  width: min(310px, 84%);
  aspect-ratio: 1 / 1;
  margin: 0 auto 20px;
  display: block;
  object-fit: contain;
  background: var(--surface-soft);
  image-rendering: auto;
  border: 9px solid var(--photo-frame);
  border-radius: 16px;
  box-shadow: 5px 7px 0 var(--small-shadow);
}
.banana-reward h2 { margin: 6px 0 8px; font-family: var(--hand); font-size: 2rem; }
.banana-reward p { color: var(--ink-soft); }
.banana-close {
  position: absolute;
  top: 9px;
  right: 12px;
  z-index: 1;
  width: 34px;
  height: 34px;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--rule-dark);
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.banana-take {
  margin-top: 17px;
  padding: 11px 17px;
  display: inline-block;
  color: var(--ink);
  background: var(--banana-soft);
  border: 1px solid var(--banana);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}
.banana-take:hover { background: var(--banana); }
.banana-taken { min-height: 1.5em; margin-top: 10px; font-family: var(--hand); font-size: 1rem; }
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@keyframes banana-tap {
  0% { transform: rotate(-7deg) scale(1); }
  45% { transform: rotate(8deg) scale(.9); }
  100% { transform: rotate(-7deg) scale(1); }
}

.post-tag {
  display: inline-block;
  padding: 4px 9px;
  color: var(--cocoa);
  background: var(--surface-soft);
  border: 1px solid var(--rule-dark);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 9px;
  text-decoration: none;
  white-space: nowrap;
}
.tag-blue { color: var(--blue); background: var(--tag-blue-bg); border-color: var(--tag-blue-border); }
.tag-red { color: var(--red); background: var(--tag-red-bg); border-color: var(--tag-red-border); }
.tag-amber { color: var(--amber); background: var(--tag-amber-bg); border-color: var(--tag-amber-border); }
.tag-teal { color: var(--teal); background: var(--tag-teal-bg); border-color: var(--tag-teal-border); }
.tag-purple { color: var(--purple); background: var(--tag-purple-bg); border-color: var(--tag-purple-border); }
.tag-green { color: var(--green); background: var(--tag-green-bg); border-color: var(--tag-green-border); }
.tag-forest { color: var(--forest); background: var(--forest-soft); border-color: var(--tag-forest-border); }
.tag-cocoa { color: var(--cocoa); background: var(--tag-cocoa-bg); border-color: var(--tag-cocoa-border); }

.empty-note { padding: 42px 12px; color: var(--ink-faint); font-family: var(--mono); font-size: 12px; text-align: center; }

.category-hero {
  min-height: 250px;
  margin-bottom: 40px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  background: var(--surface);
  border: 1px solid var(--rule);
  box-shadow: var(--shadow);
}
.category-hero > div { padding: clamp(30px, 5vw, 55px); display: flex; flex-direction: column; justify-content: center; }
.category-hero h1 { margin: 8px 0 12px; font-family: var(--hand); font-size: clamp(2.2rem, 5vw, 3.5rem); line-height: 1; }
.category-hero p { max-width: 570px; color: var(--ink-soft); font-size: 14px; }
.category-hero figure { position: relative; overflow: hidden; display: flex; align-items: center; background: var(--surface-soft); border-left: 1px solid var(--rule); }
.category-hero figure img { width: 100%; height: 100%; object-fit: contain; object-position: center; filter: saturate(.72) contrast(1.04); }
.category-hero figcaption { position: absolute; right: 12px; bottom: 12px; padding: 6px 10px; background: var(--banana-soft); border: 1px solid var(--banana); border-radius: 5px; font-family: var(--hand); transform: rotate(-2deg); }

html[data-theme="dark"] .mood-card img,
html[data-theme="dark"] .hero-photo > img,
html[data-theme="dark"] .category-hero figure img {
  filter: saturate(.72) brightness(.82) contrast(1.08);
}

/* Search and filters */
.filter-bar { margin-bottom: 24px; display: flex; flex-wrap: wrap; gap: 7px; }
.filter-btn {
  padding: 7px 11px;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px dashed var(--rule-dark);
  border-radius: 6px;
  font-family: var(--sans);
  font-size: 11px;
  cursor: pointer;
}
.filter-btn:hover { color: var(--ink); border-color: var(--banana); }
.filter-btn.active { color: var(--ink); background: var(--banana-soft); border-color: var(--banana); box-shadow: inset 0 -3px 0 var(--banana); }

/* Long-form post */
.post-layout { width: min(900px, 100%); margin: 0 auto; padding: 62px 26px 90px; }
.post-header {
  margin-bottom: 44px;
  padding: 0 0 30px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 126px;
  gap: 32px;
  align-items: end;
  border-bottom: 1px solid var(--rule);
}
.post-heading-copy { min-width: 0; }
.post-header .post-tag { margin-bottom: 15px; }
.post-header h1 { color: var(--ink); font-size: clamp(1.75rem, 4vw, 2.55rem); line-height: 1.35; letter-spacing: -.025em; overflow-wrap: anywhere; }
.post-meta { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px 17px; color: var(--ink-faint); font-family: var(--mono); font-size: 10px; overflow-wrap: anywhere; }
.post-mood { transform: rotate(2deg); }
.post-mood img { width: 104px; height: 104px; margin-left: auto; object-fit: contain; background: var(--surface-soft); border: 7px solid var(--surface); box-shadow: 4px 5px 0 var(--card-shadow-hover); }
.post-mood figcaption { margin-top: 7px; color: var(--cocoa); font-family: var(--hand); text-align: right; }

.post-body { color: var(--body-copy); font-size: 16px; line-height: 1.9; overflow-wrap: break-word; }
.post-body p { margin-bottom: 1.45rem; }
.post-body h2 { margin: 3.3rem 0 1.1rem; padding-bottom: .55rem; color: var(--ink); border-bottom: 1px solid var(--rule); font-size: 1.45rem; line-height: 1.45; }
.post-body h2::before { content: '↳ '; color: var(--banana); font-family: var(--hand); }
.post-body h3 { margin: 2.35rem 0 .8rem; color: var(--ink); font-size: 1.12rem; }
.post-body h3::before { content: '• '; color: var(--forest); }
.post-body h4 { margin: 1.8rem 0 .6rem; color: var(--cocoa); font-family: var(--mono); font-size: .85rem; }

.post-body pre {
  max-width: 100%;
  margin: 1.6rem 0 1.9rem;
  padding: 19px 21px;
  overflow-x: auto;
  color: var(--code-text);
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-left: 4px solid var(--banana);
  border-radius: 6px;
  line-height: 1.7;
  box-shadow: 0 10px 28px rgba(35, 37, 31, .12);
}
.post-body pre code { padding: 0; color: inherit; background: none; border: 0; font-family: var(--mono); font-size: 12.8px; white-space: pre; }
.post-body :not(pre) > code { padding: 2px 6px; color: var(--cocoa); background: var(--inline-code-bg); border: 1px solid var(--inline-code-border); border-radius: 4px; font-family: var(--mono); font-size: 12.5px; overflow-wrap: anywhere; }
.post-body blockquote { margin: 1.6rem 0; padding: 16px 19px; color: var(--ink-soft); background: var(--forest-soft); border-left: 4px solid var(--forest); border-radius: 0 6px 6px 0; }
.post-body blockquote p:last-child { margin-bottom: 0; }
.post-body ul,
.post-body ol { margin: .7rem 0 1.5rem; padding-left: 1.65rem; }
.post-body li { margin-bottom: .45rem; }
.post-body li::marker { color: var(--forest); }
.post-body table { display: block; width: 100%; max-width: 100%; margin: 1.8rem 0; overflow-x: auto; border-collapse: collapse; border: 1px solid var(--rule); background: var(--surface); font-size: 13px; }
.post-body th { padding: 11px 13px; color: var(--cocoa); background: var(--banana-soft); border-bottom: 1px solid var(--rule-dark); text-align: left; white-space: nowrap; }
.post-body td { padding: 10px 13px; color: var(--ink-soft); border-bottom: 1px solid var(--rule); vertical-align: top; }
.post-body tr:last-child td { border-bottom: 0; }
.post-body img { max-width: 100%; height: auto; margin: 1.2rem auto; border: 1px solid var(--rule); border-radius: 6px; box-shadow: var(--shadow); }
.post-body svg { max-width: 100%; height: auto; }
.post-body iframe,
.post-body video { max-width: 100%; border: 0; border-radius: 6px; }
.post-body mjx-container[display="true"] { max-width: 100%; overflow-x: auto; overflow-y: hidden; }
.post-body hr { height: 1px; margin: 2.8rem 0; border: 0; background: linear-gradient(90deg, transparent, var(--banana), var(--rule), transparent); }
.post-body a { color: var(--forest); text-decoration: underline; text-decoration-color: var(--link-underline); text-underline-offset: 3px; overflow-wrap: anywhere; }
.post-body a:hover { color: var(--cocoa); text-decoration-color: var(--banana); text-decoration-thickness: 3px; }
.post-body strong { color: var(--ink); }
.post-body details { margin: 1.5rem 0; padding: 14px 17px; background: var(--surface); border: 1px solid var(--rule); border-radius: 5px; }
.post-body summary { color: var(--cocoa); cursor: pointer; font-weight: 700; }

.post-footer { margin-top: 56px; padding-top: 22px; display: flex; flex-wrap: wrap; gap: 18px; border-top: 1px solid var(--rule); }
.back-btn { color: var(--ink-soft); font-family: var(--mono); font-size: 11px; text-decoration: underline; text-decoration-color: var(--banana); text-underline-offset: 4px; }
.back-btn:hover { color: var(--cocoa); }

/* About */
.about-layout { width: min(900px, 100%); margin: 0 auto; padding: 62px 26px 90px; }
.about-head { margin-bottom: 28px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.about-avatar { width: 96px; height: 96px; flex: 0 0 auto; object-fit: cover; border-radius: 50%; border: 4px solid var(--banana); box-shadow: 5px 6px 0 var(--small-shadow); transform: rotate(-2deg); }
.about-name { color: var(--ink); font-family: var(--hand); font-size: 2.15rem; line-height: 1.1; }
.about-realname { color: var(--ink-faint); font-family: var(--sans); font-size: .9rem; font-weight: 400; }
.about-role { color: var(--forest); font-family: var(--mono); font-size: 11px; }
.about-bio { margin-bottom: 34px; color: var(--ink-soft); }
.hash-list { display: flex; flex-wrap: wrap; gap: 7px; }
.hash-tag,
.skill-tag { padding: 5px 9px; color: var(--ink-soft); background: var(--surface); border: 1px dashed var(--rule-dark); border-radius: 5px; font-family: var(--mono); font-size: 10px; }
.skill-group { margin-bottom: 18px; }
.skill-group-name { margin-bottom: 8px; color: var(--forest); font-family: var(--mono); font-size: 10px; letter-spacing: .08em; }
.skill-list { display: flex; flex-wrap: wrap; gap: 7px; }
.now-list { display: flex; flex-direction: column; gap: 9px; }
.now-item { padding: 13px 15px; display: flex; gap: 11px; align-items: baseline; background: var(--surface); border: 1px solid var(--rule); border-left: 4px solid var(--banana); border-radius: 0 5px 5px 0; }
.now-dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--forest); }
.now-text { color: var(--ink); font-size: 14px; }
.now-note { color: var(--ink-faint); font-size: 12px; }
.timeline { position: relative; margin-bottom: 20px; padding-left: 25px; }
.timeline::before { content: ''; position: absolute; left: 5px; top: 7px; bottom: 7px; width: 2px; background: var(--banana); }
.tl-item { position: relative; padding-bottom: 21px; }
.tl-item::before { content: ''; position: absolute; left: -24px; top: 9px; width: 10px; height: 10px; background: var(--surface); border: 2px solid var(--forest); border-radius: 50%; }
.tl-period { color: var(--forest); font-family: var(--mono); font-size: 10px; }
.tl-title { color: var(--ink); font-size: 14px; font-weight: 700; }
.tl-org { color: var(--ink-faint); font-family: var(--mono); font-size: 11px; }
.tl-desc { margin-top: 4px; color: var(--ink-soft); font-size: 13px; }
.link-list { display: flex; flex-wrap: wrap; gap: 12px; }

/* Footer */
.site-footer { padding: 32px 24px 38px; color: var(--ink-soft); background: var(--surface); border-top: 1px solid var(--rule); font-size: 11px; text-align: center; }
.site-footer strong { color: var(--cocoa); font-family: var(--hand); font-size: 1.15rem; }
.footer-links { margin-top: 2px; }
.site-footer a { color: var(--ink-soft); text-underline-offset: 3px; }
.photo-credit { max-width: 900px; margin: 10px auto 0; }
.photo-credit summary { cursor: pointer; color: var(--ink-faint); }
.photo-credit span { display: block; margin-top: 6px; line-height: 1.65; }

/* Legacy helpers */
.glitch { font-family: var(--hand); }
.highlight { background: transparent; }

@media (max-width: 1040px) {
  .shell { grid-template-columns: minmax(0, 1fr); padding-top: 28px; }
  .sidebar { position: static; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .profile-card { grid-row: span 2; }
  .mood-card { max-width: none; }
}

@media (max-width: 780px) {
  .header-top { min-height: 66px; padding: 10px 17px; }
  .utility-nav { gap: 13px; }
  .category-nav { padding: 9px 17px 11px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .shell { padding: 24px 17px 55px; }
  .hero { grid-template-columns: 1fr; }
  .hero-copy { padding: 40px 28px; }
  .hero-photo { min-height: 300px; border-left: 0; border-top: 1px solid var(--rule); }
  .categories-grid { grid-template-columns: 1fr; }
  .category-hero { grid-template-columns: 1fr; }
  .category-hero figure { min-height: 260px; border-left: 0; border-top: 1px solid var(--rule); }
  .post-layout,
  .about-layout { padding: 44px 20px 70px; }
  .post-header { grid-template-columns: 1fr; }
  .post-mood { width: 126px; }
  .post-mood img { margin-left: 0; }
  .post-mood figcaption { text-align: left; }
}

@media (max-width: 560px) {
  .nav-logo small { display: none; }
  .logo-text { font-size: 1.25rem; }
  .utility-nav a:nth-child(3) { display: none; }
  .theme-toggle { min-width: 32px; padding-inline: 7px; }
  .theme-label { display: none; }
  .category-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sidebar { grid-template-columns: 1fr; }
  .profile-card { grid-row: auto; }
  .panel--archive { display: none; }
  .post-item { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; }
  .post-date { grid-column: 1 / -1; }
  .post-body { font-size: 15px; }
  .post-body pre { padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .001ms !important; }
}
