/*
Theme Name: Book Fork Blog
Theme URI: https://github.com/Rastin-Amani/book-fork
Author: Book Fork
Author URI: https://github.com/Rastin-Amani/book-fork
Description: The editorial theme for the Book Fork journal. It carries the exact "Warm Paper Workspace" system used by the Book Fork app and marketing site — cream canvas, one amber action, storyboard-blue links, hairline borders instead of shadows, flat 6px geometry and self-hosted DM Sans — onto long-form reading. The header mirrors the product navbar; the footer is the same ink chamber as bookfork.space, carrying the journal's topics, latest writing and the product's link graph.
Version: 2.0.0
Requires at least: 6.4
Tested up to: 6.7
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: book-fork-blog
Tags: blog, news, one-column, custom-logo, custom-menu, featured-images, translation-ready, accessibility-ready, editor-style, threaded-comments, sticky-post
*/

/* ==========================================================================
   Book Fork Blog — "Warm Paper Workspace" (reading expression)

   Mirrors the Book Fork app + marketing daisyUI theme `book-fork` exactly:
     base-100 #fafaf5 · base-200 #f3f2ec · base-300 #e6e5df
     base-content #121212 · primary #e8aa42 · accent #214c7e
     neutral #121212 · success #2f7d4f · warning #eb6c00 · error #b23b30
     radius-box / radius-field / radius-selector: 6px · depth: 0

   Components follow the same contracts: flat surfaces, 1px hairlines,
   amber reserved for the one primary action, mono for eyebrows/metadata,
   DM Sans never below 400, and no shadow except genuinely floating overlays.
   ========================================================================== */

/* Self-hosted DM Sans (the "matter" substitute) — CSP-friendly, no CDN. */
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("assets/fonts/dm-sans-latin.woff2") format("woff2");
  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: "DM Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("assets/fonts/dm-sans-latin-ext.woff2") format("woff2");
  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;
}

:root {
  /* Surfaces — daisyUI base-100 / base-200 / base-300 / neutral */
  --canvas: #fafaf5;
  --paper: #fafaf5;    /* cards sit on the canvas, separated by hairlines */
  --raised: #f3f2ec;
  --hairline: #e6e5df;
  --pebble: #cecdca;
  --ink-band: #121212;

  /* Ink — base-content at full and quiet weights */
  --ink: #121212;
  --graphite: #4d4d4d;
  --mid-gray: #7d7d7d;
  --muted-ash: #898989;

  /* Action + accents — primary / accent / status */
  --amber: #e8aa42;
  --amber-ink: #121212;
  --amber-hover: #df9b2f;
  --deep-amber: #eb6c00;
  --blue: #214c7e;
  --sketch: #daeef8;
  --success: #2f7d4f;
  --warning: #eb6c00;
  --error: #b23b30;

  /* daisyUI aliases, so the system reads the same as the app CSS */
  --base-100: var(--canvas);
  --base-200: var(--raised);
  --base-300: var(--hairline);
  --base-content: var(--ink);
  --primary: var(--amber);
  --primary-content: var(--amber-ink);
  --accent: var(--blue);
  --neutral: var(--ink);

  /* Type */
  --sans: "DM Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --measure: 68ch;

  /* Shape */
  --r: 6px;
  --r-lg: 6px;

  /* Layout */
  --shell: 72rem;
  --read: 45rem;
  --gutter: 1.25rem;
  --header-h: 64px;

  /* Motion */
  --ease: cubic-bezier(0, 0, 0.2, 1);
  --shadow-overlay: 0 12px 40px rgba(18, 18, 18, 0.12);
}

@media (min-width: 48rem) {
  :root { --gutter: 2rem; }
}

@media (max-width: 22rem) {
  :root { --gutter: 0.875rem; }
}

/* ---------------------------------------------------------------- Reset/base */

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

* { -webkit-tap-highlight-color: color-mix(in srgb, var(--amber) 22%, transparent); }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--canvas);
  caret-color: var(--blue);
  font-feature-settings: "ss01";
  overflow-wrap: break-word;
  text-wrap: pretty;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 { text-wrap: balance; margin: 0; }

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

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: var(--r);
}

::selection { background: var(--amber); color: var(--ink); }

.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -3rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: #fff;
  border-radius: var(--r);
  text-decoration: none;
  font-weight: 600;
  transition: top 140ms var(--ease);
}
.skip-link:focus { top: 0.5rem; }

.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.screen-reader-text:focus {
  position: static !important;
  width: auto; height: auto;
  clip: auto; margin: 0;
}

