/* Site styles for the book-page design. */
:root {
  color-scheme: light;
}
body {
  margin: 0;
}
img {
  max-width: 100%;
}
[hidden] {
  display: none !important;
}

/* Layout: one text column with a live right-hand margin (notes and figures); a single full-width plate opens the page. */
:root {
  --paper: #f3f5f0;
  --ink: #1a2620;
  --mute: #4d5a52;
  --rule: rgba(26, 38, 32, 0.22);
  --wash: rgba(26, 38, 32, 0.05);
  --rubric: #a63a24;
  --figbg: #ffffff;
  --diagram-filter: none;
  --photo-filter: none;
  --heat-filter: saturate(0.74);
  --serif: "EB Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --mw: 264px;
  --gap: 56px;
  --head: 52px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #111613;
    --ink: #e6e3d5;
    --mute: #a5ab9e;
    --rule: rgba(230, 227, 213, 0.2);
    --wash: rgba(230, 227, 213, 0.06);
    --rubric: #e88a6e;
    --figbg: #ffffff;
    --diagram-filter: invert(0.91) hue-rotate(180deg);
    --photo-filter: brightness(0.9);
    --heat-filter: saturate(0.62) brightness(0.84);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #111613;
  --ink: #e6e3d5;
  --mute: #a5ab9e;
  --rule: rgba(230, 227, 213, 0.2);
  --wash: rgba(230, 227, 213, 0.06);
  --rubric: #e88a6e;
  --figbg: #ffffff;
  --diagram-filter: invert(0.91) hue-rotate(180deg);
  --photo-filter: brightness(0.9);
  --heat-filter: saturate(0.62) brightness(0.84);
  color-scheme: dark;
}

html {
  scroll-behavior: smooth;
}
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(19px, 0.5vw + 16px, 21px);
  line-height: 1.55;
  font-variant-numeric: oldstyle-nums;
  font-kerning: normal;
  font-feature-settings:
    "liga" 1,
    "kern" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 10;
  background: var(--paper);
}
.theming,
.theming * {
  transition:
    background-color 0.5s ease,
    color 0.5s ease,
    border-color 0.5s ease,
    filter 0.5s ease,
    transform 0.6s cubic-bezier(0.3, 0.7, 0.2, 1),
    opacity 0.25s ease !important;
}

