:root {
  --bg: #fdfdfc;
  --fg: #1c1c1e;
  --muted: #6e6e73;
  --line: #e5e5e5;
  --code-bg: #f3f3f2;
  --accent: #2557d6;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141415;
    --fg: #e8e8ea;
    --muted: #98989d;
    --line: #2c2c2e;
    --code-bg: #1f1f21;
    --accent: #7aa2ff;
  }
}

* { box-sizing: border-box; }

html {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
}

main {
  max-width: 38rem;
  margin: 0 auto;
  padding: 4.5rem 1.25rem 3rem;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3 { line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: 1.6rem; margin: 0; }
h2 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 3rem 0 1rem;
}

/* Homepage */
.intro { display: flex; align-items: center; gap: 1.25rem; margin-bottom: 2rem; }
.avatar { width: 176px; height: 132px; border-radius: 12px; object-fit: cover; flex-shrink: 0; }
.tagline { margin: 0.15rem 0 0; color: var(--muted); }

.about p { margin: 0 0 1rem; }

.links { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.9rem; }
.links a {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.2rem 0.85rem;
  font-size: 0.9rem;
  color: var(--fg);
}
.links a:hover { border-color: var(--muted); text-decoration: none; }

.posts { list-style: none; padding: 0; margin: 0; }
.posts li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
}
.posts li:last-child { border-bottom: 0; }
.posts a { color: var(--fg); }
.posts .meta { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }

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

/* Posts */
.back { margin-bottom: 2.5rem; font-size: 0.9rem; }
.back a { color: var(--muted); }
.post-header { margin-bottom: 2rem; }
.post-header h1 { font-size: 1.9rem; margin-bottom: 0.4rem; }
.post-header time { color: var(--muted); font-size: 0.9rem; }

article p, article ul, article ol { margin: 0 0 1.1rem; }
article li { margin-bottom: 0.3rem; }
article h2 { text-transform: none; letter-spacing: -0.01em; font-size: 1.3rem; color: var(--fg); margin: 2.5rem 0 1rem; }
article img { max-width: 100%; height: auto; }
article blockquote { margin: 0 0 1.1rem; padding-left: 1rem; border-left: 3px solid var(--line); color: var(--muted); }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--code-bg);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}
pre { background: var(--code-bg); padding: 1rem; border-radius: 8px; overflow-x: auto; line-height: 1.5; }
pre code { background: none; padding: 0; }

/* Section dividers with a label: `---` followed by {: data-content=" label "} */
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; overflow: visible; text-align: center; height: 0; }
hr[data-content]::after {
  content: attr(data-content);
  position: relative;
  top: -0.8em;
  padding: 0 0.5rem;
  background: var(--bg);
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

@media (max-width: 480px) {
  main { padding-top: 2.5rem; }
  .intro { flex-direction: column; align-items: flex-start; }
  .avatar { width: 100%; height: auto; aspect-ratio: 4 / 3; }
  .posts li { flex-direction: column; gap: 0.1rem; }
}