.tabular, time, .kpi__value { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- Layout */

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.site {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--canvas);
}
.site__main { flex: 1; padding-block: 2.5rem 5rem; }

.panel {
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
}

.section { margin-top: 4rem; }

/* ---------------------------------------------------------------- Type */

.display {
  font-size: clamp(2.6rem, 1.35rem + 5vw, 4.75rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.h1 { font-size: clamp(2.1rem, 1.35rem + 2.9vw, 3.25rem); font-weight: 700; letter-spacing: -0.04em; line-height: 1.02; }
.h2 { font-size: clamp(1.625rem, 1.2rem + 1.7vw, 2.25rem); font-weight: 700; letter-spacing: -0.035em; line-height: 1.05; }
.h3 { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.3; }

.lead {
  margin-top: 1.5rem;
  max-width: 42rem;
  font-size: 1.125rem;
  line-height: 1.7;
  color: color-mix(in srgb, var(--ink) 65%, transparent);
}

.muted { color: var(--mid-gray); }
.stone { color: color-mix(in srgb, var(--ink) 65%, transparent); }

/* Mono eyebrow — the one label above headings, exactly as the product. */
.label, .eyebrow {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.65625rem; /* 10.5px */
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: color-mix(in srgb, var(--ink) 45%, transparent);
}
.section-label { margin: 0 0 0.9rem; }

.eyebrow-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: var(--canvas);
  font-family: var(--mono);
  font-size: 0.625rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: color-mix(in srgb, var(--ink) 55%, transparent);
}
.eyebrow-pill::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--amber);
  flex: none;
}

.section-top {
  border-top: 1px solid var(--hairline);
  padding-top: 1.5rem;
  margin-bottom: 2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}
.section-top .h2 { margin: 0; }
.section-top__label { display: block; margin-bottom: 0.5rem; }
.section-top__link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: color-mix(in srgb, var(--ink) 60%, transparent);
  text-decoration: none;
  transition: color 140ms var(--ease);
}
.section-top__link:hover { color: var(--blue); }
.section-top__link .arrow { transition: translate 150ms var(--ease); }
.section-top__link:hover .arrow { translate: 3px 0; }

.page-head { display: grid; gap: 0.6rem; margin-bottom: 2.5rem; padding-top: 0.5rem; }
.page-head .h1 { margin-top: 0.35rem; }
.page-sub { max-width: var(--measure); color: color-mix(in srgb, var(--ink) 60%, transparent); font-size: 1.0625rem; line-height: 1.7; }

/* ---------------------------------------------------------------- Header — the product navbar */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--canvas) 85%, transparent);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  backdrop-filter: blur(12px) saturate(160%);
  border-bottom: 1px solid color-mix(in srgb, var(--hairline) 80%, transparent);
}
.navbar {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.primary-nav { flex: 1; min-width: 0; display: flex; align-items: center; }

.brand-group { display: flex; align-items: center; gap: 0.75rem; flex: none; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; flex: none; }
.brand__mark {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: var(--r);
  background: var(--ink);
  color: var(--amber);
  transition: transform 200ms var(--ease);
}
.brand:hover .brand__mark { transform: rotate(-3deg); }
.brand__mark svg { width: 16px; height: 16px; }
.brand__word { font-weight: 700; letter-spacing: -0.02em; font-size: 1.125rem; line-height: 1; }

.brand__journal {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--mono);
  font-size: 0.625rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: color-mix(in srgb, var(--ink) 45%, transparent);
}
.brand__journal::before {
  content: "";
  width: 1px; height: 1rem;
  background: var(--hairline);
}

.nav {
  margin: 0 0 0 0.5rem;
  padding: 0;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.125rem;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav li { list-style: none; flex: none; }
.nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.45rem 0.75rem;
  border-radius: var(--r);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  color: color-mix(in srgb, var(--ink) 55%, transparent);
  text-decoration: none;
  transition: color 150ms var(--ease), background-color 150ms var(--ease);
}
.nav a:hover { color: var(--ink); background: var(--raised); }
.nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 2px;
  height: 2px;
  border-radius: 999px;
  background: var(--amber);
}
.nav-mobile-only { display: none; }

.navbar__actions { margin-left: auto; display: flex; align-items: center; gap: 0.25rem; flex: none; }
.nav-github svg { width: 18px; height: 18px; }

.nav-toggle {
  display: none;
  width: 40px; height: 40px;
  align-items: center; justify-content: center;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: var(--r);
  color: var(--ink);
  cursor: pointer;
  transition: background-color 150ms var(--ease);
}
.nav-toggle:hover { background: var(--raised); }
.nav-toggle svg { width: 20px; height: 20px; }

