/* ==========================================================================
   Writer — a refined editorial Ghost theme
   Hand-crafted, dependency-free stylesheet. No build step required.
   ========================================================================== */

/* ---------------------------------------------------------------------------
   1. Design tokens
   --------------------------------------------------------------------------- */
:root {
  /* Type — falls back to Ghost admin custom fonts (--gh-font-*) when set */
  --font-display: var(--gh-font-heading, "Bricolage Grotesque", "Helvetica Neue", sans-serif);
  --font-body: var(--gh-font-body, "Spline Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif);
  --font-mono: "Spline Sans Mono", ui-monospace, "SF Mono", "Menlo", monospace;

  /* Light palette (cool porcelain) */
  --paper: #ebecea;
  --paper-raised: #f6f7f5;
  --paper-sunken: #e1e3df;
  --ink: #14171a;
  --ink-soft: #3c4146;
  --muted: #777d80;
  --line: rgba(20, 23, 26, 0.10);
  --line-strong: rgba(20, 23, 26, 0.20);
  --accent: var(--ghost-accent-color, #15605a);
  --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
  --accent-hover: color-mix(in srgb, var(--accent) 80%, #000);
  --on-accent: #ffffff;
  --shadow-sm: 0 1px 2px rgba(20, 23, 26, 0.07), 0 2px 8px rgba(20, 23, 26, 0.05);
  --shadow-md: 0 10px 28px rgba(20, 23, 26, 0.10), 0 2px 6px rgba(20, 23, 26, 0.06);
  --shadow-lg: 0 26px 64px rgba(20, 23, 26, 0.16), 0 8px 18px rgba(20, 23, 26, 0.07);

  /* Layout */
  --measure: 680px;
  --wide: 1200px;
  --gutter: clamp(1.25rem, 5vw, 3rem);
  --radius: 4px;
  --radius-lg: 12px;
  --header-h: 76px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

html[data-scheme="dark"] {
  --paper: #0f1214;
  --paper-raised: #181c1e;
  --paper-sunken: #0a0c0e;
  --ink: #e6eae9;
  --ink-soft: #b3b9b9;
  --muted: #6e7477;
  --line: rgba(230, 234, 233, 0.10);
  --line-strong: rgba(230, 234, 233, 0.20);
  --accent: var(--ghost-accent-color, #54c6b6);
  --accent-soft: color-mix(in srgb, var(--accent) 18%, transparent);
  --accent-hover: color-mix(in srgb, var(--accent) 78%, #fff);
  --on-accent: #ffffff;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.6);
}

@media (prefers-color-scheme: dark) {
  html[data-scheme="auto"] {
    --paper: #0f1214;
    --paper-raised: #181c1e;
    --paper-sunken: #0a0c0e;
    --ink: #e6eae9;
    --ink-soft: #b3b9b9;
    --muted: #6e7477;
    --line: rgba(230, 234, 233, 0.10);
    --line-strong: rgba(230, 234, 233, 0.20);
    --accent: var(--ghost-accent-color, #54c6b6);
    --accent-soft: color-mix(in srgb, var(--accent) 18%, transparent);
    --accent-hover: color-mix(in srgb, var(--accent) 78%, #fff);
    --on-accent: #ffffff;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.6);
  }
}

/* ---------------------------------------------------------------------------
   2. Reset & base
   --------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(120% 90% at 50% 0%, var(--accent-soft) 0%, transparent 42%),
    radial-gradient(100% 80% at 50% 100%, var(--accent-soft) 0%, transparent 48%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "kern", "liga", "calt";
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* subtle paper grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.035;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
html[data-scheme="dark"] body::before,
html[data-scheme="auto"] body::before { mix-blend-mode: screen; opacity: 0.04; }

img, picture, svg, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--accent); color: var(--on-accent); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 560;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-optical-sizing: auto;
}

/* ---------------------------------------------------------------------------
   3. Layout helpers
   --------------------------------------------------------------------------- */
.wrap { width: 100%; max-width: var(--wide); margin-inline: auto; padding-inline: var(--gutter); }
.wrap--narrow { max-width: calc(var(--measure) + 4rem); }
.site { position: relative; z-index: 2; display: flex; flex-direction: column; min-height: 100vh; }
.site-main { flex: 1 0 auto; padding-top: clamp(2.25rem, 5vw, 3.5rem); }
.eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  font-family: var(--font-body);
}
.section-rule {
  display: flex; align-items: center; gap: 1.25rem;
  margin: 0 0 2.5rem;
}
.section-rule::after { content: ""; flex: 1; height: 1px; background: var(--line-strong); }
.section-rule h2 { font-size: clamp(1.5rem, 3vw, 2rem); }

/* ---------------------------------------------------------------------------
   4. Reading progress
   --------------------------------------------------------------------------- */
.reading-progress {
  position: fixed; top: 0; left: 0; z-index: 60;
  height: 3px; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  transition: width 0.1s linear;
}

/* ---------------------------------------------------------------------------
   5. Header
   --------------------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line-strong);
  transition: box-shadow 0.3s var(--ease), background 0.3s var(--ease);
}
.site-header.is-stuck { box-shadow: var(--shadow-sm); }

.header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1.5rem;
  min-height: var(--header-h);
}
.brand { grid-column: 1; justify-self: start; }
.brand a { display: inline-flex; align-items: center; gap: 0.6rem; }
.brand img { max-height: 38px; width: auto; }
.brand-title {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.2vw, 1.7rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

/* Centered tag navigation */
.nav-tags { grid-column: 2; justify-self: center; min-width: 0; }
.nav-tags ul { display: flex; align-items: center; gap: 1.4rem; list-style: none; padding: 0; }
.nav-tags a {
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.02em;
  color: var(--ink-soft);
  position: relative; padding: 0.35rem 0; white-space: nowrap;
  transition: color 0.2s var(--ease);
}
.nav-tags a::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 1.5px; width: 0;
  background: var(--accent); transition: width 0.28s var(--ease);
}
.nav-tags a:hover { color: var(--ink); }
.nav-tags a:hover::after { width: 100%; }

.header-actions { grid-column: 3; justify-self: end; display: flex; align-items: center; gap: 0.35rem; }
.icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: 50%;
  color: var(--ink-soft);
  transition: background 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease);
}
.icon-btn:hover { background: var(--paper-sunken); color: var(--ink); }
.icon-btn:active { transform: scale(0.92); }
.icon-btn svg { width: 19px; height: 19px; }
.theme-toggle .moon { display: none; }
html[data-scheme="dark"] .theme-toggle .sun,
html[data-scheme="auto"] .theme-toggle .sun { display: none; }
html[data-scheme="dark"] .theme-toggle .moon,
html[data-scheme="auto"] .theme-toggle .moon { display: block; }

.subscribe-btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.5rem 1.05rem; border-radius: 100px;
  background: var(--ink); color: var(--paper);
  font-size: 0.82rem; font-weight: 600; letter-spacing: 0.01em;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.subscribe-btn:hover { background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-sm); transform: translateY(-1px); }

.nav-toggle { display: none; }

/* Mobile drawer */
.mobile-nav {
  position: fixed; inset: 0; z-index: 70;
  background: var(--paper);
  background-image: radial-gradient(130% 80% at 100% 0%, var(--accent-soft), transparent 55%);
  display: flex; flex-direction: column;
  transform: translateY(-100%);
  visibility: hidden; opacity: 0;
  transition: transform 0.5s var(--ease), visibility 0.5s var(--ease), opacity 0.4s var(--ease);
  overflow-y: auto;
}
.mobile-nav.is-open { transform: translateY(0); visibility: visible; opacity: 1; }
.mobile-nav-inner { display: flex; flex-direction: column; min-height: 100%; padding-bottom: 2.5rem; }
.mobile-nav-top { display: flex; justify-content: space-between; align-items: center; min-height: var(--header-h); }
.mobile-nav-top .brand-title { font-size: 1.15rem; }
.mobile-nav-label { display: block; margin: 1.75rem 0 0.5rem; }

.mobile-menu { list-style: none; padding: 0; margin: 0; counter-reset: m; }
.mobile-menu li {
  counter-increment: m;
  border-bottom: 1px solid var(--line);
  opacity: 0; transform: translateY(14px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
  transition-delay: calc(var(--i, 0) * 0.045s + 0.12s);
}
.mobile-nav.is-open .mobile-menu li { opacity: 1; transform: none; }
.mobile-menu a {
  display: flex; align-items: baseline; gap: 1rem;
  padding: 1.05rem 0.25rem;
  font-family: var(--font-display);
  font-size: 1.5rem; font-weight: 500; letter-spacing: -0.02em; line-height: 1.1;
  color: var(--ink);
  transition: color 0.2s var(--ease), padding-left 0.25s var(--ease);
}
.mobile-menu a:hover, .mobile-menu a:focus-visible { color: var(--accent); padding-left: 0.6rem; }
.m-index {
  font-family: var(--font-mono); font-size: 0.7rem; font-weight: 500;
  color: var(--muted); width: 1.7rem; flex-shrink: 0; letter-spacing: 0.04em;
  transition: color 0.2s var(--ease);
}
.m-index::before { content: counter(m, decimal-leading-zero); }
.mobile-menu a:hover .m-index { color: var(--accent); }
.m-label { flex: 1; }
.m-arrow { width: 20px; height: 20px; align-self: center; color: var(--muted); flex-shrink: 0; transition: transform 0.25s var(--ease), color 0.2s var(--ease); }
.mobile-menu a:hover .m-arrow { transform: translateX(5px); color: var(--accent); }

.mobile-nav-foot { margin-top: auto; padding-top: 2.25rem; display: flex; flex-direction: column; gap: 1.25rem; }
.mobile-nav-foot .subscribe-btn { justify-content: center; width: 100%; font-size: 1rem; padding: 0.95rem 1.5rem; }

/* ---------------------------------------------------------------------------
   6. Masthead / publication intro
   --------------------------------------------------------------------------- */
.masthead { text-align: center; padding: clamp(1rem, 3vw, 2rem) 0 clamp(2.5rem, 5vw, 3.75rem); }
.masthead .eyebrow { display: inline-block; margin-bottom: 1.25rem; }
.masthead h1 {
  font-size: clamp(2.4rem, 7vw, 4.5rem);
  font-weight: 480; letter-spacing: -0.03em; line-height: 1.0;
}
.masthead p {
  max-width: 40ch; margin: 1.5rem auto 0;
  color: var(--ink-soft); font-size: 1.15rem; line-height: 1.55;
}

/* ---------------------------------------------------------------------------
   7. Featured hero
   --------------------------------------------------------------------------- */
.hero { margin-bottom: clamp(3rem, 7vw, 5rem); }
.hero-card {
  display: grid; grid-template-columns: 1.1fr 1fr;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
}
.hero-media { position: relative; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg); }
.hero-media::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 1px var(--line); border-radius: var(--radius-lg); }
.hero-media img { width: 100%; aspect-ratio: 5 / 4; object-fit: cover; transition: transform 0.8s var(--ease); }
.hero-card:hover .hero-media img { transform: scale(1.04); }
.hero-body .eyebrow { margin-bottom: 1rem; }
.hero-body h2 {
  font-size: clamp(2rem, 4.2vw, 3.25rem);
  font-weight: 500; letter-spacing: -0.025em; margin-bottom: 1rem;
}
.hero-body h2 a { background-image: linear-gradient(var(--accent), var(--accent)); background-size: 0% 1.5px; background-position: 0 100%; background-repeat: no-repeat; transition: background-size 0.4s var(--ease); }
.hero-body h2 a:hover { background-size: 100% 1.5px; }
.hero-body .excerpt { font-size: 1.1rem; color: var(--ink-soft); margin-bottom: 1.5rem; max-width: 46ch; }

/* ---------------------------------------------------------------------------
   8. Post cards / feed grid
   --------------------------------------------------------------------------- */
.post-feed {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: clamp(2rem, 3.5vw, 3rem) clamp(1.25rem, 2.5vw, 2rem);
}

.p-card { display: flex; flex-direction: column; }
.p-card-media {
  position: relative; display: block; overflow: hidden;
  border-radius: var(--radius-lg); aspect-ratio: 3 / 2;
  background: var(--paper-sunken); box-shadow: var(--shadow-sm);
}
.p-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s var(--ease); }
.p-card:hover .p-card-media img { transform: scale(1.05); }
.p-card-media.is-placeholder { display: grid; place-items: center; }
.p-card-media.is-placeholder span {
  font-family: var(--font-display); font-size: 3rem; color: var(--line-strong);
}
.p-card-body { padding-top: 1.15rem; display: flex; flex-direction: column; flex: 1; }
.p-card-tag {
  display: inline-block; margin-bottom: 0.7rem;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent);
}
.p-card-title {
  font-size: 1.28rem; font-weight: 560; line-height: 1.16; letter-spacing: -0.02em;
  margin-bottom: 0.55rem;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.p-card-title a { transition: color 0.2s var(--ease); }
.p-card:hover .p-card-title a { color: var(--accent); }
.p-card-excerpt {
  color: var(--ink-soft); font-size: 0.94rem; line-height: 1.55; margin-bottom: 1rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.p-card-meta {
  margin-top: auto; display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.78rem; color: var(--muted); letter-spacing: 0.01em;
}
.p-card-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--muted); }

