/* Sprayberry Labs — blog
   Shared chrome + article typography. Loaded as a same-origin stylesheet
   (CSP style-src 'self'), so individual posts stay lean: they carry content,
   not 700 lines of duplicated CSS. Tokens + nav + footer match index.html. */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }

:root {
  --bg: #0b0f14;
  --bg-elev: #0f141b;
  --text: #e8edf3;
  --text-dim: #8b95a5;
  --text-muted: #758196;
  --accent: #a78bfa;
  --accent-bright: #c084fc;
  --accent-glow: rgba(139, 92, 246, 0.15);
  --rule: rgba(139, 149, 165, 0.14);
  --rule-strong: rgba(139, 92, 246, 0.35);
  --code-bg: rgba(15, 20, 27, 0.85);
  --mono: ui-monospace, 'SF Mono', 'Cascadia Code', 'Roboto Mono', Menlo, Consolas, monospace;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--rule) 1px, transparent 1px),
    linear-gradient(90deg, var(--rule) 1px, transparent 1px);
  background-size: 56px 56px;
  background-position: -1px -1px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 35%, black 30%, transparent 75%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  top: -200px;
  right: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent-glow), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ── nav ───────────────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  font-size: 0.85rem;
  background: rgba(11, 15, 20, 0.78);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--rule);
}

.nav .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  text-decoration: none;
}

.nav .brand svg { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 22px;
  margin: 0 auto;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.06em;
  transition: color 200ms;
}

.nav-links a:hover { color: var(--accent-bright); }
.nav-links a[aria-current="page"] { color: var(--accent-bright); }

.nav .cta-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  color: var(--accent-bright);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  background: rgba(139, 92, 246, 0.05);
  transition: background 200ms, color 200ms;
}

.nav .cta-pill:hover { background: var(--accent); color: #0a0a0f; }

/* ── layout ────────────────────────────────────────────────────────── */
main {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 32px 80px;
  animation: rise 700ms cubic-bezier(.2,.8,.2,1);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.eyebrow {
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 0 0 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.eyebrow::before {
  content: '';
  width: 28px;
  height: 1px;
  background: var(--accent);
}

/* ── blog index: post list ─────────────────────────────────────────── */
.index-lede {
  font-size: clamp(1.02rem, 2vw, 1.18rem);
  line-height: 1.55;
  color: var(--text-dim);
  max-width: 620px;
  margin: 0 0 48px;
}

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

.post-list li { border-top: 1px solid var(--rule); }
.post-list li:last-child { border-bottom: 1px solid var(--rule); }

.post-link {
  display: block;
  padding: 26px 0;
  text-decoration: none;
  transition: padding-left 200ms;
}

.post-link:hover { padding-left: 8px; }

.post-link .post-meta {
  font-size: 0.74rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.post-link .post-meta .tag { color: var(--accent); }

.post-link .post-title {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text);
  margin: 0 0 10px;
  transition: color 200ms;
}

.post-link:hover .post-title { color: var(--accent-bright); }

.post-link .post-excerpt {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text-dim);
  margin: 0;
  max-width: 640px;
}

.empty-note {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 32px 0 0;
}

/* ── article ───────────────────────────────────────────────────────── */
.article-meta {
  font-size: 0.74rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.article-meta .tag { color: var(--accent); }

article h1 {
  font-size: clamp(1.9rem, 5vw, 2.9rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
  color: var(--text);
  margin: 0 0 22px;
}

article .standfirst {
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  line-height: 1.55;
  color: var(--text-dim);
  margin: 0 0 14px;
}

article .byline {
  font-size: 0.82rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin: 0 0 36px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--rule);
}

article .byline a { color: var(--text-dim); text-decoration: none; border-bottom: 1px dashed var(--rule); }
article .byline a:hover { color: var(--accent-bright); border-color: var(--accent); }

.prose { font-size: 1.02rem; line-height: 1.72; color: var(--text); }

.prose > p { margin: 0 0 22px; color: var(--text); }

.prose h2 {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text);
  margin: 44px 0 16px;
  scroll-margin-top: 80px;
}

.prose h3 {
  font-size: 1.12rem;
  font-weight: 600;
  color: var(--text);
  margin: 32px 0 12px;
}

.prose a {
  color: var(--accent-bright);
  text-decoration: none;
  border-bottom: 1px dashed var(--rule-strong);
  transition: color 200ms, border-color 200ms;
}

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

.prose strong { color: var(--text); font-weight: 700; }

.prose ul, .prose ol { margin: 0 0 22px; padding-left: 4px; }

.prose li {
  list-style: none;
  position: relative;
  padding: 5px 0 5px 24px;
  color: var(--text-dim);
  line-height: 1.6;
}

.prose ul li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 13px;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--accent);
  border-bottom: 1.5px solid var(--accent);
  transform: rotate(-45deg);
}

