/* Deck theme: pure black background, white text, EB Garamond body,
   TeX Gyre Chorus (chancery) display face for titles. */

@font-face {
  font-family: "EB Garamond";
  src: url("fonts/EBGaramond12-Regular.woff") format("woff");
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: "EB Garamond";
  src: url("fonts/EBGaramond12-Italic.woff") format("woff");
  font-weight: normal;
  font-style: italic;
}
@font-face {
  font-family: "EB Garamond";
  src: url("fonts/EBGaramond12-Bold.woff") format("woff");
  font-weight: bold;
  font-style: normal;
}
@font-face {
  font-family: "Chorus";
  src: url("fonts/texgyrechorus-mediumitalic.otf") format("opentype");
}

:root {
  --slt-background: #000;
  --slt-foreground: #fff;
  --slt-muted: #999;
  --slt-landscape-color: #adb4b9;
  --slt-accent: #ffdc00;
  --slt-progress-accent: var(--slt-accent);
  /* The colour of what a widget or a picture singles out: curves, sample
     points, estimates, sliders. Widgets read it where they sit. */
  --slt-highlight: #ff9933;
  --slt-body-font: "EB Garamond", Garamond, serif;
  --slt-display-font: "Chorus", "EB Garamond", serif;
}

body[data-progress-color="orange"] {
  --slt-progress-accent: #ff9933;
}
body[data-progress-color="magenta"] {
  --slt-progress-accent: #ff4dff;
}

/* `palette: purple` in a deck's metadata: one violet for everything that is
   orange or yellow by default (widgets, sliders, the progress bar). It is
   light enough to stay readable on black in thin lines and small text. */
body[data-palette="purple"] {
  --slt-highlight: #b388ff;
  --slt-accent: #b388ff;
  --slt-progress-accent: #b388ff;
}

html,
body,
.reveal-viewport {
  background: var(--slt-background);
}

.reveal {
  font-family: var(--slt-body-font);
  font-size: 36px;
  color: var(--slt-foreground);
}

.reveal .slides {
  text-align: left;
}

/* Presenter previews: mark the drawing area's edge against black letterboxing. */
.reveal .slides .presenter-slide-boundary {
  position: absolute;
  inset: 0;
  box-sizing: border-box;
  border: 1px solid #999;
  pointer-events: none;
  z-index: 50;
}

.reveal .slides section {
  line-height: 1.3;
}

/* Headings. */

.reveal h1,
.reveal h2 {
  font-family: var(--slt-display-font);
  font-weight: normal;
  margin: 0 0 0.6em 0;
}
.reveal h1 {
  font-size: 2.6em;
}
.reveal h2 {
  font-size: 1.6em;
}
.reveal h3 {
  font-size: 1.1em;
  font-style: italic;
  font-weight: normal;
  margin: 0 0 0.4em 0;
}

/* Title slide and section-title slides (level-1 headings) are centred. */

.reveal #title-slide,
.reveal section.level1 > h1:only-child {
  text-align: center;
}
.reveal #title-slide {
  padding-top: 18%;
}
.reveal #title-slide > .title-landscape {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 0;
}
.reveal #title-slide > :not(.title-landscape) {
  position: relative;
  z-index: 1;
}
.reveal #title-slide .subtitle {
  font-style: italic;
  font-size: 1.2em;
  margin-bottom: 1.5em;
}
.reveal #title-slide .author,
.reveal #title-slide .date {
  margin: 0.2em 0;
}
.reveal section.level1 > h1:only-child {
  margin-top: 25%;
}

/* Decorative mathematical ornaments above section titles. */

.reveal section.level1[data-ornament]::before {
  content: "";
  position: absolute;
  top: 85px;
  left: 50%;
  width: 280px;
  height: 180px;
  transform: translateX(-50%);
  background: var(--slt-muted);
  mask: var(--slt-ornament) center / contain no-repeat;
  pointer-events: none;
}
.reveal section[data-ornament="cusp"] {
  --slt-ornament: url("ornaments/cusp.svg");
}
.reveal section[data-ornament="cusp-5"] {
  --slt-ornament: url("ornaments/cusp-5.svg");
}
.reveal section[data-ornament="parabola"] {
  --slt-ornament: url("ornaments/parabola.svg");
}
.reveal section[data-ornament="triple-crossing"] {
  --slt-ornament: url("ornaments/triple-crossing.svg");
}
.reveal section[data-ornament="normal-crossings"] {
  --slt-ornament: url("ornaments/normal-crossings.svg");
}
.reveal section[data-ornament="punctured-axes"] {
  --slt-ornament: url("ornaments/punctured-axes.svg");
}

