*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
}

body {
  background: #fff;
  color: #101010;
  counter-reset: figure;
  font-display: swap;
  font-family: 'Open Sans','Helvetica Neue','Helvetica',sans-serif;
  font-weight: 400;
}

header {
  display: block;
  padding: 1rem;
}

article {
  display: block;
  margin: 0 auto;
  max-width: 50rem;
  padding: 0 0.5rem;
}

footer {
  background: #e0e0e0;
  margin-top: 2rem;
  padding: 2rem 0;
}

footer > p {
  color: #424242;
  margin: 0 auto;
  max-width: 50rem;
  padding: 0 0.5rem;
}

footer > p a,
footer > p a:active,
footer > p a:hover,
footer > p a:visited {
  color: #212121;
}

a,
a:active {
  color: #e53935;
}

a:visited {
  color: #b71c1c;
}

p {
  line-height: 1.5rem;
  margin: 1rem 0;
  max-width: 36rem;
}

p.math {
  font-size: 1.5em;
  text-align: center;
}

h1, h2 {
  color: #212121;
  font-family: 'Crimson Text','Times New Roman',serif;
  font-weight: 400;
  line-height: 1.2em;
}

h1 {
  font-size: 2.5rem;
  margin-top: 6rem;
}

h2 {
  color: #212121;
  font-size: 2rem;
  font-style: italic;
  margin-top: 4rem;
}

.pubdate {
	display: block;
  font-family: 'Crimson Text','Times New Roman',serif;
	font-size: 0.8em;
	letter-spacing: 0.05em;
	margin-top: 1rem;
	text-transform: uppercase;
}

sub, sup {
  line-height: 1em;
}

figure {
  position: relative;
  width: 100%;
}

figure svg {
  height: auto;
  width: 100%;
}

figure svg.quarter {
  height: auto;
  width: 25%;
}

figure > .input {
  color: #424242;
  display: none;
  font-size: 0.9em;
  margin-bottom: 0.5rem;
}

figure > .input.hidden {
  display: none !important;
}

body.scriptable figure > .input {
  display: block;
}

figure > .input::after {
  content: '';
  clear: both;
  display: table;
}

figure > .input > .title {
  line-height: 1.2em;
}

figure > .input > .left {
  float: left;
  font-size: 0.9em;
}

figure > .input > .right {
  float: right;
  font-size: 0.9em;
  text-align: right;
}

figcaption {
  font-size: 0.9rem;
  line-height: 1.2em;
  max-width: 10rem;
  padding-top: 1rem;
  position: absolute;
  right: 0;
  top: 100%;
}

figcaption::before {
  counter-increment: figure;
  content: "Figure " counter(figure) ". ";
  display: inline;
  font-style: italic;
}

input[type=range] {
  -webkit-appearance: none;
  display: block;
  width: 100%;
}
input[type=range]:focus {
  outline: none;
}
input[type=range]::-webkit-slider-runnable-track {
  background: #eeeeee;
  border: none;
  border-radius: 0.5rem;
  box-shadow: inset 0 0.05em 0.2em rgba(0,0,0,0.1);
  cursor: pointer;
  height: 1rem;
  width: 100%;
}
input[type=range]::-moz-range-track {
  background: #eeeeee;
  box-shadow: inset 0 0.05em 0.2em rgba(0,0,0,0.1);
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  height: 1rem;
  width: 100%;
}
input[type=range]::-ms-track {
  background: transparent;
  border: none;
  color: transparent;
  cursor: pointer;
  height: 1rem;
  width: 100%;
}
input[type=range]::-ms-fill-lower {
  background: #eeeeee;
  border: none;
  border-radius: 0.5rem;
  box-shadow: none;
}
input[type=range]::-ms-fill-upper {
  background: #eeeeee;
  border: none;
  border-radius: 0.5rem;
  box-shadow: none;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  background: #ef5350;
  border: none;
  border-radius: 0.5rem;
  box-shadow: 0 0.05em 0.2em rgba(0,0,0,0.1);
  cursor: pointer;
  height: 1rem;
  margin-top: 0px;
  width: 1rem;
}
input[type=range]::-moz-range-thumb {
  background: #ef5350;
  border: none;
  border-radius: 0.5rem;
  box-shadow: 0 0.05em 0.2em rgba(0,0,0,0.1);
  cursor: pointer;
  height: 1rem;
  margin-top: 0px;
  width: 1rem;
}
input[type=range]::-ms-thumb {
  background: #ef5350;
  border: none;
  border-radius: 0.5rem;
  box-shadow: 0 0.05em 0.2em rgba(0,0,0,0.1);
  cursor: pointer;
  height: 1rem;
  margin-top: 0px;
  width: 1rem;
}
input[type=range]:focus::-webkit-slider-runnable-track,
input[type=range]:hover::-webkit-slider-runnable-track {
  background: #e0e0e0;
}
input[type=range]:focus::-moz-range-track,
input[type=range]:hover::-moz-range-track {
  background: #e0e0e0;
}
input[type=range]:focus::-ms-fill-lower,
input[type=range]:focus::-ms-fill-upper,
input[type=range]:hover::-ms-fill-lower,
input[type=range]:hover::-ms-fill-upper {
  background: #e0e0e0;
}
input[type=range]:focus::-webkit-slider-thumb,
input[type=range]:hover::-webkit-slider-thumb {
  background: #f44336;
}
input[type=range]:focus::-moz-range-thumb,
input[type=range]:hover::-moz-range-thumb {
  background: #f44336;
}
input[type=range]:focus::-ms-thumb,
input[type=range]:hover::-ms-thumb {
  background: #f44336;
}

.math {
  font-family: 'Crimson Text',serif;
  font-size: 1.2em;
  line-height: 1em;
}

.variable {
  font-style: italic;
}

.equation > .term {
  display: inline-block;
  margin: 0 0.25em;
  vertical-align: middle;
}

.division > .numerator {
  display: block;
  border-bottom: 1px solid #101010;
  padding: 0 0.5em;
}

.division .operator,
.division .paren {
  display: none;
}

.division > .denominator {
  display: block;
  padding: 0 0.5em;
}

.coordinate {
  font-family: 'Crimson Text',serif;
  font-size: 1.2em;
  white-space: nowrap;
}

@media (max-width: 50rem) {
  figure {
    padding-right: 11rem;
  }
  figcaption {
    padding-top: 0;
    top: 0;
  }
}

@media (max-width: 35rem) {
  h1 {
    font-size: 2.25rem;
  }
  h2 {
    font-size: 1.75rem;
  }
  figure {
    padding-right: 0;
  }
  figcaption {
    position: static;
    max-width: 100%;
  }
}

@media print {
  figure > .input {
    display: none !important;
  }
}
