:root {
  color-scheme: light;
  --background: #fff;
  --surface: #f8f9fc;
  --text: #1c2230;
  --muted: #515b6d;
  --link: #164dae;
  --border: #d7dce6;
  font: 100%/1.6 system-ui, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--text); background: var(--background); }
a { color: var(--link); text-underline-offset: .2em; }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--link); outline-offset: 4px; }
code { font-family: ui-monospace, monospace; font-size: .9em; }

.shell { max-width: 76rem; margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2.5rem); }
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.site-header nav { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; align-items: baseline; padding-block: 1rem; }
.site-header a { color: var(--text); }
.site-header .brand { font-weight: 700; text-decoration: none; }
.site-header .brand:hover { text-decoration: underline; }

.skip-link {
  position: absolute;
  top: .5rem;
  left: .5rem;
  padding: .25rem .75rem;
  background: var(--background);
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

.layout { display: flex; align-items: flex-start; gap: 2.5rem; padding-block: 2rem 4rem; }
main { flex: 1; min-width: 0; max-width: 56rem; overflow-wrap: anywhere; }
.contents {
  flex: 0 0 13.5rem;
  order: 1;
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
  overflow: auto;
  padding: .25rem .5rem .25rem 1rem;
  border-left: 1px solid var(--border);
  font-size: .875rem;
  overflow-wrap: anywhere;
}
.contents summary { font-weight: 650; cursor: pointer; }
.contents ul { list-style: none; margin-block: .25rem; padding-inline-start: .75rem; }
.contents nav > ul { padding-inline-start: 0; }
.contents li { margin-block: .25rem; }
.contents a { color: var(--muted); }
.contents a:hover { color: var(--link); }

h1, h2, h3, h4 { line-height: 1.2; margin-block: 1.6em .5em; scroll-margin-top: 1rem; }
h1 { margin-top: 0; font-size: clamp(1.8rem, 4vw, 2.5rem); letter-spacing: -.025em; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.15rem; }
:target:not(main) { outline: 1px solid var(--border); outline-offset: .25rem; }
p, ul, ol { margin-block: .75rem; }
ul, ol { padding-inline-start: 1.5rem; }
img { max-width: 100%; height: auto; }
blockquote { margin-inline: 0; padding-inline-start: 1rem; border-left: 3px solid var(--border); color: var(--muted); }
pre, :not(pre) > code { background: var(--surface); }
pre {
  padding: .85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: auto;
  line-height: 1.5;
  tab-size: 4;
}
:not(pre) > code { padding: .1em .25em; border-radius: 3px; }
table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-size: .9375rem; }
th, td { padding: .45rem .75rem; text-align: start; vertical-align: top; border-bottom: 1px solid var(--border); }
th { background: var(--surface); }

@media (max-width: 48rem) {
  .layout { display: block; padding-top: 1.25rem; }
  .contents {
    position: static;
    max-height: 10rem;
    margin-bottom: 1rem;
    padding: .5rem .75rem;
    background: var(--surface);
    border: 1px solid var(--border);
  }
}
