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

body {
  -webkit-font-smoothing: antialiased;
}

svg,
canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
}

ul,
ol {
  list-style: none;
}

a {
  color: currentColor;
}

:root {
  --font-size-5xl: 3.815rem;
  --font-size-4xl: 3.052rem;
  --font-size-3xl: 2.441rem;
  --font-size-2xl: 1.953rem;
  --font-size-xl: 1.563rem;
  --font-size-lg: 1.25rem;
  --font-size-md: 1rem;
  --font-size-sm: 0.8rem;

  --font-family: "Cabin", sans-serif;

  --font-weight-body: 400;
  --font-weight-title: 700;

  --line-height-title: 1.1;
  --line-height-body: 1.4;

  --color-white: #fff;
  --color-black: #000;
  --color-gray-50: #fafafa;
  --color-gray-100: #f5f5f5;
  --color-gray-200: #eeeeee;
  --color-gray-300: #e0e0e0;
  --color-gray-400: #bdbdbd;
  --color-gray-500: #9e9e9e;
  --color-gray-600: #757575;
  --color-gray-700: #616161;
  --color-gray-800: #424242;
  --color-gray-900: #212121;

  --color-bg: var(--color-white);
  --color-text-emphasis: var(--color-gray-900);
  --color-text: var(--color-gray-800);
  --color-text-muted: var(--color-gray-700);

  --color-cooling: #0868ac;
  --color-heating: #b30000;
  --color-land: var(--color-gray-200);
  --color-nation-border: var(--color-white);
  --color-local-border-active: var(--color-gray-900);
  --color-stroke: var(--color-gray-400);
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-body);
  line-height: var(--line-height-body);
  color: var(--color-text);
  background-color: var(--color-bg);
}

h1,
h2 {
  font-weight: var(--font-weight-title);
  line-height: var(--line-height-title);
  text-wrap: pretty;
  color: var(--color-text-emphasis);
}

h1 {
  font-size: var(--font-size-3xl);
}

h2 {
  font-size: var(--font-size-2xl);
}

p {
  text-wrap: pretty;
}

.chart-title {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-title);
  line-height: var(--line-height-body);
  color: var(--color-text-emphasis);
}

.chart-subtitle {
  font-size: var(--font-size-md);
}

text {
  font-size: var(--font-size-sm);
  fill: currentColor;
}

.cooling {
  --color-theme: var(--color-cooling);
}

.heating {
  --color-theme: var(--color-heating);
}

.themed-text {
  color: var(--color-theme);
}

.footer {
  color: var(--color-text-muted);
}

main {
  margin-block: 4rem;
}

article > * {
  --col-width: 640px;
  --col-gap: 48px;
  --max-width: var(--col-width);
  width: min(100% - 2rem, var(--max-width));
  margin-inline: auto;
}

.bleed {
  --max-width: calc(var(--col-width) * 2 + var(--col-gap));
}

article > * + * {
  margin-block-start: var(--col-gap);
}

.figures {
  display: flex;
  gap: var(--col-gap);
  flex-wrap: wrap;
  justify-content: center;
}

.figure {
  flex-basis: var(--col-width);
}

.figure > * + * {
  margin-block-start: calc(var(--col-gap) / 3);
}

.legend-container {
  max-width: 400px;
}

.legend-labels {
  display: flex;
  justify-content: space-between;
}

.swatches {
  display: flex;
}

.swatch {
  flex: 1;
  height: 20px;
  background-color: var(--color-swatch);
}

.choropleth-container {
  position: relative;
}

.choropleth {
  display: grid;
}

.choropleth > * {
  grid-area: 1 / -1;
  width: 100%;
  height: auto;
}

.region-outline {
  fill: none;
  stroke: var(--color-local-border-active);
  stroke-linecap: round;
  stroke-linejoin: round;
}

.axis line {
  stroke: var(--color-stroke);
}

.series-path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5px;
}

.series-circle {
  stroke: currentColor;
  stroke-width: 1.5px;
}

.indicator-line {
  stroke: currentColor;
  stroke-width: 1.5px;
  stroke-dasharray: 6 4;
}

.indicator-text {
  font-weight: var(--font-weight-title);
}

.tooltip {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  background-color: var(--color-bg);
  background-color: color-mix(in srgb, var(--color-bg) 90%, transparent);
  border: 1px solid var(--color-stroke);
  padding: 8px 12px;
  border-radius: 4px;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.1s,
    visibility 0.1s;
}

.tooltip.is-visible {
  opacity: 1;
  visibility: visible;
}
