@media (prefers-color-scheme: light) {
  :root {
    --theme-color-base-lightest: #fff8fb;
    --theme-color-base-lighter: #f7e7ee;
    --theme-color-base-light: #d9bdca;
    --theme-color-base: #8b6879;
    --theme-color-base-dark: #614957;
    --theme-color-base-darker: #47343e;
    --theme-color-base-darkest: #241a1f;
    --theme-color-base-ink: #241a1f;
    --theme-color-primary-lighter: #fde7f1;
    --theme-color-primary-light: #f38ab7;
    --theme-color-primary: #c2185b;
    --theme-color-primary-vivid: #e91e63;
    --theme-color-primary-dark: #9d174d;
    --theme-color-primary-darker: #74113a;
    --theme-body-background-color: #fffafd;
    --theme-link-color: var(--theme-color-primary);
    --theme-link-visited-color: #88436c;
    --theme-link-hover-color: var(--theme-color-primary-dark);
    --theme-link-active-color: var(--theme-color-primary-darker);
    --theme-focus-color: var(--theme-color-primary-vivid);
    --shale-color-cool-lightest: #f0effc;
    --shale-color-cool-light: #d9d6f5;
    --shale-color-cool: #5d55b3;
    --shale-color-cool-dark: #47408f;
  }

  body {
    background-color: #fffafd;
  }

  header {
    background-color: var(--theme-color-primary);
  }

  .usa-header--extended .usa-nav {
    background-color: #fff6fa;
    border-bottom-color: #f4dce7;
  }

  .usa-nav__primary > .usa-nav__primary-item > a {
    color: #543745;
  }

  .usa-nav__primary > .usa-nav__primary-item > a.usa-current {
    color: var(--theme-color-primary-dark);
  }

  .usa-nav__primary > .usa-nav__primary-item > a:hover {
    color: var(--theme-color-primary-dark);
    background-color: #f9e7ef;
  }

  .usa-nav__primary > .usa-nav__primary-item > a.usa-current::after {
    background-color: var(--theme-color-primary);
  }

  .usa-link,
  .markdown a {
    text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
  }

  .markdown a {
    color: var(--theme-link-color);
  }

  .usa-table th,
  .usa-table td,
  .markdown th,
  .markdown td {
    border-color: #ead8e0;
    border-width: 1px;
  }

  .usa-table thead th,
  .usa-table thead td,
  .usa-table tfoot th,
  .usa-table tfoot td {
    background-color: #f5e3eb;
  }

  details.m-usa-accordion > summary.m-usa-accordion__heading {
    background-color: #f5e8ee;
  }

  details.m-usa-accordion > summary.m-usa-accordion__heading:hover {
    background-color: #efd9e3;
  }

  details.m-usa-accordion > summary.m-usa-accordion__heading:focus {
    outline-color: var(--theme-focus-color);
  }

  details.m-usa-accordion > .m-usa-accordion__content {
    background-color: #fffdfe;
  }

  :is(.usa-input, .usa-textarea, .usa-select) {
    border-color: #ad8a9a;
  }

  input:is([type="radio"], [type="checkbox"]) {
    accent-color: var(--theme-color-primary);
  }

  :is(.usa-radio__input, .usa-checkbox__input):focus
    + [class*="__label"]::before {
    outline-color: var(--theme-focus-color);
  }

  :is(.usa-radio__input--tile, .usa-checkbox__input--tile):checked
    + [class*="__label"] {
    background-color: var(--theme-color-primary-lighter);
  }

  hr {
    border-color: #c9aeba;
  }

  .markdown p > code,
  kbd {
    color: #543745;
    background-color: #f3e4eb;
    border-color: #d9bdca;
  }

  :is(td, span).idleage.weeks,
  :is(td, span).idleage.months,
  :is(td, span).idleage.years {
    color: #8b6879;
  }

  :is(#page-log, #page-history) .usa-tag.tag {
    color: white;
    background-color: var(--shale-color-cool);
  }

  #page-commit details .adds,
  #page-commit table.unified-diffs tr.added td:is(:nth-child(1), :nth-child(2)),
  #page-commit table.unified-diffs tr.added td:nth-child(3)::before,
  #page-commit table.split-diffs tr td.added:nth-child(odd),
  #page-commit table.split-diffs tr td.added::before {
    color: var(--shale-color-cool-dark);
  }

  #page-commit table.unified-diffs tr.added td,
  #page-commit table.split-diffs tr td.added,
  #page-commit :is(table.unified-diffs, table.split-diffs) tr.status td {
    background-color: var(--shale-color-cool-lightest);
  }

  #page-commit table.unified-diffs tr.added
    td:is(:nth-child(1), :nth-child(2)),
  #page-commit table.split-diffs tr td.added:nth-child(odd) {
    background-color: var(--shale-color-cool-light);
  }

  #page-commit #m-changedfiles a[data-icon="file-plus"]::before {
    background-color: var(--shale-color-cool);
  }

  .issuestatus-todo use {
    --stroke: var(--shale-color-cool);
  }

  ::highlight(co),
  ::highlight(n),
  ::highlight(at),
  ::highlight(pr),
  ::highlight(tu) {
    color: var(--shale-color-cool-dark);
  }

  .usa-footer__secondary-section {
    background-color: #f6e8ee;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --theme-color-base-lightest: #f9eef3;
    --theme-color-base-lighter: #e8d4dd;
    --theme-color-base-light: #b994a5;
    --theme-color-base: #8d697a;
    --theme-color-base-dark: #5d414e;
    --theme-color-base-darker: #3f2b34;
    --theme-color-base-darkest: #241820;
    --theme-color-base-ink: #171015;
    --theme-color-primary-lighter: #ffe0ec;
    --theme-color-primary-light: #ff9fc3;
    --theme-color-primary: #ff6fa9;
    --theme-color-primary-vivid: #ff4f98;
    --theme-color-primary-dark: #f24b8b;
    --theme-color-primary-darker: #da3476;
    --theme-body-background-color: #1d151a;
    --theme-text-color: #f7edf2;
    --theme-text-reverse-color: #21161c;
    --theme-link-color: #ff8fba;
    --theme-link-visited-color: #d9a3c1;
    --theme-link-hover-color: #ffc0d8;
    --theme-link-active-color: #ffd7e6;
    --theme-focus-color: var(--theme-color-primary-vivid);
    --shale-color-cool-lightest: #292641;
    --shale-color-cool-light: #38345f;
    --shale-color-cool: #a59cff;
    --shale-color-cool-dark: #cbc7ff;
  }

  body {
    background-color: var(--theme-body-background-color);
    color: var(--theme-text-color);
  }

  header {
    background-color: #861947;
  }

  .usa-header--extended .usa-nav {
    background-color: #281c22;
    border-bottom-color: #49313d;
  }

  .usa-nav__primary > .usa-nav__primary-item > a {
    color: #ead7e0;
  }

  .usa-nav__primary > .usa-nav__primary-item > a.usa-current {
    color: var(--theme-color-primary-light);
  }

  .usa-nav__primary > .usa-nav__primary-item > a:hover {
    color: var(--theme-link-hover-color);
    background-color: #3a2730;
  }

  .usa-nav__primary > .usa-nav__primary-item > a.usa-current::after {
    background-color: var(--theme-color-primary);
  }

  .usa-link,
  .markdown a {
    text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
  }

  .markdown a {
    color: var(--theme-link-color);
  }

  .usa-table th,
  .usa-table td,
  .markdown th,
  .markdown td {
    border-color: #503844;
    border-width: 1px;
  }

  .usa-table thead th,
  .usa-table thead td,
  .usa-table tfoot th,
  .usa-table tfoot td {
    background-color: #34242c;
  }

  details.m-usa-accordion > summary.m-usa-accordion__heading {
    background-color: #302129;
  }

  details.m-usa-accordion > summary.m-usa-accordion__heading:hover {
    background-color: #422b36;
  }

  details.m-usa-accordion > summary.m-usa-accordion__heading:focus {
    outline-color: var(--theme-focus-color);
  }

  details.m-usa-accordion > .m-usa-accordion__content {
    color: var(--theme-text-color);
    background-color: #23181e;
  }

  :is(.usa-input, .usa-textarea, .usa-select) {
    color: var(--theme-text-color);
    background-color: #24191f;
    border-color: #765361;
  }

  input:is([type="radio"], [type="checkbox"]) {
    accent-color: var(--theme-color-primary);
  }

  :is(.usa-radio__input, .usa-checkbox__input):focus
    + [class*="__label"]::before {
    outline-color: var(--theme-focus-color);
  }

  :is(.usa-radio__input--tile, .usa-checkbox__input--tile):checked
    + [class*="__label"] {
    background-color: #3b2330;
  }

  hr {
    border-color: #654653;
  }

  .markdown p > code,
  kbd {
    color: #f1dce6;
    background-color: #38262f;
    border-color: #624451;
  }

  :is(td, span).idleage.weeks,
  :is(td, span).idleage.months,
  :is(td, span).idleage.years {
    color: #bd9eac;
  }

  :is(#page-log, #page-history) .usa-tag.tag {
    color: #17132b;
    background-color: var(--shale-color-cool);
  }

  #page-commit details .adds,
  #page-commit table.unified-diffs tr.added td:is(:nth-child(1), :nth-child(2)),
  #page-commit table.unified-diffs tr.added td:nth-child(3)::before,
  #page-commit table.split-diffs tr td.added:nth-child(odd),
  #page-commit table.split-diffs tr td.added::before {
    color: var(--shale-color-cool-dark);
  }

  #page-commit table.unified-diffs tr.added td,
  #page-commit table.split-diffs tr td.added,
  #page-commit :is(table.unified-diffs, table.split-diffs) tr.status td {
    background-color: var(--shale-color-cool-lightest);
  }

  #page-commit table.unified-diffs tr.added
    td:is(:nth-child(1), :nth-child(2)),
  #page-commit table.split-diffs tr td.added:nth-child(odd) {
    background-color: var(--shale-color-cool-light);
  }

  #page-commit #m-changedfiles a[data-icon="file-plus"]::before {
    background-color: var(--shale-color-cool);
  }

  .issuestatus-todo use {
    --stroke: var(--shale-color-cool);
  }

  ::highlight(co),
  ::highlight(n),
  ::highlight(at),
  ::highlight(pr),
  ::highlight(tu) {
    color: var(--shale-color-cool-dark);
  }

  svg {
    color: #f1dfe7;
  }

  use {
    stroke: currentColor;
    --stroke: currentColor;
  }

  .usa-card__container {
    border-color: #503844;
  }

  .usa-footer__secondary-section {
    background-color: #2b1e25;
  }
}

