:root {
  --color-hue: 210;
  --color-saturation: 6%;

  --bg-dark: hsl(var(--color-hue), var(--color-saturation), 5%);
  --bg: hsl(var(--color-hue), var(--color-saturation), 10%);
  --bg-light: hsl(var(--color-hue), var(--color-saturation), 20%);
  --bg-code: hsl(var(--color-hue), var(--color-saturation), 20%);

  --text: hsl(0 0% 95%);
  --text-muted: hsl(0 0% 70%);

  --border: hsl(var(--color-hue), var(--color-saturation), 30%);
  --gradient: linear-gradient(0deg, var(--bg) 95%, var(--bg-light));
  --gradient-hover: linear-gradient(0deg, var(--bg), var(--bg-light));
  --highlight: hsl(var(--color-hue), var(--color-saturation), 50%);
  --border-card: 1px solid var(--border);
  
  --primary-color: rgb(4, 87, 102);
  --primary-color--hover: rgba(4, 87, 102, 0.9);
  --primary-color--active: rgba(4, 87, 102, 0.6);
  --primary-white: rgb(240, 240, 240);

  --nav--height: 48px;
}
body.light {
  --bg-dark: hsl(var(--color-hue), var(--color-saturation), 90%);
  /* --bg-dark: hsl(0, 0%, 90%); */
  --bg: hsl(var(--color-hue), var(--color-saturation), 95%);
  --bg-light: hsl(var(--color-hue), var(--color-saturation), 100%);
  --bg-code: hsl(var(--color-hue), var(--color-saturation), 75%);

  --text: hsl(0 0% 5%);
  --text-muted: hsl(0 0% 30%);

  --border: hsl(var(--color-hue), var(--color-saturation), 30%);
  --gradient: linear-gradient(0deg, var(--bg) 95%, var(--bg-light));
  --gradient-hover: linear-gradient(0deg, var(--bg), var(--bg-light));
  --highlight: hsl(var(--color-hue), var(--color-saturation), 100%);
  --border-card: 1px solid var(--bg);
  --shadow: 0px 2px 2px hsla(0, 0%, 0%, 0.07), 
            0px 4px 4px hsla(0, 0%, 0%, 0.15);
}

:target {
  scroll-margin-top: calc(var(--nav--height) + 1rem);
}

body {
  /* scroll bar is then black, idk why it doesn't work inside .body-container */
  background: var(--bg-dark);
  color: var(--text);
}

.body-container {
  /* padding: 16px; */
  /* padding-left: 16px; */
  margin-inline: auto;
  display: flex;
  justify-content: center;
  width: min(80ch, 100% - 4rem);
}

h1 {
  margin-top: 32px;
}
h2 {
  margin-top: 48px;
}
/* h2:first-child {
  margin-top: 0;
} */

h3 {
  margin-top: 32px;
}

h3:first-of-type,
h4 {
  margin-top: 16px;
}
/* h3:first-child {
  margin-top: 0;
} */

p, blockquote {
  text-align: justify;
  margin-top: 16px;
}
p {
  color: var(--text-muted);
}
body.light p {
  color: var(--text);
}
blockquote {
  margin-left: 16px;
  border-left: 4px solid var(--bg-code);
  padding-left: 8px;
}

.blog-content {
  margin-top: 0;
}

pre > code {
  white-space: pre;
  width: fit-content;
  margin: 1rem 0 1rem 0;
  display: block;
  padding: 4px;
}
pre {
  overflow-x: auto;
}

code {
  background-color: var(--bg-code);
  color: var(--text);
  font-size: 0.875rem;
}

img {
  margin-top: 16px;
}

aside {
  width: fit-content;
}
details {
  background-color: hsla(200, 80%, 35%, 0.5);
  padding: 8px;
  margin-top: 16px;
}

a:link {
  color: hsla(200, 80%, 60%, 0.9);
}
a:visited {
  color: hsla(220, 80%, 60%, 0.4);
}

li + p {
  margin-top: 0;
}

.site {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  grid-template-columns: minmax(0, 1fr);
}

.toplink {
  position: fixed;
  bottom: 32px;
  right: 32px;
  background-color: hsla(0, 0%, 60%, 0.4);
  padding: 4px;
}

.primary-navigation {
  background-color: var(--bg-light);
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
}
.navbar__button-default {
  height: var(--nav--height);
  width: var(--nav--height);
  background-color: var(--bg-light);
  color: var(--text);
  border: none;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
}
.navbar__button-default:hover {
  background-color: var(--bg);
}
.navbar__button-default:focus-visible {
  outline: 2px solid pink;
}
.dark-mode-toggler {
  display: flex;
  align-items: center;
  justify-content: center;
}
.dark-mode-toggler svg:last-child {
  display: none;
}
body.light .dark-mode-toggler svg:first-child {
  display: none;
}
body.light .dark-mode-toggler svg:last-child {
  display: block;
}
svg {
  fill: var(--text);
  pointer-events: none;
}

.blog-title {
  color: inherit;
}

section {
  counter-reset: h3;
}
.numbered-h3::before {
  content: counter(h3) ". ";
  counter-increment: h3;
}

.text-highlight {
  color: rgb(164, 104, 30);
}

img {
  display: block;
  width: min(auto, 800px);
  object-position: center;
  object-fit: cover;
}
.blur-load {
  width: 100%;
  background-size: cover;
  background-position: center;
}

input {
  width: 5rem;
  margin-top: 0.25rem;
}

.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip .tooltiptext {
  visibility: hidden;
  width: 9rem;
  background-color: #555;
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 5px;
  position: absolute;
  z-index: 1;
  bottom: 120%;
  left: 50%;
  margin-left: -75px;
  opacity: 0;
  transition: opacity 0.3s;
}

.tooltip .tooltiptext::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: #555 transparent transparent transparent;
}

.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}

.frac {
  display: inline-block;
  position: relative;
  vertical-align: middle;
  letter-spacing: 0.001em;
  text-align: center;
}
.frac > span {
  display: block;
  padding: 0.1em;
}
.frac span.bottom {
  border-top: thin solid var(--text);
}
.frac span.symbol {
  display: none;
}

.extra-field {
  padding: 8px;
  background-color: var(--bg-light);
  margin-top: 1rem;
}
.extra-field p {
  margin-top: 8px;
}

footer {
  /* grid-area: footer; */
  background-color: var(--bg);
  color: var(--text-muted);
  /* height: auto; */
  /* display: flex;
  align-items: center; */
  margin-top: 1rem;
  padding: 8px;
}