/**
 * GLOBAL CONFIG --------------------------------------------------------------
 */

@font-face {
  font-display: swap;
  font-family: "Space Mono";
  font-style: normal;
  font-weight: 400;
  src: url("/fonts/space-mono-v12-latin-regular.woff2") format("woff2"),
    url("/fonts/space-mono-v12-latin-regular.woff") format("woff");
}

@font-face {
  font-display: swap;
  font-family: "Space Mono";
  font-style: italic;
  font-weight: 400;
  src: url("/fonts/space-mono-v12-latin-italic.woff2") format("woff2"),
    url("/fonts/space-mono-v12-latin-italic.woff") format("woff");
}

@font-face {
  font-display: swap;
  font-family: "Space Mono";
  font-style: normal;
  font-weight: 700;
  src: url("/fonts/space-mono-v12-latin-700.woff2") format("woff2"),
    url("/fonts/space-mono-v12-latin-700.woff") format("woff");
}

:root {
  --font-family: "Space Mono";
}

:root {
  --background-color: #f9f5d7;
  --text-color: #3c3836;
  --text-code-color: #cc241d;

  --text-color-link: #989718;
  --text-color-link-active: #b8bb26;
  --text-color-link-visited: #d79921;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background-color: #282828;
    --text-color: #ebdbb2;

    --text-color-link: #989718;
    --text-color-link-active: #b8bb26;
    --text-color-link-visited: #d79921;
  }
}

/**
 * GLOBAL STYLES --------------------------------------------------------------
 */

* {
  box-sizing: border-box;
}

html,
body {
  padding: 0;
  margin: 0 auto;
  font-family: var(--font-family);
  color: var(--text-color);
  background-color: var(--background-color);
}

code {
  font-family: var(--font-family);
  color: var(--text-code-color);
}

html {
  overflow-y: scroll;
}

body {
  max-width: 60em;
}

a[href] {
  color: var(--text-color-link);
  text-decoration: none;
}
a[href]:visited {
  color: var(--text-color-link-visited);
}
a[href]:hover,
a[href]:active {
  color: var(--text-color-link-active);
}

q5-canvas {
  display: block;
  height: 500px;
  border: 1px solid black;
}

/**
 * BASE STYLES ----------------------------------------------------------------
 */

.home-link {
  text-align: center;
}

/**
 * POST STYLES ----------------------------------------------------------------
 */

.post-title h1 {
  margin-bottom: 0.1em;
}

.post-title {
  margin-bottom: 2em;
}

/**
 * PRISM THEMES ---------------------------------------------------------------
 */

/**
 * Gruvbox dark theme
 *
 * Adapted from a theme based on:
 * Vim Gruvbox dark Theme (https://github.com/morhetz/gruvbox)
 *
 * @author Azat S. <to@azat.io>
 * @version 1.0
 */

