:root {
  --bg: #05070f;
  --surface: rgba(255,255,255,0.03);
  --border: rgba(255,255,255,0.12);
  --text: rgba(255,255,255,0.92);
  --text-dim: rgba(255,255,255,0.65);
  --text-faint: rgba(255,255,255,0.45);
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .logo-mark {
  font-family: 'Space Grotesk', 'Plus Jakarta Sans', sans-serif;
  letter-spacing: -0.02em;
  color: #fff;
  line-height: 1.15;
}

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

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Ambient particle background (lightweight canvas 2D, replaces the
   homepage's WebGL scene for these fast, content-first pages) */
#blog-particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* Floating glass topbar dock — matches the homepage exactly */
#main-header {
  position: fixed;
  top: 24px;
  left: 0;
  right: 0;
  z-index: 9999999;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  pointer-events: none;
  padding: 0 16px;
}
.verity-glass-circle-btn,
.verity-topbar-dock {
  background: rgba(255, 255, 255, 0.05);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.4), 0 20px 50px rgba(0, 0, 0, 0.5);
  border-radius: 9999px;
  pointer-events: auto;
  position: relative;
  z-index: 99999999;
  flex-shrink: 0;
}
.verity-topbar-dock {
  width: fit-content;
  max-width: 94vw;
  padding: 10px 32px;
  display: flex;
  align-items: center;
}
.verity-glass-circle-btn {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.28);
  opacity: 0.8;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.verity-glass-circle-btn:hover { opacity: 1; }
.verity-glass-circle-btn:active { transform: scale(0.95); }
#theme-icon-sun { color: #fff; fill: #fff; width: 20px; height: 20px; }
#theme-icon-moon { color: #0f172a; fill: #0f172a; width: 20px; height: 20px; }
.hidden { display: none !important; }

@media (max-width: 768px) {
  #main-header { top: 14px; }
  .verity-glass-circle-btn { width: 36px; height: 36px; }
  .verity-topbar-dock { padding: 8px 20px; }
}

nav.site-nav a {
  color: var(--text-dim);
  font-size: 13px;
  font-family: monospace;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-left: 20px;
}
nav.site-nav a:hover { color: #fff; }

main {
  position: relative;
  z-index: 1;
  padding: 140px 0 96px;
}

.eyebrow {
  font-family: monospace;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin: 0 0 12px;
}

h1.post-title {
  font-size: clamp(28px, 5vw, 44px);
  margin: 0 0 16px;
}

.post-meta {
  font-size: 13px;
  color: var(--text-faint);
  font-family: monospace;
  margin: 0 0 32px;
}

.post-hero {
  width: 100%;
  aspect-ratio: 16 / 8;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  overflow: hidden;
  margin: 0 0 40px;
  display: block;
}
.post-hero svg { width: 100%; height: 100%; display: block; }

.inline-figure {
  width: 100%;
  aspect-ratio: 16 / 7;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  margin: 36px 0;
  display: block;
}
.inline-figure svg { width: 100%; height: 100%; display: block; }
.figure-caption {
  font-family: monospace;
  font-size: 12px;
  color: var(--text-faint);
  text-align: center;
  margin: -28px 0 22px;
}

.post-body p {
  font-size: 17px;
  color: var(--text-dim);
  margin: 0 0 22px;
}

.post-body h2 {
  font-size: 26px;
  margin: 48px 0 16px;
}

.post-body h3 {
  font-size: 20px;
  margin: 32px 0 12px;
  color: #fff;
}

.post-body ul, .post-body ol {
  color: var(--text-dim);
  font-size: 17px;
  padding-left: 22px;
  margin: 0 0 22px;
}
.post-body li { margin-bottom: 8px; }

.post-body strong { color: #fff; font-weight: 600; }

blockquote {
  border-left: 3px solid var(--accent);
  margin: 32px 0;
  padding: 4px 0 4px 20px;
  color: #fff;
  font-size: 19px;
  font-style: italic;
}

.related-reading {
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.related-heading {
  font-family: monospace;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  margin: 0 0 16px;
}
.related-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.related-list a {
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
}
body.light-mode .related-list a { color: #0f172a; }
.related-list a:hover { color: var(--accent); }

.cta-box {
  margin-top: 56px;
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  text-align: center;
}
.cta-box h3 { margin: 0 0 8px; font-size: 22px; }
.cta-box p { color: var(--text-dim); margin: 0 0 20px; font-size: 15px; }
.cta-btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 12px 28px;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 14px;
}
.cta-btn:hover { background: var(--accent-hover); color: #fff; }

.blog-index-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.blog-index-list li {
  border-bottom: 1px solid var(--border);
  padding: 28px 0;
}
.blog-index-list li:first-child { padding-top: 0; }
.blog-index-list a.post-link {
  color: #fff;
  font-size: 22px;
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
}
.blog-index-list a.post-link:hover { color: var(--accent); }
.blog-index-list p {
  color: var(--text-dim);
  font-size: 15px;
  margin: 10px 0 0;
}

footer.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 32px 0;
  text-align: center;
  color: var(--text-faint);
  font-size: 13px;
}
footer.site-footer a { color: var(--text-dim); }

@media (max-width: 640px) {
  nav.site-nav a { margin-left: 12px; font-size: 11px; }
  main { padding: 110px 0 64px; }
}

/* ---------- Light mode ---------- */
body.light-mode {
  --bg: #fafafa;
  --surface: rgba(15,23,42,0.04);
  --border: rgba(15,23,42,0.12);
  --text: rgba(15,23,42,0.92);
  --text-dim: rgba(15,23,42,0.68);
  --text-faint: rgba(15,23,42,0.48);
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
}
body.light-mode h1, body.light-mode h2, body.light-mode h3, body.light-mode h4 { color: #0f172a; }
body.light-mode .post-body h3 { color: #0f172a; }
body.light-mode blockquote { color: #0f172a; }
body.light-mode .blog-index-list a.post-link { color: #0f172a; }
body.light-mode .post-body strong { color: #0f172a; }
body.light-mode .verity-glass-circle-btn,
body.light-mode .verity-topbar-dock {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(15, 23, 42, 0.18);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.8), 0 20px 40px rgba(0, 0, 0, 0.06);
}
body.light-mode .logo svg path,
body.light-mode svg.logo path {
  fill: #0f172a;
}
body.light-mode #theme-icon-moon { fill: #0f172a; color: #0f172a; }