.nav-search { position: relative; }
.nav-search > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: var(--r);
  color: color-mix(in srgb, var(--ink) 55%, transparent);
  transition: background-color 150ms var(--ease), color 150ms var(--ease);
}
.nav-search > summary::-webkit-details-marker { display: none; }
.nav-search > summary:hover,
.nav-search[open] > summary { background: var(--raised); color: var(--ink); }
.nav-search svg { width: 17px; height: 17px; }
.nav-search__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.65rem);
  z-index: 50;
  width: min(22rem, calc(100vw - 2 * var(--gutter)));
  padding: 0.5rem;
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-overlay);
}
.nav-search__panel .search-form { max-width: none; }

@media (max-width: 74.99rem) {
  .nav-toggle { display: inline-flex; }
  .navbar__actions .nav-login,
  .navbar__actions .nav-github { display: none; }
  .brand__journal { display: none; }

  .nav {
    position: absolute;
    right: var(--gutter);
    top: calc(100% + 0.5rem);
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0.125rem;
    width: min(20rem, calc(100vw - 2 * var(--gutter)));
    margin: 0;
    padding: 0.375rem;
    max-height: calc(100dvh - var(--header-h) - 1rem);
    overflow-y: auto;
    background: var(--canvas);
    border: 1px solid var(--hairline);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-overlay);
  }
  .nav[data-open="true"] { display: flex; }
  .nav a { min-height: 44px; padding: 0.7rem 0.75rem; font-size: 0.9375rem; }
  .nav a[aria-current="page"] { background: var(--raised); }
  .nav a[aria-current="page"]::after { display: none; }
  .nav-mobile-only { display: block; }
  .nav-mobile-only a { color: color-mix(in srgb, var(--ink) 45%, transparent); }
  .nav-mobile-only + .nav-mobile-only { border-top: 1px solid var(--hairline); margin-top: 0.375rem; padding-top: 0.375rem; }

  .nav-search__panel {
    position: fixed;
    left: var(--gutter);
    right: var(--gutter);
    top: calc(var(--header-h) + 0.5rem);
    width: auto;
  }
}

.nav-cta__short { display: none; }

@media (max-width: 26rem) {
  .nav-cta__full { display: none; }
  .nav-cta__short { display: inline; }
}

/* ---------------------------------------------------------------- Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.6rem 1rem;
  border-radius: var(--r);
  border: 1px solid var(--pebble);
  background: var(--canvas);
  color: var(--ink);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms var(--ease), color 150ms var(--ease),
    border-color 150ms var(--ease), transform 100ms var(--ease);
}
.btn:active { transform: scale(0.98); }
.btn .arrow { transition: translate 150ms var(--ease); }
.btn:hover .arrow { translate: 3px 0; }
.btn:hover .arrow--up { translate: 2px -2px; }

.btn--sm { min-height: 36px; padding: 0.4rem 0.75rem; font-size: 0.875rem; }
.btn--icon { width: 36px; min-height: 36px; padding: 0; flex: none; }

.btn--primary { background: var(--amber); border-color: var(--amber); color: var(--amber-ink); }
.btn--primary:hover { background: var(--amber-hover); border-color: var(--amber-hover); }
.btn--dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn--dark:hover { background: #000; border-color: #000; }
.btn--ghost { background: transparent; border-color: transparent; color: color-mix(in srgb, var(--ink) 60%, transparent); }
.btn--ghost:hover { background: var(--raised); color: var(--ink); }
.btn--outline { background: transparent; border-color: var(--pebble); color: var(--ink); }
.btn--outline:hover { border-color: color-mix(in srgb, var(--ink) 35%, transparent); background: var(--raised); }
.btn--block { width: 100%; }

/* ---------------------------------------------------------------- Search form */

.search-form { display: flex; gap: 0.4rem; width: 100%; max-width: 32rem; }
.search-form .field { flex: 1; min-width: 0; }
.search-form .btn { flex: none; }

.field {
  width: 100%;
  min-height: 44px;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--pebble);
  border-radius: var(--r);
  background: var(--canvas);
  color: var(--ink);
  font: inherit;
  font-size: 0.9375rem;
}
.field::placeholder { color: var(--muted-ash); }
.field:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; border-color: var(--blue); }

/* ---------------------------------------------------------------- Masthead */

