@font-face {
  font-family: 'IBM Plex Mono';
  src: url('../fonts/ibm-plex-mono.woff2') format('woff2');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #181715;
  --surface: #201e1b;
  --ink: #d1ccc3;
  --muted: #aaa194;
  --line: #36322c;
  --accent: #a8bdcd;
  --warm: #c6a081;
  --mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  scroll-behavior: smooth;
  scroll-padding-top: 20px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 13px/1.7 var(--mono);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--warm);
  text-decoration: underline;
  text-underline-offset: 3px;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--warm);
  outline-offset: 4px;
}

::selection {
  background: var(--warm);
  color: var(--bg);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  font-weight: 400;
}

h1 {
  font-size: 24px;
  line-height: 1.4;
}

h2 {
  font-size: 14px;
}

h3 {
  font-size: 13px;
  line-height: 1.6;
}

img {
  max-width: 100%;
  height: auto;
}

button,
input,
select,
textarea {
  font: inherit;
}

iframe {
  width: 100%;
  max-width: 100%;
  border: 0;
}

.external-icon {
  display: inline-block;
  width: .75em;
  height: .75em;
  margin-left: 3px;
  flex-shrink: 0;
  vertical-align: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

.site-header,
.page-shell,
.site-footer {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding-left: 44px;
  padding-right: 44px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 58px;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  color: var(--ink);
  font-size: 15px;
  letter-spacing: -.025em;
}

.wordmark::before {
  content: '~/';
  margin-right: 9px;
  color: var(--warm);
  font-size: 12px;
}

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 25px;
  font-size: 11px;
}

.site-header nav a {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  color: var(--muted);
}

.site-header nav a[aria-current='page'] {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--warm);
  text-underline-offset: 6px;
}

.intro-strip {
  padding: 21px 0 22px;
  border-bottom: 1px solid var(--line);
}

.topics {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 17px;
  font-size: 11px;
  line-height: 1.7;
}

.topics span + span::before {
  content: '/';
  margin-right: 17px;
  color: var(--muted);
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 21px;
  margin-top: 8px;
  font-size: 10px;
}

.hero-links a {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
}

.section-label {
  display: flex;
  align-items: baseline;
  gap: 15px;
  margin-bottom: 18px;
}

.section-number {
  color: var(--warm);
  font-size: 10px;
}

.section-label h2 {
  font-size: 14px;
}

.bio-section {
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
}

.bio-grid {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 30px;
  align-items: start;
}

.portrait-wrap {
  margin: 0;
}

.portrait {
  display: block;
  width: 180px;
  height: 180px;
  aspect-ratio: 1;
  object-fit: cover;
  filter: saturate(.35);
  border-radius: 2px;
}

.bio-copy {
  min-width: 0;
  font-size: 12px;
  line-height: 1.9;
}

.bio-copy p + p {
  margin-top: 15px;
}

.bio-copy a {
  border-bottom: 1px solid var(--line);
}

.publications-section {
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}

.section-heading .section-label {
  margin: 0;
}

.scholar-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 15px;
  font-size: 10px;
}

.scholar-links a {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
}

.bibbase-frame {
  display: block;
  width: 100%;
  height: 5000px;
  margin-top: 16px;
  border: 1px solid var(--line);
  background: var(--bg);
  color-scheme: dark;
}

.bibliography-link {
  display: inline-block;
  margin-top: 13px;
  font-size: 10px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding-top: 18px;
  padding-bottom: 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
  line-height: 1.8;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 15px;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
}

.inner-heading {
  padding: 28px 0 20px;
  border-bottom: 1px solid var(--line);
}

