:root {
  --font-content: -apple-system, BlinkMacSystemFont, "Inter", "IBM Plex Sans", Segoe UI, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "Cascadia Code", "Roboto Mono", "Source Code Pro", "DejaVu Sans Mono", "Liberation Mono", "Consolas", Menlo, Monaco, monospace;
  --font-small: 0.875em;
  --font-smaller: 0.8em;
  --wrap-wide: 1000px;
  --wrap-normal: 37em;
  --line-height: 1.5;
}

/* Monospace Typography for Canvas Nodes */
.node {
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
}

.node-name {
  font-family: var(--font-mono);
  font-size: calc(0.75rem * 1 / var(--scale));
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.node-text-content,
.node-link-content,
.node-file-content {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  line-height: 1.6;
}

.node {
  border: 1px solid var(--border);
}

.node:hover {
  border-color: var(--accent);
}

.node.is-active {
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

#canvas-edges path {
  stroke: var(--accent);
  stroke-width: 2;
  opacity: 0.6;
}

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

::selection {
  background: rgba(52, 152, 219, 0.2);
}

::-moz-selection {
  background: rgba(52, 152, 219, 0.2);
}

html,
body {
  touch-action: manipulation;
}

html {
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  font-size: 62.5%;
}

body {
  color-scheme: light dark;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background-color: var(--background);
  font-family: var(--font-content);
  margin: 0 auto 0 auto;
  line-height: var(--line-height);
  padding: 0;
  font-size: 1.6rem;
  color: var(--foreground);
}

/* Canvas area */
#home {
  overflow: hidden;
}

#container {
  touch-action: none;
  display: flex;
  flex: 1;
  flex-direction: row;
  height: 100%;
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
}

#canvas-container {
  width: 100%;
  height: 100%;
  padding: 0;
  position: relative;
  background-color: #1a1a1a;
  background-image: radial-gradient(var(--border) calc(var(--scale)*0.5px + 0.5px), transparent 0);
  background-size: calc(var(--scale) * 20px) calc(var(--scale) * 20px);
  overflow: hidden;
  background-position: calc(var(--pan-x) - 19px) calc(var(--pan-y) - 19px);
}

#canvas-edges,
#canvas-nodes {
  opacity: 0;
  transform: translate(var(--pan-x), var(--pan-y)) scale(var(--scale));
  transform-origin: left top;
}

#canvas-edges {
  z-index: 150;
  pointer-events: none;
  user-select: none;
  overflow: visible;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

#canvas-edges path {
  stroke: var(--accent);
  stroke-width: 2;
  fill: none;
}

#arrowhead {
  fill: var(--accent);
}

.will-pan {
  cursor: grab;
}

/* Canvas output pane */
#output.hidden {
  transform: translateX(120%);
}

#output {
  position: fixed;
  height: 92vh;
  top: 1rem;
  right: 1rem;
  bottom: auto;
  border-radius: 12px;
  color: var(--foreground);
  background-color: var(--background);
  border: 1px solid var(--border);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  ;
  z-index: 0;
  width: 24em;
  max-width: 40%;
  display: flex;
  flex-direction: column;
  transition: transform 200ms;
}

#output p {
  font-size: 90%;
  line-height: 1.3;
  padding-right: 0.5em;
}

#output-code {
  color-scheme: dark;
  flex-grow: 1;
  width: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

#output pre {
  color-scheme: dark;
  width: 100%;
  padding: 0.5em;
  margin: 0;
}

.code-footer,
.code-header {
  font-size: 80%;
  font-weight: 500;
  padding: 0;
  display: flex;
  align-items: center;
  color: var(--muted);
  gap: 8px;
  padding: 1rem;
}

.code-footer {
  justify-content: center;
}

.code-header .language {
  flex-grow: 1;
}

.close-output {
  font-weight: 300;
  cursor: pointer;
  user-select: none;
  -ms-user-select: none;
  -webkit-user-select: none;
  font-size: 24px;
  line-height: 0;
  display: flex;
  align-items: center;
  margin-top: -4px;
}

.close-output:hover {
  color: var(--foreground);
}

/* Pages */
.page {
  padding: 36px 36px 48px;
  max-width: 48em;
  margin: 0 auto;
}

nav {
  padding: 24px 36px;
  max-width: 48em;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

nav #logo {
  flex-grow: 1;
}

nav .link {
  color: var(--accent);
  text-decoration: none;
  padding: 0.25em 0.5em;
  border-radius: 6px;
}

nav .link:hover {
  color: var(--background);
  background-color: var(--accent);
}

.hidenav #navbar {
  display: none;
}

/* Specific nodes */
#logo {
  border-radius: 8px;
  line-height: 0;
  z-index: 100;
  padding: 4px 12px 4px 4px;
}

#logo .node-name {
  top: -1.25em;
  padding-left: 4px;
}

#nav {
  z-index: 90;
  white-space: nowrap;
  padding-right: 48px;
}

#readme {
  width: 480px;
  height: fit-content;
  padding: 36px;
  z-index: 80;
}

#spec {
  width: 480px;
  height: 480px;
  z-index: 70;
}


/* General node styling */
.node {
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  position: absolute;
  display: block;
}

.node.is-active {
  box-shadow:
    0 0 0 2px var(--accent);
}

.node.is-dragging {
  cursor: grabbing;
  box-shadow:
    0 0 0 2px var(--accent),
    0 5px 15px rgba(0, 0, 0, 0.2);
}

.node.is-dragging iframe {
  pointer-events: none;
}

.node:hover .node-name {
  opacity: 1;
  color: var(--foreground);
  border-radius: 8px 8px 0 0;
}

