html,
body {
  padding: 0;
  margin: 0;

  width: 100%;
  min-height: 100%;
}

* {
  box-sizing: border-box;
}

h1,
h2,
h3,
p {
  margin: 0;
}

/* ----- common ----------------- */

a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
sup > a {
  text-decoration: none;
}

b {
  font-weight: 600;
}

.tooltip {
  position: relative;

  border-bottom: 1px dashed var(--text-color);
}

.tooltip::after {
  content: attr(data-tooltip);

  position: absolute;
  width: 120px;

  background-color: var(--text-color);
  color: var(--bg-color);

  text-align: center;

  padding: 2px;
  bottom: 0;
  left: 50%;

  opacity: 0;
  transition: opacity 200ms;

  transform: translateX(-50%) translateY(-18px);

  z-index: 1;
}

.tooltip:hover::after {
  opacity: 1;
}

/* ----- specific --------------- */

body {
  --text-color: rgb(0, 0, 0);
  --bg-color: rgb(255, 255, 255);
  --bg-dot-color: rgb(200, 200, 200);
  --sep-color: rgb(220, 220, 220);

  font-family: "Inconsolata";
  line-height: 1.5;
  color: var(--text-color);

  background-image: radial-gradient(var(--bg-dot-color) 1px, transparent 1px);
  background-size: 13px 13px;
  background-color: var(--bg-color);

  display: flex;
}

body.dark-theme {
  --text-color: rgb(255, 255, 255);
  --bg-dot-color: rgb(80, 80, 80);
  --bg-color: rgb(20, 20, 20);
  --sep-color: rgb(80, 80, 80);
}

main {
  position: relative;

  min-height: 100%;
  max-width: 850px;

  margin: 0 auto;

  border-width: 0 1px;
  border-style: solid;
  border-color: var(--sep-color);

  padding-bottom: 96px;
}

main > :is(h1, h2, h3) {
  padding: 24px;

  border-bottom: 1px solid var(--sep-color);
}
main > :is(h1, h2, h3):not(:last-child) {
  margin-bottom: 24px;
}

main > p {
  padding: 8px 32px;
}

main > div.columns {
  width: 100%;

  display: flex;
  justify-content: space-between;
}
main > div.columns > div {
  flex: 1;
  margin: 0 10px;
}
main > div.columns > div:not(:last-child) {
  border-right: 1px solid var(--sep-color);
}

main > :is(ul, ol) {
  padding-left: 64px;
  padding-right: 48px;
}
main :is(ul, ol) > li {
  padding: 4px;
}

main > #theme-switcher {
  position: absolute;
  top: 0;
  right: 0;
  padding: 2px 8px;
  cursor: pointer;
}

[data-ref]:target {
  border-radius: 2px;
  color: var(--bg-color);
  background-color: var(--text-color);
}
