:root {
  --bg: #0b0c0e;
  --panel: #111215ee;
  --line: #24262b;
  --ink: #ece9e2;
  --ink-2: #b4b0a7;
  --ink-3: #75726c;
  --accent: #e8c36a;
  --sans: "Be Vietnam Pro", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
html { background: var(--bg); color: var(--ink); }
body { margin: 0; min-height: 100vh; font: 300 16px/1.6 var(--sans); background: radial-gradient(ellipse at 40% 45%, #16171b 0%, var(--bg) 65%); }
a { color: inherit; text-decoration: none; }
#sky { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; }
.muted { color: var(--ink-3); }

/* header */
.top { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 8px 32px; border-bottom: 1px solid var(--line); background: #0b0c0ecc; backdrop-filter: blur(6px); position: sticky; top: 0; z-index: 5; }
.brand { white-space: nowrap; display: flex; align-items: center; gap: 12px; font-weight: 500; letter-spacing: .02em; }
.brand svg { width: 26px; height: 26px; fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.topics { display: flex; justify-content: flex-end; gap: 0; font: 500 13px var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.topics a { padding: 4px 18px; color: var(--ink-2); border-left: 1px solid var(--line); }
.topics a:first-child { border-left: 0; }
.topics a:hover, .topics a[aria-current] { color: var(--accent); }

/* home */
.home { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 32px; padding: 24px 32px 40px; align-items: center; min-height: calc(100vh - 140px); }
.stage { display: flex; flex-direction: column; gap: 22px; width: 100%; max-width: 860px; margin: 0 auto; }
.search { order: -1; position: relative; width: min(100%, 420px); }
.search input { width: 100%; padding: 12px 44px 12px 18px; border-radius: 999px; border: 1px solid var(--line); background: #131418; color: var(--ink); font: 300 16px var(--sans); outline: none; }
.search input:focus { border-color: var(--ink-3); }
.search svg { position: absolute; right: 16px; top: 13px; width: 20px; height: 20px; fill: none; stroke: var(--ink-2); stroke-width: 1.8; stroke-linecap: round; pointer-events: none; }
#results { position: absolute; left: 0; right: 0; top: calc(100% + 8px); margin: 0; padding: 6px; list-style: none; background: #131418; border: 1px solid var(--line); border-radius: 12px; z-index: 6; }
#results a, #results .none { display: block; padding: 8px 12px; border-radius: 8px; }
#results a:hover { background: #1c1d22; }
#results small { display: block; color: var(--ink-3); font-size: 12px; }
.hint { margin: 0; font: 400 12px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }

/* bookshelf */
.shelves { position: relative; display: flex; flex-direction: column; gap: 34px; }
.shelf h2 { display: flex; justify-content: space-between; align-items: center; margin: 0 4px 10px; font: 500 13px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2); }
.shelf h2 a { display: flex; align-items: center; gap: 8px; }
.shelf h2 a:hover { color: var(--accent); }
.shelf h2 span { color: var(--ink-3); font-weight: 400; letter-spacing: .08em; }
.books { display: flex; align-items: flex-end; gap: 60px; padding: 0 14px; min-height: 230px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column-reverse; align-items: flex-start; gap: 3px; }
.book { position: relative; display: flex; align-items: center; flex: none; width: var(--w); height: var(--h); padding: 0 38px; background: linear-gradient(#ffffff12, transparent 30%, #0004), var(--c); border: 1px solid #ffffff14; border-radius: 2px 5px 5px 2px; box-shadow: 0 3px 6px #0008; transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s; cursor: pointer; overflow: hidden; }
.book:hover { transform: translateX(10px); }
.book.up { transform: translateX(46px) translateY(-2px); box-shadow: 14px 8px 22px -6px #000c; z-index: 2; }
.book .band { position: absolute; top: 0; bottom: 0; left: 12px; width: 5px; background: #e8c36a66; border-inline: 1px solid #e8c36a99; }
.book .band.b2 { left: auto; right: 12px; }
.book::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #0006, transparent 9%, transparent 91%, #0006); pointer-events: none; }
.book .title { flex: 1; text-align: center; font: 500 15px/1.2 var(--sans); color: #eeeae0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.book .cnt { position: absolute; right: 24px; top: 50%; transform: translateY(-50%); font: 500 12px var(--mono); color: var(--accent); }
.shelf { position: relative; padding: 10px 0 0; background: linear-gradient(#ffffff05, transparent 60%); border-radius: 4px; }
.plank { height: 14px; margin: 0 -2px; border-radius: 2px; background: linear-gradient(#3a2f26, #241c16); box-shadow: 0 10px 18px -6px #000c; }
.empty { align-self: center; font-size: 14px; }
.peek { position: absolute; width: 280px; padding: 16px 18px; background: #15161a; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 18px 40px -10px #000; z-index: 4; }
.peek[hidden] { display: none; }
.peek h3 { margin: 4px 0 10px; font-size: 20px; font-weight: 500; line-height: 1.35; }
.peek ul { list-style: none; margin: 0 0 12px; padding: 0; }
.peek li { padding: 7px 0; border-top: 1px solid var(--line); font-size: 15px; line-height: 1.4; }
.peek li a:hover { color: var(--accent); }
.peek li small { display: block; color: var(--ink-3); font: 400 12px var(--mono); }
.peek li.more { color: var(--ink-3); font-size: 13px; }
.peek .read { color: var(--accent); font-weight: 500; }
@media (prefers-reduced-motion: reduce) { .book { transition: none; } }

/* panel */
.panel { border: 1px solid var(--line); background: var(--panel); border-radius: 4px; }
.panel section { padding: 20px 24px; border-top: 1px solid var(--line); }
.panel section:first-child { border-top: 0; }
.hello { display: flex; gap: 18px; }
.avatar { flex: none; width: 64px; height: 64px; border-radius: 6px; display: grid; place-items: center; background: #e9e5dc; color: #111; font: 500 28px var(--sans); }
.hello h2 { margin: 0 0 6px; font-size: 20px; font-weight: 500; }
.hello p { margin: 0; color: var(--ink-2); font-size: 15px; }
.label { display: flex; justify-content: space-between; font: 400 12px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 10px; }
.bars, .latest { list-style: none; margin: 0; padding: 0; }
.bars a { display: grid; grid-template-columns: 26px 1fr 90px 40px; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.bars li:last-child a { border-bottom: 0; }
.bars .name { font-size: 18px; font-weight: 400; }
.bars .bar { height: 4px; background: #2a2c31; border-radius: 2px; overflow: hidden; }
.bars .bar i { display: block; height: 100%; background: var(--ink); }
.bars .num { text-align: right; font: 500 18px var(--mono); }
.bars a:hover .name { color: var(--accent); }
.ico { width: 22px; height: 22px; fill: none; stroke: var(--ink-2); stroke-width: 1.5; stroke-linejoin: round; }
.latest li { border-bottom: 1px solid var(--line); }
.latest li:last-child { border-bottom: 0; }
.latest a { display: block; padding: 9px 0; font-size: 16px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.latest a:hover { color: var(--accent); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.stats > div + div { border-left: 1px solid var(--line); padding-left: 16px; }
.stats b { display: block; font: 500 26px var(--mono); }
.stats small { font: 400 11px var(--mono); letter-spacing: .1em; color: var(--ink-3); text-transform: uppercase; }

/* lists & posts */
.list, .post { max-width: 720px; margin: 0 auto; padding: 56px 24px 72px; }
.kicker { margin: 0 0 8px; font: 400 12px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.list h1, .post h1 { margin: 0 0 16px; font-size: clamp(30px, 5vw, 42px); line-height: 1.2; font-weight: 500; }
.list ul, .related ul { list-style: none; margin: 32px 0 0; padding: 0; }
.item { padding: 22px 0; border-top: 1px solid var(--line); }
.item h3 { margin: 0 0 6px; font-size: 21px; font-weight: 500; line-height: 1.35; }
.item a:hover h3 { color: var(--accent); }
.meta { margin: 0; font: 400 13px var(--mono); color: var(--ink-3); }
.excerpt { margin: 8px 0 0; color: var(--ink-2); }
.prose { margin-top: 36px; font-size: 18px; line-height: 1.8; color: #dedad2; }
.prose h2, .prose h3 { color: var(--ink); font-weight: 500; line-height: 1.3; margin: 2em 0 .6em; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.prose blockquote { margin: 1.5em 0; padding: 0 0 0 20px; border-left: 2px solid var(--accent); color: var(--ink-2); }
.prose code { font: 15px var(--mono); background: #18191d; padding: 1px 5px; border-radius: 4px; }
.prose pre { background: #131418; padding: 16px; border-radius: 8px; overflow-x: auto; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5em 0; }
.prose table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 6px 10px; }
.prose strong { font-weight: 600; color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 40px; }
.chips a { padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; color: var(--ink-2); }
.chips a:hover { color: var(--accent); border-color: var(--accent); }
.related { margin-top: 56px; }
.foot { padding: 28px 32px 36px; text-align: center; font: 500 24px/1.3 "Dancing Script", cursive; color: var(--ink-3); }

@media (max-width: 1100px) {
  .home { grid-template-columns: 1fr; }
  .panel { max-width: 560px; width: 100%; margin: 0 auto; }
}
@media (max-width: 720px) {
  .top { padding: 8px 16px; gap: 12px; }
  .topics { overflow-x: auto; font-size: 12px; }
  .topics a { padding: 4px 12px; white-space: nowrap; }
  
  .home { padding: 8px 16px 32px; gap: 16px; }
  .books { padding: 0 6px; gap: 20px; min-height: 0; }
  .book { width: min(var(--w), 78vw); }
  .book .title { font-size: 14px; }
  .peek { width: min(300px, 90vw); }
  .panel section { padding: 16px; }
  .bars a { grid-template-columns: 24px 1fr 60px 32px; }
  .list, .post { padding: 32px 16px 56px; }
  .prose { font-size: 17px; }
}
