/*
 * Dark color scheme using 216 web-safe colors, inspired
 * somewhat by the default color scheme in mutt.
 * CC0-1.0 <https://creativecommons.org/publicdomain/zero/1.0/legalcode>
 * https://en.wikipedia.org/wiki/Light-on-dark_color_scheme
 */
* {
  font-size: 100%;
  font-family: monospace;
  background: #000;
  color: #ccc;
}
pre {
  white-space: pre-wrap;
}
input,
textarea {
  background: #033;
}

a:link {
  color: #69f;
  text-decoration: none;
}
a:visited {
  color: #96f;
}
a:hover {
  color: #fff;
  background: #03c;
}

body {
  max-width: none;
  margin: 0;
  padding: 1em 0;
  display: grid;
  grid-template-columns: 1fr minmax(0, 80ch) 1fr;
  column-gap: 1em;
  line-height: 1.4;
}
body > * {
  grid-column: 2;
}
body > .wave {
  display: block;
  position: sticky;
  top: 0;
  align-self: start;
  grid-row: 1 / span 50;
  width: 100%;
  height: 100vh;
  pointer-events: none;
  user-select: none;
}
body > .wave.left {
  grid-column: 1;
}
body > .wave.right {
  grid-column: 3;
}
@media (max-width: 1000px) {
  body {
    display: block;
    max-width: 80ch;
    margin: 0 auto;
    padding: 1em;
  }
  body > .wave {
    display: none;
  }
}
body > .wave.left {
  box-shadow: inset -1px 0 rgba(255, 255, 255, 0.25);
}
body > .wave.right {
  box-shadow: inset 1px 0 rgba(255, 255, 255, 0.25);
}
h1,
h2 {
  color: #fff;
  font-weight: bold;
}
h1 {
  margin: 1.5em 0 0.5em;
}
h2 {
  margin: 0 0 0.5em;
}
h2::before {
  content: "## ";
  color: #c93;
}
h1::before {
  content: "# ";
  color: #c93;
}

hr {
  border: 0;
  border-top: 1px dashed #666;
  margin: 2em 0;
}

.mark {
  color: #fff;
  font-weight: bold;
}
.dim {
  color: #888;
}
.tag {
  color: #c93;
}

nav {
  margin: 0.5em 0 0;
}
nav a {
  margin-right: 1ch;
}

ul.links {
  list-style: none;
  margin: 1em 0;
  padding: 0;
}
ul.links li::before {
  content: "- ";
  color: #666;
}

dl {
  margin: 1em 0;
}
dt {
  color: #fff;
  font-weight: bold;
  margin-top: 1em;
}
dd {
  margin: 0 0 0 2ch;
  color: #aaa;
}

img {
  max-width: 100%;
  height: auto;
  border: 0;
  vertical-align: middle;
}
.button-box img {
  image-rendering: pixelated;
}

details {
  margin: 0.5em 0;
}
summary {
  cursor: pointer;
  color: #888;
}
textarea {
  display: block;
  width: 100%;
  max-width: 60ch;
  border: 1px solid #666;
  margin-top: 0.5em;
  resize: none;
}

button {
  font: inherit;
  color: #fff;
  background: #000;
  border: 1px solid #ccc;
  padding: 0 1ch;
  cursor: pointer;
}
button:hover {
  background: #03c;
}

.presence {
  margin: 1em 0;
}
.presence .pdot {
  display: inline-block;
  width: 1ch;
  height: 1ch;
  background: #666;
  margin-right: 1ch;
}
.presence[data-s="online"] .pdot {
  background: #0f0;
}
.presence[data-s="idle"] .pdot {
  background: #ff0;
}
.presence[data-s="dnd"] .pdot {
  background: #f30;
}

.badges {
  margin: 1em 0;
}
.badges > * {
  margin: 0 1ch 1ch 0;
}

footer {
  margin-top: 3em;
  padding-top: 1em;
  border-top: 1px dashed #666;
  color: #888;
}
footer > * {
  margin-right: 2ch;
}

.you-hint {
  position: fixed;
  bottom: 1em;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  color: #fff;
  opacity: 0;
  pointer-events: none;
}
.you {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1em;
  background: #000;
  opacity: 0;
}
.you[hidden] {
  display: none;
}
.you.on {
  opacity: 1;
}
.ylines {
  width: 100%;
  max-width: 70ch;
  max-height: 100%;
  overflow-y: auto;
  scrollbar-width: none;
}
.ylines p {
  margin: 0 0 1em;
  color: #ccc;
  opacity: 0;
}
.ylines p.in {
  opacity: 1;
}
.ylines p::before {
  content: "> ";
  color: #c93;
}
.ylines p.first {
  color: #fff;
  font-weight: bold;
}
.you p.small {
  font-size: 80%;
  color: #888;
}
.yclose {
  position: absolute;
  bottom: 1em;
  left: 50%;
  transform: translateX(-50%);
}

#lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1em;
  background: rgba(0, 0, 0, 0.92);
}
#lightbox[hidden] {
  display: none;
}
#lightbox img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
}
.lb-cap {
  margin-top: 0.75em;
  font-family: monospace;
  color: #fff;
  opacity: 0.7;
}
.tree,
.tree ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.tree ul {
  margin-left: -1ch;
}
.tree li {
  position: relative;
  padding-left: 3ch;
  line-height: 1.7;
}
.tree li::before {
  content: "";
  position: absolute;
  left: 1ch;
  top: 0;
  bottom: 0;
  border-left: 1px solid #444;
}
.tree li:last-child::before {
  bottom: auto;
  height: 0.85em;
}
.tree li::after {
  content: "";
  position: absolute;
  left: 1ch;
  top: 0.85em;
  width: 1.5ch;
  border-top: 1px solid #444;
}
.tree summary {
  list-style: none;
  cursor: pointer;
  color: #fff;
  font-weight: bold;
}
.tree summary::-webkit-details-marker {
  display: none;
}
.tree summary::before {
  content: "[+] ";
  color: #c93;
  font-weight: normal;
}
.tree details[open] > summary::before {
  content: "[-] ";
}
.tree summary::after {
  content: "/";
  color: #666;
}
.tree a[target="_blank"]::after {
  content: " >>";
  color: #666;
}
.tree a:focus,
.tree summary:focus {
  outline: none;
  background: #03c;
  color: #fff;
}
.sbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(80ch, calc(100vw - 2em));
  padding: 0.5em 0;
  border-top: 1px dashed #666;
  display: flex;
  gap: 1ch;
  align-items: center;
  z-index: 5;
}
body:has(.sbar) main {
  padding-bottom: 4em;
}
.sbar input {
  width: 20ch;
  border: 1px solid #666;
  color: #fff;
}
.sbar #st {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
