/* The design system (loaded first) supplies the colour tokens, Inter,
   and .btn / .input / .tag / .text-muted. This file adds only what a blog needs
   on top: the header and footer chrome the canvas draws with inline styles, the
   signup strip, and prose. Do not redefine a token here — change it in the
   canvas and both follow. */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--color-accent-200); }
a:hover { color: #fff; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 60;
  padding: 10px 16px; background: var(--color-surface);
  border: 1px solid var(--color-accent); border-radius: var(--radius-sm);
  color: var(--color-accent-200); font-size: 14px; text-decoration: none;
}
.skip:focus { left: 12px; top: 12px; }

/* --- signup, in the index's inbox block --- */
.signup { justify-self: start; width: 100%; max-width: 360px; }
.signup-row { display: flex; gap: 8px; flex-wrap: wrap; }
.signup-row .input { flex: 1; min-width: 170px; min-height: 40px; font-size: 14px; }
.signup-row .btn { min-height: 40px; padding-inline: 18px; white-space: nowrap; }
.signup-msg { margin: 8px 0 0; font-size: 13px; color: var(--color-accent-200); }

/* --- header --- */
.site-head {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, #161826 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-divider);
}
.site-head-in {
  max-width: 1120px; margin: 0 auto; padding: 12px 24px;
  display: flex; align-items: center; gap: 20px;
}
.brand {
  display: flex; align-items: center; gap: 9px;
  color: var(--color-text); text-decoration: none; margin-right: auto; flex: none;
}
.brand-mark { color: var(--color-accent); display: flex; }
.brand-name { font-family: var(--font-heading); font-weight: 500; font-size: 16px; letter-spacing: -0.01em; }
.site-nav { display: flex; align-items: center; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a {
  padding: 8px 11px; font-size: 13.5px; color: var(--color-neutral-300);
  white-space: nowrap; text-decoration: none; border-radius: 6px;
}
.site-nav a:hover { color: var(--color-text); background: color-mix(in srgb, var(--color-surface) 70%, transparent); }
.site-nav a[aria-current="page"] { color: var(--color-accent-200); }
.nav-cta { flex: none; min-height: 38px; padding-inline: 16px; }

/* --- layout --- */
/* .prose and .post-foot are children of .wrap, so they inherit its measure and
   gutter — giving them their own would indent the body copy past the headline. */
.wrap { max-width: 760px; margin-inline: auto; padding: 44px 24px 4px; }
.blog-head { max-width: 860px; margin-inline: auto; padding: 56px 24px 10px; }
.post-list { max-width: 860px; margin-inline: auto; padding: 26px 24px 70px; }

.crumb { margin: 0 0 4px; font-size: 13.5px; }
.crumb a { color: var(--color-neutral-400); text-decoration: none; }
.crumb a:hover { color: var(--color-text); }

/* metadata, in the mono treatment the design uses throughout */
.meta-mono {
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 11.5px; color: var(--color-neutral-500); letter-spacing: 0.06em;
}
.post-head { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 22px 0 12px; }

h1 {
  font-family: var(--font-heading); font-weight: 500;
  font-size: clamp(28px, 3.8vw, 40px); line-height: 1.12;
  letter-spacing: -0.03em; margin: 0 0 16px;
}
.blog-head h1 { font-size: clamp(32px, 4.4vw, 46px); margin: 16px 0 14px; }

/* the standfirst — larger and lighter than body copy */
.dek {
  font-size: 18px; line-height: 1.55;
  color: var(--color-neutral-200); margin: 0 0 6px; max-width: 58ch;
}
.lede { font-size: 17px; color: var(--color-neutral-300); max-width: 60ch; margin: 0; }

/* --- prose --- */
.prose { font-size: 16px; line-height: 1.68; color: var(--color-neutral-200); padding-top: 18px; }
.prose > * + * { margin-top: 0; }
.prose p { margin: 0 0 16px; text-wrap: pretty; }
.prose h2 {
  font-family: var(--font-heading); font-weight: 500; color: var(--color-text);
  font-size: 22px; letter-spacing: -0.02em; margin: 34px 0 10px;
}
.prose h3 {
  font-family: var(--font-heading); font-weight: 500; color: var(--color-text);
  font-size: 18px; letter-spacing: -0.01em; margin: 26px 0 8px;
}
.prose strong { color: var(--color-text); font-weight: 600; }

/* lists use the design's accent dash, not bullets */
.prose ul { list-style: none; padding: 0; margin: 0 0 18px; display: flex; flex-direction: column; gap: 9px; }
/* The design draws the dash as its own column, but that markup is two spans
   per item. A markdown <li> is inline content, so a grid would put every word
   in its own cell — the marker is absolutely positioned instead. */
.prose ul li {
  position: relative; padding-left: 28px;
  font-size: 15.5px; line-height: 1.6;
}
.prose ul li::before {
  content: "—"; color: var(--color-accent);
  position: absolute; left: 0; top: 0;
}
.prose ol { padding-left: 1.3em; margin: 0 0 18px; display: flex; flex-direction: column; gap: 9px; }
.prose ol li { font-size: 15.5px; line-height: 1.6; }

/* a blockquote renders as the design's note callout; a leading <strong>
   becomes its label, so "> **Why it matters** text" reads correctly */
.prose blockquote {
  margin: 4px 0 22px; padding: 16px 18px;
  border: 1px solid var(--color-accent-700); border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--color-accent) 7%, transparent);
}
.prose blockquote p { margin: 0; font-size: 15px; line-height: 1.62; }
.prose blockquote p + p { margin-top: 8px; }
.prose blockquote strong:first-child {
  display: block; color: var(--color-accent);
  font-family: var(--font-heading); font-weight: 500; font-size: 13px; margin-bottom: 6px;
}

