:root {
  --ink: #17231d;
  --muted: #607068;
  --green: #19745a;
  --green-dark: #123f33;
  --gold: #b8892f;
  --cream: #f7f5ee;
  --surface: #fffefa;
  --soft: #eaf2ed;
  --line: rgba(23, 35, 29, .13);
  --shadow: 0 24px 70px rgba(24, 58, 46, .10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--cream); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 16px; line-height: 1.68; }
a { color: var(--green); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--green-dark); }

.hero { color: #f8fbf9; background: radial-gradient(circle at 85% 15%, rgba(202, 166, 76, .26), transparent 30%), radial-gradient(circle at 15% 80%, rgba(68, 151, 119, .25), transparent 38%), var(--green-dark); }
.topbar { display: flex; align-items: center; justify-content: space-between; width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 22px 0; border-bottom: 1px solid rgba(255,255,255,.14); }
.brand { color: white; font-weight: 780; text-decoration: none; letter-spacing: -.02em; }
.brand span { display: inline-grid; place-items: center; width: 32px; height: 32px; margin-right: 8px; border-radius: 10px; color: #fff0b8; background: rgba(255,255,255,.11); font-family: Georgia, serif; font-size: 24px; }
.nav-links { display: flex; gap: 24px; }
.nav-links a { color: rgba(255,255,255,.78); font-size: 14px; font-weight: 650; text-decoration: none; }
.nav-links a:hover { color: white; }
.hero-content { width: min(960px, calc(100% - 40px)); margin: 0 auto; padding: 92px 0 76px; text-align: center; }
.eyebrow, .section-label { margin: 0 0 12px; color: #dfbe69; font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
h1 { max-width: 820px; margin: 0 auto; font-size: clamp(42px, 7vw, 76px); line-height: 1.03; letter-spacing: -.055em; }
.lede { max-width: 760px; margin: 25px auto 0; color: rgba(255,255,255,.75); font-size: clamp(18px, 2.2vw, 22px); line-height: 1.55; }
.actions { display: flex; justify-content: center; gap: 12px; margin-top: 32px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 20px; border-radius: 13px; font-size: 14px; font-weight: 780; text-decoration: none; }
.button.primary { color: var(--green-dark); background: #f4cf72; }
.button.secondary { color: white; border: 1px solid rgba(255,255,255,.24); background: rgba(255,255,255,.08); }
.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); max-width: 800px; margin: 62px auto 0; border: 1px solid rgba(255,255,255,.13); border-radius: 18px; overflow: hidden; background: rgba(255,255,255,.05); backdrop-filter: blur(8px); }
.summary-grid div { padding: 20px 12px; border-right: 1px solid rgba(255,255,255,.12); }
.summary-grid div:last-child { border-right: 0; }
.summary-grid strong, .summary-grid span { display: block; }
.summary-grid strong { color: #f4cf72; font-size: 27px; }
.summary-grid span { color: rgba(255,255,255,.66); font-size: 12px; }

main { position: relative; display: grid; grid-template-columns: 210px minmax(0, 790px); gap: 54px; width: min(1100px, calc(100% - 40px)); margin: 0 auto; padding: 74px 0 90px; }
.toc { position: sticky; top: 24px; align-self: start; display: grid; gap: 6px; padding: 18px 0; }
.toc p { margin: 0 0 9px; color: var(--ink); font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.toc a { padding: 5px 10px; border-left: 2px solid transparent; color: var(--muted); font-size: 13px; font-weight: 650; text-decoration: none; }
.toc a:hover { border-color: var(--green); color: var(--green); }
article { min-width: 0; }
section { padding: 14px 0 64px; scroll-margin-top: 20px; }
section + section { border-top: 1px solid var(--line); padding-top: 64px; }
.section-label { color: var(--green); }
h2 { max-width: 700px; margin: 0 0 20px; font-size: clamp(30px, 4vw, 45px); line-height: 1.12; letter-spacing: -.04em; }
h3 { margin: 34px 0 8px; font-size: 21px; letter-spacing: -.02em; }
p { margin: 0 0 15px; }
.callout { margin: 28px 0; padding: 20px 22px; border-left: 4px solid var(--green); border-radius: 0 14px 14px 0; background: var(--soft); }
.callout strong { font-size: 15px; }
.callout p { margin: 6px 0 0; color: var(--muted); }
.callout.warning { border-color: var(--gold); background: #faf2df; }
.formula { margin: 25px 0; padding: 22px; overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 8px 28px rgba(27, 57, 46, .05); text-align: center; }
.formula p { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.formula.prominent { border-color: rgba(25,116,90,.28); background: linear-gradient(135deg, var(--surface), var(--soft)); }
.steps { display: grid; gap: 12px; margin: 26px 0; padding: 0; list-style: none; }
.steps li { display: grid; grid-template-columns: 38px 1fr; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.55); }
.steps li > span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; color: white; background: var(--green); font-size: 13px; font-weight: 800; }
.steps p { margin: 3px 0 0; color: var(--muted); font-size: 14px; }
.event-grid, .difference-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 26px; }
.event-grid div, .difference-grid div { padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.event-grid span, .difference-grid strong { color: var(--green); font-size: 14px; font-weight: 800; }
.event-grid p, .difference-grid p { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.table-wrap { margin: 26px 0; overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--green-dark); background: var(--soft); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
.rule-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 28px 0; }
.rule-grid div { display: flex; flex-direction: column; padding: 20px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.rule-grid span { margin-bottom: 10px; color: var(--green); font-size: 15px; font-weight: 800; }
.rule-grid strong { font-size: 13px; }
.rule-grid p { margin: 12px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.references { display: grid; gap: 8px; padding-left: 20px; }
.closing { margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
footer { display: flex; justify-content: space-between; gap: 20px; padding: 26px max(20px, calc((100% - 1100px)/2)); color: rgba(255,255,255,.65); background: var(--green-dark); font-size: 13px; }
footer a { color: #f4cf72; }

@media (max-width: 860px) {
  .nav-links a:not(:last-child), .toc { display: none; }
  main { display: block; width: min(760px, calc(100% - 32px)); }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .summary-grid div:nth-child(2) { border-right: 0; }
  .summary-grid div:nth-child(-n+2) { border-bottom: 1px solid rgba(255,255,255,.12); }
}

@media (max-width: 600px) {
  body { font-size: 15px; }
  .topbar, .hero-content { width: calc(100% - 28px); }
  .hero-content { padding: 64px 0 54px; }
  .actions { flex-direction: column; }
  .event-grid, .difference-grid, .rule-grid { grid-template-columns: 1fr; }
  .formula { padding: 15px 10px; font-size: 12px; }
  th, td { padding: 11px 12px; }
  footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
