/* ─────────────────────────────────────────────────────────────
   DEEP: "The Abyss" for Ghost.
   Tokens mirror apps/web/src/styles/theme.css. Keep them in sync.
   Text colors are only ink / mute / dim on abyss / trench / shelf
   (all WCAG AA). Violet and sonar are for marks, rules and fills.
   ───────────────────────────────────────────────────────────── */

/* ---------- Fonts (self-hosted, SIL OFL 1.1; see fonts/LICENSE-*.txt) ---------- */
@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/inter-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}
@font-face {
  font-family: "Space Grotesk Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 300 700;
  src: url("../fonts/space-grotesk-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url("../fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url("../fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
}

/* ---------- Tokens ---------- */
:root {
  --abyss: #07090d;
  --trench: #0b1018;
  --shelf: #111927;
  --ridge: #172133;
  --ink: #f5f7fa;
  --mute: #8793a5;
  --dim: #788496;
  --violet: #8b83ff;
  --violet-deep: #5a52d6;
  --sonar: #42d9c5;
  --line: rgb(255 255 255 / 0.08);
  --line-strong: rgb(255 255 255 / 0.14);

  --font-display: var(
    --gh-font-heading,
    "Space Grotesk Variable",
    "Space Grotesk",
    ui-sans-serif,
    system-ui,
    sans-serif
  );
  --font-sans: var(--gh-font-body, "Inter Variable", "Inter", ui-sans-serif, system-ui, sans-serif);
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --gutter: 16px;
  --content: 720px;
  --wide: 1040px;
  --max: 1200px;
  --header-h: 64px;

  /* Ghost card assets read these. Pin them to the brand regardless of admin setting. */
  --ghost-accent-color: var(--violet);
  color-scheme: dark;
}
@media (min-width: 768px) {
  :root {
    --gutter: 24px;
  }
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  background: var(--abyss);
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
}
body {
  margin: 0;
  background: var(--abyss);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}
img,
video,
svg {
  max-width: 100%;
}
img {
  height: auto;
  display: block;
}
a {
  color: inherit;
}
::selection {
  background: rgb(139 131 255 / 0.35);
}
:focus-visible {
  outline: 1.5px solid var(--violet);
  outline-offset: 2px;
  border-radius: 4px;
}
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0;
  color: var(--ink);
}
p {
  margin: 0;
}

.mono,
time,
.num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.dim {
  color: var(--dim);
}
.sep {
  margin: 0 0.5em;
  color: var(--dim);
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--mute);
  font-weight: 400;
  text-decoration: none;
}
.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 100;
  padding: 8px 12px;
  background: var(--ink);
  color: var(--abyss);
  border-radius: var(--radius-md);
  font-size: 14px;
  text-decoration: none;
}
.skip-link:focus {
  top: 12px;
}

.site {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}
.site-main {
  flex: 1 0 auto;
}

.container,
.container-narrow,
.container-wide {
  width: 100%;
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container {
  max-width: calc(var(--max) + var(--gutter) * 2);
}
.container-narrow {
  max-width: calc(var(--content) + var(--gutter) * 2);
}
.container-wide {
  max-width: calc(var(--wide) + var(--gutter) * 2);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color 0.2s var(--ease),
    border-color 0.2s var(--ease),
    color 0.2s var(--ease);
}
.btn-sm {
  height: 32px;
  padding: 0 12px;
  font-size: 12px;
}
.btn-primary {
  background: var(--ink);
  color: var(--abyss);
  box-shadow:
    0 0 0 1px rgb(255 255 255 / 0.2),
    0 8px 30px -8px rgb(139 131 255 / 0.55);
}
.btn-primary:hover {
  background: #fff;
}
.btn-outline {
  border-color: var(--line-strong);
  color: var(--ink);
  background: transparent;
}
.btn-outline:hover {
  border-color: rgb(139 131 255 / 0.6);
  background: rgb(139 131 255 / 0.05);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--mute);
  cursor: pointer;
  transition:
    color 0.2s var(--ease),
    background-color 0.2s var(--ease);
}
.icon-btn:hover {
  color: var(--ink);
  background: rgb(255 255 255 / 0.04);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgb(7 9 13 / 0.94);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: var(--header-h);
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  flex-shrink: 0;
}
.wordmark .mark {
  width: 20px;
  height: 20px;
  color: var(--violet);
}
.wordmark-text {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.32em;
  line-height: 1;
}
.wordmark-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mute);
  padding-left: 10px;
  border-left: 1px solid var(--line-strong);
  line-height: 1;
}
.site-nav {
  flex: 1;
  min-width: 0;
}
.site-nav .nav {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav .nav a {
  position: relative;
  display: block;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--mute);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}