.page {
  max-width: 1080px;
  margin: 0 auto;
  padding-inline: clamp(0px, 3vw, 40px);
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition:
    color 0.18s ease,
    text-decoration-color 0.18s ease;
}
a:hover {
  color: var(--rubric);
  text-decoration-color: var(--rubric);
}
a:focus-visible,
button:focus-visible {
  outline: 1.5px solid var(--rubric);
  outline-offset: 3px;
  border-radius: 1px;
}
::selection {
  background: var(--ink);
  color: var(--paper);
}
.sc {
  font-variant-caps: all-small-caps;
  letter-spacing: 0.09em;
}
.name {
  font-variant-caps: small-caps;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.nw {
  white-space: nowrap;
}
p {
  margin: 0;
}
img {
  height: auto;
}
.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Running head */
.head {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 24px;
  height: var(--head);
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.head .who {
  text-decoration: none;
  font-size: 0.93em;
  letter-spacing: 0.13em;
  white-space: nowrap;
}
.head .where {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  font-style: italic;
  font-size: 0.9em;
  color: var(--mute);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.head .where.on {
  opacity: 1;
}
.head .where b {
  font-weight: 400;
  font-style: normal;
  color: var(--rubric);
  margin-right: 0.5em;
}
.rh-nav {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 22px;
  margin-left: auto;
  font-style: italic;
  font-size: 0.9em;
}
.rh-nav a {
  text-decoration: none;
  line-height: var(--head);
  white-space: nowrap;
}
.theme {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-right: -13px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}
.theme svg {
  width: 17px;
  height: 17px;
  transition: transform 0.6s cubic-bezier(0.3, 0.7, 0.2, 1);
}
.theme:hover {
  color: var(--rubric);
}
.is-dark .theme svg {
  transform: rotate(180deg);
}
.rh-progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 1px;
  width: 100%;
  background: var(--rubric);
  transform-origin: 0 50%;
  transform: scaleX(var(--p, 0));
}
@media (max-width: 760px) {
  .head .where {
    display: none;
  }
}
@media (max-width: 560px) {
  .rh-nav a {
    display: none;
  }
}

/* Title */
.title {
  padding-top: clamp(40px, 7vw, 76px);
}
.eyebrow {
  color: var(--rubric);
  font-size: 0.88em;
  letter-spacing: 0.13em;
  line-height: 1.35;
}
h1 {
  margin: 0.14em 0 0;
  font-weight: 400;
  font-size: clamp(50px, 9.4vw, 112px);
  line-height: 0.96;
  letter-spacing: -0.014em;
  text-wrap: balance;
}
h1 em {
  font-style: italic;
}

/* Plate */
.plate {
  position: relative;
  isolation: isolate;
  width: 100%;
  aspect-ratio: 2.05;
  margin-top: clamp(6px, 1.4vw, 16px);
  touch-action: pan-y pinch-zoom;
  user-select: none;
  -webkit-user-select: none;
}
.plate canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: pan-y pinch-zoom;
}
.plate.dragging canvas {
  cursor: grabbing;
}
.plate.aim canvas {
  cursor: pointer;
}
.flag {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  padding: 0 0 calc(17px + var(--lift, 0px));
  white-space: nowrap;
  font-size: 15.5px;
  line-height: 1.1;
  letter-spacing: 0.015em;
  text-decoration: none;
  color: var(--ink);
  transition:
    padding-bottom 0.25s ease,
    opacity 0.25s ease,
    color 0.18s ease;
}
.flag::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 1px;
  height: calc(13px + var(--lift, 0px));
  background: currentColor;
  opacity: 0.65;
  transition: height 0.25s ease;
}
.flag .l {
  display: block;
  padding: 1px 5px 2px;
  text-shadow:
    0 0 2px var(--paper),
    0 0 3px var(--paper),
    0 0 5px var(--paper),
    0 0 8px var(--paper),
    0 0 12px var(--paper);
}
.flag .c {
  margin-left: 0.4em;
  color: var(--rubric);
}
.flag.lit,
.flag:hover,
.flag:focus-visible {
  color: var(--rubric);
}

/* Sections */
.sec {
  margin-top: clamp(52px, 7vw, 76px);
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  scroll-margin-top: calc(var(--head) + 8px);
}
.sec > h2 {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 0 0 24px;
  font-weight: 400;
  font-style: italic;
  font-size: 1.45em;
  line-height: 1.2;
}
.sec > h2 .no {
  font-style: normal;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.1em;
  font-size: 0.62em;
  color: var(--rubric);
  white-space: nowrap;
}
.body {
  padding-right: calc(var(--mw) + var(--gap));
}
.mn {
  float: right;
  clear: right;
  width: var(--mw);
  margin: 0 calc(-1 * (var(--mw) + var(--gap))) 18px 0;
}
.note {
  font-style: italic;
  font-size: 0.8em;
  line-height: 1.42;
  color: var(--mute);
}
.note .sc {
  font-style: normal;
  color: var(--rubric);
  margin-right: 0.3em;
}
.prose p + p {
  margin-top: 0.9em;
}
.prose p {
  text-wrap: pretty;
}
.prose.lead > p:first-child::first-letter {
  float: left;
  font-size: 5.75em;
  line-height: 0.69;
  margin: 0.045em 0.07em 0 -0.02em;
  color: var(--rubric);
  font-variant-caps: normal;
  letter-spacing: 0;
}
.interests {
  margin-top: 1.1em;
  font-size: 0.93em;
  line-height: 1.5;
}
.interests .sc {
  color: var(--mute);
  margin-right: 0.6em;
}
.about {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--mw);
  column-gap: var(--gap);
  align-items: start;
}
.about .side {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.portrait {
  margin: 0;
}
.portrait img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border: 1px solid var(--rule);
  box-sizing: border-box;
  filter: var(--photo-filter);
}

