:root {
  --bg: #fff;
  --fg: #111;
  --muted: #777;
  --faint: #b5b5b5;
  --rule: #e8e8e8;
  --accent: #1a4fd6;
  --measure: 40rem;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #111; --fg: #ececec; --muted: #9a9a9a; --faint: #5a5a5a; --rule: #262626; --accent: #8ab4ff; }
}
:root[data-theme="dark"] { --bg: #111; --fg: #ececec; --muted: #9a9a9a; --faint: #5a5a5a; --rule: #262626; --accent: #8ab4ff; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
.wrap { max-width: var(--measure); margin: 0 auto; padding: 6rem 1.25rem 5rem; }
.nav { display: flex; justify-content: space-between; align-items: center; margin: 1rem 0 0; font-size: 0.95rem; }
.nav.top { margin: 0 0 3.5rem; }
.nav.mid { margin-top: 2.5rem; }
.nav a { color: var(--muted); }
.nav a:hover { color: var(--fg); }
.navlinks { display: flex; align-items: center; gap: 1.5rem; }

/* identity */
.who { display: flex; align-items: center; gap: 0.7rem; font-weight: 500; }
.who img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.tag { color: var(--muted); margin: 0.3rem 0 0; }
.intro { margin: 2rem 0 0; }
.intro p { margin: 0 0 1rem; }

/* sections */
.section { margin-top: 3.5rem; }
.section h2 {
  font-size: 1rem; font-weight: 400; color: var(--muted);
  margin: 0; padding-bottom: 0.6rem; border-bottom: 1px solid var(--rule);
}
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { border-bottom: 1px solid var(--rule); }
.rows > li > a, .rows .row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1.5rem;
  padding: 0.8rem 0;
}
.rows .meta { color: var(--muted); white-space: nowrap; font-size: 0.95rem; }
.rows .sub { display: block; color: var(--muted); font-size: 0.9rem; margin-top: 0.1rem; }
.rows .sub a { text-decoration: underline; text-decoration-color: var(--faint); text-underline-offset: 3px; }
.rows .sub a:hover { color: var(--accent); text-decoration-color: var(--accent); }
.rows .sub + .sub { margin-top: 0.35rem; }
.rows .sub b { font-weight: 500; color: var(--fg); margin-right: 0.3rem; }
.rows > li > a:hover .meta { color: inherit; }
.inline { display: flex; gap: 2.2rem; padding: 0.8rem 0; }

/* article */
.article { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.article header h1 { font-size: 1rem; font-weight: 500; margin: 0; }
.article header time { color: var(--muted); font-size: 0.95rem; }
@media (min-width: 1100px) {
  .wrap.wide { max-width: 64rem; }
  .article { grid-template-columns: 16rem var(--measure); gap: 3rem; }
  .article header { text-align: left; }
}
.prose h1, .prose h2, .prose h3 { font-size: 1rem; font-weight: 500; margin: 2.2rem 0 0.6rem; }
.prose p { margin: 0 0 1.1rem; }
.prose a { text-decoration: underline; text-decoration-color: var(--faint); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--accent); }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin-bottom: 0.4rem; }
.prose blockquote { margin: 1.4rem 0; padding-left: 1rem; border-left: 2px solid var(--rule); color: var(--muted); font-style: italic; }
.prose img { max-width: 100%; height: auto; border-radius: 6px; }
.prose pre { overflow-x: auto; padding: 1rem; border-radius: 6px; background: #f6f6f6; font-size: 0.85rem; line-height: 1.5; }
.prose code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.88em; }
.prose :not(pre) > code { background: #f2f2f2; padding: 0.1em 0.35em; border-radius: 4px; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .prose pre, :root:not([data-theme="light"]) .prose :not(pre) > code { background: #1b1b1b; }
}
:root[data-theme="dark"] .prose pre, :root[data-theme="dark"] .prose :not(pre) > code { background: #1b1b1b; }
:root[data-theme="dark"] .highlight, :root[data-theme="dark"] .highlight * { color: #d4d4d4; background: transparent; }
.prose table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
.prose th, .prose td { text-align: left; padding: 0.5rem 0; border-bottom: 1px solid var(--rule); }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 2rem 0; }

/* footer */
.foot { margin-top: 5rem; color: var(--muted); font-size: 0.95rem; }
.foot .links { display: flex; flex-wrap: wrap; gap: 1.4rem; margin-top: 0.8rem; }
.foot .links a { color: var(--fg); }
.foot .links a:hover { color: var(--accent); }

/* theme toggle */
.theme {
  width: 28px; height: 28px; margin-left: -0.3rem; border-radius: 50%; border: 0; padding: 0;
  background: transparent; color: var(--muted); cursor: pointer;
  display: grid; place-items: center; transition: color .15s;
}
.theme:hover { color: var(--fg); }
.theme svg { width: 16px; height: 16px; }
.theme .moon { display: none; }
:root[data-theme="dark"] .theme .sun { display: none; }
:root[data-theme="dark"] .theme .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme .sun { display: none; }
  :root:not([data-theme="light"]) .theme .moon { display: block; }
}
