/* Fonts: Fraunces, Source Sans 3, JetBrains Mono (SIL Open Font License). */
@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/fraunces-latin-opsz-normal.woff2") format("woff2"); }
@font-face { font-family: "Fraunces"; font-style: italic; font-weight: 100 900; font-display: swap;
  src: url("../fonts/fraunces-latin-opsz-italic.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 200 900; font-display: swap;
  src: url("../fonts/source-sans-3-latin-wght-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-style: italic; font-weight: 200 900; font-display: swap;
  src: url("../fonts/source-sans-3-latin-wght-italic.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap;
  src: url("../fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2"); }

:root {
  --paper: #f6f1e7;
  --paper-2: #eee7d6;
  --card: #fcf9f2;
  --ink: #1c1a17;
  --ink-2: #453f36;
  --muted: #6a6356;
  --rule: #d8cfbb;
  --accent: #9b2226;
  --accent-ink: #fff8f0;
  --blue: #1f3a68;
  --shadow: 0 1px 0 rgba(28, 26, 23, .04), 0 12px 28px -18px rgba(28, 26, 23, .35);
  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --paper: #14130f; --paper-2: #1b1a15; --card: #1e1c17; --ink: #efe9db; --ink-2: #cfc8b8;
  --muted: #a0988a; --rule: #36322a; --accent: #f08c7d; --accent-ink: #1b0f0d; --blue: #a3bdee;
  --shadow: 0 12px 28px -18px rgba(0, 0, 0, .8);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #14130f; --paper-2: #1b1a15; --card: #1e1c17; --ink: #efe9db; --ink-2: #cfc8b8;
    --muted: #a0988a; --rule: #36322a; --accent: #f08c7d; --accent-ink: #1b0f0d; --blue: #a3bdee;
    --shadow: 0 12px 28px -18px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 1.5rem; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 1.125rem/1.6 var(--sans);
  text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.1; margin: 0; text-wrap: balance; }
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration-color: var(--accent); text-decoration-thickness: 1.5px; text-underline-offset: .2em; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--accent); color: var(--accent-ink); }

.wrap { width: min(100% - 2.5rem, 72rem); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper); padding: .6rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; top: 1rem; }

.eyebrow, .label, .pub__year, .row__when, .tags, .jump, .shelf__year, .pill {
  font-family: var(--mono); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase;
}
.eyebrow { color: var(--accent); margin-bottom: 1.25rem; font-weight: 500; }
.label { color: var(--muted); margin-bottom: .6rem; }
.lead { font-size: clamp(1.15rem, 1rem + .7vw, 1.4rem); line-height: 1.5; color: var(--ink-2); max-width: 38em; }

