/* ============================================================= *
   MrK — Field Notes
   Warm editorial · cream paper · ink serif · terracotta accent
 * ============================================================= */

/* ---- TOKENS ------------------------------------------------- */
:root {
  --paper:    #f4eee3;   /* warm cream page */
  --paper-2:  #efe7d8;   /* deeper cream — hover wells */
  --card:     #f8f3ea;
  --ink:      #221e18;   /* near-black, warm */
  --ink-soft: #46402f;
  --muted:    #756c5b;
  --faint:    #a99f8c;
  --line:     rgba(34, 30, 24, 0.16);
  --line-2:   rgba(34, 30, 24, 0.08);

  --accent:      #b04a2c;   /* terracotta */
  --accent-deep: #8c3619;
  --accent-soft: rgba(176, 74, 44, 0.10);
  --gold:        #9a7b34;   /* secondary, used sparingly */

  --ink-block: #211d17;     /* dark code/quote panels on light page */

  --shadow:   0 26px 50px -34px rgba(58, 42, 22, 0.45);

  --serif:   "Newsreader", Georgia, "Times New Roman", serif;
  --display: "Fraunces", Georgia, serif;
  --mono:    "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --measure: 38rem;          /* reading column */
  --wide:    66rem;          /* max layout width */
  --gutter:  clamp(1.25rem, 5vw, 3.5rem);
}

/* ---- RESET / BASE ------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-size: clamp(1.05rem, 0.99rem + 0.3vw, 1.18rem);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* subtle warm wash from the top, plus a faint horizon line */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(176, 74, 44, 0.06), transparent 60%),
    linear-gradient(180deg, #f6f1e7, var(--paper) 40%);
}

/* paper grain — multiply so it reads as fibre, not noise */
.grain {
  position: fixed;
  inset: -50%;
  z-index: 9998;
  pointer-events: none;
  opacity: 0.5;
  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' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
}

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

::selection { background: var(--accent); color: #fdf6ea; }

a { color: inherit; }

* { scrollbar-width: thin; scrollbar-color: var(--faint) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: #cfc4b0; border-radius: 20px; border: 3px solid var(--paper); }

/* ---- SHARED ATOMS ----------------------------------------- */
.kicker {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--accent);
}

.main { width: 100%; }

.cta {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.78rem 1.3rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--paper);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 2px;
  transition: background 0.25s, color 0.25s, transform 0.25s, border-color 0.25s;
}
.cta:hover { background: var(--accent); border-color: var(--accent); transform: translateY(-2px); }
.cta__arrow { transition: transform 0.25s; }
.cta:hover .cta__arrow { transform: translateX(4px); }

.cta--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.cta--ghost:hover { background: transparent; color: var(--accent); border-color: var(--accent); }

/* ---- MASTHEAD --------------------------------------------- */
.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem var(--gutter);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: baseline;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--ink);
}
.brand__prompt { color: var(--accent); font-weight: 700; }
.brand__name { color: var(--ink); }
.brand__caret { display: none; }

.nav {
  display: flex;
  gap: 1.7rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.nav a {
  position: relative;
  text-decoration: none;
  color: var(--muted);
  padding: 0.15rem 0;
  transition: color 0.2s;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 100%; height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.28s;
}
.nav a:hover { color: var(--ink); }
.nav a:hover::after { transform: scaleX(1); }

/* ============================================================= *
   HOME — LEDE (editorial hero)
 * ============================================================= */
.lede {
  max-width: var(--wide);
  margin: 0 auto;
  padding: clamp(3.5rem, 11vh, 7rem) var(--gutter) clamp(2.5rem, 6vh, 4rem);
}
.lede__title {
  font-family: var(--display);
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: clamp(2.6rem, 1.4rem + 5vw, 5.4rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin-top: 1.3rem;
  max-width: 16ch;
  text-wrap: balance;
}
.lede__title em { font-style: italic; color: var(--accent); }

.lede__intro {
  max-width: 40rem;
  margin-top: 2.1rem;
  color: var(--ink-soft);
  font-size: clamp(1.1rem, 1rem + 0.5vw, 1.3rem);
  line-height: 1.68;
}
.lede__intro p + p { margin-top: 1.05rem; }
.lede__intro em { font-style: italic; color: var(--ink); }
.lede__intro p:first-of-type::first-letter {
  float: left;
  font-family: var(--display);
  font-weight: 600;
  font-size: 3.5em;
  line-height: 0.72;
  margin: 0.06em 0.1em 0 0;
  color: var(--accent);
}

.lede__facts {
  list-style: none;
  padding: 1.3rem 0 0;
  margin-top: 2rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.4rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.lede__facts li { position: relative; padding-left: 1.1rem; }
.lede__facts li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.46em;
  width: 0.42rem; height: 0.42rem;
  background: var(--accent);
  transform: rotate(45deg);
}

/* ============================================================= *
   HOME — WRITING INDEX
 * ============================================================= */
.writing {
  max-width: var(--wide);
  margin: clamp(2.5rem, 7vh, 4.5rem) auto 6rem;
  padding: 0 var(--gutter);
}
.writing__head {
  display: flex;
  align-items: baseline;
  gap: 1.1rem;
  padding-bottom: 1rem;
  margin-bottom: 0;
  border-bottom: 2px solid var(--ink);
}
.writing__head h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  letter-spacing: -0.01em;
  color: var(--ink);
}
.writing__hint {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.feed { list-style: none; padding: 0; }
.feed__item { border-bottom: 1px solid var(--line); }
.feed__link {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: baseline;
  gap: clamp(1rem, 3vw, 2.2rem);
  padding: clamp(1.3rem, 2.6vw, 1.7rem) 0.4rem;
  text-decoration: none;
  color: var(--ink);
  position: relative;
  transition: padding-left 0.3s ease, background 0.3s;
}
.feed__link::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.3s ease;
}
.feed__link:hover { padding-left: 1.3rem; background: var(--accent-soft); }
.feed__link:hover::before { transform: scaleY(1); }

.feed__num {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.4rem, 1rem + 1.4vw, 2.1rem);
  line-height: 1;
  color: var(--faint);
  transition: color 0.3s;
  font-variant-numeric: tabular-nums;
}
.feed__link:hover .feed__num { color: var(--accent); }

