.dark .shiki,
.dark .shiki span {
  color: var(--s-dark, inherit);
  --twoslash-popup-bg: #191919;
  --twoslash-border-color: #8884;
}
.dark .shiki {
  background-color: #0e0e0e;
}

html:not(.dark) .shiki {
  background-color: #fafafa;
}

html:not(.dark) .shiki,
html:not(.dark) .shiki span {
  color: var(--s-light, inherit);
  --twoslash-popup-bg: #fafafa;
}

.twoslash ul {
  font-size: 1em !important;
}

.twoslash ul > li::before {
  display: none;
}

.twoslash ul > li {
  padding: 1px;
  margin: 0;
}

.twoslash-query-presisted .twoslash-popup-info {
  transform: translate(0, 1.6em);
}

/* Prose */
.prose pre:not(.shiki) {
  padding: 0;
  margin: 0;
  background: transparent;
}

.prose .shiki {
  font-family: 'DM Mono', 'Input Mono', 'Fira Code', monospace;
  font-size: 0.92em;
  line-height: 1.4;
  margin: 0.5em 0;
}

.prose img {
  width: 100%;
}

.prose p > img {
  width: 100%;
  --uno: shadow rounded-lg;
  transform: scale(1.05);
  margin: 2.6em 0;
}

.prose {
  --fg-light: #666;
  --fg: #444;
  --fg-deep: #222;
  --fg-deeper: #000;

  color: var(--fg);
}

.prose a {
  font-weight: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(125, 125, 125, 0.3);
  transition: border 0.3s ease-in-out;
}

.prose a:hover {
  border-bottom: 1px solid var(--fg);
}

.prose a code {
  color: inherit;
}

.prose hr {
  width: 50px;
  margin: 2em auto;
}

.prose s {
  opacity: 0.5;
}

.prose em {
  text-decoration: underline;
  text-decoration-color: #aaa3;
  text-underline-offset: 3px;
}

.prose ol > li::before {
  color: inherit;
}

html.dark .prose {
  --fg-light: #aaa;
  --fg: #ccc;
  --fg-deep: #ddd;
  --fg-deeper: #fff;
}

a.item {
  transition: 0.2s all ease-out;
  text-decoration: none;
  border-bottom: none !important;
  opacity: 0.6;
}

a.item:hover {
  opacity: 1;
}

a.header-anchor {
  float: left;
  margin-top: 0.125em;
  margin-left: -1.2em;
  padding-right: 0.5em;
  font-size: 0.85em;
  opacity: 0;
  text-decoration: none;
  border: 0 !important;
}

a.header-anchor:hover,
a.header-anchor:focus {
  text-decoration: none;
}

h1:hover .header-anchor,
h1:focus .header-anchor,
h2:hover .header-anchor,
h2:focus .header-anchor,
h3:hover .header-anchor,
h3:focus .header-anchor,
h4:hover .header-anchor,
h4:focus .header-anchor,
h5:hover .header-anchor,
h5:focus .header-anchor,
h6:hover .header-anchor,
h6:focus .header-anchor {
  opacity: 0.5;
}

.prose blockquote {
  font-weight: normal;
  font-style: normal;
  line-height: 1.6em;
  padding: 0.5em 1em;
  margin-left: -1.1em;
}

.prose blockquote > * {
  opacity: 0.7;
}

.prose blockquote > :first-child {
  margin-top: 0;
}

.prose blockquote > :last-child {
  margin-bottom: 0;
}

.prose blockquote p:first-of-type::before {
  content: none;
}

.prose blockquote p:first-of-type::after {
  content: none;
}

.table-of-contents {
  position: fixed;
  top: 90px;
  bottom: 0;
  font-size: 0.8em;
  left: 20px;
  z-index: 200;
  overflow: hidden;
  --uno: hidden lg-flex flex-col w-100px lg-w-200px xl-w-300px;
}

.table-of-contents-anchor {
  --uno: mx2 w-7 h-7 text-lg flex items-center justify-center bg-base rounded
    text-hex-8887 border border-base shadow md: border-transparent md:
    shadow-none transition duration-400;
}

.table-of-contents > ul {
  text-overflow: ellipsis;
  height: 100%;
  overflow-y: auto;
  --uno: rounded op0 mt-1 pb-5 transition duration-700;
}

*:hover > .table-of-contents > .table-of-contents-anchor,
.toc-always-on .table-of-contents > .table-of-contents-anchor {
  --uno: text-inherit;
}

.toc-always-on .table-of-contents > ul {
  opacity: 0.6;
}

*:hover > .table-of-contents > ul {
  opacity: 0.75;
}

.table-of-contents ul > li::before {
  display: none;
}

.table-of-contents ul > li {
  padding-left: 0.8rem;
  line-height: 1.5em;
  margin-top: 0.5em;
}

.table-of-contents ul > li > a {
  --uno: op75 hover-op100 transition;
}

.code-wrap .line {
  white-space: break-spaces;
}

.markdown-magic-link {
  display: inline-flex;
  align-items: center;
  background-color: #8883;
  transform: translateY(3px);
  line-height: 100%;
  color: var(--fg-light) !important;
  transition: 0.15s all ease-out !important;
  overflow: hidden;
  --uno: gap-1 rounded px1.5 py1 important-border-0 font-condensed;

  &::before {
    content: '';
    position: absolute;
    left: -110%;
    top: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(
      90deg,
      rgba(255, 255, 255, 0),
      rgba(255, 255, 255, 0.5),
      rgba(255, 255, 255, 0)
    );
  }
}

.markdown-magic-link:hover {
  background-color: #8884;
  color: var(--fg) !important;
  &::before {
    left: 110%;
    transition: all 0.8s;
  }
}

.markdown-magic-link-image {
  display: inline-block;
  height: 1.1em;
  width: 1.1em;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  border-radius: 2px;
}

.markdown-magic-link.markdown-magic-link-github-at {
  transform: translateY(6px);
  --uno: pl-0 py-0 pr2 uppercase text-sm gap-1.2 rounded-full;
}

.markdown-magic-link.markdown-magic-link-github-at .markdown-magic-link-image {
  height: 1.6em;
  width: 1.6em;
  border-radius: 50%;
}
