/* =====================================================================
   Transaction Intelligence — Theme styles
   Built from the Direction A "Refined Editorial" mockups.
   Tokens live in tokens.css.
   ===================================================================== */

/* ---------------------------------------------------------------- Base */
*,
*::before,
*::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 16px);
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img, svg, video { max-width: 100%; display: block; height: auto; }

a {
  color: inherit;
  text-decoration: none;
  transition: color 120ms ease;
}
a:hover { color: var(--brand); }

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  color: inherit;
}

input, textarea, select { font: inherit; color: inherit; }

::selection { background: var(--brand); color: var(--bg); }

/* Visible focus ring everywhere — accessibility */
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Skip to content link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 100;
}
.skip-link:focus {
  position: fixed;
  left: 16px;
  top: 16px;
  width: auto;
  height: auto;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--sans);
  font-size: 13px;
}

/* ----------------------------------------------------- Type utilities */
.font-serif      { font-family: var(--serif); }
.font-serif-caps { font-family: var(--serif-caps); letter-spacing: 0.04em; }
.font-sans       { font-family: var(--sans); }
.font-mono       { font-family: var(--mono); }

.eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand);
}
.dot--sm { width: 8px; height: 8px; }
.dot--xs { width: 6px; height: 6px; }
.sep-dot {
  display: inline-block;
  width: 3px;
  height: 3px;
  background: var(--ink-4);
  border-radius: 50%;
  vertical-align: middle;
}

/* Container — editorial measure */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 28px;
}
.container--narrow { max-width: 980px; }
.container--reading { max-width: 720px; }

/* ----------------------------------------------------------- Site chrome */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  gap: 24px;
}
.site-header--compact .site-header__inner { padding: 12px 28px; }

.site-header__nav,
.site-header__nav ul,
.site-header__nav ol {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-2);
  font-weight: 500;
  flex-wrap: wrap;
}
.site-header__nav li { list-style: none; margin: 0; padding: 0; }
.site-header__nav a { padding: 6px 0; color: var(--ink-2); }
.site-header__nav a:hover { color: var(--brand); }
.site-header__nav .nav-current > a,
.site-header__nav a[aria-current="page"] { color: var(--brand); }

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 14px;
}
.site-header__icon-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-2);
  border-radius: 4px;
}
.site-header__icon-btn:hover { color: var(--brand); background: var(--brand-tint); }

.site-header__menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  gap: 4px;
}
.site-header__menu-btn span {
  display: block;
  height: 1.5px;
  width: 18px;
  background: var(--ink);
}

.site-dateline {
  border-bottom: 1px solid var(--rule);
  padding: 8px 28px;
  display: flex;
  justify-content: space-between;
  font-family: var(--sans);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.site-dateline__right { display: flex; gap: 18px; align-items: baseline; }
.site-dateline__reading { color: var(--brand); font-weight: 600; }
.site-dateline__est em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  font-size: 12px;
  margin-right: 1px;
}

/* Logo lockup */
.logo-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}
.logo-lockup:hover { color: var(--ink); }
.logo-mark {
  display: inline-block;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  line-height: 0;
}
.logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.logo-lockup--sm .logo-mark { width: 20px; height: 20px; }
.logo-lockup--lg .logo-mark { width: 32px; height: 32px; }

.logo-lockup__wordmark {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
  line-height: 1;
}
.logo-lockup--sm .logo-lockup__wordmark { font-size: 13px; }
.logo-lockup--lg .logo-lockup__wordmark { font-size: 20px; }

/* Subscribe button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.02em;
  padding: 8px 14px;
  border-radius: 4px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
  white-space: nowrap;
}
.btn--primary {
  background: var(--brand);
  color: #FFFFFF;
}
.btn--primary:hover { background: var(--brand-ink); color: #FFFFFF; }
.btn--ghost {
  background: transparent;
  color: var(--brand);
  border-color: var(--brand);
}
.btn--ghost:hover { background: var(--brand-tint); color: var(--brand); }
.btn--lg { padding: 10px 18px; font-size: 13px; }
.btn--block { display: flex; width: 100%; }

/* ----------------------------------------------------------- Hero (homepage) */
.hero {
  padding: 56px 28px 48px;
  border-bottom: 1px solid var(--rule);
}
.hero__inner { max-width: 980px; margin: 0 auto; }
.hero__category {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}
.hero__title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(40px, 5.5vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 24px;
  text-wrap: balance;
}
.hero__dek {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.45;
  color: var(--ink-2);
  max-width: 52ch;
  margin: 0 0 28px;
}
.hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-3);
}
.hero__meta strong {
  color: var(--ink);
  font-weight: 600;
}