.masthead {
  position: relative;
  isolation: isolate;
  overflow: clip;
  margin-top: -2.5rem;
  padding-block: 4.5rem 3rem;
  text-align: center;
}
.masthead::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 1rem;
  z-index: -1;
  width: min(34rem, 90vw);
  height: min(34rem, 90vw);
  transform: translateX(-50%);
  border-radius: 50%;
  background: color-mix(in srgb, var(--amber) 11%, transparent);
  filter: blur(64px);
  pointer-events: none;
}
.masthead .display { max-width: 15ch; margin: 1.5rem auto 0; }
.masthead .lead { margin-inline: auto; }
.masthead__search { margin: 2rem auto 0; max-width: 34rem; }
.masthead__search .search-form {
  max-width: none;
  padding: 0.25rem;
  background: var(--canvas);
  border: 1px solid var(--pebble);
  border-radius: var(--r-lg);
}
.masthead__search .field { border: 0; background: transparent; padding-inline: 0.65rem; }
.masthead__search .field:focus-visible { outline: 0; }
.masthead__search .btn { min-height: 38px; }
.masthead__note {
  margin: 0.85rem 0 0;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  color: color-mix(in srgb, var(--ink) 45%, transparent);
}
.masthead__note a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--pebble); }
.masthead__note a:hover { color: var(--blue); border-color: var(--blue); }

/* ---------------------------------------------------------------- Featured story */

.featured {
  margin-top: 1.5rem;
  display: grid;
  overflow: hidden;
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
}
@media (min-width: 64rem) {
  .featured { grid-template-columns: 1.25fr 1fr; }
  .featured--text { grid-template-columns: 1fr; }
}
.featured__media {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--raised);
  border-bottom: 1px solid var(--hairline);
}
.featured__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 500ms var(--ease);
}
.featured:hover .featured__media img { transform: scale(1.02); }
@media (min-width: 64rem) {
  .featured__media { aspect-ratio: auto; min-height: 24rem; height: 100%; border-bottom: 0; border-right: 1px solid var(--hairline); }
}
.featured__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.9rem;
  padding: clamp(1.5rem, 3vw, 2.75rem);
}
.featured__kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; }
.featured__kicker a { color: inherit; text-decoration: none; }
.featured__kicker a:hover { color: var(--blue); }
.featured__title {
  font-size: clamp(1.75rem, 1.2rem + 1.9vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
}
.featured__title a { text-decoration: none; }
.featured__title a:hover { color: var(--blue); }
.featured__excerpt {
  max-width: 60ch;
  margin: 0;
  color: color-mix(in srgb, var(--ink) 62%, transparent);
  font-size: 1.0625rem;
  line-height: 1.65;
}
.featured__actions { margin: 0.5rem 0 0; }

/* ---------------------------------------------------------------- Cards */

.card-grid { display: grid; gap: 1.25rem; }
@media (min-width: 40rem) { .card-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 64rem) { .card-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Related cards sit inside the narrower reading column: two across, never three. */
@media (min-width: 40rem) {
  .entry .related .card-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  transition: border-color 160ms var(--ease);
}
.card:hover { border-color: color-mix(in srgb, var(--ink) 30%, transparent); }
.card__media { display: block; aspect-ratio: 16 / 10; background: var(--raised); overflow: hidden; }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 500ms var(--ease); }
.card:hover .card__media img { transform: scale(1.03); }
.card__body { padding: 1.25rem; display: flex; flex-direction: column; gap: 0.55rem; flex: 1; }
.card__kicker { font-family: var(--mono); font-size: 0.625rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.14em; color: color-mix(in srgb, var(--ink) 45%, transparent); }
.card__title { font-size: 1.1875rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.28; }
.card:hover .card__title { color: var(--blue); }
.card__excerpt {
  margin: 0;
  color: color-mix(in srgb, var(--ink) 60%, transparent);
  font-size: 0.9375rem;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card__meta {
  margin-top: auto;
  padding-top: 0.55rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  font-family: var(--mono);
  font-size: 0.625rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: color-mix(in srgb, var(--ink) 45%, transparent);
}

/* ---------------------------------------------------------------- Ledger list */

.ledger { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--hairline); }
.ledger > li { border-bottom: 1px solid var(--hairline); }

.ledger-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 0.35rem 1rem;
  margin-inline: -0.75rem;
  padding: 1.25rem 0.75rem;
  text-decoration: none;
  color: inherit;
  border-radius: var(--r);
  transition: background-color 150ms var(--ease);
}
.ledger-row:hover { background: var(--raised); }
.ledger-row:focus-within { background: var(--raised); }
.ledger-row__title {
  grid-column: 1;
  display: block;
  color: inherit;
  text-decoration: none;
  font-size: 1.1875rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
}
.ledger-row:hover .ledger-row__title { color: var(--blue); }
.ledger-row__excerpt {
  grid-column: 1 / -1;
  margin: 0;
  max-width: 74ch;
  color: color-mix(in srgb, var(--ink) 55%, transparent);
  font-size: 0.9375rem;
  line-height: 1.6;
}
.ledger-row__meta {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.65rem;
  font-family: var(--mono);
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 500;
  color: color-mix(in srgb, var(--ink) 45%, transparent);
}
.ledger-row__meta a { color: inherit; text-decoration: none; }
.ledger-row__meta a:hover { color: var(--blue); }
.ledger-row__go {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  display: inline-flex;
  color: var(--pebble);
  text-decoration: none;
  transition: translate 150ms var(--ease), color 150ms var(--ease);
}
.ledger-row:hover .ledger-row__go { translate: 4px 0; color: var(--blue); }

