:root {
  color-scheme: light;
  --ink: #202a32;
  --muted: #59656d;
  --line: #d9dedf;
  --paper: #fff;
  --canvas: #f4f5f2;
  --accent: #176b67;
  --accent-strong: #10524f;
  --code: #eef1f0;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font: 16px/1.65 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a { color: var(--accent-strong); text-underline-offset: .16em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 3px solid #d28c32; outline-offset: 3px; }

.skip-link {
  position: absolute;
  top: -4rem;
  left: 1rem;
  z-index: 2;
  padding: .5rem .75rem;
  color: white;
  background: var(--accent-strong);
}
.skip-link:focus { top: 1rem; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  min-height: 4.25rem;
  padding: .75rem max(1.25rem, calc((100vw - 78rem) / 2));
  color: #f7f8f5;
  background: #233437;
}
.site-header a { color: inherit; }
.site-name { font-family: Georgia, "Times New Roman", serif; font-size: 1.35rem; font-weight: 700; text-decoration: none; }
.site-header nav { display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; font-size: .92rem; }

.page-shell {
  display: grid;
  grid-template-columns: 13rem minmax(0, 1fr);
  gap: 2.5rem;
  max-width: 78rem;
  min-height: calc(100vh - 8rem);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}
.side-nav { align-self: start; position: sticky; top: 1.5rem; display: grid; gap: .25rem; font-size: .92rem; }
.side-nav a { padding: .3rem .45rem; border-radius: .2rem; text-decoration: none; }
.side-nav a:hover { background: #e6ebe8; text-decoration: underline; }
.nav-heading { margin: 0 0 .4rem; color: var(--muted); font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }

.document { min-width: 0; padding: clamp(1.25rem, 3vw, 3rem); background: var(--paper); border: 1px solid var(--line); border-radius: .35rem; box-shadow: 0 1px 3px #202a320a; }
.document > :first-child { margin-top: 0; }
.document h1, .document h2, .document h3, .document h4 { color: #263638; line-height: 1.25; scroll-margin-top: 1rem; }
.document h1 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(2rem, 4vw, 2.8rem); }
.document h2 { margin-top: 2.2em; padding-bottom: .35em; border-bottom: 1px solid var(--line); font-size: 1.55rem; }
.document h3 { margin-top: 1.7em; font-size: 1.2rem; }
.document img, .document video { max-width: 100%; height: auto; }
.document table { display: block; width: 100%; overflow-x: auto; border-collapse: collapse; }
.document th, .document td { padding: .55rem .7rem; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.document th { background: #edf1ef; }
.document blockquote { margin: 1.25rem 0; padding: .15rem 1rem; border-left: 3px solid #8ba7a0; color: var(--muted); }
.document pre { max-width: 100%; overflow: auto; padding: 1rem; border: 1px solid var(--line); border-radius: .25rem; background: var(--code); font-size: .88rem; line-height: 1.5; }
.document code { padding: .08em .25em; border-radius: .2rem; background: var(--code); font-size: .9em; }
.document pre code { padding: 0; background: transparent; }
.document hr { margin: 2rem 0; border: 0; border-top: 1px solid var(--line); }

.site-footer { padding: 1.25rem; border-top: 1px solid var(--line); color: var(--muted); text-align: center; font-size: .88rem; }

@media (max-width: 760px) {
  .site-header { align-items: flex-start; flex-direction: column; gap: .4rem; }
  .page-shell { display: block; padding-top: 1rem; }
  .side-nav { position: static; display: flex; flex-wrap: wrap; margin-bottom: 1rem; gap: .25rem .55rem; }
  .nav-heading { flex-basis: 100%; }
  .side-nav a { padding: .25rem .1rem; }
  .document { padding: 1.2rem; }
}

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