:root {
  --bg: #08080a;
  --bg-1: #0c0c0f;
  --bg-2: #111114;
  --bg-3: #16161a;
  --surface: #131318;
  --surface-2: #1a1a20;
  --border: #1f1f25;
  --border-2: #292932;
  --border-strong: #3a3a44;
  --text: #f3f3f5;
  --text-2: #a8a8b3;
  --text-3: #6a6a75;
  --text-4: #4a4a52;
  --accent: #a78bfa;
  --accent-bright: #c4b5fd;
  --accent-deep: #7c3aed;
  --accent-glow: rgba(167, 139, 250, 0.18);
  --green: #34d399;
  --amber: #fbbf24;
  --red: #f87171;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
::selection { background: var(--accent-deep); color: #fff; }
html, body { background: var(--bg); color: var(--text); font-family: 'Inter', -apple-system, sans-serif; font-size: 16px; line-height: 1.7; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-bright); text-decoration: underline; text-underline-offset: 3px; }
body::before { content: ''; position: fixed; inset: -20%; background: radial-gradient(ellipse 40% 40% at 20% 0%, var(--accent-glow), transparent 60%); filter: blur(40px); pointer-events: none; z-index: 0; }
body::after { content: ''; position: fixed; inset: 0; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.04 0'/></filter><rect width='200' height='200' filter='url(%23n)'/></svg>"); opacity: 0.35; pointer-events: none; z-index: 0; mix-blend-mode: overlay; }

.nav { position: sticky; top: 0; z-index: 50; background: rgba(8,8,10,0.78); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.nav-inner { max-width: 1200px; margin: 0 auto; padding: 14px 28px; display: flex; align-items: center; gap: 32px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 32px; height: 32px; background: var(--text); border-radius: 8px; display: flex; align-items: center; justify-content: center; transition: background 200ms, transform 280ms; }
.brand-mark span { font-family: 'Instrument Serif', serif; font-style: italic; color: var(--bg); font-size: 19px; line-height: 1; }
.brand:hover .brand-mark { background: var(--accent); transform: rotate(-4deg); }
.brand:hover .brand-mark span { color: #fff; }
.brand-name { font-family: 'Instrument Serif', serif; font-size: 20px; color: var(--text); }
.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-links a { padding: 8px 14px; border-radius: 6px; color: var(--text-2); font-size: 14px; transition: color 200ms, background 200ms; text-decoration: none; }
.nav-links a:hover, .nav-links a.active { color: var(--text); background: var(--surface); }
.nav-cta { padding: 8px 16px; border-radius: 6px; background: var(--accent); color: var(--bg) !important; font-size: 13px; font-weight: 500; transition: background 200ms; }
.nav-cta:hover { background: var(--accent-bright); }

.page { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; padding: 56px 28px 96px; }
.page.wide { max-width: 1080px; }

/* Article hero */
.eyebrow { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--accent); letter-spacing: 0.22em; text-transform: uppercase; margin-bottom: 24px; }
h1.title { font-family: 'Instrument Serif', serif; font-size: 56px; line-height: 1.05; font-weight: 400; letter-spacing: -0.02em; margin-bottom: 20px; }
.lede { font-size: 19px; color: var(--text-2); margin-bottom: 28px; line-height: 1.55; font-weight: 300; max-width: 700px; }
.meta-row { display: flex; gap: 14px; align-items: center; padding: 16px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin-bottom: 48px; font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text-3); letter-spacing: 0.06em; }
.meta-row span:not(:last-child)::after { content: '·'; color: var(--text-4); margin-left: 14px; }
.meta-row .tag { color: var(--accent); }

/* Article body */
article h2 { font-family: 'Instrument Serif', serif; font-size: 34px; font-weight: 400; margin: 56px 0 14px; letter-spacing: -0.01em; }
article h2::before { content: '§ '; color: var(--accent); font-weight: 400; }
article h3 { font-family: 'Instrument Serif', serif; font-size: 22px; font-weight: 400; margin: 36px 0 10px; }
article h4 { font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); margin: 32px 0 12px; }
article p { color: var(--text-2); margin-bottom: 18px; }
article p strong { color: var(--text); font-weight: 500; }
article p em { color: var(--accent-bright); font-style: italic; }
article ul, article ol { color: var(--text-2); margin: 14px 0 22px 24px; }
article li { margin-bottom: 8px; }
article li::marker { color: var(--text-4); }
article blockquote { border-left: 2px solid var(--accent); padding: 4px 0 4px 22px; margin: 24px 0; color: var(--text); font-style: italic; font-family: 'Instrument Serif', serif; font-size: 21px; line-height: 1.5; }
article p code, article li code, article td code { font-family: 'JetBrains Mono', monospace; font-size: 13px; background: var(--surface); border: 1px solid var(--border); padding: 2px 7px; border-radius: 4px; color: var(--accent); }
article pre { background: #07070a; border: 1px solid var(--border-2); border-radius: 8px; padding: 18px 22px; overflow-x: auto; margin: 18px 0 30px; font-family: 'JetBrains Mono', monospace; font-size: 13px; line-height: 1.6; }
article pre code { color: var(--text-2); background: none; border: none; padding: 0; font-size: 13px; }

article table { width: 100%; border-collapse: collapse; margin: 22px 0 32px; font-size: 14px; }
article th { font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-3); font-weight: 500; text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--border-2); background: var(--surface); }
article td { padding: 12px 16px; color: var(--text-2); border-bottom: 1px solid var(--border); vertical-align: top; }
article td:first-child { color: var(--text); }
article td.green { color: var(--green); }
article td.red { color: var(--red); }

