:root {
  --bg: #fafafa;
  --fg: #1a1a1a;
  --muted: #666;
  --rule: #ddd;
  --accent: #1a1a1a;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --fg: #eaeaea;
    --muted: #999;
    --rule: #2e2e2e;
    --accent: #eaeaea;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
main {
  max-width: 38rem;
  margin: 0 auto;
  padding: 4.5rem 1.5rem 3rem;
}
.identity {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 0.15rem;
}
.identity-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
h1 {
  font-size: 1.6rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.01em;
}
.tagline {
  font-size: 1.05rem;
  color: var(--muted);
  margin: 0 0 2.25rem;
}
p.intro {
  font-size: 1rem;
  margin: 0 0 2rem;
}
h2 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
  margin: 0 0 0.9rem;
}
.nav-link {
  flex-shrink: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--fg);
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 3px;
  white-space: nowrap;
}
.nav-link::after {
  content: " \2192";
}
.nav-link:hover {
  text-decoration-color: var(--fg);
}
ul.services {
  list-style: none;
  margin: 0 0 2.25rem;
  padding: 0;
}
ul.services li {
  padding: 0.55rem 0;
  border-top: 1px solid var(--rule);
  font-size: 0.98rem;
}
ul.services li:last-child {
  border-bottom: 1px solid var(--rule);
}
ul.services li strong {
  font-weight: 600;
}
ul.services li span.desc {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.15rem;
}
ul.services li a {
  color: var(--fg);
  text-decoration: none;
  font-weight: 600;
}
ul.services li a:hover {
  text-decoration: underline;
}
.series-box {
  border: 1px solid var(--rule);
  border-radius: 0.5rem;
  padding: 0 1rem;
  margin: 0 0 1.25rem;
}
.series-box ul.services {
  margin: 0;
}
.series-box ul.services li:last-child {
  border-bottom: none;
}
.icon-package {
  vertical-align: -3px;
  margin-right: 0.5rem;
}
.book {
  margin: 0 0 2.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.book a.button {
  display: inline-block;
  padding: 0.65rem 1.15rem;
  border: 1px solid var(--fg);
  border-radius: 0.35rem;
  color: var(--fg);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
}
.book a.button:hover {
  background: var(--fg);
  color: var(--bg);
}
.contact {
  font-size: 0.98rem;
}
.contact a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
}
.contact a:hover {
  border-bottom-color: var(--accent);
}
.contact div {
  margin: 0.3rem 0;
}
footer {
  margin-top: 3rem;
  font-size: 0.8rem;
  color: var(--muted);
}

/* Article pages */
.back {
  display: inline-block;
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 2rem;
}
.back:hover {
  color: var(--fg);
}
.article-meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 2.5rem;
}
.prose h1 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}
.prose p {
  margin: 0 0 1.15rem;
}
.prose p a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 2px solid var(--accent);
}
.prose p a:hover {
  border-bottom-width: 3px;
}
.prose h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
}
.prose ul, .prose ol {
  margin: 0 0 1.15rem;
  padding-left: 1.25rem;
}
.prose li {
  margin: 0 0 0.4rem;
}
.prose strong {
  font-weight: 600;
}
.diagram {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 0.5rem;
  padding: 1rem;
  margin: 0 0 0.6rem;
  overflow-x: auto;
}
.diagram img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
}
.diagram-caption {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0 0 1.75rem;
}
.prose blockquote {
  margin: 0 0 1.15rem;
  padding-left: 1rem;
  border-left: 2px solid var(--rule);
  color: var(--muted);
}
.references {
  margin: 2.5rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}
.references h2 {
  margin-bottom: 0.75rem;
}
.references ol {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.82rem;
}
.references li {
  margin: 0 0 0.4rem;
  color: var(--muted);
}
.references a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
}
.references a:hover {
  color: var(--fg);
  border-bottom-color: var(--fg);
}

/* Audit lead-magnet page */
.prose pre {
  background: var(--fg);
  border: 1px solid var(--rule);
  border-radius: 0.5rem;
  padding: 0.9rem 1rem;
  margin: 0 0 1.15rem;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.5;
}
.prose pre code {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  color: var(--bg);
}
.audit-form {
  margin-top: 0.5rem;
}
.audit-form .field {
  margin: 0 0 0.9rem;
}
.audit-form label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.3rem;
}
.audit-form input,
.audit-form textarea {
  width: 100%;
  font: inherit;
  font-size: 0.95rem;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 0.35rem;
  padding: 0.55rem 0.7rem;
}
.audit-form input:focus,
.audit-form textarea:focus {
  outline: none;
  border-color: var(--fg);
}
.audit-form textarea {
  resize: vertical;
  min-height: 4.5rem;
}
.audit-form button {
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--bg);
  background: var(--fg);
  border: 1px solid var(--fg);
  border-radius: 0.35rem;
  padding: 0.65rem 1.15rem;
  cursor: pointer;
}
.audit-form button:hover {
  opacity: 0.85;
}
.audit-form button:disabled {
  opacity: 0.5;
  cursor: default;
}
.audit-form .note {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.6rem;
}
.audit-status {
  display: none;
  padding: 0.9rem 1rem;
  border: 1px solid var(--rule);
  border-radius: 0.5rem;
  font-size: 0.92rem;
}
.audit-status.show {
  display: block;
}
.audit-status.error {
  border-color: #b3261e;
  color: #b3261e;
}
