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

:root {
  --bg:       #07080B;
  --surface:  #0f1117;
  --border:   #1e2029;
  --text:     #e8eaf0;
  --muted:    #6b7280;
  --accent:   #00ff87;
  --cyan:     #58c4ff;
  --font-display: 'Space Grotesk', sans-serif;
  --font-body:    'IBM Plex Sans', sans-serif;
  --font-mono:    'IBM Plex Mono', monospace;
  --wrap:     720px;
  --wrap-wide: 960px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

.blog-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .9rem 2rem;
  background: rgba(7,8,11,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.blog-header .logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -.01em;
}

.blog-header .logo span { color: var(--accent); }
.blog-header nav { display: flex; gap: 1.5rem; }

.blog-header nav a {
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: .04em;
  transition: color .2s;
}

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

.read-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: var(--accent);
  z-index: 200;
  transition: width .1s linear;
}

.blog-index {
  max-width: var(--wrap-wide);
  margin: 0 auto;
  padding: 4rem 2rem 6rem;
}

.blog-index-header {
  margin-bottom: 3rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.5rem;
}

.blog-index-header .eyebrow {
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--accent);
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: .5rem;
}

.blog-index-header h1 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.post-list { list-style: none; }

.post-list li {
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 0 1.5rem;
  align-items: start;
}

.post-list li:last-child { border-bottom: none; }

.post-date {
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--muted);
  padding-top: .3rem;
  white-space: nowrap;
}

.post-list h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: .5rem;
}

.post-list h2 a {
  color: var(--text);
  text-decoration: none;
  transition: color .2s;
}

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

.post-tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }

.post-tag {
  font-family: var(--font-mono);
  font-size: .68rem;
  color: var(--cyan);
  background: rgba(88,196,255,.08);
  border: 1px solid rgba(88,196,255,.2);
  padding: .15rem .55rem;
  border-radius: 4px;
  letter-spacing: .03em;
}

.excerpt {
  font-size: .9rem;
  color: var(--muted);
  margin-top: .4rem;
  line-height: 1.6;
}

.article-wrap {
  position: relative;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 4rem 2rem 6rem;
}

.article-wrap::before {
  content: '';
  position: fixed;
  left: max(1rem, calc(50% - var(--wrap)/2 - 2.5rem));
  top: 60px;
  bottom: 0;
  width: 2px;
  background: var(--border);
  pointer-events: none;
}

.article-wrap::after {
  content: '';
  position: fixed;
  left: max(1rem, calc(50% - var(--wrap)/2 - 2.5rem));
  top: 60px;
  width: 2px;
  height: var(--read-pct, 0%);
  background: var(--accent);
  pointer-events: none;
  transition: height .1s linear;
}

.article-eyebrow {
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--accent);
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: .75rem;
  display: flex;
  align-items: center;
  gap: .75rem;
}

.article-eyebrow::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 1px;
  background: var(--accent);
}

article h1 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.02em;
  color: var(--text);
  margin-bottom: 1rem;
}

.post-meta {
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem .75rem;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.post-meta .post-tag { margin: 0; }

article p {
  margin-bottom: 1.25rem;
  font-size: 1rem;
  color: #c8ccd8;
  line-height: 1.8;
}

article h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin: 2.5rem 0 .75rem;
  letter-spacing: -.01em;
}

article h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin: 2rem 0 .5rem;
}

article ul, article ol {
  margin: 0 0 1.25rem 1.25rem;
  color: #c8ccd8;
}

article li { margin-bottom: .4rem; line-height: 1.7; }
article strong { color: var(--text); font-weight: 600; }

article a {
  color: var(--cyan);
  text-decoration: none;
  border-bottom: 1px solid rgba(88,196,255,.3);
  transition: border-color .2s, color .2s;
}

article a:hover { color: var(--accent); border-color: var(--accent); }

article code {
  font-family: var(--font-mono);
  font-size: .85em;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: .1em .4em;
  border-radius: 4px;
  color: var(--cyan);
}

article pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}

article pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: .85rem;
  color: var(--text);
}

article blockquote {
  border-left: 3px solid var(--accent);
  margin: 1.5rem 0;
  padding: .75rem 1.25rem;
  background: rgba(0,255,135,.04);
  border-radius: 0 6px 6px 0;
  color: var(--muted);
  font-style: italic;
}

article table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: .9rem; }
article th {
  font-family: var(--font-mono);
  font-size: .75rem;
  text-align: left;
  padding: .6rem 1rem;
  border-bottom: 2px solid var(--border);
  color: var(--muted);
  letter-spacing: .05em;
  text-transform: uppercase;
}
article td { padding: .6rem 1rem; border-bottom: 1px solid var(--border); color: #c8ccd8; }
article tr:last-child td { border-bottom: none; }

.cta-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  font-size: .92rem;
  color: var(--muted);
  line-height: 1.65;
}

.cta-box a { color: var(--accent); border-color: rgba(0,255,135,.3); font-weight: 500; }
.cta-box a:hover { color: var(--text); }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 2rem;
  letter-spacing: .03em;
  transition: color .2s;
}

.back-link:hover { color: var(--accent); }
.back-link::before { content: '←'; }

.blog-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 2rem;
  text-align: center;
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--muted);
}

.blog-footer a { color: var(--muted); text-decoration: none; transition: color .2s; }
.blog-footer a:hover { color: var(--accent); }

@media (max-width: 768px) {
  .blog-header { padding: .75rem 1.25rem; }
  .blog-index, .article-wrap { padding: 2.5rem 1.25rem 4rem; }
  .post-list li { grid-template-columns: 1fr; gap: .25rem; }
  .post-date { margin-bottom: .25rem; }
  .article-wrap::before, .article-wrap::after { display: none; }
}

@media (max-width: 480px) {
  .blog-header nav { gap: 1rem; }
  article h1 { font-size: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
