@import url('https://fonts.googleapis.com/css2?family=Martian+Mono:wght@300;400;600&family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&display=swap');

:root {
  --bg: #0d0f11;
  --surface: #13161a;
  --border: #1f242b;
  --accent: #00e5a0;
  --accent-dim: rgba(0,229,160,0.08);
  --text: #c9d1d9;
  --text-muted: #586069;
  --text-bright: #f0f6fc;
  --mono: 'Martian Mono', monospace;
  --serif: 'Libre Baskerville', serif;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.75;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* ══════════════════════════════════════
   PAGE WRAPPER
══════════════════════════════════════ */
.page {
  display: flex;
  min-height: 100vh;
  max-width: 1080px;
  margin: 0 auto;
}

/* ══════════════════════════════════════
   LEFT SIDEBAR
══════════════════════════════════════ */
.sidebar {
  width: 210px;
  flex-shrink: 0;
  padding: 36px 24px 36px 20px;
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.sidebar-banner {
  margin-bottom: 20px;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border);
  aspect-ratio: 16 / 6;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.sidebar-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0,229,160,0.04) 3px,
    rgba(0,229,160,0.04) 4px
  );
}

.banner-text {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.25em;
  color: var(--accent);
  opacity: 0.5;
  position: relative;
  z-index: 1;
}

.sidebar-title {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.04em;
  margin-bottom: 18px;
  display: block;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  margin-bottom: 24px;
}

.sidebar-nav a {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-muted);
  padding: 5px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.15s;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  color: var(--accent);
}

.nav-dash { color: var(--border); }

.sidebar-bio {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.9;
  margin-bottom: 18px;
}

.sidebar-socials {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: auto;
}

.sidebar-socials a {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  opacity: 0.65;
  padding: 3px 0;
  transition: opacity 0.15s;
}

.sidebar-socials a:hover { opacity: 1; }

/* ══════════════════════════════════════
   MAIN CONTENT
══════════════════════════════════════ */
.main {
  flex: 1;
  padding: 40px 44px 60px;
  min-width: 0;
}

.main-heading {
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 12px;
}

.main-intro {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.85;
  margin-bottom: 36px;
  max-width: 560px;
}

/* ══════════════════════════════════════
   POST LIST (index + tags + search)
══════════════════════════════════════ */
.post-item {
  padding: 22px 0;
  border-top: 1px solid var(--border);
}

.post-item:last-of-type {
  border-bottom: 1px solid var(--border);
}

.post-title-link {
  display: block;
  margin-bottom: 8px;
}

.post-title {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  line-height: 1.55;
  transition: opacity 0.15s;
}

.post-title-link:hover .post-title { opacity: 0.65; }

.post-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 10px;
}

.meta-icon {
  width: 11px;
  height: 11px;
  opacity: 0.3;
  flex-shrink: 0;
}

.post-date, .post-read {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-muted);
}

.meta-sep {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-muted);
  margin: 0 2px;
}

.post-excerpt {
  font-size: 14px;
  color: var(--text);
  line-height: 1.75;
  margin-bottom: 12px;
}

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

.tag {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: 2px;
  transition: color 0.15s, border-color 0.15s;
}

.tag:hover {
  color: var(--accent);
  border-color: rgba(0,229,160,0.25);
}

/* ══════════════════════════════════════
   PAGINATION
══════════════════════════════════════ */
.pagination {
  margin-top: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-link {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 2px;
  transition: color 0.15s, border-color 0.15s;
}

.page-link:hover, .page-link.active {
  color: var(--accent);
  border-color: rgba(0,229,160,0.3);
}

.page-link.active { background: var(--accent-dim); }

/* ══════════════════════════════════════
   POST ARTICLE PAGE
══════════════════════════════════════ */
.post-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.post-header .post-title {
  font-size: 18px;
  margin-bottom: 12px;
  line-height: 1.4;
}

.post-body {
  font-size: 15px;
  line-height: 1.85;
  color: var(--text);
  max-width: 620px;
}

.post-body h2 {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-bright);
  margin: 32px 0 12px;
}

.post-body p { margin-bottom: 18px; }

.post-body a {
  color: var(--accent);
  border-bottom: 1px solid rgba(0,229,160,0.3);
  transition: border-color 0.15s;
}

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

.post-body code {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 2px;
  color: var(--accent);
}

.post-body pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 18px 20px;
  overflow-x: auto;
  margin-bottom: 20px;
}

.post-body pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 12px;
  color: var(--text);
  line-height: 1.7;
}

.post-body blockquote {
  border-left: 2px solid var(--accent);
  padding-left: 16px;
  margin: 20px 0;
  color: var(--text-muted);
  font-style: italic;
}

.post-nav {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.post-nav a {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  transition: color 0.15s;
  max-width: 45%;
}

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

/* ══════════════════════════════════════
   TAGS PAGE
══════════════════════════════════════ */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 40px;
}

.tag-cloud-item {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 2px;
  transition: color 0.15s, border-color 0.15s;
  cursor: pointer;
}

.tag-cloud-item:hover,
.tag-cloud-item.active {
  color: var(--accent);
  border-color: rgba(0,229,160,0.3);
  background: var(--accent-dim);
}

/* ══════════════════════════════════════
   SEARCH PAGE
══════════════════════════════════════ */
.search-wrap {
  margin-bottom: 32px;
  position: relative;
}

.search-input {
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-bright);
  font-family: var(--mono);
  font-size: 12px;
  padding: 10px 14px;
  border-radius: 3px;
  outline: none;
  transition: border-color 0.15s;
}

.search-input::placeholder { color: var(--text-muted); }
.search-input:focus { border-color: rgba(0,229,160,0.4); }

/* ══════════════════════════════════════
   ABOUT PAGE
══════════════════════════════════════ */
.about-body {
  max-width: 560px;
}

.about-body p {
  font-size: 15px;
  color: var(--text);
  margin-bottom: 18px;
  line-height: 1.85;
}

.about-body h2 {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-bright);
  margin: 28px 0 10px;
  letter-spacing: 0.04em;
}

.about-body a {
  color: var(--accent);
  border-bottom: 1px solid rgba(0,229,160,0.3);
  transition: border-color 0.15s;
}

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

.stack-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stack-list li {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.stack-list li::before {
  content: '—';
  color: var(--border);
}

/* ══════════════════════════════════════
   ERROR PAGE
══════════════════════════════════════ */
.error-wrap {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 60px;
}

.error-code {
  font-family: var(--mono);
  font-size: 72px;
  font-weight: 600;
  color: var(--border);
  line-height: 1;
  margin-bottom: 8px;
}

.error-msg {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 24px;
}

.error-sub {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 32px;
  line-height: 1.8;
}

.btn {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  border: 1px solid rgba(0,229,160,0.3);
  padding: 8px 18px;
  border-radius: 2px;
  transition: background 0.15s, border-color 0.15s;
}

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

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */
@media (max-width: 680px) {
  .page { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 20px;
  }
  .sidebar-banner { display: none; }
  .sidebar-socials { margin-top: 0; flex-direction: row; gap: 16px; }
  .main { padding: 24px 20px; }
}
