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

::selection {
  background: #999;
}

body {
  color: #eee;
  background-color: #05050a;
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px 90px;
  line-height: 1.5;
  font-size: 20px;
  font-family: 'Space Mono', Consolas, monospace;
}

a {
  color: #FFD27D;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
a:has(em.rx):hover {
  text-decoration-color: #CC2266;
}

.logo {
  margin-bottom: 24px;
}
.logo a {
  display: inline-block;
}
.logo img {
  display: block;
  max-width: 100%;
  height: auto;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

h1, h2, h3 {
  font-family: 'Space Mono', Consolas, monospace;
  font-weight: bold;
  color: #00FF88;
  text-shadow: 0 0 8px rgba(0, 255, 136, 0.4);
}

h1 {
  font-size: 2.8em;
  line-height: 1.3;
  margin-bottom: 80px;
}

em.rxx {
  color: #00FF88;
  font-style: normal;
}

em.rx {
  color: #CC2266;
  font-style: normal;
}

h2 {
  font-size: 1.3em;
  margin-top: 80px;
  margin-bottom: 24px;
}

h3 {
  font-size: 1.05em;
  font-weight: normal;
  margin-top: 40px;
  margin-bottom: 16px;
}

p {
  margin-bottom: 1em;
}

.subtitle {
  font-size: 0.55em;
  display: block;
  color: #eee;
  margin-top: 8px;
  font-weight: normal;
}

.nav {
  margin-bottom: 60px;
  font-size: 0.95em;
}
.nav-pages {
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #1a1a2a;
  font-weight: bold;
  text-transform: lowercase;
  letter-spacing: 0.02em;
}
.nav-sections {
  font-size: 0.85em;
}
.nav a {
  margin-right: 16px;
  white-space: nowrap;
}
.gh {
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
  margin-left: 0.35em;
}
.nav-sections a {
  color: #BBFFEE;
}
.nav-sections a::before {
  content: "#";
  color: #00FF88;
  margin-right: 1px;
}
.nav a.current {
  color: #eee;
}
.nav a.current:hover {
  text-decoration: none;
  cursor: default;
}

/* wide screens: the logo and the doc-page section index both float in the
   left gutter. below 1100px they collapse together into the document flow —
   logo at page top, sections as the inline header row — before the gutter
   gets too tight to hold them. */
@media (min-width: 1100px) {
  body {
    padding-top: 90px;
  }
  .logo {
    position: fixed;
    top: 24px;
    left: 24px;
    z-index: 10;
    margin-bottom: 0;
  }
  .nav-toc {
    position: fixed;
    top: 336px;
    /* right edge tracks the content column (24px gap), so the index sticks
       to the text on very wide screens instead of centering in the gutter */
    right: calc(50% + 360px + 24px);
    width: calc((100vw - 720px) / 2 - 32px);
    max-width: 220px;
    margin: 0;
    padding: 0;
    font-size: 0.8em;
    line-height: 1.9;
    text-align: right;
  }
  .nav-toc a {
    display: block;
    margin-right: 0;
    white-space: normal;
  }
}

code {
  color: #BBFFEE;
  font-family: 'Space Mono', Consolas, monospace;
}

pre {
  margin: 20px 2px 20px 2px;
  padding: 0.7em;
  line-height: 1.4;
  font-size: 0.9em;
  overflow-x: auto;
  border: 1px solid #00FF88;
}

.video-caption {
  margin: 1em 0 0.4em 0;
}

.video-frame {
  margin: 20px 2px 20px 2px;
  padding: 0.7em;
  border: 1px solid #00FF88;
  display: block;
  overflow: hidden;
}

.video-frame video {
  display: block;
  width: 100%;
  height: auto;
}

pre code {
  color: #BBFFEE;
}

/* basic syntax highlighting for code blocks */
pre code .hl-c { color: #00FF88; font-style: italic; }   /* comment */
pre code .hl-k { color: #c586c0; }                      /* keyword */
pre code .hl-f { color: #dcdcaa; }                      /* function */
pre code .hl-s { color: #ce9178; }                      /* string */
pre code .hl-n { color: #b5cea8; }                      /* number */

ul {
  list-style: none;
  padding-left: 24px;
  margin-bottom: 1em;
}

ul li {
  position: relative;
  margin-bottom: 0.4em;
}

ul li::before {
  content: '\2192';
  color: #00FF88;
  position: absolute;
  margin-left: -24px;
}

li > strong:first-child {
  color: #BBFFEE;
}

blockquote {
  border: 1px solid #00FF88;
  box-shadow: 0 0 6px rgba(0, 255, 136, 0.2);
  font-size: 0.9em;
  padding: 16px;
  margin: 24px 0;
}

blockquote p:last-child {
  margin-bottom: 0;
}

.warning-box {
  border: 1px solid #CC2266;
  padding: 16px 20px;
  margin: 24px 0;
  font-size: 0.95em;
}
.warning-box p:last-child {
  margin-bottom: 0;
}
.warning-box a {
  color: #FFD27D;
}

hr {
  border: none;
  border-top: 1px solid #222;
  margin: 60px 0;
}

.footer {
  margin-top: 80px;
  color: #666;
  font-size: 0.8em;
}
.footer a {
  color: #888;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 0.85em;
}

th, td {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid #222;
}

th {
  color: #00FF88;
  font-weight: bold;
}

td code {
  font-size: 0.95em;
}

.comment { color: #666; }
.keyword { color: #CC2266; }
.string { color: #FFEEBB; }
.fn-name { color: #00FF88; }
.number { color: #FF8844; }

@media (max-width: 720px) {
  body {
    font-size: 16px;
    padding: 40px 28px 90px;
  }
  h1 {
    font-size: 2.2em;
    margin-bottom: 40px;
  }
  h2 {
    margin-top: 40px;
  }
}

/* Plugin showcase: the same narrow column, palette and square borders. */
.plugin-intro { color: #BBFFEE; }
.plugin-gallery { display: grid; gap: 40px; margin-top: 48px; }
.plugin-card {
  min-width: 0;
  scroll-margin-top: 24px;
}
.plugin-card h2 { margin: 0 0 16px; }
.plugin-separator { margin: 0; border-top: 1px dashed #00FF88; }
.plugin-tagline { color: #eee; }
.plugin-card figure { margin: 24px 0; }
.plugin-card figcaption { font-size: 0.75em; color: #b3b3c2; }
.plugin-card > p:not(.plugin-tagline) { font-size: 0.85em; }
.plugin-card pre { border-color: #263e36; margin: 20px 0; font-size: 0.75em; }
.plugin-source, .plugin-note { font-size: 0.8em; }
a:focus-visible, video:focus-visible { outline: 2px solid #FFD27D; outline-offset: 5px; }