.note { display: grid; grid-template-columns: 60px 1fr; gap: 20px; padding: 18px 22px; margin: 28px 0; border-left: 2px solid var(--accent); background: linear-gradient(90deg, var(--accent-glow), transparent 60%); border-radius: 0 8px 8px 0; }
.note .tag { font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent); padding-top: 4px; }
.note p { color: var(--text-2); font-size: 15px; margin: 0; }
.note.warn { border-color: var(--amber); background: linear-gradient(90deg, rgba(251,191,36,0.06), transparent 60%); }
.note.warn .tag { color: var(--amber); }

.cta-card { margin: 56px 0 48px; padding: 32px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; text-align: center; }
.cta-card .h { font-family: 'Instrument Serif', serif; font-size: 28px; font-weight: 400; margin-bottom: 8px; letter-spacing: -0.01em; }
.cta-card p { color: var(--text-2); font-size: 15px; margin-bottom: 22px; }
.cta-card .actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.cta-card a { padding: 10px 18px; border-radius: 6px; font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; transition: all 200ms; text-decoration: none; }
.cta-card a.primary { background: var(--accent); color: var(--bg); }
.cta-card a.primary:hover { background: var(--accent-bright); color: var(--bg); }
.cta-card a.ghost { color: var(--text-2); border: 1px solid var(--border-2); }
.cta-card a.ghost:hover { color: var(--text); border-color: var(--border-strong); }

.related { margin-top: 64px; padding-top: 32px; border-top: 1px solid var(--border); }
.related h4 { font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-3); margin-bottom: 18px; }
.related-list { display: grid; gap: 12px; }
.related-list a { display: block; padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; transition: border-color 200ms, background 200ms; color: var(--text); text-decoration: none; }
.related-list a:hover { border-color: var(--accent); background: var(--bg-3); text-decoration: none; }
.related-list a .t { font-family: 'Instrument Serif', serif; font-size: 19px; line-height: 1.3; color: var(--text); }
.related-list a:hover .t { color: var(--accent-bright); }
.related-list a .d { font-size: 13px; color: var(--text-3); margin-top: 6px; }

.footer { margin-top: 96px; padding-top: 28px; border-top: 1px solid var(--border); font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text-3); letter-spacing: 0.12em; text-transform: uppercase; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer a:hover { color: var(--text-2); }

/* Blog index layout */
.posts { display: grid; gap: 14px; margin-top: 32px; }
.post-card { padding: 28px 32px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; transition: border-color 200ms, background 200ms; display: block; text-decoration: none; color: var(--text); }
.post-card:hover { border-color: var(--accent); background: var(--bg-3); text-decoration: none; }
.post-card .pc-eyebrow { font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.post-card .pc-title { font-family: 'Instrument Serif', serif; font-size: 28px; line-height: 1.15; letter-spacing: -0.01em; margin-bottom: 8px; }
.post-card:hover .pc-title { color: var(--accent-bright); }
.post-card .pc-desc { color: var(--text-2); font-size: 14px; margin-bottom: 14px; line-height: 1.55; }
.post-card .pc-meta { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--text-3); letter-spacing: 0.08em; }

@media (max-width: 720px) {
  .page { padding: 32px 20px 64px; }
  h1.title { font-size: 38px; }
  article h2 { font-size: 26px; }
  .nav-links a:not(.nav-cta) { display: none; }
}
