:root {
  color-scheme: light dark;
  --ink: #1a1a1a;
  --paper: #fafaf7;
  --muted: #6b6b6b;
  --accent: #0077b6;
  --rule: #e6e4dc;
  --code-bg: #f0eee5;
  --measure: 38rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8e6df;
    --paper: #14140f;
    --muted: #8a8780;
    --accent: #6cb8e0;
    --rule: #2a2a25;
    --code-bg: #1f1f1a;
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --ink: #1a1a1a;
  --paper: #fafaf7;
  --muted: #6b6b6b;
  --accent: #0077b6;
  --rule: #e6e4dc;
  --code-bg: #f0eee5;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e8e6df;
  --paper: #14140f;
  --muted: #8a8780;
  --accent: #6cb8e0;
  --rule: #2a2a25;
  --code-bg: #1f1f1a;
}

* { box-sizing: border-box; }

html {
  font-size: 17px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  line-height: 1.65;
  font-feature-settings: "kern", "liga";
}

main, .site-header, .site-footer {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  align-items: baseline;
  padding-top: 2.5rem;
  padding-bottom: 2.5rem;
}

.site-name {
  font-weight: 600;
  margin-right: auto;
  color: var(--ink);
  text-decoration: none;
}

.site-header nav {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.site-header nav a {
  color: var(--ink);
  text-decoration: none;
}

.site-header nav a:hover {
  color: var(--accent);
}

.theme-toggle {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  line-height: 1;
}

.theme-toggle.is-loading { visibility: hidden; }

.theme-toggle:hover {
  color: var(--accent);
}

.theme-toggle[hidden] {
  display: none;
}

a {
  color: var(--ink);
  /*text-decoration: none;*/
}

a:hover {
  color: var(--accent);
}

h1, h2, h3 {
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.01em;
}

h1 { font-size: 1.75rem; margin: 0 0 0.5rem; }
h2 { font-size: 1.25rem; margin: 2.5rem 0 0.75rem; }
h3 { font-size: 1.05rem; margin: 2rem 0 0.5rem; }

p { margin: 0 0 1.1rem; }

article time, .post-list time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
}

.post-header {
  margin-bottom: 2rem;
}

.post-header time {
  display: block;
  margin-top: 0.25rem;
}

.post-body :is(h2, h3) { margin-top: 2rem; }
.post-body img { max-width: 100%; height: auto; }

.post-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  background: var(--rule);
  padding: 0.1em 0.3em;
  border-radius: 3px;
}

.post-body pre {
  overflow-x: auto;
  padding: 1rem;
  background: var(--code-bg);
  border-radius: 4px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.post-body pre code {
  background: transparent;
  padding: 0;
}

.post-body blockquote {
  border-left: 2px solid var(--rule);
  margin: 1.5rem 0;
  padding-left: 1rem;
  color: var(--muted);
}

ul.post-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 2rem;
}

ul.post-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--rule);
}

ul.post-list a {
  color: var(--ink);
  text-decoration: none;
}

ul.post-list a:hover {
  color: var(--accent);
}

.intro {
  padding: 1.5rem 0 1rem;
}

.site-footer {
  margin-top: 4rem;
  padding-top: 2rem;
  padding-bottom: 3rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 480px) {
  html { font-size: 16px; }
  main, .site-header, .site-footer { padding: 0 1rem; }
}