/* ---------------------------------------------- Featured row (homepage) */
.feature-row {
  padding: 48px 28px;
  border-bottom: 1px solid var(--rule);
}
.feature-row__grid {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
}
.feature-row__col {
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.feature-card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  margin-bottom: 18px;
  border-radius: 2px;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  background-color: var(--surface-2);
}
.feature-card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  mix-blend-mode: multiply;
}
.feature-card--lead .feature-card__media::after {
  background: linear-gradient(135deg, rgba(75, 46, 131, 0.30) 0%, rgba(20, 10, 40, 0.55) 100%);
}
.feature-card__title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 8px 0 10px;
  text-wrap: balance;
}
.feature-card--secondary .feature-card__title { font-size: 19px; line-height: 1.2; letter-spacing: -0.005em; }
.feature-card__dek {
  font-family: var(--serif);
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--ink-2);
  margin: 0;
}
.feature-card--secondary .feature-card__dek { font-size: 14px; line-height: 1.5; }
.feature-card--secondary + .feature-card--secondary {
  border-top: 1px solid var(--rule-soft);
  padding-top: 18px;
}
.feature-card a:hover .feature-card__title { color: var(--brand); }

/* ----------------------------------------------------- Category rail */
.category-rail {
  padding: 48px 28px 64px;
  background: var(--surface-2);
}
.category-rail__inner { max-width: 1120px; margin: 0 auto; }
.category-rail__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
  flex-wrap: wrap;
}
.category-rail__heading {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 30px;
  letter-spacing: -0.01em;
  margin: 0;
}
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}
.category-tile {
  background: var(--paper);
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 2px solid var(--ink-3);
  transition: background 120ms ease;
}
.category-tile:hover { background: color-mix(in oklab, var(--paper) 96%, var(--brand) 4%); }
.category-tile__head { display: flex; align-items: center; gap: 8px; }
.category-tile__count {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}
.category-tile__cta {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-3);
}

/* =============================================================
   Category accent map — slug → jewel hue.

   Two paths into the same --cat variable:

   1. [data-category="<slug>"] — set on individual elements (post cards,
      category tiles, the archive header) so accents work even outside
      a tag-page context (e.g. mixed grids on the homepage).

   2. body.tag-<slug> — Ghost's {{body_class}} emits this on tag pages.
      Used to scope the page-level archive-header tint.

   The slug list mirrors the brand spec (short forms): ai, ux, payments,
   behaviour, banking, regulatory. If you rename a tag in Ghost admin,
   update both columns here.
   ============================================================= */

[data-category="ai"],         body.tag-ai          { --cat: var(--cat-ai); }
[data-category="ux"],         body.tag-ux          { --cat: var(--cat-ux); }
[data-category="payments"],   body.tag-payments    { --cat: var(--cat-payments); }
[data-category="behaviour"],  body.tag-behaviour   { --cat: var(--cat-behaviour); }
[data-category="banking"],    body.tag-banking     { --cat: var(--cat-banking); }
[data-category="regulatory"], body.tag-regulatory  { --cat: var(--cat-regulatory); }

/* Long-form aliases — kept so we still light up correctly if a tag was
   ever renamed to one of these slugs in admin. */
[data-category="ai-automation"]       { --cat: var(--cat-ai); }
[data-category="ux-design"]           { --cat: var(--cat-ux); }
[data-category="financial-behaviour"] { --cat: var(--cat-behaviour); }
[data-category="banking-technology"]  { --cat: var(--cat-banking); }

.category-tile { border-top-color: var(--cat, var(--ink-3)); }
.category-tile .dot,
.category-tile .eyebrow,
[data-category] .post-card__eyebrow,
[data-category] .archive-header__dot { color: var(--cat, var(--ink-3)); }
[data-category] .post-card__eyebrow .dot { background: var(--cat, var(--brand)); }