/* Header */
.site-header { border-bottom: 1px solid var(--rule); }
.site-header__in { display: flex; align-items: center; gap: .75rem 2rem; flex-wrap: wrap; padding-block: 1.1rem; }
.brand { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; text-decoration: none; margin-right: auto; letter-spacing: -.01em; }
.brand__mark { color: var(--accent); margin-right: .45rem; }
.nav { display: flex; gap: 1.6rem; }
.nav a { text-decoration: none; font-size: .98rem; padding-block: .3rem; border-bottom: 2px solid transparent; }
.nav a:hover { border-color: var(--rule); color: inherit; }
.nav a[aria-current="page"] { border-color: var(--accent); }
.theme-toggle { background: none; border: 1px solid var(--rule); color: var(--ink-2); width: 2.25rem; height: 2.25rem; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.theme-toggle:hover { border-color: var(--ink); color: var(--ink); }

/* Buttons and links */
.button { display: inline-block; background: var(--ink); color: var(--paper); padding: .7rem 1.2rem; border-radius: 4px; text-decoration: none; font-weight: 600; font-size: 1rem; border: 1.5px solid var(--ink); transition: background .15s, color .15s, border-color .15s; }
.button:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.button--ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.button--ghost:hover { background: transparent; color: var(--accent); border-color: var(--accent); }
.links { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; margin: 0; font-weight: 600; font-size: .98rem; }
.links--stack { flex-direction: column; }
.arrow { text-decoration: none; }
.arrow::after { content: "→"; display: inline-block; margin-left: .35em; color: var(--accent); transition: transform .15s; }
.arrow:hover::after { transform: translateX(3px); }
.quiet { color: var(--muted); font-weight: 400; }

/* Home hero */
.hero { padding-block: clamp(2.5rem, 7vw, 5.5rem) 0; }
.hero__in { display: grid; grid-template-columns: minmax(0, 1fr) clamp(13rem, 26vw, 20rem); gap: clamp(2rem, 6vw, 5rem); align-items: center; }
.hero h1 { font-size: clamp(3.4rem, 1.6rem + 9vw, 8rem); font-weight: 400; letter-spacing: -.035em; line-height: .92; margin-bottom: 1.75rem; font-variation-settings: "opsz" 144; }
.hero__cta { display: flex; flex-wrap: wrap; gap: .7rem; margin: 2rem 0 0; }
.portrait { margin: 0; }
.portrait picture { display: block; position: relative; }
.portrait img { border-radius: 4px; aspect-ratio: 4 / 5; object-fit: cover; width: 100%; position: relative; }
.portrait picture::before { content: ""; position: absolute; inset: 0; transform: translate(.9rem, .9rem); border: 1.5px solid var(--accent); border-radius: 4px; }
.portrait figcaption { margin-top: 1.75rem; font-weight: 600; }
.portrait--small { width: min(100%, 17.5rem); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); margin: clamp(3rem, 7vw, 5rem) 0 0; border-top: 1px solid var(--ink); }
.stats--3 { grid-template-columns: repeat(3, 1fr); margin-top: 0; }
.stat { display: flex; flex-direction: column-reverse; justify-content: flex-end; padding: 1.4rem 1.5rem 1.6rem 0; }
.stat + .stat { padding-left: 1.5rem; border-left: 1px solid var(--rule); }
.stat dd { margin: 0 0 .5rem; font-family: var(--serif); font-size: clamp(1.9rem, 1.2rem + 2vw, 2.9rem); line-height: 1; letter-spacing: -.02em; white-space: nowrap; }
.stat dd small { font-size: .45em; color: var(--muted); margin-left: .3em; letter-spacing: 0; }
.stat dt { color: var(--muted); font-size: .92rem; line-height: 1.4; max-width: 17em; }