.meta-author { display: inline-flex; align-items: center; gap: 0.45rem; }
.meta-author img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }

/* ---------------------------------------------------------------------------
   9. Pagination
   --------------------------------------------------------------------------- */
.pagination {
  display: flex; align-items: center; justify-content: center; gap: 1.5rem;
  margin-top: clamp(3rem, 6vw, 5rem);
  font-size: 0.85rem; font-weight: 600;
}
.pagination a, .page-load-more {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.7rem 1.4rem; border: 1px solid var(--line-strong); border-radius: 100px;
  color: var(--ink); transition: all 0.2s var(--ease);
}
.pagination a:hover, .page-load-more:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.pagination .page-status { color: var(--muted); letter-spacing: 0.04em; }

/* ---------------------------------------------------------------------------
   10. Archive / tag / author headers
   --------------------------------------------------------------------------- */
.archive-head { text-align: center; padding: clamp(0.5rem, 2vw, 1rem) 0 clamp(2rem, 4vw, 3rem); }
.archive-head .eyebrow { margin-bottom: 1rem; }
.archive-head h1 { font-size: clamp(2.2rem, 6vw, 3.75rem); font-weight: 480; letter-spacing: -0.02em; }
.archive-head p { max-width: 52ch; margin: 1.25rem auto 0; color: var(--ink-soft); font-size: 1.1rem; }
.archive-head .count { margin-top: 1.25rem; font-size: 0.8rem; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }

