:root {
  --bg: #15120f;
  --bg-soft: #1f1915;
  --text: #f2ede6;
  --muted: #c3b8aa;
  --border: #3a2f27;
  --link-hover: #ded5c8;
  --focus: #81a5ff;
}

:root[data-theme="sepia"] {
  --bg: #f7efe1;
  --bg-soft: #f0e2cf;
  --text: #2d241d;
  --muted: #655748;
  --border: #cab9a2;
  --link-hover: #1f1812;
  --focus: #4068cf;
}

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

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 18px;
  line-height: 1.72;
}

a {
  color: var(--text);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

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

a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}

.wrap {
  width: min(600px, calc(100vw - 2rem));
  margin: 0 auto;
}

.site-header {
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 2;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 0;
}

.brand {
  color: var(--text);
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 700;
}

.site-nav {
  display: flex;
  gap: 0.9rem;
  align-items: center;
}

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

.site-nav a[aria-current="page"] {
  color: var(--text);
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

.theme-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.theme-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.theme-switch .slider {
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  cursor: pointer;
  display: inline-block;
  position: relative;
}

.theme-switch .slider::after {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--text);
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.16s ease;
}

.theme-switch input:checked + .slider::after {
  transform: translateX(16px);
}

main {
  padding: 2.6rem 0 3.2rem;
}

section {
  margin-bottom: 2.9rem;
}

h1,
h2,
h3 {
  line-height: 1.3;
  margin: 0 0 0.7rem;
}

h1 {
  font-size: clamp(1.8rem, 4vw, 2.3rem);
}

h2 {
  font-size: clamp(1.25rem, 2.7vw, 1.45rem);
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.03rem;
  margin-bottom: 0.4rem;
}

p,
li {
  color: var(--text);
}

p {
  margin: 0 0 1rem;
}

.lead {
  font-size: 1.05rem;
  color: var(--muted);
}

.meta {
  color: var(--muted);
  font-size: 0.86rem;
  margin: 0 0 0.3rem;
}

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

.list li {
  padding: 0.25rem 0;
}

.list li + li {
  margin-top: 1.15rem;
}

.list article p {
  margin: 0.35rem 0 0;
}

.site-footer {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  padding: 0.2rem 0 2.2rem;
}

.essay-header {
  margin-bottom: 1.4rem;
}

@media (max-width: 640px) {
  html,
  body {
    font-size: 17px;
  }

  main {
    padding-top: 2rem;
  }

  section {
    margin-bottom: 2.3rem;
  }
}
