:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #0f0f0f;
  --bg-card: #131313;
  --bg-code: #181818;
  --text-primary: #e8e8e8;
  --text-secondary: #999999;
  --text-muted: #666666;
  --accent-green: #39ff14;
  --accent-cyan: #00e5ff;
  --accent-green-dim: rgba(57, 255, 20, 0.1);
  --accent-cyan-dim: rgba(0, 229, 255, 0.08);
  --border-color: #222;
  --border-hover: #39ff14;
  --max-width: 800px;
  --font-mono: 'Fira Code', 'JetBrains Mono', 'Cascadia Code', 'Consolas', monospace;
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --radius: 10px;
  --radius-sm: 6px;
}

* { box-sizing: border-box; }
::selection { background: var(--accent-green); color: #000; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.75;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

.wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border-color);
  padding: 24px 0;
  margin-bottom: 48px;
}

.site-title,
.site-title:visited {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 600;
  color: #39ff14 !important;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 3px;
}

.site-nav {
  float: right;
  line-height: 2.4;
}
.site-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  margin-left: 24px;
  transition: color 0.2s;
}
.site-nav a:hover {
  color: var(--accent-cyan);
}

/* Links */
a,
a:visited {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: color 0.2s, text-shadow 0.2s;
}
a:hover {
  color: var(--accent-green);
  text-shadow: 0 0 8px var(--accent-green-dim);
}

/* Typography */
h1, h2, h3, h4 {
  font-family: var(--font-mono);
  color: #fff;
  margin-top: 2em;
  margin-bottom: 0.5em;
  font-weight: 600;
}
h1 { font-size: 1.8rem; border-bottom: 1px solid var(--border-color); padding-bottom: 0.3em; }
h2 { font-size: 1.4rem; color: var(--accent-green); }
h3 { font-size: 1.15rem; color: var(--accent-cyan); }

