/* ---------------------------------------------------------------------------
   Styling for the blog — index and posts.

   The tokens and chrome here mirror index.html rather than being shared with
   it: the landing page is one self-contained file on purpose, and lifting its
   400 lines of inline CSS out to make a blog page work would have risked the
   page for no visible gain. If a third page ever appears, that's the moment to
   merge the two.
   --------------------------------------------------------------------------- */

:root {
  --bg: #f7f8fc;
  --surface: #ffffff;
  --border: #e2e5ef;
  --text: #14172a;
  --muted: #666d85;
  --accent: #4f5bd5;
  --accent-soft: #eceefc;
  --radius: 16px;
  --maxw: 1080px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Header ─────────────────────────────────────────────────────────────── */

header { padding: 22px 0; }

.bar {
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
  flex: none;
}

.mark {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--accent);
  position: relative;
  flex: none;
}

.mark::after {
  content: "";
  position: absolute;
  inset: 6px 6px auto 6px;
  height: 3px;
  border-radius: 2px;
  background: #fff;
  box-shadow: 0 5px 0 rgba(255, 255, 255, 0.55);
}

nav {
  display: flex;
  gap: 22px;
  flex: 1;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 500;
}

nav a:hover { color: var(--text); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  padding: 12px 20px;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover { background: #4049c4; }

.btn-ghost {
  border-color: var(--border);
  color: var(--text);
  background: transparent;
}

.btn-ghost:hover { background: #fff; }

.btn-sm { padding: 8px 15px; font-size: 14px; }

/* ── Blog index ─────────────────────────────────────────────────────────── */

.page-head {
  padding: 44px 0 8px;
  max-width: 620px;
}

.page-head h1 {
  margin: 0 0 10px;
  font-size: clamp(30px, 5vw, 40px);
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.page-head p {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
}

.posts {
  display: grid;
  gap: 16px;
  padding: 32px 0 64px;
}

.post-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 28px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, transform 0.15s;
}

.post-card:hover {
  border-color: #c9cee6;
  transform: translateY(-2px);
}

.post-card h2 {
  margin: 0 0 8px;
  font-size: 21px;
  letter-spacing: -0.02em;
}

.post-card p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 15.5px;
}

.meta {
  color: var(--muted);
  font-size: 13.5px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.meta .dot { opacity: 0.5; }

/* ── Post ───────────────────────────────────────────────────────────────── */

.article {
  max-width: 700px;
  margin: 0 auto;
  padding: 44px 0 72px;
}

.back {
  color: var(--muted);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 500;
}

.back:hover { color: var(--text); }

.article h1 {
  margin: 20px 0 12px;
  font-size: clamp(30px, 5vw, 42px);
  line-height: 1.14;
  letter-spacing: -0.03em;
}

.standfirst {
  margin: 0 0 10px;
  font-size: 18.5px;
  color: var(--muted);
  line-height: 1.6;
}

.article-meta {
  padding-bottom: 26px;
  margin-bottom: 34px;
  border-bottom: 1px solid var(--border);
}

.article h2 {
  margin: 44px 0 14px;
  font-size: 24px;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.article h3 {
  margin: 32px 0 10px;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.article p {
  margin: 0 0 20px;
  font-size: 17px;
}

.article ul,
.article ol {
  margin: 0 0 20px;
  padding-left: 22px;
  font-size: 17px;
}

.article li { margin-bottom: 9px; }

.article a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.article strong { font-weight: 650; }

.article code {
  background: var(--accent-soft);
  color: #3a44b0;
  border-radius: 5px;
  padding: 2px 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em;
}

.article pre {
  background: #14172a;
  color: #d8dcf0;
  border-radius: 12px;
  padding: 20px;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.6;
  margin: 0 0 24px;
}

.article pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: inherit;
}

.callout {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  padding: 18px 22px;
  margin: 0 0 24px;
}

.callout p:last-child { margin-bottom: 0; }

.article figure {
  margin: 0 0 24px;
}

.article table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 24px;
  font-size: 15.5px;
}

.article th,
.article td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.article th {
  font-weight: 600;
  color: var(--muted);
  font-size: 13.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.end-cta {
  margin-top: 48px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}

.end-cta h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

.end-cta p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 15.5px;
}

/* ── Footer ─────────────────────────────────────────────────────────────── */

footer {
  border-top: 1px solid var(--border);
  padding: 26px 0 40px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 14px;
}

footer a {
  color: var(--muted);
  text-decoration: none;
}

footer a:hover { color: var(--text); }

@media (max-width: 720px) {
  nav { display: none; }
  .article p,
  .article ul,
  .article ol { font-size: 16.5px; }
}