/* ----------------------------------------------------- Post-card */
.post-card { display: block; }
.post-card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  margin-bottom: 14px;
  border-radius: 2px;
  overflow: hidden;
  background: var(--surface-2);
}
.post-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.post-card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  mix-blend-mode: multiply;
  background: linear-gradient(135deg, rgba(75, 46, 131, 0.20) 0%, rgba(20, 10, 40, 0.45) 100%);
}
.post-card__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cat, var(--ink-3));
}
.post-card__title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 22px;
  line-height: 1.18;
  letter-spacing: -0.01em;
  margin: 6px 0 8px;
  text-wrap: balance;
}
.post-card__dek {
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-2);
  margin: 0;
}
.post-card--compact {
  padding-top: 18px;
  border-top: 1px solid var(--rule-soft);
}
.post-card--compact .post-card__title { font-size: 18px; line-height: 1.2; }
.post-card--list {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 14px;
  align-items: baseline;
  padding: 12px 0;
}
.post-card--list .post-card__num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-3);
}
.post-card--list .post-card__title { font-size: 17px; line-height: 1.2; margin: 4px 0 0; }
.post-card a:hover .post-card__title,
a.post-card:hover .post-card__title { color: var(--brand); }

/* ----------------------------------------------------- Article (post.hbs) */
.article-hero {
  padding: 64px 28px 40px;
  border-bottom: 1px solid var(--rule);
}
.article-hero__inner {
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
}
.article-hero__category {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}
.article-hero__title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 22px;
  text-wrap: balance;
}
.article-hero__dek {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(17px, 1.8vw, 21px);
  line-height: 1.45;
  color: var(--ink-2);
  margin: 0 auto 32px;
  max-width: 52ch;
  text-wrap: balance;
}
.article-hero__meta {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: center;
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
}

.article-hero__cover {
  margin-top: 40px;
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
}
.article-hero__cover img {
  width: 100%;
  height: auto;
  border-radius: 2px;
}

/* Reading progress bar */
.reading-progress {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  height: 2px;
  background: transparent;
  z-index: 49;
  pointer-events: none;
}
.reading-progress__fill {
  width: 0;
  height: 100%;
  background: var(--brand);
  transition: width 60ms linear;
}

/* Article body grid: meta rail | body | share rail */
.article-body {
  padding: 56px 28px 80px;
}
.article-body__grid {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) 180px;
  gap: 40px;
}
.article-rail {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--ink-3);
}
.article-rail__sticky {
  position: sticky;
  top: calc(var(--header-height) + 32px);
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: var(--serif);
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.4;
}
.toc-list a { padding-left: 12px; display: block; }
.toc-list a.is-active {
  color: var(--brand);
  font-weight: 600;
  border-left: 2px solid var(--brand);
  padding-left: 10px;
}
.share-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--serif);
  font-size: 13px;
  color: var(--ink-2);
}
.share-list a:hover { color: var(--brand); }

.tag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag-chip {
  display: inline-block;
  font-family: var(--sans);
  font-size: 11px;
  color: var(--ink-2);
  padding: 3px 8px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  white-space: nowrap;
}
.tag-chip:hover { color: var(--brand); border-color: var(--brand-line); background: var(--brand-tint); }

/* Article body itself — long-form prose */
.article-content {
  font-family: var(--serif);
  font-size: 18.5px;
  line-height: 1.65;
  color: var(--ink);
  max-width: var(--measure);
}
.article-content > * + * { margin-top: 0; }
.article-content p,
.article-content ul,
.article-content ol,
.article-content blockquote { margin: 0 0 1.4em; }
.article-content h2 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 2em 0 0.6em;
}
.article-content h3 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.005em;
  line-height: 1.25;
  margin: 1.6em 0 0.5em;
}
.article-content h4 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  margin: 1.6em 0 0.5em;
}
.article-content a {
  color: var(--brand);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.article-content a:hover { background: var(--brand-tint); }

.article-content blockquote,
.article-content figure.kg-quote-card,
.article-content figure.kg-pullquote-card {
  margin: 2.4em -32px;
  padding: 28px;
  background: var(--surface-2);
  border-left: 3px solid var(--cat, var(--brand));
}
.article-content blockquote p {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  line-height: 1.4;
  letter-spacing: -0.005em;
  color: var(--ink);
}
.article-content blockquote cite,
.article-content blockquote footer,
.article-content figcaption {
  display: block;
  margin-top: 14px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-style: normal;
}

.article-content code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 3px;
}
.article-content pre {
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.55;
  background: var(--surface-2);
  padding: 18px 20px;
  border-radius: 4px;
  overflow-x: auto;
  margin: 1.6em -8px;
}
.article-content pre code {
  background: none;
  padding: 0;
}

