:root {
  --bg: #000;
  --bar: #000;
  --line: #2b2140;
  --fg: #e6dff7;
  --dim: #9a89c2;
  --user: #b48cff;
  --host: #d2b6ff;
  --cwd: #9d9cff;
  --accent: #c9a6ff;
  --link: #b48cff;
  --error: #f25c5c;
  --code-bg: #0d0916;
  --char: 28ms;
  --mono: "JetBrains Mono", "Cascadia Code", "Fira Code", "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", "Liberation Mono", monospace;
  color-scheme: dark;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.65 var(--mono);
  font-variant-ligatures: none;
}

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

a { color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--host); }
a:focus-visible { outline: 2px solid var(--host); outline-offset: 2px; }

.skip {
  position: absolute;
  left: 8px;
  top: -48px;
  padding: 6px 10px;
  background: var(--accent);
  color: var(--bg);
  z-index: 20;
}
.skip:focus { top: 8px; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.dim { color: var(--dim); }

/* tmux-style bar */

.statusbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 4px;
  padding: 3px 12px;
  background: var(--bar);
  border-bottom: 1px solid var(--line);
  color: var(--dim);
  font-size: 13px;
}

.statusbar a {
  color: inherit;
  padding: 0 6px;
  text-decoration: none;
}

.statusbar a:hover { color: var(--fg); }
.statusbar a[aria-current="page"] { background: var(--user); color: var(--bg); font-weight: 700; }
.statusbar a[aria-current="page"]::after { content: "*"; }
.statusbar a:focus-visible { outline: 2px solid var(--host); outline-offset: -2px; }

.session { color: var(--user); font-weight: 700; margin-right: 4px; }
.clock { margin-left: auto; }

.screen {
  max-width: 920px;
  margin: 0 auto;
  padding: clamp(20px, 5vw, 48px) clamp(16px, 4vw, 32px) 24px;
  animation: power-on .5s ease-out both;
}

/* prompt + typing */

.prompt {
  margin: 0;
  overflow-wrap: anywhere;
}

.ps1 { white-space: nowrap; }
.ps1-user { color: var(--user); font-weight: 700; }
.ps1-at, .ps1-sep { color: var(--dim); }
.ps1-host { color: var(--host); font-weight: 700; }
.ps1-cwd { color: var(--cwd); }
.ps1-sym { color: var(--dim); margin-left: 6px; }

.cmd {
  display: inline-block;
  vertical-align: bottom;
  max-width: 100%;
  width: calc(var(--chars) * 1ch);
  overflow: hidden;
  white-space: nowrap;
  color: var(--fg);
}

.step { margin-bottom: 26px; }

.step,
.idle { animation: appear 1ms var(--at, 0ms) both; }

.step .cmd {
  animation: type calc(var(--chars) * var(--char)) steps(var(--chars), end) var(--at) both;
}

.out,
.reveal {
  margin-top: 8px;
  animation: reveal .35s ease-out calc(var(--at) + var(--chars, 0) * var(--char) + 80ms) both;
}

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

@keyframes type { from { width: 0; } }
@keyframes appear { from { visibility: hidden; } to { visibility: visible; } }
@keyframes reveal { from { opacity: 0; transform: translateY(4px); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes power-on {
  from { opacity: 0; }
}

/* output blocks */

.out > :first-child { margin-top: 0; }
.out > :last-child { margin-bottom: 0; }
.out p { margin: 0 0 10px; max-width: 72ch; }

.name {
  margin: 0;
  color: var(--accent);
  font-size: clamp(26px, 6vw, 40px);
  line-height: 1.15;
  letter-spacing: -.01em;
}

.role { color: var(--dim); }

.ls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(20ch, 1fr));
  gap: 2px 16px;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}

.dir { color: var(--cwd); font-weight: 700; }

.ls-long {
  border-collapse: collapse;
  width: 100%;
}

.ls-long caption { text-align: left; }
.ls-long td { padding: 2px 16px 2px 0; vertical-align: top; }
.ls-long td:last-child { padding-right: 0; }
.ls-long td:not(.summary) { white-space: nowrap; }
.summary { color: var(--dim); }

.status::before { content: "\25CF  "; }
.status-active { color: var(--user); }
.status-paused { color: var(--host); }
.status-archived { color: var(--dim); }

.post-list {
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}

.post-list li {
  display: grid;
  grid-template-columns: 11ch 1fr;
  gap: 0 16px;
  padding: 2px 0;
}

.post-list time { color: var(--dim); }
.post-list .excerpt { grid-column: 2; color: var(--dim); }

.kv {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 2px 16px;
  margin: 0;
}

.kv dt { color: var(--host); }
.kv dd { margin: 0; overflow-wrap: anywhere; }

.error { color: var(--error); }

/* blog post */

.post { max-width: 72ch; margin-bottom: 30px; }

.post-header {
  border-bottom: 1px dashed var(--line);
  padding-bottom: 14px;
  margin-bottom: 22px;
}

.post-header h1 {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: clamp(22px, 5vw, 30px);
  line-height: 1.25;
}

.meta { margin: 0; color: var(--dim); font-size: 13px; }
.tag { color: var(--cwd); }

.prose h2,
.prose h3,
.prose h4 {
  margin: 1.8em 0 .6em;
  color: var(--host);
  font-size: 1em;
  line-height: 1.4;
}

.prose h2::before { content: "## "; color: var(--dim); }
.prose h3::before { content: "### "; color: var(--dim); }
.prose h4::before { content: "#### "; color: var(--dim); }

.prose p,
.prose ul,
.prose ol { margin: 0 0 1.1em; }

.prose ul { list-style: none; padding-left: 2ch; }
.prose ul > li::before { content: "- "; margin-left: -2ch; color: var(--dim); }
.prose ol { padding-left: 3ch; }
.prose li::marker { color: var(--dim); }

.prose code {
  padding: 1px 5px;
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: .92em;
}

.prose pre {
  margin: 0 0 1.2em;
  padding: 14px 16px;
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow-x: auto;
  line-height: 1.5;
}

.prose pre code { padding: 0; background: none; border: 0; font-size: .9em; }

.prose blockquote {
  margin: 0 0 1.2em;
  padding-left: 14px;
  border-left: 3px solid var(--accent);
  color: var(--dim);
}

.prose img { display: block; max-width: 100%; height: auto; border-radius: 6px; }

.prose hr { border: 0; border-top: 1px dashed var(--line); margin: 2em 0; }

.prose table { width: 100%; border-collapse: collapse; margin: 0 0 1.2em; display: block; overflow-x: auto; }
.prose th, .prose td { padding: 4px 12px; border: 1px solid var(--line); text-align: left; }
.prose th { color: var(--host); }

.post-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 20px;
  margin-top: 34px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

/* footer */

.footnote {
  max-width: 920px;
  margin: 0 auto;
  padding: 16px clamp(16px, 4vw, 32px) 28px;
  border-top: 1px dashed var(--line);
  color: var(--dim);
  font-size: 12px;
  text-align: center;
}

.footnote p { margin: 0; }

@media (max-width: 640px) {
  body { font-size: 14px; }
  .clock { display: none; }
  .ls-long, .ls-long tbody, .ls-long tr, .ls-long td { display: block; }
  .ls-long caption { display: block; }
  .ls-long tr { display: grid; grid-template-columns: auto auto 1fr; gap: 0 12px; padding: 4px 0; }
  .ls-long td { padding: 0; }
  .ls-long .summary { grid-column: 1 / -1; }
  .post-list li { grid-template-columns: 1fr; }
  .post-list .excerpt { grid-column: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
