/* emiliogcs.com — one stylesheet, no build step. */

/* ---------------------------------------------------------------- fonts */

@font-face {
  font-family: "EB Garamond";
  src: url("/assets/fonts/eb-garamond-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("/assets/fonts/eb-garamond-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/assets/fonts/ibm-plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* Metric-matched fallbacks (computed from the real fonts), so the swap
   from system font to web font moves nothing. */
@font-face {
  font-family: "Garamond Fallback";
  src: local("Times New Roman"), local("TimesNewRomanPSMT"), local("Liberation Serif"), local("Tinos");
  size-adjust: 94.17%;
  ascent-override: 106.94%;
  descent-override: 31.65%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Plex Fallback";
  src: local("Menlo"), local("Menlo-Regular"), local("Courier New"), local("CourierNewPSMT"), local("Liberation Mono"), local("Cousine");
  size-adjust: 99.8%;
  ascent-override: 102.7%;
  descent-override: 27.55%;
  line-gap-override: 0%;
}

/* --------------------------------------------------------------- tokens */

:root {
  --paper: #F5F3EE;
  --ink: #151515;
  --muted: #6B6A66;
  --rule: #D9D6CF;
  --accent: #8C2F23; /* oxblood */

  --serif: "EB Garamond", "Garamond Fallback", Garamond, "Times New Roman", serif;
  --mono: "IBM Plex Mono", "Plex Fallback", ui-monospace, Menlo, Consolas, monospace;

  --gutter: 20px;
  --gap: 24px;
  --max: 1280px;
  --space: 80px; /* between sections */

  color-scheme: light dark;
}
/* Dark follows the system unless the visitor picked a theme with the switch
   in the footer (site.js sets data-theme="light" or "dark" on <html>). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0F0F0E;
    --ink: #ECE9E2;
    --muted: #8E8B84;
    --rule: #2A2926;
    --accent: #D27A68;
  }
}
:root[data-theme="dark"] {
  --paper: #0F0F0E;
  --ink: #ECE9E2;
  --muted: #8E8B84;
  --rule: #2A2926;
  --accent: #D27A68;
  color-scheme: dark;
}
:root[data-theme="light"] {
  color-scheme: light;
}
@media (min-width: 900px) {
  :root {
    --gutter: 48px;
    --space: 128px;
  }
}

/* ----------------------------------------------------------------- base */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 18px/1.6 var(--serif);
  font-variant-numeric: oldstyle-nums;
  font-kerning: normal;
  overflow-wrap: break-word;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}
:root[data-theme="dark"] body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
p,
ul,
ol,
figure,
pre {
  margin: 0;
}
ul {
  padding: 0;
  list-style: none;
}
h1,
h2,
h3 {
  font-weight: 400;
}
cite {
  font-style: italic;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}
a:hover {
  color: var(--accent);
}

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

::selection {
  background: var(--ink);
  color: var(--paper);
}

/* Visually hidden, still read aloud. */
.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 4px 8px;
  background: var(--paper);
  font: 13px/1.6 var(--mono);
  transform: translateY(-200%);
}
.skip:focus {
  transform: none;
}

/* Small caps for acronyms in running text. */
.sc {
  font-variant-caps: all-small-caps;
  letter-spacing: 0.04em;
}

/* Mono metadata: labels, years, numbers, link rows. */
.mono,
.label,
.note,
.actions,
.nav,
.links,
.yr,
.sublabel,
.line-cap {
  font-family: var(--mono);
  font-variant-numeric: lining-nums;
}

/* --------------------------------------------------------------- layout */

.wrap {
  width: min(100% - 2 * var(--gutter), var(--max));
  margin-inline: auto;
}

/* Twelve columns on desktop: labels sit in 1–2, text starts at column 3. */
@media (min-width: 900px) {
  .grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--gap);
    align-items: start;
  }
  .grid > .label {
    grid-column: 1 / 3;
  }
  .grid > .body {
    grid-column: 3 / -1;
  }
}

.reading {
  max-width: 640px;
}

.section {
  margin-top: var(--space);
  padding-top: 20px;
  border-top: 1px solid var(--rule);
}

.label {
  font-size: 12px;
  line-height: 24px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 32px;
}
@media (min-width: 900px) {
  .label {
    margin-bottom: 0;
  }
}

/* --------------------------------------------------------------- header */

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  column-gap: 32px;
  row-gap: 4px;
  padding-top: 28px;
}
@media (min-width: 900px) {
  .site-header {
    padding-top: 40px;
  }
}