.article-content hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 2em 0;
}

.article-content img,
.article-content figure img,
.article-content .kg-card {
  width: 100%;
  margin: 1.8em 0;
}

.article-content .kg-bookmark-card {
  display: block;
  border: 1px solid var(--rule);
  border-radius: 4px;
  text-decoration: none;
  margin: 1.8em 0;
}
.article-content .kg-bookmark-content {
  padding: 20px 24px;
}

/* Drop cap */
.article-content > p:first-child::first-letter,
.article-content .has-dropcap::first-letter {
  float: left;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 78px;
  line-height: 0.85;
  padding: 6px 10px 0 0;
  color: var(--brand);
}

/* Inline newsletter */
.newsletter-inline {
  margin: 32px 0;
  padding: 32px;
  background: var(--brand-tint);
  border: 1px solid var(--brand-line);
  border-radius: 2px;
}
.newsletter-inline__title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin: 8px 0;
}
.newsletter-inline__copy {
  font-family: var(--serif);
  font-size: 14px;
  color: var(--ink-2);
  margin: 0 0 18px;
  line-height: 1.5;
}
.newsletter-inline__form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.newsletter-inline__input {
  flex: 1 1 220px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--rule);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 14px;
  border-radius: 2px;
  color: var(--ink);
}

/* Related posts */
.related {
  padding: 32px 28px 48px;
  background: var(--surface-2);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.related__inner { max-width: 980px; margin: 0 auto; }
.related__heading {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
}
.related__list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.related__list li + li {
  border-top: 1px solid var(--rule-soft);
  padding-top: 12px;
  margin-top: 12px;
}

/* ----------------------------------------------------- Archive (tag/author) */
.archive-header {
  padding: 64px 28px 48px;
  border-bottom: 1px solid var(--rule);
  background: color-mix(in oklab, var(--cat, var(--brand)) 6%, var(--bg));
}
.archive-header__inner {
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  gap: 32px;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
}
.archive-header__title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
}
.archive-header__dek {
  font-family: var(--serif);
  font-style: italic;
  font-size: 20px;
  line-height: 1.45;
  color: var(--ink-2);
  margin: 0;
  max-width: 52ch;
}
.archive-header--author .archive-header__inner { align-items: flex-start; }
.archive-header__avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  background-color: var(--brand);
  color: #FFF;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 32px;
  letter-spacing: -0.02em;
}
.archive-header__author {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  flex: 1 1 auto;
}

/* Year filter pills (right side of archive header) */
.year-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}
.year-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 16px;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.year-pill:hover { color: var(--brand); border-color: var(--brand-line); background: var(--brand-tint); }
.year-pill--active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.year-pill--active:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.year-pills__more { position: relative; }
.year-pills__more > summary {
  list-style: none;
  cursor: pointer;
}
.year-pills__more > summary::-webkit-details-marker { display: none; }
.year-pills__more[open] > summary { background: var(--surface-2); border-color: var(--rule); }
.year-pills__menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 6px;
  box-shadow: var(--shadow-modal);
  min-width: 100px;
}
.year-pills__menu .year-pill {
  border-color: transparent;
  border-radius: 4px;
  justify-content: flex-start;
  width: 100%;
}
.year-pills__menu .year-pill:hover { background: var(--brand-tint); }

.archive-filter-hint {
  margin: 0 0 20px;
  padding: 10px 14px;
  background: var(--brand-tint);
  border: 1px solid var(--brand-line);
  border-radius: 4px;
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--ink-2);
}

.archive-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.archive-list__item {
  display: grid;
  grid-template-columns: 110px 1fr 90px;
  gap: 28px;
  align-items: baseline;
  padding: 24px 0;
}
.archive-list__item + .archive-list__item {
  border-top: 1px solid var(--rule-soft);
}
.archive-list__num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-3);
}
.archive-list__title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
  text-wrap: balance;
}
.archive-list__dek {
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-2);
  margin: 0;
}
.archive-list__minutes {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-3);
  text-align: right;
}
.archive-list__item:hover .archive-list__title { color: var(--brand); }

