:root {
  --bg: #0d1117;
  --bg-soft: #161b22;
  --bg-code: #010409;
  --border: #30363d;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --accent: #58a6ff;
  --accent-2: #3fb950;
  --warning: #d29922;
  --danger: #f85149;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", Helvetica, Arial, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ---------- Top nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 17, 23, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand::before {
  content: "$";
  color: var(--accent-2);
}

.nav-links {
  display: flex;
  gap: 24px;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.92rem;
  transition: color 0.15s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  text-decoration: none;
}

.nav-links a.active {
  border-bottom: 2px solid var(--accent);
  padding-bottom: 2px;
}

/* ---------- Layout ---------- */
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Hero ---------- */
.hero {
  padding: 72px 0 48px;
  border-bottom: 1px solid var(--border);
}

.hero h1 {
  font-size: 2.4rem;
  line-height: 1.25;
  margin-bottom: 16px;
}

.hero h1 .hl {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero .tagline {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 640px;
}

.hero .terminal-card {
  margin-top: 36px;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 0.85rem;
}

.terminal-bar {
  display: flex;
  gap: 6px;
  padding: 10px 14px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
}

.terminal-bar i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.terminal-bar i:nth-child(1) { background: #ff5f56; }
.terminal-bar i:nth-child(2) { background: #ffbd2e; }
.terminal-bar i:nth-child(3) { background: #27c93f; }

.terminal-body {
  padding: 16px 18px;
  color: var(--text-muted);
  white-space: pre-wrap;
}

.terminal-body .cmd {
  color: var(--text);
}

.terminal-body .prompt {
  color: var(--accent-2);
}

.terminal-body .ok {
  color: var(--accent-2);
}

.terminal-body .warn {
  color: var(--warning);
}

/* ---------- Sections ---------- */
.section {
  padding: 48px 0;
}

.section h2 {
  font-size: 1.4rem;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section h2::before {
  content: "##";
  font-family: var(--mono);
  color: var(--accent-2);
  font-size: 1rem;
}

/* ---------- Post grid ---------- */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 20px;
}

.post-card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.15s, transform 0.15s;
}

.post-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.post-card .post-tag {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--accent);
  background: rgba(88, 166, 255, 0.12);
  padding: 2px 8px;
  border-radius: 4px;
  align-self: flex-start;
}

.post-card h3 {
  font-size: 1.05rem;
  line-height: 1.4;
}

.post-card h3 a {
  color: var(--text);
}

.post-card h3 a:hover {
  color: var(--accent);
  text-decoration: none;
}

.post-card .post-excerpt {
  color: var(--text-muted);
  font-size: 0.9rem;
  flex: 1;
}

.post-card .post-meta {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ---------- Post page ---------- */
.post-header {
  padding: 56px 0 32px;
  border-bottom: 1px solid var(--border);
}

.post-header h1 {
  font-size: 2rem;
  line-height: 1.3;
  margin-bottom: 14px;
}

.post-header .post-meta {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.post-header .post-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.post-content {
  padding: 40px 0 64px;
  max-width: 780px;
}

.post-content h2 {
  font-size: 1.4rem;
  margin: 36px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.post-content h3 {
  font-size: 1.15rem;
  margin: 28px 0 12px;
}

.post-content p {
  margin-bottom: 16px;
  color: #c9d1d9;
}

.post-content ul,
.post-content ol {
  margin: 0 0 16px 24px;
  color: #c9d1d9;
}

.post-content li {
  margin-bottom: 6px;
}

.post-content strong {
  color: var(--text);
}

.post-content blockquote {
  border-left: 3px solid var(--accent);
  background: var(--bg-soft);
  padding: 12px 16px;
  margin: 0 0 16px;
  color: var(--text-muted);
  border-radius: 0 6px 6px 0;
}

.post-content code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent-2);
}

.post-content pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
  margin: 0 0 16px;
  line-height: 1.55;
}

.post-content pre code {
  background: none;
  border: none;
  padding: 0;
  color: #c9d1d9;
  font-size: 0.85rem;
}

.post-content pre .cm {
  color: #8b949e;
}

.post-content pre .kw {
  color: #ff7b72;
}

.post-content pre .st {
  color: #a5d6ff;
}

.post-content pre .fn {
  color: #d2a8ff;
}

.post-content pre .co {
  color: #7ee787;
}

.post-content pre .pt {
  color: #ffa657;
}

/* TOC */
.toc {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 24px;
  font-size: 0.9rem;
}

.toc strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.toc ul {
  list-style: none;
  margin: 0;
}

.toc li {
  margin-bottom: 4px;
}

.toc a {
  color: var(--accent);
}

/* ---------- Callout ---------- */
.callout {
  border-radius: 8px;
  padding: 14px 18px;
  margin: 20px 0;
  font-size: 0.92rem;
  border-left: 3px solid;
}

.callout.info {
  background: rgba(88, 166, 255, 0.1);
  border-color: var(--accent);
  color: #c9d1d9;
}

.callout.warn {
  background: rgba(210, 153, 34, 0.1);
  border-color: var(--warning);
  color: #d29922;
}

.callout.danger {
  background: rgba(248, 81, 73, 0.1);
  border-color: var(--danger);
  color: #f85149;
}

.callout strong:first-child {
  display: block;
  margin-bottom: 4px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 40px;
  align-items: start;
}

.avatar-card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  text-align: center;
}

.avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 2rem;
  font-weight: 700;
  color: #0d1117;
  margin: 0 auto 16px;
}

.avatar-card h2 {
  font-size: 1.2rem;
  margin-bottom: 4px;
}

.avatar-card .role {
  color: var(--accent-2);
  font-family: var(--mono);
  font-size: 0.82rem;
  margin-bottom: 12px;
}

.avatar-card .bio {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.skill-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 16px;
}

.skill-list span {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font-family: var(--mono);
  font-size: 0.78rem;
  text-align: center;
  color: var(--text);
}

.about-text h2 {
  font-size: 1.3rem;
  margin: 28px 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.about-text h2::before {
  content: "//";
  font-family: var(--mono);
  color: var(--accent-2);
}

.about-text p {
  color: #c9d1d9;
  margin-bottom: 14px;
}

.about-text ul {
  margin: 0 0 14px 24px;
  color: #c9d1d9;
}

.about-text li {
  margin-bottom: 6px;
}

/* ---------- Tags cloud ---------- */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag-cloud a {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--text);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 20px;
  transition: border-color 0.15s, color 0.15s;
}

.tag-cloud a:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 40px;
}

.footer-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer .mono {
  font-family: var(--mono);
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .hero { padding: 48px 0 36px; }
  .hero h1 { font-size: 1.8rem; }
  .about-grid { grid-template-columns: 1fr; }
  .skill-list { grid-template-columns: repeat(2, 1fr); }
  .post-header h1 { font-size: 1.6rem; }
  .nav-links { gap: 14px; }
}

@media (max-width: 480px) {
  .skill-list { grid-template-columns: 1fr; }
  .brand span { display: none; }
}