.name {
  font-size: 17px;
  line-height: 24px;
  font-variant-caps: all-small-caps;
  font-variant-numeric: lining-nums;
  letter-spacing: 0.06em;
}

.nav ul,
.links {
  display: flex;
  flex-wrap: wrap;
}
.nav {
  font-size: 13px;
  line-height: 24px;
  text-transform: lowercase;
}
.nav a,
.links a {
  display: inline-block;
  min-height: 24px;
}
/* The dot hangs off the end of each item, so a wrapped row never starts with one. */
.nav li:not(:last-child)::after,
.links li:not(:last-child)::after {
  content: "·";
  content: "·" / "";
  margin-inline: 0.6em;
  color: var(--muted);
}

/* ---------------------------------------------------------------- intro */

.intro {
  padding-top: 72px;
}
@media (min-width: 900px) {
  .intro {
    padding-top: 112px;
  }
}
/* With the birds (body.sky), the flock sits above the statement until 1200px. */
.sky .intro {
  padding-top: 32px;
}
@media (min-width: 900px) {
  .sky .intro {
    padding-top: 48px;
  }
}
@media (min-width: 1200px) {
  .sky .intro {
    padding-top: 112px;
  }
}

.statement {
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.2;
  max-width: 17em;
  text-wrap: balance;
}

.bio {
  margin-top: 32px;
  max-width: 34em; /* ≈ 64ch */
  text-wrap: pretty;
}

/* ------------------------------------------------------------- the line */

.line {
  margin-top: 64px;
}
@media (min-width: 900px) {
  .line {
    margin-top: 96px;
  }
}
.line-svg {
  display: block;
  width: 100%;
  height: 64px;
  color: var(--muted);
  overflow: visible;
}
.line-svg path {
  stroke-width: 0.75;
}
.line-cap {
  margin-top: 8px;
  font-size: 11px;
  line-height: 16px;
  text-align: right;
  color: var(--muted);
}
.phi {
  font-family: var(--serif);
  font-size: 13px;
}

/* ---------------------------------------------------------------- birds */
/* Birds: two birds traced from a line drawing (scripts/birds.py) sit in
   the intro as drawn. With motion allowed, site.js
   hides them there (.aloft keeps their space) and flies them, with three
   more, in .flight: one layer over the window, above the text. */

.intro {
  position: relative;
}
.flock {
  display: block;
  position: relative;
  width: auto;
  height: 200px;
  margin: 0 0 32px auto;
  overflow: visible;
  color: var(--ink);
  pointer-events: none;
}
.flock.aloft {
  visibility: hidden;
}
@media (min-width: 900px) {
  .flock {
    grid-column: 3 / -1;
    justify-self: end;
    height: 240px;
    margin: 0 0 40px;
  }
}
@media (min-width: 1200px) {
  .flock {
    position: absolute;
    top: 8px;
    right: 0;
    height: min(340px, 24vw);
    margin: 0;
  }
}

.flight {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 1;
  color: var(--ink);
}
/* Contact page: the birds wheel round the address. Birds at the back of
   their ring fly in .flight.behind, under the text; at the front, in
   .flight.ahead, over it. With motion allowed the drawing itself is not
   shown there (site.js sizes the birds as it would be). */
[data-birds="orbit"] .site-header,
[data-birds="orbit"] main,
[data-birds="orbit"] .site-footer {
  position: relative;
  z-index: 1;
}
.flight.behind {
  z-index: 0;
}
.flight.ahead {
  z-index: 2;
}
@media (prefers-reduced-motion: no-preference) {
  .js [data-birds="orbit"] .flock {
    display: none;
  }
}
.contact {
  min-height: 62vh;
}
.sky .intro.contact {
  padding-top: clamp(96px, 24vh, 240px); /* the address about a third of the way down, room for the ring */
}
.contact-email {
  font-size: clamp(28px, 4vw, 40px); /* the home page statement's size */
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.contact-email a {
  text-decoration-line: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
  transition: color 0.2s, text-decoration-color 0.2s;
}
.contact-email a:hover,
.contact-email a:focus-visible {
  text-decoration-color: currentColor;
}
.contact-copy {
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 24px;
}
.contact-copy .act {
  float: none;
  display: inline-block;
}
.contact .links {
  margin-top: 28px;
}
.contact-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 48px;
}

