/* Syntax highlighting theme tuned to this site.

   `highlight` emits spans like:
     <span class="hl kwa">def</span>

   This stylesheet maps highlight token classes to colors that
   match the site's palette and supports light/dark mode.
*/

:root {
  --code-fg: var(--text-main);
  --code-muted: var(--text-muted);
  --code-keyword: var(--accent);
  --code-func: #2563eb;
  --code-type: #7c3aed;
  --code-string: #047857;
  --code-number: #b45309;
  --code-operator: var(--text-main);
  --code-error: #dc2626;
}

@media (prefers-color-scheme: dark) {
  :root {
    --code-func: #93c5fd;
    --code-type: #c4b5fd;
    --code-string: #34d399;
    --code-number: #fbbf24;
    --code-error: #f87171;
  }
}

/* Base */
main#content pre code {
  color: var(--code-fg);
}

/* Comments */
.hl.com,
.hl.slc {
  color: var(--code-muted);
}

/* Strings */
.hl.sng,
.hl.pps {
  color: var(--code-string);
}

/* Numbers */
.hl.num {
  color: var(--code-number);
}

/* Keywords */
.hl.kwa,
.hl.kwb {
  color: var(--code-keyword);
  font-weight: 600;
}

/* Names (functions/types/etc) */
.hl.kwd,
.hl.kwf {
  color: var(--code-func);
}

.hl.kwc,
.hl.kwe {
  color: var(--code-type);
}

/* Operators / punctuation / misc */
.hl.opt,
.hl.esc,
.hl.ipl,
.hl.ppc {
  color: var(--code-operator);
}

/* Errors */
.hl.err,
.hl.erm {
  color: var(--code-error);
  font-weight: 700;
}

/* Optional line-number class if enabled */
.hl.lin {
  color: var(--code-muted);
  user-select: none;
  -webkit-user-select: none;
}