/* Publications */
.pubs ol.bibliography {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 30px;
}
.pub {
  position: relative;
  display: flow-root;
  padding-left: 46px;
  scroll-margin-top: calc(var(--head) + 24px);
}
.pub::before {
  content: "";
  position: absolute;
  inset: -10px -14px -6px -14px;
  background: var(--wash);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.pub.is-lit::before {
  opacity: 1;
}
.pub:target::before {
  animation: flash 2.2s ease 0.2s;
}
@keyframes flash {
  0%,
  100% {
    opacity: 0;
  }
  18%,
  55% {
    opacity: 1;
  }
}
.pub > * {
  position: relative;
}
.pub .n {
  position: absolute;
  left: 0;
  top: 0.2em;
  font-size: 0.9em;
  color: var(--rubric);
  transition: transform 0.25s ease;
}
.pub.is-lit .n {
  transform: translateX(3px);
}
.pub h3 {
  margin: 0;
  font-weight: 400;
  font-style: italic;
  font-size: 1.2em;
  line-height: 1.25;
  text-wrap: balance;
}
.pub h3 a {
  text-decoration: none;
}
.pub .by {
  margin-top: 5px;
  font-size: 0.92em;
  line-height: 1.45;
}
.pub .in {
  font-size: 0.86em;
  line-height: 1.45;
  color: var(--mute);
}
.pub .links {
  display: flex;
  flex-wrap: wrap;
  column-gap: 18px;
  font-style: italic;
  font-size: 0.86em;
}
.pub .links a {
  line-height: 40px;
}
.pub .fig {
  margin-top: 5px;
  margin-bottom: 0;
}
.pub .fig img {
  display: block;
  width: 100%;
  aspect-ratio: 8 / 3;
  object-fit: contain;
  background: var(--figbg);
  border: 1px solid var(--rule);
  box-sizing: border-box;
}
.pub .fig img.diagram {
  filter: var(--diagram-filter);
}
.pub .fig img.heat {
  object-fit: cover;
  filter: var(--heat-filter);
}
.pub aside.mn {
  margin-top: 7px;
  margin-bottom: 0;
}

/* Notes */
.toc {
  display: flex;
  flex-direction: column;
}
.toc a {
  display: block;
  padding: 6px 0;
  text-decoration: none;
}
.toc .row {
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.toc .t {
  line-height: 1.3;
}
.toc .dots {
  flex: 1 1 24px;
  min-width: 16px;
  border-bottom: 1px dotted var(--mute);
  transform: translateY(-0.28em);
  opacity: 0.75;
  transition:
    border-color 0.18s ease,
    opacity 0.18s ease;
}
.toc a:hover .dots,
.toc a:focus-visible .dots {
  border-color: var(--rubric);
  opacity: 1;
}
.toc .date {
  font-size: 0.86em;
  color: var(--mute);
  white-space: nowrap;
}
.toc .d {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  font-style: italic;
  font-size: 0.8em;
  line-height: 1.4;
  color: var(--mute);
}
#toc-note {
  transition: transform 0.35s cubic-bezier(0.3, 0.7, 0.2, 1);
  padding-top: 0.55em;
  margin-bottom: 0;
}

/* Teaching and service */
.cv-list {
  display: grid;
  grid-template-columns: 10em minmax(0, 1fr);
  column-gap: 24px;
  row-gap: 18px;
  margin: 0;
}
.cv-list dt {
  font-variant-caps: all-small-caps;
  letter-spacing: 0.09em;
  font-size: 0.9em;
  line-height: 1.3;
  color: var(--mute);
  padding-top: 0.2em;
}
.cv-list dt .when {
  display: block;
  margin-top: 3px;
  font-variant-caps: normal;
  font-style: italic;
  letter-spacing: 0;
  font-size: 0.89em;
  white-space: nowrap;
}
.cv-list dd {
  position: relative;
  margin: 0;
}
.cv-list dd p + p {
  margin-top: 2px;
  font-size: 0.9em;
  line-height: 1.45;
  color: var(--mute);
}
.bb {
  position: absolute;
  top: 5px;
  left: calc(100% + var(--gap));
  width: var(--mw);
  margin: 0;
}
.tape {
  display: flex;
  gap: 3px;
  width: 100%;
  padding: 2px 0 13px;
  border: 0;
  background: none;
  cursor: pointer;
}
.tape i {
  position: relative;
  flex: 1 1 0;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--rule);
  box-sizing: border-box;
  transition:
    background-color 0.12s ease,
    border-color 0.12s ease;
}
.tape i.on {
  background: var(--ink);
  border-color: var(--ink);
}
.tape i.at::after {
  content: "";
  position: absolute;
  left: 50%;
  top: calc(100% + 3px);
  margin-left: -4px;
  border: 4px solid transparent;
  border-top: 0;
  border-bottom: 6px solid var(--rubric);
}
.rules {
  display: grid;
  grid-template-columns: 1.4em repeat(4, minmax(0, 1fr));
  column-gap: 4px;
  row-gap: 1px;
  margin: 0 0 8px;
  font-size: 0.74em;
  line-height: 1.5;
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: 0.05em;
  color: var(--mute);
}
.rules span {
  text-align: center;
  padding: 0 2px;
  transition:
    color 0.12s ease,
    background-color 0.12s ease;
}
.rules .k {
  text-align: left;
  padding-left: 0;
  font-style: italic;
  letter-spacing: 0;
}
.rules .st {
  color: var(--ink);
}
.rules .on {
  color: var(--paper);
  background: var(--rubric);
}
.bb figcaption {
  font-style: italic;
  font-size: 0.8em;
  line-height: 1.42;
  color: var(--mute);
  min-height: 2.9em;
}
.bb figcaption .sc {
  font-style: normal;
  color: var(--rubric);
  margin-right: 0.3em;
}
.bb #bb-status {
  font-variant-numeric: tabular-nums oldstyle-nums;
}

