/*
 * Shared styles for every blog post and the blog index.
 *
 * Extracted from the posts once there were two of them: the alternative was
 * copy-pasting ~150 lines of identical CSS into every new article and then
 * hand-syncing them forever. Page-specific tweaks still go inline in the post.
 */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --cream: #faf8f5; --cream-dark: #f2ede6;
  --purple: #6c47ff; --purple-light: #ede9ff; --purple-deep: #3d2f80;
  --orange: #ff6b35; --orange-light: #fff1eb;
  --green: #00b97d; --green-light: #e6f9f2;
  --red: #d94436; --red-light: #ffeceb;
  --text: #1a1714; --body: #4a443f; --muted: #9c9590;
  --white: #ffffff; --border: #e8e3dc;
  --radius-sm: 10px; --radius-lg: 18px;
}

body {
  font-family: 'Instrument Sans', sans-serif;
  background: var(--cream); color: var(--text);
  line-height: 1.75;
  display: flex; flex-direction: column; min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Nav ───────────────────────────────────────────────────────────── */
nav {
  position: sticky; top: 0; z-index: 100;
  padding: 16px 32px; display: flex; align-items: center; justify-content: space-between;
  background: rgba(250, 248, 245, 0.85); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-logo { font-family: 'Cabinet Grotesk', sans-serif; font-weight: 900; font-size: 20px; color: var(--text); text-decoration: none; display: flex; align-items: center; gap: 2px; }
.nav-logo span.h { color: var(--purple); }
.nav-logo span.ai { background: var(--orange); color: #fff; padding: 1px 6px; border-radius: 6px; font-size: 13px; margin-left: 2px; }
.nav-cta { font-family: 'Cabinet Grotesk', sans-serif; font-weight: 800; font-size: 14px; background: var(--orange); color: #fff; padding: 10px 20px; border-radius: var(--radius-sm); text-decoration: none; transition: all 0.15s; }
.nav-cta:hover { background: #e85e2b; transform: translateY(-1px); }

/* ── Gradient hero band ────────────────────────────────────────────── */
.post-hero {
  background:
    radial-gradient(120% 120% at 15% 0%, #ede9ff 0%, rgba(237,233,255,0) 55%),
    radial-gradient(100% 100% at 95% 10%, #ffe6db 0%, rgba(255,230,219,0) 50%),
    var(--cream);
  border-bottom: 1px solid var(--border);
  padding: 44px 24px 52px;
}
.post-hero-inner { max-width: 760px; margin: 0 auto; }

.crumb { font-size: 14px; color: var(--muted); margin-bottom: 22px; }
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--purple); }

.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.pill {
  background: var(--white); border: 1.5px solid var(--border); color: var(--body);
  font-size: 13px; font-weight: 600; padding: 5px 14px; border-radius: 999px;
}
.pill.is-primary { background: var(--purple); border-color: var(--purple); color: #fff; font-weight: 700; }

.post-hero h1 {
  font-family: 'Cabinet Grotesk', sans-serif; font-weight: 900;
  font-size: clamp(33px, 6vw, 54px); letter-spacing: -1.4px; line-height: 1.06;
  margin-bottom: 18px;
}
.standfirst { font-size: clamp(17px, 2.3vw, 20px); color: var(--body); max-width: 620px; margin-bottom: 28px; }

.byline { display: flex; align-items: center; gap: 12px; font-size: 14.5px; color: var(--muted); }
.byline-avatar {
  width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--purple) 0%, #8b6dff 100%);
  color: #fff; font-family: 'Cabinet Grotesk', sans-serif; font-weight: 900; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  object-fit: cover;
}
.byline strong { color: var(--text); font-weight: 700; }
.byline a { color: var(--purple); text-decoration: none; font-weight: 600; }

/* ── Hero image ────────────────────────────────────────────────────── */
.post-figure { max-width: 900px; margin: 0 auto; padding: 32px 24px 0; }
.post-figure img { width: 100%; height: auto; display: block; border-radius: var(--radius-lg); border: 1.5px solid var(--border); }
.post-figure figcaption { font-size: 13.5px; color: var(--muted); text-align: center; margin-top: 12px; }

/* ── Article body ──────────────────────────────────────────────────── */
article { flex: 1; width: 100%; max-width: 720px; margin: 0 auto; padding: 44px 24px 100px; }

article h2 { font-family: 'Cabinet Grotesk', sans-serif; font-weight: 800; font-size: clamp(24px, 3.6vw, 32px); letter-spacing: -0.7px; line-height: 1.18; margin: 54px 0 16px; scroll-margin-top: 80px; }
article h3 { font-family: 'Cabinet Grotesk', sans-serif; font-weight: 700; font-size: 20px; margin: 34px 0 12px; }
article p { margin-bottom: 19px; font-size: 17.5px; color: var(--body); }
article > ul, article > ol { margin: 0 0 22px 22px; }
article li { margin-bottom: 10px; font-size: 17.5px; color: var(--body); }
article strong { font-weight: 700; color: var(--text); }
article a { color: var(--purple); }

/* ── Table of contents ─────────────────────────────────────────────── */
.toc { background: var(--white); border: 1.5px solid var(--border); border-radius: var(--radius-lg); padding: 24px 28px; margin-bottom: 8px; }
.toc h4 { font-family: 'Cabinet Grotesk', sans-serif; font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted); margin-bottom: 14px; }
.toc ol { margin: 0 0 0 18px; }
.toc li { margin-bottom: 7px; font-size: 15.5px; }
.toc a { color: var(--text); text-decoration: none; }
.toc a:hover { color: var(--purple); }

/* ── Callouts ──────────────────────────────────────────────────────── */
.callout { border-radius: var(--radius-lg); padding: 20px 24px; margin: 26px 0; font-size: 16.5px; }
.callout p { margin-bottom: 0; font-size: 16.5px; color: inherit; }
.callout.tip { background: var(--purple-light); border-left: 4px solid var(--purple); color: var(--purple-deep); }
.callout.good { background: var(--green-light); border-left: 4px solid var(--green); }
.callout.bad { background: var(--red-light); border-left: 4px solid var(--red); }
.callout.key { background: var(--orange-light); border-left: 4px solid var(--orange); }
.callout-label { display: block; font-family: 'Cabinet Grotesk', sans-serif; font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 6px; }
.callout.good .callout-label { color: var(--green); }
.callout.bad .callout-label { color: var(--red); }
.callout.key .callout-label { color: var(--orange); }

/* ── Interactive checklist ─────────────────────────────────────────── */
.check-list { list-style: none; margin: 20px 0 24px; padding: 0; }
.check-list li {
  display: flex; align-items: flex-start; gap: 12px; padding: 11px 16px; margin-bottom: 8px;
  background: var(--white); border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; transition: all 0.14s; font-size: 16px; user-select: none; color: var(--body);
}
.check-list li:hover { border-color: #c4b5ff; }
.check-list li .box {
  flex-shrink: 0; width: 20px; height: 20px; border: 2px solid var(--border); border-radius: 5px;
  margin-top: 3px; display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: transparent; transition: all 0.14s; font-weight: 900;
}
.check-list li.checked { background: var(--green-light); border-color: var(--green); }
.check-list li.checked .box { background: var(--green); border-color: var(--green); color: #fff; }
.check-list li.checked .label { text-decoration: line-through; color: var(--muted); }

/* ── Prompt block ──────────────────────────────────────────────────── */
.prompt-wrap { background: #1a1714; border-radius: var(--radius-lg); overflow: hidden; margin: 26px 0 30px; }
.prompt-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid #322c27; }
.prompt-head span { font-family: 'Cabinet Grotesk', sans-serif; font-weight: 800; font-size: 12px; letter-spacing: 0.8px; text-transform: uppercase; color: var(--muted); }
.prompt-copy { font-family: 'Cabinet Grotesk', sans-serif; font-weight: 800; font-size: 13px; background: var(--purple); color: #fff; border: none; padding: 8px 16px; border-radius: 8px; cursor: pointer; transition: all 0.15s; }
.prompt-copy:hover { background: #5a37e0; }
.prompt-copy.done { background: var(--green); }
.prompt-body { padding: 22px 20px; margin: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14.5px; line-height: 1.7; color: #f0ece6; white-space: pre-wrap; word-wrap: break-word; }

/* ── Breakdown cards ───────────────────────────────────────────────── */
.breakdown { list-style: none; margin: 24px 0; padding: 0; }
.breakdown li { background: var(--white); border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 18px 22px; margin-bottom: 12px; font-size: 16.5px; color: var(--body); }
.breakdown code { display: block; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; color: var(--purple); background: var(--purple-light); padding: 8px 12px; border-radius: 6px; margin-bottom: 10px; }

/* ── Inline CTA ────────────────────────────────────────────────────── */
.cta-box { margin: 56px 0 0; background: linear-gradient(135deg, #6c47ff 0%, #8b6dff 100%); border-radius: var(--radius-lg); padding: 36px 34px; color: #fff; }
.cta-box h3 { font-family: 'Cabinet Grotesk', sans-serif; font-weight: 900; font-size: 26px; color: #fff; margin: 0 0 12px; letter-spacing: -0.5px; }
.cta-box p { color: rgba(255,255,255,0.9); font-size: 16.5px; margin-bottom: 22px; }
.cta-box a.btn { display: inline-block; background: var(--orange); color: #fff; font-family: 'Cabinet Grotesk', sans-serif; font-weight: 800; font-size: 16px; padding: 14px 30px; border-radius: var(--radius-sm); text-decoration: none; transition: all 0.15s; }
.cta-box a.btn:hover { background: #e85e2b; transform: translateY(-2px); }
.cta-box small { display: block; margin-top: 14px; color: rgba(255,255,255,0.75); font-size: 14px; }

/* ── Sticky bottom CTA bar ─────────────────────────────────────────── */
.sticky-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  background: rgba(255,255,255,0.96); backdrop-filter: blur(12px);
  border-top: 1.5px solid var(--border);
  padding: 12px 24px;
  display: flex; align-items: center; justify-content: center; gap: 20px;
  transform: translateY(110%); transition: transform 0.28s ease;
}
.sticky-cta.visible { transform: translateY(0); }
.sticky-cta-copy { font-size: 15px; color: var(--body); }
.sticky-cta-copy strong { display: block; font-family: 'Cabinet Grotesk', sans-serif; font-weight: 800; font-size: 16px; color: var(--text); }
.sticky-cta a {
  flex-shrink: 0; background: var(--orange); color: #fff;
  font-family: 'Cabinet Grotesk', sans-serif; font-weight: 800; font-size: 15px;
  padding: 12px 26px; border-radius: var(--radius-sm); text-decoration: none; transition: all 0.15s;
}
.sticky-cta a:hover { background: #e85e2b; }
.sticky-cta-close {
  background: none; border: none; color: var(--muted); font-size: 22px; line-height: 1;
  cursor: pointer; padding: 4px 8px; flex-shrink: 0;
}
.sticky-cta-close:hover { color: var(--text); }

/* ── Footer ────────────────────────────────────────────────────────── */
footer { background: var(--white); border-top: 1.5px solid var(--border); padding: 28px 32px; text-align: center; font-size: 13px; color: var(--muted); }
footer a { color: var(--muted); text-decoration: none; margin: 0 8px; }
footer a:hover { color: var(--purple); }

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  nav { padding: 12px 20px; }
  .post-hero { padding: 30px 20px 36px; }
  article { padding: 32px 20px 120px; }
  .post-figure { padding: 24px 20px 0; }
  .cta-box { padding: 28px 24px; }
  .prompt-body { font-size: 13.5px; }
  .sticky-cta { flex-direction: row; gap: 12px; padding: 10px 14px; }
  .sticky-cta-copy { font-size: 13px; }
  .sticky-cta-copy strong { font-size: 14px; }
  .sticky-cta-copy .hide-sm { display: none; }
  .sticky-cta a { padding: 11px 18px; font-size: 14px; }
}
