@import url("https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,400;0,500;0,600;1,400;1,500&display=swap");

:root {
  --bg: #f3efe4;
  --fg: #1c1914;
  --muted: #6a6458;
  --accent: #0b6b4a;
  --elevated: #e7e1d2;
  --border: color-mix(in oklab, var(--fg) 14%, transparent);
  --cursor: #0b6b4a;
  color-scheme: light;
}

html.dark {
  --bg: #0c0e0c;
  --fg: #d7ddd4;
  --muted: #8a9388;
  --accent: #7dcea0;
  --elevated: #151815;
  --border: color-mix(in oklab, var(--fg) 14%, transparent);
  --cursor: #7dcea0;
  color-scheme: dark;
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--fg);
  font-family: "JetBrains Mono", ui-monospace, "SFMono-Regular", "Cascadia Code", Menlo, Consolas, monospace;
  font-size: 0.9375rem;
  line-height: 1.55;
}

button:not(:disabled) {
  cursor: pointer;
}

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

h1, h2, h3 {
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 50;
  width: auto;
  background: var(--elevated);
  padding: 0.5rem 0.75rem;
  color: var(--fg);
  text-decoration: none;
}

.wrap {
  width: min(100%, 84ch);
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 1rem;
  padding-inline: 1rem;
}

@media (min-width: 640px) {
  .header-inner {
    padding-inline: 1.5rem;
  }
}

.prompt {
  display: flex;
  align-items: center;
  min-height: 2.75rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.prompt .em {
  color: var(--accent);
}

.caret {
  margin-left: 0.25rem;
  display: inline-block;
  height: 1rem;
  width: 0.5rem;
  transform: translateY(1px);
  background: var(--cursor);
}

@media (prefers-reduced-motion: no-preference) {
  .caret {
    animation: caret 1.1s steps(1, end) infinite;
  }
}

@keyframes caret {
  50% { opacity: 0; }
}

.nav {
  order: 3;
  display: flex;
  min-height: 2.75rem;
  width: 100%;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 0.75rem;
}

@media (min-width: 640px) {
  .nav {
    order: 0;
    width: auto;
    flex: 1;
  }
}

.nav a {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  font-size: 0.875rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 150ms cubic-bezier(0.23, 1, 0.32, 1);
}

.nav a:hover {
  color: var(--fg);
}

.theme {
  display: flex;
  min-height: 2.75rem;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
  font-size: 0.875rem;
}

.theme-label {
  display: none;
  color: var(--muted);
}

@media (min-width: 640px) {
  .theme-label {
    display: inline;
  }
}

.theme button {
  display: inline-flex;
  min-height: 2.75rem;
  min-width: 2.75rem;
  align-items: center;
  justify-content: center;
  padding: 0 0.5rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  transition: color 150ms cubic-bezier(0.23, 1, 0.32, 1), transform 150ms cubic-bezier(0.23, 1, 0.32, 1);
}

.theme button:hover {
  color: var(--fg);
}

.theme button:active {
  transform: scale(0.96);
}

.theme button[aria-pressed="true"] {
  color: var(--accent);
}

.theme-sep {
  color: var(--border);
}

.page {
  padding: 2.5rem 1rem;
}

@media (min-width: 640px) {
  .page {
    padding: 3.5rem 1.5rem;
  }
}

.man-banner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
}

.banner-cat {
  display: none;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.banner-host {
  color: var(--muted);
}

.banner-right {
  display: none;
}

@media (min-width: 640px) {
  .banner-cat {
    display: block;
  }

  .banner-host {
    display: none;
  }

  .banner-right {
    display: inline;
  }
}

.sec {
  margin-top: 2.5rem;
}

.sec-block {
  margin-top: 3rem;
  scroll-margin-top: 5rem;
}

h1, h2, h3 {
  margin: 0;
}

h2 {
  font-size: inherit;
  font-weight: 500;
  letter-spacing: 0.025em;
}

h1 {
  margin-top: 0.75rem;
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.375;
}

@media (min-width: 640px) {
  h1 {
    font-size: 1.5rem;
  }
}

h3 {
  margin-top: 0.25rem;
  font-size: inherit;
  font-weight: 500;
  line-height: 1.375;
}

.indent {
  padding-left: 0;
}

@media (min-width: 640px) {
  .indent {
    padding-left: 4ch;
  }
}

.dash {
  color: var(--muted);
}

.em {
  color: var(--accent);
}

.muted {
  color: var(--muted);
}

.prose {
  margin-top: 0.75rem;
}

.prose p {
  margin: 0;
}

.prose p + p {
  margin-top: 1rem;
}

.synopsis {
  display: grid;
  margin: 0.75rem 0 0;
  gap: 0.2rem 1.25rem;
}

@media (min-width: 640px) {
  .synopsis {
    grid-template-columns: 12ch minmax(0, 1fr);
  }
}

.synopsis dt {
  color: var(--muted);
}

.synopsis dd {
  margin: 0;
}

.papers,
.links {
  margin: 0;
  padding: 0;
  list-style: none;
}

.papers > li + li {
  margin-top: 2rem;
}

.paper-meta {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
}

.paper-authors {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  color: var(--muted);
}

.me {
  font-weight: 500;
  color: var(--fg);
}

.paper-links {
  display: flex;
  flex-wrap: wrap;
  margin: 0.5rem 0 0;
  column-gap: 1rem;
  row-gap: 0.25rem;
  font-size: 0.875rem;
}

a.ext {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 4px;
  transition: color 150ms cubic-bezier(0.23, 1, 0.32, 1);
}

a.ext:hover {
  text-decoration: underline;
}

details {
  margin-top: 0.5rem;
}

summary {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  font-size: 0.875rem;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
  transition: color 150ms cubic-bezier(0.23, 1, 0.32, 1);
}

summary::-webkit-details-marker {
  display: none;
}

summary:hover {
  color: var(--fg);
}

.mark {
  display: inline-block;
  width: 1rem;
  margin-right: 0.5rem;
  color: var(--accent);
}

.mark-close {
  display: none;
}

details[open] > summary .mark-open {
  display: none;
}

details[open] > summary .mark-close {
  display: inline;
}

.abstract {
  margin: 0.5rem 0 0;
  max-width: 65ch;
  font-size: 0.875rem;
  line-height: 1.625;
}

.stack {
  margin-top: 0.75rem;
}

.stack > * + * {
  margin-top: 1.5rem;
}

.entry {
  display: grid;
  gap: 0.35rem 1.25rem;
}

@media (min-width: 640px) {
  .entry {
    grid-template-columns: 16ch minmax(0, 1fr);
  }
}

.when {
  margin: 0;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.body {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  line-height: 1.625;
}

.links li + li {
  margin-top: 0.25rem;
}

kbd {
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--elevated);
  padding: 0.125rem 0.375rem;
  color: var(--accent);
  font: inherit;
}

.colophon {
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
  line-height: 1.625;
}

@media print {
  :root {
    --bg: #ffffff;
    --fg: #111111;
    --muted: #444444;
    --accent: #0b6b4a;
    --elevated: #ffffff;
    --border: #cccccc;
  }

  html,
  body {
    background: white;
    color: black;
  }

  .no-print {
    display: none !important;
  }

  a {
    color: inherit;
    text-decoration: none;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #444;
  }

  details {
    display: block;
  }

  details > summary {
    display: none;
  }
}
