
/* StokeOnStocks blog  - plain, readable, not a storefront */
:root {
  --bg: #faf9f7;
  --bg-elev: #ffffff;
  --ink: #1a1917;
  --muted: #6b6560;
  --faint: #9c9590;
  --line: #e8e4df;
  --accent: #0d6e66;
  --accent-hover: #0a5a54;
  --max: 40rem;
  --max-wide: 46rem;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Source Serif 4", Georgia, serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-feature-settings: "kern" 1, "liga" 1;
}
a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.12em;
}
a:hover { color: var(--accent-hover); }
.wrap {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}
/*  - -  top bar  - -  */
.top {
  font-family: var(--sans);
  font-size: 0.8125rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  padding-bottom: 1.25rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--line);
}
.top .brand {
  color: var(--ink);
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.top .brand:hover { color: var(--accent); }
.top nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  color: var(--muted);
}
.top nav a {
  color: var(--muted);
  text-decoration: none;
}
.top nav a:hover { color: var(--ink); }
.top nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }
/*  - -  type  - -  */
.kicker {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 0.5rem;
}
h1 {
  font-family: var(--serif);
  font-size: clamp(1.65rem, 4.2vw, 2.15rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
}
h2 {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 2.25rem 0 0.85rem;
}
.lead {
  font-size: 1.05rem;
  color: var(--muted);
  margin: 0 0 1.25rem;
  max-width: 36rem;
  line-height: 1.55;
}
.meta {
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: var(--faint);
  margin: 0 0 1.75rem;
}
.meta span + span::before {
  content: "·";
  margin: 0 0.45rem;
  opacity: 0.6;
}
/*  - -  hero  - -  */
.hero {
  padding: 0.25rem 0 0.5rem;
  margin-bottom: 0.5rem;
}
/*  - -  series / essay lists  - -  */
.series-block {
  margin: 2rem 0 2.75rem;
  padding-bottom: 2.25rem;
  border-bottom: 1px solid var(--line);
}
.series-block:last-of-type { border-bottom: 0; padding-bottom: 0; }
.series-block h1, .series-block .series-title {
  font-size: clamp(1.35rem, 3vw, 1.65rem);
  margin-bottom: 0.55rem;
}
.series-block .lead { font-size: 1rem; margin-bottom: 1rem; max-width: 38rem; }
.series-block .links { margin-top: 1.15rem; }
/* roomy episode table/cards  - breathing space */
.section-block {
  margin: 2.25rem 0 2.5rem;
}
.section-block > h2 {
  margin: 0 0 1rem;
}
.essay-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.65rem;
}
.essay-list li { margin: 0; }
.essay-list a {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr) auto;
  gap: 0.85rem 1rem;
  align-items: baseline;
  padding: 0.95rem 1.1rem;
  color: inherit;
  text-decoration: none;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.essay-list a:hover {
  border-color: #b7e4df;
  box-shadow: 0 1px 0 rgba(13, 110, 102, 0.06);
  color: inherit;
}
.essay-list a:hover .num { color: var(--accent); }
.essay-list a:hover .go { color: var(--accent); }
.essay-list .num {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.01em;
  padding-top: 0.1rem;
}
.essay-list .title {
  font-size: 1rem;
  line-height: 1.45;
  min-width: 0;
}
.essay-list .go {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 500;
  white-space: nowrap;
}
.hero { margin-bottom: 1.75rem; }
.hero .lead { margin-bottom: 1rem; max-width: 38rem; }
.hero .meta { margin-top: 0.25rem; margin-bottom: 0; }
.part {
  margin: 2.25rem 0 0;
  padding-top: 1.75rem;
  border-top: 1px solid var(--line);
}
.part:first-of-type { border-top: 0; padding-top: 0; }
.part h3 {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  letter-spacing: -0.015em;
  text-transform: none;
}
.part .part-blurb {
  font-family: var(--sans);
  font-size: 0.92rem;
  color: var(--muted);
  margin: 0 0 1.1rem;
  line-height: 1.5;
  max-width: 38rem;
}
.part .note {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--faint);
  margin: 0 0 1rem;
}
.part .essay-list { margin-top: 0.25rem; }
.part .links { margin-top: 1.1rem; }
.series-block {
  margin: 2rem 0 2.75rem;
  padding-bottom: 2.25rem;
  border-bottom: 1px solid var(--line);
}
.wrap {
  max-width: 48rem;
  margin: 0 auto;
  padding: 2rem 1.35rem 5rem;
}
/*  - -  simple links row  - -  */
.links {
  font-family: var(--sans);
  font-size: 0.875rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.1rem;
  margin: 0.75rem 0 0;
}
.links a { text-decoration: none; font-weight: 500; }
.links a:hover { text-decoration: underline; }
/*  - -  article body (chapters)  - -  */
article {
  max-width: var(--max);
  margin-top: 0.5rem;
}
article h2 {
  font-family: var(--serif);
  font-size: 1.28rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 2.35rem 0 0.85rem;
  line-height: 1.25;
  padding-top: 0.35rem;
}
article h2:first-child { margin-top: 1.25rem; }
article p {
  margin: 0 0 1.15rem;
  line-height: 1.7;
}
article ul, article ol {
  margin: 0 0 1.35rem;
  padding-left: 1.35rem;
  line-height: 1.65;
}
article li { margin: 0.45rem 0; padding-left: 0.15rem; }
article li::marker { color: var(--accent); }
article table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0 1.5rem;
  font-size: 0.92rem;
  font-family: var(--sans);
}
article th, article td {
  border: 1px solid var(--line);
  padding: 0.55rem 0.7rem;
  text-align: left;
  vertical-align: top;
}
article th {
  background: #f0eeea;
  font-weight: 600;
  color: var(--ink);
  font-size: 0.8rem;
}
article td { background: var(--bg-elev); }
.cta {
  margin: 2rem 0 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-elev);
  font-family: var(--sans);
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--muted);
}
.cta strong { color: var(--ink); }
.cta a { font-weight: 600; }
article code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: #f0eeea;
  padding: 0.1em 0.35em;
  border-radius: 3px;
}
/* Numbered solution moves (was broken <pre>) */
.steps {
  list-style: none;
  margin: 1.25rem 0 1.75rem;
  padding: 0;
  display: grid;
  gap: 1rem;
  counter-reset: none;
}
.step {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem 1.15rem 1.05rem;
}
.step .step-head {
  display: grid;
  grid-template-columns: 1.75rem 1fr;
  gap: 0.65rem;
  align-items: start;
  margin: 0 0 0.55rem;
}
.step .step-num {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--accent);
  line-height: 1.4;
}
.step .step-title {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.98rem;
  line-height: 1.4;
  color: var(--ink);
  margin: 0;
}
.step .step-body {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.65;
  color: var(--ink);
}
.step .step-body + .step-body { margin-top: 0.65rem; }
/* bullet callout lists converted from pre */
.point-list {
  list-style: none;
  margin: 1rem 0 1.5rem;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}
