:root {
  --paper: #f5f0e7;
  --ink: #1e211f;
  --muted: #62655f;
  --faint: #d8d2c7;
  --accent: #087a82;
  --accent-dark: #045f66;
  --display: "Arial Black", "Avenir Next", "Segoe UI", sans-serif;
  --body: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --ui: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  --measure: 70ch;
  --gutter: clamp(1.25rem, 5vw, 3rem);
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4.5rem;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 100%;
  line-height: 1.65;
  overflow-wrap: break-word;
  text-rendering: optimizeLegibility;
}

body { margin: 0; min-width: 0; }

a {
  color: var(--accent-dark);
  text-decoration-color: color-mix(in srgb, var(--accent) 55%, transparent);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

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

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  z-index: 10;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.6rem 0.85rem;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--ui);
  transform: translateY(-180%);
}

.skip-link:focus { transform: translateY(0); }

.site-header,
.site-footer,
main {
  width: min(100% - (2 * var(--gutter)), var(--measure));
  margin-inline: auto;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 6rem;
  border-bottom: 1px solid var(--faint);
  font-family: var(--ui);
}

.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 0.65rem;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.wordmark span:first-child {
  color: var(--accent-dark);
  font-family: var(--display);
  font-size: 1.4rem;
  letter-spacing: -0.08em;
}

.site-header nav a {
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 600;
}

.site-header nav a[aria-current="page"] { text-decoration-thickness: 0.14em; }

main { min-height: 58vh; }

.home-intro { padding-block: clamp(3.75rem, 10vw, 7.5rem) clamp(3.5rem, 8vw, 6rem); }

h1, h2, h3 {
  margin-block: 0;
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.08;
  text-wrap: balance;
}

.home-intro h1 {
  max-width: 12ch;
  font-size: clamp(2.7rem, 8vw, 5.6rem);
}

.home-intro > p {
  max-width: 42ch;
  margin: var(--space-3) 0 0;
  font-size: clamp(1.2rem, 2.3vw, 1.5rem);
  line-height: 1.5;
}

.latest { padding-bottom: var(--space-5); }

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  padding-bottom: 0.85rem;
  border-bottom: 2px solid var(--ink);
  font-family: var(--ui);
}

.section-heading h2 { font-size: 1.2rem; letter-spacing: -0.015em; }
.section-heading a { flex: none; font-size: 0.9rem; }

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

.note-list li { border-bottom: 1px solid var(--faint); }
.note-list article { padding-block: 1.35rem 1.5rem; }

.note-list__line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: var(--space-3);
}

.note-list h2 { font-size: clamp(1.15rem, 3vw, 1.45rem); }
.note-list h2 a { color: var(--ink); text-decoration: none; }
.note-list h2 a:hover { color: var(--accent-dark); text-decoration: underline; }

.note-list time,
.note__header time {
  color: var(--muted);
  font-family: var(--ui);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.note-list p { margin: 0.55rem 0 0; color: var(--muted); line-height: 1.5; }

.empty-state {
  padding-block: 2rem;
  border-bottom: 1px solid var(--faint);
  color: var(--muted);
}

.empty-state p { margin: 0; }
.empty-state p + p { margin-top: 0.2rem; }

.page-heading { padding-block: clamp(3.5rem, 9vw, 6.5rem) var(--space-4); }
.eyebrow { margin: 0 0 0.6rem; color: var(--accent-dark); font-family: var(--ui); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.page-heading h1, .not-found h1 { font-size: clamp(2.8rem, 8vw, 5rem); }
.page-heading > p:last-child { max-width: 48ch; margin: var(--space-2) 0 0; color: var(--muted); font-size: 1.15rem; }

.note { padding-block: clamp(3rem, 8vw, 6rem) var(--space-5); }
.note__header { margin-bottom: clamp(2.5rem, 8vw, 5rem); }
.back-link { display: inline-block; margin-bottom: var(--space-3); font-family: var(--ui); font-size: 0.9rem; }
.note__header h1 { max-width: 18ch; margin-bottom: var(--space-2); font-size: clamp(2.5rem, 8vw, 4.8rem); }

.prose { font-size: clamp(1.05rem, 1.5vw, 1.16rem); }
.prose > * { margin-block: 0; }
.prose > * + * { margin-top: 1.35em; }
.prose h2 { margin-top: 2.5em; font-size: clamp(1.65rem, 4vw, 2.15rem); }
.prose h3 { margin-top: 2.1em; font-size: clamp(1.3rem, 3vw, 1.55rem); }
.prose ul, .prose ol { padding-left: 1.35em; }
.prose li + li { margin-top: 0.45em; }
.prose blockquote { margin-inline: 0; padding: 0.2rem 0 0.2rem 1.35rem; border-left: 3px solid var(--accent); color: #454843; font-size: 1.08em; }
.prose blockquote > :first-child { margin-top: 0; }
.prose blockquote > :last-child { margin-bottom: 0; }
.prose code { overflow-wrap: anywhere; padding: 0.08em 0.28em; background: #e7e0d5; border-radius: 2px; font-size: 0.88em; }
.prose pre { max-width: 100%; overflow-x: auto; padding: 1.1rem; background: var(--ink); color: #f7f2e9; border-radius: 2px; line-height: 1.55; }
.prose pre code { padding: 0; background: transparent; color: inherit; overflow-wrap: normal; }
.prose figure { margin: 2.5rem 0; }
.prose img { display: block; max-width: 100%; height: auto; }
.prose figcaption { margin-top: 0.65rem; color: var(--muted); font-family: var(--ui); font-size: 0.85rem; }
.prose hr { margin-block: 3rem; border: 0; border-top: 1px solid var(--faint); }

.not-found { padding-block: clamp(4rem, 12vw, 9rem); }
.not-found > p:not(.eyebrow) { max-width: 42ch; }

.site-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  padding-block: 2.5rem 3rem;
  border-top: 1px solid var(--faint);
  font-family: var(--ui);
  font-size: 0.88rem;
}

.footer-heading { margin: 0 0 0.55rem; color: var(--muted); font-weight: 600; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.35rem 1.2rem; }
.rss-link { flex: none; }

@media (max-width: 36rem) {
  :root { --gutter: 1.15rem; }
  .site-header__inner { min-height: 4.75rem; }
  .home-intro { padding-top: 3rem; }
  .note-list__line { grid-template-columns: 1fr; gap: 0.4rem; }
  .note-list time { grid-row: 1; }
  .note-list h2 { grid-row: 2; }
  .site-footer { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: no-preference) {
  a { transition: color 120ms ease, text-decoration-color 120ms ease; }
  .skip-link { transition: transform 120ms ease; }
}

@media print {
  .skip-link, .site-header, .site-footer, .back-link { display: none; }
  html { background: #fff; }
  main { width: 100%; }
  a { color: inherit; }
}
