html {
  scroll-behavior: smooth;
}
body {
  min-height: calc(100vh - 16px);
  background-image: linear-gradient(to bottom,var(--main),var(--main) calc(100% - 100px),var(--green),var(--blue),var(--purple));
}
main {
  width: calc(100% - 318px);
  margin-left: 318px;
  min-height: calc(100vh - 16px);
}

/* ~ NAVIGATION ~ */

nav {
  position: fixed;
  top: 8px;
  left: 8px;
  width: 300px;
  height: calc(100vh - 18px);
  background-color: var(--accent);
  border: 1px solid var(--double-accent);
  border-radius: 5px;
  box-shadow: 0 0 2px var(--counter);
  overflow-y: auto;
  padding: 5px;
  box-sizing: border-box;
  font-size: 0.9em !important;
}
ol {
  counter-reset: item;
  margin: 0;
  padding-left: 20px;
  line-height: 1.3em;
}
nav > ol {
  padding-left: 0;
}
ol li {
  display: block;
  margin-bottom: 5px;
}
ol ol {
  margin-top: 5px;
}
li > a {
  padding: 1px 3px;
  border-radius: 3px;
  position: relative;
  left: -3px;
}
li > a:hover {
  cursor: pointer;
  background-color: var(--triple-accent);
  transition: 0.15s;
}
ol li:before {
  content: counters(item, ".") ". ";
  counter-increment: item;
}

/* ~ MESSAGE ~ */

.comp-error {
  color: var(--red);
  font-weight: bold;
  font-style: italic;
}
.comp-error::after {
  content: "Compilation Error";
}

/* ~ TOP LOGO ~ */

.top-bar {
  background-image: linear-gradient(to right,var(--main),var(--accent));
  border: 1px solid var(--double-accent);
  border-radius: 5px;
  display: flex;
  align-items: center;
}
.top-bar svg, .top-bar img {
  height: 44px;
  width: 44px;
  padding: 3px;
}
.top-bar span {
  margin-left: 10px;
  font-size: 2em;
  font-weight: bold;
}

/* ~ CODE AND TABLE ~ */

code {
  background-color: var(--accent);
  border: 1px solid var(--double-accent);
  padding: 3px 6px;
  border-radius: 5px;
}
p code {
  padding-top: 0px;
  padding-bottom: 0px;
}
code:not(.break):not(.big) {
  white-space: nowrap;
}
code.big {
  font-size: 1.2em;
  width: 100%;
  display: block;
  box-sizing: border-box;
  position: relative;
}
table {
  border-collapse: collapse;
  border: 1.5px solid var(--double-accent);
  border-radius: 5px;
  width: 100%;
}
th {
  background-color: var(--accent);
  text-align: left;
}
td, th {
  padding-left: 10px;
  padding-right: 10px;
}
td:has(code) {
  padding-top: 6px;
  padding-bottom: 6px;
  width: auto;
}
td:has(code):first-child {
  padding-left: 2px;
}
td.wide {
  width: 100%;
}
td[rowspan="2"] {
  border-left: 1.5px solid var(--double-accent);
}

/* ~ TEXT ~ */

h1, h2 {
  margin: 8px 0;
}
h1 {
  font-size: 2em !important;
  text-decoration: underline;
}
h1:first-child {
  margin-top: 0;
}
h2 {
  font-size: 1.5em !important;
}
p {
  text-align: justify;
  line-height: 1.5em;
}
span.citation {
  color: var(--counter-accent);
  font-size: 0.7em;
}
span.citation + code {
  margin-top: 16px;
}

/* ~ COPY TEXT ~ */

.copy {
  position: absolute;
  top: 2px;
  right: 2px;
  border: 1px solid var(--triple-accent);
  height: 25px;
  border-radius: 3px;
  background-color: var(--double-accent);
}
.copy:not(.success) > span {
  display: none;
}
.copy > span {
  line-height: 25px;
  font-size: 0.8em;
  position: relative;
  top: -5px;
  padding-left: 10px;
}
.copy > span::after {
  content: "Code Copied!";
}
.copy > button {
  border: none;
  background-color: var(--double-accent);
  padding: 2px;
  height: 25px;
  width: 25px;
  transition: 0.15s;
}
.copy > button:hover {
  background-color: var(--triple-accent);
  border-radius: 2px;
}
.copy > button > svg {
  fill: var(--counter);
}