.site-nav .nav a:hover,
.site-nav .nav-current a {
  color: var(--ink);
}
.site-nav .nav-current a::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -13px;
  height: 1px;
  background: var(--violet);
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.nav-toggle {
  display: none;
}
.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 16px;
  height: 1.5px;
  background: currentColor;
  border-radius: 1px;
  position: relative;
  transition: transform 0.2s var(--ease);
}
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
}
.nav-toggle-bars::before {
  top: -5px;
}
.nav-toggle-bars::after {
  top: 5px;
}
.nav-open .nav-toggle-bars {
  background: transparent;
}
.nav-open .nav-toggle-bars::before {
  transform: translateY(5px) rotate(45deg);
}
.nav-open .nav-toggle-bars::after {
  transform: translateY(-5px) rotate(-45deg);
}

@media (max-width: 767px) {
  .header-inner {
    gap: 12px;
  }
  .wordmark-sub {
    display: none;
  }
  .hide-sm {
    display: none;
  }
  .nav-toggle {
    display: inline-flex;
  }
  .site-nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--trench);
    border-bottom: 1px solid var(--line);
    padding: 8px var(--gutter) 16px;
  }
  .nav-open .site-nav {
    display: block;
  }
  .site-nav .nav {
    flex-direction: column;
    gap: 0;
  }
  .site-nav .nav a {
    padding: 12px 0;
    font-size: 15px;
    border-radius: 0;
    border-bottom: 1px solid var(--line);
  }
  .site-nav .nav-current a::after {
    display: none;
  }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, black 20%, transparent 75%);
  mask-image: radial-gradient(ellipse at 50% 30%, black 20%, transparent 75%);
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -40%;
  width: 900px;
  height: 600px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgb(139 131 255 / 0.14), transparent);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  z-index: 1;
  padding-top: 88px;
  padding-bottom: 72px;
}
.hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.ping {
  position: relative;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sonar);
}
.ping::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--sonar);
  animation: sonar 3.2s var(--ease) infinite;
}
@keyframes sonar {
  0% {
    transform: scale(0.6);
    opacity: 0.55;
  }
  100% {
    transform: scale(2.4);
    opacity: 0;
  }
}
.hero-title {
  margin-top: 20px;
  font-size: clamp(40px, 7vw, 76px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.02;
  max-width: 14ch;
}
.hero-lede {
  margin-top: 20px;
  max-width: 56ch;
  font-size: 17px;
  line-height: 1.6;
  color: var(--mute);
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}
@media (max-width: 767px) {
  .hero-inner {
    padding-top: 56px;
    padding-bottom: 48px;
  }
}

/* ---------- Feed ---------- */
.feed-section {
  padding-top: 48px;
  padding-bottom: 80px;
}
.section-title {
  font-size: 28px;
  margin-bottom: 32px;
}
.section-title .mono {
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0;
}
.post-feed {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
@media (max-width: 1023px) {
  .post-feed {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 639px) {
  .post-feed {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
}

/* First post on the home page spans the row. */
.home-template .feed-section .post-feed > .post-card:first-child:not(.no-image) {
  grid-column: 1 / -1;
}
@media (min-width: 768px) {
  .home-template .feed-section .post-feed > .post-card:first-child:not(.no-image) .post-card-link {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
  }
  .home-template .feed-section .post-feed > .post-card:first-child:not(.no-image) .post-card-image {
    aspect-ratio: auto;
    min-height: 320px;
    border-bottom: 0;
    border-right: 1px solid var(--line);
  }
  .home-template .feed-section .post-feed > .post-card:first-child:not(.no-image) .post-card-body {
    justify-content: center;
    padding: 40px;
  }
  .home-template .feed-section .post-feed > .post-card:first-child:not(.no-image) .post-card-title {
    font-size: 32px;
  }
}

.post-card {
  background: var(--trench);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition:
    border-color 0.25s var(--ease),
    background-color 0.25s var(--ease);
}
.post-card:hover {
  border-color: rgb(139 131 255 / 0.4);
  background: var(--shelf);
}
.post-card:focus-within {
  border-color: rgb(139 131 255 / 0.6);
}
.post-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
}
.post-card-link:focus-visible {
  outline-offset: -2px;
  border-radius: var(--radius-lg);
}
.post-card-image {
  margin: 0;
  aspect-ratio: 16 / 9;
  background: var(--shelf);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.post-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}
.post-card:hover .post-card-image img {
  transform: scale(1.02);
}
.post-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 10px;
  padding: 20px 20px 18px;
}
.post-card-tag {
  color: var(--mute);
}
.post-card-title {
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: -0.015em;
}
.post-card-excerpt {
  color: var(--mute);
  font-size: 14px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card-meta {
  margin-top: auto;
  padding-top: 12px;
  font-size: 12px;
  color: var(--dim);
}
.post-card-meta .sep {
  margin: 0 0.4em;
}

.empty-state {
  padding: 64px 24px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  color: var(--mute);
}
.empty-state .eyebrow {
  margin-bottom: 8px;
}

.pagination {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  margin-top: 48px;
  font-size: 12px;
  color: var(--dim);
}
.pagination > :last-child {
  justify-self: end;
}
.pagination-count {
  text-align: center;
}

/* ---------- Archive headers (tag / author) ---------- */
.archive-header {
  padding-top: 64px;
  padding-bottom: 8px;
}
.archive-title {
  margin-top: 12px;
  font-size: clamp(32px, 5vw, 48px);
  letter-spacing: -0.03em;
}
.archive-lede {
  margin-top: 12px;
  max-width: 60ch;
  color: var(--mute);
  font-size: 16px;
}
.archive-count {
  margin-top: 16px;
  font-size: 12px;
  color: var(--dim);
}
.archive-count a {
  color: var(--mute);
  text-underline-offset: 3px;
  text-decoration-color: rgb(139 131 255 / 0.6);
}
.archive-count a:hover {
  color: var(--ink);
}
.author-header {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}
.author-avatar {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line-strong);
  background: var(--shelf);
}
.author-avatar-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--violet);
}
.author-avatar-empty .mark {
  width: 28px;
  height: 28px;
}