.flight.armed path {
  stroke-dasharray: var(--len) var(--len);
  stroke-dashoffset: var(--len);
}
.flight.armed.draw path {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1.6s cubic-bezier(0.3, 0.5, 0.3, 1) var(--delay, 0s);
}

/* ------------------------------------------------------------- research */

.plate {
  display: grid;
  gap: 24px;
}
/* Plates: a hairline with 96px between them, split either side. */
.plate + .plate {
  margin-top: 48px;
  padding-top: 48px;
  border-top: 1px solid var(--rule);
}
.plate-fig {
  order: -1; /* figure above the text on narrow screens */
  max-width: 560px;
}
@media (min-width: 900px) {
  .plate {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    column-gap: 48px;
    align-items: start;
  }
  .plate-fig {
    order: 0;
    max-width: 400px;
    width: 100%;
  }
}

.plate-svg {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  transition: color 0.2s;
}
.plate-svg .base {
  stroke: var(--rule);
}

.plate-title {
  font-size: clamp(24px, 2.6vw, 32px);
  line-height: 1.2;
  text-wrap: balance;
}
.plate-title a {
  text-decoration-line: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color 0.2s, text-decoration-color 0.2s;
}

.with {
  margin-top: 12px;
  font-style: italic;
  color: var(--muted);
}
.venue {
  margin-top: 2px;
}
.note {
  margin-top: 6px;
  font-size: 13px;
  line-height: 20px;
  color: var(--muted);
  text-transform: lowercase;
}

/* Hover or focus anywhere in a plate: figure to accent, title underlined. */
.plate:hover .plate-svg,
.plate:focus-within .plate-svg {
  color: var(--accent);
}
.plate:hover .plate-title a,
.plate:focus-within .plate-title a {
  text-decoration-color: currentColor;
}

/* Action row: paper ↗ · supplement ↗ · bibtex · abstract +
   Links float so the abstract's <summary> can share their line while its
   content opens full width below. */
.actions {
  margin-top: 16px;
  font-size: 13px;
  line-height: 24px;
  text-transform: lowercase;
}
.actions::after {
  content: "";
  display: table;
  clear: both;
}
.act,
.sep {
  float: left;
}
.sep {
  margin-inline: 0.6em;
  color: var(--muted);
}
.act {
  display: block;
  min-height: 24px;
  white-space: nowrap;
}
button.act {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-transform: inherit;
  cursor: pointer;
  transition: color 0.2s;
}
button.act:hover {
  color: var(--accent);
}

details > summary {
  list-style: none;
  cursor: pointer;
}
details > summary::-webkit-details-marker {
  display: none;
}
.abstract > summary {
  display: inline-block;
  white-space: nowrap;
  transition: color 0.2s;
}
.abstract > summary:hover {
  color: var(--accent);
}
.sign::before {
  content: "+";
}
details[open] > summary .sign::before {
  content: "−";
}

.abstract-body {
  clear: left;
  max-width: 60ch;
  padding-top: 12px;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.55;
  font-variant-numeric: oldstyle-nums;
  text-transform: none;
  text-wrap: pretty;
}
.abstract-body p + p {
  margin-top: 0.6em;
}
.abstract-body .run-in {
  font-variant-caps: all-small-caps;
  letter-spacing: 0.04em;
}

/* Animate the abstract opening where the platform can; open instantly elsewhere. */
@supports (interpolate-size: allow-keywords) {
  @media (prefers-reduced-motion: no-preference) {
    :root {
      interpolate-size: allow-keywords;
    }
    .abstract::details-content {
      block-size: 0;
      overflow: clip;
      transition: block-size 0.35s cubic-bezier(0.3, 0, 0.2, 1), content-visibility 0.35s allow-discrete;
    }
    .abstract[open]::details-content {
      block-size: auto;
    }
  }
}

/* BibTeX without JavaScript: a plain <details>. With JavaScript it becomes
   a copy button, and this only reappears if the clipboard is unavailable. */
.bib {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 24px;
}
.bib > summary {
  display: inline-block;
}
.bib > summary::after {
  content: " +";
}
.bib[open] > summary::after {
  content: " −";
}
.bib pre {
  margin-top: 8px;
  padding: 12px 0;
  border-block: 1px solid var(--rule);
  font: 12px/1.6 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  tab-size: 2;
}

/* --------------------------------------------------- figures in motion */

/* With JS and motion allowed, figures wait (invisible) until site.js arms
   them. If the script never runs, they appear after 2.5s regardless. */
