:root {
  --font-medium: 600 1.4rem/1.2 var(--sans-serif);
  --font-big: 600 1.8rem/1.2 var(--sans-serif);
  --theme-green: #2ca02c;
  --theme-purple: #6f42c1;
  --base-font-size: calc(15/16 * 1rem);
  --small-screen-width: 480px;
  --medium-screen-width: 720px;
}

.medium {
  font: var(--font-medium);
}

#observablehq-center {
  margin: 1.5rem;
}
#observablehq-toc div {
  margin-bottom: .75rem;
}
.observablehq-secondary-link a {
  padding: .4rem 0;
}

body {
  font-family: var(--sans-serif);
  font-size: var(--base-font-size);
  padding-bottom: 15rem;
}

header {
  margin: 2rem 0 3rem;
}
header h1 {
  font-size: 2.5rem;
  line-height: 1.1;
  margin: 0 0 .5em;
  text-wrap: balance;
  letter-spacing: -0.02em;
}
header h2 {
  font-style: initial;
  font-size: 1.2rem;
  line-height: 1.5;
  margin: 0 0 1.5em;
}
header h3 {
  font-size: var(--base-font-size);
  text-transform: none;
  letter-spacing: 0;
  margin: 0;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  margin: 2.5em 0 1.5em;
}
h2 {
  margin-top: 3.5em;
}
h3 {
  font-weight: 500;
  font-size: .875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--theme-foreground-muted);
  margin: 3.5em 0 2em;
}
h4 {
  font-size: 1.25rem;
}

a[href] {
  font-weight: 600;
  text-decoration: underline;
  color: var(--theme-blue);
}
h1 a[href],
h2 a[href],
h3 a[href],
h4 a[href] {
  font-weight: inherit;
  text-decoration: none;
}

table {
  margin: 2em 0;
}

.list-none {
  list-style: none;
  padding: 1em 0 0;
  margin: 0;
}
.list-none li {
  padding: .1em 0;
}

.grid.cells {
  gap: 1px;
  border: 1px solid var(--theme-foreground-fainter);
  background: var(--theme-foreground-fainter);
  margin: 3em 0;
}
.grid.cells.green-border {
  border: 1px solid var(--theme-green);
  background: var(--theme-green);
}
h3 + .grid.cells {
  margin-top: 1em;
}
.grid.cells > div {
  display: flex;
  flex-direction: column;
  flex-flow: column-reverse;
  align-items: start;
  justify-content: end;
  padding: 1.25rem 1.5rem;
  background: white;
}
.grid.cells.normal-flow > div {
  flex-flow: column;
  justify-content: start;
}
.grid h3 {
  font-size: var(--base-font-size);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.3;
  margin: 0;
  color: var(--theme-foreground-muted);
}
.grid h3:only-child {
  color: var(--theme-foreground);
}
.grid h3 strong {
  font-weight: 500;
  color: var(--theme-foreground);
}
.grid h3 + p {
  font: var(--font-medium);
  padding-bottom: .5rem;
}
.grid small {
  font-size: 1.25rem
}

.callout {
  display:flex;
  flex-direction: column;
  row-gap: .6rem;
  padding: 1.5rem 1.75rem;
  border: 1px dotted var(--theme-blue);
  max-width: fit-content;
  margin: 3em 0;
  background-color: aliceblue;
}
.callout h1 {
  margin: 0 0 .75em;
}
.callout p {
  margin: 0;
}

.grid > div.green h3,
.grid > div.green h3 strong {
  color: var(--theme-green);
}
.grid > div.blue h3,
.grid > div.blue h3 strong {
  color: var(--theme-blue);
}

.chart {
  margin: 2em 0;
}
.chart.controlled {
  display: flex;
  flex-direction: column;
  row-gap: 1.5em;
}
.chart select {
  appearance: none;
  display: block;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.5rem;
  border-color: var(--theme-foreground-fainter);
  border-width: 1px;
  border-radius: 0px;
  padding: 1rem 4rem 1rem 1rem;
  margin: 0;
  color: var(--theme-foreground);
  background: var(--theme-background);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5rem 1.5rem;
  -webkit-print-color-adjust: exact;
  -moz-osx-font-smoothing: grayscale;
}

#mrrTreemap {
  width: 100vw;
  height: auto;
  margin: 0 -1.5rem;
}

.green h3,
.green strong {
  color: var(--theme-green) !important;
}
.green-bg {
  color: white !important;
  background: var(--theme-green) !important;
}
.green-bg h3 {
  color: hsla(0deg, 0%, 100%, 0.8)
}
.green-bg h3 strong {
  color: var(--theme-background);
}
.purple {
  color: var(--theme-purple) !important;
}
.purple h3,
.purple strong {
  color: var(--theme-purple) !important;
}
.purple-bg {
  color: white !important;
  background: var(--theme-purple) !important;
}
.purple-bg h3 {
  color: hsla(0deg, 0%, 100%, 0.8)
}
.purple-bg h3 strong {
  color: var(--theme-background);
}

/* 
div:target {
  position: relative;
}
div:target:after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  pointer-events: none;
  animation: fadeBorder 3s forwards;
}
@keyframes fadeBorder {
  0% {
    border: 4px solid var(--theme-blue);
  }
  100% {
    border: 4px solid transparent;
  }
}
*/

h2:target,
span:target {
  animation: fadeHeading 3s forwards;
}
@keyframes fadeHeading {
  from {
    color: var(--theme-blue);
  }
  to {
    color: initial;
  }
}


@media (min-width: 480px) {
  #observablehq-center {
    margin: 1rem 2rem;
  }
  header h1 {
    font-size: 4rem;
    line-height: 1.05;
  }
  #mrrTreemap {
    width: 100%;
    max-width: 100%;
    margin: 0;
  }
  .phrase {
    white-space: nowrap;
  }
}
@media (min-width: 720px) {
  header h1 {
    font-size: 5rem;
    line-height: 1.05;
  }
}