.point-list li {
  margin: 0;
  padding: 0.75rem 0.95rem;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 8px;
  line-height: 1.55;
}
.point-list li::before {
  content: "-";
  color: var(--accent);
  font-weight: 700;
  margin-right: 0.45rem;
}
/* hide raw mermaid source when PNG diagram is shown */
.diagram-panel pre.mermaid,
.diagram-panel pre:not(.keep) {
  display: none;
}
.diagram-panel {
  margin: 1.75rem 0 2rem;
  padding: 0;
  background: transparent;
  border: 0;
}
.diagram-panel img {
  max-width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-elev);
}
.diagram-panel .diagram-note,
.diagram-panel figcaption {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0.55rem 0 0.75rem;
  line-height: 1.45;
}
.side {
  margin: 2.5rem 0 1rem;
  padding: 1.15rem 0 0;
  border-top: 1px solid var(--line);
  font-family: var(--sans);
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.55;
}
/* chapter header breathing room */
header.hero {
  margin-bottom: 1.5rem;
  padding-bottom: 0.25rem;
}
header.hero h1 { margin-bottom: 0.65rem; }
header.hero .lead { margin-bottom: 0.35rem; max-width: 38rem; }
.nav {
  margin-bottom: 1.5rem !important;
}
.side {
  margin: 2rem 0;
  padding: 1rem 0 0;
  border-top: 1px solid var(--line);
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}
.side strong {
  display: block;
  color: var(--ink);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
  font-weight: 600;
}
/* chapter local nav + callouts */
.nav {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin: 0 0 1.25rem;
}
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover { color: var(--accent); }
.howto {
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 1.5rem;
  padding: 0.85rem 0 0.85rem 0.9rem;
  border-left: 2px solid var(--line);
  line-height: 1.5;
}
.howto strong {
  color: var(--ink);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
}
.howto p { margin: 0.35rem 0 0; }
/* chapter chrome */

.chap-nav {
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0 0 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  align-items: baseline;
}
.chap-nav a { color: var(--muted); text-decoration: none; }
.chap-nav a:hover { color: var(--accent); }
.chap-nav .sep { color: var(--line); }
header.hero .prev-next,
.chap-links {
  font-family: var(--sans);
  font-size: 0.85rem;
  margin: 0 0 1.25rem;
}
.chap-links a { margin-right: 1rem; }
footer.site-foot {
  margin-top: 3.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--faint);
  line-height: 1.5;
}
footer.site-foot a { color: var(--muted); text-decoration: none; }
footer.site-foot a:hover { color: var(--accent); }
/* hide legacy footers that say "books" if any remain */
footer:not(.site-foot) {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--faint);
}
/* mermaid pre blocks */
pre.mermaid {
  font-family: var(--mono);
  font-size: 0.75rem;
  overflow: auto;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.85rem;
}
/* commerce (hidden until enabled) */
.commerce-bar {
  font-family: var(--sans);
  font-size: 0.875rem;
  margin: 1.5rem 0;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-elev);
}
.commerce-bar a { font-weight: 600; }
@media (max-width: 520px) {
  .essay-list a { grid-template-columns: 3rem 1fr; gap: 0.55rem 0.75rem; padding: 0.85rem 0.9rem; }
  .essay-list .go { display: none; }
  body { font-size: 1.02rem; }
}