.prose ol { counter-reset: item; }
.prose ol li { counter-increment: item; }
.prose ol li::before {
  content: counter(item);
  position: absolute;
  left: 0;
  top: 5px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.prose code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--code-bg);
  border: 1px solid var(--rule);
  border-radius: 5px;
  padding: 1px 6px;
  color: var(--accent-bright);
  word-break: break-word;
}

.prose pre {
  background: var(--code-bg);
  border: 1px solid var(--rule);
  border-left: 2px solid var(--accent);
  border-radius: 8px;
  padding: 18px 20px;
  overflow-x: auto;
  margin: 0 0 24px;
  font-size: 0.84rem;
  line-height: 1.6;
}

.prose pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text);
  font-size: inherit;
  word-break: normal;
}

.prose blockquote {
  margin: 0 0 24px;
  padding: 4px 18px;
  border-left: 2px solid var(--accent);
  background: rgba(139, 92, 246, 0.04);
  border-radius: 0 6px 6px 0;
  color: var(--text-dim);
}

.prose blockquote p { margin: 14px 0; }

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

/* post footer — back link + soft CTA back to the studio funnel */
.post-foot {
  margin: 56px 0 0;
  padding-top: 32px;
  border-top: 1px solid var(--rule);
}

.post-foot .cta-card {
  padding: 24px 26px;
  border: 1px solid var(--rule-strong);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.04), rgba(15, 20, 27, 0.7) 60%);
}

.post-foot .cta-card p {
  margin: 0 0 16px;
  color: var(--text-dim);
  font-size: 0.95rem;
  line-height: 1.55;
}

.post-foot .cta-card .cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  background: var(--accent);
  color: #0a0a0f;
  font-weight: 600;
  text-decoration: none;
  border-radius: 8px;
  font-size: 0.92rem;
  transition: background 200ms;
}

.post-foot .cta-card .cta:hover { background: var(--accent-bright); }

.post-foot .cta-card .cta-sub {
  margin: 0 0 16px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.post-foot .cta-card .cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.post-foot .cta-card .cta-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  background: transparent;
  color: var(--accent-bright);
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  font-size: 0.92rem;
  transition: background 200ms, border-color 200ms, color 200ms;
}

.post-foot .cta-card .cta-secondary:hover {
  background: var(--accent-glow);
  border-color: var(--accent);
  color: var(--accent-bright);
}

.back-link {
  display: inline-block;
  margin: 28px 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: color 200ms;
}

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

/* ── footer ────────────────────────────────────────────────────────── */
footer {
  position: relative;
  z-index: 2;
  padding: 24px 32px;
  border-top: 1px solid var(--rule);
  color: var(--text-muted);
  font-size: 0.78rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

footer .copy { letter-spacing: 0.05em; }
footer .meta { letter-spacing: 0.12em; text-transform: uppercase; }
footer .links { display: flex; gap: 18px; }
footer .links a {
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.06em;
  transition: color 200ms;
}
footer .links a:hover { color: var(--accent-bright); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 10px 16px;
  background: var(--accent);
  color: #0a0a0f;
  font-weight: 600;
  border-radius: 0 0 8px 0;
  text-decoration: none;
}
.skip-link:focus { left: 0; }

@media (max-width: 880px) {
  .nav-links { display: none; }
}

@media (max-width: 600px) {
  .nav { padding: 14px 20px; }
  main { padding: 32px 20px 56px; }
  footer { padding: 18px 20px; font-size: 0.7rem; }
  .post-link .post-title { font-size: 1.2rem; }
}

@media (prefers-reduced-motion: reduce) {
  main { animation: none; }
  .post-link:hover { padding-left: 0; }
}