/* ---------- Article ---------- */
.article {
  padding-bottom: 64px;
}
.article-header {
  padding-top: 64px;
  padding-bottom: 32px;
}
.article-tag {
  display: inline-block;
  margin-bottom: 16px;
}
.article-tag:hover {
  color: var(--ink);
}
.article-title {
  font-size: clamp(32px, 5.2vw, 52px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.08;
}
.article-lede {
  margin-top: 18px;
  font-size: 19px;
  line-height: 1.55;
  color: var(--mute);
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--dim);
}
.article-authors a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
}
.article-authors a:hover {
  text-decoration: underline;
  text-decoration-color: var(--violet);
  text-underline-offset: 3px;
}
.article-image {
  margin-top: 8px;
  margin-bottom: 48px;
}
.article-image img {
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
}
.article-image figcaption,
.gh-content figcaption {
  margin-top: 10px;
  text-align: center;
  font-size: 13px;
  color: var(--dim);
}
.article-footer {
  margin-top: 48px;
}
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.chip {
  display: inline-block;
  padding: 4px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--mute);
  text-decoration: none;
  transition:
    color 0.2s var(--ease),
    border-color 0.2s var(--ease);
}
.chip:hover {
  color: var(--ink);
  border-color: rgb(139 131 255 / 0.6);
}

.cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 48px;
  padding: 24px;
  background: var(--trench);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.cta-text {
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
}
@media (max-width: 639px) {
  .cta {
    flex-direction: column;
    align-items: flex-start;
  }
}
.article-comments {
  margin-top: 48px;
}
/* The comments iframe document has no dark color-scheme; matching it avoids the browser's opaque white backdrop. */
.article-comments iframe {
  color-scheme: light;
  background: transparent;
}

.related {
  padding-top: 48px;
  border-top: 1px solid var(--line);
}
.related-title {
  margin-bottom: 20px;
}

/* ---------- Post content ---------- */
.gh-content {
  display: grid;
  grid-template-columns:
    [full-start] minmax(var(--gutter), 1fr)
    [wide-start] minmax(0, calc((var(--wide) - var(--content)) / 2))
    [main-start] min(var(--content), calc(100% - var(--gutter) * 2))
    [main-end] minmax(0, calc((var(--wide) - var(--content)) / 2))
    [wide-end] minmax(var(--gutter), 1fr)
    [full-end];
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink);
}
.gh-content > * {
  grid-column: main-start / main-end;
  margin: 0;
  min-width: 0;
}
.gh-content > * + * {
  margin-top: 1.5em;
}
.gh-content > .kg-width-wide {
  grid-column: wide-start / wide-end;
}
.gh-content > .kg-width-full {
  grid-column: full-start / full-end;
}
.gh-content > .kg-width-full img {
  border-radius: 0;
  border-left: 0;
  border-right: 0;
}