.node-name {
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  cursor: grab;
  opacity: 1;
  position: absolute;
  height: 2.25em;
  padding: 0.25em 0.5em;
  width: 100%;
  top: -2.25em;
  left: 0;
  color: var(--muted);
  font-size: calc(var(--font-smaller) * 1/var(--scale));
  -ms-user-select: none;
  -webkit-user-select: none;
  user-select: none;
}

.node.is-dragging .node-name {
  cursor: grabbing;
}

.node-link,
.node-text {
  background-color: var(--background);
  border-radius: 8px;
  box-shadow: 0 0 0 2px var(--border);
}

.node-file img {
  -webkit-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  user-drag: none;
}

.node-text-content {
  padding: 12px 24px;
}

/* Canvas controls */
#controls {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 6px;
  -ms-user-select: none;
  -webkit-user-select: none;
  user-select: none;
}

/* Page content */
h1 {
  line-height: 1.1;
  margin-top: 0.25em;
}

h2 {
  line-height: 1.2;
  margin-bottom: 0em;
  margin-top: 1.5em;
}

h2+p {
  margin-top: 0.5em;
}

ul+h2,
ul+h3,
p+h2,
p+h3 {
  margin-top: 1.5em;
}

h2+h3 {
  margin-top: 0.75em;
}

a {
  font-weight: 600;
  color: var(--foreground);
  text-decoration: underline;
}

small {
  color: var(--muted);
}

small a {
  font-weight: 400;
  color: var(--muted);
}

hr {
  margin: 0;
  border: 0;
  height: 1px;
  background-color: var(--border);
}

iframe {
  -webkit-appearance: none;
  border: none;
  outline: none;
  margin: 0;
  vertical-align: bottom;
  border-radius: 8px;
}

img {
  vertical-align: bottom;
}

code {
  -webkit-appearance: none;
  font-family: var(--font-mono);
  cursor: text;
}

pre {
  -webkit-appearance: none;
  font-family: var(--font-mono);
  background-color: transparent;
  border-radius: 4px;
  padding: 0;
  font-size: 85%;
  cursor: text;
}

pre:active,
pre:focus {
  outline: none;
  border: none;
}

pre code {
  color: var(--muted);
  background-color: transparent;
  border: none;
  padding: 0;
  font-size: inherit;
}

code {
  font-family: var(--font-mono);
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 0.2em;
  font-size: 85%;
}

ul {
  padding-inline-start: 2em;
}

li::marker {
  color: var(--muted);
}

table {
  margin-top: 1.5em;
  margin-bottom: 2.5em;
  border-collapse: collapse;
  border-spacing: 0;
}

tr {
  border-bottom: 1px solid var(--border);
}

td {
  padding: 0.5em 1em 0.5em 0;
  line-height: 1.3;
}

th:not(:last-child) {
  padding-right: 1em;
}

td:last-child {
  padding-right: 0;
}

th {
  text-align: left;
  font-weight: 600;
  padding: 0 1em 0.5em 0;
}

button {
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  -ms-user-select: none;
  -webkit-user-select: none;
  user-select: none;
  cursor: pointer;
  font-family: var(--font-content);
  background: var(--surface);
  outline: none;
  border: 1px solid var(--border);
  padding: 4px 8px;
  color: var(--foreground);
  border-radius: 4px;
  font-weight: 500;
}

button:hover {
  border-color: var(--accent);
}

@media (max-width: 800px) {
  body:not(.hidenav) nav {
    padding: 24px;
    gap: 0;
  }

  body:not(.hidenav) .page {
    padding: 24px 24px 48px 24px;
  }

  #controls {
    bottom: 0;
    right: 0;
    left: 0;
    padding: 1rem;
    border-top: 1px solid var(--border);
    width: 100%;
    background-color: var(--background);
    justify-content: center;
    height: 48px;
  }

  #output {
    border-radius: 0;
    border: none;
    left: 0;
    top: 0;
    z-index: 200;
    width: 100vw;
    height: calc(100% - 48px);
    transition: none;
    max-width: 100vw;
    box-shadow: none;
  }

  #output-code {
    padding: 1rem 1rem 6rem;
  }

  .code-footer {}
}

/* PrismJS 1.29.0
https://prismjs.com/download.html#themes=prism&languages=json */
/**
 * prism.js default theme for JavaScript, CSS and HTML
 * Based on dabblet (http://dabblet.com)
 * @author Lea Verou
 */

code[class*="language-"],
pre[class*="language-"] {
  text-align: left;
  white-space: pre-wrap;
  word-spacing: normal;
  word-break: normal;
  word-wrap: normal;

  -moz-tab-size: 4;
  -o-tab-size: 4;
  tab-size: 4;

  -webkit-hyphens: none;
  -moz-hyphens: none;
  -ms-hyphens: none;
  hyphens: none;
}

/* Code blocks */
pre[class*="language-"] {
  overflow: auto;
  overflow-x: hidden;
}

/* Inline code */
:not(pre)>code[class*="language-"] {
  white-space: normal;
}

.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
  color: slategray;
}

.token.punctuation {
  color: var(--muted);
}

.token.namespace {
  opacity: .7;
}

.token.property,
.token.tag,
.token.boolean,
.token.constant,
.token.symbol,
.token.deleted {
  color: #f8aa59;
}

.token.number {
  color: #ee529d;
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
  color: #fe7568;
}

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
  color: var(--muted);
}

.token.atrule,
.token.attr-value,
.token.keyword {
  color: #07a;
}

.token.function,
.token.class-name {
  color: #DD4A68;
}

.token.regex,
.token.important,
.token.variable {
  color: #e90;
}

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

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

.token.entity {
  cursor: help;
}