:root {
  --bg: rgb(29, 3, 79);
  --bg-surface: rgba(255, 255, 255, 0.05);
  --text: #e0e0e0;
  --text-bright: #ffffff;
  --text-dim: #999;
  --accent: #b794f6;
  --link: #b794f6;
  --link-hover: #ffffff;
  --border: rgba(255, 255, 255, 0.12);
  --code-bg: rgba(255, 255, 255, 0.08);
}

* { box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Lucida Console", "Courier New", monospace;
  font-size: 14px;
  line-height: 1.7;
  max-width: 42em;
  margin: 3rem auto;
  padding: 0 1.5rem;
}

/* headings */
h1, h2, h3, h4 {
  color: var(--text-bright);
  margin-top: 2em;
  margin-bottom: 0.5em;
  line-height: 1.3;
}

h1 { font-size: 1.6em; margin-top: 0; }
h2 { font-size: 1.2em; border-bottom: 1px solid var(--border); padding-bottom: 0.3em; }
h3 { font-size: 1.05em; }

/* links */
a {
  color: var(--link);
  text-decoration: none;
  font-weight: bold;
}
a:hover, a:focus {
  color: var(--link-hover);
  text-decoration: underline;
}

/* paragraphs */
p { margin: 1em 0; }

/* strong/emphasis */
strong { color: var(--text-bright); }
em { color: var(--text); }

/* lists */
ul, ol { padding-left: 1.5em; }
li { margin: 0.3em 0; }

/* code */
code {
  font-family: "Lucida Console", "Courier New", monospace;
  background: var(--code-bg);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  font-size: 0.9em;
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1em;
  overflow-x: auto;
  line-height: 1.5;
}

pre code {
  background: none;
  padding: 0;
}

/* tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.85em;
}

th, td {
  border: 1px solid var(--border);
  padding: 0.5em 0.8em;
  text-align: left;
}

th {
  background: var(--bg-surface);
  color: var(--text-bright);
  font-weight: bold;
}

tr:nth-child(even) { background: var(--bg-surface); }

/* blockquotes */
blockquote {
  border-left: 3px solid var(--accent);
  margin: 1.5em 0;
  padding: 0.5em 1em;
  color: var(--text-dim);
}

/* images / figures */
img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 1em 0;
  background: #ffffff;
  padding: 0.5em;
}

/* figure captions (italics after images) */
p > img + em {
  display: block;
  color: var(--text-dim);
  font-size: 0.85em;
  margin-top: -0.5em;
  margin-bottom: 1.5em;
}

/* horizontal rules */
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2em 0;
}

/* tl;dr */
p > strong:first-child {
  color: var(--accent);
}

/* footer */
footer, body > p:last-child {
  color: var(--text-dim);
  font-size: 0.85em;
  margin-top: 3em;
  padding-top: 1em;
  border-top: 1px solid var(--border);
}

/* responsive */
@media (max-width: 600px) {
  body {
    font-size: 14px;
    margin: 1.5rem auto;
  }
  h1 { font-size: 1.3em; }
  table { font-size: 0.8em; }
}

/* print */
@media print {
  body {
    background: white;
    color: black;
    max-width: none;
  }
  a { color: black; }
  img { background: none; padding: 0; }
}

/* === Apache autoindex (directory listings) === */
/* Hide icons column */
td:first-child, th:first-child { display: none; }
/* Hide separator rows */
tr:has(> th > hr), tr:has(> td > hr) { display: none; }
/* Size column right-aligned */
td:nth-child(4) { text-align: right; font-variant-numeric: tabular-nums; }
/* Date column dim */
td:nth-child(3) { color: var(--text-dim); }