/* Five moments of sampling chains settling on two crossing lines
   (tools/make_sgld_ornaments.mjs), to go with the "sgld" title landscape. */


/* The same on the cusp. */

.reveal section[data-ornament="sgld-cusp-1"] {
  --slt-ornament: url("ornaments/sgld-cusp-1.svg");
}
.reveal section[data-ornament="sgld-cusp-2"] {
  --slt-ornament: url("ornaments/sgld-cusp-2.svg");
}
.reveal section[data-ornament="sgld-cusp-3"] {
  --slt-ornament: url("ornaments/sgld-cusp-3.svg");
}
.reveal section[data-ornament="sgld-cusp-4"] {
  --slt-ornament: url("ornaments/sgld-cusp-4.svg");
}
.reveal section[data-ornament="sgld-cusp-5"] {
  --slt-ornament: url("ornaments/sgld-cusp-5.svg");
}

/* Three reductions: merge duplicates, remove a zero-output unit, absorb a constant. */

.reveal section[data-ornament="network-short-3"] {
  --slt-ornament: url("ornaments/network-short-3.svg");
}

.reveal section[data-ornament="network-short-2"] {
  --slt-ornament: url("ornaments/network-short-2.svg");
}

.reveal section[data-ornament="network-short-1"] {
  --slt-ornament: url("ornaments/network-short-1.svg");
}

.reveal section[data-ornament="network-short-0"] {
  --slt-ornament: url("ornaments/network-short-0.svg");
}

/* Body text. */

.reveal .slides p {
  margin: 0 0 0.6em 0;
}
.reveal .slides ul,
.reveal .slides ol {
  margin: 0 0 0.6em 1.2em;
}
.reveal .slides li {
  margin: 0.25em 0;
}
.reveal .slides ul > li::marker {
  content: "•  ";
}
.reveal .slides dl {
  margin: 0 0 0.6em 0;
}
.reveal .slides dt {
  font-weight: bold;
}
.reveal .slides dd {
  margin: 0 0 0.6em 1.2em;
}
.reveal .slides em {
  font-style: italic;
}
.reveal .slides strong {
  font-weight: bold;
}
.reveal .slides a {
  color: var(--slt-foreground);
  text-decoration: underline;
}
.reveal .slides .math.inline > .katex {
  font-size: 1em;
}
.reveal .slides .katex-display {
  margin: 0.6em 0;
}
.reveal .slides .muted {
  color: var(--slt-muted);
}
.reveal .slides .centered {
  text-align: center;
}

.reveal .slides blockquote {
  margin: 0.8em 1em;
  font-style: italic;
}

/* Images, videos and widgets fill available width, centred. */

.reveal .slides img,
.reveal .slides video {
  max-width: 100%;
  max-height: 520px;
  display: block;
  margin: 0 auto;
}

/* A compact portrait grid with room for four lecturers in a sidebar. */
.reveal .slides .headshots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.reveal .slides .headshots > p {
  margin: 0;
}
.reveal .slides .headshots img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

/* Two columns, via pandoc's `:::: columns` / `::: column` divs. */

.reveal .slides .columns {
  display: flex;
  gap: 1.5em;
}
.reveal .slides .column {
  flex: 1;
}

/* Slide shorthand: .sidebar or .split, with --- between the columns. */
.reveal .slides .columns.sidebar,
.reveal .slides .columns.split {
  gap: 1%;
}
.reveal .slides .columns.split > .column {
  flex: 0 0 49.5%;
  min-width: 0;
}
.reveal .slides .columns.sidebar > .column {
  flex: 0 0 24%;
  min-width: 0;
}
.reveal .slides .columns.sidebar > .column:first-child {
  flex-basis: 75%;
}
/* `## Title {.sidebar .wide}`: a wider sidebar, for a tall picture. */
.reveal .slides section.wide .columns.sidebar > .column {
  flex-basis: 35%;
}
.reveal .slides section.wide .columns.sidebar > .column:first-child {
  flex-basis: 64%;
}

/* Section progress: each segment is proportional to its slide count. */

.reveal .section-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  display: flex;
  gap: 2px;
  z-index: 30;
}
.reveal .section-progress button {
  position: relative;
  flex-basis: 0;
  min-width: 0;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--slt-muted);
  cursor: pointer;
}
.reveal .section-progress button[aria-current="step"] {
  color: var(--slt-progress-accent);
}
.reveal .section-progress button::before {
  content: "";
  position: absolute;
  inset: 0;
  background: currentColor;
  opacity: 0.25;
}
.reveal .section-progress button > span {
  display: block;
  height: 100%;
  background: currentColor;
  transform: scaleX(var(--section-progress, 0));
  transform-origin: left;
}
.reveal .section-progress button:focus-visible {
  outline: 2px solid var(--slt-foreground);
  outline-offset: 2px;
}

