* {
	box-sizing: border-box;
	margin: 0;
}

:root {
	--font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial,
		sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
	--font-family-code: Menlo, Monaco, Consolas, 'Droid Sans Mono', monospace, 'Droid Sans Fallback';
	--font-size: 15px;
	--line-height: 1.6;
	--rule: #b7b1ae;
	--background: #d4c9c4;
	--foreground: #252429;
	--link: #0071bf;
	--pre-code: #d1d0cc;
	--inline-code: #926501;
	--code-number: #6cb2e3;
	--code-string: #a6bf5c;
	--code-literal: #bd75cb;
	--code-special: #80d3c7;
	--code-comment: #84858a;
	--pre-background: #372d39;
	--result-header: #676a76;
	--result-background: #c8c9cd;
	--result-shadow: rgba(0 0 0 / 10%);
	--toc-width: 210px;
	--toc-button-size: 40px;
	--toc-button-margin: 1rem;
	--toc-button-border: #0003;
	--border-radius: 2px;
}

@media (prefers-color-scheme: dark) {
	:root {
		--rule: #43444c;
		--background: #262831;
		--foreground: #d2d2d0;
		--pre-background: #342d39;
		--link: #53b9d0;
		--inline-code: #cbaf72;
		--result-header: #434f5b;
		--result-background: #666c75;
		--result-shadow: rgba(0 0 0 / 20%);
		--toc-button-border: #0007;
}
}

html,
body {
	font-family: var(--font-family);
	font-size: var(--font-size);
	line-height: var(--line-height);
	padding: 0;
}

html {
	-webkit-font-smoothing: antialiased;
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

body {
	background-color: var(--background);
	color: var(--foreground);
}

/* basic markdown */

strong {
	font-weight: 600;
}

img {
	max-width: 100%;
	max-height: 100%;
}

a {
	color: var(--link);
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

pre {
	color: var(--pre-code);
	background: var(--pre-background);
	padding: 1rem;
	overflow: auto;
	font-family: var(--font-family-code);
	border-radius: var(--border-radius);
	tab-size: 4;
}

code {
	font-family: var(--font-family-code);
	font-size: 1em;
	line-height: 1.357em;
	color: var(--inline-code);
}

pre code {
	color: var(--pre-code);
}

p code {
	white-space: nowrap;
	font-size: 0.95em;
}

hr {
	height: 2px;
	border: 0;
	background: var(--rule);
}

/* headers */

h1 {
	font-size: 2.35em;
	line-height: 1;
	font-weight: 700;

	border-top: 2px solid var(--rule);
	padding-top: 2rem;
	margin-bottom: 1.75rem;
}

section:first-of-type h1 {
	border: none;
}

h2 {
	font-size: 1.5em;
	line-height: 1.35;
	font-weight: 500;

	border-top: 1px solid var(--rule);
	padding-top: 1.25rem;
	margin-bottom: 1.25rem;
}

h3 {
	font-size: 1em;
	line-height: var(--line-height);
	font-weight: 600;

	border-top: 1px solid var(--rule);
	padding-top: 1.35rem;
	margin-bottom: 1rem;
}

h1 a,
h2 a,
h3 a {
	color: var(--foreground);
}

/* hide header border when scrolling to anchor */

a[name]:empty {
	position: absolute;
	margin-top: 3px;
}

/* vertical spacing */

p,
ul {
	margin-bottom: calc(var(--line-height) * 1rem);
}

pre,
.result {
	margin-bottom: calc(var(--line-height) * 1.25rem);
}

p + p,
p + ul,
ul + p,
pre + p,
pre + .result,
.result + p {
	margin-top: calc(var(--line-height) * -0.25rem);
}

/* code highlighting */

.hljs-keyword,
.hljs-selector-tag,
.hljs-title,
.hljs-section,
.hljs-doctag,
.hljs-name,
.hljs-strong {
	font-weight: bold;
}

.hljs-comment {
	color: var(--code-comment);
}

.hljs-title,
.hljs-section,
.hljs-type,
.hljs-addition,
.hljs-tag,
.hljs-quote,
.hljs-name,
.hljs-selector-id,
.hljs-selector-class,
.hljs-built_in {
	color: var(--code-special);
}

.hljs-literal {
	color: var(--code-literal);
}

.hljs-number {
	color: var(--code-number);
}

.hljs-string {
	color: var(--code-string);
}

.hljs-emphasis {
	font-style: italic;
}

/* main */

#homepage {
	display: flex;
}

main {
	max-width: 700px;
	box-sizing: content-box;
	padding: 0 2rem;
}

/* toc */

#toc-container {
	width: var(--toc-width);
	position: relative;
}

#toc {
	position: fixed;
	overflow: auto;
	width: var(--toc-width);
	height: 100%;
	padding: 0 1rem;
	top: 0;
	background: var(--background);
	border-right: 1px solid var(--rule);
	z-index: 1002;
	font-size: 12px;
}