.va-middle-childs > svg,
.usa-header--basic .usa-logo a > svg {
  margin-right: 4px;
}

/* Repo icons: forgejo avatars painted over the lucide glyph on the index and repo header. */
.va-middle-childs > svg:has(+ a[href="./discord-name-painter/"]),
.usa-header--basic a[href="/discord-name-painter/"] > svg {
  background: url(/-/repo-icons/discord-name-painter.png) center / contain no-repeat;
  & > use { display: none; }
}
.va-middle-childs > svg:has(+ a[href="./home-infra/"]),
.usa-header--basic a[href="/home-infra/"] > svg {
  background: url(/-/repo-icons/home-infra.png) center / contain no-repeat;
  & > use { display: none; }
}
.va-middle-childs > svg:has(+ a[href="./markodown/"]),
.usa-header--basic a[href="/markodown/"] > svg {
  background: url(/-/repo-icons/markodown.png) center / contain no-repeat;
  & > use { display: none; }
}
.va-middle-childs > svg:has(+ a[href="./react-mutation/"]),
.usa-header--basic a[href="/react-mutation/"] > svg {
  background: url(/-/repo-icons/react-mutation.png) center / contain no-repeat;
  & > use { display: none; }
}
.va-middle-childs > svg:has(+ a[href="./sitegen/"]),
.usa-header--basic a[href="/sitegen/"] > svg {
  background: url(/-/repo-icons/sitegen.png) center / contain no-repeat;
  & > use { display: none; }
}
.va-middle-childs > svg:has(+ a[href="./toolkit/"]),
.usa-header--basic a[href="/toolkit/"] > svg {
  background: url(/-/repo-icons/toolkit.png) center / contain no-repeat;
  & > use { display: none; }
}
.va-middle-childs > svg:has(+ a[href="./snowbound/"]),
.usa-header--basic a[href="/snowbound/"] > svg {
  background: url(/-/repo-icons/snowbound.png) center / contain no-repeat;
  & > use { display: none; }
}
