:root {
  --bg: #111;
  --fg: #ccc;
  --bright: #eee;
  --dim: #6b6b6b;
  --green: #8ec07c;
  --amber: #e5c07b;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}

html {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 17px;
  line-height: 1.65;
}

body {
  max-width: 76ch;
  margin: 0 auto;
  padding: 24px 16px;
}

::selection {
  background: var(--green);
  color: var(--bg);
}

h1,
h2,
h3,
h4,
h5 {
  color: var(--bright);
  font-size: 1em;
  margin: 2em 0 0.6em;
}

h1 {
  font-size: 1.35em;
}

h1::before { content: "# "; color: var(--green); }
h2::before { content: "## "; color: var(--green); }
h3::before { content: "### "; color: var(--green); }

b,
strong {
  color: #fff;
}

a {
  color: var(--bright);
  text-decoration: underline dotted var(--dim);
  text-underline-offset: 3px;
}

a:hover,
a:focus-visible {
  color: var(--bg);
  background: var(--green);
  text-decoration: none;
  outline: none;
}

header {
  border-bottom: 1px dotted var(--dim);
  padding-bottom: 12px;
}

.prompt {
  text-decoration: none;
  font-size: 1.15em;
}

.prompt:hover,
.prompt:focus-visible {
  background: none;
  color: var(--bright);
}

.user,
.host { color: var(--green); }
.path { color: var(--amber); }

.cursor {
  display: inline-block;
  width: 0.6em;
  height: 1.1em;
  vertical-align: text-bottom;
  background: var(--green);
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .cursor { animation: none; }
}

header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 8px;
}

header nav a::before { content: "["; color: var(--dim); }
header nav a::after { content: "]"; color: var(--dim); }
header nav a { text-decoration: none; }

main > h1:first-child {
  margin-top: 1.2em;
}

.ls {
  list-style: none;
  padding: 0;
}

.ls li {
  display: flex;
  gap: 2ch;
}

time,
.meta {
  color: var(--dim);
  white-space: nowrap;
}

.tag {
  color: var(--amber);
  margin-left: 1ch;
}

.tag::before { content: "#"; }

blockquote {
  margin: 1em 0;
  padding-left: 2ch;
  border-left: 1px dotted var(--green);
  color: #aaa;
}

pre {
  overflow-x: auto;
}

code {
  color: var(--amber);
}

pre code {
  color: inherit;
}

img {
  max-width: 100%;
}

hr {
  border: 0;
  border-top: 1px dotted var(--dim);
}

.post {
  display: flex;
  flex-direction: column;
}

figure {
  align-self: center;
  text-align: center;
  font-style: italic;
}

#prev-next {
  display: flex;
  justify-content: space-between;
  gap: 2ch;
  margin-top: 40px;
}

.block {
  border: 1px dotted var(--fg);
  padding: 5px 15px;
  margin: 1em 0;
}

.block h1 {
  font-size: 1em;
  margin: 0.5em 0 0;
}

.small {
  font-size: 0.8em;
}

footer {
  margin-top: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--dim);
}

footer pre {
  border: 0;
  margin: 0;
}

.man-bar {
  display: flex;
  justify-content: space-between;
  gap: 2ch;
  color: var(--dim);
  margin: 1.5em 0;
}

.man h1,
.man h2 {
  font-size: 1em;
  margin: 1.6em 0 0.4em;
}

.man h1::before,
.man h2::before {
  content: none;
}

.man > div > :not(h1) {
  margin-left: 4ch;
}

.man h2 {
  color: var(--green);
  margin-top: 1em;
}

.man h2 a {
  color: inherit;
}

.man h2 + p {
  margin-top: 0;
  margin-left: 8ch;
}

@media (max-width: 480px) {
  .man > div > :not(h1) { margin-left: 2ch; }
  .man h2 + p { margin-left: 4ch; }
  .man-bar span:nth-child(2) { display: none; }
}