/* ---------------------------------------------------------------- Topic chips */

.topics { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.topic-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 40px;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--hairline);
  border-radius: var(--r);
  background: var(--canvas);
  font-size: 0.875rem;
  font-weight: 500;
  color: color-mix(in srgb, var(--ink) 65%, transparent);
  text-decoration: none;
  transition: border-color 140ms var(--ease), color 140ms var(--ease), background-color 140ms var(--ease);
}
.topic-chip:hover { border-color: color-mix(in srgb, var(--blue) 40%, transparent); color: var(--blue); background: color-mix(in srgb, var(--sketch) 55%, transparent); }
.topic-chip__count {
  font-family: var(--mono);
  font-size: 0.625rem;
  font-weight: 500;
  color: color-mix(in srgb, var(--ink) 40%, transparent);
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------- Single post */

.layout-post { display: grid; gap: 2rem; }
.layout-post > * { min-width: 0; }
@media (min-width: 64rem) {
  .layout-post:has(.entry__aside) { grid-template-columns: minmax(0, 1fr) 16rem; gap: 4rem; align-items: start; }
}

/* Below the two-column article layout the TOC would trail the whole post, so
   the article's own headings are the better navigation. */
@media (max-width: 63.99rem) {
  .entry__aside { display: none; }
}

.entry { max-width: var(--read); }

.entry__head { display: grid; gap: 0.9rem; margin-bottom: 2rem; }
.entry__kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; }
.entry__kicker a { text-decoration: none; }
.entry__kicker a:hover { color: var(--blue); }
.entry__title { font-size: clamp(2.1rem, 1.35rem + 2.9vw, 3.25rem); font-weight: 700; letter-spacing: -0.04em; line-height: 1.02; }
.entry__dek { font-size: 1.1875rem; line-height: 1.6; color: color-mix(in srgb, var(--ink) 62%, transparent); max-width: 60ch; }
.entry__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.9rem; color: color-mix(in srgb, var(--ink) 45%, transparent); font-family: var(--mono); font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.1em; }
.entry__meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--pebble); }
.entry__meta a { color: inherit; text-decoration: none; }
.entry__meta a:hover { color: var(--blue); }

.byline { display: inline-flex; align-items: center; gap: 0.55rem; font-family: var(--sans); text-transform: none; letter-spacing: 0; }
.byline img { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--canvas); outline: 1px solid var(--hairline); }
.byline__name { font-weight: 600; font-size: 0.875rem; color: var(--ink); }

.entry__hero { margin: 0 0 2.25rem; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--hairline); background: var(--raised); }
.entry__hero img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.entry__hero figcaption { padding: 0.65rem 0.9rem; font-family: var(--mono); font-size: 0.6875rem; line-height: 1.5; color: color-mix(in srgb, var(--ink) 45%, transparent); background: var(--canvas); border-top: 1px solid var(--hairline); }

