:root {
  color-scheme: light dark;
  --paper: #f7f7f4;
  --card: #fbfbf9;
  --ink: #23262a;
  --ink-muted: #565a60;
  --graphite: #5e6268;
  --graphite-faint: #cdd0d3;
  --sage: #a0b78f;
  --sage-wash: #d3dfc8;
  --sage-deep: #4d6b40;
  --sage-deeper: #3d5633;
  --on-sage: #ffffff;
  --serif: 'Iowan Old Style', 'Baskerville', 'Palatino Linotype', Georgia, serif;
  --hand: 19px 15px 21px 14px / 15px 20px 14px 19px;
  --hand-small: 12px 10px 13px 9px / 10px 13px 9px 12px;
  font-synthesis: none;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1b1d20;
    --card: #23262a;
    --ink: #ecede9;
    --ink-muted: #a8acb1;
    --graphite: #a9adb2;
    --graphite-faint: #3a3e43;
    --sage: #6a8259;
    --sage-wash: #3c4a35;
    --sage-deep: #b9cfa8;
    --sage-deeper: #d3dfc8;
    --on-sage: #1b1d20;
  }
  img {
    filter: brightness(0.9);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Avenir Next', Avenir, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
::selection {
  background: var(--sage-wash);
  color: var(--ink);
}
a {
  color: inherit;
  text-decoration-color: var(--graphite-faint);
  text-underline-offset: 4px;
}
a:hover {
  text-decoration-color: var(--sage);
}
a:focus-visible {
  outline: 3px solid var(--sage-deep);
  outline-offset: 5px;
}
h1,
h2,
h3,
.wordmark {
  font-family: var(--serif);
  font-weight: 400;
}
p {
  margin-top: 0;
}

.page-width {
  width: min(1180px, calc(100% - clamp(32px, 9vw, 140px)));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  min-height: 96px;
}
.wordmark {
  font-size: clamp(22px, 2.4vw, 28px);
  letter-spacing: -0.047em;
  white-space: nowrap;
  text-decoration: none;
}
.wordmark i {
  font-size: 0.87em;
}
.wordmark-period {
  color: var(--sage);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 30px;
  color: var(--graphite);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.165em;
  text-transform: uppercase;
}
.eyebrow-stroke {
  display: inline-block;
  flex: none;
  width: 24px;
  height: 5px;
  border-top: 2.5px solid var(--sage);
  border-radius: 45% 57% 28% 30%;
  transform: rotate(-10deg);
}

.intro {
  padding: clamp(32px, 7vw, 84px) 0 clamp(40px, 6vw, 72px);
}
.intro h1 {
  margin: 0 0 28px;
  font-size: clamp(54px, 7vw, 100px);
  line-height: 0.97;
  letter-spacing: -0.064em;
}
.intro h1 em {
  display: inline-block;
  color: var(--sage-deep);
  letter-spacing: -0.058em;
}
.attribution {
  margin: -12px 0 28px;
  color: var(--graphite);
  font-family: var(--serif);
  font-size: 20px;
  font-style: italic;
}
.attribution::before {
  content: '— ';
}
.intro-text {
  max-width: 430px;
  color: var(--ink-muted);
  font-size: 16px;
  line-height: 1.78;
}
.empty {
  margin: 0 0 clamp(64px, 9vw, 120px);
  color: var(--ink-muted);
}

.posts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: clamp(28px, 4vw, 52px);
  margin: 0 0 clamp(64px, 9vw, 120px);
  padding: 0;
  list-style: none;
}
.post-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 14px 14px 26px;
  text-decoration: none;
  background: var(--card);
  border: 1.2px solid var(--graphite-faint);
  border-radius: var(--hand);
  box-shadow: 0 1px 0 #00000008;
  transition:
    transform 0.16s ease-out,
    border-color 0.16s ease-out;
}
.post-link:hover {
  transform: translateY(-2px) rotate(-0.25deg);
  border-color: var(--sage);
}
.post-link img,
.post-blank {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  margin-bottom: 22px;
  border-radius: var(--hand-small);
}
.post-blank {
  background: var(--sage-wash);
  opacity: 0.5;
}
.post-meta {
  margin: 0 8px 10px;
  color: var(--graphite);
  font-size: 13px;
}
.post-link h2 {
  margin: 0 8px 10px;
  font-size: clamp(30px, 3vw, 40px);
  line-height: 1.05;
  letter-spacing: -0.055em;
}
.post-link p:not(.post-meta) {
  flex: 1;
  margin: 0 8px 22px;
  color: var(--ink-muted);
  font-size: 15px;
  line-height: 1.7;
}
.read {
  align-self: flex-start;
  margin-left: 8px;
  padding: 11px 20px 10px;
  color: var(--on-sage);
  background: var(--sage-deep);
  border: 1.5px solid var(--sage-deeper);
  border-radius: 15px 17px 14px 16px / 15px 14px 17px 13px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.025em;
}
.post-link:hover .read {
  background: var(--sage-deeper);
}

.post-page {
  max-width: 720px;
  padding: clamp(24px, 5vw, 64px) 0 clamp(48px, 7vw, 96px);
}
.post-head h1 {
  margin: 0 0 22px;
  font-size: clamp(44px, 6vw, 76px);
  line-height: 1;
  letter-spacing: -0.055em;
}
.lede {
  max-width: 520px;
  margin: 0;
  color: var(--ink-muted);
  font-size: 18px;
  line-height: 1.7;
}
.post-head::after {
  content: '';
  display: block;
  clear: both;
}