.author-head { display: flex; flex-direction: column; align-items: center; text-align: center; }
.author-avatar { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; margin-bottom: 1.5rem; box-shadow: var(--shadow-md); border: 3px solid var(--paper-raised); }
.author-social { display: flex; gap: 0.75rem; margin-top: 1.5rem; }
.author-social a {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line-strong); color: var(--ink-soft);
  transition: all 0.2s var(--ease);
}
.author-social a:hover { background: var(--accent); color: var(--on-accent); border-color: var(--accent); transform: translateY(-2px); }
.author-social svg { width: 17px; height: 17px; }

/* ---------------------------------------------------------------------------
   11. Single post
   --------------------------------------------------------------------------- */
.article { padding-top: 0; }
.article-header { text-align: center; max-width: 50rem; margin: 0 auto clamp(2rem, 5vw, 3rem); padding-inline: var(--gutter); }
.article-header .post-tags { margin-bottom: 1.4rem; }
.article-header .post-tags a {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent);
}
.article-title { font-size: clamp(2.1rem, 5.5vw, 3.6rem); font-weight: 480; letter-spacing: -0.025em; line-height: 1.06; }
.article-excerpt { margin-top: 1.4rem; font-size: clamp(1.1rem, 2.2vw, 1.3rem); color: var(--ink-soft); line-height: 1.5; font-family: var(--font-body); font-weight: 400; }