/* Prose */
.prose { font-size: 1.125rem; line-height: 1.8; color: color-mix(in srgb, var(--ink) 70%, transparent); }
.prose > * + * { margin-top: 1.4rem; }
.prose h2 { margin-top: 2.75rem; font-size: 1.75rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; color: var(--ink); scroll-margin-top: calc(var(--header-h) + 1rem); }
.prose h3 { margin-top: 2rem; font-size: 1.3rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.3; color: var(--ink); scroll-margin-top: calc(var(--header-h) + 1rem); }
.prose h4 { margin-top: 1.6rem; font-size: 1.0625rem; font-weight: 600; color: var(--ink); }
.prose p { margin: 0; }
.prose a { color: var(--blue); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--blue) 40%, transparent); }
.prose a:hover { text-decoration-color: var(--blue); }
.prose strong { font-weight: 700; color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.35rem; }
.prose li + li { margin-top: 0.4rem; }
.prose li::marker { color: var(--amber); }
.prose blockquote {
  margin: 1.9rem 0;
  padding: 0.35rem 0 0.35rem 1.35rem;
  border-left: 3px solid var(--amber);
  color: var(--ink);
  font-size: 1.375rem;
  line-height: 1.5;
  letter-spacing: -0.015em;
}
.prose blockquote p { font-size: inherit; }
.prose img { border-radius: var(--r); }
.prose figure { margin: 1.9rem 0; }
.prose figcaption { margin-top: 0.55rem; font-family: var(--mono); font-size: 0.6875rem; line-height: 1.5; color: color-mix(in srgb, var(--ink) 45%, transparent); text-align: center; }
.prose code { font-family: var(--mono); font-size: 0.875em; background: var(--raised); padding: 0.12em 0.4em; border-radius: 4px; }
.prose pre { overflow-x: auto; padding: 1.15rem 1.25rem; background: var(--ink); color: #f5f5f2; border-radius: var(--r); font-size: 0.875rem; line-height: 1.7; }
.prose pre code { background: transparent; padding: 0; color: inherit; }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.prose th, .prose td { padding: 0.65rem 0.8rem; border-bottom: 1px solid var(--hairline); text-align: left; vertical-align: top; }
.prose th { font-family: var(--mono); font-size: 0.625rem; text-transform: uppercase; letter-spacing: 0.12em; color: color-mix(in srgb, var(--ink) 50%, transparent); font-weight: 500; background: var(--raised); }
.prose hr { border: 0; border-top: 1px solid var(--hairline); margin: 2.75rem 0; }
.prose .wp-block-table { overflow-x: auto; }

/* In-body callout */
.callout {
  margin: 1.9rem 0;
  padding: 1.15rem 1.25rem;
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--amber);
  border-radius: var(--r);
  background: color-mix(in srgb, var(--raised) 65%, transparent);
}
.callout p { margin: 0; font-size: 1rem; color: color-mix(in srgb, var(--ink) 65%, transparent); }
.callout p + p { margin-top: 0.6rem; }

/* Table of contents (aside) */
.toc { position: sticky; top: calc(var(--header-h) + 1.5rem); }
.toc__title { margin-bottom: 0.75rem; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--hairline); }
.toc a {
  display: block;
  padding: 0.32rem 0 0.32rem 0.9rem;
  margin-left: -1px;
  border-left: 2px solid transparent;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: color-mix(in srgb, var(--ink) 50%, transparent);
  text-decoration: none;
  transition: color 140ms var(--ease), border-color 140ms var(--ease);
}
.toc a:hover { color: var(--ink); }
.toc a.is-active { color: var(--blue); border-left-color: var(--blue); font-weight: 600; }
.toc .toc-h3 a { padding-left: 1.8rem; }

/* Entry footer: tags, author, nav */
.entry__footer { margin-top: 2.75rem; display: grid; gap: 1.75rem; }
.tag-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--hairline);
  border-radius: var(--r);
  background: var(--canvas);
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: color-mix(in srgb, var(--ink) 55%, transparent);
  text-decoration: none;
}
.tag:hover { border-color: color-mix(in srgb, var(--blue) 40%, transparent); color: var(--blue); }

.post-nav { display: grid; gap: 1rem; }
@media (min-width: 40rem) { .post-nav { grid-template-columns: 1fr 1fr; } }
.post-nav a {
  display: grid;
  gap: 0.35rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--hairline);
  border-radius: var(--r);
  text-decoration: none;
  background: var(--canvas);
  transition: border-color 140ms var(--ease);
}
.post-nav a:hover { border-color: color-mix(in srgb, var(--ink) 30%, transparent); }
.post-nav .label { color: color-mix(in srgb, var(--ink) 45%, transparent); }
.post-nav__title { font-weight: 600; font-size: 0.9375rem; letter-spacing: -0.01em; }
.post-nav a:hover .post-nav__title { color: var(--blue); }
.post-nav .next { text-align: right; }