.prose code {
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace; font-size: 0.86em;
  background: var(--color-surface); border: 1px solid var(--color-divider);
  border-radius: 4px; padding: 1px 5px;
}
.prose pre {
  margin: 0 0 20px; padding: 15px 17px; background: #101120;
  border: 1px solid var(--color-divider); border-radius: var(--radius-sm);
  overflow-x: auto; font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 12.5px; line-height: 1.72;
}
.prose pre code { background: none; border: 0; padding: 0; font-size: inherit; }
.prose img { max-width: 100%; height: auto; border-radius: var(--radius-md); border: 1px solid var(--color-divider); }
.prose table { width: 100%; border-collapse: collapse; font-size: 14px; display: block; overflow-x: auto; margin: 0 0 18px; }
.prose th, .prose td { border: 1px solid var(--color-divider); padding: 8px 12px; text-align: left; }
.prose th { color: var(--color-text); font-weight: 600; }
.prose hr { border: 0; border-top: 1px solid var(--color-divider); margin: 30px 0; }

/* --- index list --- */
.post-list article { border-top: 1px solid var(--color-divider); }
.post-list article > a { display: block; padding: 24px 4px; text-decoration: none; color: inherit; }
.post-list h2 {
  font-family: var(--font-heading); font-weight: 500;
  font-size: 24px; letter-spacing: -0.02em; margin: 0 0 7px; max-width: 36ch;
}
.post-list article > a p { margin: 0 0 10px; font-size: 15px; color: var(--color-neutral-300); max-width: 62ch; }
.post-list article > a:hover h2 { color: var(--color-accent-200); }
.read-it { font-size: 13.5px; color: var(--color-accent-300); }

.list-foot {
  border-top: 1px solid var(--color-divider); padding-top: 26px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px; align-items: center;
}
.list-foot h3 { font-family: var(--font-heading); font-weight: 500; font-size: 18px; margin: 0 0 4px; }
.list-foot p { margin: 0; font-size: 14px; color: var(--color-neutral-300); max-width: 48ch; }
.list-foot .btn { justify-self: start; min-height: 40px; }

/* --- post foot --- */
.post-foot {
  padding-bottom: 70px; padding-top: 24px; margin-top: 16px;
  border-top: 1px solid var(--color-divider);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px;
}
.post-foot h6 {
  color: var(--color-accent); margin: 0 0 6px;
  font-family: var(--font-heading); font-weight: 500; font-size: 13px;
}
.next-post {
  font-size: 16px; font-family: var(--font-heading); font-weight: 500;
  color: var(--color-text); text-decoration: none;
}
.next-post:hover { color: var(--color-accent-200); }
.post-foot .btn { min-height: 40px; margin-top: 2px; justify-self: start; }

/* --- footer --- */
.site-foot {
  border-top: 1px solid var(--color-divider);
  background: color-mix(in srgb, var(--color-surface) 45%, transparent);
  margin-top: 56px;
}
.site-foot-in {
  max-width: 1120px; margin: 0 auto; padding: 44px 24px 30px;
  display: grid; grid-template-columns: minmax(0,1.4fr) repeat(3, minmax(0,1fr)); gap: 32px;
}
.foot-brand { margin-bottom: 10px; }
.site-foot-in p { font-size: 13.5px; margin: 0 0 8px; max-width: 42ch; }
.foot-col { display: flex; flex-direction: column; gap: 7px; }
.foot-col h6 {
  margin: 0 0 3px; color: var(--color-neutral-500);
  font-family: var(--font-heading); font-weight: 500; font-size: 13px;
}
.foot-col a { font-size: 13.5px; color: var(--color-neutral-300); text-decoration: none; }
.foot-col a:hover { color: var(--color-text); }
.site-foot-fine {
  max-width: 1120px; margin: 0 auto;
  padding: 16px 24px 30px; border-top: 1px solid var(--color-divider);
  display: flex; gap: 18px; flex-wrap: wrap; align-items: center;
  font-size: 12.5px; color: var(--color-neutral-500);
}
.site-foot-fine a { color: var(--color-neutral-400); text-decoration: none; }
.site-foot-fine a:hover { color: var(--color-text); }

@media (max-width: 860px) {
  .site-foot-in { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .wrap { padding: 32px 18px 8px; }
  .site-head-in { padding-inline: 18px; }
  .site-foot-in { grid-template-columns: 1fr; gap: 24px; padding-inline: 18px; }
  .site-foot-fine { padding-inline: 18px; }
  .nav-cta { display: none; }
}
