:root {
  --page:        #080907;
  --bg:          #0e100e;
  --panel:       #121410;
  --card:        #14160f;
  --border:      #23261f;
  --border-soft: #1e211a;
  --hair:        #171a13;
  --text:        #cfccc0;
  --bright:      #f6f3e9;
  --head:        #f2efe4;
  --body:        #a8a698;
  --muted:       #9b9a8b;
  --dim:         #6d7062;
  --faint:       #5c5f52;
  --accent:      #e0a34e;
  --accent-brd:  #3a3320;
  --green:       #8fbf7f;
  --green-brd:   #2f4a2a;
  --amber-pill:  #c7b06a;
  --amber-brd:   #4a4225;
}

* { box-sizing: border-box; }

html { background: #080907; }

body {
  margin: 0;
  background: #080907;
  color: var(--text);
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: rgba(224, 163, 78, .22); }

a { color: inherit; }

/* ---------- shell / window ---------- */
.shell {
  max-width: 800px;
  margin: 30px auto;
  min-height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 26px 60px -28px rgba(0, 0, 0, .7);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-soft);
  border-radius: 10px 10px 0 0;
  background: var(--panel);
}
.topbar .dot { width: 11px; height: 11px; border-radius: 50%; background: #3a3d34; display: inline-block; }
.topbar .pwd { margin-left: 12px; font-size: 12px; color: var(--dim); }
.topbar .pwd a { color: inherit; text-decoration: none; transition: color .15s; }
.topbar .pwd a:hover { color: var(--accent); }
.topbar nav { margin-left: auto; display: flex; gap: 18px; font-size: 12px; }
.topbar nav a { color: #8a8d7c; text-decoration: none; transition: color .15s; }
.topbar nav a:hover, .topbar nav a.active { color: var(--accent); }

.content { flex: 1; padding: 44px 48px; }

/* ---------- primitives ---------- */
.prompt { font-size: 13px; color: var(--dim); text-decoration: none; display: block; }
.prompt.back-link { margin-top: 34px; }
.prompt .faint { color: var(--faint); }
a.prompt:hover { color: var(--accent); }

.title {
  margin: 14px 0 6px;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -.015em;
  color: var(--head);
}
.lead, .lead p { font-size: 15px; line-height: 1.7; color: var(--muted); margin: 0; max-width: 600px; }
.lead p + p { margin-top: 12px; }

.divider { height: 1px; background: var(--border-soft); margin: 30px 0; }

.count { font-size: 13px; color: var(--faint); }

.btn {
  display: inline-block;
  margin-top: 30px;
  font-size: 13px;
  color: var(--accent);
  border: 1px solid var(--accent-brd);
  padding: 9px 16px;
  border-radius: 5px;
  text-decoration: none;
  transition: background .15s;
}
.btn:hover { background: #17140d; }

/* ---------- post listing rows ---------- */
.listing-head, .listing-head-big { display: flex; align-items: baseline; gap: 14px; }
.listing-head { font-size: 13px; color: var(--dim); margin-bottom: 20px; }
.listing-head .count { margin-left: auto; }
.listing-head-big { margin: 14px 0 6px; }

.listing { display: flex; flex-direction: column; gap: 2px; }
.row {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 20px;
  align-items: baseline;
  padding: 15px 14px;
  border-radius: 5px;
  text-decoration: none;
  transition: background .12s;
}
.row:hover { background: var(--card); }
.row:hover .row-title { color: var(--bright); }
.row-date { font-size: 12px; color: var(--dim); white-space: nowrap; }
.row-body { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.row-title { font-size: 16px; font-weight: 500; color: #e6e3d8; }
.row-tags { font-size: 11px; color: var(--green); }

/* archive year headers */
.year { display: flex; align-items: center; gap: 14px; margin: 30px 0 12px; }
.year span:first-child { font-size: 13px; font-weight: 600; color: var(--accent); }
.year .year-line { flex: 1; height: 1px; background: var(--border-soft); }

/* tag filter */
.tags-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 30px; }
.chip {
  font-size: 12px;
  color: var(--muted);
  border: 1px solid #2a2d24;
  padding: 5px 12px;
  border-radius: 20px;
  text-decoration: none;
  transition: border-color .15s, color .15s;
}
.chip:hover { color: var(--bright); border-color: #3a3d33; }
.chip.active { color: #1a1a1a; background: var(--accent); border-color: var(--accent); }

/* ---------- project cards / slideshow ---------- */
.ss-head { display: flex; align-items: center; font-size: 13px; color: var(--dim); margin-bottom: 16px; }
.ss-nav { margin-left: auto; display: flex; gap: 8px; }
.ss-nav button {
  cursor: pointer; font: inherit; color: var(--muted);
  background: transparent; border: 1px solid #2a2d24; border-radius: 4px;
  padding: 0 11px; line-height: 1.7;
}
.ss-nav button:hover { color: var(--accent); border-color: var(--accent-brd); }

.slideshow { overflow: hidden; }
.ss-track { display: flex; gap: 14px; transition: transform .55s cubic-bezier(.4,0,.2,1); }
.ss-track .pcard { flex: 0 0 258px; }

.ss-dots { display: flex; gap: 6px; justify-content: center; margin-top: 16px; }
.ss-dot { height: 5px; width: 6px; border-radius: 3px; background: #34372c; transition: all .3s ease; cursor: pointer; }
.ss-dot.on { width: 18px; background: var(--accent); }

.pgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.pcard {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  transition: border-color .15s, transform .15s;
}
.pcard:hover { border-color: #34382c; transform: translateY(-2px); }
.pcard-head { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; }
.pcard-name { font-size: 15px; color: var(--head); font-weight: 600; }
.pcard-desc { margin: 0 0 16px; font-size: 12px; line-height: 1.5; color: var(--muted); }
.pcard-meta { display: flex; align-items: center; gap: 14px; font-size: 11px; color: var(--dim); margin-top: auto; }
.pcard-meta .lang { display: flex; align-items: center; gap: 6px; }
.lang-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.pcard-meta .updated { margin-left: auto; color: var(--faint); }

.badge { font-size: 9px; letter-spacing: .04em; padding: 1px 8px; border-radius: 20px; }
.badge-active  { color: var(--green); border: 1px solid var(--green-brd); }
.badge-wip     { color: var(--amber-pill); border: 1px solid var(--amber-brd); }
.badge-archive { color: #7d7f70; border: 1px solid #34372c; }
.badge-private { color: #8a8d7c; border: 1px solid #34372c; }

.pcard-static { cursor: default; }
.pcard-static:hover { border-color: var(--border); transform: none; }

/* ---------- article ---------- */
.post { max-width: 640px; margin: 0 auto; }
.post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.tag-pill { font-size: 11px; color: var(--accent); border: 1px solid var(--accent-brd); padding: 3px 10px; border-radius: 20px; }
.post-title { margin: 14px 0 16px; font-size: 36px; line-height: 1.15; font-weight: 700; letter-spacing: -.02em; color: var(--bright); }
.post-meta { display: flex; align-items: center; gap: 16px; font-size: 12px; color: var(--dim); padding-bottom: 26px; border-bottom: 1px solid var(--border-soft); }
.post-meta .sep { color: #3a3d34; }

/* prose */
.prose { color: var(--body); }
.prose > *:first-child { margin-top: 28px; }
.prose h2 { font-size: 21px; font-weight: 600; color: var(--head); margin: 38px 0 14px; letter-spacing: -.01em; }
.prose h3 { font-size: 17px; font-weight: 600; color: var(--head); margin: 30px 0 12px; }
.prose p { font-size: 15px; line-height: 1.75; margin: 0 0 18px; }
.prose a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--accent-brd); }
.prose a:hover { border-bottom-color: var(--accent); }
.prose ul, .prose ol { font-size: 15px; line-height: 1.8; margin: 0 0 24px; padding-left: 22px; }
.prose li { margin-bottom: 4px; }
.prose strong { color: var(--bright); }
.prose code { font-size: 13px; background: var(--panel); border: 1px solid var(--border-soft); border-radius: 4px; padding: 1px 6px; color: var(--accent); }
.prose blockquote { margin: 24px 0; padding: 4px 18px; border-left: 2px solid #34372c; color: var(--muted); }
.prose img { max-width: 100%; border-radius: 6px; border: 1px solid var(--border); }

/* code blocks (chroma wrapper) */
.prose .highlight { margin: 24px 0; border: 1px solid var(--border-soft); border-radius: 7px; background: var(--panel); overflow: hidden; }
.prose .highlight pre { margin: 0; padding: 18px 20px; overflow-x: auto; font-size: 13px; line-height: 1.7; }
.prose > pre { margin: 24px 0; padding: 18px 20px; border: 1px solid var(--border-soft); border-radius: 7px; background: var(--panel); overflow-x: auto; font-size: 13px; line-height: 1.7; }
.prose pre > code { background: none; border: none; padding: 0; color: inherit; font-size: 13px; }

/* note callout (shortcode) */
.note { border-left: 2px solid var(--accent); background: var(--card); padding: 14px 18px; margin: 24px 0; border-radius: 0 6px 6px 0; }
.note-label { font-size: 11px; color: var(--accent); margin-bottom: 6px; letter-spacing: .06em; }
.note-body { font-size: 14px; line-height: 1.65; color: #b6b4a6; }
.note-body p { margin: 0; }

/* pager */
.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 38px; padding-top: 26px; border-top: 1px solid var(--border-soft); }
.pager-item { flex: 1; background: var(--card); border: 1px solid var(--border); border-radius: 7px; padding: 16px 18px; text-decoration: none; transition: border-color .15s; }
.pager-item:hover { border-color: #34382c; }
.pager-item.right { text-align: right; }
.pager-item.empty { background: none; border: none; }
.pager-label { display: block; font-size: 11px; color: var(--dim); margin-bottom: 6px; }
.pager-title { display: block; font-size: 14px; color: #e6e3d8; }

/* ---------- footer ---------- */
.site-footer { display: flex; align-items: center; padding: 26px 48px; border-top: 1px solid var(--border-soft); border-radius: 0 0 10px 10px; font-size: 12px; color: var(--faint); }
.foot-links { margin-left: auto; display: flex; gap: 16px; }
.foot-links a { color: var(--dim); text-decoration: none; }
.foot-links a:hover { color: var(--accent); }

/* ---------- responsive ---------- */
@media (max-width: 720px) {
  .content { padding: 32px 22px; }
  .site-footer { padding: 22px; }
  .row { grid-template-columns: 84px 1fr; }
  .pgrid { grid-template-columns: 1fr; }
  .topbar .pwd { display: none; }
  .post-title { font-size: 28px; }
}