/* ----------------------------------------------------- Pagination */
.pagination {
  margin-top: 32px;
  padding: 20px 0;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--sans);
  font-size: 13px;
  gap: 8px;
}
.pagination a { color: var(--brand); font-weight: 600; }
.pagination__disabled { color: var(--ink-4); }
.pagination__page { color: var(--ink-3); }

/* ----------------------------------------------------- Static page */
.page-hero {
  padding: 72px 28px 40px;
  border-bottom: 1px solid var(--rule);
}
.page-hero__inner {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}
.page-hero__title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(36px, 6vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 14px 0 18px;
  text-wrap: balance;
}
.page-hero__dek {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(17px, 1.8vw, 21px);
  line-height: 1.5;
  color: var(--ink-2);
  margin: 0 auto;
  max-width: 52ch;
}
.page-content {
  padding: 56px 28px;
}
.page-content__inner {
  max-width: var(--measure);
  margin: 0 auto;
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.65;
}

/* ----------------------------------------------------- Narrow doc page
   Used by custom-narrow-doc.hbs for /terms/, /privacy/, /support/,
   /colophon/, /newsletter/. Tighter measure, denser headings, sticky
   in-page section nav rail on the left at desktop. */
.doc-page__hero {
  padding: 64px 28px 36px;
  border-bottom: 1px solid var(--rule);
}
.doc-page__inner {
  max-width: 720px;
  margin: 0 auto;
}
.doc-page__title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 12px 0 14px;
  text-wrap: balance;
}
.doc-page__dek {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(16px, 1.6vw, 19px);
  line-height: 1.5;
  color: var(--ink-2);
  margin: 0;
  max-width: 52ch;
}
.doc-page__body {
  padding: 48px 28px 64px;
}
.doc-page__grid {
  max-width: 720px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 36px;
}
.doc-page__nav-rail {
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--ink-3);
}
.doc-page__nav-sticky {
  position: sticky;
  top: calc(var(--header-height) + 16px);
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.doc-page__nav-sticky nav {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.doc-page__nav-sticky a {
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--ink-2);
  padding: 4px 0 4px 10px;
  border-left: 2px solid var(--rule);
  text-decoration: none;
}
.doc-page__nav-sticky a:hover { color: var(--brand); border-left-color: var(--brand-line); }
.doc-page__nav-sticky a.is-active {
  color: var(--brand);
  font-weight: 600;
  border-left-color: var(--brand);
}
.doc-page__content {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.65;
  max-width: none;
}
.doc-page__content > * + * { margin-top: 0; }
.doc-page__content p,
.doc-page__content ul,
.doc-page__content ol { margin: 0 0 0.9em; color: var(--ink-2); }
.doc-page__content h2 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.005em;
  line-height: 1.25;
  margin: 1.6em 0 0.4em;
  color: var(--ink);
  scroll-margin-top: calc(var(--header-height) + 16px);
}
.doc-page__content h3 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.005em;
  line-height: 1.3;
  margin: 1.4em 0 0.4em;
  color: var(--ink);
  scroll-margin-top: calc(var(--header-height) + 16px);
}
.doc-page__content h2:first-child,
.doc-page__content > section:first-child h2 { margin-top: 0; }

/* Drop-cap is too dramatic for legal copy — disable */
.doc-page__content > p:first-child::first-letter { all: unset; }