@media (prefers-reduced-motion: no-preference) {
  .js .plate-fig:not(.ready) svg,
  .js .line:not(.ready) svg,
  .js .flock:not(.ready) {
    opacity: 0;
    animation: failsafe 0s 2.5s forwards;
  }
}
@keyframes failsafe {
  to {
    opacity: 1;
  }
}

.armed .plate-svg path:not(.base):not(.null) {
  stroke-dasharray: var(--len) var(--len);
  stroke-dashoffset: var(--len);
}
.armed .plate-svg circle,
.armed .plate-svg .null {
  opacity: 0;
}
.armed.draw .plate-svg path:not(.base):not(.null) {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset var(--dur, 1.3s) cubic-bezier(0.25, 0.6, 0.3, 1) var(--delay, 0s);
}
.armed.draw .plate-svg circle,
.armed.draw .plate-svg .null {
  opacity: 1;
  transition: opacity 0.4s ease-out var(--delay, 0s);
}

.line.armed .line-svg {
  clip-path: inset(0 100% 0 0);
}
.line.armed.draw .line-svg {
  clip-path: inset(0 0 0 0);
  transition: clip-path 1.8s cubic-bezier(0.45, 0.05, 0.25, 1);
}

/* ----------------------------------------------------------- also, bg */

.plain li + li {
  margin-top: 12px;
}

.lists {
  display: grid;
  gap: 48px;
}
.sublabel {
  font-size: 13px;
  line-height: 24px;
  color: var(--muted);
  text-transform: lowercase;
  margin-bottom: 12px;
}
.cv li {
  display: grid;
  grid-template-columns: 7.5em minmax(0, 1fr);
  column-gap: 16px;
}
.cv li + li {
  margin-top: 10px;
}
.yr {
  font-size: 13px;
  line-height: 1.6rem;
  padding-top: 2px; /* settle the mono years on the serif baseline */
  color: var(--muted);
  white-space: nowrap;
}
.org {
  color: var(--muted);
}
@media (max-width: 479px) {
  .cv li {
    grid-template-columns: minmax(0, 1fr);
  }
  .yr {
    padding-top: 0;
    line-height: 20px;
  }
}

/* --------------------------------------------------------------- footer */

.site-footer {
  margin-bottom: 96px;
}
.links {
  font-size: 13px;
  line-height: 24px;
}
.links .place {
  color: var(--muted);
}
.footer-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px 32px;
}

/* Theme switch: theme  auto · light · dark */
.theme-switch {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 24px;
}
.theme-switch[hidden] {
  display: none;
}
.theme-label {
  margin-right: 0.8em;
  color: var(--muted);
}
.theme-switch button {
  min-height: 24px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
  transition: color 0.2s;
}
.theme-switch button + button::before {
  content: "·";
  content: "·" / "";
  margin-inline: 0.6em;
  color: var(--muted);
  display: inline-block; /* keeps the dot out of the underline */
}
.theme-switch button:hover {
  color: var(--accent);
}
.theme-switch button[aria-pressed="true"] {
  color: var(--ink);
  text-decoration-line: underline;
}

/* ------------------------------------------------------------ code page */
/* /code/: the pyfgls documentation, generated from its repository
   (scripts/build_site_page.py there). Prose in the serif, code and
   metadata in mono, code between hairlines as the BibTeX entries are.
   Contents: a sticky column from 1200px, a closed <details> above that. */

.code-intro .statement {
  max-width: 15em;
}
.pitch {
  margin-top: 16px;
  font-style: italic;
  color: var(--muted);
}
.lede {
  margin-top: 24px;
  text-wrap: pretty;
}
.lede > * + * {
  margin-top: 0.7em;
}
.lede ul {
  padding-left: 1.2em;
  list-style: disc;
}
.lede li + li {
  margin-top: 0.4em;
}
.code-intro .actions {
  margin-top: 28px;
}