#toc h1,
#toc h2,
#toc h3 {
	border: none;
	padding-top: 0;
	margin-bottom: 1rem;
}

#toc h1 {
	font-size: 14px;
	font-weight: 600;
	/* spacing lives in h1 so it has 
	 * padding when scrolled into view */
	margin-top: 0;
	padding-top: 1rem;
}

#toc h2 {
	font-size: 14px;
	font-weight: 600;
}

#toc h3 {
	font-size: 12px;
	font-weight: 400;
	font-style: italic;
}

#toc ol,
#toc ul {
	margin-bottom: 1rem;
}

#toc ul {
	padding-left: 1rem;
}

#toc ul li {
	text-indent: -5px;
}

#toc ol {
	padding-left: 1rem;
}

#toc a {
	color: var(--foreground);
}

/* active section highlight */
#toc h2.active a,
#toc li.active,
#toc li.active a {
	color: var(--link);
}

/* toc button */

#toc-button {
	position: fixed;
	visibility: hidden;
	outline: none;
	cursor: pointer;
	appearance: none;
	z-index: 1;
	width: var(--toc-button-size);
	height: var(--toc-button-size);
	top: var(--toc-button-margin);
	right: var(--toc-button-margin);
	border-radius: var(--border-radius);
	background: var(--background);
	border: 1px solid var(--toc-button-border);
	border-bottom-width: 2px;
	font-size: 0;
	display: flex;
	padding: 10px;
	box-sizing: border-box;
	flex-wrap: wrap;
	align-items: center;
}

#toc-button:before,
#toc-button:after {
	content: ' ';
	display: block;
}

#toc-button:before,
#toc-button:after,
#toc-button div {
	width: 100%;
	height: 3px;
	border-radius: 3px;
	background: var(--foreground);
}

/* examples */

#section-examples {
	margin: 2rem 0 2.5rem;
}

#section-examples li:not(:last-child) {
	margin-bottom: 0.25rem;
}

/* guide */

#section-guide code span.changed {
	background-color: magenta;
	transition: none;
}

#section-guide code span {
	background-color: transparent;
	transition: background-color 0.5s linear;
}

/* guide demos */

.result {
	display: flex;
	align-items: flex-start;
	justify-content: flex-end;
	padding: 0 16px 20px 0;
	border-top: 26px solid var(--result-header);
	border-radius: 5px;
	background: var(--result-background);
	min-height: 150px;
	position: relative;
	box-shadow: 0 10px 30px var(--result-shadow);
}

.result::before {
	content: 'Result';
	color: var(--pre-code);
	position: absolute;
	left: 8px;
	font-size: 11px;
	font-weight: 600;
	top: -26px;
	height: 26px;
	display: flex;
	align-items: center;
}

/* api */

main .api-index {
	columns: 2;
	column-rule: 1px solid var(--rule);
	column-gap: 60px;
	margin-bottom: 2rem;
}

main .api-index .class {
	width: 100%;
	break-inside: avoid;
}

main .api-index a {
	color: var(--foreground);
}

main .api-index ul {
	padding-left: 1.5rem;
	margin: 0;
}

/* member declarations vary weight */
.api-index h2,
#section-api h2 {
	font-weight: normal;
}

.api-index h2 {
	border: none;
	padding: 0;
}

#section-api li p {
	margin-bottom: 1rem;
}

#section-api li:last-child p {
	margin: 0;
}

/* small desktop */

@media (max-width: 958px) {
	main {
		margin: 0 auto;
		padding: 0 1rem;
	}

	#homepage {
		display: block;
	}

	#toc-button {
		visibility: visible;
	}

	#toc {
		border: 0;
		right: 0;
		transition: transform cubic-bezier(0.215, 0.61, 0.355, 1) 0.5s;
	}

	.toc-open #toc {
		box-shadow: 23px 0 10px 20px #0007;
	}

	body:not(.toc-open) #toc {
		transform: translateX(var(--toc-width));
	}
}
/* mobile */

@media (max-width: 500px) {
	pre {
		font-size: 13.5px;
		line-height: 1.6;
	}

	pre code {
		tab-size: 2;
	}

	.result {
		min-height: 0;
	}

	ul {
		padding-left: 1.5rem;
	}

	main .api-index {
		column-rule: none;
		column-gap: 0;
		font-size: 0.95rem;
	}

	main .api-index ul {
		padding-left: 0;
		list-style: none;
	}
}

/* hide-gui-on-scroll */

.autoPlace {
	will-change: opacity;
	transition: none;
}

.loaded .autoPlace {
	transition: opacity 0.2s;
}

/* */

pre a {
	color: var(--code-string);
	text-decoration: underline;
}