:root {
  color-scheme: light;
  --bg: #f4f0e6;
  --bg-raise: #fffdf8;
  --ink: #1c1915;
  --muted: #4a453c;
  --line: #d9d0c2;
  --accent: #0e5c45;
  --accent-ink: #f7fffb;
  --header: rgba(244, 240, 230, 0.92);
  --shadow: 0 1px 0 rgba(28, 25, 21, 0.04);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #121614;
    --bg-raise: #1b221e;
    --ink: #f4f0e6;
    --muted: #c8c0b4;
    --line: #313a34;
    --accent: #8fd0b0;
    --accent-ink: #10211a;
    --header: rgba(18, 22, 20, 0.92);
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f0e6;
  --bg-raise: #fffdf8;
  --ink: #1c1915;
  --muted: #4a453c;
  --line: #d9d0c2;
  --accent: #0e5c45;
  --accent-ink: #f7fffb;
  --header: rgba(244, 240, 230, 0.92);
  --shadow: 0 1px 0 rgba(28, 25, 21, 0.04);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121614;
  --bg-raise: #1b221e;
  --ink: #f4f0e6;
  --muted: #c8c0b4;
  --line: #313a34;
  --accent: #8fd0b0;
  --accent-ink: #10211a;
  --header: rgba(18, 22, 20, 0.92);
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
}

.skip {
  position: absolute;
  left: 0.75rem;
  top: 0.75rem;
  transform: translateY(-150%);
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.5rem 0.8rem;
  z-index: 10;
}

.skip:focus { transform: none; }

.wrap {
  width: min(1080px, calc(100% - 2.5rem));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--header);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  padding: 0.75rem 0;
}

.brand {
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--ink);
  text-decoration: none;
  margin-right: auto;
}

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

.site-nav a {
  color: var(--ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  padding: 0.4rem 0;
}

.theme-toggle {
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  min-height: 44px;
  cursor: pointer;
}

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

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

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

a:focus-visible,
.theme-toggle:focus-visible,
.skip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

main { padding: 2.5rem 0 3.5rem; }

.kicker {
  margin: 0 0 0.4rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

h2 {
  margin: 2.5rem 0 0.6rem;
  font-family: var(--serif);
  font-size: clamp(1.7rem, 3vw, 2.15rem);
  font-weight: 500;
  line-height: 1.2;
}

h3 {
  margin: 2rem 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h4 {
  margin: 0.2rem 0 0.4rem;
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.3;
}

h4 a { color: var(--ink); }

.place {
  margin: 0.6rem 0 0;
  color: var(--muted);
  font-size: 1.15rem;
}

.lede {
  max-width: 68ch;
  font-size: 1.15rem;
}

.section-note {
  max-width: 70ch;
  color: var(--muted);
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0;
  margin: 1.25rem 0 0;
  list-style: none;
}

.profile-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-raise);
  text-decoration: none;
  box-shadow: var(--shadow);
}

.profile-links a:hover { border-color: var(--accent); }

.panel {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-top: 2.5rem;
  padding: 1.25rem 1.25rem 1.35rem;
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  box-shadow: var(--shadow);
}

.panel h2 { margin-top: 0; }

.panel p { margin: 0; max-width: 62ch; }

.panel-link {
  align-self: end;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.45rem 0.9rem;
  background: var(--accent);
  color: var(--accent-ink);
  text-decoration: none;
  border-radius: 999px;
}

.panel-link:hover { text-decoration: underline; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16.5rem, 1fr));
  gap: 0.9rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.cards li {
  margin: 0;
  padding: 1rem 1rem 0.9rem;
  background: var(--bg-raise);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.cards p { margin: 0.35rem 0 0; }

.cards a,
.plain a { overflow-wrap: anywhere; }

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

.plain {
  margin: 0;
  padding: 0;
  list-style: none;
  max-width: 75ch;
}

.plain li {
  margin: 0;
  padding: 0.7rem 0;
  border-top: 1px solid var(--line);
}

.plain li:last-child { border-bottom: 1px solid var(--line); }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.25rem 0 2rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.site-footer p { margin: 0; }

@media (max-width: 640px) {
  .wrap { width: min(1080px, calc(100% - 1.5rem)); }
  main { padding-top: 1.75rem; }
  .header-inner { align-items: stretch; }
  .theme-toggle { width: 100%; }
  .panel-link { width: 100%; justify-content: center; }
}