/* ----------------------------------------------------- Error 404 */
.error-page {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 28px;
}
.error-page__inner {
  max-width: 540px;
  text-align: center;
}
.error-page__digits {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(96px, 14vw, 168px);
  line-height: 0.85;
  letter-spacing: -0.04em;
  color: var(--brand);
  margin-bottom: 16px;
}
.error-page__title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin: 12px 0 16px;
  text-wrap: balance;
}
.error-page__dek {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink-2);
  margin: 0 0 28px;
}
.error-page__actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ----------------------------------------------------- Footer */
.site-footer {
  padding: 40px 28px 28px;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-3);
  background: var(--bg);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
}
.site-footer__brand {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.site-footer__nav,
.site-footer__nav ul,
.site-footer__nav ol {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-footer__nav li { list-style: none; margin: 0; padding: 0; }
.site-footer__nav a:hover { color: var(--brand); }

/* ----------------------------------------------------- Search modal */
.search-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 80px 16px 16px;
  background: color-mix(in oklab, var(--ink) 50%, transparent);
}
.search-modal[aria-hidden="false"] { display: flex; }
.search-modal__panel {
  width: 100%;
  max-width: 560px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 4px;
  box-shadow: var(--shadow-modal);
  overflow: hidden;
}
.search-modal__head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  gap: 10px;
}
.search-modal__input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--serif);
  font-size: 17px;
  color: var(--ink);
  outline: none;
}
.search-modal__esc {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  padding: 2px 6px;
  border: 1px solid var(--rule);
  border-radius: 3px;
}
.search-modal__results {
  padding: 8px 0;
  max-height: 60vh;
  overflow-y: auto;
}
.search-modal__foot {
  padding: 10px 16px;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  font-family: var(--sans);
  font-size: 11px;
  color: var(--ink-3);
}

