html {
  --border-radius-sm: 8px;
  --surface-2: #17212b;
  --surface-3: #232e3c;
  --text-1: #f5f5f5;

  --black: #1D293A;
  --black-1: #192332;
  --yellow: #F8B601;
  --orange: #E36D19;
  --red: #DC3235;
  --green: #1DA44D;
  --blue: #28A3D9;
  --purple: #473769;
}

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

* {
  margin: 0;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    interpolate-size: allow-keywords;
  }
}

html {
  height: 100%;
  background-color: var(--black-1);
  scroll-behavior: smooth;
}

body {
  font-family: 'Montserrat', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  font-optical-sizing: auto;
  line-height: 1.25;
  -webkit-font-smoothing: antialiased;

  color: var(--text-1);
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1.5em;
  align-items: center;
}

img, picture, video, canvas, svg {
  display: block;
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  user-drag: none;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
  border: none;
  border-radius: var(--border-radius-sm);
}

input, textarea {
  background: var(--surface-3);
  color: var(--text-1);
  padding: 5px 8px 6px;
  margin: 0 -8px;
  -webkit-user-select: text;
  user-select: text;
  resize: vertical;
}

p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

p {
  text-wrap: pretty;
}

h1, h2, h3, h4, h5, h6 {
  text-wrap: balance;
}

a, a:visited {
  color: var(--blue);
}

main {
  max-width: 800px;
}

h1 {
  text-align: center;
}
h2 {
  margin: 0;
  padding-top: 1em;
}
h3 {
  margin-top: 1.5em;
}
.subtitle {
  text-align: center;
  font-size: 1.2em;
  opacity: 0.5;
}

p, li {
  margin: 1em 0;
}

i {
  font-weight: 500;
}

details {
  margin: 1em 0;
  padding: 0.5em 1em;
  border: 1px solid #ddd;
  border-radius: 1em;
}
details summary {
  cursor: pointer;
  font-weight: bold;
  font-size: 1.17em;
  padding: 0em;
}
details[open] {
  padding: 0.5em 1em 1em;
}
details[open] summary {
  margin-bottom: 0.5em;
}
details > :first-child {
  margin-top: 0;
}
details >:last-child {
  margin-bottom: 0;
}

dt {
  font-weight: bold;
  font-style: italic;
}

dl {
  margin-top: 1em;
}

dl,
dd {
  font-size: 0.9rem;
}

dd {
  margin-bottom: 1em;
  margin-left: 1em;
}

nav {
  position: fixed;
  top: 0;
  right: 0;
  padding: 1.5em 2em;
  min-width: 325px;
}

nav h3 {
  margin: 0;
}

nav ol {
  list-style: none;
  padding: 0;
  margin-top: 1em;
  display: flex;
  flex-direction: column;
  position: relative;
}

nav ol:after {
  content: '';
  display: block;
  position: absolute;
  left: -10px;
  top: calc(var(--active-index) * 1.5em);
  height: 1.5em;
  width: 3px;
  background-color: var(--blue);
  border-radius: 1px;
  transition: top 0.3s ease-in-out;
}

nav ol li {
  margin: 0;
  height: 1.5em;
  display: flex;
  align-items: center;
}

nav a, nav a:visited {
  /*color: var(--text-1);*/
  text-decoration: none;
  font-weight: 500;
}

.btn-toc {
  display: none;
}

figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 1em 0;
}
figure h3 {
  text-align: center;
  margin: 0;
}
figure img {
  max-width: 500px;
  aspect-ratio: 1.5;
}

blockquote {
  padding-left: 1em;
  position: relative;
}
blockquote::before {
  content: '';
  display: block;
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background-color: var(--blue);
  border-radius: 9999px;
}

@media (max-width: 1460px) {
  body {
    align-items: stretch;
  }
  main {
    max-width: calc(100% - 330px);
  }
}

@media (max-width: 900px) {
  h1, .subtitle {
    text-align: left;
  }
  h1, h2 {
    padding-right: 2em;
  }
  .btn-toc {
    position: fixed;
    top: 1.2em;
    right: 1.2em;
    z-index: 1;
    background-color: color-mix(in srgb, var(--black) 70%, transparent);
    backdrop-filter: blur(5px);
    display: block;
    width: 4em;
    height: 3em;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill="none" stroke="white" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16 12H3m13 6H3M16 6H3m18 6h.01M21 18h.01M21 6h.01"/></svg>');
    background-position: center;
    background-repeat: no-repeat;
  }
  main {
    max-width: 800px;
  }
  nav {
    background-color: var(--black);
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;
    z-index: 2;
    border-bottom-left-radius: 12px;
  }
  main.is-toc-open nav {
    transform: none;
  }
}