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

:root {
  color-scheme: light;
  --bg: #fdfcfa;
  --surface: #faf8f5;
  --surface-soft: #fbf7f6;
  --ink: #1a1a1a;
  --ink-soft: #3f3f3f;
  --muted: #6b7280;
  --faint: #73736f;
  --rule: #e7e4df;
  --accent: #ae2b25;
  --accent-strong: #8f211d;
  --code-bg: #f4f2ee;
  --selection-bg: #f1d2cf;
  --selection-ink: #1a1a1a;
  --measure: 44rem;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111214;
  --surface: #181a1d;
  --surface-soft: #1d191a;
  --ink: #f1f0ec;
  --ink-soft: #cbc9c3;
  --muted: #aaa8a2;
  --faint: #85837e;
  --rule: #32343a;
  --accent: #f27b70;
  --accent-strong: #ff958c;
  --code-bg: #1b1d21;
  --selection-bg: #683934;
  --selection-ink: #f1f0ec;
}

* { box-sizing: border-box; }

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

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

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;
  color: var(--ink); text-decoration: none;
}
.brand::before { content: "◗ "; color: var(--accent); }
.site-nav { display: flex; gap: 0.75rem; align-items: center; }
.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); }
.theme-toggle {
  width: 2rem; height: 2rem; padding: 0;
  display: grid; place-items: center;
  border: 1px solid var(--rule); border-radius: 4px;
  background: transparent; color: var(--muted); cursor: pointer;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.05rem; line-height: 1;
}
.theme-toggle:hover { background: var(--surface); color: var(--ink); }
.theme-icon-light { display: none; }
:root[data-theme="dark"] .theme-icon-light { display: inline; }
:root[data-theme="dark"] .theme-icon-dark { display: none; }
.site-nav a:focus-visible, .brand:focus-visible, a:focus-visible,
.theme-toggle:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.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; text-transform: uppercase;
  color: var(--accent); margin-bottom: 0.9rem;
}
.post h1 {
  font-size: 2.35rem; line-height: 1.12; letter-spacing: 0;
  margin: 0 0 0.6rem; font-weight: 700;
}
.post-standfirst { font-size: 1.18rem; color: var(--ink-soft); 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;
  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: var(--ink-soft);
}

/* 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;
  background: var(--surface);
}
.theme-art-dark { display: none; }
:root[data-theme="dark"] .theme-art-light { display: none; }
:root[data-theme="dark"] .theme-art-dark { display: block; }
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: var(--surface-soft); 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: var(--ink-soft); 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: var(--surface); 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; 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; color: var(--muted); }

/* cover — the title page you click into */
.cover {
  min-height: 82vh; display: flex; align-items: center;
  padding: 3rem 1.5rem; border-bottom: 1px solid var(--rule);
}
.cover-inner { max-width: 40rem; margin: 0 auto; width: 100%; }
.cover-kicker {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem; letter-spacing: 0; text-transform: uppercase;
  color: var(--accent); margin: 0 0 1.3rem;
}
.cover h1 { font-size: 3rem; line-height: 1.07; letter-spacing: 0; margin: 0 0 1rem; font-weight: 700; }
.cover-deck { font-size: 1.32rem; color: var(--ink-soft); line-height: 1.45; margin: 0 0 1.7rem; }
.cover-byline {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem; color: var(--faint); margin: 0 0 0.45rem;
}
.cover-support {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem; color: var(--muted); margin: 0 0 1.9rem;
}
.cover-cta {
  display: inline-block; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9rem; font-weight: 600; color: var(--bg); background: var(--ink);
  border: 1px solid var(--ink); border-radius: 4px; padding: 0.65rem 1.3rem; text-decoration: none;
}
.cover-cta:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--bg); text-decoration: none; }
#read { scroll-margin-top: 1.5rem; }

@media (max-width: 640px) { .cover h1 { font-size: 2.1rem; } .cover-deck { font-size: 1.12rem; } }

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