:root,
:root[data-theme="light"] {
  --text: #2a1f17;        /* dark espresso */
  --muted: #786450;       /* warm taupe */
  --bg: #f6efe2;          /* warm parchment */
  --link: #9a4520;        /* burnt sienna */
  --rule: #e3d5be;        /* soft tan */
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --text: #ebdfc9;      /* cream */
    --muted: #a08d75;     /* warm grey-taupe */
    --bg: #1a1510;        /* dark cocoa */
    --link: #d68963;      /* warm terracotta */
    --rule: #2f261c;      /* dark tan */
  }
}

:root[data-theme="dark"] {
  --text: #ebdfc9;
  --muted: #a08d75;
  --bg: #1a1510;
  --link: #d68963;
  --rule: #2f261c;
}

* { box-sizing: border-box; }

::selection {
  background: var(--link);
  color: var(--bg);
}

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

html {
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-size-adjust: 100%;
}

body {
  max-width: 640px;
  margin: 0 auto;
  padding: 4.5rem 1.5rem 6rem;
  color: var(--text);
  background: var(--bg);
  font-family: "Charter", "Iowan Old Style", "Apple Garamond", Georgia, "Times New Roman", serif;
  line-height: 1.6;
  font-feature-settings: "kern", "liga";
  position: relative;
}

#theme-toggle {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.9rem;
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0.01em;
  cursor: pointer;
  padding: 0.3rem 0.2rem;
  transition: color 120ms ease;
}

#theme-toggle:hover,
#theme-toggle:focus-visible {
  color: var(--link);
  outline: none;
}

header {
  margin-bottom: 2.5rem;
}

h1 {
  font-weight: 500;
  font-size: 1.75rem;
  letter-spacing: -0.01em;
  margin: 0 0 0.25rem;
}

.subtitle {
  color: var(--muted);
  margin: 0;
  font-size: 1rem;
}

h2 {
  font-size: 0.78rem;
  font-weight: 600;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  margin: 3rem 0 1rem;
}

section:first-of-type h2 { margin-top: 0; }

p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  text-decoration-color: color-mix(in srgb, var(--link) 50%, transparent);
}

a:hover {
  text-decoration-thickness: 2px;
  text-decoration-color: var(--link);
}

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

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

ul.entries li:last-child { border-bottom: none; }

ul.entries a {
  flex: 1 1 auto;
}

ul.entries .date {
  color: var(--muted);
  font-size: 0.85rem;
  font-style: italic;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  white-space: nowrap;
}

p.more {
  margin-top: 1rem;
  font-size: 0.95rem;
}

p.elsewhere {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.5rem;
  margin: 0;
}

@media (max-width: 520px) {
  html { font-size: 16px; }
  body { padding: 3rem 1.25rem 4rem; }
  ul.entries li {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
  }
  ul.entries .date { font-size: 0.78rem; }
}