.article-byline {
  display: flex; align-items: center; justify-content: center; gap: 0.85rem;
  margin-top: 2rem; flex-wrap: wrap;
}
.article-byline img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; box-shadow: var(--shadow-sm); }
.byline-text { text-align: left; line-height: 1.4; }
.byline-text .name { font-weight: 600; font-size: 0.95rem; }
.byline-text .meta { font-size: 0.8rem; color: var(--muted); display: flex; gap: 0.4rem; align-items: center; }

.article-feature { margin: clamp(2rem, 5vw, 3.5rem) auto 0; max-width: var(--wide); padding-inline: var(--gutter); }
.article-feature figure { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg); }
.article-feature img { width: 100%; max-height: 70vh; object-fit: cover; }
.article-feature figcaption { text-align: center; font-size: 0.85rem; color: var(--muted); margin-top: 0.9rem; font-style: italic; }

/* ---------------------------------------------------------------------------
   12. Article content (Koenig)
   --------------------------------------------------------------------------- */
.post-content {
  display: grid;
  grid-template-columns:
    [full-start] minmax(var(--gutter), 1fr)
    [wide-start] minmax(0, 7rem)
    [main-start] min(var(--measure), calc(100% - 2 * var(--gutter)))
    [main-end] minmax(0, 7rem)
    [wide-end] minmax(var(--gutter), 1fr) [full-end];
  margin-top: clamp(2.5rem, 6vw, 4rem);
  font-size: 1.15rem;
  line-height: 1.72;
  color: var(--ink-soft);
}
.post-content > * { grid-column: main-start / main-end; }
.post-content > .kg-width-wide { grid-column: wide-start / wide-end; }
.post-content > .kg-width-full { grid-column: full-start / full-end; }