.gh-content > h2 {
  margin-top: 2em;
  font-size: 28px;
}
.gh-content > h3 {
  margin-top: 1.8em;
  font-size: 22px;
}
.gh-content > h4 {
  margin-top: 1.6em;
  font-size: 18px;
}
.gh-content > h2 + *,
.gh-content > h3 + *,
.gh-content > h4 + * {
  margin-top: 0.75em;
}
.gh-content a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: rgb(139 131 255 / 0.7);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s var(--ease);
}
.gh-content a:hover {
  text-decoration-color: var(--violet);
  text-decoration-thickness: 2px;
}
.gh-content strong {
  font-weight: 600;
}
.gh-content ul,
.gh-content ol {
  padding-left: 1.4em;
}
.gh-content li + li {
  margin-top: 0.4em;
}
.gh-content li::marker {
  color: var(--mute);
}
.gh-content ol li::marker {
  font-family: var(--font-mono);
  font-size: 0.9em;
}
.gh-content blockquote:not([class]) {
  padding: 2px 0 2px 20px;
  border-left: 2px solid var(--violet);
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1.5;
  color: var(--ink);
}
.gh-content blockquote.kg-blockquote-alt {
  padding: 0 1em;
  text-align: center;
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 1.4;
  color: var(--mute);
}
.gh-content hr {
  width: 100%;
  height: 1px;
  margin-top: 2.5em;
  margin-bottom: 1em;
  border: 0;
  background: var(--line-strong);
}
.gh-content code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  padding: 0.15em 0.4em;
  background: var(--shelf);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.gh-content pre {
  overflow-x: auto;
  padding: 18px 20px;
  background: var(--trench);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  font-size: 14px;
  line-height: 1.6;
}
.gh-content pre code {
  padding: 0;
  background: none;
  border: 0;
  font-size: inherit;
}
.gh-content table:not(.gist table) {
  display: block;
  overflow-x: auto;
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}
.gh-content th,
.gh-content td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.gh-content th {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--mute);
}
.gh-content figure {
  margin-inline: 0;
}
.gh-content img {
  border-radius: var(--radius-md);
}
.gh-content iframe {
  max-width: 100%;
  border: 0;
}

/* ---------- Koenig cards ---------- */
/* Ghost injects the base card CSS/JS (card_assets: true); these rules re-skin it for the Abyss. */
.kg-image-card img {
  margin-inline: auto;
}
.kg-width-wide img,
.kg-width-full img {
  width: 100%;
}
.kg-embed-card {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.kg-gallery-card + .kg-gallery-card,
.kg-image-card + .kg-image-card {
  margin-top: 0.75em;
}
.kg-gallery-image img {
  border-radius: var(--radius-sm);
}

.kg-callout-card {
  border-radius: var(--radius-lg) !important;
  font-size: 16px;
  line-height: 1.65;
}
.kg-callout-card-grey,
.kg-callout-card-white {
  background: var(--trench) !important;
  box-shadow: inset 0 0 0 1px var(--line) !important;
}
.kg-callout-card-blue {
  background: rgb(139 131 255 / 0.1) !important;
  box-shadow: inset 0 0 0 1px rgb(139 131 255 / 0.25);
}
.kg-callout-card-green {
  background: rgb(66 217 197 / 0.08) !important;
  box-shadow: inset 0 0 0 1px rgb(66 217 197 / 0.22);
}
.kg-callout-card-yellow {
  background: rgb(245 184 74 / 0.08) !important;
  box-shadow: inset 0 0 0 1px rgb(245 184 74 / 0.22);
}
.kg-callout-card-red {
  background: rgb(255 93 115 / 0.08) !important;
  box-shadow: inset 0 0 0 1px rgb(255 93 115 / 0.22);
}
.kg-callout-card-pink,
.kg-callout-card-purple {
  background: rgb(139 131 255 / 0.1) !important;
  box-shadow: inset 0 0 0 1px rgb(139 131 255 / 0.25);
}
.kg-callout-card-accent {
  background: var(--violet) !important;
}
.kg-callout-card-accent,
.kg-callout-card-accent .kg-callout-text,
.kg-callout-card-accent a {
  color: var(--abyss) !important;
}
.kg-callout-text {
  color: inherit;
}

.kg-bookmark-card a.kg-bookmark-container,
.kg-bookmark-container {
  background: var(--trench) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: none !important;
  color: var(--ink) !important;
  text-decoration: none !important;
  overflow: hidden;
  transition: border-color 0.2s var(--ease);
}
.kg-bookmark-container:hover {
  border-color: rgb(139 131 255 / 0.5) !important;
}
.kg-bookmark-title {
  color: var(--ink) !important;
  font-family: var(--font-display);
  font-weight: 600 !important;
}
.kg-bookmark-description,
.kg-bookmark-metadata,
.kg-bookmark-publisher,
.kg-bookmark-author {
  color: var(--mute) !important;
}
.kg-bookmark-metadata {
  font-family: var(--font-mono);
  font-size: 12px !important;
}

.kg-toggle-card {
  background: var(--trench) !important;
  box-shadow: inset 0 0 0 1px var(--line) !important;
  border-radius: var(--radius-lg) !important;
}
.kg-toggle-heading-text {
  font-family: var(--font-display);
  color: var(--ink) !important;
}
.kg-toggle-card-icon svg,
.kg-toggle-card svg {
  color: var(--mute) !important;
}
.kg-toggle-content {
  color: var(--mute);
}

.kg-button-card a.kg-btn,
.kg-btn {
  border-radius: var(--radius-md) !important;
  font-family: var(--font-sans);
  font-weight: 500 !important;
  text-decoration: none !important;
}
.kg-btn-accent,
.kg-button-card a.kg-btn-accent {
  background: var(--ink) !important;
  color: var(--abyss) !important;
  box-shadow:
    0 0 0 1px rgb(255 255 255 / 0.2),
    0 8px 30px -8px rgb(139 131 255 / 0.55);
}
.kg-btn-accent:hover {
  background: #fff !important;
}

.kg-header-card {
  border-radius: var(--radius-lg);
}
.kg-header-card.kg-width-full {
  border-radius: 0;
}
.kg-header-card h2,
.kg-header-card .kg-header-card-header,
.kg-header-card .kg-header-card-heading {
  font-family: var(--font-display) !important;
  letter-spacing: -0.02em;
}
.kg-header-card.kg-style-dark {
  background: var(--shelf) !important;
}
.kg-header-card.kg-style-accent {
  background: var(--violet-deep) !important;
}

.kg-product-card-container,
.kg-signup-card,
.kg-cta-card {
  background: var(--trench) !important;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg) !important;
  color: var(--ink);
}
.kg-product-card-title {
  font-family: var(--font-display);
  color: var(--ink) !important;
}
.kg-product-card-description {
  color: var(--mute) !important;
}

