:root {
  --wide-width: 80vw;
  --content-width: 1000px;
  --bg-color: white;
  --fg-color: black;
  --code-bg: lightgray;
  --code-fg: black;
  --primary-color: #309d4c;
}

@media (max-width: 1000px) {
  :root {
    --wide-width: 100%;
    --content-width: 100%;
  }
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #272822;
    --fg-color: #e6e6e0;
    --code-bg: #2d2d2d;
    --code-fg: white;
    --primary-color: #00d3ff;
  }
  svg {
    filter: invert(100%);
  }
}
body {
  background-color: var(--bg-color);
  color: var(--fg-color);
  margin: 0;
}

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

nav {
  display: flex;
  flex-wrap: wrap;
  padding-left: 2rem;
  padding-right: 2rem;
  justify-content: space-between;
}
nav ul {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  padding-left: 0;
  column-gap: 1rem;
}

main {
  max-width: var(--wide-width);
  margin: auto;
  margin-top: 2rem;
  padding: 1rem;
}
main > *:not(.wide) {
  max-width: var(--content-width);
  margin: auto;
}
main .wide {
  max-width: var(--wide-width);
  display: block;
  margin: auto;
}

pre,
code {
  background-color: var(--code-bg);
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  color: var(--code-fg);
  border-radius: 0.5rem;
}

pre,
.editor .editor-inner {
  box-shadow: 2px 2px 3px var(--fg-color);
  border-radius: 0.5rem;
}

pre {
  overflow: auto;
  font-size: 12pt;
}

input:not([type=file]) {
  background-color: var(--bg-color);
  color: var(--fg-color);
  box-shadow: inset 0px -2px var(--primary-color);
}
input:not([type=file])::placeholder {
  color: rgb(from var(--fg-color) r g b/0.5);
}

input,
button {
  font-size: inherit;
  border-radius: 0.25rem;
  margin: 3px;
}
input:not(input[type=file],
button[type=file]), input::file-selector-button,
button:not(input[type=file],
button[type=file]),
button::file-selector-button {
  padding: 0.5rem;
  border: none;
  border-radius: 0.25rem;
}
input:focus,
button:focus {
  outline: none;
  box-shadow: inset 0px -4px var(--primary-color);
}

.editor {
  margin-bottom: 1rem;
}
.editor .editor-inner {
  display: grid;
  grid-template-columns: auto 1fr;
}
.editor .editor-inner .numbers {
  padding: 0.5rem;
  text-align: right;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.editor .editor-inner .code-text {
  font-size: 12pt;
  font-family: monospace;
  line-height: 1.5em;
}
.editor .editor-inner .text-wrapper {
  overflow: scroll;
  border-top-right-radius: 0.5rem;
  border-bottom-right-radius: 0.5rem;
  background-color: var(--code-bg) !important;
  background: linear-gradient(to right, var(--code-bg) 50%, rgba(255, 255, 255, 0)) left center, linear-gradient(to left, var(--code-bg) 50%, rgba(255, 255, 255, 0)) right center, linear-gradient(to right, rgba(0, 0, 0, 0.3) 40%, rgba(255, 255, 255, 0)) left center, linear-gradient(to left, rgba(0, 0, 0, 0.3) 40%, rgba(255, 255, 255, 0)) right center;
  background-repeat: no-repeat;
  background-size: 40px 100%, 40px 100%, 20px 100%, 20px 100%;
  background-attachment: local, local, scroll, scroll;
}
.editor .editor-inner .text-wrapper > div {
  display: grid;
  width: 100%;
}
.editor .editor-inner .text-wrapper > div > * {
  margin: 0px;
  padding: 0.5rem;
  border: 0;
  height: 100%;
  resize: none;
  min-width: 100%;
  width: fit-content;
  white-space: pre;
  overflow: hidden;
  grid-area: 1/1/2/2;
  box-sizing: border-box;
}
.editor .editor-inner .text-wrapper .text-view {
  z-index: 0;
  box-shadow: none;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}
.editor .editor-inner .text-wrapper .text-view,
.editor .editor-inner .text-wrapper .text-view code {
  background-color: unset;
}
.editor .editor-inner .text-wrapper .text-view code {
  padding: 0px;
}
.editor .editor-inner .text-wrapper .text-input {
  z-index: 1;
  color: rgb(from currentColor r g b/0);
  background: transparent;
  caret-color: rgb(from currentColor r g b/1);
  width: 100%;
  overflow: hidden;
}
.editor .editor-inner .text-wrapper .text-input:focus {
  outline: none;
}
.editor .hint-text {
  vertical-align: top;
  margin: 0px;
}

.hint-text {
  color: gray;
  font-size: 10pt;
}

.hint-text:hover {
  filter: brightness(150%);
}
