:root {
  color-scheme: dark;
  --background: #101b2d;
  --text: #edf0f5;
  --link: #acc9e5;
  --muted: #96a6bb;
  --line: #2b384c;
  --semester-line: #52627b;
  --course-line: #2b384c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

::selection { background: #acc9e5; color: #101b2d; }

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover { color: #fff; }
a:focus-visible { outline: 2px solid var(--link); outline-offset: 5px; }

.visually-hidden,
.skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link:focus {
  position: absolute;
  z-index: 1;
  top: 8px;
  left: 20px;
  padding: 8px 12px;
  background: var(--text);
  color: var(--background);
}

.site-header { width: min(623px, calc(100% - 57px)); margin-inline: auto; border-bottom: 1px solid var(--semester-line); }

.header-inner,
.page {
  width: min(623px, calc(100% - 57px));
  margin-inline: auto;
}

.header-inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 120px; padding-block: 38px;
}

.site-title { margin: 0; font: inherit; }

.site-name {
  color: var(--text);
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -.6px;
  text-decoration: none;
}

nav {
  display: flex;
  gap: 24px;
  font-size: 17px;
}

nav a {
  padding-block: 2px;
  color: var(--muted);
  text-decoration: none;
  transition: color 120ms ease;
  border-bottom: 1px solid transparent;
}

nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--text); }
nav a:hover { color: var(--text); }

.page {
  padding-block: 47px 60px;
  animation: page-enter 130ms ease-out;
  transition: opacity 90ms ease-in;
}
.page.is-leaving { animation: none; opacity: 0; }

@keyframes page-enter {
  from { opacity: 0; }
  to { opacity: 1; }
}

.profile {
  display: grid;
  grid-template-columns: 178px minmax(0, 1fr);
  align-items: start;
  gap: 22px;
  margin-bottom: 38px;
}
.page-heading { margin: 0 0 32px; font-size: 33px; font-weight: 600; line-height: 1.3; letter-spacing: -.8px; }
.profile-details .page-heading { margin-bottom: 5px; font-size: 30px; }
.bio { font-size: 19px; line-height: 1.65; }
.bio p { margin-bottom: 24px; }
.contact-list { margin: 13px 0 0; font-family: "SFMono-Regular", Consolas, monospace; font-size: 13px; }
.contact-list > div { display: flex; gap: 9px; padding-block: 5px; border-block: 1px solid var(--semester-line); }
.contact-list dt { flex: 0 0 50px; color: var(--link); }
.contact-list dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.contact-list a { color: var(--muted); text-decoration: none; }
.site-footer { width: min(623px, calc(100% - 57px)); margin-inline: auto; padding: 47px 0; border-top: 1px solid var(--semester-line); text-align: center; color: var(--muted); font-size: 15px; }
.footer-links { display: flex; justify-content: center; gap: 26px; margin-bottom: 24px; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--text); }
.site-footer p { margin: 0; }

p { margin: 0 0 23px; }
.bio p:last-child { margin-bottom: 0; }

.portrait {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 2px;
}

.social-links {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 15px;
}

.social-links span { color: var(--muted); }

.notes-heading {
  margin: 0 0 18px;
  font-size: 28px;
  line-height: 1.4;
  letter-spacing: -.5px;
}
.notes-divider {
  margin: 30px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.semester-heading {
  margin: 0 0 16px;
  font-size: 21px;
  font-weight: 500;
  line-height: 1.4;
}
.coursework-section + .coursework-section { margin-top: 36px; }
.coursework-section summary { display: flex; justify-content: space-between; align-items: center; gap: 24px; cursor: pointer; list-style: none; font-size: 21px; font-weight: 500; }
.coursework-section summary::-webkit-details-marker { display: none; }
.coursework-section summary::after { content: ""; flex-shrink: 0; width: 12px; height: 12px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); margin-right: 6px; transition: transform 220ms ease; }
.coursework-section[open]:not(.is-closing) summary::after { transform: rotate(225deg); }
.disclosure-content { padding-top: 22px; }
.course-list.course-list-names li { display: block; }
.course-list {
  margin: 0;
  padding: 0;
  border-block: 1px solid var(--semester-line);
  list-style: none;
}
.course-list li {
  display: grid;
  grid-template-columns: 103px minmax(0, 1fr);
  align-items: baseline;
  gap: 19px;
  margin: 0;
  padding-block: 9px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  line-height: 1.65;
}
.course-list li + li { border-top: 1px solid var(--course-line); }
.course-code {
  color: #b2bfd1;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 14px;
  white-space: nowrap;
}

@media (max-width: 620px) {
  body { font-size: 16px; }
  .site-header, .site-footer, .page { width: calc(100% - 40px); }
  .header-inner { min-height: 76px; flex-direction: column; align-items: flex-start; gap: 0; padding-block: 13px; }
  .site-name { font-size: 20px; }
  nav { gap: 18px; font-size: 15px; }
  .page { padding-block: 36px 48px; }
  .profile { grid-template-columns: minmax(0, 1fr); gap: 28px; margin-bottom: 36px; }
  .portrait { width: min(100%, 178px); }
  .page-heading { font-size: 30px; margin-bottom: 34px; }
  .bio { font-size: 17px; line-height: 1.8; }
  .contact-list { font-size: 14px; }
  .contact-list > div { flex-direction: row; gap: 16px; }
  .coursework-section summary { font-size: 20px; }
  .semester-heading { font-size: 20px; }
  .course-list li { grid-template-columns: 110px minmax(0, 1fr); gap: 14px; padding-block: 9px; font-size: 18px; }
  .course-code { font-size: 15px; }
}

