:root {
  --text: #222;
  --muted: #666;
  --soft: #999;
  --accent: #1a7040;
  --rule: #eaeaea;
  --code-bg: #f6f7f8;
  --callout-bg: #f4f8fa;
  --callout-border: #2a6b8f;
  --warn-bg: #fdf7ee;
  --warn-border: #b37315;
  --finding-bg: #f6f3fa;
  --finding-border: #553b82;
  --max: 720px;
}

* { box-sizing: border-box; }

html {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  font-family: Charter, "Source Serif Pro", "PT Serif", Georgia, "Times New Roman", serif;
  font-size: 19px;
  line-height: 1.7;
  color: var(--text);
  max-width: var(--max);
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
  background: #fff;
}

h1, h2, h3, h4, .toc, nav, .meta, .caption, .lede-meta, .pull, .stat-num, button, figcaption {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  font-weight: 700;
  letter-spacing: -0.01em;
}

h1 {
  font-size: 2.55rem;
  line-height: 1.15;
  margin: 0 0 0.4rem;
  letter-spacing: -0.025em;
}

.subtitle {
  font-family: Charter, Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: 1.25rem;
  line-height: 1.5;
  color: var(--muted);
  margin: 0 0 1.8rem;
}

.lede-meta {
  color: var(--soft);
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-weight: 600;
  margin: 0 0 2rem;
}

.cover {
  margin: 0.5rem 0 2.5rem;
  border-radius: 8px;
  overflow: hidden;
  background: #f4f5f6;
  border: 1px solid var(--rule);
  aspect-ratio: 900 / 592;
  line-height: 0;
}

.cover img,
.cover video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.cover-caption {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
  font-size: 0.8rem;
  color: var(--soft);
  text-align: center;
  margin: 0.6rem 0 2.5rem;
  letter-spacing: 0.02em;
  font-style: italic;
  font-weight: 500;
}

.lede {
  font-size: 1.18rem;
  line-height: 1.55;
  color: #333;
  margin-bottom: 2.5rem;
  font-style: normal;
}

.lede strong { color: var(--text); }

h2 {
  font-size: 1.6rem;
  margin: 4rem 0 1.1rem;
  padding-top: 0.2rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

h2::before {
  content: "§";
  color: var(--accent);
  margin-right: 0.5rem;
  font-size: 0.9em;
  opacity: 0.7;
}

h3 {
  font-size: 1.2rem;
  margin: 2.8rem 0 0.8rem;
  color: var(--text);
}

h4 {
  font-size: 1rem;
  margin: 2rem 0 0.6rem;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

p { margin: 0 0 1.3rem; }

strong { color: var(--text); font-weight: 600; }

code {
  font-family: "JetBrains Mono", "SF Mono", "Fira Code", Menlo, Consolas, monospace;
  font-size: 0.86em;
  background: var(--code-bg);
  padding: 0.1em 0.38em;
  border-radius: 3px;
  color: #24292e;
}

pre {
  background: var(--code-bg);
  padding: 1.1rem 1.25rem;
  border-radius: 6px;
  overflow-x: auto;
  line-height: 1.55;
  font-size: 0.82em;
  margin: 1.5rem 0;
  border: 1px solid var(--rule);
}

pre code {
  background: none;
  padding: 0;
  font-size: inherit;
  color: #24292e;
}

.code-label {
  font-family: "JetBrains Mono", "SF Mono", Menlo, monospace;
  font-size: 0.75rem;
  color: var(--muted);
  margin: 2rem 0 -0.7rem 0;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--rule);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(26, 112, 64, 0.3);
}

a:hover {
  border-bottom-color: var(--accent);
}

blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.1rem 0 0.1rem 1.15rem;
  margin: 1.5rem 0;
  color: #444;
  font-style: italic;
}

table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.8rem 0;
  font-size: 0.88rem;
  font-family: -apple-system, BlinkMacSystemFont, Arial, sans-serif;
}