.post-content > p,
.post-content > ul,
.post-content > ol,
.post-content > blockquote,
.post-content > h2,
.post-content > h3,
.post-content > h4,
.post-content > hr,
.post-content > .kg-card { margin-block: 1.5rem; }

.post-content > h2 { font-size: clamp(1.7rem, 3.4vw, 2.2rem); margin-top: 3rem; color: var(--ink); }
.post-content > h3 { font-size: clamp(1.4rem, 2.8vw, 1.7rem); margin-top: 2.4rem; color: var(--ink); }
.post-content > h4 { font-size: 1.25rem; font-family: var(--font-body); font-weight: 700; margin-top: 2rem; color: var(--ink); }
.post-content p { color: var(--ink-soft); }
.post-content a:not(.kg-btn) {
  color: var(--ink); background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 100% 1px; background-position: 0 100%; background-repeat: no-repeat;
  padding-bottom: 1px; transition: background-size 0.2s var(--ease), color 0.2s var(--ease);
}
.post-content a:not(.kg-btn):hover { color: var(--accent); background-size: 100% 2px; }
.post-content strong { color: var(--ink); font-weight: 680; }
.post-content em { font-style: italic; }

/* Drop cap on first paragraph */
/* .post-content > p:first-of-type::first-letter {
  font-family: var(--font-display);
  font-size: 3.6em; line-height: 0.78; font-weight: 500;
  float: left; margin: 0.06em 0.12em 0 0; color: var(--accent);
} */

.post-content ul, .post-content ol { padding-left: 1.4rem; }
.post-content li { margin-block: 0.5rem; padding-left: 0.3rem; }
.post-content li::marker { color: var(--accent); }

