/* api/coach — one stylesheet for every page. */

:root {
  --bg: #FBFAF6;
  --ink: #15171C;
  --muted: #4A4F59;
  --faint: #6B6F78;
  --rule: #D9D7CF;
  --accent: #2546D8;
  --code-bg: #FFFFFF;
  --inline-code-bg: #EFEDE6;
  --indent: 3ch;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'IBM Plex Mono', Menlo, Consolas, monospace;
  font-size: clamp(14px, 0.35vw + 12px, 17px);
  line-height: 1.7;
}

a { color: inherit; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

h1, h2, h3 { margin: 0; font-size: 1em; font-weight: 600; }
p { margin: 0; text-wrap: pretty; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Layout */

.page {
  max-width: 72ch;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 72px) 16px 72px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px 4ch;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--ink);
}

.site-main { display: flex; flex-direction: column; gap: 40px; }

.brand { display: flex; flex-direction: column; text-decoration: none; }
.brand-name { font-weight: 500; font-size: 1.25em; letter-spacing: -0.01em; }
.slash { color: var(--accent); }
.tagline { color: var(--muted); }

.site-nav { display: flex; flex-wrap: wrap; gap: 0 2ch; }
.site-nav a { min-height: 44px; display: inline-flex; align-items: center; }
.site-nav a[aria-current="page"] { color: var(--ink); text-decoration: none; font-weight: 600; }

.lnk,
.site-nav a,
.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.site-footer {
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  color: var(--faint);
  font-size: 0.85em;
}

/* Shared text helpers */

.section { display: flex; flex-direction: column; gap: 10px; }
.num { color: var(--faint); }
.ind { padding-left: var(--indent); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }

/* Home */

.services {
  margin: 0;
  padding: 0 0 0 var(--indent);
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.services li { display: flex; flex-direction: column; }
.services strong { font-weight: 600; }

.contact { display: flex; flex-direction: column; }

/* Blog index */

.post-list { margin: 0; padding: 0; list-style: none; }
.post-list li { border-top: 1px solid var(--rule); }
.post-list li:last-child { border-bottom: 1px solid var(--rule); }

.post-link {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 3ch;
  padding: 16px 0;
  text-decoration: none;
}
.post-date { flex: none; width: 12ch; color: var(--faint); }
.post-text { flex: 1 1 36ch; display: flex; flex-direction: column; gap: 2px; }
.post-title {
  color: var(--accent);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.post-link:hover .post-title { text-decoration-thickness: 2px; }
.post-summary { color: var(--muted); }

.empty {
  padding: 16px 0 16px var(--indent);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  color: var(--muted);
}

.draft-flag {
  display: inline-block;
  margin-left: 1ch;
  padding: 0 0.6ch;
  border: 1px solid var(--faint);
  color: var(--faint);
  font-size: 0.8em;
  font-weight: 400;
  text-decoration: none;
}

/* Post */

.post { display: flex; flex-direction: column; gap: 24px; line-height: 1.75; }
.post-head { display: flex; flex-direction: column; gap: 6px; }
.post-head h1 { font-size: 1.6em; line-height: 1.25; letter-spacing: -0.02em; text-wrap: balance; }
.back { align-self: flex-start; color: var(--muted); min-height: 44px; display: inline-flex; align-items: center; }
.meta { color: var(--faint); }

.prose { display: flex; flex-direction: column; gap: 18px; counter-reset: h2; }
.prose h2 { counter-increment: h2; margin-top: 14px; }
.prose h2::before { content: counter(h2) ". "; color: var(--faint); }
.prose h3 { margin-top: 6px; }

/* Everything after the first section heading sits indented under it. */
.prose h2 ~ :not(h2) { margin-left: var(--indent); }

.prose pre {
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--ink);
  background: var(--code-bg);
  font: inherit;
  font-size: 0.9em;
  line-height: 1.7;
  overflow-x: auto;
}
.prose code { font: inherit; }
.prose :not(pre) > code { background: var(--inline-code-bg); padding: 0 0.3ch; }
.prose .note { color: var(--accent); }

.prose figure { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.prose figcaption { color: var(--faint); font-size: 0.85em; }

.prose ul { margin: 0; padding-left: 2ch; list-style: "- "; display: flex; flex-direction: column; gap: 6px; }
.prose ol { margin: 0; padding: 0; list-style: none; counter-reset: li; display: flex; flex-direction: column; gap: 6px; }
.prose ol > li { counter-increment: li; padding-left: 3ch; text-indent: -3ch; }
.prose ol > li::before { content: counter(li, lower-alpha) ". "; }

.prose blockquote { margin: 0; padding-left: 2ch; color: var(--muted); font-style: italic; }
.prose hr { width: 100%; border: 0; border-top: 1px solid var(--rule); }
.prose img { max-width: 100%; height: auto; }

.prose table { border-collapse: collapse; display: block; overflow-x: auto; }
.prose th, .prose td { padding: 4px 1.5ch; border-bottom: 1px solid var(--rule); text-align: left; }

.post-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 4ch;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
}
.post-nav a { min-height: 44px; display: inline-flex; align-items: center; }

/* Phones */

@media (max-width: 640px) {
  :root { --indent: 0; }
}
