:root {
  color-scheme: light;
  --paper: #ffffff;
  --ink: #1c1c1c;
  --muted: #686868;
  --link: #174d38;
  --selection: #dce8df;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #1b1b1b;
  --ink: #ececec;
  --muted: #a6a6a6;
  --link: #9bc9ac;
  --selection: #304a39;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Charter, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 18px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--selection); }

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

a:hover { text-decoration-thickness: 2px; }

.page {
  width: min(100% - 3rem, 650px);
  margin: 0 auto;
}

.theme-bar {
  display: flex;
  justify-content: flex-end;
  padding-top: 1.5rem;
}

.theme-toggle {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-family: "Avenir Next", Avenir, "Helvetica Neue", sans-serif;
  font-size: 0.7rem;
}

.theme-toggle:hover { color: var(--ink); text-decoration: underline; }

main { padding: 4rem 0 5rem; }

h1 {
  margin: 0 0 2rem;
  font-size: clamp(2.2rem, 7vw, 3.2rem);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

p { margin: 0 0 1.5rem; }
.contact { margin-top: 2rem; }

@media (max-width: 560px) {
  .page { width: calc(100% - 2rem); }
  main { padding: 3rem 0 3.5rem; }
}