/* Inner page hero */
.page-hero { padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(2rem, 5vw, 3.5rem); }
.page-hero h1 { font-size: clamp(2.5rem, 1.5rem + 4.6vw, 4.8rem); font-weight: 400; letter-spacing: -.03em; line-height: 1; margin-bottom: 1.5rem; font-variation-settings: "opsz" 144; max-width: 14em; }
.jump { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 2rem; }
.jump a { display: block; text-decoration: none; border: 1px solid var(--rule); border-radius: 999px; padding: .45rem .9rem; color: var(--ink-2); }
.jump a:hover { border-color: var(--accent); color: var(--accent); }
.aside { border-left: 3px solid var(--accent); padding: .2rem 0 .2rem 1rem; color: var(--ink-2); max-width: 46em; margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.about { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.prose { max-width: 40em; font-size: 1.1rem; }
.prose p:first-child { font-size: 1.25rem; line-height: 1.5; color: var(--ink); }
.prose p { color: var(--ink-2); }
.minor { font-family: var(--mono); font-size: .75rem; font-weight: 400; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 2rem 0 .9rem; }

/* Sections: title on the left, content on the right */
.section { border-top: 1px solid var(--rule); padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.section__in { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); gap: 1.5rem clamp(2rem, 5vw, 4.5rem); }
.section__head h2 { font-size: clamp(1.7rem, 1.3rem + 1.2vw, 2.15rem); letter-spacing: -.015em; margin-bottom: .9rem; }
.section__head h2::before { content: ""; display: block; width: 2rem; height: 3px; background: var(--accent); margin-bottom: 1.1rem; }
.section__blurb { color: var(--muted); font-size: .98rem; }
.section__head .links { margin-top: 1.2rem; }
@media (min-width: 60rem) { .section__head { position: sticky; top: 1.5rem; align-self: start; } }

/* Audience cards */
.audiences { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.audience { background: var(--card); border: 1px solid var(--rule); border-radius: 6px; padding: 1.5rem; display: flex; flex-direction: column; }
.audience h3 { font-size: 1.45rem; margin-bottom: .8rem; }
.audience p { color: var(--ink-2); font-size: 1rem; }
.audience .label { margin-bottom: .2rem; color: var(--accent); }
.audience .links { margin-top: auto; padding-top: .5rem; }

/* Book covers */
.cover { display: flex; flex-direction: column; aspect-ratio: 3 / 4; padding: 9% 9% 8%; border-radius: 3px 6px 6px 3px; color: #f8f1e1; position: relative; overflow: hidden; box-shadow: var(--shadow); text-decoration: none; background-color: var(--c); container-type: inline-size; }
.cover::before { content: ""; position: absolute; inset: 0; background: var(--p); opacity: .55; }
.cover::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 4%; background: linear-gradient(90deg, rgba(0,0,0,.28), rgba(0,0,0,0)); }
.cover > * { position: relative; }
.cover__kicker { font-family: var(--mono); font-size: 5cqw; letter-spacing: .1em; text-transform: uppercase; opacity: .85; }
.cover__title { font-family: var(--serif); font-size: 13.5cqw; line-height: 1.02; letter-spacing: -.02em; margin-top: auto; font-variation-settings: "opsz" 144; text-wrap: balance; }
.cover__sub { font-size: 5.6cqw; line-height: 1.3; margin-top: 5cqw; opacity: .9; }
.cover__author { font-size: 5.6cqw; margin-top: 8cqw; padding-top: 5cqw; border-top: 1px solid rgba(248, 241, 225, .45); }
.cover--blue  { --c: #1f3a68; --p: radial-gradient(circle at 1px 1px, rgba(255,255,255,.28) 1.5px, transparent 2px) 0 0 / 14px 14px; }
.cover--green { --c: #1d5243; --p: repeating-linear-gradient(0deg, rgba(255,255,255,.13) 0 1px, transparent 1px 16px), repeating-linear-gradient(90deg, rgba(255,255,255,.13) 0 1px, transparent 1px 16px); }
.cover--plum  { --c: #4a2a5c; --p: repeating-linear-gradient(0deg, rgba(255,255,255,.16) 0 2px, transparent 2px 22px); }
.cover--amber { --c: #99500f; --p: repeating-radial-gradient(circle at 100% 0, rgba(255,255,255,.16) 0 1px, transparent 1px 22px); }
.cover--red   { --c: #8f1d22; --p: repeating-linear-gradient(135deg, rgba(255,255,255,.13) 0 1px, transparent 1px 14px); }
.cover::before { -webkit-mask-image: linear-gradient(180deg, #000 0, #000 30%, transparent 62%); mask-image: linear-gradient(180deg, #000 0, #000 30%, transparent 62%); }

.shelf { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1rem, 3vw, 2rem); }
.shelf__item { text-decoration: none; display: block; }
.shelf__item .cover { transition: transform .2s ease; }
.shelf__item:hover .cover { transform: translateY(-5px) rotate(-.6deg); }
.shelf__year { display: block; margin-top: .9rem; color: var(--muted); }

.books { display: grid; gap: clamp(2rem, 4vw, 3rem); }
.book { display: grid; grid-template-columns: clamp(8.5rem, 20vw, 12.5rem) minmax(0, 1fr); gap: clamp(1.25rem, 4vw, 2.5rem); align-items: start; scroll-margin-top: 1.5rem; }
.book h3 { font-size: clamp(1.4rem, 1.2rem + .8vw, 1.8rem); margin-bottom: .8rem; }
.book p { color: var(--ink-2); max-width: 38em; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: 1.25rem; }
.card { background: var(--card); border: 1px solid var(--rule); border-radius: 6px; padding: 1.5rem; display: flex; flex-direction: column; scroll-margin-top: 1.5rem; transition: border-color .15s, box-shadow .15s; }
.card:hover { border-color: var(--ink-2); box-shadow: var(--shadow); }
.card h3 { font-size: 1.5rem; margin-bottom: .75rem; letter-spacing: -.01em; }
.card p { color: var(--ink-2); font-size: 1rem; }
.card .links { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--rule); }
.tags { display: flex; flex-wrap: wrap; gap: .35rem .9rem; color: var(--muted); margin-bottom: 1.1rem; text-transform: none; letter-spacing: 0; font-size: .78rem; }
.tags li + li::before { content: "/"; margin-right: .9rem; color: var(--rule); }

.card--project { overflow: hidden; }
.card__art { margin: -1.5rem -1.5rem 1.4rem; aspect-ratio: 16 / 10; border-bottom: 1px solid var(--rule); background: var(--paper-2); overflow: hidden; }
.card__art img { width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform .35s ease; }
.card--project:hover .card__art img { transform: scale(1.03); }
.card__art--blank { display: grid; place-items: center; padding: 1.5rem; text-align: center; background: radial-gradient(circle at 1px 1px, var(--rule) 1.5px, transparent 2px) 0 0 / 16px 16px, var(--paper-2); }
.card__art--blank span { font-family: var(--serif); font-size: clamp(1.8rem, 1.2rem + 2vw, 2.6rem); line-height: 1; letter-spacing: -.02em; color: var(--accent); font-variation-settings: "opsz" 144; }

/* Publications and dated rows */
.pubs, .rows { display: grid; }
.pub, .row { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: 1rem; padding-block: 1.25rem; border-top: 1px solid var(--rule); scroll-margin-top: 1.5rem; }
.pub:first-child, .row:first-child { border-top: 0; padding-top: 0; }
.pub__year, .row__when { color: var(--muted); padding-top: .4rem; letter-spacing: .04em; }
.pub__title, .row h3 { font-size: 1.3rem; line-height: 1.25; margin-bottom: .35rem; font-weight: 500; }
.pub__venue, .row p { color: var(--ink-2); margin-bottom: .4rem; font-size: 1rem; max-width: 44em; }
.pub__note { color: var(--muted); font-size: .96rem; margin-bottom: .5rem; max-width: 44em; }
.pub .links { margin-top: .3rem; }
.row__org { color: var(--accent) !important; font-weight: 600; }
.row div > p:last-child { margin-bottom: 0; }
.pill { display: inline-block; vertical-align: middle; margin-left: .5rem; padding: .2rem .55rem; border: 1px solid var(--accent); color: var(--accent); border-radius: 999px; font-size: .65rem; font-weight: 500; }

/* Chips */
.courses + .courses { margin-top: 2rem; }
.courses h3 { font-size: 1.3rem; margin-bottom: .9rem; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chips li { border: 1px solid var(--rule); background: var(--card); border-radius: 999px; padding: .4rem .9rem; font-size: .96rem; }
.chips span { font-family: var(--mono); font-size: .78rem; color: var(--accent); margin-left: .3rem; }
.chips--plain li { background: transparent; }
.section__body > .stats { margin-bottom: 2.5rem; }
.prose-list { display: grid; gap: 1rem; max-width: 44em; color: var(--ink-2); }
.prose-list li { padding-left: 1.2rem; position: relative; }
.prose-list li::before { content: ""; position: absolute; left: 0; top: .7em; width: .45rem; height: 2px; background: var(--accent); }
.contact__lead { font-family: var(--serif); font-size: clamp(1.3rem, 1.1rem + .9vw, 1.7rem); line-height: 1.35; max-width: 30em; margin-bottom: 1.5rem; }
#contact .links { margin-top: 1.5rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--ink); background: var(--paper-2); margin-top: clamp(2rem, 5vw, 4rem); font-size: .98rem; color: var(--ink-2); }
.site-footer__in { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 2rem; padding-block: 3rem; }
.site-footer__name { font-family: var(--serif); font-size: 1.4rem; color: var(--ink); margin-bottom: .6rem; }
.site-footer__name span { color: var(--accent); }
.site-footer p { margin-bottom: 0; }
.site-footer .label { margin-bottom: .6rem; }
.plain li + li { margin-top: .15rem; }

@media (max-width: 60rem) {
  .section__in { grid-template-columns: 1fr; }
  .audiences { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { padding-left: 0; border-left: 0; }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--rule); }
  .stats--3 { grid-template-columns: repeat(3, 1fr); }
  .stats--3 .stat:nth-child(3) { padding-left: 1.5rem; border-left: 1px solid var(--rule); border-top: 0; }
}
@media (max-width: 44rem) {
  body { font-size: 1.0625rem; }
  .hero__in, .about { grid-template-columns: 1fr; }
  .hero .portrait { width: min(62%, 15rem); order: -1; }
  .about .portrait { order: -1; width: min(55%, 13rem); }
  .nav { gap: 1.1rem; }
  .site-header__in { gap: .6rem 1rem; }
  .brand { width: 100%; }
  .theme-toggle { margin-left: auto; }
  .pub, .row { grid-template-columns: 1fr; gap: .2rem; }
  .pub__year, .row__when { padding-top: 0; }
  .site-footer__in { grid-template-columns: 1fr; }
  .stats--3 { grid-template-columns: 1fr; }
  .stats--3 .stat { padding-left: 0 !important; border-left: 0 !important; }
  .stats--3 .stat + .stat { border-top: 1px solid var(--rule); }
  .shelf { gap: .75rem; }
}
@media (max-width: 26rem) {
  .book { grid-template-columns: 1fr; }
  .book .cover { width: 60%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
@media print {
  .site-header nav, .theme-toggle, .jump, .hero__cta { display: none; }
  body { background: #fff; color: #000; }
}
