body, html {
  margin: 0;
  font-size: 1em;
  font-family: 'EB Garamond', serif;
  color: #111;
  width: 100%;
  height: 100%;
}

p, li {
  font-size: 2rem;
}

@media all and (max-width: 1400px) {
  body, html {
    font-size: 0.95em;
  }
}

@media all and (max-width: 1200px) {
  body, html {
    font-size: 0.8em;
  }
}

* {
  transition: all ease 0.3s;
}

.hidden {
  opacity: 0;
}
svg .hidden:not(.transform) {
  opacity: 1;
  fill-opacity: 0;
  stroke-opacity: 0;
}
svg circle, svg path, svg g {
  transition: all linear 0.2s;
}
g.transform.hidden {
  transform: none !important;
  opacity: 1;
}

h1 {
  font-size: 3em;
  text-align: center;
}

#slides {
  display: flex;
  justify-content: stretch;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;

  font-size: 1.5em;
}

section {
  box-sizing: border-box;
  padding: 2em 5em;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

img, svg.expand {
  height: auto;
  max-width: 100%;
  border: 0;
}

.loading section {
  display: none;
}

.stretch {
  align-self: stretch;
}

.fill {
  flex: 1;
}

.fill-double {
  flex: 2;
}

.both {
  align-self: stretch;
}

.center {
  display: flex;
  justify-content: center;
  align-items: center;
}

p.center, h1.center, h2.center, h3.center, h4.center {
  display: block;
  text-align: center;
}

.column {
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

.row {
  display: flex;
  align-items: center;
  flex-direction: row;
  position: relative;
}

.aligntop {
  align-items: flex-start !important;
}

section svg {
  /*border: 2px solid #000;*/
  justify-self: stretch;
}

section svg * {
  transition: all ease 0.3s;
}

section svg .visible {
  stroke-dashoffset: 0 !important;
}

section .stepsContainer {
  border-left: 1px solid #DDD;
  padding-left: 1em;
}

section .stepsContainer .step {
  display: inline-block;
  vertical-align: middle;
  margin-right: 0.3em;
  margin-bottom: 0.3em;
  margin-top: 0.3em;
  font-size: 0.9em;
  transition: all ease 0.3s;
}

.disappearing {
  overflow: hidden;
  box-sizing: border-box;
}

ul.disappearing, ol.disappearing, p.disappearing, div.disappearing {
  max-height: 90vh !important;
}
ul.disappearing.hidden, ol.disappearing.hidden, p.disappearing.hidden, div.disappearing.hidden {
  margin: 0;
  max-height: 0 !important;
}
.step.disappearing.hidden, span.disappearing.hidden {
  max-width: 0 !important;
  margin-left: 0;
}
.step.disappearing.hidden {
  margin-right: 0;
}
span.disappearing.hidden {
  margin-right: -0.6em;
}
span.disappearing.nospace.hidden {
  margin-right: 0;
}
th.disappearing.hidden, td.disappearing.hidden, img.disappearing.hidden {
  max-width: 0 !important;
  max-height: 0 !important;
  padding: 0 !important;
  border-width: 0 !important;
  border-width: 0 !important;
}

section .stepsContainer .step span.code, span.disappearing {
  display: inline-block;
  vertical-align: middle;
}

section .stepsContainer .step.visible span.code {
  background-color: rgba(240,200, 0, 0.6);
  animation-name: bounce;
  animation-duration: 0.5s;
  animation-fill-mode: both;
}

section .stepsContainer .step.visible.no-animation span.code {
  animation: none;
}

td, th {
  padding: 0.6em;
  margin: 0;
  vertical-align: top;
  border-right: 1px solid #DDD;
  border-bottom: 1px solid #DDD;
}
.row table {
  max-width: 45%;
}
table span.code {
  display: inline-block;
  margin-top: 0.1em;
  margin-bottom: 0.1em;
}
table:not(.appearing) td, table:not(.appearing) th, td.first, th.first {
  border-left: 1px solid #DDD;
}
table:not(.appearing) td, table:not(.appearing) th, tr:first-child td, tr:first-child th {
  border-top: 1px solid #DDD;
}
td.hidden, th.hidden {
  border-color: rgba(0,0,0,0);
}
th {
  font-weight: bold;
  background-color: #f7f7f7;
}
.highlighted th, th.highlighted {
  background-color: #fff5af;
}
.highlighted td, td.highlighted {
  background-color: #fffce0;
}
path, line {
  transition: stroke linear 0.2s;
}
path.highlighted, line.highlighted {
  stroke: #f7c634 !important;
}
span.highlighted {
  /* color: #f7a614; */
  background-color: #fff5af;
}
table {
  border-spacing: 0;
  margin: 0 auto;
  font-size: inherit;
}
table:not(.appearing) {
  border-collapse: collapse;
}

table.small {
  font-size: 0.8em;
}

span.code {
  font-family: monospace;
  unicode-bidi: embed;
  background-color: rgba(0,0,0,0.1);
  border-radius: 4px;
  -webkit-border-radius: 4px;
  padding: 0.2em;
  vertical-align: middle;
  word-wrap: normal;
  vertical-align: middle;
  white-space: nowrap;
}
span.code.highlighted {
  background-color: rgba(240,200, 0, 0.6);
}

.disappearing span.code, span.disappearing {
  white-space: nowrap;
}

img.stack {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

li {
  margin-top: 0.3em;
  margin-bottom: 0.3em;
}

span.frac {
  display: inline-block;
  vertical-align: middle;
}
span.frac > span {
  display: block;
  text-align: center;
}
span.frac > span:first-child {
  border-bottom: 1px solid #000;
}

span.sum {
  display: inline-block;
  vertical-align: middle;
}
span.sum > span {
  text-align: center;
  display: block;
  font-size: 0.8em;
}
span.sum > span.sigma {
  font-size: 1.4em;
  margin-top: -0.2em;
  margin-bottom: -0.2em;
}

span.space {
  display: inline-block;
  width: 2em;
}

@keyframes bounce {
  0%, 100% {
    transform: scale(1);
  }

  30% {
    transform: scale(1.4);
  }
}

.mjx-chtml {
  font-size: inherit !important;
}

iframe {
  border: 0;
}
