:root {
  --bg: #f7f4ed;
  --paper: rgba(255, 252, 245, 0.88);
  --text: #22201b;
  --muted: #6d665b;
  --line: rgba(34, 32, 27, 0.14);
  --accent: #9d5c2f;
  --shadow: rgba(57, 39, 26, 0.08);
  --max-width: 44rem;
}

:root[data-theme="dark"] {
  --bg: #111315;
  --paper: rgba(24, 27, 30, 0.9);
  --text: #ece5d8;
  --muted: #b0a696;
  --line: rgba(236, 229, 216, 0.14);
  --accent: #f0ad72;
  --shadow: rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--accent) 14%, transparent), transparent 30%),
    linear-gradient(180deg, #f8f5ef 0%, var(--bg) 100%);
  font-family: "Newsreader", Georgia, serif;
  line-height: 1.7;
  transition: background-color 180ms ease, color 180ms ease;
}

a {
  color: inherit;
  text-decoration-color: rgba(157, 92, 47, 0.45);
  text-underline-offset: 0.18em;
}

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

.page {
  width: min(calc(100% - 2rem), calc(var(--max-width) + 8rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.site-header,
.site-footer,
.intro,
.block {
  background: var(--paper);
  backdrop-filter: blur(6px);
  border: 1px solid var(--line);
  box-shadow: 0 12px 30px var(--shadow);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.site-header,
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
}

.site-header {
  margin-bottom: 2rem;
}

.site-title,
.site-nav,
.eyebrow,
.meta,
.site-footer {
  font-family: "IBM Plex Sans", Arial, sans-serif;
}

.site-title {
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: 1rem;
  font-size: 0.95rem;
}

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

.theme-toggle {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  padding: 0.55rem 0.8rem;
  font: 500 0.9rem "IBM Plex Sans", Arial, sans-serif;
  cursor: pointer;
  transition: border-color 180ms ease, color 180ms ease, background-color 180ms ease;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.intro,
.block {
  padding: 2rem 1.25rem;
  margin-bottom: 1.25rem;
}

.eyebrow,
.meta {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 14ch;
  margin-bottom: 1rem;
  font-size: clamp(2.8rem, 8vw, 5rem);
  line-height: 0.95;
  font-weight: 500;
}

.lede,
.about-copy,
.post p {
  max-width: var(--max-width);
  font-size: 1.15rem;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.85rem;
  margin-bottom: 1.2rem;
  border-bottom: 1px solid var(--line);
}

.section-heading h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 500;
}

.section-heading a {
  font-family: "IBM Plex Sans", Arial, sans-serif;
  font-size: 0.9rem;
  color: var(--muted);
}

.post + .post {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.post h3 {
  margin-bottom: 0.5rem;
  font-size: 1.65rem;
  line-height: 1.15;
  font-weight: 500;
}

.post h3 a {
  text-decoration: none;
}

.about-copy p:last-child,
.post p:last-child,
.site-footer p {
  margin-bottom: 0;
}

.site-footer {
  margin-top: 2rem;
  color: var(--muted);
  font-size: 0.95rem;
}

@media (max-width: 700px) {
  .page {
    width: min(calc(100% - 1rem), calc(var(--max-width) + 2rem));
    padding-top: 0.5rem;
  }

  .site-header,
  .site-footer,
  .section-heading {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-controls {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
  }

  .site-nav {
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
  }

  .intro,
  .block {
    padding: 1.5rem 1rem;
  }

  .lede,
  .about-copy,
  .post p {
    font-size: 1.05rem;
  }
}