.docs > .toc-side {
  display: none;
}
@media (min-width: 1200px) {
  .docs > .toc-side {
    display: block;
    grid-column: 1 / 3;
    position: sticky;
    top: 24px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }
  .toc-top {
    display: none;
  }
}
.toc-side,
.toc-top {
  font-family: var(--mono);
  font-variant-numeric: lining-nums;
  font-size: 12px;
  line-height: 18px;
}
.toc-title {
  margin-bottom: 8px;
  line-height: 24px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.toc-list,
.toc-list ol {
  margin: 0;
  padding: 0;
  list-style: none;
}
.toc-list ol {
  margin: 2px 0 8px 1px;
  padding-left: 12px;
  border-left: 1px solid var(--rule);
}
.toc-list a {
  display: block;
  padding: 3px 0; /* 24px targets */
  color: var(--muted);
}
.toc-list > li > a {
  color: var(--ink);
}
.toc-list a:hover,
.toc-list a[aria-current] {
  color: var(--accent);
}
.toc-list code {
  font: inherit;
}
/* With the script, only the section in view shows its subsections. */
.toc-side.spy .toc-list ol {
  display: none;
}
.toc-side.spy .toc-list li.open > ol {
  display: block;
}

.toc-top {
  margin-bottom: 48px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule); /* the section's own rule is just above */
  font-size: 13px;
}
.toc-top > summary {
  display: inline-block;
  min-height: 24px;
  line-height: 24px;
  transition: color 0.2s;
}
.toc-top > summary:hover {
  color: var(--accent);
}
.toc-top nav {
  padding: 8px 0 4px;
}

.doc {
  min-width: 0;
  max-width: 800px;
}
.doc-section + .doc-section {
  margin-top: 96px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
}
.doc-h2 {
  margin-bottom: 32px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 24px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.doc-section h3,
.doc-section h4,
.doc-section h5,
.doc-section h6 {
  font-weight: 400;
}
.doc-section h3 {
  margin: 72px 0 16px;
  font-size: clamp(24px, 2.6vw, 30px);
  line-height: 1.2;
  text-wrap: balance;
}
.doc-h2 + h3 {
  margin-top: 0;
}
.doc-section h4 {
  margin: 40px 0 12px;
  font-size: 21px;
  line-height: 1.3;
}
.doc :is(h2, h3, h4, h5, h6)[id] {
  scroll-margin-top: 24px;
}
.doc-section :is(h3, h4) > a::after {
  content: " #";
  content: " #" / "";
  color: var(--muted);
  opacity: 0;
  transition: opacity 0.2s;
}
.doc-section :is(h3, h4) > a:is(:hover, :focus-visible)::after {
  opacity: 1;
}

.doc-section :is(p, ul, ol, dl, .table-wrap, .code, div.math, .api-obj, blockquote) {
  margin-top: 16px;
}
/* Notes set apart (the README's "> ..."): a hairline at the left, as nested API entries. */
.doc-section blockquote {
  max-width: 680px;
  margin-inline: 0;
  padding-left: 16px;
  border-left: 1px solid var(--rule);
}
.doc-section blockquote > :first-child {
  margin-top: 0;
}
.doc-section :is(p, ul, ol, dl) {
  max-width: 680px;
  text-wrap: pretty;
}
.doc-section :is(h3, h4, h5, .doc-h2) + :is(p, ul, ol, dl, .table-wrap, .code, div.math) {
  margin-top: 0;
}
.doc-section ul {
  padding-left: 1.2em;
  list-style: disc;
}
.doc-section ol {
  padding-left: 1.5em;
}
.doc-section li + li {
  margin-top: 0.4em;
}
.doc-section li > p {
  margin-top: 0;
}
.doc-section a:not(.api-h a):not(:is(h3, h4, h5) a) {
  text-decoration-line: underline;
  text-decoration-color: var(--rule);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color 0.2s, text-decoration-color 0.2s;
}
.doc-section a:not(.api-h a):not(:is(h3, h4, h5) a):hover {
  text-decoration-color: currentColor;
}
.doc-section code,
.lede code {
  font-family: var(--mono);
  font-size: 0.8em;
  font-variant-numeric: lining-nums;
}
.doc-section img {
  display: block;
  max-width: 100%;
  height: auto;
  margin-top: 24px;
  mix-blend-mode: multiply; /* the figure's white falls into the paper */
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .doc-section img {
    filter: invert(1) hue-rotate(180deg);
    mix-blend-mode: screen;
  }
}
:root[data-theme="dark"] .doc-section img {
  filter: invert(1) hue-rotate(180deg);
  mix-blend-mode: screen;
}

/* Tables: rows between hairlines, mono heads; wide ones scroll in place. */
.table-wrap {
  overflow-x: auto;
}
.doc-section table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.45;
}
.doc-section th,
.doc-section td {
  padding: 7px 16px 7px 0;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}
.doc-section th {
  border-bottom-color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  line-height: 20px;
  color: var(--muted);
}
.doc-section th code {
  font-size: 1em;
}
.doc-section :is(th, td):last-child {
  padding-right: 0;
}

