:root {
  --bg: #fbf1c7;
  --bg-soft: #ebdbb2;
  --fg: #282828;
  --fg-soft: #504945;
  --accent: #b57614;
  --link: #076678;
  --border: #d5c4a1;
  --code-bg: #eee0b5;
  --code-border: #c7b99c;
  --code-fg: #9d0006;
}
:root[data-theme="dark"] {
  --bg: #282828;
  --bg-soft: #3c3836;
  --fg: #ebdbb2;
  --fg-soft: #bdae93;
  --accent: #d79921;
  --link: #83a598;
  --border: #504945;
  --code-bg: #403c39;
  --code-border: #665c54;
  --code-fg: #d3869b;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, sans-serif;
  line-height: 1.7;
}

body {
  margin: 0;
}

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

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

.shell {
  margin: 0 auto;
  max-width: 48rem;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.site-header {
  border-bottom: 1px solid var(--border);
}

.header-inner {
  align-items: center;
  display: flex;
  justify-content: space-between;
  min-height: 4rem;
}

.site-title {
  color: var(--fg);
  font-weight: 700;
  text-decoration: none;
}

.theme-toggle {
  align-items: center;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 0.25rem;
  color: var(--fg);
  cursor: pointer;
  display: inline-flex;
  height: 2.25rem;
  justify-content: center;
  padding: 0.45rem;
  width: 2.25rem;
}

.theme-icon {
  fill: none;
  height: 1.2rem;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  width: 1.2rem;
}

.theme-icon--moon {
  display: none;
}

:root[data-theme="light"] .theme-icon--sun {
  display: none;
}

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

main {
  min-height: calc(100vh - 9rem);
  padding-bottom: 3rem;
  padding-top: 3rem;
}

h1,
h2,
h3 {
  line-height: 1.3;
}

.intro {
  margin-bottom: 3rem;
}

.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

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

time,
.empty {
  color: var(--fg-soft);
}

.post-header {
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
  padding-bottom: 1rem;
}

.post-content img {
  height: auto;
  max-width: 100%;
}

pre {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 0.25rem;
  overflow-x: auto;
  padding: 1rem;
}

.code-block {
  margin: 1em 0;
}

.code-block:not(.is-expanded) > pre {
  max-height: calc(1.7em * 2 + 2rem);
  overflow: hidden;
}

.code-block-toggle {
  background: transparent;
  border: 0;
  color: var(--fg-soft);
  cursor: pointer;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  padding: 0;
}

.code-block > pre {
  margin-bottom: 0;
}

code {
  font-family: ui-monospace, "Cascadia Code", "Noto Sans Mono", monospace;
}

.post-content :not(pre) > code {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: 0.2rem;
  color: var(--code-fg);
  padding: 0.1em 0.3em;
}

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--fg-soft);
  padding-bottom: 1.5rem;
  padding-top: 1.5rem;
}

@media (max-width: 36rem) {
  .post-list li {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.15rem;
  }
}