.feed__body { min-width: 0; }
.feed__title {
  display: block;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.25rem, 1rem + 1vw, 1.65rem);
  line-height: 1.16;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.feed__desc {
  display: block;
  margin-top: 0.4rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
  max-width: 56ch;
}
.feed__meta {
  text-align: right;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  line-height: 1.5;
}
.feed__meta time { display: block; color: var(--ink-soft); }
.feed__mins { display: block; color: var(--faint); }
.feed__arrow {
  font-family: var(--mono);
  font-size: 1.3rem;
  color: var(--faint);
  transition: transform 0.3s, color 0.3s;
}
.feed__link:hover .feed__arrow { color: var(--accent); transform: translateX(5px); }

/* ============================================================= *
   POST
 * ============================================================= */
.post {
  max-width: var(--wide);
  margin: 0 auto;
  padding: clamp(3rem, 8vh, 5.5rem) var(--gutter) 5rem;
}
.post__header { max-width: 46rem; }
.post__title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.2rem, 1.4rem + 3.6vw, 4rem);
  line-height: 1.04;
  letter-spacing: -0.022em;
  margin-top: 1rem;
  text-wrap: balance;
}
.post__lede {
  margin-top: 1.2rem;
  font-family: var(--display);
  font-size: clamp(1.15rem, 1rem + 0.6vw, 1.45rem);
  line-height: 1.45;
  color: var(--ink-soft);
  font-style: italic;
}
.post__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
  margin-top: 1.6rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.post__meta .dot { color: var(--faint); }
.post__progress { color: var(--accent); }
.post__rule {
  display: block;
  height: 2px;
  margin-top: 2rem;
  background: var(--ink);
}

