@font-face {
  font-family: "TeX Gyre Pagella";
  src: url("/fonts/pagella/texgyrepagella-regular.woff2") format("woff2");
  font-weight: 400;
}

@font-face {
  font-family: "TeX Gyre Pagella";
  src: url("/fonts/pagella/texgyrepagella-italic.woff2") format("woff2");
  font-style: italic;
}

@font-face {
  font-family: "TeX Gyre Pagella";
  src: url("/fonts/pagella/texgyrepagella-bold.woff2") format("woff2");
  font-weight: 700;
}

@font-face {
  font-family: "TeX Gyre Pagella";
  src: url("/fonts/pagella/texgyrepagella-bolditalic.woff2") format("woff2");
  font-weight: 700;
  font-style: italic;
}

/* Hint to the browser that we support both themes (scrollbars/forms, etc.) */
:root {
  color-scheme: light dark;
}

body {
  font-family: "TeX Gyre Pagella", serif;
  margin: auto;
  max-width: 42em;
  padding: 1em;
  line-height: 1.55;

  color: #444;

  background-color: #f3efe6;
  background-image: url("/images/paper-grain.svg");
  background-repeat: repeat;
  background-size: 256px 256px;
}

li {
  margin-bottom: 0.4em;
}

p {
  margin: 0.8em 0;
}

h1, h2, h3 {
  line-height: 1.2;
  margin-top: 1.6em;
}

h1:first-child {
  margin-top: 0;
}

h2 {
  scroll-margin-top: 2rem;
}

.bio {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 600px) {
  .bio {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .bio img {
    margin: 0 auto;
    width: 160px;
  }
}


a {
  color: #4b2aa6;
}
a:visited {
  color: #5b33c2;
}

/* Blockquotes: match the “paper” look (not a heavy gray box) */
blockquote {
  margin: 1em 0;
  padding: 0.8em 1em;
  border: 1px solid rgba(0,0,0,0.14);
  background: rgba(255,255,255,0.22);
  border-radius: 6px;
}

/* Inline code */
p code, li code, blockquote code {
  padding: 0.12em 0.35em;
  border: 1px solid rgba(0,0,0,0.12);
  background: rgba(255,255,255,0.35);
  border-radius: 4px;
}

/* Code blocks */
pre {
  overflow-x: auto;
  padding: 1em 1.1em;
  border: 1px solid rgba(0,0,0,0.14);
  background: rgba(255,255,255,0.28);
  border-radius: 6px;
  box-shadow: 0 1px 0 rgba(0,0,0,0.04);
}

pre code {
  border: 0;
  padding: 0;
  background: transparent;
  display: block;
}

/* Always hide MathJax assistive MathML (prevents apparent “double” math) */
mjx-assistive-mml {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}

.site-nav {
  margin-top: 3rem;
  padding-top: 0.75rem;
  text-align: center;
  font-size: 0.9rem;
  border-top: 1px solid rgba(0, 0, 0, 0.15);
}

.site-nav a {
  text-decoration: none;
}

.site-nav a:hover {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}


/* Dark mode */
@media (prefers-color-scheme: dark) {
   .site-nav {
    border-top-color: rgba(255, 255, 255, 0.15);
  }

  body {
    color: #e6e2da;

    /* Dark “paper” base */
    background-color: #121212;

    /* Keep the grain; adjust inside the SVG if you want it subtler */
    background-image: url("/images/paper-grain.svg");
  }

  a {
    color: #c8a6ff;
  }
  a:visited {
    color: #d0b8ff;
  }

  h1, h2, h3 {
    color: #f0f0f0;
  }

  blockquote {
    border-color: rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.06);
  }

  p code, li code, blockquote code {
    border-color: rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.07);
    color: #f0eee8;
  }

  pre {
    border-color: rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.07);
    box-shadow: 0 1px 0 rgba(255,255,255,0.03);
  }
}

