:root {
  --background-body: #1A1A1A;
  --background: #2E2E2E;
  --selection: #C02020;
  --text-main: #C5C5BE;
  --text-bright: #F0F0E5;
  --text-muted: #8A8A8A;
  --links: #DA1;
}

body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  max-width: 70ch;
  margin: auto;
  padding: 2ch;
  word-wrap: break-word;
  color: var(--text-main);
  background: var(--background-body);
  text-rendering: optimizeLegibility;
}

main { display: flow-root; }

h1, h2, h3, h4, h5, h6 {
  color: var(--text-bright);
  font-weight: 600;
  margin: 1.5em 0 0.5em;
}
h1 { font-size: 2.2em; margin-top: 0; }
h2 { font-size: 1.65em; }
h3 { font-size: 1.35em; }
h4 { font-size: 1.15em; }
h5 { font-size: 1em; }

strong, b { color: var(--text-bright); }

p, ul, ol { margin-bottom: 1em; }
ul, ol { padding-left: 2em; }
li { margin-bottom: 0.25em; }

a { color: var(--links); text-decoration: none; }
a:hover { text-decoration: underline; }

code, time {
  background: var(--background);
  color: var(--text-bright);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
}

pre {
  background: var(--background);
  border-radius: 6px;
  padding: 1em;
  overflow-x: auto;
  line-height: 1.6;
}

blockquote {
  border-left: 4px solid var(--links);
  margin: 1.5em 0;
  padding: 0.5em 1em;
  font-style: italic;
}
blockquote footer,
blockquote cite { font-style: normal; }

hr {
  border: none;
  border-top: 1px solid var(--text-muted);
  margin: 2em 0;
}

table {
  border-collapse: collapse;
  width: 100%;
  margin-bottom: 1em;
}
th, td {
  border: 1px solid var(--text-muted);
  padding: 0.5em;
  text-align: left;
  vertical-align: top;
}
th {
  font-weight: 600;
  background: var(--background);
  color: var(--text-bright);
}
thead { border-bottom: 2px solid var(--text-muted); }


mark {
  background: var(--links);
  border-radius: 2px;
  padding: 0 0.2em;
  color: var(--background-body);
}

img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

details {
  background: var(--background);
  border-radius: 6px;
  padding: 0.5em 1em;
  margin: 1em 0;
}
summary { cursor: pointer; font-weight: 600; }
summary:hover { text-decoration: underline; }

footer {
  border-top: 1px solid var(--text-muted);
  padding-top: 0.5em;
  color: var(--text-muted);
  font-size: 0.9em;
}
body > footer { margin-top: 2em; }

::selection {
  background: var(--selection);
  color: var(--text-bright);
}

@media print {
  body { background: #fff; color: #000; max-width: none; }
  h1, h2, h3, h4, h5, h6, strong { color: #000; }
  a { color: #000; text-decoration: underline; }
  code, pre { background: #f5f5f5; }
  ::selection { background: highlight; color: highlighttext; }
}
