:root {
  --bg: #fafaf7;
  --fg: #22252a;
  --muted: #6b7078;
  --accent: #2f6f5e;
  --line: #e4e3dc;
  --code-bg: #f0efe8;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17191c;
    --fg: #e6e6e1;
    --muted: #9a9fa6;
    --accent: #6fc2a9;
    --line: #2b2f34;
    --code-bg: #20242a;
  }
}
* { box-sizing: border-box; }
html { font-size: 17px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.7;
}
a { color: var(--accent); text-decoration: none; border-bottom: 1px solid transparent; }
a:hover { border-bottom-color: var(--accent); }
header.site {
  border-bottom: 1px solid var(--line);
  padding: 1.4rem 1rem;
}
.wrap { max-width: 42rem; margin: 0 auto; padding: 0 1rem; }
header.site .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .6rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: .7rem;
  font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--fg);
}
.brand img { width: 38px; height: 38px; border-radius: 50%; }
nav a {
  margin-left: 1.2rem;
  font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: .92rem;
  color: var(--muted);
}
nav a.active, nav a:hover { color: var(--fg); }
main { padding: 2.2rem 0 3rem; }
h1, h2, h3 {
  font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.25;
  letter-spacing: -.01em;
}
h1 { font-size: 1.9rem; margin: 0 0 .4rem; }
h2 { font-size: 1.35rem; margin: 2.2rem 0 .6rem; }
.meta {
  color: var(--muted);
  font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: .85rem;
  margin-bottom: 1.6rem;
}
.post-list { list-style: none; margin: 0; padding: 0; }
.post-list li { padding: 1.3rem 0; border-bottom: 1px solid var(--line); }
.post-list li:last-child { border-bottom: none; }
.post-list h2 { margin: 0 0 .25rem; font-size: 1.25rem; }
.post-list p { margin: .4rem 0 0; color: var(--muted); }
.tag {
  display: inline-block;
  font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--accent);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: .05rem .4rem;
  margin-right: .4rem;
}
pre, code {
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  background: var(--code-bg);
  font-size: .86rem;
}
code { padding: .08rem .3rem; border-radius: 3px; }
pre {
  padding: 1rem 1.1rem;
  border-radius: 6px;
  overflow-x: auto;
  line-height: 1.5;
}
pre code { padding: 0; background: none; }
blockquote {
  margin: 1.4rem 0;
  padding: .2rem 1.1rem;
  border-left: 3px solid var(--accent);
  color: var(--muted);
}
figure { margin: 1.8rem 0; }
figure img { max-width: 100%; border-radius: 6px; border: 1px solid var(--line); }
figcaption { color: var(--muted); font-size: .85rem; text-align: center; margin-top: .4rem; }
footer.site {
  border-top: 1px solid var(--line);
  padding: 1.6rem 1rem 2.4rem;
  color: var(--muted);
  font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: .82rem;
}
footer.site .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }
.notfound { text-align: center; padding: 4rem 0; }
.notfound .code {
  font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 5rem;
  font-weight: 700;
  color: var(--line);
  margin: 0;
}
@media (max-width: 520px) {
  html { font-size: 16px; }
  nav a { margin-left: .8rem; }
}

/* forms */
.form { margin: 1.6rem 0 2rem; }
.form label {
  display: block;
  font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: .85rem;
  color: var(--muted);
  margin: 1rem 0 .3rem;
}
.form input, .form select, .form textarea {
  width: 100%;
  font: inherit;
  font-size: .95rem;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: .55rem .7rem;
}
.form input:focus, .form select:focus, .form textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 0;
}
.form .invalid { border-color: #c0443a; }
.form button, .subscribe button {
  margin-top: 1.1rem;
  font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: .92rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: .6rem 1.2rem;
  cursor: pointer;
}
.form button:hover, .subscribe button:hover { opacity: .9; }
.status { font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif; font-size: .88rem; min-height: 1.3em; }
.status.ok { color: var(--accent); }
.status.error { color: #c0443a; }

/* subscribe box */
.subscribe {
  margin-top: 2.5rem;
  padding: 1.3rem 1.4rem;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.subscribe h2 { margin: 0 0 .3rem; font-size: 1.1rem; }
.subscribe p { margin: .2rem 0 .6rem; color: var(--muted); font-size: .92rem; }
.subscribe .row { display: flex; gap: .6rem; flex-wrap: wrap; }
.subscribe input {
  flex: 1 1 14rem;
  font: inherit; font-size: .95rem;
  color: var(--fg); background: var(--bg);
  border: 1px solid var(--line); border-radius: 5px; padding: .55rem .7rem;
}
.subscribe button { margin-top: 0; }

/* cards */
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1.4rem 0; }
.card { border: 1px solid var(--line); border-radius: 8px; padding: 1rem 1.1rem; }
.card h3 { margin: 0 0 .3rem; font-size: 1.05rem; }
.card p { margin: .3rem 0; font-size: .92rem; }
.card-meta { color: var(--muted); font-size: .8rem !important; }
@media (max-width: 600px) { .cards { grid-template-columns: 1fr; } }

/* archive */
.archive { list-style: none; padding: 0; margin: 0; }
.archive li { padding: .55rem 0; border-bottom: 1px solid var(--line); }
.archive .date {
  display: inline-block; width: 5rem;
  font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: .85rem; color: var(--muted);
}
