*,
*::before,
*::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

html {
	color-scheme: light dark;
	font-size: large;
}

body {
	font-family: Arial, sans-serif;
	color: var(--text-color);
	background-color: var(--bg-color);
	line-height: 1.5;
}

a {
	color: var(--link-color);
}

button {
	font-family: inherit;
	font-size: inherit;
	color: inherit;
	cursor: pointer;
}

img {
	max-width: 100%;
}

code {
	background-color: var(--code-bg-color);
	padding: 0.1rem 0.3rem;
	border-radius: 0.2rem;
}

ol,
ul {
	list-style-position: inside;
}

:root {
	--text-color: #111;
	--bg-color: #fff;
	--link-color: #19589c;
	--code-bg-color: #f5f5f5;
	--blockquote-border-color: #ccc;
}

@media screen and (prefers-color-scheme: dark) {
	:root {
		--text-color: #fff;
		--bg-color: #252525;
		--link-color: #00ffff;
		--code-bg-color: #333;
		--blockquote-border-color: #555;
	}
}

/* index styling */
main.index {
	max-width: min(1200px, 95%);
	margin: 2rem auto;
}

main.index section {
	margin-top: 2rem;
}

main.index section ul {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(300px, 95%), 1fr));
	gap: 1rem;
	list-style: none;
}

main.index section ul li {
	width: 100%;
}

main.index section ul a {
	color: var(--text-color);
	display: flex;
	justify-content: center;
	align-items: center;
	height: 5rem;
	border-radius: 0.5rem;
	border: solid 2px var(--text-color);
	transition: all 0.2s ease-in-out;
}

main.index section ul a:where(:hover, :focus-visible) {
	color: var(--link-color);
	border-color: var(--link-color);
}

main.index section ul a:focus-visible {
	outline: solid 2px var(--link-color);
	outline-offset: 2px;
}

/* page controls (back buttons) */
a.back-home {
	position: fixed;
	top: 0.5rem;
	left: 0.5rem;
	background-color: var(--bg-color);
	z-index: 1;
}

a.back-home::before {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 2.5rem;
	background-color: var(--bg-color);
	z-index: -1;
}

@media screen and (max-width: 1200px) {
	a.back-home::before {
		content: '';
	}
}

button.back-to-top {
	position: fixed;
	right: calc(50% - min(800px, 95%) / 2);
	bottom: -100%;
	transition: bottom 0.4s ease;
	font-size: 1.8rem;
	background-color: var(--bg-color);
	font-weight: bold;
	width: 2.5rem;
	aspect-ratio: 1;
	border: solid 2px var(--link-color);
	border-radius: 8px;
}


body button.back-to-top:focus-visible,
body.show-scroll button.back-to-top {
	bottom: 1rem;
}

button.back-to-top svg {
	position: absolute;
	top: 45%;
	left: 50%;
	transform: translate(-50%, -50%);
	transition: all 0.2s ease-in-out;
	fill: var(--text-color);
	width: 50%;
	stroke-width: 50px;
}

button.back-to-top svg path {
	stroke: currentColor;
}

button.back-to-top:hover svg,
button.back-to-top:focus-visible svg {
	color: var(--link-color);
	animation: bounce 0.4s ease-in-out infinite alternate;
}

button.back-to-top:focus-visible {
	outline-offset: 2px;
	outline: solid 2px var(--text-color);
}

@keyframes bounce {
	to {
		top: 40%;
	}
}

/* article styles */
article {
	max-width: min(800px, 95%);
	margin: 2rem auto 5rem auto;
}

article *:not(:where(li, h1, h2, h3, h4, h5, h6, img, a code, span :last-child)) {
	margin-bottom: 1rem;
}

article blockquote {
	margin: 1rem 0;
	padding: 0.5rem 1rem;
	border-left: 5px solid var(--blockquote-border-color);
	font-style: italic;
}

article blockquote a {
	font-style: normal;
}

article ul li + li,
article ol li + li {
	margin-top: 0.5rem;
}

article header figure img {
	width: 100%;
	max-height: 400px;
	object-fit: cover;
}

article header figure figcaption {
	font-size: 0.9rem;
}

article header h1 {
	margin-top: 1rem;
	font-size: 1.7rem;
}

article figure figcaption {
	text-align: center;
}

/* code syntax highlighting */
/* prettier-ignore */
@media screen {
	code[class*=language-],pre[class*=language-]{color:#f8f8f2;background:0 0;text-shadow:0 1px rgba(0,0,0,.3);font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto;border-radius:.3em}:not(pre)>code[class*=language-],pre[class*=language-]{background:#272822}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#8292a2}.token.punctuation{color:#f8f8f2}.token.namespace{opacity:.7}.token.constant,.token.deleted,.token.property,.token.symbol,.token.tag{color:#f92672}.token.boolean,.token.number{color:#ae81ff}.token.attr-name,.token.builtin,.token.char,.token.inserted,.token.selector,.token.string{color:#a6e22e}.language-css .token.string,.style .token.string,.token.entity,.token.operator,.token.url,.token.variable{color:#f8f8f2}.token.atrule,.token.attr-value,.token.class-name,.token.function{color:#e6db74}.token.keyword{color:#66d9ef}.token.important,.token.regex{color:#fd971f}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}
}
