:root {
  --fg: #222;
  --fg-muted: #666;
  --bg: #fdfdfc;
  --accent: #8b2e2e;
  --rule: #e5e3df;
  --code-bg: #f4f2ee;
  --max-width: 38rem;
}

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

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

body {
  margin: 0;
  padding: 2rem 1.25rem 4rem;
  color: var(--fg);
  background: var(--bg);
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
  line-height: 1.6;
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main, .site-header, .site-footer {
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
}

.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 3rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
}

.site-nav {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9rem;
}
.site-nav a {
  color: var(--fg-muted);
  text-decoration: none;
  margin-left: 1rem;
}
.site-nav a:hover { color: var(--accent); }

.site-title {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.site-title:hover { color: var(--accent); }

.site-footer {
  margin-top: 4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  color: var(--fg-muted);
  font-size: 0.85rem;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}
.site-footer p { margin: 0; }

/* Home: drop the divider so the title and tagline read as one thought */
body.home .site-header {
  border-bottom: none;
  margin-bottom: 0.5rem;
  padding-bottom: 0;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
a:hover { text-decoration-thickness: 2px; }

h1, h2, h3, h4, h5, h6 {
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
  line-height: 1.25;
  margin: 2rem 0 1rem;
  color: var(--fg);
  font-weight: 600;
}

h1 { font-size: 1.7rem; margin-top: 0; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.15rem; }

p, ul, ol, blockquote, pre, table { margin: 0 0 1.1rem; }

ul, ol { padding-left: 1.4rem; }
li { margin: 0.25rem 0; }
li > p { margin: 0.25rem 0; }

blockquote {
  margin-left: 0;
  padding: 0.25rem 0 0.25rem 1rem;
  border-left: 3px solid var(--rule);
  color: var(--fg-muted);
  font-style: italic;
}

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2rem 0;
}

img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

code, kbd, samp {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.9em;
}

p code, li code, h1 code, h2 code, h3 code, a code {
  background: var(--code-bg);
  padding: 0.05em 0.35em;
  border-radius: 3px;
}

pre {
  background: var(--code-bg);
  padding: 0.85rem 1rem;
  border-radius: 4px;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.5;
}

pre code {
  background: transparent;
  padding: 0;
  font-size: inherit;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.95rem;
}
th, td {
  border-bottom: 1px solid var(--rule);
  padding: 0.4rem 0.6rem;
  text-align: left;
}

/* Post list */
.post-list ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.post-list li {
  display: flex;
  gap: 1rem;
  padding: 0.4rem 0;
  align-items: baseline;
}
.post-list time {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--fg-muted);
  font-size: 0.85rem;
  flex-shrink: 0;
  min-width: 6rem;
}
.post-list a {
  color: var(--fg);
  text-decoration: none;
}
.post-list a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* Single post */
.post-header {
  margin-bottom: 2rem;
}
.post-header h1 {
  margin-bottom: 0.4rem;
}
.post-header time {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--fg-muted);
  font-size: 0.85rem;
}

.post-body :first-child { margin-top: 0; }

/* Small screens */
@media (max-width: 480px) {
  html { font-size: 17px; }
  body { padding: 1.25rem 1rem 3rem; }
  .post-list li {
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.5rem 0;
  }
  .post-list time { min-width: 0; }
}

/* Larger screens — stay narrow, this is intentional */
@media (min-width: 1200px) {
  html { font-size: 19px; }
}