.author-box {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  padding: 1.25rem;
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--raised) 55%, transparent);
}
.author-box img { width: 56px; height: 56px; border-radius: 50%; outline: 1px solid var(--hairline); }
.author-box__name { font-weight: 700; }
.author-box__name a { color: inherit; text-decoration: none; }
.author-box__name a:hover { color: var(--blue); }
.author-box__bio { margin-top: 0.35rem; color: color-mix(in srgb, var(--ink) 55%, transparent); font-size: 0.9375rem; line-height: 1.6; }

/* ---------------------------------------------------------------- Archives / search */

.archive-head { margin-bottom: 2.5rem; padding-top: 0.5rem; }
.archive-head .h1, .archive-head .h2 { margin: 0.4rem 0 0.5rem; }
.count {
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: color-mix(in srgb, var(--ink) 45%, transparent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 500;
}

.pagination { margin-top: 2.5rem; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.pagination .page-numbers {
  display: inline-grid;
  place-items: center;
  min-width: 40px; height: 40px;
  padding-inline: 0.5rem;
  border: 1px solid var(--hairline);
  border-radius: var(--r);
  background: var(--canvas);
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  color: color-mix(in srgb, var(--ink) 55%, transparent);
}
.pagination .page-numbers.current { background: var(--ink); border-color: var(--ink); color: #fff; }
.pagination a.page-numbers:hover { border-color: color-mix(in srgb, var(--blue) 40%, transparent); color: var(--blue); }

.empty {
  padding: 3rem 1.5rem;
  text-align: center;
  border: 1px dashed var(--pebble);
  border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--raised) 45%, transparent);
}
.empty__title { font-size: 1.25rem; font-weight: 700; }
.empty__text { margin-top: 0.5rem; color: color-mix(in srgb, var(--ink) 55%, transparent); }

/* Breadcrumbs */
.crumbs { margin-bottom: 1.75rem; }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; font-size: 0.8125rem; color: color-mix(in srgb, var(--ink) 45%, transparent); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--blue); }
.crumbs [aria-current="page"] { color: color-mix(in srgb, var(--ink) 62%, transparent); }
.crumbs .sep { color: var(--pebble); }

/* Comments */
.comments { margin-top: 3rem; max-width: var(--read); }
.comments__title { font-size: 1.375rem; font-weight: 700; letter-spacing: -0.02em; }
.comment-list { list-style: none; margin: 1.5rem 0 0; padding: 0; }
.comment-list .children { list-style: none; margin-left: 1.5rem; }
.comment-body { padding: 1.1rem 0; border-top: 1px solid var(--hairline); }
.comment-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; font-family: var(--mono); font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.08em; color: color-mix(in srgb, var(--ink) 45%, transparent); }
.comment-author { font-family: var(--sans); font-weight: 700; font-size: 0.875rem; text-transform: none; letter-spacing: 0; color: var(--ink); }
.comment-content { margin-top: 0.5rem; }
.comment-content a { color: var(--blue); }
.comment-list .avatar { border-radius: 50%; }
.comment-respond { margin-top: 2rem; }
.comment-form label { display: block; font-family: var(--mono); font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 500; margin-bottom: 0.35rem; color: color-mix(in srgb, var(--ink) 50%, transparent); }
.comment-form p { margin-bottom: 1rem; }