/* Highlight mouse and keyboard navigation in the overview grid. */

.reveal.overview .slides section:not(.stack):hover,
.reveal.overview .slides section:not(.stack).present {
  outline: 10px solid var(--slt-highlight);
  outline-offset: 10px;
}

/* Slide number. */

.reveal .slide-number {
  background: transparent;
  color: var(--slt-muted);
  font-family: var(--slt-body-font);
  font-size: 18px;
}
.reveal .slide-number a {
  text-decoration: none;
}

/* Chalk slides: blank pages for drawing on, optionally with a heading. */

.reveal section.chalk > h2:empty {
  display: none;
}

/* Dense derivation slides: `## Title {.compact}` sets slightly smaller type.
   The title keeps its size, so that every slide title is the same. */

.reveal .slides section.compact {
  font-size: 0.86em;
}
.reveal .slides section.compact > h2 {
  font-size: calc(1.6em / 0.86);
}

/* Decks with `vertical-fill: true` (see filters/slide-fill.lua). The body of
   each slide is a column as tall as the slide. Text keeps its spacing, and
   the leftover height goes above and below the displays, in equal shares. */

.reveal .slides .slide-body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.5em;
  box-sizing: border-box;
  /* The slide height, less one line of heading with its margin. */
  height: calc(720px - 3.04em);
  padding-bottom: 30px;
}
.reveal .slides section.compact .slide-body {
  height: calc(720px - 3.04em / 0.86);
}
.reveal .slides .slide-body > .columns {
  flex: 1;
  min-height: 0;
}
.reveal .slides .slide-body .column {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.5em;
}
/* A lone step or column item sits in the middle. */
.reveal .slides .slide-body > .step:only-child,
.reveal .slides .slide-body .column > :only-child {
  margin-top: auto;
  margin-bottom: auto;
}
.reveal .slides .slide-body .step > :last-child,
.reveal .slides .slide-body .column > * > :last-child {
  margin-bottom: 0;
}

/* With displays: the steps dissolve, so that every block is an item of the
   column. The gap separates the blocks; the displays take the rest. */
.reveal .slides .has-display > .step {
  display: contents;
}
.reveal .slides .has-display > .step > *,
.reveal .slides .has-display > ul,
.reveal .slides .has-display > ol {
  margin-top: 0;
  margin-bottom: 0;
}
.reveal .slides .has-display > .step > .display {
  margin-top: auto;
  margin-bottom: auto;
  padding: 0.1em 0;
}
.reveal .slides .has-display > .step > .display.follows {
  margin-top: 0;
}
.reveal .slides .slide-body .display > p,
.reveal .slides .slide-body .display .katex-display {
  margin: 0;
}
/* A dissolved step has no box to fade, so its blocks fade instead. */
.reveal .slides .has-display > .step.fragment > * {
  opacity: 0;
  transition: opacity 0.2s ease;
}
.reveal .slides .has-display > .step.fragment.visible > * {
  opacity: 1;
}
/* A picture in a column may use the whole height. */
.reveal .slides .slide-body .column .display img {
  max-height: 570px;
}

/* `## Title {.middle}`: for a slide with little on it. The content stays
   together as one block, halfway between the title and the bottom edge, with
   a fixed space above and below each display. */
.reveal .slides section.middle .slide-body {
  justify-content: center;
}
.reveal .slides section.middle .has-display > .step > .display {
  margin-top: 1.4em;
  margin-bottom: 1.4em;
}

/* `## Title {.even}`: space every block evenly, list items included. */
.reveal .slides section.even .slide-body > .step,
.reveal .slides section.even .slide-body > .step > ul,
.reveal .slides section.even .slide-body > .step > ol {
  display: contents;
}
.reveal .slides section.even .slide-body > .step > * {
  margin-top: 0;
  margin-bottom: 0;
  padding: 0;
}
.reveal .slides section.even .slide-body > .step > ul > li,
.reveal .slides section.even .slide-body > .step > ol > li {
  margin: 0 0 0 1.2em;
}

/* Tables: left-aligned cells separated by thin rules. */

.reveal .slides table {
  border-collapse: collapse;
  margin: 0 auto 0.8em;
}
.reveal .slides th,
.reveal .slides td {
  padding: 0.35em 0.7em;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid #444;
}
.reveal .slides thead th {
  font-weight: bold;
  border-bottom: 1px solid var(--slt-muted);
}