code[class*="language-"],
pre[class*="language-"] {
  color: #ebdbb2; /* fg1 / fg */
  font-family: Consolas, Monaco, "Andale Mono", monospace;
  direction: ltr;
  text-align: left;
  white-space: pre;
  word-spacing: normal;
  word-break: normal;
  line-height: 1.5;

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

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

pre[class*="language-"]::-moz-selection,
pre[class*="language-"] ::-moz-selection,
code[class*="language-"]::-moz-selection,
code[class*="language-"] ::-moz-selection {
  color: #fbf1c7; /* fg0 */
  background: #7c6f64; /* bg4 */
}

pre[class*="language-"]::selection,
pre[class*="language-"] ::selection,
code[class*="language-"]::selection,
code[class*="language-"] ::selection {
  color: #fbf1c7; /* fg0 */
  background: #7c6f64; /* bg4 */
}

/* Code blocks */
pre[class*="language-"] {
  padding: 1em;
  margin: 0.5em 0;
  overflow: auto;
}

:not(pre) > code[class*="language-"],
pre[class*="language-"] {
  background: #1d2021; /* bg0_h */
}

/* Inline code */
:not(pre) > code[class*="language-"] {
  padding: 0.1em;
  border-radius: 0.3em;
}

.token.comment,
.token.prolog,
.token.cdata {
  color: #a89984; /* fg4 / gray1 */
}

.token.delimiter,
.token.boolean,
.token.keyword,
.token.selector,
.token.important,
.token.atrule {
  color: #fb4934; /* red2 */
}

.token.operator,
.token.punctuation,
.token.attr-name {
  color: #a89984; /* fg4 / gray1 */
}

.token.tag,
.token.tag .punctuation,
.token.doctype,
.token.builtin {
  color: #fabd2f; /* yellow2 */
}

.token.entity,
.token.number,
.token.symbol {
  color: #d3869b; /* purple2 */
}

.token.property,
.token.constant,
.token.variable {
  color: #fb4934; /* red2 */
}

.token.string,
.token.char {
  color: #b8bb26; /* green2 */
}

.token.attr-value,
.token.attr-value .punctuation {
  color: #a89984; /* fg4 / gray1 */
}

.token.url {
  color: #b8bb26; /* green2 */
  text-decoration: underline;
}

.token.function {
  color: #fabd2f; /* yellow2 */
}

.token.regex {
  background: #b8bb26; /* green2 */
}

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

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

.token.inserted {
  background: #a89984; /* fg4 / gray1 */
}

.token.deleted {
  background: #fb4934; /* red2 */
}

/* Use light theme if set to dark for contrast */
@media (prefers-color-scheme: dark) {
  /**
 * Gruvbox light theme
 *
 * Based on Gruvbox: https://github.com/morhetz/gruvbox
 * Adapted from PrismJS gruvbox-dark theme: https://github.com/schnerring/prism-themes/blob/master/themes/prism-gruvbox-dark.css
 *
 * @author Michael Schnerring (https://schnerring.net)
 * @version 1.0
 */

  code[class*="language-"],
  pre[class*="language-"] {
    color: #3c3836; /* fg1 / fg */
    font-family: Consolas, Monaco, "Andale Mono", monospace;
    direction: ltr;
    text-align: left;
    white-space: pre;
    word-spacing: normal;
    word-break: normal;
    line-height: 1.5;

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

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

  pre[class*="language-"]::-moz-selection,
  pre[class*="language-"] ::-moz-selection,
  code[class*="language-"]::-moz-selection,
  code[class*="language-"] ::-moz-selection {
    color: #282828; /* fg0 */
    background: #a89984; /* bg4 */
  }

  pre[class*="language-"]::selection,
  pre[class*="language-"] ::selection,
  code[class*="language-"]::selection,
  code[class*="language-"] ::selection {
    color: #282828; /* fg0 */
    background: #a89984; /* bg4 */
  }

  /* Code blocks */
  pre[class*="language-"] {
    padding: 1em;
    margin: 0.5em 0;
    overflow: auto;
  }

  :not(pre) > code[class*="language-"],
  pre[class*="language-"] {
    background: #f9f5d7; /* bg0_h */
  }

  /* Inline code */
  :not(pre) > code[class*="language-"] {
    padding: 0.1em;
    border-radius: 0.3em;
  }

  .token.comment,
  .token.prolog,
  .token.cdata {
    color: #7c6f64; /* fg4 / gray1 */
  }

  .token.delimiter,
  .token.boolean,
  .token.keyword,
  .token.selector,
  .token.important,
  .token.atrule {
    color: #9d0006; /* red2 */
  }

  .token.operator,
  .token.punctuation,
  .token.attr-name {
    color: #7c6f64; /* fg4 / gray1 */
  }

  .token.tag,
  .token.tag .punctuation,
  .token.doctype,
  .token.builtin {
    color: #b57614; /* yellow2 */
  }

  .token.entity,
  .token.number,
  .token.symbol {
    color: #8f3f71; /* purple2 */
  }

  .token.property,
  .token.constant,
  .token.variable {
    color: #9d0006; /* red2 */
  }

  .token.string,
  .token.char {
    color: #797403; /* green2 */
  }

  .token.attr-value,
  .token.attr-value .punctuation {
    color: #7c6f64; /* fg4 / gray1 */
  }

  .token.url {
    color: #797403; /* green2 */
    text-decoration: underline;
  }

  .token.function {
    color: #b57614; /* yellow2 */
  }

  .token.regex {
    background: #797403; /* green2 */
  }

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

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

  .token.inserted {
    background: #7c6f64; /* fg4 / gray1 */
  }

  .token.deleted {
    background: #9d0006; /* red2 */
  }
}
