/* ---- Reset-ish basics ---- */
* { box-sizing: border-box; }

html {
  font-size: 100%;
}

body {
  margin: 0;
  padding: 0;
  background: #fdfdfb;
  color: #1a1a1a;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Georgia, "Iowan Old Style", "Times New Roman", serif;
  font-size: 1.125rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  text-decoration-color: currentColor;
}

/* ---- Layout ---- */
header, main, footer {
  max-width: 42rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-top: 3rem;
  padding-bottom: 2rem;
}

.site-title {
  font-weight: 600;
  font-size: 1.1rem;
  text-decoration: none;
}

header nav a {
  margin-left: 1.25rem;
  font-size: 0.95rem;
  text-decoration: none;
  color: #555;
}

header nav a:first-child {
  margin-left: 0;
}

header nav a:hover {
  color: #1a1a1a;
}

main {
  padding-top: 1rem;
  padding-bottom: 4rem;
  min-height: 60vh;
}

footer {
  padding-top: 2rem;
  padding-bottom: 3rem;
  font-size: 0.85rem;
  color: #888;
}

/* ---- Typography ---- */
h1, h2, h3 {
  line-height: 1.25;
  font-weight: 600;
}

h1 { font-size: 1.75rem; margin-bottom: 0.25rem; }
h2 { font-size: 1.35rem; margin-top: 2rem; }
h3 { font-size: 1.1rem; margin-top: 1.5rem; }

p, ul, ol, blockquote, pre {
  margin-top: 0;
  margin-bottom: 1.25rem;
}

blockquote {
  margin-left: 0;
  padding-left: 1rem;
  border-left: 2px solid #ddd;
  color: #444;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: #f1f0ec;
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

pre {
  background: #f1f0ec;
  padding: 1rem;
  overflow-x: auto;
  border-radius: 4px;
}

pre code {
  background: none;
  padding: 0;
}

img {
  max-width: 100%;
  height: auto;
}

hr {
  border: none;
  border-top: 1px solid #e2e2de;
  margin: 2.5rem 0;
}

/* ---- Homepage post list ---- */
.intro {
  color: #444;
  margin-bottom: 2.5rem;
}

.tag-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.tag-btn {
  font: inherit;
  font-size: 0.85rem;
  background: none;
  border: 1px solid #ddd;
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  color: #555;
  cursor: pointer;
}

.tag-btn:hover {
  border-color: #aaa;
  color: #1a1a1a;
}

.tag-btn.active {
  background: #1a1a1a;
  border-color: #1a1a1a;
  color: #fdfdfb;
}

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

.post-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid #edece7;
}

.post-list li:first-child {
  border-top: 1px solid #edece7;
}

.post-list a {
  text-decoration: none;
  font-weight: 500;
}

.post-list a:hover {
  text-decoration: underline;
}

.post-list time {
  font-size: 0.85rem;
  color: #888;
  white-space: nowrap;
}

/* ---- Post page ---- */
.post-header {
  margin-bottom: 2rem;
}

.post-header time {
  display: block;
  color: #888;
  font-size: 0.9rem;
  margin-top: 0.35rem;
}

.post-tags {
  margin-top: 0.5rem;
  margin-bottom: 0;
  font-size: 0.85rem;
  color: #888;
  text-transform: lowercase;
}

/* ---- Note layout ---- */
.note {
  border-left: 2px solid #ddd;
  padding-left: 1.25rem;
}

.note-meta {
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 0.5rem;
  text-transform: lowercase;
}

.note-title {
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.note-body p:last-child {
  margin-bottom: 0;
}

.post-nav {
  margin-top: 3rem;
  font-size: 0.95rem;
}

.post-nav a {
  text-decoration: none;
  color: #555;
}

.post-nav a:hover {
  color: #1a1a1a;
}

/* ---- Small screens ---- */
@media (max-width: 480px) {
  body { font-size: 1.05rem; }
  header { padding-top: 2rem; }
  h1 { font-size: 1.5rem; }
}
