/* detsema site — editorial technical blog. Serif body, narrow measure,
   restrained palette. No cards, grids, gradients, or marketing chrome. */

:root {
  --bg: #fdfcfa;
  --ink: #1a1a1a;
  --muted: #6b7280;
  --faint: #8a8a85;
  --rule: #e7e4df;
  --accent: #ae2b25;
  --code-bg: #f4f2ee;
  --measure: 44rem;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Charter, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 19px;
  line-height: 1.65;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

.shell { width: 100%; max-width: var(--measure); margin: 0 auto; padding: 0 1.5rem; }

/* header / footer — small, out of the way */
.site-header { border-bottom: 1px solid var(--rule); }
.header-inner {
  max-width: 52rem; margin: 0 auto; padding: 0.9rem 1.5rem;
  display: flex; align-items: baseline; justify-content: space-between;
}
.brand {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 600; font-size: 0.95rem; letter-spacing: 0.02em;
  color: var(--ink); text-decoration: none;
}
.brand::before { content: "◗ "; color: var(--accent); }
.site-nav { display: flex; gap: 1.25rem; }
.site-nav a {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem; color: var(--muted); text-decoration: none;
}
.site-nav a:hover { color: var(--ink); }

.site-footer { border-top: 1px solid var(--rule); margin-top: 4rem; }
.footer-inner {
  max-width: 52rem; margin: 0 auto; padding: 1.5rem;
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem; color: var(--faint);
}
.footer-inner a { color: var(--muted); }

/* links */
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

/* article */
.post { padding: 3rem 1.5rem 1rem; }
.post-head { margin-bottom: 2.5rem; }
.post-kicker {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 0.9rem;
}
.post h1 {
  font-size: 2.35rem; line-height: 1.12; letter-spacing: -0.015em;
  margin: 0 0 0.6rem; font-weight: 700;
}
.post-standfirst { font-size: 1.18rem; color: #3f3f3f; font-style: italic; margin: 0 0 1.1rem; }
.post-meta {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.76rem; color: var(--faint);
  display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center;
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  padding: 0.7rem 0;
}
.post-meta span::after { content: "·"; margin-left: 0.6rem; color: var(--rule); }
.post-meta span:last-child::after { content: ""; }

.post-body > * { max-width: 100%; }
.post-body h2 {
  font-size: 1.5rem; line-height: 1.2; letter-spacing: -0.01em;
  margin: 2.8rem 0 0.8rem; font-weight: 700;
}
.post-body h3 { font-size: 1.15rem; margin: 2rem 0 0.5rem; font-weight: 700; }
.post-body p { margin: 0 0 1.15rem; }
.post-body ul { padding-left: 1.2rem; margin: 0 0 1.3rem; }
.post-body li { margin-bottom: 0.5rem; }
.post-body strong { font-weight: 700; }
.post-body hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5rem 0; }
.post-body blockquote {
  margin: 1.5rem 0; padding: 0.2rem 0 0.2rem 1.2rem;
  border-left: 3px solid var(--accent); color: #3f3f3f;
}

/* code */
code, pre, .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
:not(pre) > code {
  background: var(--code-bg); padding: 0.1em 0.35em; border-radius: 3px;
  font-size: 0.86em;
}
pre {
  background: var(--code-bg); border: 1px solid var(--rule); border-radius: 6px;
  padding: 1rem 1.1rem; overflow-x: auto; font-size: 0.82rem; line-height: 1.55;
  margin: 0 0 1.4rem;
}
pre code { background: none; padding: 0; font-size: inherit; }

/* figures */
figure { margin: 2rem 0; }
figure img, figure svg { width: 100%; height: auto; display: block; border-radius: 6px; }
figure.bordered img { border: 1px solid var(--rule); }
figcaption {
  font-size: 0.82rem; color: var(--muted); margin-top: 0.6rem; line-height: 1.45;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* key result callout — one restrained device, not a card grid */
.keystat {
  margin: 2rem 0; padding: 1.1rem 1.3rem;
  border: 1px solid var(--rule); border-left: 3px solid var(--accent);
  background: #fbf7f6; border-radius: 4px;
}
.keystat .formula {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.05rem; color: var(--ink); margin: 0 0 0.3rem;
}
.keystat .note { font-size: 0.95rem; color: #4a4a4a; margin: 0; }

/* optional derivation — collapsed by default so the main read stays light */
.post-body details.aside {
  margin: -0.4rem 0 1.6rem; border: 1px solid var(--rule); border-radius: 6px;
  background: #faf8f5; font-size: 0.95rem;
}
.post-body details.aside > summary {
  cursor: pointer; list-style: none; padding: 0.55rem 0.95rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem; letter-spacing: 0.01em; color: var(--muted);
}
.post-body details.aside > summary::-webkit-details-marker { display: none; }
.post-body details.aside > summary::before { content: "\25B8\00a0\00a0"; color: var(--accent); }
.post-body details.aside[open] > summary::before { content: "\25BE\00a0\00a0"; }
.post-body details.aside > summary:hover { color: var(--ink); }
.post-body details.aside p { margin: 0.2rem 0 0.9rem; padding: 0 0.95rem; }

/* tables */
table { width: 100%; border-collapse: collapse; margin: 0 0 1.4rem; font-size: 0.9rem; }
th, td { text-align: left; padding: 0.5rem 0.7rem; border-bottom: 1px solid var(--rule); }
th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }

@media (max-width: 640px) {
  body { font-size: 17.5px; }
  .post h1, .home h1 { font-size: 1.9rem; }
  .post-body h2 { font-size: 1.3rem; }
}
