html, body {
  font-family: monospace;
  font-size: 16px;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  color: #e0e0e0;
  background-color: #111;
}

.container {
  max-width: 650px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

a {
  color: #66b0ff;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: #ffffff;
}

p {
  margin: 1rem 0;
}

/* Content list styling */
.content ul,
.content ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.content li {
  margin: 0.25rem 0;
}

/* Profile styling */
.profile {
  display: flex;
  align-items: center;
  margin-bottom: 2rem;
}

.profile img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  margin-right: 1rem;
}

/* Navigation styling */
.nav {
  margin: 2rem 0;
}

.nav ul {
  list-style-type: none;
  padding: 0;
}

.nav li {
  margin: 0.5rem 0;
}

/* Posts styling */
.posts li {
  margin: 0.5rem 0;
}

.post-date {
  font-size: 0.9rem;
  color: #999;
}

/* Footer styling */
.footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid #333;
  font-size: 0.9rem;
  opacity: 0.7;
}

/* Inline navigation */
.nav-inline {
  display: flex;
  list-style-type: none;
  padding: 0;
  margin: 1.5rem 0;
  flex-wrap: wrap;
}

.nav-inline li {
  margin-right: 1.5rem;
  margin-bottom: 0.5rem;
}

.nav-inline li:last-child {
  margin-right: 0;
}

/* Table styling */
table {
  width: 100%;
  margin: 1.5rem 0;
  border-collapse: collapse;
  border: 1px solid #333;
}

th, td {
  padding: 0.5rem;
  border: 1px solid #333;
}

th {
  background-color: #222;
}

tr:nth-child(even) {
  background-color: #1a1a1a;
}

/* Blockquote styling */
blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  border-left: 4px solid #66b0ff;
  background-color: #222;
  font-style: italic;
}

blockquote p:first-child {
  margin-top: 0;
}

blockquote p:last-child {
  margin-bottom: 0;
}

/* Horizontal rule styling */
hr {
  border: none;
  height: 1px;
  background-color: #333;
  margin: 2rem 0;
}

/* Task list styling */
.task-list {
  list-style-type: none !important;
  padding-left: 0 !important;
  margin-left: 0 !important;
}

li.task-list-item {
  list-style-type: none !important;
  padding-left: 0 !important;
  margin-left: 0 !important;
  position: relative;
}

.task-list-item input[type="checkbox"] {
  margin-right: 0.5rem;
}

/* Additional fixes for task lists */
ul li input[type="checkbox"] {
  margin-right: 0.5rem;
}

/* Remove default bullets from task lists */
ul li.task-list-item {
  list-style-type: none !important;
  margin-left: -1.5rem;
}

/* Show task list checkboxes */
ul li.task-list-item input[type="checkbox"] {
  margin-right: 0.5rem;
}

/* Footnote styling */
.footnotes {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid #333;
  font-size: 0.9rem;
}

.footnotes ol {
  padding-left: 1.5rem;
}

.footnotes li {
  margin-bottom: 0.5rem;
}

a.footnote-ref, sup[id^="fnref"] {
  font-size: 0.7em;
  vertical-align: super;
  line-height: 0;
  text-decoration: none;
}

a.footnote-backref, a[href^="#fnref"] {
  font-size: 0.8em;
  text-decoration: none;
}

/* Fix footnotes */
.footnote-ref {
  font-size: 0.75em;
  vertical-align: super;
  line-height: 0;
}

.footnotes {
  margin-top: 2rem;
  border-top: 1px solid #333;
  padding-top: 1rem;
}

.footnotes hr {
  display: none;
}

/* Image styling */
img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.5rem 0;
  border-radius: 4px;
}

.profile img {
  display: inline-block;
  width: 100px;
  height: 100px;
  max-width: none;
  margin: 0;
  margin-right: 1rem;
}

figure {
  margin: 1.5rem 0;
  text-align: center;
}

figure img {
  margin: 0 auto;
}

figcaption {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: #999;
  font-style: italic;
}

/* Table of Contents styling */
.toc {
  background-color: #222;
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  border-radius: 4px;
}

.toc h2 {
  margin-top: 0;
  font-size: 1.2rem;
}

#TableOfContents ul {
  padding-left: 1.5rem;
}

#TableOfContents li {
  margin: 0.25rem 0;
}

/* Emoji styling - ensure good vertical alignment */
.emoji {
  vertical-align: -0.1em;
}

/* Code block background override */
.highlight {
  background-color: #222 !important;
  overflow-x: auto !important; /* Add overflow to parent container */
  max-width: 100% !important;
}

.highlight pre {
  background-color: #222 !important;
  border: none !important; /* Remove border from nested pre */
  white-space: pre !important; /* Preserve whitespace and line breaks */
  word-wrap: normal !important; /* Don't wrap code */
  overflow-x: visible !important; /* Let parent handle scrolling */
  max-width: none !important; /* Allow content to be wider than container */
}