/* CTA band — the one dark chamber, same as the marketing CTA. */
.cta-band {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin-top: 4rem;
  padding: clamp(2rem, 5vw, 4rem);
  border-radius: var(--r-lg);
  background: var(--ink-band);
  color: #fafaf5;
  display: grid;
  gap: 0.5rem;
}
.cta-band::before {
  content: "";
  position: absolute;
  right: -6rem;
  top: -6rem;
  z-index: -1;
  width: 18rem;
  height: 18rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--amber) 10%, transparent);
  filter: blur(64px);
  pointer-events: none;
}
.cta-band .label { color: color-mix(in srgb, #ffffff 45%, transparent); }
.cta-band h2 { font-size: clamp(1.75rem, 1.2rem + 1.9vw, 2.5rem); font-weight: 700; letter-spacing: -0.035em; line-height: 1.05; color: #fff; }
.cta-band p { color: color-mix(in srgb, #ffffff 70%, transparent); max-width: 52ch; margin: 0.5rem 0 0; font-size: 1rem; line-height: 1.7; }
.cta-band .cta-band__actions { margin-top: 1.75rem; display: flex; flex-wrap: wrap; gap: 0.65rem; }
.cta-band .btn--ghost { color: #fafaf5; border-color: transparent; }
.cta-band .btn--ghost:hover { background: color-mix(in srgb, #ffffff 10%, transparent); color: #fff; }

/* ---------------------------------------------------------------- Footer — the main site's ink chamber */

.site-footer {
  margin-top: auto;
  background: var(--ink-band);
  color: #fff;
}
.site-footer__inner { padding-block: 4rem; }

.site-footer__top {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid color-mix(in srgb, #ffffff 10%, transparent);
}
@media (min-width: 64rem) {
  .site-footer__top { flex-direction: row; align-items: flex-end; justify-content: space-between; }
}
.site-footer__intro { max-width: 36rem; }

.brand--footer .brand__word { color: #fff; font-size: 1.5rem; }
.brand--footer .brand__mark { background: color-mix(in srgb, #ffffff 10%, transparent); color: var(--amber); }
.brand--footer:hover .brand__mark { transform: rotate(-3deg); }
.site-footer .custom-logo { filter: brightness(0) invert(1); }

.site-footer__about {
  margin: 1.25rem 0 0;
  max-width: 34rem;
  color: color-mix(in srgb, #ffffff 65%, transparent);
  font-size: 1rem;
  line-height: 1.7;
}

.site-footer__actions { display: flex; flex-direction: column; gap: 0.75rem; flex: none; }
.site-footer__actions .btn { width: 100%; }
@media (min-width: 40rem) {
  .site-footer__actions { flex-direction: row; flex-wrap: wrap; }
  .site-footer__actions .btn { width: auto; }
}
@media (min-width: 64rem) {
  .site-footer__actions { flex-direction: column; flex-wrap: nowrap; }
}
.btn--outline-light {
  background: transparent;
  border-color: color-mix(in srgb, #ffffff 30%, transparent);
  color: #fff;
}
.btn--outline-light:hover {
  background: #fff;
  border-color: #fff;
  color: var(--ink);
}

.footer-grid {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem 1rem;
  font-size: 0.875rem;
}
@media (min-width: 40rem) { .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 64rem) { .footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 80rem) { .footer-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

.footer-group h3 {
  margin: 0 0 1rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: color-mix(in srgb, #ffffff 45%, transparent);
}
.footer-group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.65rem; }
.footer-group a {
  color: color-mix(in srgb, #ffffff 70%, transparent);
  text-decoration: none;
  transition: color 140ms var(--ease);
}
.footer-group a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.footer-group .footer-group__more { color: color-mix(in srgb, #ffffff 50%, transparent); font-family: var(--mono); font-size: 0.6875rem; letter-spacing: 0.04em; }

.site-footer__base {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid color-mix(in srgb, #ffffff 10%, transparent);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
}
.site-footer__base p { margin: 0; }
.site-footer__base,
.site-footer__base a {
  font-family: var(--mono);
  font-size: 0.6875rem;
  line-height: 1.7;
  color: color-mix(in srgb, #ffffff 45%, transparent);
  text-decoration: none;
}
.site-footer__base a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.site-footer__base .sep { margin-inline: 0.35rem; }

/* ---------------------------------------------------------------- Utilities */

.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.stack-sm > * + * { margin-top: 0.5rem; }
.stack > * + * { margin-top: 1rem; }
.stack-lg > * + * { margin-top: 2rem; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-6 { margin-top: 3rem; }
.mb-4 { margin-bottom: 2rem; }
.hidden { display: none; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------------------------------------------------------------- Motion */

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .masthead > *, .entry__head, .featured__body, .page-head, .archive-head { animation: rise 0.4s var(--ease) both; }
  .ledger > li { animation: rise 0.35s var(--ease) both; }
  .ledger > li:nth-child(2) { animation-delay: 0.03s; }
  .ledger > li:nth-child(3) { animation-delay: 0.06s; }
  .ledger > li:nth-child(4) { animation-delay: 0.09s; }
  .ledger > li:nth-child(n+5) { animation-delay: 0.12s; }
}

.read-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0;
  background: var(--amber);
  z-index: 60;
  transition: width 80ms linear;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Frostier material when the reader asks for less transparency. */
@media (prefers-reduced-transparency: reduce) {
  .site-header { background: var(--canvas); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .nav, .nav-search__panel { background: var(--canvas); }
}

/* Stronger separation when the reader asks for more contrast. */
@media (prefers-contrast: more) {
  :root { --hairline: #b9b7ae; --pebble: #8f8d85; }
  .site-header { background: var(--canvas); }
  .site-footer { border-top: 1px solid #fff; }
}

/* ---------------------------------------------------------------- Editor */

.editor-styles-wrapper {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--canvas);
}
.editor-styles-wrapper .wp-block { max-width: var(--read); }