/* Code: a mono label and the copy button above, hairlines either side. */
.code {
  border-block: 1px solid var(--rule);
}
.doc-section .code {
  margin-top: 20px;
}
.code-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 4px;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 24px;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.code-head .act {
  float: none;
  letter-spacing: 0;
  font-size: 12px;
}
.code pre {
  overflow-x: auto;
  padding: 4px 0 14px;
  font: 13px/1.6 var(--mono);
  font-variant-numeric: lining-nums;
  font-variant-ligatures: none;
  tab-size: 4;
}
.code pre code {
  font: inherit;
}
.code.sig pre {
  padding-top: 12px;
}
@media (max-width: 479px) {
  .code pre {
    font-size: 12px;
  }
}
/* Highlighting in the site's three inks: keywords in the accent, comments
   and prompts muted, everything else as text. */
.code :is(.k, .kc, .kd, .kn, .kp, .kr, .kt, .ow, .nd) {
  color: var(--accent);
}
.code :is(.c, .c1, .ch, .cm, .cp, .cpf, .cs, .gp) {
  color: var(--muted);
}

/* Math: MathJax typesets \( \) and \[ \]; until then the TeX shows as mono. */
.math {
  font-family: var(--mono);
  font-size: 0.8em;
}
.math:has(mjx-container) {
  font-family: inherit;
  font-size: inherit;
}
div.math {
  overflow-x: auto;
  overflow-y: hidden;
  padding-block: 4px;
}
mjx-container[display="true"] {
  margin: 0 !important;
}

/* API reference */
.api-note,
.api-inherits {
  color: var(--muted);
}
.doc-section .api-obj {
  margin-top: 48px;
}
.doc-section .api-obj .api-obj {
  margin-top: 32px;
  padding-left: 16px;
  border-left: 1px solid var(--rule);
}
.doc-section .api-h {
  margin: 0 0 8px;
  font-family: var(--mono);
  font-size: 15px;
  line-height: 24px;
  overflow-wrap: anywhere;
}
.doc-section h5.api-h,
.doc-section h6.api-h {
  font-size: 14px;
}
.api-h code {
  font-size: 1em;
}
.api-kind {
  margin-left: 0.6em;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.doc-section .api-label {
  margin-top: 20px;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 24px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.doc-section .api-label + :is(.api-items, .code) {
  margin-top: 4px;
}
.api-items dt {
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 20px;
}
.api-items dt:first-child {
  margin-top: 0;
}
.api-items dt code {
  font-size: 1em;
}
.api-type {
  color: var(--muted);
}
.api-items dd {
  margin: 2px 0 0 16px;
  font-size: 17px;
  line-height: 1.55;
}
.doc-section .api-items dd p {
  margin-top: 0;
}

/* ---------------------------------------------------------------- 404 */

.lost {
  padding-top: 112px;
  padding-bottom: 160px;
}
.lost p + p {
  margin-top: 16px;
}

/* ------------------------------------------------------------ motion */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0s !important;
    animation-duration: 0s !important;
  }
}

/* ------------------------------------------------------------- print */

@media print {
  :root,
  :root[data-theme] {
    --paper: #fff;
    --ink: #000;
    --muted: #444;
    --rule: #bbb;
    --accent: #000;
    --space: 32px;
  }
  body {
    font-size: 11pt;
  }
  .nav,
  .line,
  .skip,
  .actions,
  .bib,
  .theme-switch,
  .flock,
  .flight,
  .toc,
  .toc-top,
  .copy-code {
    display: none !important;
  }
  .code pre {
    overflow: visible;
    white-space: pre-wrap;
  }
  .wrap {
    width: auto;
    margin-inline: 0;
  }
  .intro {
    padding-top: 24px;
  }
  .plate,
  .cv li {
    break-inside: avoid;
  }
  .plate-fig {
    max-width: 240px;
  }
  .plate-svg {
    color: #000 !important;
  }
  a[href^="http"]::after,
  a[href^="mailto:"]::after {
    content: " (" attr(href) ")";
    font-family: var(--mono);
    font-size: 8pt;
    color: var(--muted);
    overflow-wrap: anywhere;
    white-space: normal;
  }
  a[href^="/"]:not([href="/"]):not([href^="/#"])::after {
    content: " (https://emiliogcs.com" attr(href) ")";
    font-family: var(--mono);
    font-size: 8pt;
    color: var(--muted);
  }
  .plate-title a::after {
    display: block;
    margin-top: 2px;
  }
}
