/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0d0f14;
  --bg-card:   #12151c;
  --bg-code:   #0a0c10;
  --border:    #1e2330;
  --text:      #c9d1e0;
  --text-dim:  #6b7a96;
  --text-head: #e8edf5;
  --accent:    #00d4a8;
  --accent2:   #4d9fff;
  --red:       #ff4757;
  --yellow:    #ffd32a;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --font-body: 'Inter', system-ui, sans-serif;
}

html { scroll-behavior: smooth; }

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

/* === LAYOUT === */
.container { max-width: 820px; margin: 0 auto; padding: 0 24px; }

/* === HEADER === */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
  position: sticky;
  top: 0;
  background: rgba(13,15,20,0.95);
  backdrop-filter: blur(10px);
  z-index: 100;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.logo-bracket { color: var(--accent); }

.logo-cursor {
  color: var(--accent);
  animation: blink 1.2s step-end infinite;
}

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

.site-nav { display: flex; gap: 28px; }

.site-nav a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: color 0.2s;
}

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

/* === MAIN === */
.site-main { flex: 1; padding: 60px 0; }

/* === HOMEPAGE === */
.site-hero { margin-bottom: 64px; }

.hero-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 16px;
  display: block;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 600;
  color: var(--text-head);
  line-height: 1.2;
  margin-bottom: 20px;
}

.hero-title .highlight { color: var(--accent); }

.hero-desc {
  font-size: 1.05rem;
  color: var(--text-dim);
  max-width: 520px;
  line-height: 1.7;
}

.hero-terminal {
  margin-top: 32px;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 24px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  max-width: 480px;
}

.terminal-line { display: flex; gap: 10px; margin-bottom: 6px; }
.terminal-line:last-child { margin-bottom: 0; }
.t-prompt { color: var(--accent); }
.t-cmd { color: var(--text); }
.t-out { color: var(--text-dim); padding-left: 20px; }

/* === POST LIST === */
.posts-section h2 {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.post-card {
  display: block;
  padding: 28px;
  margin-bottom: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  transition: border-color 0.2s, transform 0.2s;
  position: relative;
  overflow: hidden;
}

.post-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.2s;
}

.post-card:hover { border-color: #2a3040; transform: translateX(3px); }
.post-card:hover::before { opacity: 1; }

.card-date {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 1px;
  margin-bottom: 8px;
  display: block;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-head);
  margin-bottom: 8px;
  line-height: 1.4;
}

.card-excerpt {
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.6;
}

.card-tags { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px; }

.tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  background: rgba(0,212,168,0.08);
  color: var(--accent);
  border: 1px solid rgba(0,212,168,0.2);
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

/* === POST PAGE === */
.post-header { margin-bottom: 48px; }

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

.post-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  letter-spacing: 1px;
}

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

.post-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  color: var(--text-head);
  line-height: 1.25;
  margin-bottom: 12px;
}

.post-subtitle {
  font-size: 1.1rem;
  color: var(--text-dim);
  line-height: 1.6;
}

/* === POST CONTENT === */
.post-content { max-width: 720px; }

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4 {
  color: var(--text-head);
  font-weight: 600;
  margin-top: 2.5em;
  margin-bottom: 0.75em;
  line-height: 1.3;
}

.post-content h2 {
  font-size: 1.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.4em;
}

.post-content h3 { font-size: 1.2rem; color: var(--accent); }
.post-content h4 { font-size: 1rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; font-family: var(--font-mono); }

.post-content p { margin-bottom: 1.4em; }

.post-content a { color: var(--accent2); text-decoration: none; border-bottom: 1px solid rgba(77,159,255,0.3); transition: border-color 0.2s; }
.post-content a:hover { border-color: var(--accent2); }

.post-content strong { color: var(--text-head); font-weight: 600; }
.post-content em { color: var(--yellow); font-style: normal; }

.post-content ul, .post-content ol {
  padding-left: 1.5em;
  margin-bottom: 1.4em;
}

.post-content li { margin-bottom: 0.4em; }

.post-content ul li::marker { color: var(--accent); }

.post-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 12px 20px;
  margin: 24px 0;
  background: rgba(0,212,168,0.05);
  border-radius: 0 6px 6px 0;
  color: var(--text-dim);
  font-style: italic;
}

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

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

.post-content pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  overflow-x: auto;
  margin: 24px 0;
  position: relative;
}

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

.post-content img {
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin: 24px 0;
  display: block;
}

.post-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 40px 0;
}

/* === POST FOOTER === */
.post-footer { margin-top: 64px; padding-top: 32px; border-top: 1px solid var(--border); }

.back-link {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s;
}

.back-link:hover { color: var(--accent); }

/* === FOOTER === */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
}

.site-footer .container {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.footer-sep { color: var(--accent); }

/* === RESPONSIVE === */
@media (max-width: 600px) {
  .site-nav { gap: 16px; }
  .post-card { padding: 20px; }
}

/* === SYNTAX HIGHLIGHTING === */
.highlight .k, .highlight .kd, .highlight .kn { color: #c792ea; }
.highlight .s, .highlight .s1, .highlight .s2 { color: #c3e88d; }
.highlight .c, .highlight .c1, .highlight .cm { color: #546e7a; font-style: italic; }
.highlight .n { color: #82aaff; }
.highlight .nv { color: #f07178; }
.highlight .mi, .highlight .mf { color: #f78c6c; }
.highlight .nt { color: var(--accent); }
.highlight .na { color: var(--accent2); }