.inner-heading h1 {
  max-width: 850px;
  font-size: 24px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.inner-heading .eyebrow,
.post-date {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
}

.page-content {
  min-width: 0;
  padding: 28px 0 45px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.page-content p {
  margin-bottom: 15px;
}

/* Inline links stay recognizable without relying on color alone. */
.page-content a[href],
.site-footer > span a,
.dsq-brlink {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.page-content h2 {
  margin: 25px 0 15px;
  font-size: 20px;
  line-height: 1.5;
}

.page-content h3 {
  margin: 20px 0 12px;
  font-size: 16px;
  line-height: 1.6;
}

.page-content h4,
.page-content h5,
.page-content h6 {
  margin: 18px 0 10px;
  font-size: 13px;
  font-weight: 400;
}

.page-content ul,
.page-content ol {
  padding-left: 24px;
  margin: 0 0 16px;
}

.page-content li + li {
  margin-top: 5px;
}

.page-content blockquote {
  margin: 20px 0;
  padding-left: 18px;
  border-left: 2px solid var(--warm);
  color: var(--muted);
}

.page-content hr {
  margin: 24px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.page-content code,
.page-content pre {
  font-family: var(--mono);
  font-size: 12px;
}

.page-content :not(pre) > code {
  padding: 1px 4px;
  background: var(--surface);
}

.page-content pre {
  max-width: 100%;
  padding: 15px;
  margin: 16px 0;
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  line-height: 1.7;
  white-space: pre;
  overflow-wrap: normal;
  word-break: normal;
  -webkit-overflow-scrolling: touch;
}

.page-content pre code {
  padding: 0;
  background: transparent;
  white-space: inherit;
}

.page-content table {
  display: block;
  max-width: 100%;
  margin: 18px 0;
  overflow-x: auto;
  border-collapse: collapse;
}

.page-content td,
.page-content th {
  padding: 8px;
  border: 1px solid var(--line);
  text-align: left;
}

.page-content th {
  color: var(--warm);
  font-weight: 400;
}

.page-content figure {
  margin: 20px 0;
}

.page-content figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.page-content .container {
  width: auto !important;
  max-width: 100%;
  margin: 0;
  padding: 0;
}

.page-content .wrapper,
.page-content .row {
  margin: 0;
  padding: 0;
}

.page-content .row > * {
  float: none;
  min-width: 0;
  max-width: 100%;
}

.page-content font {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

.page-content .MathJax_Display,
.page-content .MathJax_SVG_Display,
.page-content mjx-container[display='true'],
.page-content .katex-display {
  max-width: 100%;
  padding-bottom: 5px;
  overflow-x: auto;
  overflow-y: hidden;
}

.highlight {
  color: var(--ink);
}

.highlight :is(.c, .c1, .cm, .cp, .cs, .ch) {
  color: var(--muted);
}

.highlight :is(.k, .kc, .kd, .kn, .kp, .kr, .kt, .ow) {
  color: var(--warm);
}

.highlight :is(.nb, .bp, .nc, .nf, .nn, .nt) {
  color: var(--accent);
}

.highlight :is(.s, .s1, .s2, .sa, .sb, .sc, .sd, .se, .sh, .si, .sr, .ss, .gi) {
  color: #b2bd9a;
}

.highlight :is(.m, .mb, .mf, .mh, .mi, .mo, .il) {
  color: #c1a9c7;
}

.highlight :is(.err, .gd) {
  color: #d8a5a0;
}

/* Preserve the article's tensor colors with contrast on the dark background. */
mjx-container :is([fill='blue' i], [fill='#0000ff' i]) {
  fill: #a8bdcd;
}

mjx-container :is([stroke='blue' i], [stroke='#0000ff' i]) {
  stroke: #a8bdcd;
}

mjx-container :is([fill='red' i], [fill='#ff0000' i]) {
  fill: #d8a5a0;
}

mjx-container :is([stroke='red' i], [stroke='#ff0000' i]) {
  stroke: #d8a5a0;
}

mjx-container :is([fill='green' i], [fill='#008000' i]) {
  fill: #b2bd9a;
}

mjx-container :is([stroke='green' i], [stroke='#008000' i]) {
  stroke: #b2bd9a;
}

mjx-container :is([fill='purple' i], [fill='#800080' i]) {
  fill: #c1a9c7;
}

mjx-container :is([stroke='purple' i], [stroke='#800080' i]) {
  stroke: #c1a9c7;
}

.blog-list {
  padding: 0;
  margin: 0;
  list-style: none;
}

.blog-list li {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.blog-list time {
  color: var(--muted);
  font-size: 11px;
}

.blog-list a {
  font-size: 15px;
}

.comments {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.comments h2 {
  margin-top: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 10;
  padding: 10px;
  background: var(--bg);
  border: 1px solid var(--warm);
}

.skip-link:focus {
  top: 10px;
}

@media (max-width: 850px) {
  .site-header,
  .page-shell,
  .site-footer {
    padding-left: 28px;
    padding-right: 28px;
  }

  .site-header nav {
    gap: 4px 18px;
  }

  .bio-grid {
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 25px;
  }

  .bio-copy {
    grid-column: 2;
    grid-row: 1;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
  }
}

@media (max-width: 560px) {
  .site-header,
  .page-shell,
  .site-footer {
    padding-left: 20px;
    padding-right: 20px;
  }

  .site-header {
    flex-wrap: wrap;
    gap: 4px;
    padding-top: 14px;
    padding-bottom: 10px;
  }

  .wordmark {
    font-size: 15px;
  }

  .site-header nav {
    width: 100%;
    gap: 0 18px;
    font-size: 12px;
  }

  .site-header nav a {
    min-height: 36px;
  }

  .intro-strip {
    padding: 17px 0;
  }

  .topics {
    font-size: 12px;
  }

  .topics {
    gap: 5px 12px;
  }

  .topics span + span::before {
    margin-right: 12px;
  }

  .hero-links {
    gap: 0 17px;
    font-size: 12px;
  }

  .hero-links a {
    min-height: 32px;
  }

  .bio-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 17px;
  }

  .bio-copy {
    grid-column: auto;
    grid-row: auto;
    font-size: 12px;
    line-height: 1.85;
  }

  .section-number {
    font-size: 12px;
  }

  .section-label {
    margin-bottom: 15px;
  }

  .scholar-links,
  .bibliography-link {
    font-size: 12px;
  }

  .scholar-links {
    gap: 0 15px;
  }

  .scholar-links a {
    min-height: 32px;
  }

  .bibliography-link {
    display: block;
  }

  .site-footer {
    flex-direction: column;
    gap: 12px;
    font-size: 12px;
  }

  .social-links {
    gap: 0 16px;
  }

  .social-links a {
    min-height: 32px;
  }

  .inner-heading h1 {
    font-size: 20px;
  }

  .inner-heading .eyebrow,
  .post-date {
    font-size: 12px;
  }

  .page-content {
    font-size: 12px;
  }

  .blog-list li {
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
  }

  .blog-list time,
  .blog-list a {
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