@media (max-width: 360px) {
  .site-name { font-size: 18px; }
  nav { gap: 13px; font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .page, nav a, .coursework-section summary::after { animation: none; transition: none; }
  .page.is-leaving { opacity: 1; }
}

/* Reading notes share the site's narrow column and navy palette. */
.note-list-entry h2 { margin: 0 0 10px; font-size: 23px; font-weight: 550; line-height: 1.4; }
.note-list-entry h2 a { text-decoration: none; }
.note-list-entry h2 a:hover { text-decoration: underline; }
.note-list-entry p { margin-bottom: 12px; }
.note-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: 14px; }
.back-link { display: inline-block; margin-bottom: 24px; text-decoration: none; font-size: 15px; }
.note-header { margin-bottom: 36px; }
.note-header .page-heading { margin-bottom: 16px; }
.note-deck { color: var(--muted); font-size: 18px; }
.note-page h2 { margin: 38px 0 16px; font-size: 24px; line-height: 1.4; font-weight: 600; letter-spacing: -.3px; }
.note-page h3 { margin: 28px 0 14px; font-size: 20px; font-weight: 550; }
.note-page hr { margin: 36px 0; border: 0; border-top: 1px solid var(--line); }
.note-page li { margin-bottom: 10px; }
.note-page ul, .note-page ol { padding-left: 24px; }
.note-page code { font-family: "SFMono-Regular", Consolas, monospace; font-size: .84em; color: #c6daee; overflow-wrap: anywhere; }
.note-page :not(pre) > code { padding: 2px 4px; background: #17253b; border-radius: 3px; }
.note-page pre { overflow-x: auto; margin: 24px 0; padding: 18px; border: 1px solid var(--line); border-radius: 4px; background: #0d1727; line-height: 1.65; }
.note-page pre code { overflow-wrap: normal; }
.math-block { overflow-x: auto; overflow-y: hidden; margin-block: 24px; padding-block: 5px; }
.math-block .katex-display { margin: 0; }
.note-page .katex { font-size: 1.08em; }
.note-page .katex-error { color: #f5b8a8 !important; }
.note-figure { margin: 30px 0; }
.diagram-scroll { overflow-x: auto; }
.note-figure svg { min-width: 520px; width: 100%; height: auto; display: block; }
.note-figure svg rect { fill: #17253b; stroke: var(--semester-line); }
.note-figure svg path { stroke: var(--link); fill: none; stroke-width: 1.5; }
.note-figure svg marker path { fill: var(--link); }
.note-figure svg text { fill: var(--text); font: 15px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.note-figure svg .diagram-muted { fill: var(--muted); font-size: 13px; }
.note-figure img { display: block; width: 100%; height: auto; background: white; border-radius: 4px; padding: 12px; }
.note-page figcaption, .small-note { margin-top: 12px; font-size: 14px; color: var(--muted); line-height: 1.6; }
.table-scroll { max-width: 100%; overflow-x: auto; margin: 24px 0 12px; }
.note-page table { width: 100%; border-collapse: collapse; font-size: 15px; text-align: left; }
.note-page th, .note-page td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.note-page th { font-weight: 550; color: var(--link); }
.boundary-demo { margin: 30px 0; padding: 22px; border: 1px solid var(--semester-line); border-radius: 4px; }
.boundary-demo h3 { margin-top: 0; }
.boundary-demo > label { display: flex; justify-content: space-between; gap: 16px; }
.boundary-demo output { color: var(--link); font-variant-numeric: tabular-nums; }
.boundary-demo input[type="range"] { width: 100%; margin: 16px 0; accent-color: var(--link); }
.boundary-demo fieldset { border: 0; padding: 0; margin: 0 0 18px; }
.boundary-demo legend { margin-bottom: 8px; color: var(--muted); font-size: 15px; }
.boundary-demo fieldset label { display: block; margin: 6px 0; font-size: 15px; }
.boundary-demo input[type="radio"] { accent-color: var(--link); }
.demo-results { border-top: 1px solid var(--line); padding-top: 16px; }
.demo-results p { margin-bottom: 10px; font-size: 15px; }
.demo-results p:last-child { margin-bottom: 0; color: var(--muted); }
.references { font-size: 15px; overflow-wrap: anywhere; }
.references li { padding-left: 4px; margin-bottom: 16px; scroll-margin-top: 24px; }
.references li:target { background: #17253b; }
@media (max-width: 620px) {
  .note-page .page-heading { font-size: 28px; }
  .note-page h2 { font-size: 22px; }
  .note-page pre { padding: 14px; }
  .boundary-demo { padding: 16px; }
}
