:root {
  color-scheme: dark;
  --black: #000;
  --white: #fff;
  --cyan: #00aaaa;
  --bright-cyan: #55ffff;
  --blue: #0000aa;
  --bright-blue: #1717d1;
  --gray: #aaaaaa;
  --dark-gray: #222;
  --yellow: #ffff55;
  --shell: 48rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  background: var(--black);
  color: var(--white);
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--black);
  font-size: 13px;
  line-height: 1.45;
}

a {
  color: inherit;
  font-weight: 700;
  text-decoration: none;
}

a:hover { text-decoration: underline; }

a:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 2px;
}

.shell {
  width: min(calc(100% - 1rem), var(--shell));
  margin-inline: auto;
}

.site-header {
  padding: 0.4rem 0;
  text-align: center;
}

nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 0.8rem;
}

.masthead {
  padding: 3rem 0 2.4rem;
  overflow-x: auto;
  color: var(--bright-cyan);
  text-align: center;
}

.masthead pre {
  width: max-content;
  min-width: 100%;
  margin: 0;
  color: var(--white);
  font: inherit;
  line-height: 1.15;
  text-align: left;
}

.masthead p { margin: 1.2rem 0 0; }

.frame {
  border: 1px solid #555;
  background: var(--dark-gray);
}

.status-bar,
.sub-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  padding: 0.3rem 0.45rem;
}

.status-bar {
  color: var(--bright-cyan);
  border-bottom: 1px solid #555;
}

.bar {
  margin: 0;
  padding: 0.3rem 0.45rem;
  background: var(--cyan);
  color: var(--black);
  font: inherit;
  text-align: left;
}

.sub-bar {
  background: var(--gray);
  color: var(--black);
  border-bottom: 1px solid var(--black);
}

.post-index {
  width: 100%;
  border-collapse: collapse;
}

.post-index th,
.post-index td {
  padding: 0.45rem 0.55rem;
  border-bottom: 1px solid #555;
  text-align: left;
  vertical-align: top;
}

.post-index th {
  background: var(--gray);
  color: var(--black);
}

.post-index tbody tr:nth-child(odd) { background: var(--blue); }
.post-index tbody tr:nth-child(even) { background: var(--bright-blue); }
.post-index tbody tr:hover { background: var(--black); color: var(--bright-cyan); }
.post-index td:first-child { width: 3.5rem; }
.post-index td:last-child { width: 12rem; text-align: right; white-space: nowrap; }
.post-index td span { display: block; margin-top: 0.2rem; color: var(--gray); font-size: 11px; font-weight: 400; }

.terminal-note {
  margin: 1rem 0 3rem;
  padding: 0.75rem;
  border: 1px solid #555;
  color: var(--gray);
}

.terminal-note p { margin: 0; }
.terminal-note p:first-child { color: var(--bright-cyan); }

.post,
.page,
.not-found { margin: 2.5rem 0 3rem; }

.article-body,
.page,
.not-found {
  padding: 1.5rem 2rem 2.5rem;
  background: var(--white);
  color: var(--black);
}

.abstract {
  margin: 0 0 2rem;
  padding: 0.8rem;
  border: 1px solid var(--black);
}

.prose { font-size: 14px; }
.prose h1 { margin: 0 0 1.5rem; font-size: 1.4rem; }
.prose h2 { margin: 2.5rem 0 0.8rem; font-size: 1rem; }
.prose h2::before { content: "--[ "; }
.prose h3 { margin-top: 2rem; font-size: 0.95rem; }
.prose h3::before { content: "---[ "; }
.prose p { max-width: 74ch; }
.prose a { text-decoration: underline; }
.prose code { font-family: inherit; }
.prose :not(pre) > code { padding: 0.1em 0.25em; background: #ddd; }
.prose pre {
  overflow-x: auto;
  margin: 1.25rem -0.5rem;
  padding: 1rem;
  border: 1px solid var(--black);
  background: var(--black);
  color: var(--white);
}

.not-found h1 { font-size: 1.3rem; }
.not-found a { text-decoration: underline; }

footer {
  padding: 0.8rem 0 2rem;
  border-top: 1px solid #555;
  color: var(--gray);
  font-size: 11px;
  text-align: center;
}

footer p { margin: 0.4rem 0; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 40rem) {
  body { font-size: 12px; }
  .masthead { padding-top: 2rem; }
  .masthead pre { font-size: 9px; }
  .post-index th:first-child, .post-index td:first-child { display: none; }
  .post-index th:last-child, .post-index td:last-child { width: auto; white-space: normal; }
  .article-body, .page, .not-found { padding: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