/* ----------------------------------------------------- Mobile nav drawer */
.nav-drawer {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
}
.nav-drawer[aria-hidden="false"] { display: block; }
.nav-drawer__scrim {
  position: absolute;
  inset: 0;
  background: color-mix(in oklab, var(--ink) 50%, transparent);
}
.nav-drawer__panel {
  position: relative;
  width: min(320px, 88vw);
  height: 100%;
  background: var(--paper);
  border-right: 1px solid var(--rule);
  padding: 24px 20px;
  overflow-y: auto;
}
.nav-drawer__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}
.nav-drawer__sections,
.nav-drawer__categories,
.nav-drawer__sections ul,
.nav-drawer__sections ol {
  display: flex;
  flex-direction: column;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-drawer__sections li { list-style: none; margin: 0; padding: 0; }
.nav-drawer__sections a,
.nav-drawer__categories a {
  padding: 12px 0;
  border-bottom: 1px solid var(--rule-soft);
  font-family: var(--serif);
  font-size: 18px;
  color: var(--ink);
}
.nav-drawer__categories a {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  padding: 10px 0;
}

/* ----------------------------------------------------- Members / Portal */
/* Ghost ships Portal as a separate iframe; we only style the inline subscribe. */
.subscribe-card {
  max-width: 420px;
  margin: 40px auto;
  padding: 32px;
  background: var(--paper);
  border: 1px solid var(--rule);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

/* ----------------------------------------------------- Responsive */
@media (max-width: 980px) {
  .feature-row__grid {
    grid-template-columns: 1fr 1fr;
  }
  .article-body__grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .article-rail { display: none; }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .site-header__nav { display: none; }
  .site-header__actions .btn { display: none; }
  .site-header__menu-btn { display: inline-flex; }
  .site-header__inner { padding: 12px 16px; }
  .site-dateline { padding: 8px 16px; font-size: 10px; }

  .hero {
    padding: 32px 16px 28px;
  }
  .hero__title { font-size: 32px; line-height: 1.08; letter-spacing: -0.015em; }
  .hero__dek { font-size: 16px; }

  .feature-row { padding: 24px 16px; }
  .feature-row__grid { grid-template-columns: 1fr; gap: 24px; }
  .feature-card__title { font-size: 22px; }

  .category-rail { padding: 24px 16px; }
  .category-rail__heading { font-size: 22px; }
  .category-grid { grid-template-columns: 1fr 1fr; }
  .category-tile { padding: 14px 12px; }
  .category-tile__count { font-size: 22px; }

  .article-hero { padding: 32px 16px 24px; }
  .article-hero__title { font-size: 32px; line-height: 1.08; }
  .article-hero__dek { font-size: 16px; }

  .article-body { padding: 28px 18px; }
  .article-content { font-size: 17px; line-height: 1.65; }
  .article-content > p:first-child::first-letter,
  .article-content .has-dropcap::first-letter { font-size: 56px; padding: 4px 8px 0 0; }
  .article-content blockquote,
  .article-content figure.kg-quote-card { margin: 1.8em -18px; padding: 20px 18px; }

  .archive-header { padding: 36px 16px 28px; }
  .archive-header__title { font-size: 38px; }
  .archive-header__dek { font-size: 16px; }
  .archive-list__item { grid-template-columns: 1fr; gap: 6px; padding: 20px 0; }
  .archive-list__minutes { display: none; }
  .archive-list__title { font-size: 20px; }
  .year-pills { width: 100%; margin-top: 12px; overflow-x: auto; scrollbar-width: none; }
  .year-pills::-webkit-scrollbar { display: none; }

  .page-hero { padding: 40px 16px 28px; }
  .page-hero__inner { text-align: left; }
  .page-hero__title { font-size: 40px; }
  .page-content { padding: 32px 18px; }

  .doc-page__hero { padding: 36px 16px 24px; }
  .doc-page__title { font-size: 36px; }
  .doc-page__body { padding: 28px 18px; }
  .doc-page__grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .doc-page__nav-rail { display: none; }
  .doc-page__content { font-size: 16px; }
  .doc-page__content h2 { font-size: 22px; }
  .doc-page__content h3 { font-size: 18px; }
  .page-content__inner { font-size: 17px; }

  .error-page { padding: 60px 18px; }

  .site-footer {
    padding: 32px 16px 24px;
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
  }
  .site-footer__nav { gap: 18px; }
}

/* ----------------------------------------------------- Koenig editor cards */
/* Wide / full-bleed images break out of the reading measure */
.article-content .kg-width-wide,
.article-content figure.kg-width-wide {
  width: 100%;
  max-width: min(100vw, 1140px);
  margin-left: 50%;
  transform: translateX(-50%);
  position: relative;
}
.article-content .kg-width-full,
.article-content figure.kg-width-full {
  width: 100vw;
  max-width: 100vw;
  margin-left: 50%;
  transform: translateX(-50%);
  position: relative;
}
.article-content .kg-width-full img,
.article-content .kg-width-wide img { width: 100%; height: auto; }

.article-content .kg-image-card { margin: 1.8em 0; }
.article-content .kg-image-card figcaption { margin-top: 8px; }

.article-content .kg-gallery-card { margin: 1.8em 0; }
.article-content .kg-gallery-row { display: flex; flex-direction: row; gap: 8px; }
.article-content .kg-gallery-image { flex: 1; }

.article-content .kg-embed-card { margin: 1.8em 0; }
.article-content .kg-embed-card iframe { display: block; max-width: 100%; }

.article-content .kg-callout-card {
  display: flex;
  gap: 14px;
  padding: 18px 22px;
  margin: 1.8em 0;
  border-radius: 4px;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.55;
  background: var(--brand-tint);
  border-left: 3px solid var(--brand);
  color: var(--ink);
}
.article-content .kg-callout-card-grey { background: var(--surface-2); border-left-color: var(--ink-3); }
.article-content .kg-callout-card-white { background: var(--paper); border-left-color: var(--rule); }
.article-content .kg-callout-emoji { font-size: 22px; line-height: 1.4; }

.article-content .kg-toggle-card {
  margin: 1.8em 0;
  padding: 18px 22px;
  border: 1px solid var(--rule);
  border-radius: 4px;
}
.article-content .kg-toggle-card .kg-toggle-heading {
  cursor: pointer;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 18px;
  margin: 0;
}
.article-content .kg-toggle-content { margin-top: 12px; }

.article-content .kg-button-card { margin: 1.8em 0; text-align: center; }
.article-content .kg-button-card a {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  padding: 10px 22px;
  border-radius: 4px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
}

.article-content .kg-header-card {
  margin: 2em 0;
  padding: 32px;
  background: var(--surface-2);
  text-align: center;
  border-radius: 4px;
}
.article-content .kg-header-card h2 { margin: 0 0 12px; }

.article-content .kg-product-card {
  margin: 1.8em 0;
  padding: 20px;
  border: 1px solid var(--rule);
  border-radius: 4px;
}

.article-content .kg-file-card {
  margin: 1.8em 0;
  padding: 18px 22px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  display: flex;
  gap: 14px;
  align-items: center;
}

.article-content .kg-audio-card,
.article-content .kg-video-card { margin: 1.8em 0; }

.article-content .kg-nft-card {
  margin: 1.8em 0;
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
}

/* Ghost signup card — restyle to match newsletter-inline CTA.
   Applies on both post bodies and narrow-doc pages. */
.kg-signup-card {
  margin: 32px 0;
  padding: 28px 32px;
  background: var(--brand-tint);
  border: 1px solid var(--brand-line);
  border-radius: 2px;
  box-shadow: none;
  position: relative;
  overflow: hidden;
}
.kg-signup-card.kg-style-light {
  background: var(--brand-tint);
  border-color: var(--brand-line);
  color: var(--ink);
}
.kg-signup-card.kg-style-dark {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}
.kg-signup-card.kg-style-accent {
  background: var(--brand);
  border-color: var(--brand-ink);
  color: #ffffff;
}
.kg-signup-card-content {
  max-width: none;
  margin: 0;
}
.kg-signup-card-text {
  margin: 0 0 18px;
}
.kg-signup-card-heading,
.kg-signup-card h2,
.kg-signup-card h3 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin: 0 0 8px;
  color: inherit;
}
.kg-signup-card-subheading,
.kg-signup-card p {
  font-family: var(--serif);
  font-size: 14.5px;
  line-height: 1.5;
  margin: 0 0 4px;
  color: inherit;
  opacity: 0.85;
}
.kg-signup-card-form,
.kg-signup-card form { margin: 0; }
.kg-signup-card-fields,
.kg-signup-card-form > div {
  display: flex;
  flex-direction: row;
  gap: 8px;
  align-items: stretch;
  flex-wrap: wrap;
}
.kg-signup-card input[type="email"],
.kg-signup-card-input {
  flex: 1 1 220px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--rule);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 14px;
  border-radius: 2px;
  color: var(--ink);
  outline: none;
}
.kg-signup-card input[type="email"]:focus,
.kg-signup-card-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand-line);
}
.kg-signup-card button,
.kg-signup-card-button {
  background: var(--brand);
  color: #ffffff;
  padding: 10px 18px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.02em;
  border-radius: 2px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 120ms ease;
}
.kg-signup-card button:hover,
.kg-signup-card-button:hover { background: var(--brand-ink); }
.kg-signup-card-disclaimer,
.kg-signup-card .gh-portal-signup-message {
  margin-top: 12px;
  font-family: var(--sans);
  font-size: 11.5px;
  color: var(--ink-3);
}
.kg-signup-card-success {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink-2);
  padding: 8px 0;
}
.kg-signup-card-image {
  display: none; /* The brand-tint flat treatment doesn't pair well with hero imagery in the card */
}

