/* ─── Variables ─────────────────────────────────────────────────────────── */
:root {
  --bg:        #0d1117;
  --bg-2:      #161b22;
  --bg-3:      #21262d;
  --border:    #30363d;
  --text:      #c9d1d9;
  --text-muted:#8b949e;
  --accent:    #58a6ff;
  --accent-2:  #79c0ff;
  --green:     #56d364;
  --purple:    #bc8cff;
  --radius:    8px;
  --mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

/* ─── Reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

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

/* ─── Header & Nav ───────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 17, 23, 0.80);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav-container {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-title {
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--green);
  text-decoration: none;
  letter-spacing: 0.5px;
}

.site-title::before { content: '> '; color: var(--text-muted); }
.site-title::after  { content: '_'; animation: blink 1.1s step-end infinite; }

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.nav-links { display: flex; gap: 1.5rem; }

.nav-links a {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.18s;
}

.nav-links a:hover { color: var(--accent); }

/* ─── Main Content ───────────────────────────────────────────────────────── */
.main-content {
  max-width: 880px;
  margin: 0 auto;
  padding: 3rem 2rem 5rem;
}

/* ─── Typography ─────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  color: #e6edf3;
  font-weight: 600;
  line-height: 1.3;
  margin-top: 2.25rem;
  margin-bottom: 0.75rem;
}

h1 { font-size: 1.9rem; }

h2 {
  font-size: 1.4rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.4rem;
}

h3 { font-size: 1.15rem; color: var(--accent-2); }
h4 { font-size: 1rem;    color: var(--text-muted); }

p { margin-bottom: 1rem; }

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

strong { color: #e6edf3; }
em     { color: var(--text); }

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

/* ─── Lists ──────────────────────────────────────────────────────────────── */
ul, ol { padding-left: 1.75rem; margin-bottom: 1rem; }
li { margin-bottom: 0.35rem; }

/* ─── Code ───────────────────────────────────────────────────────────────── */
code {
  font-family: var(--mono);
  font-size: 0.875em;
  background: var(--bg-3);
  color: var(--accent-2);
  padding: 0.2em 0.45em;
  border-radius: 4px;
  border: 1px solid var(--border);
}

pre {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}

pre code { background: none; padding: 0; border: none; color: var(--text); }

/* ─── Blockquote ─────────────────────────────────────────────────────────── */
blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.75rem 1.25rem;
  margin: 1.75rem 0;
  background: var(--bg-2);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-muted);
}

/* ─── Images ─────────────────────────────────────────────────────────────── */
img {
  max-width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: block;
  margin: 1.5rem auto;
}

/* ─── Tables ─────────────────────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; margin: 1.75rem 0; font-size: 0.9rem; }

th {
  background: var(--bg-3);
  color: var(--accent);
  font-weight: 600;
  padding: 0.65rem 1rem;
  text-align: left;
  border: 1px solid var(--border);
}

td { padding: 0.55rem 1rem; border: 1px solid var(--border); }
tr:nth-child(even) td { background: var(--bg-2); }

/* ─── Hero (index page) ──────────────────────────────────────────────────── */
.hero {
  padding: 4rem 0 3rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3rem;
}

.hero-body {
  display: flex;
  align-items: center;
  gap: 3.5rem;
}

.hero-text { flex: 1; min-width: 0; }

.hero-photo { flex-shrink: 0; }

.avatar {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  margin: 0;
  display: block;
  transition: border-color 0.2s;
}

.avatar:hover { border-color: var(--accent); }

.hero-label {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--green);
  margin-bottom: 0.75rem;
}

.hero-name {
  font-size: 2.5rem;
  font-weight: 700;
  color: #e6edf3;
  margin: 0 0 0.5rem;
  line-height: 1.15;
}