.pin,
.fig-card,
.fig-side {
  position: relative;
  padding: 8px 8px 10px;
  background: var(--card);
  border: 1.2px solid var(--graphite-faint);
  border-radius: var(--hand-small);
  box-shadow: 0 1px 4px rgb(0 0 0 / 0.1);
}
.pin::before,
.fig-card::before,
.fig-side::before {
  content: '';
  position: absolute;
  top: -11px;
  left: 50%;
  width: 84px;
  height: 22px;
  translate: -50% 0;
  rotate: -5deg;
  z-index: 1;
  background: color-mix(in srgb, color-mix(in srgb, var(--sage) 55%, var(--card)) 85%, transparent);
}
figure {
  margin: 0;
}
figure img {
  display: block;
  width: 100%;
  border-radius: 6px 5px 7px 4px;
}
figcaption {
  margin-top: 8px;
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 21px;
  text-align: center;
}
.pin {
  float: right;
  width: 230px;
  margin: 0 0 16px 32px;
  rotate: 2.5deg;
}
.pin img {
  aspect-ratio: 1;
  object-fit: cover;
}
@media (max-width: 599px) {
  .pin {
    width: 120px;
    margin: 4px 0 8px 14px;
    padding: 5px 5px 6px;
  }
}

.listen {
  margin: 36px 0 28px;
  padding: 16px 18px 18px;
  background: color-mix(in srgb, var(--sage-wash) 40%, var(--card));
  border: 1.2px solid var(--graphite-faint);
  border-radius: var(--hand);
}
.listen p {
  margin: 0 0 10px;
  color: var(--ink-muted);
  font-size: 14px;
}
.listen strong {
  margin-right: 6px;
  color: var(--ink);
  font-weight: 600;
}
.listen audio {
  display: block;
  width: 100%;
}

.toc {
  margin: 28px 0 8px;
  padding-left: 16px;
  border-left: 2px solid var(--sage-wash);
  font-size: 15px;
  line-height: 26px;
}
.toc p {
  margin: 0 0 4px;
  font-weight: 600;
}
.toc ul {
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--ink-muted);
}

.post-body {
  font-size: 18px;
  line-height: 1.75;
}
.post-body p,
.post-body ul,
.post-body ol {
  margin: 0 0 18px;
}
.post-body li + li {
  margin-top: 6px;
}
.post-body h2 {
  margin: 56px 0 14px;
  font-size: clamp(30px, 3.4vw, 40px);
  line-height: 1.08;
  letter-spacing: -0.045em;
}
.post-body h3 {
  margin: 32px 0 10px;
  font-size: 25px;
  line-height: 1.2;
  letter-spacing: -0.03em;
}
.post-body blockquote {
  margin: 0 0 18px;
  padding-left: 16px;
  border-left: 2px solid var(--sage);
  color: var(--ink-muted);
}

.table-wrap {
  overflow-x: auto;
  margin: 24px 0;
}
.formula {
  overflow-x: auto;
  margin: 24px 0;
  font-size: 22px;
}
table {
  border-collapse: collapse;
  width: 100%;
  min-width: 520px;
  font-size: 15px;
  line-height: 23px;
}
th,
td {
  padding: 10px 12px 10px 0;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--graphite-faint);
}
thead th {
  border-bottom: 2px solid var(--graphite);
}
.align-left {
  text-align: left;
}
.align-center {
  text-align: center;
}
.align-right {
  text-align: right;
}

.fig {
  margin: 40px 12px;
  rotate: -1deg;
}
.fig img {
  aspect-ratio: 3 / 2;
  object-fit: cover;
}
.fig:nth-of-type(even),
.fig-pair:nth-child(even of .fig-pair) .fig {
  rotate: 1.2deg;
}
@media (max-width: 599px) {
  .fig {
    margin: 36px 8px;
  }
}
@media (min-width: 1280px) {
  .fig-pair {
    display: grid;
    grid-template-columns: 100% 380px;
    column-gap: 48px;
    align-items: start;
    margin-bottom: 18px;
  }
  .fig-pair > :last-child {
    grid-area: 1 / 1;
  }
  .fig-pair > :last-child,
  .fig-pair > :last-child > :last-child {
    margin-bottom: 0;
  }
  .fig-pair > .fig-side {
    grid-area: 1 / 2;
    position: sticky;
    top: 32px;
    margin: 0;
  }
}

.note {
  margin: 56px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--graphite-faint);
  color: var(--ink-muted);
  font-size: 14px;
}
.pager {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  font-size: 15px;
}
.pager span:last-child {
  text-align: right;
}

.site-footer {
  padding: 28px 0 40px;
  border-top: 1px solid var(--graphite-faint);
  color: var(--graphite);
  font-size: 13px;
}
.site-footer a {
  text-underline-offset: 5px;
}
.site-footer a:hover {
  color: var(--sage-deep);
}

@media (prefers-reduced-motion: reduce) {
  .post-link {
    transition: none;
  }
  .post-link:hover {
    transform: none;
  }
}