p { margin: 1em 0; }
strong { color: #fff; }

/* Code */
pre, code {
  font-family: var(--font-mono);
  font-size: 0.88rem;
}
code {
  background: var(--bg-code);
  color: var(--accent-cyan);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}
pre {
  background: var(--bg-code);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 16px;
  overflow-x: auto;
  line-height: 1.5;
}
pre code {
  background: none;
  padding: 0;
  color: var(--text-primary);
}

/* highlight.js overrides */
.hljs { background: var(--bg-code) !important; color: #c9d1d9; }
.hljs-keyword { color: #ff7b72; }
.hljs-string { color: #a5d6ff; }
.hljs-comment { color: #8b949e; font-style: italic; }
.hljs-function { color: #d2a8ff; }
.hljs-number { color: #79c0ff; }
.hljs-attr { color: #79c0ff; }
.hljs-built_in { color: #ffa657; }
.hljs-title { color: #d2a8ff; }
.hljs-type { color: #ffa657; }
.hljs-literal { color: #79c0ff; }
.hljs-meta { color: #8b949e; }
.hljs-tag { color: #7ee787; }
.hljs-name { color: #7ee787; }
.hljs-attribute { color: #79c0ff; }
.hljs-selector-class { color: #7ee787; }
.hljs-selector-tag { color: #ff7b72; }
.hljs-deletion { color: #ffdcd7; background: #3d1114; }
.hljs-addition { color: #aff5b4; background: #113417; }

/* Blockquotes */
blockquote {
  border-left: 3px solid var(--accent-green);
  margin: 1.5em 0;
  padding: 0.75em 1.25em;
  background: var(--bg-card);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
}

/* Horizontal rule */
hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 2em 0;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
}
th, td {
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  text-align: left;
}
th {
  background: var(--bg-card);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-green);
}
tr:nth-child(even) td { background: rgba(255,255,255,0.02); }

/* Images */
img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  margin: 1.5em 0;
}

/* Homepage cards */
.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.post-list li {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}
.post-list li:hover {
  border-color: var(--border-hover);
  box-shadow: 0 0 24px var(--accent-green-dim);
  background: #161616;
}

.post-meta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0 0 0.5em;
}

.post-list .post-link {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  display: block;
  margin-bottom: 0.4em;
  transition: color 0.2s;
}
.post-list .post-link:hover {
  color: var(--accent-green);
}

.post-list .post-excerpt {
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin: 0.4em 0;
  line-height: 1.6;
}

.post-list .post-tags {
  margin-top: 0.75em;
}

/* Tags */
.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent-green);
  background: var(--accent-green-dim);
  padding: 2px 10px;
  border-radius: 4px;
  margin-right: 6px;
  margin-bottom: 4px;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}
.tag:hover {
  background: var(--accent-green);
  color: #000;
}

/* Post header */
.post-header {
  margin-bottom: 2em;
}
.post-header .post-title {
  font-family: var(--font-mono);
  font-size: 2rem;
  color: #fff;
  margin: 0 0 0.3em;
  border: none;
  line-height: 1.3;
}

/* Read more */
.read-more {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent-green);
  text-decoration: none;
  display: inline-block;
  margin-top: 0.75em;
}
.read-more:hover {
  text-shadow: 0 0 10px var(--accent-green-dim);
}
.read-more::after {
  content: " →";
}

/* TOC */
#markdown-toc, .toc {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1em 1.5em;
  margin: 1.5em 0;
  list-style: none;
}
#markdown-toc ul, .toc ul {
  list-style: none;
  padding-left: 1.5em;
  margin: 0.3em 0;
}
#markdown-toc li, .toc li { margin: 0.3em 0; }
#markdown-toc a, .toc a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  text-decoration: none;
}
#markdown-toc a:hover, .toc a:hover { color: var(--accent-cyan); }

/* Post navigation */
.post_navi {
  display: flex;
  gap: 20px;
  margin: 2em 0;
}
.post_navi-item {
  flex: 1;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: border-color 0.25s, background 0.25s;
}
.post_navi-item:hover {
  border-color: var(--accent-green);
  background: rgba(57, 255, 20, 0.05);
}
.post_navi-arrow {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  color: var(--accent-green);
  margin-bottom: 4px;
}
.post_navi-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.post_navi-item span {
  font-size: 0.88rem;
  color: var(--text-primary);
  display: block;
  margin-top: 4px;
}
.nav_prev { text-align: left; }
.nav_next { text-align: right; }

/* Share buttons */
.share-links {
  margin: 1.5em 0;
  padding: 1em 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}
#share-buttons {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  vertical-align: middle;
}
#share-buttons > div {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; border-radius: 4px;
  transition: background 0.2s;
}
#share-buttons > div:hover { background: rgba(255,255,255,0.05); }
#share-buttons > div > svg { height: 16px; fill: #555; transition: fill 0.2s; }
#share-buttons > div.facebook:hover > svg { fill: var(--accent-cyan); }
#share-buttons > div.twitter:hover > svg { fill: var(--accent-green); }
#share-buttons > div.linkedin:hover > svg { fill: var(--accent-cyan); }
#share-buttons > div.gplus:hover > svg { fill: var(--accent-green); }
#share-buttons > div.mail:hover > svg { fill: var(--accent-cyan); }
#share-buttons > div.facebook > svg { height: 18px; }
#share-buttons > div.twitter > svg { height: 20px; }
#share-buttons > div.linkedin > svg { height: 19px; }

/* Archive page */
.archive-page h1 {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.3em;
}
.archive-page h3 {
  color: var(--accent-green);
  font-family: var(--font-mono);
  font-size: 1.1rem;
  margin-top: 1.5em;
}
.archive-page ul {
  list-style: none;
  padding: 0;
}
.archive-page ul li {
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.archive-page ul li a {
  color: var(--text-primary);
  font-size: 0.92rem;
  transition: color 0.2s;
}
.archive-page ul li a:hover { color: var(--accent-cyan); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-color);
  margin-top: 3em;
  padding: 1.5em 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
}

/* Content lists */
.post-content ul, .post-content ol { padding-left: 1.5em; }
.post-content li { margin: 0.4em 0; }

/* Responsive */
@media (max-width: 600px) {
  html { font-size: 15px; }
  .site-nav { float: none; margin-top: 10px; display: block; }
  .site-nav a:first-child { margin-left: 0; }
  .post-header .post-title { font-size: 1.5rem; }
  .post_navi { flex-direction: column; }
  .post-list { gap: 1rem; }
  .post-list li { padding: 1.25rem; }
}