.post-content blockquote {
  border-left: 3px solid var(--accent); padding: 0.4rem 0 0.4rem 1.5rem;
  font-family: var(--font-display); font-weight: 500; font-size: 1.3rem;
  letter-spacing: -0.01em; color: var(--ink); line-height: 1.4;
}
.post-content blockquote.kg-blockquote-alt {
  border: none; text-align: center; font-size: 1.7rem; padding: 1rem 0;
}

.post-content hr { border: none; height: 1px; background: var(--line-strong); margin-block: 3rem; position: relative; }
.post-content hr::after {
  content: "❋"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: var(--paper); padding: 0 1rem; color: var(--muted); font-size: 0.9rem;
}

.post-content img, .post-content video { border-radius: var(--radius-lg); width: 100%; }
.post-content figure { margin-block: 2.25rem; }
.post-content figcaption { text-align: center; font-size: 0.85rem; color: var(--muted); margin-top: 0.85rem; font-style: italic; }

/* code */
.post-content :not(pre) > code {
  font-family: var(--font-mono); font-size: 0.85em;
  background: var(--paper-sunken); padding: 0.15em 0.4em; border-radius: 4px;
  border: 1px solid var(--line); color: var(--accent);
}
.post-content pre {
  background: #1a1815; color: #ece5d6;
  padding: 1.25rem 1.4rem; border-radius: var(--radius-lg); overflow-x: auto;
  font-family: var(--font-mono); font-size: 0.88rem; line-height: 1.6;
  box-shadow: var(--shadow-md);
}
.post-content pre code { background: none; border: none; padding: 0; color: inherit; font-size: inherit; }

/* tables */
.post-content table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.post-content th, .post-content td { padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--line); text-align: left; }
.post-content th { font-family: var(--font-body); font-weight: 700; color: var(--ink); border-bottom-color: var(--line-strong); }

/* Koenig cards */
.kg-card { width: 100%; }
.kg-image-card img { margin-inline: auto; }
.kg-image-card.kg-card-hascaption { display: flex; flex-direction: column; }

.kg-gallery-container { display: flex; flex-direction: column; gap: 0.75rem; }
.kg-gallery-row { display: flex; gap: 0.75rem; }
.kg-gallery-image img { width: 100%; height: 100%; object-fit: cover; }

.kg-embed-card, .kg-video-card, .kg-audio-card { display: flex; flex-direction: column; align-items: center; }
.kg-embed-card iframe { max-width: 100%; }

.kg-bookmark-card { width: 100%; }
.kg-bookmark-container {
  display: flex; border: 1px solid var(--line-strong); border-radius: var(--radius-lg);
  overflow: hidden; text-decoration: none; color: var(--ink);
  background: var(--paper-raised); box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}
.kg-bookmark-container:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.kg-bookmark-content { flex: 1 1 auto; padding: 1.25rem 1.4rem; display: flex; flex-direction: column; }
.kg-bookmark-title { font-family: var(--font-body); font-weight: 700; font-size: 1rem; color: var(--ink); }
.kg-bookmark-description { color: var(--ink-soft); font-size: 0.9rem; margin-top: 0.4rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kg-bookmark-metadata { display: flex; align-items: center; gap: 0.5rem; margin-top: auto; padding-top: 0.8rem; font-size: 0.8rem; color: var(--muted); }
.kg-bookmark-icon { width: 18px; height: 18px; border-radius: 3px; }
.kg-bookmark-thumbnail { position: relative; min-width: 33%; max-width: 240px; }
.kg-bookmark-thumbnail img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 0; }

.kg-callout-card {
  display: flex; gap: 0.8rem; padding: 1.1rem 1.3rem; border-radius: var(--radius-lg);
  background: var(--accent-soft); border: 1px solid var(--line); align-items: flex-start;
}
.kg-callout-emoji { font-size: 1.2rem; }
.kg-callout-text { color: var(--ink); font-size: 1rem; }

