:root {
  --yellow: rgb(255, 216, 102);
  --orange: rgb(252, 152, 103);
  --black: rgb(64, 62, 65);
  --light-black: rgb(114, 112, 114);
  --blue: rgb(120, 220, 232);
  --red: rgb(255, 97, 136);
  --purple: rgb(171, 157, 242);
  --white: rgb(252, 252, 250);
  --green: rgb(169, 220, 118);

  --text-line-height: 1.5;
  --vertical-content-margin: 1rem;
}

* {
  padding: 0;
  margin: 0;
}

@font-face {
  font-family: 'CascadiaMono';
  src: local('Cascadia Mono Regular'), url('../fonts/CascadiaMono.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
}

/* Fix a font rendering issue with Firefox on Windows machines where the system font has unusual artifacts. */
/* See: https://github.com/microsoft/cascadia-code/issues/618 */
@-moz-document url-prefix() {
  @font-face {
    font-family: 'CascadiaMono';
    src: url('../fonts/CascadiaMono.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
  }
}

@font-face {
  font-family: 'CascadiaMonoLight';
  src: local('Cascadia Mono Light Regular'), url('../fonts/CascadiaMonoLight.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
}

/* Fix a font rendering issue with Firefox on Windows machines where the system font has unusual artifacts. */
/* See: https://github.com/microsoft/cascadia-code/issues/618 */
@-moz-document url-prefix() {
  @font-face {
    font-family: 'CascadiaMonoLight';
    src: url('../fonts/CascadiaMonoLight.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
  }
}

html, body {
  line-height: var(--text-line-height);
  font-family: 'CascadiaMonoLight';
  font-size: large;
  color: var(--white);
  background-color: var(--black);
}

/* Specifically for the homepage so that the main div is vertically/horizontally centered. */
:is(html, body):has(#home-panel) {
  height: 100%;
}

@media screen and (max-width: 600px) {
  main, nav {
    width: 90vw;
  }

  nav ul {
    display: flex;
    justify-content: space-between;
  }

  #nav-label {
    display: none;
  }
}

@media all and (min-width: 600px) {
  main, nav {
    width: 70vw;
  }

  nav ul li {
    display: inline-block;
  }

  nav ul li {
    padding: 0 1rem 0 1rem;
  }
}

::selection {
  background: var(--orange);
}

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

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

h1, h2, h3, h4, h5, h6 {
  font-family: 'CascadiaMono';
}

.ta-center {
  text-align: center;
}

main, nav {
  margin: 0 auto;
  padding: 0;
}

nav {
  margin: var(--vertical-content-margin) auto var(--vertical-content-margin) auto;
  text-align: center;
}

nav ul {
  margin: 0;
  padding: 0;
  list-style: outside none none;
}

.nav-icon {
  color: var(--yellow);
}

.fs-3x {
  font-size: 3em;
}

article {
  margin-bottom: var(--vertical-content-margin);
}

article > * {
  --quarter-text-lh: calc(var(--text-line-height) * 1lh / 4);
  padding: var(--quarter-text-lh) 0 var(--quarter-text-lh) 0;
  overflow: auto;
}

article time.posted-on {
  display: inline-block;
  padding-bottom: 1rem;
}

article table {
  margin: 0 auto;
}

article table :is(td, th) {
  padding: 0.5em;
  word-break: break-word;
  max-width: 50cqw;
  line-height: var(--text-line-height);
}

article ol li:before {
  content: counter(num) ". ";
  counter-increment: num 1;
}

article ol  {
  list-style: none;
  counter-reset: num;
}

article ul {
  padding-inline-start: 2ch;
}

article ul li::marker {
  font-family: 'CascadiaMono';
}

article :is(ul, ol) li :is(ul, ol) {
  margin-left: 1em;
}

article img {
  max-width: 100%;
  max-height: 75vh;
  margin: 0 auto;
}

article p:has(> mjx-container > svg + mjx-assistive-mml[display="block"], > img) {
  text-align: center;
}

article blockquote {
  margin: 1lh 0 1lh 0;
  padding: 1rem;
  background-color: var(--light-black);
}

article h1 {
  font-size: 36px;
}

article :is(h1, h2, h3, h4, h5, h6) {
  margin: 0;
  padding: 10px 0 10px 0;
  color: var(--yellow);
}

article :is(h1, h2, h3, h4, h5, h6) a,
article :is(h1, h2, h3, h4, h5, h6) a:visited {
  color: var(--yellow);
}

article section {
  padding-bottom: 1rem;
}

article section h3 {
  padding: 0;
}

article svg {
  max-width: 100%;
  overflow: auto;
}

mjx-assistive-mml {
  display: none;
}

#home-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

#home-panel h1 {
  font-size: 4rem;
  color: var(--white);
  font-weight: 400;
}

#nav-label {
  font-weight: bold;
  opacity: 0;
  transition: opacity 1s;
  position: absolute;
  left: 0;
  right: 0;
  margin: 1rem;
}

#home-panel nav {
  margin: 0;
}

/* For inline ticks (not preformatted code blocks). */
:not(pre) > code {
  padding: 0.2em;
  background-color: var(--light-black);
}

code[class*="language-"],
pre[class*="language-"] {
  font-family: 'CascadiaMono';
	text-shadow: 0 1px rgba(0, 0, 0, 0.3);
	direction: ltr;
	text-align: left;
	white-space: pre;
	word-spacing: normal;
	word-break: normal;
	word-wrap: normal;
	tab-size: 4;
	hyphens: none;
}

pre[class*="language-"] {
	margin: 0.5em 0;
	overflow: auto;
	border-radius: 0.3em;
}

:not(pre) > code[class*="language-"],
pre[class*="language-"] {
	background: --var(--black);
}

:not(pre) > code[class*="language-"] {
	padding: 0.1em;
	border-radius: 0.3em;
}

.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
	color: var(--light-black);
}

.namespace {
	opacity: 0.7;
}

.token.class-name {
  color: var(--blue);
}

.token.property,
.token.tag,
.token.constant,
.token.symbol,
.token.deleted,
.token.operator,
.token.keyword {
	color: var(--red);
}

.token.boolean,
.token.number {
	color: var(--purple);
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.inserted {
	color: var(--yellow);
}

.token.entity,
.token.url,
.language-css .token.string,
.style .token.string,
.token.variable,
.token.punctuation {
	color: var(--white);
}

.token.atrule,
.token.attr-value,
.token.builtin,
.token.function {
	color: var(--green);
}

.token.regex,
.token.important {
	color: var(--orange);
}

.token.important,
.token.bold {
	font-weight: bold;
}

.token.italic {
	font-style: italic;
}

.token.entity {
	cursor: help;
}