th, td {
  text-align: left;
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

thead th {
  border-bottom: 2px solid var(--text);
  font-weight: 700;
  color: var(--text);
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

tbody tr:hover { background: #fafafa; }

nav.toc {
  background: #fafafa;
  padding: 1.25rem 1.5rem;
  border-radius: 6px;
  margin: 2.5rem 0;
  font-size: 0.93rem;
  border: 1px solid var(--rule);
}

nav.toc-title {
  font-weight: 700;
  color: var(--soft);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}

nav.toc ol {
  list-style: none;
  counter-reset: toc;
  padding-left: 0;
  margin: 0;
}

nav.toc ol li {
  counter-increment: toc;
  padding-left: 2.5rem;
  position: relative;
  line-height: 1.85;
}

nav.toc ol li::before {
  content: counter(toc, decimal-leading-zero);
  position: absolute;
  left: 0;
  color: var(--soft);
  font-size: 0.8rem;
  font-weight: 600;
  top: 0.15rem;
}

nav.toc a {
  color: var(--text);
  border-bottom: none;
}

nav.toc a:hover { color: var(--accent); }

.pull {
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  font-size: 1.55rem;
  line-height: 1.3;
  color: var(--text);
  margin: 2.5rem -0.5rem;
  padding: 1.8rem 1.5rem;
  border-top: 3px solid var(--text);
  border-bottom: 1px solid var(--text);
  letter-spacing: -0.015em;
  font-weight: 700;
}

.callout {
  background: var(--callout-bg);
  border-left: 3px solid var(--callout-border);
  padding: 0.9rem 1.15rem;
  margin: 1.8rem 0;
  font-size: 0.95rem;
  border-radius: 0 4px 4px 0;
  line-height: 1.55;
}

.callout p:last-child { margin-bottom: 0; }

.callout .callout-label {
  font-family: -apple-system, sans-serif;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--callout-border);
  font-weight: 700;
  margin-right: 0.5rem;
}

.callout.warn {
  background: var(--warn-bg);
  border-left-color: var(--warn-border);
}

.callout.warn .callout-label { color: var(--warn-border); }

.callout.finding {
  background: var(--finding-bg);
  border-left-color: var(--finding-border);
}

.callout.finding .callout-label { color: var(--finding-border); }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.stat {
  background: #fafafa;
  padding: 1rem;
  border-radius: 6px;
  border: 1px solid var(--rule);
}

.stat-num {
  font-size: 1.8rem;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.35rem;
  line-height: 1.4;
}

hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 3.5rem auto;
  max-width: 180px;
}

.priority-table td:nth-child(1) { white-space: nowrap; font-weight: 600; color: var(--muted); }
.priority-table td:nth-child(2) { font-weight: 600; }
.priority-table td:nth-child(4) { font-family: "JetBrains Mono", monospace; font-size: 0.82em; color: var(--accent); }

.findings-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
  counter-reset: finding;
}

.findings-list li {
  counter-increment: finding;
  padding: 1.1rem 1.25rem 1.1rem 3.5rem;
  margin-bottom: 1rem;
  background: #fafafa;
  border-left: 3px solid var(--finding-border);
  border-radius: 0 4px 4px 0;
  position: relative;
  line-height: 1.55;
  font-size: 0.96rem;
}

.findings-list li::before {
  content: counter(finding);
  font-family: -apple-system, sans-serif;
  font-weight: 700;
  color: var(--finding-border);
  font-size: 1.5rem;
  position: absolute;
  left: 1rem;
  top: 0.95rem;
  line-height: 1;
}

footer {
  margin-top: 5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--rule);
  color: var(--soft);
  font-size: 0.85rem;
  text-align: center;
  font-family: -apple-system, sans-serif;
}

footer a { color: var(--muted); }

@media (max-width: 640px) {
  body {
    padding: 2rem 1.1rem 3.5rem;
    font-size: 17px;
  }
  h1 { font-size: 2rem; }
  h2 { font-size: 1.4rem; margin-top: 3rem; }
  h3 { font-size: 1.1rem; }
  .pull { font-size: 1.25rem; padding: 1.4rem 1rem; margin: 2rem 0; }
  pre { font-size: 0.75em; padding: 0.85rem 1rem; }
  .lede { font-size: 1.08rem; }
  .subtitle { font-size: 1.1rem; }
  .stat-num { font-size: 1.5rem; }
  nav.toc { padding: 1rem 1.15rem; }
  table { font-size: 0.82rem; }
  th, td { padding: 0.45rem 0.55rem; }
}
