/* Docsify's dark theme, recoloured to the main site's palette. */

:root {
  --ground: #0c0d0f;
  --panel: #17191c;
  --line: #2f3338;
  --text: #e9eaec;
  --muted: #a0a4ab;
  --quiet: #7d828a;
  --accent: #3d8bff;
  --accent-soft: #8fbaff;
}

html, body { background: var(--ground); }

body {
  color: var(--text);
  font-family: "Archivo", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--line);
}

.sidebar > h1 {
  margin: 28px 0 20px;
  font-size: 1rem;
  font-weight: 300;
  letter-spacing: .3em;
  text-transform: uppercase;
}

.sidebar > h1 a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.sidebar > h1 img {
  width: 28px;
  height: 28px;
}

.sidebar ul li a { color: var(--muted); }
.sidebar ul li a:hover { color: var(--text); }
.sidebar ul li.active > a { color: var(--accent-soft); border-right-color: var(--accent); }

.sidebar-nav hr {
  margin: 12px 15px;
  border: 0;
  border-top: 1px solid var(--line);
}

/* Group heading for lists of pages, such as the extensions. */
.sidebar-nav .nav-label {
  color: var(--quiet);
  font-size: .75rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

/* The module list shows only on the API pages (api-find.js sets in-api). */
body:not(.in-api) .sidebar-nav a[href="#/python/"] + ul { display: none; }

/* Icons on the top-level pages, masked so they take the link colour. */
.sidebar-nav a[href="#/"]::before,
.sidebar-nav a[href="#/requirements"]::before,
.sidebar-nav a[href="#/performance"]::before,
.sidebar-nav a[href="#/essentials"]::before,
.sidebar-nav a[href="#/curves"]::before,
.sidebar-nav a[href="#/animation"]::before,
.sidebar-nav a[href="#/topology"]::before,
.sidebar-nav a[href="#/destruction"]::before,
.sidebar-nav a[href="#/masonry"]::before,
.sidebar-nav a[href="#/settlement"]::before,
.sidebar-nav a[href="#/stagehand"]::before,
.sidebar-nav a[href="#/formats"]::before,
.sidebar-nav a[href="#/studio-setup"]::before,
.sidebar-nav a[href="#/privacy"]::before,
.sidebar-nav a[href="#/duplicate"]::before,
.sidebar-nav a[href="#/scene-origin"]::before,
.sidebar-nav a[href="#/attributes"]::before,
.sidebar-nav a[href="#/node-editor"]::before,
.sidebar-nav a[href="#/debug-drawing"]::before,
.sidebar-nav a[href="#/lights"]::before,
.sidebar-nav a[href="#/change-stream"]::before,
.sidebar-nav a[href="#/cpp-extensions"]::before,
.sidebar-nav a[href="#/file-translators"]::before,
.sidebar-nav a[href="#/faq"]::before,
.sidebar-nav a[href="#/support"]::before,
.sidebar-nav a[href="#/python/"]::before,
.sidebar-nav a[href="#/cpp/"]::before,
.sidebar-nav a[href^="https://ko-fi.com"]::before,
.sidebar-nav a[href^="https://lila-3d.github.io"]::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 8px;
  vertical-align: -3px;
  background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}