.kg-toggle-card { border-bottom: 1px solid var(--line-strong); }
.kg-toggle-heading { display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
.kg-toggle-heading-text { font-family: var(--font-display); font-size: 1.2rem; color: var(--ink); padding: 1rem 0; }

.kg-btn {
  display: inline-flex; align-items: center; padding: 0.75rem 1.6rem; border-radius: 100px;
  font-family: var(--font-body); font-weight: 600; font-size: 0.95rem;
  background: var(--accent); color: var(--on-accent); transition: transform 0.2s var(--ease), background 0.2s var(--ease);
}
.kg-btn:hover { background: var(--accent-hover); transform: translateY(-1px); }
.kg-btn-accent { background: var(--accent); }
.kg-card.kg-button-card { display: flex; }
.kg-button-card.kg-align-center { justify-content: center; }

.kg-header-card { text-align: center; padding: clamp(2rem, 6vw, 4rem) 1rem; border-radius: var(--radius-lg); background: var(--paper-sunken); }
.kg-header-card .kg-header-card-header { font-size: clamp(1.8rem, 4vw, 2.6rem); }

.kg-product-card .kg-product-card-container { border: 1px solid var(--line-strong); border-radius: var(--radius-lg); padding: 1.5rem; }

/* signup / cta card */
.kg-signup-card { border-radius: var(--radius-lg); }

/* ---------------------------------------------------------------------------
   13. Post footer (tags, share, author bio)
   --------------------------------------------------------------------------- */
.article-footer { max-width: calc(var(--measure) + 2rem); margin: clamp(3rem, 6vw, 4rem) auto 0; padding-inline: var(--gutter); }
.post-tag-list { display: flex; flex-wrap: wrap; gap: 0.5rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.post-tag-list a {
  font-size: 0.78rem; font-weight: 600; padding: 0.4rem 0.9rem; border-radius: 100px;
  background: var(--paper-sunken); color: var(--ink-soft); transition: all 0.2s var(--ease);
}
.post-tag-list a:hover { background: var(--accent); color: var(--on-accent); }

.bio-card {
  display: flex; gap: 1.25rem; margin-top: 2.5rem; padding: 1.75rem;
  background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.bio-card img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.bio-card .eyebrow { margin-bottom: 0.35rem; }
.bio-card h3 { font-size: 1.35rem; margin-bottom: 0.4rem; }
.bio-card h3 a:hover { color: var(--accent); }
.bio-card p { color: var(--ink-soft); font-size: 0.95rem; }
.bio-links { display: flex; gap: 1rem; margin-top: 0.75rem; }
.bio-links a { font-size: 0.82rem; font-weight: 600; color: var(--accent); }

/* ---------------------------------------------------------------------------
   14. Related posts & subscribe CTA
   --------------------------------------------------------------------------- */
.related { margin-top: clamp(4rem, 8vw, 6rem); padding: clamp(3rem, 7vw, 5rem) 0; background: var(--paper-sunken); border-top: 1px solid var(--line); }

.cta-band {
  margin-top: clamp(4rem, 8vw, 6rem);
  text-align: center; padding: clamp(3rem, 8vw, 5.5rem) var(--gutter);
  background: var(--ink); color: var(--paper);
  border-radius: var(--radius-lg); position: relative; overflow: hidden;
}
.cta-band::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(80% 120% at 50% 0%, var(--accent-soft), transparent 60%);
  opacity: 0.6;
}
.cta-band > * { position: relative; }
.cta-band h2 { color: var(--paper); font-size: clamp(1.8rem, 4vw, 2.75rem); font-weight: 500; }
.cta-band p { max-width: 44ch; margin: 1rem auto 1.75rem; color: color-mix(in srgb, var(--paper) 75%, transparent); }
.cta-form { display: flex; gap: 0.5rem; max-width: 440px; margin: 0 auto; flex-wrap: wrap; justify-content: center; }
.cta-form input {
  flex: 1; min-width: 220px; padding: 0.85rem 1.2rem; border-radius: 100px;
  background: color-mix(in srgb, var(--paper) 12%, transparent); border: 1px solid color-mix(in srgb, var(--paper) 25%, transparent);
  color: var(--paper);
}
.cta-form input::placeholder { color: color-mix(in srgb, var(--paper) 55%, transparent); }
.cta-form button {
  padding: 0.85rem 1.6rem; border-radius: 100px; background: var(--accent); color: var(--on-accent);
  font-weight: 600; transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}
.cta-form button:hover { background: var(--accent-hover); transform: translateY(-1px); }

/* ---------------------------------------------------------------------------
   15. Comments
   --------------------------------------------------------------------------- */
.comments-section { max-width: calc(var(--measure) + 2rem); margin: clamp(3rem, 6vw, 4rem) auto 0; padding-inline: var(--gutter); }
.comments-section h2 { font-size: 1.6rem; margin-bottom: 1.5rem; }

/* ---------------------------------------------------------------------------
   16. Footer
   --------------------------------------------------------------------------- */
.site-footer { margin-top: clamp(4rem, 8vw, 6rem); padding: clamp(3rem, 6vw, 4.5rem) 0 2.5rem; border-top: 1px solid var(--line); }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 2.5rem; }
.footer-brand h3 { font-size: 1.6rem; margin-bottom: 0.75rem; }
.footer-brand p { color: var(--ink-soft); max-width: 36ch; font-size: 0.95rem; }
.footer-col h4 { font-family: var(--font-body); font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-bottom: 1rem; }
.footer-col ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.footer-col a { font-size: 0.92rem; color: var(--ink-soft); transition: color 0.2s var(--ease); }
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem;
  margin-top: 3rem; padding-top: 1.75rem; border-top: 1px solid var(--line);
  font-size: 0.82rem; color: var(--muted);
}
.footer-social { display: flex; gap: 0.5rem; }
.footer-social a { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-strong); color: var(--ink-soft); transition: all 0.2s var(--ease); }
.footer-social a:hover { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.footer-social svg { width: 16px; height: 16px; }
.footer-bottom p a:hover { color: var(--accent); }

/* ---------------------------------------------------------------------------
   17. Error page
   --------------------------------------------------------------------------- */
.error-page { display: grid; place-items: center; text-align: center; min-height: 70vh; padding: var(--gutter); }
.error-code { font-family: var(--font-display); font-size: clamp(6rem, 22vw, 13rem); font-weight: 300; line-height: 1; color: var(--accent); letter-spacing: -0.03em; }
.error-page h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); margin: 0.5rem 0 1rem; }
.error-page p { color: var(--ink-soft); margin-bottom: 2rem; }