div.highlight, pre.chroma {
  background-color: #222 !important;
  border-radius: 4px;
  padding: 1rem;
  margin: 1.5rem 0;
  border: 1px solid #333;
  overflow-x: auto !important; /* Ensure horizontal scrolling */
  max-width: 100%;
}

/* Target all descendants of .highlight */
.highlight * {
  background-color: transparent !important;
}

/* Code styling */
pre, code {
  font-family: monospace;
  border-radius: 3px;
}

code {
  padding: 0.2rem 0.4rem;
  background-color: #222;
}

/* Style pre tags that are NOT inside a highlight div */
pre:not(.highlight pre) {
  padding: 1rem;
  overflow-x: auto !important; /* Critical for horizontal scrolling */
  background-color: #222 !important;
  border-radius: 4px;
  margin: 1.5rem 0;
  border: 1px solid #333;
  white-space: pre !important; /* Prevent wrapping */
}

pre code {
  padding: 0;
  background: transparent !important;
  border: none;
  word-wrap: normal !important; /* Prevent wrapping */
  white-space: pre !important; /* Preserve whitespace and line breaks */
}

/* Code block font size - ADD THIS HERE */
.highlight pre, pre.chroma, pre code {
  font-size: 13px !important; /* Smaller than the main 16px font */
}

/* Keep inline code slightly closer to text size but still smaller */
p code, li code, h1 code, h2 code, h3 code, h4 code, h5 code, h6 code, 
table code, blockquote code {
  font-size: 0.9em !important; /* Relative to parent element */
}

/* For inline code */
p code, li code, h1 code, h2 code, h3 code, h4 code, h5 code, h6 code, 
table code, blockquote code {
  background-color: #222 !important;
  color: #e0e0e0;
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-size: 0.9em;
  white-space: normal !important; /* Allow inline code to wrap */
}
/* ---- site: nav, posts, home sections ---- */
.page-header .nav-inline { margin: 0 0 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid #333; }

.posts, .content .posts { list-style: none; padding: 0; margin: 0.5rem 0 0; }
.posts li { display: flex; gap: 1rem; }
.posts .post-date { flex: 0 0 7em; white-space: nowrap; }
a:visited { color: #b48ead; }
.statusline a:visited { color: inherit; }

.post-title { margin-bottom: 0.25rem; }
.post .post-date { margin-top: 0; }
.cite { color: #999; }
.cite:hover { color: #66b0ff; }
.cite-missing { color: #ff6b6b; }
.math.display { display: block; margin: 1rem 0; overflow-x: auto; }

.sec { margin: 0 0 1.5rem; }
.sec-posts { margin: -0.5rem 0 2.5rem; }
header > h1 { margin: 0 0 0.5rem; }
.tagline { margin: 0; }
.sec-title { margin: 0 0 0.5rem; font-size: 1rem; }
.strip { margin: 0; font-size: 0.9rem; line-height: 1.8; }
.strip a { margin-right: 1rem; }
.thought { margin: 0; font-style: italic; color: #999; }
.sec-stream { margin-top: 2rem; }
.sec-stream .sec-title { display: none; }

/* ---- footer: sticky, source path left, links right ---- */
body { padding-bottom: 3rem; }
.statusline {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  box-sizing: border-box; max-width: 650px; margin: 0 auto; padding: 0.6rem 1rem;
  display: flex; align-items: baseline; gap: 1.25rem;
  background: #111; border-top: 1px solid #333;
  font-size: 0.9rem; color: #999; white-space: nowrap; overflow: hidden;
}
.statusline .buf { color: #e0e0e0; overflow: hidden; text-overflow: ellipsis; }
.statusline .spacer { flex: 1; }
.statusline .links { display: flex; gap: 1rem; }
.statusline a { color: #999; }
.statusline a:hover { color: #66b0ff; text-decoration: none; }
.statusline .meta { color: #666; }
@media (max-width: 600px) { .statusline .meta { display: none; } }

/* ---- stream rail (home): minimap of the notes, one mark per dated entry ---- */
.sec-stream { position: relative; }
.sec-stream .stream > h1:first-child { margin-top: 0; }
.rail-track { display: none; position: absolute; right: -48px; top: 1.2rem; bottom: 0; width: 20px; }
@media (min-width: 820px) { .rail-track { display: block; } }
.rail { position: sticky; top: 2rem; height: calc(100vh - 6rem); width: 20px; z-index: 5; }
.rail .tick { position: absolute; right: 0; height: 1px; width: 8px; background: #2c2c2c; transition: width 0.1s, background 0.1s; }
.rail .tick.year { width: 14px; background: #444; }
.rail .tick:hover { width: 14px; background: #888; }
.rail .tick.active { width: 14px; background: #66b0ff; opacity: 0.8; }
.rail-tip {
  position: absolute; right: 26px; transform: translateY(-40%);
  max-width: 260px; padding: 0.3rem 0.55rem; border-radius: 3px;
  background: #1a1a1a; border: 1px solid #2c2c2c; color: #aaa; font-size: 0.75rem; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none;
}
@media (prefers-reduced-motion: reduce) { .rail, .rail .tick { transition: none; } }