/* Colophon */
.colophon {
  margin-top: clamp(56px, 8vw, 88px);
  padding: 22px 0 64px;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  column-gap: 40px;
  row-gap: 6px;
}
.colophon .mail {
  font-style: italic;
}
.colophon nav {
  display: flex;
  flex-wrap: wrap;
  column-gap: 22px;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.1em;
  font-size: 0.9em;
}
.colophon nav a {
  text-decoration: none;
  line-height: 40px;
}
.colophon .fine-print {
  flex: 1 1 100%;
  margin-top: 10px;
  font-style: italic;
  font-size: 0.8em;
  color: var(--mute);
}

/* Narrow: the margin folds into the column */
@media (max-width: 880px) {
  :root {
    --mw: 0px;
    --gap: 0px;
  }
  .body {
    padding-right: 0;
  }
  .mn {
    float: none;
    width: auto;
    margin: 0 0 16px;
  }
  .about {
    grid-template-columns: minmax(0, 1fr);
  }
  .about .side {
    order: -1;
    flex-direction: row;
    align-items: flex-end;
    gap: 18px;
    margin-bottom: 24px;
  }
  .about .portrait {
    flex: 0 0 min(44%, 210px);
  }
  .about .side .note {
    flex: 1 1 0;
    min-width: 0;
  }
  .pub {
    display: flex;
    flex-direction: column;
  }
  .pub .fig {
    order: 9;
    width: min(100%, 340px);
    margin: 10px 0 0;
  }
  .pub aside.mn {
    order: 9;
    margin: 4px 0 0;
  }
  .toc .d {
    position: static;
    display: block;
    width: auto;
    height: auto;
    overflow: visible;
    clip-path: none;
    white-space: normal;
    padding-right: 2em;
  }
  #toc-note {
    margin-bottom: 10px;
    padding-top: 0;
  }
  .cv-list dd {
    display: flex;
    flex-direction: column;
  }
  .bb {
    position: static;
    order: 9;
    width: min(100%, 300px);
    margin: 14px 0 4px;
  }
}
@media (max-width: 520px) {
  .plate {
    aspect-ratio: 1.35;
  }
  .pub {
    padding-left: 34px;
  }
  .cv-list {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 2px;
  }
  .cv-list dt .when {
    display: inline;
    margin-left: 0.6em;
  }
  .cv-list dd {
    margin-bottom: 16px;
  }
  .colophon nav {
    flex: 1 1 100%;
    justify-content: space-between;
    column-gap: 8px;
    letter-spacing: 0.06em;
    font-size: 0.84em;
  }
  .eyebrow {
    font-size: 0.82em;
    letter-spacing: 0.1em;
  }
  .eyebrow .nw {
    white-space: normal;
  }
}
@media (hover: none) {
  .toc .d {
    position: static;
    display: block;
    width: auto;
    height: auto;
    overflow: visible;
    clip-path: none;
    white-space: normal;
    padding-right: 2em;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