.kg-audio-card,
.kg-file-card-container {
  background: var(--trench) !important;
  border: 1px solid var(--line) !important;
  box-shadow: none !important;
  border-radius: var(--radius-lg) !important;
  color: var(--ink) !important;
}
.kg-file-card-title,
.kg-audio-title {
  color: var(--ink) !important;
}
.kg-file-card-caption,
.kg-file-card-metadata,
.kg-audio-duration,
.kg-audio-current-time {
  color: var(--mute) !important;
}
.kg-audio-card svg,
.kg-file-card-icon svg {
  color: var(--mute);
}
.kg-audio-play-icon svg,
.kg-audio-pause-icon svg {
  fill: var(--ink);
}

.kg-video-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.gh-content .kg-callout-card a,
.gh-content .kg-toggle-content a {
  color: inherit;
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  background: var(--trench);
}
.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  padding-top: 48px;
  padding-bottom: 48px;
}
.footer-tagline {
  margin-top: 16px;
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--ink);
}
.footer-risk {
  margin-top: 12px;
  max-width: 40ch;
  font-size: 12px;
  line-height: 1.6;
  color: var(--dim);
}
.footer-links .eyebrow {
  margin-bottom: 14px;
}
.footer-links ul,
.footer-links .nav {
  margin: 0;
  padding: 0;
  list-style: none;
}
.footer-links li + li {
  margin-top: 10px;
}
.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--mute);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}
.footer-links a:hover {
  color: var(--ink);
}
.footer-bar {
  border-top: 1px solid var(--line);
}
.footer-bar-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding-top: 20px;
  padding-bottom: 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--dim);
}
@media (max-width: 767px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
}

/* ---------- Error ---------- */
.error-main {
  display: flex;
  align-items: center;
}
.error-inner {
  padding-top: 96px;
  padding-bottom: 120px;
}
.error-code {
  margin-top: 12px;
  font-size: clamp(72px, 16vw, 160px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--ink);
}
.error-message {
  margin: 16px 0 32px;
  font-size: 18px;
  color: var(--mute);
}
.error-details {
  margin-top: 32px;
  padding: 0;
  list-style: none;
  font-size: 12px;
  color: var(--mute);
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .ping::after {
    display: none;
  }
  .post-card:hover .post-card-image img {
    transform: none;
  }
}