.sidebar-nav a[href="#/"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 10.5 12 3l9 7.5M5 9v12h14V9M10 21v-6h4v6'/%3E%3C/svg%3E"); }
.sidebar-nav a[href="#/requirements"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 4h18v12H3zM8 20h8M12 16v4'/%3E%3C/svg%3E"); }
.sidebar-nav a[href="#/performance"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 18a8 8 0 1 1 16 0M12 18l4-6'/%3E%3C/svg%3E"); }
.sidebar-nav a[href="#/essentials"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13 2 4 14h7l-1 8 9-12h-7l1-8z'/%3E%3C/svg%3E"); }
.sidebar-nav a[href="#/curves"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20C6 6 18 18 20 4'/%3E%3Ccircle cx='4' cy='20' r='1.5'/%3E%3Ccircle cx='20' cy='4' r='1.5'/%3E%3C/svg%3E"); }
.sidebar-nav a[href="#/animation"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 20h18M7 20v-2M17 20v-2M12 4l5 5-5 5-5-5z'/%3E%3C/svg%3E"); }
.sidebar-nav a[href="#/topology"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 5h18v14H3zM3 12c6-4 12-4 18 0M12 5c-3 5-3 9 0 14'/%3E%3C/svg%3E"); }
.sidebar-nav a[href="#/destruction"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4h7l-2 6 3 3-2 7H4zM14 4h6v16h-7l2-7-3-3z'/%3E%3C/svg%3E"); }
.sidebar-nav a[href="#/masonry"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 5h18v14H3zM3 12h18M9 5v7M15 12v7'/%3E%3C/svg%3E"); }
.sidebar-nav a[href="#/settlement"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 21V11l5-4 5 4v10M13 21V9l4-3 4 3v12M2 21h20M7 21v-4h2v4'/%3E%3C/svg%3E"); }
.sidebar-nav a[href="#/stagehand"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3 3 7.5v9L12 21l9-4.5v-9zM3 7.5l9 4.5 9-4.5M12 12v9'/%3E%3C/svg%3E"); }
.sidebar-nav a[href="#/formats"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 3H6v18h12V7zM14 3v4h4M9 13h6M9 17h6'/%3E%3C/svg%3E"); }
.sidebar-nav a[href="#/studio-setup"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 4h18v6H3zM3 14h18v6H3zM7 7h.01M7 17h.01'/%3E%3C/svg%3E"); }
.sidebar-nav a[href="#/privacy"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3 4 6v6c0 4.5 3.4 8 8 9 4.6-1 8-4.5 8-9V6z'/%3E%3Cpath d='m9 12 2 2 4-4'/%3E%3C/svg%3E"); }
.sidebar-nav a[href="#/duplicate"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 9h12v12H9z'/%3E%3Cpath d='M5 15H3V3h12v2'/%3E%3C/svg%3E"); }
.sidebar-nav a[href="#/scene-origin"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8' cy='16' r='3'/%3E%3Cpath d='M8 9v4M8 19v2M1 16h4M11 16h2M12 12l8-8M14 4h6v6'/%3E%3C/svg%3E"); }
.sidebar-nav a[href="#/attributes"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 4H5v16h3M16 4h3v16h-3M9 9h6M9 12h6M9 15h6'/%3E%3C/svg%3E"); }
.sidebar-nav a[href="#/node-editor"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 4h6v6H2zM16 14h6v6h-6zM8 7h2a3 3 0 0 1 3 3v4a3 3 0 0 0 3 3'/%3E%3C/svg%3E"); }
.sidebar-nav a[href="#/debug-drawing"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20h4L19 9l-4-4L4 16zM14 6l4 4'/%3E%3C/svg%3E"); }
.sidebar-nav a[href="#/lights"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18h6M10 21h4M12 3a6 6 0 0 0-4 10.5c.6.6 1 1.4 1 2.5h6c0-1.1.4-1.9 1-2.5A6 6 0 0 0 12 3z'/%3E%3C/svg%3E"); }
.sidebar-nav a[href="#/change-stream"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12h4l3-8 4 16 3-8h4'/%3E%3C/svg%3E"); }
.sidebar-nav a[href="#/cpp-extensions"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 2v6M15 2v6M6 8h12v4a6 6 0 0 1-12 0zM12 18v4'/%3E%3C/svg%3E"); }
.sidebar-nav a[href="#/file-translators"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 3H6v18h12V7zM14 3v4h4M9 14h6M13 11l3 3-3 3'/%3E%3C/svg%3E"); }
.sidebar-nav a[href="#/support"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M5.6 5.6l3.6 3.6M14.8 14.8l3.6 3.6M18.4 5.6l-3.6 3.6M9.2 14.8l-3.6 3.6'/%3E%3C/svg%3E"); }
.sidebar-nav a[href="#/faq"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M9.5 9a2.5 2.5 0 1 1 3.5 2.3c-.6.3-1 .9-1 1.7M12 17h.01'/%3E%3C/svg%3E"); }
.sidebar-nav a[href="#/python/"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m8 7-5 5 5 5M16 7l5 5-5 5M14 4l-4 16'/%3E%3C/svg%3E"); }
.sidebar-nav a[href="#/cpp/"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5a2 2 0 0 0 2 2h1M16 3h1a2 2 0 0 1 2 2v5a2 2 0 0 0 2 2 2 2 0 0 0-2 2v5a2 2 0 0 1-2 2h-1'/%3E%3C/svg%3E"); }
.sidebar-nav a[href^="https://ko-fi.com"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20s-8-4.8-8-10.5A4.5 4.5 0 0 1 12 7a4.5 4.5 0 0 1 8 2.5C20 15.2 12 20 12 20z'/%3E%3C/svg%3E"); }
.sidebar-nav a[href^="https://lila-3d.github.io"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 4h6v6M20 4l-9 9M18 14v6H4V6h6'/%3E%3C/svg%3E"); }

/* One shared marker for the headings listed under the current page. */
.app-sub-sidebar li a::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 10px;
  vertical-align: 2px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  opacity: .5;
}

.app-sub-sidebar li.active > a::before { background: currentColor; opacity: 1; }

.sidebar-toggle { background: var(--panel); }
.sidebar-toggle span { background: var(--muted); }

.search { border-bottom-color: var(--line); }

.search input {
  background: var(--ground);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
}

.markdown-section { max-width: 760px; }

.markdown-section h1,
.markdown-section h2,
.markdown-section h3 {
  color: var(--text);
  font-weight: 750;
  font-stretch: 112%;
  font-variation-settings: "wdth" 112;
}

.markdown-section h2 {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.markdown-section p,
.markdown-section li { color: var(--muted); }

.markdown-section strong { color: var(--text); }

.markdown-section a { color: var(--accent-soft); }

.markdown-section code,
.markdown-section pre {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  background: var(--panel);
}

.markdown-section code { color: var(--text); }

.markdown-section pre {
  border: 1px solid var(--line);
  border-radius: 8px;
}

/* Copy button on code blocks (copy-code.js). Replaces the language label in the same corner. */
.markdown-section pre::after { display: none; }

.markdown-section .code-block { position: relative; }

.markdown-section .code-block .copy-code {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
}

.markdown-section .code-block:hover .copy-code,
.markdown-section .code-block .copy-code:focus-visible { opacity: 1; }

@media (hover: none) {
  .markdown-section .code-block .copy-code { opacity: 1; }
}

.markdown-section .code-block .copy-code::before {
  content: "";
  position: absolute;
  inset: 6px;
  background: var(--muted);
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 9h12v12H9z'/%3E%3Cpath d='M5 15H3V3h12v2'/%3E%3C/svg%3E");
}

.markdown-section .code-block .copy-code:hover::before { background: var(--text); }

.markdown-section .code-block .copy-code.copied::before {
  background: var(--accent-soft);
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12l5 5L20 6'/%3E%3C/svg%3E");
}

.markdown-section blockquote {
  border-left-color: var(--accent);
  color: var(--muted);
}

.markdown-section tr { border-top-color: var(--line); }
.markdown-section td,
.markdown-section th { border-color: var(--line); }
.markdown-section tr:nth-child(2n) { background: var(--panel); }

/* Symbol finder on the Python API pages (api-find.js). Sticky, so it stays in reach down a long page. */
.api-find {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 12px 0;
  background: var(--ground);
}

.api-find input {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
}

.api-find input:focus { border-color: var(--accent); }

.markdown-section .api-find-results {
  position: absolute;
  left: 0;
  right: 0;
  max-height: 60vh;
  overflow-y: auto;
  margin: 4px 0 0;
  padding: 4px;
  list-style: none;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.markdown-section .api-find-results li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 10px;
  margin: 0;
  padding: 6px 8px;
  border-radius: 4px;
  cursor: pointer;
}

.markdown-section .api-find-results li.active { background: var(--line); }
.api-find-results code { background: none; padding: 0; }
.api-find-page { color: var(--quiet); font-size: .8125rem; justify-self: end; }

.api-find-summary {
  grid-column: 1 / -1;
  overflow: hidden;
  color: var(--muted);
  font-size: .875rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.markdown-section .api-find-results li.api-find-none { display: block; color: var(--quiet); cursor: default; }
