/* ==========================================================================
   90s Weblog Stylesheet (Modernized)
   ========================================================================== */

:root {
  --bg: #f8f6f0;
  --text: #1a1917;
  --text-muted: #5c584f;
  --link: #0b4f8c;
  --link-visited: #5a3272;
  --link-hover: #9c2718;
  --border: #d3cec4;
  --border-strong: #1a1917;
  --code-bg: #ece8dc;
  --code-border: #0b4f8c;
  --quote-bg: #f0ece0;
  --table-stripe: #f1eddf;
  --font-mono: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Monaco, Consolas, "Courier New", monospace;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", "Charter", "Bitstream Charter", "Georgia", serif;
  --content-max-width: 68ch;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141413;
    --text: #e6e3dc;
    --text-muted: #9e9a8f;
    --link: #62a0ea;
    --link-visited: #b388ff;
    --link-hover: #ff7b72;
    --border: #33312c;
    --border-strong: #e6e3dc;
    --code-bg: #1f1e1b;
    --code-border: #62a0ea;
    --quote-bg: #1a1917;
    --table-stripe: #1c1b18;
  }
}

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

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  background-color: var(--bg);
  color: var(--text);
}

body {
  margin: 0;
  padding: 2.5rem 1.25rem 4rem;
  font-family: var(--font-body);
  font-size: clamp(1.0625rem, 0.98rem + 0.35vw, 1.2rem);
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
  text-align: left;
}

.container {
  max-width: var(--content-max-width);
  margin-left: 0;
  margin-right: auto;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-mono);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
  text-align: left;
  letter-spacing: -0.015em;
  margin-top: 2.2rem;
  margin-bottom: 0.8rem;
}

h1 {
  font-size: clamp(1.75rem, 1.5rem + 1vw, 2.35rem);
  margin-top: 0;
  margin-bottom: 0.3rem;
  border-bottom: 2px solid var(--border-strong);
  padding-bottom: 0.4rem;
}

h2 {
  font-size: clamp(1.35rem, 1.2rem + 0.6vw, 1.65rem);
  border-bottom: 1px dashed var(--border);
  padding-bottom: 0.25rem;
}

h3 {
  font-size: clamp(1.15rem, 1.05rem + 0.4vw, 1.35rem);
}

p {
  margin-top: 0;
  margin-bottom: 1.3rem;
  text-align: left;
}


/* Links */
a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

a:visited {
  color: var(--link-visited);
}

a:hover, a:focus {
  color: var(--link-hover);
  text-decoration-thickness: 2px;
}

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

/* Rules / Dividers */
hr {
  border: 0;
  border-top: 2px solid var(--border);
  margin: 2.2rem 0;
  text-align: left;
}

/* Navigation / Header / Back links */
.nav-link {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  display: inline-block;
  text-decoration: none;
}

.nav-link:hover {
  text-decoration: underline;
}

.meta {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.8rem;
  letter-spacing: 0.02em;
}

/* Post list on Index */
.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.post-item {
  margin-bottom: 1.6rem;
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 1.2rem;
  align-items: baseline;
}

.post-date {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.post-content {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.post-title {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1.35;
}

.post-desc {
  font-size: 0.98rem;
  color: var(--text-muted);
  margin: 0;
}

/* Code Blocks & Inline Code */
code, kbd, samp {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background-color: var(--code-bg);
  padding: 0.15em 0.35em;
  border-radius: 2px;
  border: 1px solid var(--border);
}

pre {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.5;
  background-color: var(--code-bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--code-border);
  padding: 1rem 1.2rem;
  overflow-x: auto;
  margin: 1.6rem 0;
  tab-size: 2;
  -webkit-overflow-scrolling: touch;
}

pre code {
  background-color: transparent;
  padding: 0;
  border: none;
  font-size: inherit;
  color: inherit;
  white-space: pre;
}

/* Blockquote */
blockquote {
  margin: 1.6rem 0;
  padding: 0.6rem 1.2rem;
  border-left: 3px solid var(--border-strong);
  background-color: var(--quote-bg);
  font-style: normal;
}

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

/* Lists */
ul, ol {
  padding-left: 1.5rem;
  margin: 1.3rem 0;
}

li {
  margin-bottom: 0.4rem;
}

li::marker {
  color: var(--text-muted);
}

/* Tables */
.table-wrapper {
  overflow-x: auto;
  margin: 1.6rem 0;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  text-align: left;
  border: 1px solid var(--border-strong);
}

th, td {
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  background-color: var(--quote-bg);
  font-weight: 700;
  border-bottom: 2px solid var(--border-strong);
}

tr:nth-child(even) td {
  background-color: var(--table-stripe);
}

/* Figures & Images */
figure {
  margin: 1.8rem 0;
}

figure img {
  max-width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--border-strong);
}

figcaption {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  text-align: left;
}

/* Footnotes */
.footnotes {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px dashed var(--border);
  font-size: 0.92rem;
}

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

.footnote-backref {
  font-family: var(--font-mono);
  text-decoration: none;
  font-weight: bold;
}

/* Footer */
footer {
  margin-top: 3.5rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Mobile Responsive Adjustments */
@media (max-width: 640px) {
  body {
    padding: 1.5rem 1rem 3rem;
  }

  .post-item {
    grid-template-columns: 1fr;
    gap: 0.15rem;
    margin-bottom: 1.4rem;
  }

  .post-date {
    font-size: 0.82rem;
  }
}

.tagline {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  margin-bottom: 1.8rem;
}

.blurb {
  font-size: 1.08em;
  margin-bottom: 2rem;
}
