:root {
  --base00: #1e2c3e;
  --base01: #31455e;
  --base02: #151d29;
  --base03: #6d819c;
  --base04: #ffffff;
  --base05: #dbdbdc;
  --base06: #fff2c2;
  --base07: #ffffff;
  --base08: #ff5c7c;
  --base09: #d1ae00;
  --base0A: #ffd285;
  --base0B: #8fff96;
  --base0C: #81eced;
  --base0D: #81ecee;
  --base0E: #ff8af5;
  --base0F: #ffffff;

  --hdr-gradient: linear-gradient(
    146deg in oklab,
    rgb(30, 31, 53) 52% 52%,
    oklch(35% 0.12 261) 102% 102%
  );
  --sdr-gradient: linear-gradient(146deg, #1e1f35 52% 52%, #1e2c3e 102% 102%);

  --cyan: var(--base0C, #00c1be);
  --yellow: var(--base0A, #e1ff7f);
  --green: var(--base0B, #5faa70);
  --red: var(--base08, #b03a3a);
  --purple: var(--base0E, #8f42ae);
  --blue: var(--base0D, #6a6ace);
  --orange: var(--base09, #c6903a);

  --bg: rgb(30, 31, 53);
  --bg-code: var(--base00);
  --bg-lighter: var(--base01, #250060);
  --bg-light: var(--base07);
  --selection: var(--base02);
  --comments: var(--base03, #59456e);
  --docs-border-color: var(--base03, var(--comments));
  --dark-fg: var(--base04);
  --fg: var(--base05, #b9a9be);
  --fg-light: var(--base06);

  --error: var(--red);
  --delimiter: var(--red);
  --keyword: var(--red);
  --number: var(--purple);
  --number-type: var(--red);
  --boolean: var(--purple);
  --class: var(--blue);
  --string: var(--yellow);
  --string-type: var(--purple);
  --regex: var(--cyan);
  --symbol: var(--cyan);
  --function: var(--green);
  --object-type: var(--cyan);
  --object: var(--blue);
  --interactive: var(--base0E);
  --deprecated: var(--base0F);
}

html {
  background: var(--sdr-gradient);
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-color: var(--bg);
  overscroll-behavior: none;
  /* height: 100%; */
}

body {
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  overscroll-behavior: none;

  color: var(--fg);
  font-size: 20px;
  font-family: 'EB Garamond', serif;
  font-optical-sizing: auto;
  font-optical-sizing: auto;
}

/* 1. Use a more-intuitive box-sizing model */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* 2. Remove default margin */
* {
  margin: 0;
}

body {
  /* 3. Add accessible line-height */
  line-height: 1.5;
  /* 4. Improve text rendering */
  -webkit-font-smoothing: antialiased;
}

/* 5. Improve media defaults */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

/* 6. Inherit fonts for form controls */
input,
button,
textarea,
select {
  font: inherit;
}

/* 7. Avoid text overflows */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: bold;
  overflow-wrap: break-word;
}

/* 8. Improve line wrapping */
p {
  max-width: 800px;
  text-wrap: pretty;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  text-wrap: balance;
  /* margin-top: 1rem; */
  /* margin-left: 1rem; */
}

h4 {
  display: inline;
  font-size: 12px;
  font-family: monospace;
}

input[type='number'],
input[type='text'],
select {
  border: 1px solid var(--docs-border-color);
  background-color: var(--bg);
  height: 1.5em;
  color: var(--fg);
  font-size: 12px;
}

.flex {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 0.5em;
  max-width: 100%;
  /* background-color: antiquewhite; */
  /* width: 100%; */
}

.flex-wrap {
  flex-wrap: wrap;
}

.flex-nowrap {
  flex-wrap: nowrap;
}

.row {
  flex-direction: row;
}

.col {
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  /* outline: 1px solid red; */
  /* margin-inline: 2em; */
}

button {
  all: unset;
  transition: all 100ms linear;
  cursor: pointer;
  border: 1px solid var(--docs-border-color);
  border-radius: 4px;
  padding: 0.5em;
  font-size: 12px;

  &:hover:not(:disabled) {
    background-color: var(--docs-border-color);
  }

  &:disabled {
    cursor: auto;
    color: var(--docs-border-color);
  }
}

label {
  /* height: 3.5rem; */
  display: flex;
  /* border: 1px solid; */
  flex-direction: column;
  align-items: center;
  justify-items: flex-start;
  font-size: 12px;
  font-family: monospace;
  /* gap: 0.5rem; */
  /* padding: 1em; */
}

label:has(input[type='checkbox']) {
  display: flex;
  flex-direction: row;
  gap: 1em;
  margin-bottom: 0.5em;
}

button {
  font-family: monospace;
}

p code,
ul code,
table code {
  border-radius: 2px;
  background-color: var(--bg-lighter);
  padding-inline: 0.3em;
  font-size: 0.8em;
  font-family: monospace;
}

a {
  color: var(--fg);
}

button.unstyled {
  all: unset;
  cursor: pointer;
  font-family: monospace;

  &:disabled {
    color: var(--docs-border-color);
  }
}

.gap {
  gap: 1em !important;
}

.align-center {
  align-items: center;
}

.align-start {
  align-items: flex-start;
}

.align-end {
  align-items: flex-end !important;
}

.justify-center {
  justify-content: center;
}
.justify-start {
  justify-content: flex-start;
}
.justify-end {
  justify-content: flex-end;
}
.justify-between {
  justify-content: space-between;
}

.w-max {
  width: 100%;
}

.eb-garamond {
  font-family: 'EB Garamond', serif;
  font-optical-sizing: auto;
  /* font-weight: <weight>;
  font-style: normal; */
}

/** TOC **/

.toc {
  display: none;
  position: fixed;
  top: 50%;
  right: 0;
  flex-direction: column;
  transform: translateX(60%) translateY(-50%);
  opacity: 0.5;
  z-index: 50;
  transition: all 250ms ease-in;
  margin-top: auto;
  margin-bottom: auto;
  border-top-left-radius: 8px;
  border-bottom-left-radius: 8px;
  padding: 1em;
  max-height: 90vh;
  overflow-y: auto;

  hr {
    transition: all 250ms ease-in;
  }

  &:hover {
    transform: translateX(0) translateY(-50%);
    opacity: 1;
    border-width: 1px 0 1px 1px;
    border-style: solid;
    border-color: var(--docs-border-color);
    background-color: var(--bg);

    a {
      opacity: 1;
      background-color: transparent;
      color: var(--fg);
    }

    hr {
      opacity: 0;
      border-color: var(--docs-border-color);
    }
  }

  a {
    opacity: 0;
    transition: all 250ms ease-in;
    /* background-color: var(--comments); */
    border-radius: 8px;
    padding: 0.25em;
    color: var(--comments);
    font-size: 0.857em;
    /* margin-top: 2px; */
    line-height: 0.8;
    text-decoration: none;
  }
}

@media (min-width: 1024px) {
  .toc {
    display: flex;
  }
}

dfn {
  all: unset;
  cursor: help;
  text-decoration: underline;
  text-decoration-style: wavy;
  text-decoration-thickness: 1px;
}

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

.shiki {
  border: 1px solid var(--docs-border-color);
  border-radius: 8px;
  padding: 1ch;
  max-width: max-content;
  overflow-y: auto;
  font-size: 12px;
}

.md-types {
  display: flex;
  flex-direction: column;
  gap: 0.5ch;
  background-color: rgb(0 0 0 / 0.1);
  padding: 1ch;

  /* p {
    padding: 1ch;
    background-color: var(--bg-lighter);

    code {
      outline: 1px solid black;
    }
  } */

  table {
    background-color: var(--bg-lighter);
    font-size: 12px;
    font-family: monospace;

    th {
      font-size: 12px;
      text-align: left;
    }

    td {
      font-size: 12px;
      white-space: nowrap;
    }

    code {
      font-size: 10px;
    }
  }

  h1,
  h2,
  h3 {
    /* font-family: monospace; */

    a {
      text-decoration: none;
    }
  }
}

kbd {
  display: inline-block;
  box-shadow:
    0 1px 1px rgba(0, 0, 0, 0.2),
    0 2px 0 0 rgba(255, 255, 255, 0.7) inset;
  border: 1px solid #b4b4b4;
  border-radius: 3px;
  background-color: #eee;
  padding: 2px 4px;
  color: #333;
  font-weight: 700;
  font-size: 0.85em;
  line-height: 1;
  white-space: nowrap;
}

.DocSearch-Container {
  z-index: 1000000 !important;
}

span.icon.icon-link {
  &::before {
    content: '# ';
    color: hotpink;
  }
}
