:root {
  --font-body: "Avenir Next", Avenir, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --content-width: 42rem;
  --bg: #ffffff;
  --fg: #1a1a1a;
  --muted: #666666;
  --link: #0645ad;
  --border: #d8d8d8;
  --code-bg: #f5f5f5;
  --code-fg: #202020;
}

:root[data-theme="dark"] {
  --bg: #0f0f0f;
  --fg: #e8e8e8;
  --muted: #9a9a9a;
  --link: #8ab4f8;
  --border: #333333;
  --code-bg: #1a1a1a;
  --code-fg: #f0f0f0;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-family: var(--font-body);
  font-size: 100%;
  line-height: 1.5;
  color-scheme: light;
  text-size-adjust: 100%;
}

:root[data-theme="dark"] {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  line-height: 1.65;
  color: var(--fg);
  background: var(--bg);
  overflow-wrap: break-word;
}

main,
.site-header,
.site-footer {
  width: min(100% - 2rem, var(--content-width));
  margin-inline: auto;
}

.site-header {
  padding-block-start: 3rem;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  white-space: nowrap;
}

.site-nav-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.site-nav a,
.theme-toggle {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.theme-toggle {
  justify-content: center;
  min-width: 44px;
}

.theme-icon {
  display: none;
}

:root[data-theme="light"] .theme-icon-moon,
:root[data-theme="dark"] .theme-icon-sun {
  display: block;
}

.site-home-link {
  justify-content: center;
  width: 44px;
}

.site-home-link svg {
  display: block;
}

main {
  padding-block: 2rem;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-block-end: 3rem;
  color: var(--muted);
}

.social-links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--muted);
}

.social-links a:hover {
  color: var(--fg);
}

.social-links svg {
  display: block;
}

h1,
h2,
h3,
h4 {
  margin-block: 2rem 0.75rem;
  font-weight: 600;
  line-height: 1.2;
}

h1 {
  margin-block-start: 0;
  font-size: clamp(2rem, 1.55rem + 2.25vw, 3rem);
}

h2 {
  font-size: clamp(1.5rem, 1.25rem + 1.25vw, 2rem);
}

h3 {
  font-size: clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem);
}

h4 {
  font-size: 1rem;
}

p,
ul,
ol,
blockquote,
pre {
  margin-block: 0 1.25rem;
}

a {
  color: var(--link);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.15em;
}

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

.muted {
  color: var(--muted);
}

hr {
  border: 0;
  border-block-start: 1px solid var(--border);
}

ul,
ol {
  padding-inline-start: 1.5rem;
}

li + li {
  margin-block-start: 0.25rem;
}

code,
pre {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.92em;
  color: var(--code-fg);
  background: var(--code-bg);
}

:not(pre) > code {
  padding: 0.1em 0.25em;
}

pre {
  overflow-x: auto;
  padding: 1rem;
  border: 1px solid var(--border);
}

button {
  color: var(--fg);
  background: transparent;
  border: 1px solid var(--border);
}

button:hover {
  border-color: var(--muted);
}

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

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

.page > :last-child {
  margin-block-end: 0;
}

.post-list {
  display: grid;
  gap: 1.5rem;
}

.post-list-item h4 {
  margin-block: 0 0.2rem;
}

.post-list-item h4 a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.post-header {
  margin-block-end: 1.5rem;
}

.post-header h1 {
  margin-block-end: 0.3rem;
}

.post-meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin-block-end: 0;
}

.post-meta a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: inherit;
}

.post-meta a:hover {
  color: var(--fg);
}
