/* Cambridge at night. Shared typography and reading surfaces. */
@font-face {
  font-family: "CMU Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/cmunti.woff") format("woff");
}

:root, :root[data-theme="light"] {
  color-scheme: light;
  --backdrop: #304957;
  --sheet: #f7f1e5;
  --paper: #f7f1e5;
  --fade-solid: #f7f1e5;
  --text: #243447;
  --black: #243447;
  --muted: #5b625e;
  --faint: #73776e;
  --accent: #28567a;
  --accent-hover: #946b2b;
  --blue: #28567a;
  --blue-dark: #946b2b;
  --line: #d4d1c5;
  --rule: #c5c4b8;
  --panel-border: #d4d1c5;
  --soft-fill: #eae7dd;
  --toolbar: #0c2037;
  --toolbar-text: #d6d9d7;
  --toolbar-text-strong: #fbf0d9;
  --toolbar-accent: #d9bd77;
  --toolbar-line: #ffffff20;
  --sheet-shadow: none;
  --serif: "CMU Serif", "Iowan Old Style", Georgia, serif;
  --sans: "CMU Sans", "Helvetica Neue", Arial, sans-serif;
  --gold: #d9bd77;
  --page-gold: #b3914d;
  --page-inner-gold: #ad874b9c;
  --surround-text: #c9d0cc;
  --page-shadow: 0 24px 65px #07152240, 0 4px 10px #07152224;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --backdrop: #081522;
  --sheet: #152b3e;
  --paper: #152b3e;
  --fade-solid: #152b3e;
  --text: #e9e3d4;
  --black: #e9e3d4;
  --muted: #b4b9b4;
  --faint: #9caaa8;
  --accent: #d9bd77;
  --accent-hover: #f9df9f;
  --blue: #d9bd77;
  --blue-dark: #f9df9f;
  --line: #ffffff24;
  --rule: #ffffff30;
  --panel-border: #ffffff24;
  --soft-fill: #ffffff06;
  --page-gold: #a78a51;
  --page-inner-gold: #d2af6b80;
  --surround-text: #aebbbd;
  --page-shadow: 0 24px 70px #00000065, 0 4px 12px #00000040;
}
html { font-size: 17px; scroll-behavior: smooth; scroll-padding-top: 100px; }
body {
  margin: 0;
  color: var(--text);
  background: var(--backdrop);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
*, *::before, *::after { box-sizing: border-box; }
a { color: var(--accent); text-underline-offset: .22em; }
a:hover { color: var(--accent-hover); }
button { font: inherit; cursor: pointer; }
img { max-width: 100%; }
[hidden] { display: none !important; }
::selection { color: #12293f; background: #e8ce91; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; }
.skip-link { position: fixed; top: 12px; left: 12px; z-index: 100; padding: 10px 20px; color: #142a43; background: #fff5da; transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
.site-header, .blog-toolbar {
  position: relative;
  z-index: 20;
  border: 0;
  background: #0c2037;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.header-row, .toolbar-inner {
  width: min(1320px, calc(100% - 100px));
  min-height: 96px;
  padding: 0;
  margin: 0 auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}
.brand, .site-owner {
  flex-shrink: 0;
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 400;
  letter-spacing: -.035em;
  text-transform: none;
  color: #fbf0d9;
  text-decoration: none;
}
.header-tools, .toolbar-tools { width: auto; display: flex; align-items: center; gap: 27px; overflow: visible; }
.site-nav, .blog-nav { display: flex; align-items: center; gap: 30px; flex-wrap: nowrap; overflow: visible; padding: 0; }
.site-nav a, .blog-nav a {
  position: relative;
  padding: 8px 0;
  color: #e6e5db;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: .01em;
  white-space: nowrap;
  text-decoration: none;
}
.site-nav a + a, .blog-nav a + a { padding-left: 0; }
.site-nav a + a::before, .blog-nav a + a::before { content: none; }
.site-nav a:hover, .blog-nav a:hover, .site-nav a[aria-current], .blog-nav a[aria-current] { color: #f5d794; }
.site-nav a[aria-current]::after, .blog-nav a[aria-current]::after,
.site-nav a + a[aria-current]::after, .blog-nav a + a[aria-current]::after {
  content: "";
  position: absolute;
  height: 1px;
  left: 0;
  right: 0;
  bottom: 3px;
  background: #d9bd7799;
}
.theme-toggle { flex: 0 0 38px; width: 38px; height: 38px; padding: 0; border: 1px solid #ffffff30; border-radius: 50%; background: transparent; color: #fff0cc; }
.theme-toggle::before { content: "☾"; font: 21px Georgia, serif; }
:root[data-theme="dark"] .theme-toggle::before { content: "☼"; }
.theme-toggle:hover { background: #ffffff0b; border-color: #d9bd77; }
.menu-toggle { display: none; color: #f6edda; border: 0; border-bottom: 1px solid #d9bd7777; padding: 5px 0; background: transparent; font-size: 16px; }
.site-header :focus-visible, .blog-toolbar :focus-visible, .night-hero :focus-visible { outline-color: #f5d794; }

/* The painted sky follows continuous currents on the GPU. */
.home .site-header { position: absolute; inset: 0 0 auto; background: linear-gradient(#06172d80, transparent); }
.night-hero {
  position: relative;
  isolation: isolate;
  height: min(1050px, 100svh);
  min-height: 720px;
  overflow: hidden;
  color: #fcf0d4;
  background: #102d50;
}
.paint-scene, .painting, .flow-canvas, .hero-shade { position: absolute; inset: 0; width: 100%; height: 100%; }
.paint-scene { z-index: -2; overflow: hidden; }
.painting { display: block; max-width: none; object-fit: cover; object-position: 50% 58%; }
.flow-canvas { display: block; pointer-events: none; opacity: 0; transition: opacity .8s ease; }
.flow-ready .flow-canvas { opacity: 1; }
.hero-shade {
  z-index: -1;
  background: radial-gradient(ellipse 120% 100% at 62% 40%, transparent 55%, #04102366 100%), linear-gradient(90deg, #071a3e6e 0%, #071a3e28 44%, transparent 73%), linear-gradient(0deg, #061628a8, transparent 24%, transparent 78%, #0616281f);
}
.hero-copy { position: absolute; top: 31%; left: max(8.5%, calc((100% - 1200px) / 2)); max-width: 760px; padding-right: 24px; text-shadow: 0 2px 24px #071a3c88; }
.hero-place { margin: 0 0 17px; font-family: var(--sans); font-size: 12px; line-height: 1.5; font-weight: 400; letter-spacing: .19em; text-transform: uppercase; color: #f0d797; }
.hero-copy h1 { margin: 0 0 20px; font-family: var(--serif); font-size: clamp(80px, 8.1vw, 126px); font-weight: 400; line-height: 1.05; letter-spacing: -.055em; color: #fff2d5; }
.hero-intro { margin: 0; max-width: 490px; font-size: clamp(21px, 2vw, 28px); line-height: 1.5; letter-spacing: -.012em; color: #f9efdc; }
.hero-links { display: flex; gap: 28px; margin-top: 31px; }
.hero-links a { color: #fff1cc; font-size: 16px; line-height: 1.8; text-decoration: none; border-bottom: 1px solid #e5ce9699; }
.hero-links a:hover { border-bottom-color: #fff1cc; }
.hero-links span { margin-left: 12px; font-family: Georgia, serif; }
.hero-bottom { position: absolute; bottom: 30px; left: 50px; right: 50px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; }
.scroll-cue { justify-self: start; display: inline-flex; align-items: center; gap: 15px; color: #f3e9d5; font: 12px var(--sans); letter-spacing: .08em; text-decoration: none; }
.scroll-cue::before { content: ""; width: 1px; height: 31px; background: #e4cb8a; }
.scene-caption { margin: 0; color: #efe3c9; font-size: 13px; font-style: italic; }
.home-main { background: transparent; }
.home-volume { position: relative; width: min(1200px, calc(100% - 100px)); margin: 65px auto 70px; background: var(--paper); }
.home-introduction { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: clamp(40px, 6vw, 80px); align-items: center; width: min(1080px, calc(100% - 100px)); margin: 0 auto; padding: 80px 0 70px; }
.intro-copy p { text-align: left; text-indent: 0; hyphens: none; }
.intro-copy .section-label { margin: 0 0 23px; }
.intro-copy > p { margin: 0; max-width: 690px; font-size: 18px; line-height: 1.85; }
.intro-copy > p + p { margin-top: 1.2em; }
.intro-copy h2.section-label { font: 11px var(--sans); font-weight: 400; color: var(--muted); letter-spacing: .17em; text-transform: uppercase; }
.home-reading { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 65px; width: min(1080px, calc(100% - 100px)); margin: 0 auto; padding: 65px 0 100px; border-top: 1px solid var(--line); }
.home-contents { align-self: start; position: sticky; top: 48px; padding-top: 5px; }
.contents-label { color: var(--muted); margin: 0 0 25px; font: 11px var(--sans); text-transform: uppercase; letter-spacing: .17em; }
.home-contents a { display: block; margin: 0 0 15px; font-size: 15px; color: var(--muted); text-decoration: none; }
.home-contents a:hover { color: var(--accent); }
.home-contents .contents-work { margin-top: 35px; padding-top: 23px; border-top: 1px solid var(--line); }
.home-essay { min-width: 0; }
.section { margin: 0; padding: 0; border: 0; scroll-margin-top: 45px; }
.section + .section { margin-top: 65px; padding-top: 48px; border-top: 1px solid var(--line); }
.section h2, .article h2 { color: var(--text); font-family: var(--serif); font-size: 32px; line-height: 1.25; font-weight: 400; letter-spacing: -.02em; margin: 0 0 28px; }
.section > p, .article p, .article li { max-width: none; text-align: left; text-indent: 0; hyphens: none; }
.section > p + p, .article p + p { margin-top: 1.2em; text-indent: 0; }
.section h3, .article h3 { font-family: var(--serif); font-weight: 400; font-size: 23px; }
.section-label, .eyebrow, .post-category, .link-label { color: var(--muted); font-family: var(--sans); font-size: 11px; font-weight: 400; letter-spacing: .17em; text-transform: uppercase; }
.section > .section-label { display: block; margin-bottom: 16px; }
.table-caption, .section > p.table-caption { text-align: left; font-family: var(--sans); color: var(--muted); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; margin-top: 35px; }
.table-caption::before { content: none; }
.interest-columns { margin-top: 24px; gap: 26px; padding: 22px 0; border-block: 1px solid var(--line); }
.interest-columns .stack-block { padding: 0; background: none; border: 0; }
.interest-columns h3 { border: 0; margin: 0 0 12px; padding: 0; font-size: 21px; }
.interest-columns .compact-list { font-size: 15px; padding-left: 17px; }
.interest-columns .compact-list li + li { margin-top: 7px; }
.home-essay #hobbies .compact-list { columns: 2; column-gap: 35px; padding-left: 20px; }
.home-essay #hobbies li { break-inside: avoid; }
.home-essay #contact a { overflow-wrap: anywhere; }

/* The painting continues into the mastheads of the reading pages. */
body:not(.home)::before { content: ""; position: absolute; z-index: -1; top: 96px; left: 0; right: 0; height: 225px; background: linear-gradient(#091b3930, #0c203760), url("assets/cambridge-starry-night.webp") 50% 25% / cover; }
.page, .article-shell, .blog-sheet { position: relative; width: min(1110px, calc(100% - 100px)); margin: 150px auto 70px; padding: clamp(32px, 6vw, 75px); border: 0; border-radius: 0; background: var(--sheet); backdrop-filter: none; -webkit-backdrop-filter: none; }
.article-shell { max-width: 960px; }
.page::after, .article-shell::after { content: none; }
.page, .article-shell, .blog-sheet, .home-volume {
  border: 3px solid var(--page-gold);
  border-image: linear-gradient(125deg, #866128, #f0d697 19%, #b98d3c 39%, #e6c779 61%, #aa813b 81%, #e6ce8e) 1;
  box-shadow: var(--page-shadow);
}
.page::before, .article-shell::before, .blog-sheet::before, .home-volume::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid var(--page-inner-gold);
  pointer-events: none;
}
.author-portrait {
  width: 290px;
  margin: 0 auto;
  padding: 13px 13px 0;
  background: linear-gradient(140deg, #fffef9, #f3eee2);
  border: 1px solid #fffdf3;
  box-shadow: 0 2px 3px #17201f12, 3px 14px 24px #17201f21;
  transform: rotate(2deg);
}
.author-portrait .portrait-photo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1.12;
  object-fit: cover;
  object-position: 50% 38%;
  border: 1px solid #1a272921;
  border-radius: 0;
  box-shadow: none;
}
.author-portrait figcaption {
  padding: 19px 0 22px;
  font: italic 17px var(--serif);
  letter-spacing: .025em;
  color: #52564d;
  text-align: center;
}
.page-title, .article-title, .blog-masthead h1 { font-family: var(--serif); font-size: clamp(43px, 5vw, 68px); font-weight: 400; line-height: 1.1; letter-spacing: -.04em; margin: 0 0 28px; }
.page-title, .article-title { border-bottom: 0; padding-bottom: 0; }
.page > .section + .section { margin-top: 42px; padding-top: 36px; }
.page > .section h2::before, .article h2::before { content: none; }
.page > .section > .section-label, .article-header > .section-label { display: block; color: var(--muted); }
.resource-list { margin-top: 35px; border-top: 1px solid var(--line); }
.resource-list li { padding: 28px 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; }
.resource-list li:hover { background: none; }
.resource-item h3, .paper-record-title { font-family: var(--serif); font-weight: 400; line-height: 1.35; font-size: 25px; }
.resource-item h3 a, .paper-record-title a { color: var(--text); }
.resource-item p { color: var(--muted); font-size: 17px; }
.paper-record { padding-block: 35px; }
.paper-record-abstract { font-size: 17px; color: var(--text); }
.paper-read-more, .read-more { font-family: var(--serif); text-transform: none; letter-spacing: 0; font-size: 15px; }
.paper-tags, .paper-record-author, .paper-record-advisors, .paper-source, .resource-meta { color: var(--muted); }
.paper-record-title .katex { font-size: 1em; }
.paper-equation { overflow-x: auto; max-width: 100%; }
.blog-sheet { padding: 60px; }
.blog-masthead { padding: 0 0 38px; border-bottom: 1px solid var(--line); align-items: center; }
.blog-masthead h1 { margin: 0; font-size: clamp(40px, 4.6vw, 64px); }
.search-box { width: 215px; flex-shrink: 0; }
.search-field { border: 0; border-bottom: 1px solid var(--rule); padding: 8px 0; }
.search-field input { font-family: var(--serif); font-size: 16px; }
.search-label { font-family: var(--sans); font-size: 10px; letter-spacing: .12em; color: var(--muted); }
.blog-layout { grid-template-columns: 160px minmax(0, 1fr); gap: 35px; }
.blog-layout .about { padding: 40px 0; top: 25px; }
.about h2 { font-family: var(--sans); font-size: 11px; font-weight: 400; letter-spacing: .13em; color: var(--muted); }
.about p { color: var(--muted); font-size: 15px; }
.post-feed { border-left: 0; }
.post { padding: 40px 0; }
.post-header h2 { font-family: var(--serif); font-size: clamp(28px, 3vw, 38px); font-weight: 400; line-height: 1.25; }
.post-meta { font-family: var(--sans); font-size: 11px; letter-spacing: .01em; }
.post-subtitle { font-family: var(--serif); font-style: italic; font-size: 18px; }
.post-preview { font-size: 17px; }
.post-preview p, .post-preview li { text-align: left; text-indent: 0; hyphens: none; }
.post-preview p + p { margin-top: 1.1em; text-indent: 0; }
/* Fade the clipped content itself so every line fades across its full width. */
.post-fade, .paper-fade { display: none; }
@media screen {
  .post-preview:not(.is-expanded),
  .paper-record-body:has(.paper-read-more:not([hidden])) .paper-record-preview:not(.is-expanded),
  .resource-item-body:has(.paper-read-more:not([hidden])) .resource-item-preview:not(.is-expanded) {
    -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 3rem), transparent);
    mask-image: linear-gradient(to bottom, #000 calc(100% - 3rem), transparent);
  }
}
.site-footer, .blog-footer { margin: 0; padding: 15px 0 35px; border: 0; background: transparent; }
.footer-row { width: min(1080px, calc(100% - 100px)); margin: 0 auto; padding: 0; }
.footer-row p, :root[data-theme="dark"] .footer-row p { color: var(--surround-text); font-family: var(--serif); font-size: 14px; letter-spacing: 0; }
.footer-row a, .blog-footer a { color: #e0c78b; }
.footer-row a:hover { color: #fae7b7; }
.blog-footer { color: var(--surround-text); font-family: var(--serif); font-size: 14px; }

@media (min-width: 1700px) { .hero-copy { top: 30%; } }
@media (max-width: 1050px) {
  .header-row, .toolbar-inner { width: calc(100% - 60px); }
  .site-nav, .blog-nav { gap: 21px; }
  .header-tools, .toolbar-tools { gap: 20px; }
  .hero-copy { left: 8%; }
  .home-reading { grid-template-columns: 170px minmax(0, 1fr); gap: 40px; }
  .home-introduction { gap: 40px; grid-template-columns: minmax(0, 1fr) 250px; }
  .author-portrait { width: 250px; }
  .blog-sheet { padding: 40px; }
}
@media (max-width: 760px) {
  html { scroll-padding-top: 30px; }
  .header-row, .toolbar-inner { width: calc(100% - 42px); min-height: 78px; gap: 15px; }
  .brand, .site-owner { font-size: 21px; }
  .site-header:not(.has-menu) .header-row, .blog-toolbar:not(.has-menu) .toolbar-inner { flex-wrap: wrap; padding-block: 15px; }
  .header-tools, .toolbar-tools { gap: 19px; }
  .has-menu .menu-toggle { display: block; }
  .site-nav, .blog-nav { flex-wrap: wrap; gap: 9px 15px; }
  .has-menu .site-nav, .has-menu .blog-nav { display: none; position: absolute; top: 70px; left: 14px; right: 14px; padding: 22px 27px; background: #102942; border: 1px solid #d9bd773d; box-shadow: 0 15px 40px #06132744; }
  .has-menu.nav-open .site-nav, .has-menu.nav-open .blog-nav { display: flex; flex-direction: column; align-items: stretch; gap: 7px; }
  .site-nav a, .blog-nav a { font-size: 18px; padding: 7px 0; }
  .site-nav a[aria-current]::after, .blog-nav a[aria-current]::after { width: 35px; }
  .theme-toggle { width: 33px; height: 33px; flex-basis: 33px; }
  .night-hero { min-height: 660px; height: 94svh; max-height: 1000px; }
  .painting { object-position: 82% 50%; }
  .hero-shade { background: radial-gradient(ellipse 140% 100% at 60% 40%, transparent 55%, #04102366 100%), linear-gradient(90deg, #071a3e85, #071a3e30 75%), linear-gradient(0deg, #061628b0, transparent 32%, transparent 75%, #06162840); }
  .hero-copy { top: 28%; left: 7%; }
  .hero-place { font-size: 10px; letter-spacing: .16em; margin-bottom: 20px; }
  .hero-copy h1 { font-size: clamp(65px, 12vw, 90px); margin-bottom: 22px; }
  .hero-intro { max-width: 360px; font-size: 24px; }
  .hero-links { margin-top: 29px; gap: 25px; }
  .hero-links a { font-size: 16px; }
  .hero-bottom { bottom: 25px; left: 25px; right: 25px; }
  .scene-caption { display: none; }
  .home-volume { width: calc(100% - 28px); margin: 35px auto 45px; }
  .home-introduction { display: block; width: calc(100% - 44px); padding: 42px 0; }
  .intro-copy > p { font-size: 17px; }
  .author-portrait { width: 280px; max-width: 95%; margin: 30px auto 0; }
  .author-portrait figcaption { font-size: 16px; }
  .home-reading { width: calc(100% - 50px); display: block; padding: 0 0 60px; }
  .home-contents { position: static; padding: 25px 0; margin-bottom: 40px; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 12px 23px; }
  .contents-label, .home-contents .contents-work { display: none; }
  .home-contents a { display: inline-block; margin: 0; font-size: 14px; }
  .section h2 { font-size: 30px; }
  .interest-columns { grid-template-columns: 1fr; gap: 25px; }
  .interest-columns > .stack-block + .stack-block { margin: 0; padding-top: 20px; border-top: 1px solid var(--line); }
  body:not(.home)::before { top: 78px; height: 180px; }
  .page, .article-shell, .blog-sheet { width: calc(100% - 28px); margin: 125px auto 45px; padding: 30px 18px; }
  .page-title, .article-title { font-size: 43px; }
  .blog-masthead { display: block; padding-bottom: 28px; }
  .blog-masthead h1 { font-size: 43px; margin-bottom: 25px; }
  .search-box { width: 100%; }
  .blog-layout { display: block; }
  .blog-layout .about { position: static; border-bottom: 1px solid var(--line); padding: 20px 0; }
  .about h2 { margin-bottom: 5px; }
  .about p { margin: 0; }
  .post-feed { padding: 0; }
  .post { padding-block: 28px; }
  .paper-record { grid-template-columns: 1fr; gap: 20px; }
  .footer-row { width: calc(100% - 50px); }
}
@media (max-width: 480px) {
  .night-hero { min-height: 670px; }
  .hero-copy { top: 27%; }
  .hero-copy h1 { font-size: clamp(57px, 14.5vw, 70px); }
  .hero-intro { max-width: 300px; font-size: 22px; }
  .home-introduction { display: block; }
  .author-portrait { width: 260px; max-width: 95%; margin: 30px auto 0; }
  .home-essay #hobbies .compact-list { columns: 1; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
@media print {
  body { color: #111; background: white; }
  .site-header, .blog-toolbar, .paint-scene, .hero-shade, .hero-bottom, .hero-links, .home-contents, body:not(.home)::before { display: none; }
  .night-hero { height: auto; min-height: 0; background: white; color: #111; }
  .hero-copy { position: static; padding: 30px 0; text-shadow: none; }
  .hero-copy h1, .hero-intro, .hero-place { color: #111; }
  .home-volume { width: 100%; margin: 0; border: 0; box-shadow: none; background: white; }
  .home-volume::before, .page::before, .article-shell::before, .blog-sheet::before { display: none; }
  .home-introduction, .home-reading, .page, .article-shell, .blog-sheet { border: 0; box-shadow: none; display: block; width: 100%; margin: 0; padding: 25px 0; }
}
