:root {
  color-scheme: light dark;

  /* Color */
  --bg: #ffffff;
  --text: #1f2421;
  --muted: #6d716b;
  --line: #d4d4ce;
  --accent: #8a3a2a;

  /* Type scale — major second (1.125), 18px base */
  --text-xs: 14px;
  --text-sm: 16px;
  --text-base: 18px;
  --text-md: 20px;
  --text-lg: 23px;
  --text-xl: 26px;
  --text-2xl: 32px;

  /* Spacing scale — 4px base */
  --space-3xs: 4px;
  --space-2xs: 8px;
  --space-xs: 16px;
  --space-sm: 24px;
  --space-md: 32px;
  --space-lg: 48px;
  --space-xl: 64px;
  --space-2xl: 96px;

  --measure: 640px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16181c;
    --text: #e6e4df;
    --muted: #9a9b96;
    --line: #393c42;
    /* Cherry lightened to a warm rosewood so it stays legible on dark. */
    --accent: #d99480;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Literata Variable", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  font-optical-sizing: auto;
  font-size: var(--text-base);
  line-height: 1.65;
  font-variant-numeric: oldstyle-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.masthead,
main,
.site-footer {
  width: min(100% - 40px, var(--measure));
  margin-left: auto;
  margin-right: auto;
}

/* Masthead: name + one-line brief on the left, Bio link right-aligned. */
.masthead {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-sm);
  padding-top: var(--space-xl);
}

.site-title {
  display: inline-block;
  color: var(--text);
  font-weight: 600;
  font-size: var(--text-md);
  letter-spacing: -0.01em;
  text-decoration: none;
}

.site-title:hover {
  color: var(--accent);
}

.tagline {
  margin: var(--space-2xs) 0 0;
  color: var(--muted);
  font-style: italic;
  font-size: var(--text-sm);
  line-height: 1.5;
}

main {
  padding: var(--space-lg) 0 var(--space-xl);
}

.site-footer {
  padding-bottom: var(--space-2xl);
}

.site-nav {
  display: flex;
  flex-shrink: 0;
  gap: var(--space-sm);
  font-size: var(--text-sm);
}

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

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--accent);
}

h1,
h2,
h3 {
  margin: 0 0 var(--space-xs);
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.012em;
}

h1 {
  font-size: var(--text-2xl);
}

h2 {
  margin-top: var(--space-lg);
  font-size: var(--text-lg);
  letter-spacing: -0.006em;
}

h3 {
  margin-top: var(--space-md);
  font-size: var(--text-md);
  letter-spacing: 0;
}

p {
  margin: 0 0 var(--space-sm);
}

.feed {
  display: grid;
  gap: var(--space-xl);
}

.feed-post header {
  margin-bottom: var(--space-xs);
}

.feed-post h2 {
  margin-top: 0;
  font-size: var(--text-xl);
}

.feed-post h2 a {
  color: var(--text);
  text-decoration: none;
}

.feed-post h2 a:hover {
  color: var(--accent);
}

/* One date treatment everywhere: muted small spaced caps. */
.feed-post time,
.post .date,
.post-list time {
  color: var(--muted);
  font-size: var(--text-xs);
  font-variant-caps: all-small-caps;
  letter-spacing: 0.08em;
}

/* Above-title dates (feed + single post) stack as a block, tight to the title. */
.feed-post time,
.post .date {
  display: block;
  margin: 0 0 var(--space-3xs);
}

.post header {
  margin-bottom: var(--space-md);
}

.source {
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.5;
  margin-top: var(--space-xs);
}

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

.post-list li {
  display: flex;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: var(--space-2xs) 0;
}

.post-list time {
  flex-shrink: 0;
  white-space: nowrap;
}

.post-list a {
  color: var(--text);
  text-decoration: none;
}

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

.content :where(h2, h3) {
  margin-top: var(--space-lg);
}

.content :where(img) {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 0 var(--space-sm);
}

@media (max-width: 560px) {
  .masthead {
    padding-top: var(--space-lg);
  }

  h1 {
    font-size: var(--text-xl);
  }

  .post-list li {
    align-items: flex-start;
    flex-direction: column;
    gap: var(--space-3xs);
  }
}
