:root {
  --primary: #4d7c0f;
  --secondary: #365314;
  --accent: #f59e0b;
  --bg: #ffffff;
  --surface: #f7fee7;
  --surface-alt: #ecfccb;
  --text: #365314;
  --muted: #6b7280;
  --border: #d9f99d;
  --row-alt: #f7fee7;
  --radius: 12px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--secondary); }
img, svg { max-width: 100%; height: auto; }
header.site {
  position: sticky;
  top: 0;
  z-index: 40;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  border-bottom: 3px solid var(--accent);
  box-shadow: 0 2px 12px rgba(54, 83, 20, 0.15);
}
.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.01em;
}
.brand img { width: 40px; height: 40px; }
nav.primary ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 0;
  padding: 0;
}
nav.primary a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  padding: 6px 4px;
  border-bottom: 2px solid transparent;
}
nav.primary a:hover { border-bottom-color: var(--accent); color: #fff; }
main { max-width: 900px; margin: 0 auto; padding: 28px 20px 60px; }
.hero {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  padding: 60px 24px 52px;
  border-radius: var(--radius);
  margin-bottom: 36px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 30%, rgba(245, 158, 11, 0.16), transparent 55%),
              radial-gradient(circle at 80% 70%, rgba(217, 249, 157, 0.18), transparent 55%);
  pointer-events: none;
}
.hero > * { position: relative; }
.hero h1 {
  font-size: 2.2rem;
  line-height: 1.15;
  margin: 0 0 14px;
  letter-spacing: -0.015em;
}
.hero p { font-size: 1.06rem; max-width: 680px; margin: 0 auto 8px; opacity: 0.96; }
.byline {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 14px 0 24px;
  padding: 10px 14px;
  background: var(--surface);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
}
.byline strong { color: var(--secondary); }
.cta-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 22px;
}
.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-primary {
  background: var(--accent);
  color: var(--secondary);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(245, 158, 11, 0.45); color: var(--secondary); }
.btn-ghost {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.22); color: #fff; }
h2 {
  font-size: 1.55rem;
  line-height: 1.25;
  margin: 44px 0 14px;
  padding: 10px 16px;
  background: var(--surface);
  border-left: 5px solid var(--primary);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--secondary);
}
h3 {
  font-size: 1.18rem;
  margin: 26px 0 10px;
  color: var(--secondary);
}
p { margin: 0 0 14px; }
nav.toc {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  padding: 20px 24px;
  border-radius: var(--radius);
  margin: 20px 0 34px;
}
nav.toc h2 {
  font-size: 1.1rem;
  margin: 0 0 12px;
  padding: 0;
  background: transparent;
  border-left: 0;
  color: var(--secondary);
}
nav.toc ol {
  columns: 2;
  column-gap: 28px;
  margin: 0;
  padding-left: 22px;
  font-size: 0.96rem;
}
nav.toc a { color: var(--secondary); text-decoration: none; }
nav.toc a:hover { color: var(--primary); text-decoration: underline; }
ul, ol { padding-left: 26px; margin: 12px 0 18px; }
ul { list-style: none; padding-left: 0; }
ul li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 8px;
}
ul li::before {
  content: "\27A4";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent);
  font-weight: 700;
}
ol {
  list-style: none;
  counter-reset: item;
  padding-left: 0;
}
ol li {
  position: relative;
  padding-left: 44px;
  margin-bottom: 12px;
  counter-increment: item;
  min-height: 32px;
}
ol li::before {
  content: counter(item);
  position: absolute;
  left: 0;
  top: 0;
  width: 30px;
  height: 30px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.92rem;
}
.table-wrap {
  overflow-x: auto;
  margin: 18px 0 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
table { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
thead th {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  padding: 12px 14px;
  text-align: left;
  font-weight: 600;
}
tbody td { padding: 10px 14px; border-top: 1px solid var(--border); }
tbody tr:nth-child(even) td { background: var(--row-alt); }
details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 12px 0;
  box-shadow: 0 1px 4px rgba(54, 83, 20, 0.05);
}
details[open] { background: var(--surface-alt); box-shadow: 0 2px 8px rgba(54, 83, 20, 0.08); }
details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--secondary);
  list-style: none;
  position: relative;
  padding-right: 30px;
}
details summary::-webkit-details-marker { display: none; }
details summary::after {
  content: "\25BC";
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  transition: transform 0.2s ease;
  font-size: 0.85rem;
}
details[open] summary::after { transform: translateY(-50%) rotate(180deg); }
details p { margin: 10px 0 0; }
.author-box {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  padding: 22px;
  margin: 40px 0 20px;
  background: linear-gradient(135deg, var(--surface), var(--surface-alt));
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
}
.author-box img { border-radius: 50%; flex-shrink: 0; border: 2px solid var(--border); }
.author-name { font-weight: 700; margin: 0 0 2px; color: var(--secondary); font-size: 1.05rem; }
.author-role { color: var(--muted); font-size: 0.9rem; margin: 0 0 8px; }
.author-bio { margin: 0; font-size: 0.95rem; }
figure { margin: 24px 0; text-align: center; }
figure svg { max-width: 100%; }
figcaption { font-size: 0.87rem; color: var(--muted); margin-top: 8px; }
.callout {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  padding: 16px 20px;
  border-radius: var(--radius);
  margin: 20px 0;
}
.callout strong { color: var(--secondary); }
footer.site {
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  color: #f7fee7;
  padding: 40px 20px 24px;
  margin-top: 60px;
}
footer.site .footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
footer.site h3 { color: var(--accent); margin: 0 0 10px; font-size: 1rem; }
footer.site ul li::before { color: var(--accent); }
footer.site ul li { color: #ecfccb; }
footer.site a { color: #ecfccb; text-decoration: none; }
footer.site a:hover { color: var(--accent); }
.footer-bottom { max-width: 1120px; margin: 26px auto 0; border-top: 1px solid rgba(217, 249, 157, 0.2); padding-top: 16px; font-size: 0.87rem; text-align: center; opacity: 0.85; }
@media (max-width: 980px) {
  main { padding: 20px 16px 40px; }
  nav.toc ol { columns: 1; }
  .hero { padding: 48px 20px 44px; }
  .hero h1 { font-size: 1.85rem; }
}
@media (max-width: 700px) {
  body { font-size: 16px; }
  .header-inner { padding: 12px 14px; }
  nav.primary ul { gap: 4px 12px; font-size: 0.94rem; }
  .brand { font-size: 17px; }
  .hero { padding: 40px 16px 36px; }
  .hero h1 { font-size: 1.6rem; }
  h2 { font-size: 1.32rem; }
  .author-box { flex-direction: column; }
}

/* 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}}
