/* Quantum dark theme for sphinx_rtd_theme: deep space + cyan/violet glow */

:root {
  --bg: #0b0d1a;
  --bg-alt: #12152b;
  --panel: #171b36;
  --text: #d7dcf5;
  --muted: #8b93bd;
  --cyan: #22e3ff;
  --violet: #9b6bff;
  --pink: #ff4fd8;
  --amber: #ffcc33;
  --border: #262b52;
}

body,
.wy-body-for-nav,
.wy-nav-content-wrap,
.wy-nav-content {
  background: var(--bg);
  color: var(--text);
}

/* Sidebar */
.wy-nav-side {
  background: linear-gradient(180deg, #0f1230 0%, #0b0d1a 100%);
  border-right: 1px solid var(--border);
}

.wy-side-nav-search,
.wy-nav-top {
  background: linear-gradient(135deg, #2a1a6e 0%, #0e5a7a 100%);
}

.wy-side-nav-search > a,
.wy-side-nav-search .wy-dropdown > a,
.wy-nav-top a {
  color: #fff;
  text-shadow: 0 0 12px rgba(34, 227, 255, 0.6);
}

.wy-side-nav-search input[type="text"] {
  background: rgba(11, 13, 26, 0.7);
  border: 1px solid var(--cyan);
  color: var(--text);
  box-shadow: 0 0 10px rgba(34, 227, 255, 0.25);
}

.wy-menu-vertical header,
.wy-menu-vertical p.caption {
  color: var(--cyan);
  letter-spacing: 0.08em;
}

.wy-menu-vertical a {
  color: var(--muted);
}

.wy-menu-vertical a:hover,
.wy-menu-vertical li.current > a:hover {
  background: var(--panel);
  color: var(--cyan);
}

.wy-menu-vertical li.current,
.wy-menu-vertical li.current > a {
  background: var(--bg-alt);
  color: var(--text);
  border-color: var(--border);
}

.wy-menu-vertical li.toctree-l1.current > a {
  border-left: 3px solid var(--cyan);
  border-top: none;
  border-bottom: none;
}

.wy-menu-vertical li.current a {
  border-right: none;
  color: var(--muted);
}

.wy-menu-vertical li.current a:hover {
  background: var(--panel);
}

/* Headings */
h1 {
  background: linear-gradient(90deg, var(--cyan), var(--violet), var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

h2,
h3,
h4,
h5,
h6,
legend {
  color: #eef0ff;
}

h2 {
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.2em;
}

/* Links */
a,
a:visited {
  color: var(--cyan);
}

a:hover {
  color: var(--pink);
}

/* Code */
.rst-content code,
.rst-content tt,
code {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--amber);
}

/* sphinx_rtd_theme's own `.literal` rule (used on every inline `` `foo` ``
   role) is more specific than the block above and would otherwise win and
   silently fall back to its default dull red -- match it here so the
   bright color actually applies. */
.rst-content code.literal,
.rst-content tt.literal {
  color: var(--amber);
  background: var(--panel);
  border: 1px solid rgba(255, 204, 51, 0.4);
  border-radius: 4px;
  font-weight: 600;
}

.rst-content div[class^="highlight"],
.rst-content pre.literal-block {
  background: #0e1128;
  border: 1px solid var(--border);
  border-left: 3px solid var(--violet);
  border-radius: 4px;
}

.highlight {
  background: #0e1128 !important;
}

/* Full Pygments token set, not just the handful actually seen so far --
   any class left unstyled here silently falls back to Pygments' light-theme
   default color (e.g. Name.Variable's near-black #19177C), which is
   unreadable on this dark background. Covering the whole set once avoids
   finding these one screenshot at a time. */

/* Keywords */
.highlight .k,
.highlight .kc,
.highlight .kd,
.highlight .kn,
.highlight .kp,
.highlight .kr,
.highlight .ow { color: #c792ff; font-weight: 600; }
.highlight .kt { color: var(--pink); }

/* Strings */
.highlight .s,
.highlight .sa,
.highlight .sb,
.highlight .sc,
.highlight .dl,
.highlight .sd,
.highlight .s1,
.highlight .s2,
.highlight .sh,
.highlight .sx,
.highlight .sr,
.highlight .ss { color: #7dffb0; }
.highlight .se { color: var(--amber); font-weight: 600; }
.highlight .si { color: var(--cyan); }

/* Comments */
.highlight .c,
.highlight .ch,
.highlight .cm,
.highlight .cpf,
.highlight .cs,
.highlight .c1 { color: #5a6296; font-style: italic; }
.highlight .cp { color: var(--amber); }

/* Names: functions, classes, namespaces, attributes, tags */
.highlight .nf,
.highlight .fm,
.highlight .nc,
.highlight .nn,
.highlight .na,
.highlight .nl { color: var(--cyan); }
.highlight .nt { color: #c792ff; font-weight: 600; }
.highlight .nd { color: var(--pink); }
.highlight .ne { color: var(--pink); font-weight: 600; }
.highlight .ni { color: var(--muted); font-weight: 600; }

/* Variables -- shell/env vars like ACCOUNT, N_VALUES, KIND live here */
.highlight .nv,
.highlight .vc,
.highlight .vg,
.highlight .vi,
.highlight .vm { color: var(--amber); }

/* Builtins */
.highlight .nb,
.highlight .bp { color: #5eead4; }

/* Constants, numbers */
.highlight .no,
.highlight .m,
.highlight .mb,
.highlight .mf,
.highlight .mh,
.highlight .mi,
.highlight .mo,
.highlight .il { color: #ffb86b; }

/* Operators and punctuation */
.highlight .o { color: var(--pink); }
.highlight .p { color: var(--text); }

/* Whitespace: invisible by design */
.highlight .w { color: transparent; }

/* Errors and diffs */
.highlight .err { border: 1px solid var(--pink); color: var(--text); }
.highlight .gd,
.highlight .gr,
.highlight .gt { color: #ff6b6b; }
.highlight .gi { color: #7dffb0; }
.highlight .gh,
.highlight .gp,
.highlight .gu { color: #c792ff; font-weight: 600; }
.highlight .go { color: var(--muted); }

/* API docs */
.rst-content dl:not(.docutils) > dt {
  background: var(--panel);
  border-top: 3px solid var(--violet);
  color: var(--text);
}

.rst-content dl:not(.docutils) code,
.rst-content dl:not(.docutils) tt {
  background: transparent;
  border: none;
}

/* Admonitions */
.rst-content .note,
.rst-content .admonition-todo,
.rst-content .seealso {
  background: rgba(34, 227, 255, 0.08);
}

.rst-content .note .admonition-title {
  background: #0e7a91;
}

.rst-content .warning {
  background: rgba(255, 79, 216, 0.08);
}

.rst-content .warning .admonition-title {
  background: #a3207f;
}

/* Tables */
.rst-content table.docutils,
.rst-content table.docutils td,
.rst-content table.docutils th,
.wy-table-bordered-all,
.wy-table-bordered-all td,
.wy-table-bordered-all th {
  border-color: var(--border) !important;
}

.rst-content table.docutils {
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--border);
}

.rst-content table.docutils td,
.rst-content table.docutils th,
.rst-content table.docutils:not(.field-list) tr:nth-child(2n-1) td,
.rst-content table.docutils:not(.field-list) tr:nth-child(2n) td,
.wy-table-backed,
.wy-table-odd td,
.wy-table-striped tr:nth-child(2n-1) td {
  background-color: var(--bg) !important;
  color: var(--text) !important;
}

.rst-content table.docutils:not(.field-list) tr:nth-child(2n) td {
  background-color: var(--bg-alt) !important;
}

.rst-content table.docutils thead th {
  background-color: var(--panel) !important;
  color: var(--cyan) !important;
  border-bottom: 2px solid var(--violet) !important;
}

.rst-content table.docutils code {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--cyan);
}

.rst-content table.docutils tr:hover td {
  background-color: var(--panel) !important;
}

/* Footer and misc */
footer,
footer .rst-footer-buttons a,
.rst-footer-buttons .btn {
  color: var(--muted);
}

.btn-neutral {
  background: var(--panel) !important;
  color: var(--cyan) !important;
  border: 1px solid var(--border);
}

hr {
  border-color: var(--border);
}

.math {
  color: #eef0ff;
}

::selection {
  background: var(--violet);
  color: #fff;
}