/* ---- PROSE ------------------------------------------------- */
.prose {
  max-width: var(--measure);
  margin-top: 2.6rem;
  font-size: 1.16rem;
}
.prose > * + * { margin-top: 1.4rem; }
.prose p { color: var(--ink-soft); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose em { font-style: italic; }

.prose > p:first-of-type::first-letter {
  float: left;
  font-family: var(--display);
  font-weight: 600;
  font-size: 3.4em;
  line-height: 0.72;
  margin: 0.05em 0.11em 0 0;
  color: var(--accent);
}

.prose h2, .prose h3, .prose h4 {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.012em;
  line-height: 1.18;
  color: var(--ink);
}
.prose h2 {
  font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.1rem);
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.prose h3 { font-size: 1.4rem; margin-top: 2.3rem; }
.prose h4 { font-size: 1.14rem; margin-top: 1.8rem; font-family: var(--serif); font-weight: 600; }

.prose a {
  color: var(--accent-deep);
  text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 100% 1px;
  padding-bottom: 1px;
  transition: background-size 0.25s, color 0.25s;
}
.prose a:hover {
  color: #fdf6ea;
  background-size: 100% calc(100% - 0.05em);
}

.prose ul, .prose ol { padding-left: 1.4rem; color: var(--ink-soft); }
.prose li { margin-top: 0.5rem; }
.prose li::marker { color: var(--accent); }
.prose ul li::marker { content: "— "; }

.prose hr { border: 0; height: 1px; margin: 2.8rem 0; background: var(--line); }

/* blockquote */
.prose blockquote {
  margin: 2rem 0;
  padding: 0.3rem 0 0.3rem 1.5rem;
  border-left: 3px solid var(--accent);
  font-family: var(--display);
  font-style: italic;
  font-size: 1.3rem;
  line-height: 1.45;
  color: var(--ink);
}
.prose blockquote p { color: var(--ink); }

/* inline code */
.prose :not(pre) > code {
  font-family: var(--mono);
  font-size: 0.84em;
  padding: 0.12em 0.4em;
  border-radius: 4px;
  background: #e7ddca;
  border: 1px solid var(--line-2);
  color: var(--accent-deep);
  word-break: break-word;
}

/* code blocks — dark ink panel on the cream page */
.prose div.highlighter-rouge,
.prose figure.highlight,
.prose pre.highlight { margin: 1.9rem 0; }

.prose pre {
  overflow-x: auto;
  padding: 1.25rem 1.3rem;
  background: var(--ink-block);
  border: 1px solid rgba(0,0,0,0.25);
  border-radius: 8px;
  box-shadow: var(--shadow);
  font-family: var(--mono);
  font-size: 0.86rem;
  line-height: 1.7;
}
.prose pre code {
  font-family: var(--mono);
  background: none;
  border: 0;
  padding: 0;
  color: #ded7c6;
}

/* rouge token palette (on dark ink block) */
.highlight .c, .highlight .cm, .highlight .c1, .highlight .cs { color: #8a8472; font-style: italic; }
.highlight .k, .highlight .kd, .highlight .kn, .highlight .kp, .highlight .kr, .highlight .kt { color: #e6a85c; }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sb, .highlight .se, .highlight .sd { color: #9ed8a6; }
.highlight .nb, .highlight .bp { color: #e8c07c; }
.highlight .nf, .highlight .nx { color: #d6a6e8; }
.highlight .nv, .highlight .vg, .highlight .vi { color: #ded7c6; }
.highlight .mi, .highlight .mf, .highlight .m, .highlight .il { color: #f0a07c; }
.highlight .o, .highlight .ow, .highlight .p { color: #b8b2a2; }
.highlight .gp { color: #8fd6a6; }
.highlight .err { color: #ff9a86; }
.highlight .gi { color: #9ed8a6; }
.highlight .gd { color: #ff9a86; }

/* tables */
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.96rem;
  font-family: var(--serif);
  display: block;
  overflow-x: auto;
}
.prose thead { border-bottom: 2px solid var(--ink); }
.prose th {
  text-align: left;
  padding: 0.7rem 0.9rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  white-space: nowrap;
}
.prose td {
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  vertical-align: top;
}
.prose tbody tr:hover { background: var(--accent-soft); }

/* ---- CALLOUTS --------------------------------------------- */
.prose .sidebar-note,
.prose .callout {
  margin: 2.4rem 0;
  padding: 1.5rem 1.6rem 1.4rem;
  border-radius: 8px;
  position: relative;
  font-size: 1.02rem;
}
.prose .sidebar-note {
  background: rgba(154, 123, 52, 0.08);
  border: 1px solid rgba(154, 123, 52, 0.3);
}
.prose .callout {
  background: var(--accent-soft);
  border: 1px solid rgba(176, 74, 44, 0.34);
}
.prose .sidebar-note::before,
.prose .callout::before {
  position: absolute;
  top: -0.62rem; left: 1.2rem;
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
}
.prose .sidebar-note::before {
  content: "How I run mine";
  background: var(--paper);
  color: var(--gold);
  border: 1px solid rgba(154, 123, 52, 0.4);
}
.prose .callout::before {
  content: "Field note";
  background: var(--paper);
  color: var(--accent);
  border: 1px solid rgba(176, 74, 44, 0.4);
}
.prose .sidebar-note > :first-child,
.prose .callout > :first-child { margin-top: 0; }
.prose .sidebar-note p,
.prose .callout p { color: var(--ink-soft); }
.prose .sidebar-note strong,
.prose .callout strong { color: var(--ink); }
/* drop cap should never apply inside callouts */
.prose .sidebar-note p:first-of-type::first-letter,
.prose .callout p:first-of-type::first-letter { all: unset; }

/* ---- POST NAV --------------------------------------------- */
.post__nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  max-width: var(--wide);
  margin-top: 4.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--line);
}
.pnav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.4rem 1.5rem;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--card);
  transition: border-color 0.25s, transform 0.25s, background 0.25s;
}
.pnav--next { text-align: right; align-items: flex-end; }
.pnav:hover { border-color: var(--accent); transform: translateY(-3px); background: var(--paper-2); }
.pnav__label {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.pnav__title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.15rem;
  line-height: 1.2;
  color: var(--ink);
}

/* ============================================================= *
   404
 * ============================================================= */
.notfound {
  max-width: 44rem;
  margin: 0 auto;
  padding: clamp(4rem, 12vh, 9rem) var(--gutter) 7rem;
}
.notfound__term {
  margin-top: 1.4rem;
  padding: 1.3rem 1.4rem;
  background: var(--ink-block);
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.7;
  color: #ded7c6;
  white-space: pre-wrap;
  box-shadow: var(--shadow);
}
.notfound__prompt { color: #8fd6a6; }
.notfound__cursor {
  display: inline-block;
  width: 0.55rem; height: 1.05em;
  background: #e6a85c;
  transform: translateY(0.16em);
  animation: caret 1.15s steps(1) infinite;
}
.notfound__title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.2rem, 1.5rem + 3vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-top: 2.2rem;
}
.notfound__text { margin-top: 1rem; color: var(--muted); max-width: 38ch; }

/* ============================================================= *
   FOOTER
 * ============================================================= */
.site-footer {
  border-top: 2px solid var(--ink);
  margin-top: 4rem;
}
.site-footer__inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 2.4rem var(--gutter) 3.2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--muted);
}
.site-footer__sig .brand__prompt { color: var(--accent); }
.site-footer__meta a { color: var(--ink-soft); text-decoration: none; border-bottom: 1px solid var(--line); }
.site-footer__meta a:hover { color: var(--accent); border-color: var(--accent); }

/* ============================================================= *
   MOTION
 * ============================================================= */
@keyframes caret { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.reveal {
  opacity: 0;
  animation: fadeUp 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
  animation-delay: calc(var(--d, 0) * 110ms + 60ms);
}
.feed__item {
  opacity: 0;
  animation: fadeUp 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
  animation-delay: calc(var(--i, 0) * 65ms + 180ms);
}
.page-post .post__header > * { opacity: 0; animation: fadeUp 0.7s cubic-bezier(0.2,0.7,0.2,1) forwards; }
.page-post .kicker      { animation-delay: 60ms; }
.page-post .post__title { animation-delay: 140ms; }
.page-post .post__lede  { animation-delay: 220ms; }
.page-post .post__meta  { animation-delay: 300ms; }
.page-post .post__rule  { animation-delay: 360ms; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal, .feed__item, .page-post .post__header > * { opacity: 1; }
  html { scroll-behavior: auto; }
}

/* ============================================================= *
   SERIES GROUPS (home feed, grouped by series)
 * ============================================================= */
.series-group { margin-top: 2.8rem; }
.series-group:first-of-type { margin-top: 1.4rem; }
.series-group__title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.15rem, 1rem + 0.6vw, 1.42rem);
  letter-spacing: -0.01em;
  color: var(--ink);
  display: inline-block;
  margin: 0 0 0.1rem;
}
.series-group__hint {
  display: inline-block;
  margin-left: 0.85rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ============================================================= *
   DIAGRAMS — bespoke SVG figures + themed Mermaid blocks
 * ============================================================= */
.prose .diagram {
  margin: 2.6rem 0;
  padding: 1.5rem 1.5rem 1.2rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.prose .diagram img,
.prose .diagram svg {
  display: block;
  width: 100%;
  height: auto;
}
.prose .diagram figcaption {
  margin-top: 1rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
}
.prose .mermaid {
  margin: 2.4rem 0;
  padding: 1.5rem;
  text-align: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-x: auto;
}
.prose .mermaid svg { max-width: 100%; height: auto; }

/* ============================================================= *
   RESPONSIVE
 * ============================================================= */
@media (max-width: 640px) {
  .nav { gap: 1.1rem; }
  .nav a:nth-child(2) { display: none; }

  .feed__link {
    grid-template-columns: auto 1fr;
    gap: 0.4rem 1rem;
    align-items: start;
  }
  .feed__num { grid-row: 1 / span 2; }
  .feed__meta { grid-column: 2; text-align: left; margin-top: 0.5rem; }
  .feed__meta time, .feed__mins { display: inline; }
  .feed__mins::before { content: " · "; color: var(--faint); }
  .feed__arrow { display: none; }

  .post__nav { grid-template-columns: 1fr; }
  .pnav--next { text-align: left; align-items: flex-start; }
  .writing__hint, .series-group__hint { display: none; }

  .prose .diagram { padding: 0.9rem 0.9rem 0.7rem; }
  .prose .mermaid { padding: 0.9rem; }
}