@media (max-width: 720px) {
  .kg-signup-card {
    margin: 24px 0;
    padding: 22px 18px;
  }
  .kg-signup-card-heading,
  .kg-signup-card h2,
  .kg-signup-card h3 { font-size: 22px; }
  .kg-signup-card-fields,
  .kg-signup-card-form > div { flex-direction: column; }
}

/* ----------------------------------------------------- Custom font support
   Ghost admin lets users pick body/heading fonts; expose via CSS variables. */
:root {
  --gh-font-heading: var(--serif);
  --gh-font-body: var(--sans);
}
.gh-font-heading-modern-sans { --gh-font-heading: "Concourse", "Helvetica Neue", Helvetica, system-ui, sans-serif; }
.gh-font-heading-modern-serif { --gh-font-heading: "Source Serif Pro", "Charter", Georgia, serif; }
.gh-font-heading-elegant-serif { --gh-font-heading: "Playfair Display", "Charter", Georgia, serif; }
.gh-font-heading-sans { --gh-font-heading: "Helvetica Neue", system-ui, sans-serif; }
.gh-font-heading-serif { --gh-font-heading: Georgia, "Charter", serif; }
.gh-font-body-modern-sans { --gh-font-body: "Concourse", "Helvetica Neue", Helvetica, system-ui, sans-serif; }
.gh-font-body-modern-serif { --gh-font-body: "Source Serif Pro", "Charter", Georgia, serif; }
.gh-font-body-elegant-serif { --gh-font-body: "Lora", "Charter", Georgia, serif; }
.gh-font-body-sans { --gh-font-body: "Helvetica Neue", system-ui, sans-serif; }
.gh-font-body-serif { --gh-font-body: Georgia, "Charter", serif; }

/* Print — keep it readable */
@media print {
  .site-header, .site-footer, .reading-progress, .article-rail,
  .newsletter-inline, .related, .nav-drawer, .search-modal { display: none !important; }
  body { background: #fff; color: #000; }
  .article-content { font-size: 11pt; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
