:root {
  --primary: #14532d;
  --secondary: #052e16;
  --accent: #f43f5e;
  --bg: #ffffff;
  --surface: #f0fdf4;
  --surface-alt: #dcfce7;
  --text: #052e16;
  --muted: #64748b;
  --border: #86efac;
  --row-alt: #f0fdf4;
  --radius: 6px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 17px;
}
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
header.site {
  position: sticky; top: 0; z-index: 100;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  color: #fff;
  box-shadow: 0 2px 6px rgba(5, 46, 22, 0.18);
}
header.site .wrap { display: flex; align-items: center; gap: 16px; padding-top: 12px; padding-bottom: 12px; flex-wrap: wrap; }
header.site img.logo { width: 40px; height: 40px; border-radius: 6px; }
header.site .brand { font-weight: 700; color: #fff; text-decoration: none; font-size: 18px; letter-spacing: 0.2px; }
nav.primary { margin-left: auto; }
nav.primary ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 14px; }
nav.primary a { color: #dcfce7; text-decoration: none; font-size: 15px; font-weight: 500; }
nav.primary a:hover { color: #fff; text-decoration: underline; }
.hero {
  background: linear-gradient(135deg, var(--surface-alt) 0%, var(--surface) 60%, #ffffff 100%);
  padding: 56px 0 36px;
  border-bottom: 4px solid var(--accent);
}
h1 { font-size: 34px; line-height: 1.2; margin: 0 0 12px; color: var(--secondary); font-weight: 800; letter-spacing: -0.3px; }
h2 { font-size: 24px; line-height: 1.3; margin: 40px 0 14px; color: var(--secondary); font-weight: 700; padding: 10px 16px; background: var(--surface); border-left: 5px solid var(--accent); border-radius: 0 6px 6px 0; }
h3 { font-size: 19px; margin: 26px 0 10px; color: var(--primary); }
p { margin: 0 0 14px; }
a { color: var(--primary); }
a:hover { color: var(--accent); }
.byline { color: var(--muted); font-size: 14px; margin: 0 0 24px; }
.byline strong { color: var(--secondary); }
.intro p { font-size: 18px; }
main { padding-bottom: 40px; }
.toc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 22px; margin: 24px 0 30px; }
.toc strong { display: block; margin-bottom: 8px; color: var(--secondary); }
.toc ol { columns: 2; column-gap: 24px; margin: 0; padding-left: 20px; }
.toc ol li { margin-bottom: 6px; break-inside: avoid; }
.toc a { color: var(--secondary); text-decoration: none; }
.toc a:hover { color: var(--accent); text-decoration: underline; }
ul, ol { padding-left: 22px; margin: 8px 0 16px; }
ul { list-style: none; padding-left: 4px; }
ul li { position: relative; padding-left: 22px; margin-bottom: 8px; }
ul li::before { content: "\2192"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
ol { counter-reset: item; list-style: none; padding-left: 0; }
ol li { counter-increment: item; padding-left: 40px; position: relative; margin-bottom: 10px; }
ol li::before { content: counter(item); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #fff; text-align: center; line-height: 28px; font-weight: 700; font-size: 14px; }
.toc ol { counter-reset: item; }
.toc ol li { padding-left: 0; }
.toc ol li::before { display: none; }
.toc ol li { list-style: decimal; padding-left: 4px; }
.table-wrap { overflow-x: auto; margin: 18px 0 22px; border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 15px; background: #fff; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: linear-gradient(90deg, var(--primary), var(--secondary)); color: #fff; font-weight: 600; }
tr:nth-child(even) td { background: var(--row-alt); }
tr:last-child td { border-bottom: none; }
details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin: 10px 0; padding: 0; }
details summary { padding: 14px 42px 14px 18px; font-weight: 600; color: var(--secondary); cursor: pointer; position: relative; list-style: none; }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: "\25BC"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); color: var(--accent); transition: transform 0.2s; font-size: 12px; }
details[open] summary::after { transform: translateY(-50%) rotate(180deg); }
details > p, details > ul, details > ol { padding: 0 18px 14px; margin-top: -4px; }
.figure { margin: 22px 0; }
.figure img, .figure svg { max-width: 100%; height: auto; display: block; border-radius: var(--radius); }
.figure figcaption { color: var(--muted); font-size: 14px; margin-top: 6px; text-align: center; }
.callout { background: var(--surface-alt); border-left: 5px solid var(--primary); padding: 14px 18px; border-radius: 0 var(--radius) var(--radius) 0; margin: 18px 0; }
.warning { background: #fff5f5; border-left: 5px solid var(--accent); padding: 14px 18px; border-radius: 0 var(--radius) var(--radius) 0; margin: 18px 0; }
.warning strong { color: var(--accent); }
.author-box { background: linear-gradient(135deg, var(--surface) 0%, var(--surface-alt) 100%); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; margin: 40px 0 20px; display: flex; gap: 18px; align-items: flex-start; }
.author-box img { width: 72px; height: 72px; border-radius: 50%; flex-shrink: 0; }
.author-box .who { color: var(--secondary); font-weight: 700; font-size: 17px; margin: 0 0 4px; }
.author-box .role { color: var(--muted); font-size: 14px; margin: 0 0 8px; }
.author-box .bio { font-size: 15px; margin: 0; }
footer.site { background: var(--secondary); color: #dcfce7; padding: 32px 0 20px; margin-top: 40px; font-size: 15px; }
footer.site a { color: #86efac; text-decoration: none; }
footer.site a:hover { color: #fff; text-decoration: underline; }
footer.site .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 24px; margin-bottom: 20px; }
footer.site ul { list-style: none; padding: 0; margin: 0; }
footer.site ul li { padding-left: 0; margin-bottom: 6px; }
footer.site ul li::before { display: none; }
footer.site h3 { color: #fff; margin: 0 0 10px; font-size: 15px; }
footer.site .fine { border-top: 1px solid #14532d; padding-top: 14px; color: #86efac; font-size: 13px; }
@media (max-width: 700px) {
  h1 { font-size: 27px; }
  h2 { font-size: 21px; padding: 8px 12px; }
  h3 { font-size: 17px; }
  body { font-size: 16px; }
  .hero { padding: 36px 0 24px; }
  .toc ol { columns: 1; }
  nav.primary ul { gap: 10px; font-size: 14px; }
  .author-box { flex-direction: column; text-align: left; }
}
@media (min-width: 981px) {
  .wrap { padding: 0 24px; }
}

/* a11y additions */
.skip-link{position:absolute;left:-9999px;top:0;background:var(--primary);color:#fff;padding:10px 16px;border-radius:4px;z-index:1000;text-decoration:none;font-weight:700}
.skip-link:focus{left:12px;top:12px}
a:focus-visible,button:focus-visible,summary:focus-visible{outline:3px solid var(--accent);outline-offset:2px}
@media (prefers-reduced-motion: reduce){*,*::before,*::after{transition-duration:.01ms !important;animation-duration:.01ms !important}}
