:root {
  --bg: #0d0d0f;
  --fg: #e6e6e6;
  --muted: #8a8a8a;
  --rule: #262629;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --prose: Charter, "Iowan Old Style", Georgia, Cambria, serif;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.6;
  max-width: 680px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}
a { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--muted); }
a:hover { color: var(--muted); }
::selection { background: var(--fg); color: var(--bg); }

/* motd: Unix login banner on the homepage */
.motd { font-family: var(--mono); font-size: .85rem; line-height: 1.7; color: var(--muted); border: 0; padding: 0; margin: 0 0 1.75rem; white-space: pre-wrap; overflow-x: visible; background: none; }

/* Command echo: index-type pages show the shell command that produced them */
.cmd { color: var(--muted); font-size: .9rem; margin: 0 0 1.5rem; }
.cursor { display: inline-block; width: .55em; height: 1.05em; margin-left: .15em; vertical-align: text-bottom; background: var(--fg); animation: blink 1.1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cursor { animation: none; } }

header { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; align-items: baseline; margin-bottom: 2.5rem; }
header .prompt { color: var(--muted); text-decoration: none; font-weight: 600; }
header nav a { margin-right: 1rem; }
header nav a:last-child { margin-right: 0; }

h1, h2, h3, h4 { font-family: var(--mono); line-height: 1.3; }
h1 { font-size: 1.4rem; margin: 0 0 .25rem; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 2rem 0; }
small, .meta { color: var(--muted); font-size: .85rem; }

/* Home listing (ls-style) */
.listing { margin-top: 1rem; }
.listing h2.year { color: var(--muted); font-size: .9rem; font-weight: 600; margin: 1.5rem 0 .5rem; }
.listing ul { list-style: none; margin: 0; padding: 0; }
.listing li { margin: .15rem 0; }
.listing li a { display: flex; gap: 1rem; text-decoration: none; }
.listing li a:hover .title { text-decoration: underline; }
.listing .date { color: var(--muted); flex: 0 0 4.5rem; }
.listing .lang { color: var(--muted); font-size: .8rem; align-self: center; }

/* Post / page body: readable proportional prose */
.post-body { font-family: var(--prose); font-size: 1.08rem; line-height: 1.75; }
.post-body h1, .post-body h2, .post-body h3 { font-family: var(--mono); margin-top: 2rem; }
.post-body a { text-decoration-color: currentColor; }
.post-body img { max-width: 100%; height: auto; border: 1px solid var(--rule); }
.post-body blockquote { margin: 1.5rem 0; padding-left: 1.5rem; color: var(--muted); }
.post-body blockquote p { position: relative; }
.post-body blockquote p::before { content: ">"; position: absolute; left: -1.5rem; color: var(--muted); font-family: var(--mono); }
.post-body code { font-family: var(--mono); font-size: .9em; }
pre { font-family: var(--mono); overflow-x: auto; padding: 1rem; border: 1px solid var(--rule); background: #0a0a0c; font-size: .85rem; line-height: 1.5; }
pre code { font-size: inherit; }
/* giallo (github-dark) colors the tokens; keep our terminal-black block bg, not giallo's grey */
pre.giallo, pre.z-code { background: #0a0a0c; }

/* Tables (incl. the media log) */
table { border-collapse: collapse; width: 100%; font-size: .9rem; display: block; overflow-x: auto; }
th, td { border-bottom: 1px solid var(--rule); padding: .4rem .6rem; text-align: left; vertical-align: top; }
th { color: var(--muted); font-weight: 600; }

/* Media filter control bar */
.filter { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: 1rem 0; font-size: .85rem; }
.filter input, .filter select { background: #0a0a0c; color: var(--fg); border: 1px solid var(--rule); font-family: var(--mono); padding: .35rem .5rem; }
.filter .rec { display: inline-flex; align-items: center; gap: .3rem; color: var(--muted); cursor: pointer; user-select: none; }
.filter #count { color: var(--muted); margin-left: auto; }

/* Prev/next post navigation */
.post-nav { display: flex; gap: 1.5rem; margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--rule); font-size: .85rem; }
.post-nav .prev { flex: 1; }
.post-nav .next { flex: 1; text-align: right; }
.post-nav a { text-decoration: none; color: var(--muted); }
.post-nav a:hover { color: var(--fg); text-decoration: underline; }

footer { margin-top: 3rem; }
footer .social { display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin: 1rem 0 .75rem; font-size: .85rem; }
footer .social a { color: var(--muted); text-decoration: none; }
footer .social a:hover { color: var(--fg); text-decoration: underline; }
