/* Ctrl Freak AI blog. Self-contained: same tokens and look as the homepage, no imports. */
:root {
  --bg: #f7f7f5; --bg-2: #ffffff; --bg-3: #efefeb; --ink: #111111; --muted: #6b6b6b; --soft: #9a9a9a; --line: #e4e4df;
  --f: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "Geist Mono", ui-monospace, Menlo, monospace;
  --r1: 6px; --r2: 8px; --r3: 12px; --r4: 16px;
  --wrap: 1120px; --gutter: 40px; --nav: 64px; --measure: 70ch;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.65 var(--f); -webkit-font-smoothing: antialiased; }
img, svg { max-width: 100%; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--f); font-weight: 500; margin: 0; letter-spacing: -0.03em; line-height: 1.15; text-wrap: balance; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 10px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: var(--r1); }
.skip:focus { left: 10px; }
[id] { scroll-margin-top: calc(var(--nav) + 16px); }
.wrap { max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }

/* one button style */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 20px; border-radius: var(--r2); background: var(--ink); color: #fff; font: 500 15.5px/1 var(--f); letter-spacing: -0.01em; text-decoration: none; border: 1px solid var(--ink); white-space: nowrap; transition: background-color .18s; }
.btn:hover { background: #2e2e2e; }
.btn-sm { min-height: 36px; padding: 0 16px; font-size: 14px; border-radius: 9px; }

/* header */
.nav { position: sticky; top: 0; z-index: 50; height: var(--nav); background: rgba(247, 247, 245, .94); border-bottom: 1px solid var(--line); }
.nav-row { display: flex; align-items: center; gap: 32px; height: 100%; }
.wordmark { display: inline-flex; align-items: center; gap: 9px; font: 600 17px/1 var(--f); letter-spacing: -0.02em; text-decoration: none; color: var(--ink); white-space: nowrap; }
.wordmark.sm { font-size: 15px; }
.nav-links { flex: 1; display: flex; gap: 22px; }
.nav-links a { font-size: 15px; color: #444; text-decoration: none; white-space: nowrap; }
.nav-links a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }

/* page heads */
.post, .blog-index { padding-top: 48px; padding-bottom: 96px; }
.post > *, .post-head { max-width: var(--measure); }
.post { display: flex; flex-direction: column; }
.post > * { width: 100%; margin-left: auto; margin-right: auto; }
.blog-index > .post-head { max-width: 760px; }
.eyebrow { font-size: 14.5px; color: var(--muted); margin-bottom: 14px; }
.post-head h1 { font-size: clamp(34px, 4.4vw, 52px); letter-spacing: -0.04em; line-height: 1.05; }
.lede { margin-top: 18px; font-size: 19.5px; line-height: 1.5; color: var(--muted); }
.meta { font-size: 14px; color: var(--muted); }
.post-head .meta { margin-top: 22px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.crumbs ol { list-style: none; margin: 0 0 28px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; font-size: 14px; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--soft); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }

/* prose */
.prose { margin-top: 36px; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: 28px; margin-top: 2em; }
.prose h3 { font-size: 21px; letter-spacing: -0.02em; margin-top: 1.6em; }
.prose h2 + *, .prose h3 + * { margin-top: .6em; }
.prose a { text-decoration-color: #b9b9b2; text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .45em; }
.prose li::marker { color: var(--soft); }
.prose strong { font-weight: 600; }
.prose blockquote { margin-left: 0; margin-right: 0; padding: 4px 0 4px 20px; border-left: 2px solid var(--ink); color: #333; }
.prose code { font: 400 .88em var(--f-mono); background: var(--bg-3); padding: .12em .35em; border-radius: 4px; }
.prose pre { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r3); padding: 16px 18px; overflow-x: auto; }
.prose pre code { background: none; padding: 0; font-size: 14px; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r3); background: var(--bg-2); }
table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.45; }
th { text-align: left; font-weight: 500; color: var(--muted); padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.num, .num { font-family: var(--f-mono); font-variant-numeric: tabular-nums; font-size: 14px; }

/* post footer parts */
.sources { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); }
.sources h2 { font-size: 17px; letter-spacing: -0.01em; }
.sources ul { margin: 10px 0 0; padding-left: 1.2em; font-size: 15px; color: var(--muted); }
.sources a { color: var(--muted); }
.tags { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 8px; }
.tag { display: inline-block; font-size: 14px; color: #333; text-decoration: none; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg-2); }
.tag:hover { border-color: #c9c9c3; color: var(--ink); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.cta { margin-top: 56px; padding: 36px; border-radius: var(--r4); background: var(--ink); color: #fff; }
.cta h2 { font-size: 26px; }
.cta p { margin: 12px 0 24px; color: #bdbdbd; max-width: 56ch; }
.cta .btn { background: #fff; color: var(--ink); border-color: #fff; }
.cta .btn:hover { background: #e9e9e6; }
.blog-index > .cta { max-width: none; }

.related { margin-top: 56px; }
.related h2, .block h2 { font-size: 26px; }

/* cards + index blocks */
.block { margin-top: 64px; }
.block-sub { margin-top: 8px; color: var(--muted); max-width: 62ch; }
.sub-h { font-size: 16px; letter-spacing: -0.01em; margin-top: 24px; color: #333; }
.block .table-wrap { margin-top: 20px; }
.block > p:last-child { margin-top: 14px; }
.cards { list-style: none; margin: 20px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.card { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r3); padding: 20px 22px; transition: border-color .18s; }
.card:hover { border-color: #c9c9c3; }
.card h3 { font-size: 19px; letter-spacing: -0.02em; line-height: 1.3; margin-top: 8px; }
.card h3 a { text-decoration: none; }
.card h3 a:hover { text-decoration: underline; text-underline-offset: 3px; }
.card p:last-child { margin-top: 8px; font-size: 15px; color: var(--muted); line-height: 1.5; }
.card .meta { font-size: 13px; }
.pager { display: flex; align-items: center; gap: 24px; margin-top: 28px; font-size: 15px; }
.pager span { color: var(--muted); }

.repo-list { list-style: none; margin: 20px 0 0; padding: 0; border-top: 1px solid var(--line); }
.repo-list li { padding: 16px 0; border-bottom: 1px solid var(--line); }
.repo-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }
.repo-top a { font-weight: 500; text-underline-offset: 3px; overflow-wrap: anywhere; }
.repo-top .num { color: var(--muted); font-size: 13.5px; }
.repo-list li > p:last-child { margin-top: 4px; color: var(--muted); font-size: 15.5px; max-width: 75ch; }

/* footer */
.foot { border-top: 1px solid var(--line); padding: 32px 0; font-size: 14px; color: var(--muted); }
.foot-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 32px; }
.foot-links { margin-left: auto; display: flex; gap: 20px; }
.foot-links a { text-decoration: none; }
.foot-links a:hover { color: var(--ink); text-decoration: underline; }

@media (max-width: 760px) {
  :root { --gutter: 16px; }
  .nav { height: auto; background: var(--bg); }
  [id] { scroll-margin-top: 120px; }
  .nav-row { flex-wrap: wrap; gap: 10px 16px; padding-top: 12px; padding-bottom: 12px; }
  .nav-row .btn-sm { margin-left: auto; }
  .nav-links { order: 3; flex-basis: 100%; gap: 18px; overflow-x: auto; padding-bottom: 2px; }
  .post, .blog-index { padding-top: 28px; padding-bottom: 64px; }
  .lede { font-size: 18px; }
  .prose h2 { font-size: 24px; }
  .cta { padding: 26px 22px; }
  .cards { grid-template-columns: 1fr; }
  .foot-links { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ===================== Spatial theme (matches the homepage) ===================== */
:root { --bg: #05070d; --bg-2: rgba(255,255,255,.04); --bg-3: rgba(255,255,255,.07); --ink: #eef2ff; --muted: #9aa4c4; --soft: #7d88aa; --line: rgba(255,255,255,.09); --accent: #7b96ff; }
html, body { background: #05070d; color: var(--ink); }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(70% 50% at 85% 0%, rgba(64,96,255,.14), transparent 70%), #05070d; }
h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.04em; color: #f2f5ff; }
.nav { background: rgba(5,7,13,.6); border-bottom-color: var(--line); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
.wordmark { color: #fff; }
.nav-links a { color: #9aa4c4; }
.nav-links a:hover { color: #fff; }
.btn { background: #fff; color: #05070d; border-color: #fff; }
.btn:hover { background: #dfe6ff; }
.card, .block, .cta, .repo-list li, .table-wrap, .sources { background: rgba(16,23,44,.55); border-color: rgba(255,255,255,.1); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.card:hover { border-color: rgba(123,150,255,.45); }
.lede, .meta, .crumbs, .eyebrow, .sub-h, .foot, .foot-links a, .block-sub { color: var(--muted); }
.prose { color: #d6dcf0; }
.prose a, .related a, .cards a:hover h3 { color: #a3b6ff; }
.prose strong, .prose b { color: #fff; }
.prose blockquote { border-left-color: #7b96ff; color: #c9d1ea; }
.prose code { background: rgba(255,255,255,.08); color: #e3e8f7; }
.prose table th { background: rgba(255,255,255,.04); color: #9aa4c4; }
.prose table td, .prose table th { border-color: rgba(255,255,255,.08); }
.tag, .tag-cloud a { background: rgba(255,255,255,.06); color: #c9d1ea; border-color: rgba(255,255,255,.12); }
.tag:hover, .tag-cloud a:hover { border-color: #7b96ff; color: #fff; }
.cta { color: var(--ink); }
.cta .btn { background: #fff; color: #05070d; }
.num { color: #7b96ff; }
.pager a { color: #c9d1ea; border-color: rgba(255,255,255,.12); }
:focus-visible { outline-color: #7b96ff; }

/* Ctrl Freak AI logo (white lettering on the dark blog) */
.wordmark .logo-img { display: block; height: 52px; width: auto; max-width: none; }
.wordmark { line-height: 0; }
.wordmark.sm .logo-img { height: 38px; }
@media (max-width: 700px) { .wordmark .logo-img { height: 40px; } }
