:root {
  --bg: #ffffff;
  --text: #111111;
  --muted: #767676;
  --accent: #111111;
  --rule: #ececec;
  --code-bg: #f6f6f6;
  --max-width: 640px;
  --font-serif: "Source Serif 4", Georgia, Cambria, "Times New Roman", Times, serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-serif);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16vh 24px 12vh;
}

/* shared */
h1 {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin: 0 0 3rem;
}

p {
  font-size: 1.05rem;
  line-height: 1.65;
  margin: 0 0 1.4rem;
}

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.back {
  display: inline-block;
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: none;
  margin: 0 0 3rem;
}
.back:hover { color: var(--text); }

/* ---------- home ---------- */
.lead {
  font-size: 1.45rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 2rem;
}
.home p { text-align: justify; hyphens: auto; }
.home .lead, .home .status { text-align: left; hyphens: none; }
.home strong { font-weight: 600; }

footer {
  margin-top: 4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  font-size: 0.95rem;
}
footer a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
}
footer a:hover, footer a:focus-visible { border-bottom-color: currentColor; }

.status {
  margin-top: 3rem;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ---------- writing index ---------- */
.post-list { display: flex; flex-direction: column; gap: 2.25rem; }
.post-list .date {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0 0 0.35rem;
}
.post-list .title {
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.post-list .title:hover, .post-list .title:focus-visible { border-bottom-color: currentColor; }
.post-list .dek {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--muted);
  margin: 0.4rem 0 0;
}

/* ---------- single post ---------- */
.prose .post-title {
  font-size: 1.7rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0 0 0.5rem;
}
.prose .post-meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 2.5rem;
}
.prose h2 { font-size: 1.3rem; font-weight: 600; line-height: 1.3; margin: 2.6rem 0 0.8rem; }
.prose h3 { font-size: 1.08rem; font-weight: 600; margin: 2rem 0 0.6rem; }
.prose p { font-size: 1.05rem; line-height: 1.7; margin: 0 0 1.4rem; }
.prose ul, .prose ol { padding-left: 1.4rem; margin: 0 0 1.4rem; }
.prose li { line-height: 1.7; margin: 0 0 0.4rem; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.prose strong { font-weight: 600; }
.prose code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--code-bg);
  padding: 0.12em 0.36em;
  border-radius: 3px;
}
.prose pre {
  background: var(--code-bg);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  margin: 0 0 1.5rem;
  line-height: 1.5;
}
.prose pre code { background: none; padding: 0; font-size: 0.85rem; }
.prose blockquote {
  border-left: 2px solid var(--rule);
  margin: 0 0 1.4rem;
  padding: 0.1rem 0 0.1rem 1.1rem;
  color: var(--muted);
}
.prose hr { border: none; border-top: 1px solid var(--rule); margin: 2.5rem 0; }

/* ---------- mobile ---------- */
@media (max-width: 480px) {
  main { padding: 10vh 20px 8vh; }
  .lead { font-size: 1.25rem; }
  .home p { text-align: left; hyphens: none; }
  .prose .post-title { font-size: 1.45rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
