:root {
  color-scheme: light;
  --page: #f7f9fa;
  --surface: #fff;
  --ink: #17212b;
  --muted: #596775;
  --line: #dce4e8;
  --teal: #0f4c5c;
  --teal-soft: #eaf4f5;
  --gold: #d6a728;
}

html.dark {
  color-scheme: dark;
  --page: #10151b;
  --surface: #171e26;
  --ink: #f2f5f7;
  --muted: #aeb9c3;
  --line: #303b46;
  --teal: #68c1d1;
  --teal-soft: #1d3038;
  --gold: #f2cb67;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 6rem; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.7;
}
a { color: var(--teal); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(12px);
}
.header-inner, .footer-inner {
  width: min(100% - 2rem, 1120px);
  margin: 0 auto;
}
.header-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  position: relative;
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -.04em;
  text-decoration: none;
}
.brand::after {
  position: absolute;
  right: 0;
  bottom: -5px;
  left: 0;
  height: 2px;
  border-radius: 99px;
  background: linear-gradient(90deg, #d79f17, #ffe283, #d79f17);
  box-shadow: 0 0 8px #f2c34f99, 0 0 15px #f2c34f55;
  content: "";
}
.header-links { display: flex; align-items: center; gap: 1.35rem; }
.header-links a { color: var(--muted); font-size: .92rem; font-weight: 600; text-decoration: none; }
.theme-toggle {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .5rem .8rem;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: .84rem;
}
.page-wrap { width: min(100% - 2rem, 1000px); margin: 0 auto; }
.hero { padding: clamp(3rem, 8vw, 6rem) 0 2rem; }
.eyebrow {
  color: var(--teal);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}
h1, h2, h3 { line-height: 1.2; letter-spacing: -.035em; }
h1 { max-width: 850px; margin: .7rem 0 1rem; font-size: clamp(2.4rem, 7vw, 4.5rem); }
.dek { max-width: 760px; color: var(--muted); font-size: clamp(1.08rem, 2vw, 1.25rem); }
.article-meta { display: flex; flex-wrap: wrap; gap: .5rem 1rem; margin-top: 1.5rem; color: var(--muted); font-size: .9rem; }
.article-meta span + span::before { margin-right: 1rem; color: var(--line); content: "•"; }
.article-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  align-items: start;
  gap: 2rem;
  margin: 1rem auto 5rem;
}
.article-body, .toc, .resource-card {
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  background: var(--surface);
  box-shadow: 0 12px 40px #1027330b;
}
.article-body { min-width: 0; padding: clamp(1.25rem, 4vw, 3.25rem); }
.article-body p, .article-body li { color: var(--ink); font-size: 1.02rem; }
.article-body p { margin: 0 0 1.25rem; }
.article-body h2 { margin: 3rem 0 1rem; font-size: clamp(1.6rem, 4vw, 2.15rem); }
.article-body h3 { margin: 2rem 0 .7rem; font-size: 1.25rem; }
.article-body ul, .article-body ol { padding-left: 1.35rem; margin: .5rem 0 1.5rem; }
.article-body li { padding-left: .25rem; margin: .5rem 0; }
.article-body strong { color: var(--ink); }
.callout {
  margin: 1.75rem 0;
  border-left: 4px solid var(--gold);
  border-radius: .35rem;
  padding: 1rem 1.2rem;
  background: var(--teal-soft);
}
.callout p:last-child { margin-bottom: 0; }
.toc { position: sticky; top: 96px; padding: 1.25rem; }
.toc h2 { margin: 0 0 .8rem; font-size: 1rem; }
.toc ol { margin: 0; padding-left: 1.2rem; }
.toc li { margin: .45rem 0; color: var(--muted); font-size: .86rem; line-height: 1.45; }
.toc a { color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--teal); text-decoration: underline; }
.sources { border-top: 1px solid var(--line); margin-top: 3rem; padding-top: 1.5rem; }
.sources h2 { margin-top: 0; font-size: 1.3rem; }
.sources li, .sources a { color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.site-footer { border-top: 1px solid var(--line); background: var(--surface); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; padding: 2rem 0; color: var(--muted); font-size: .9rem; }
.footer-inner a { color: var(--teal); }
.resource-list { display: grid; gap: 1rem; margin: 2rem 0 5rem; }
.resource-card { padding: clamp(1.25rem, 4vw, 2rem); }
.resource-card h2 { margin: .5rem 0; font-size: 1.6rem; }
.resource-card p { max-width: 720px; color: var(--muted); }
.resource-card .read-link { font-weight: 700; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 1rem; top: 1rem; z-index: 99; padding: .75rem; background: var(--surface); }
@media (max-width: 800px) {
  .article-shell { grid-template-columns: 1fr; }
  .toc { position: static; grid-row: 1; }
}
@media (max-width: 560px) {
  .header-inner, .footer-inner { width: min(100% - 1.25rem, 1120px); }
  .header-inner { min-height: 64px; }
  .brand { font-size: 1.05rem; }
  .header-links { gap: .75rem; }
  .header-links a { font-size: .82rem; }
  .theme-toggle { padding: .45rem .6rem; font-size: .78rem; }
  .page-wrap { width: min(100% - 1.25rem, 1000px); }
  .article-body { padding: 1.2rem; }
}