/* ---------------------------------------------------------------------------
   18. Member / subscribe states
   --------------------------------------------------------------------------- */
.member-only-notice { text-align: center; padding: 2rem; background: var(--paper-sunken); border-radius: var(--radius-lg); margin-top: 2rem; }

/* ---------------------------------------------------------------------------
   19. Reveal animations
   --------------------------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: 0.06s; }
.reveal[data-delay="2"] { transition-delay: 0.12s; }
.reveal[data-delay="3"] { transition-delay: 0.18s; }
.reveal[data-delay="4"] { transition-delay: 0.24s; }

/* ---------------------------------------------------------------------------
   20. Responsive
   --------------------------------------------------------------------------- */
/* hide centered tag nav once it gets tight; show the drawer toggle instead */
@media (max-width: 1024px) {
  .nav-tags { display: none; }
  .header-inner { grid-template-columns: 1fr auto; }
  .brand { grid-column: 1; }
  .header-actions { grid-column: 2; }
  .nav-toggle { display: inline-grid; }
}

@media (max-width: 900px) {
  .hero-card { grid-template-columns: 1fr; }
  .hero-media { order: -1; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  :root { --header-h: 64px; }
  .header-actions .subscribe-btn { display: none; }
  .brand-title { font-size: 1.2rem; }
  .header-actions { gap: 0; }
  .post-content > p:first-of-type::first-letter { font-size: 3em; }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .footer-bottom { flex-direction: column-reverse; text-align: center; }
  .article-byline { gap: 0.6rem; }
}

@media (max-width: 480px) {
  .post-feed { grid-template-columns: 1fr; }
  body { font-size: 1rem; }
}
