:root {
  color-scheme: light;
  --paper: #f8f8f5;
  --ink: #202326;
  --quiet: #565a62;
  --link: #254982;
  --line: #d9d9d4;
  --arena: #f0f1f3;
  --reward: #314f96;
  --blob: #334577;
  font-family: Georgia, 'Times New Roman', serif;
  font-synthesis: none;
  line-height: 1.65;
  background: var(--paper);
  color: var(--ink);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-size: 1.09375rem; }
.page { max-width: 46rem; margin-inline: auto; padding: 2.5rem 1.5rem 4rem; }
.page-wide { max-width: 71.25rem; }

a { color: var(--link); text-underline-offset: .18em; text-decoration-thickness: .065em; }
a:hover { text-decoration-thickness: .12em; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 4px; border-radius: 2px; }
main:focus { outline: none; }

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  column-gap: 2rem;
  padding-bottom: .65rem;
  border-bottom: 1px solid var(--line);
}
.name { color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.35rem; }
nav, button, figcaption, .simulation-controls, .sources, time, .cv-date {
  font-family: system-ui, sans-serif;
}
nav { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 1.1rem; font-size: .875rem; }
nav > a, summary { display: inline-flex; align-items: center; min-height: 2rem; }
nav a[aria-current] { color: var(--ink); text-decoration: none; }
.email { position: relative; }
.email summary { cursor: pointer; color: var(--link); text-decoration: underline; text-underline-offset: .18em; }
.email summary::marker { content: ''; }
.email summary::-webkit-details-marker { display: none; }
.email-panel {
  position: absolute;
  z-index: 1;
  top: 100%;
  right: 0;
  display: flex;
  align-items: center;
  gap: .8rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: .2rem;
  padding: .65rem .8rem;
}
.email-panel a { white-space: nowrap; }
button {
  min-height: 2rem;
  padding: .25rem .58rem;
  border: 1px solid #aeb3be;
  border-radius: .22rem;
  font-size: .8125rem;
  line-height: 1.25;
  color: var(--ink);
  background: var(--paper);
  cursor: pointer;
}
button:hover { background: #e8eaf0; }
.skip { position: absolute; inset: .5rem auto auto .5rem; transform: translateY(-180%); background: var(--paper); padding: .4rem; }
.skip:focus { transform: none; z-index: 2; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

main { margin-top: 1.75rem; }
h1, h2 { line-height: 1.17; margin: 0; font-weight: 600; }
h1 { font-size: clamp(2.15rem, 5vw, 2.75rem); letter-spacing: -.027em; }
h2 { font-size: 1.35rem; }
p { margin: 1rem 0; }
li + li { margin-top: .32rem; }
sup { font-size: .68em; line-height: 0; }
sup a { padding-inline: .14em; }
.experience { margin-top: 2rem; }
.experience h3 { margin: 1.25rem 0 .35rem; font-size: 1rem; line-height: 1.35; font-weight: 600; }
.experience p { margin-top: 0; }
.cv-list, .thought-index { padding: 0; list-style: none; }
.sources, .footnotes, .essay-sources { margin-top: 2.1rem; border-top: 1px solid var(--line); padding-top: .85rem; }
.sources h2, .essay-sources h2 { font-size: 1rem; }
.sources, .footnotes, .essay-sources { color: var(--quiet); font-size: .875rem; }
.sources ol, .footnotes ol, .essay-sources ul { padding-left: 1.4em; }
.sources a, .essay-sources a { display: inline-block; min-height: 1.5rem; }
.thought-index li { display: flex; flex-wrap: wrap; align-items: baseline; gap: .15rem 1rem; }
time, .essay-meta { font-size: .875rem; color: var(--quiet); }
.cv-list { margin: .65rem 0 1.55rem; }
.cv-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.cv-date { white-space: nowrap; font-size: .8rem; color: var(--quiet); }

.reward-shortcut { margin: 1.5rem 0 1.65rem; }
figcaption strong { display: block; font-size: .875rem; }
figcaption p { margin: .16rem 0 .55rem; color: var(--quiet); font-size: .8125rem; }
.simulation-field { position: relative; aspect-ratio: 3.3; background: var(--arena); border: 1px solid var(--line); border-radius: .3rem; overflow: hidden; }
.simulation-field :is(svg, canvas) { display: block; width: 100%; height: 100%; }
.simulation-field canvas { position: absolute; inset: 0; touch-action: pan-y; }
.simulation-field[data-live] svg { visibility: hidden; }
.simulation-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; margin: .5rem 0 0; color: var(--quiet); font-size: .8rem; }
.simulation-controls [data-generation] { flex: 1 1 8rem; }
.simulation-key { display: flex; justify-content: space-between; color: var(--quiet); font-family: system-ui, sans-serif; font-size: .75rem; margin-top: .22rem; padding-inline: 9%; }
.simulation-key span:first-child { margin-left: 9%; }

@media (max-width: 34rem) {
  body { font-size: 1.0625rem; }
  .page { padding: 1.1rem 1.1rem 3rem; }
  .site-header { flex-direction: column; align-items: flex-start; gap: .18rem; padding-bottom: .45rem; }
  nav { width: 100%; gap: 0 .85rem; position: relative; }
  .email { position: static; }
  main { margin-top: 1.25rem; }
  .simulation-field { aspect-ratio: 2.45; }
  .cv-list li { display: block; }
  .cv-date { display: inline-block; margin-left: .4rem; }
}

@media print {
  .page { max-width: none; padding: 0; }
  nav, .skip, [download] { display: none; }
}

.page-wide main { margin-top: 0; }
.work { max-width: 43rem; padding: 0 0 4rem; }
.work-section + .work-section { margin-top: 2.4rem; }
.work-section > h2 { margin-bottom: 1.15rem; }
.work-section article + article { margin-top: 1.4rem; }
.work-title { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.work-title h3 { font-size: 1.08rem; margin: 0; font-weight: normal; }
.work-date { color: var(--quiet); white-space: nowrap; font: .8rem system-ui, sans-serif; }
.work-section p { margin: .3rem 0 0; }
.cv-list { margin: .8rem 0 1.8rem; }
.cv-list li { display: block; }
.cv-list li + li { margin-top: 1.1rem; }
.cv-entry { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.cv-list p { margin: .22rem 0 0; color: var(--quiet); font-size: .95rem; }
@media (max-width: 34rem) {
  .cv-entry { display: block; }
  .cv-date { margin-left: 0; }
}

.work-section h3 { font-size: 1.08rem; margin: 0; font-weight: normal; }
.past-list { margin: 0; padding: 0; list-style: none; }
.past-work { margin-top: 2.4rem; }
.past-work > summary { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding-block: .5rem; cursor: pointer; list-style: none; }
.past-work > summary::marker { content: ''; }
.past-work > summary::-webkit-details-marker { display: none; }
.disclosure-mark { font: 1.15rem system-ui, sans-serif; color: var(--quiet); transition: transform .18s ease; }
.past-work[open] > summary .disclosure-mark { transform: rotate(45deg); }
.past-list { padding-top: .75rem; }
.past-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding-block: .45rem; }
.past-list li + li { margin-top: 0; }
@media (prefers-reduced-motion: reduce) {
  .disclosure-mark { transition: none; }
}