.hero-role {
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.hero-bio {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 2rem;
}

.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

.btn-primary, .btn-ghost {
  display: inline-block;
  padding: 0.55rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: opacity 0.18s, transform 0.18s;
}

.btn-primary {
  background: var(--accent);
  color: #0d1117;
}

.btn-ghost {
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.btn-primary:hover, .btn-ghost:hover {
  opacity: 0.85;
  transform: translateY(-1px);
  text-decoration: none;
}

/* ─── Post Cards ─────────────────────────────────────────────────────────── */
.posts-header {
  margin-bottom: 2rem;
}

.posts-header h1 {
  margin-top: 0;
}

.post-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.post-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  transition: border-color 0.2s, transform 0.2s;
}

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

.post-card h2 {
  font-size: 1.15rem;
  margin: 0 0 0.4rem;
  border: none;
  padding: 0;
}

.post-card h2 a {
  color: #e6edf3;
  text-decoration: none;
}

.post-card h2 a:hover { color: var(--accent); }

.post-date {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.post-excerpt {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin: 0;
}

/* ─── Footer ─────────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
}

.footer-inner {
  max-width: 880px;
  margin: 0 auto;
  padding: 1.25rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--mono);
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .nav-container { padding: 0 1rem; }
  .main-content  { padding: 2rem 1rem 4rem; }
  .hero { padding: 2.5rem 0 2rem; }
  .hero-body { flex-direction: column-reverse; gap: 2rem; align-items: flex-start; }
  .hero-name { font-size: 1.9rem; }
  .avatar { width: 120px; height: 120px; }
  .nav-links a:not(:last-child) { display: none; }
  .footer-inner { flex-direction: column; gap: 0.4rem; text-align: center; }
}

/* ─── Rouge Syntax Highlighting ──────────────────────────────────────────── */
.highlight {
  background: #0d1117;
  border: 1px solid var(--border);
  color: #e6edf3;
  padding: 1.25rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1.5rem 0;
}
.highlight pre { margin: 0; }
.highlight .hll { background-color: #2a2f3a; }
.highlight .c   { color: #8b949e; font-style: italic; }
.highlight .err { color: #f85149; }
.highlight .k   { color: #ff7b72; }
.highlight .o   { color: #ff7b72; }
.highlight .p   { color: #c9d1d9; }
.highlight .cm  { color: #8b949e; font-style: italic; }
.highlight .cp  { color: #79c0ff; }
.highlight .c1  { color: #8b949e; font-style: italic; }
.highlight .cs  { color: #8b949e; font-style: italic; }
.highlight .gd  { color: #f85149; background-color: #491212; }
.highlight .ge  { font-style: italic; }
.highlight .gr  { color: #f85149; }
.highlight .gh  { color: #79c0ff; font-weight: bold; }
.highlight .gi  { color: #56d364; background-color: #122d12; }
.highlight .go  { color: #8b949e; }
.highlight .gp  { color: #79c0ff; font-weight: bold; }
.highlight .gs  { font-weight: bold; }
.highlight .gu  { color: #79c0ff; font-weight: bold; }
.highlight .gt  { color: #f85149; }
.highlight .kc  { color: #79c0ff; }
.highlight .kd  { color: #ff7b72; }
.highlight .kn  { color: #ff7b72; }
.highlight .kp  { color: #79c0ff; }
.highlight .kr  { color: #ff7b72; }
.highlight .kt  { color: #d2a8ff; }
.highlight .m   { color: #a5d6ff; }
.highlight .s   { color: #a5d6ff; }
.highlight .na  { color: #c9d1d9; }
.highlight .nb  { color: #c9d1d9; }
.highlight .nc  { color: #d2a8ff; }
.highlight .no  { color: #79c0ff; }
.highlight .nd  { color: #d2a8ff; }
.highlight .ne  { color: #f85149; }
.highlight .nf  { color: #d2a8ff; }
.highlight .nl  { color: #c9d1d9; }
.highlight .nn  { color: #d2a8ff; }
.highlight .nt  { color: #7ee787; }
.highlight .nv  { color: #79c0ff; }
.highlight .ow  { color: #ff7b72; }
.highlight .mi  { color: #a5d6ff; }
.highlight .mf  { color: #a5d6ff; }
.highlight .s2  { color: #a5d6ff; }
.highlight .s1  { color: #a5d6ff; }
.highlight .ss  { color: #79c0ff; }
.highlight .sr  { color: #79c0ff; }
.highlight .nf  { color: #d2a8ff; }
.highlight .fm  { color: #d2a8ff; }
.highlight .il  { color: #a5d6ff; }

/* ─── Utility ────────────────────────────────────────────────────────────── */
.center { display: block; margin: 0 auto; text-align: center; }
