:root {
  --measure: 72ch;
  --border-thin: 1px;
  --ratio: 1.4;
  --s-5: calc(var(--s-4) / var(--ratio));
  --s-4: calc(var(--s-3) / var(--ratio));
  --s-3: calc(var(--s-2) / var(--ratio));
  --s-2: calc(var(--s-1) / var(--ratio));
  --s-1: calc(var(--s0) / var(--ratio));
  --s0: 1rem;
  --s1: calc(var(--s0) * var(--ratio));
  --s2: calc(var(--s1) * var(--ratio));
  --s3: calc(var(--s2) * var(--ratio));
  --s4: calc(var(--s3) * var(--ratio));
  --s5: calc(var(--s4) * var(--ratio));

  --font-small: 90%;

  --font-code: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, 'DejaVu Sans Mono', monospace;
  --font-body: system-ui, sans-serif;
  --font-title: system-ui, sans-serif;

  --clr-bg: #10141f;
  --clr-text: #deceed;
  --clr-action: #B2D88F;
  --clr-secondary: #b0a7b8;
  --clr-inactive: #a6cb96;
  --clr-focus: #5dd2e4;
  --clr-outline: #4e4b5c;
}

body {
  background-color: var(--clr-bg);
  color: var(--clr-text);
  font-size: clamp(1rem, 0.6875rem + 1vw, 1.25rem);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
}

footer {
  text-align: center;
}

footer img {
  max-width: 32ch;
}

h1,
h2,
h3,
h4 {
  text-wrap: balance;
  font-family: var(--font-title);
}
h1,
h2 {
  font-weight: 900;
  font-size: var(--s1);
}
h3 {
  font-weight: 700;
  font-size: var(--s2);
}
h4 {
  font-weight: 500;
  font-size: var(--s3);
}
h1 {
  font-size: var(--s4);
}
h2 {
  font-size: var(--s3);
}
h3 {
  font-size: var(--s2);
}
h4 {
  font-size: var(--s1);
}
strong {
  font-weight: 700;
}

article h1, h2, h3, h4 {
  margin-top: var(--s3);
  margin-bottom: var(--s2);
}

.news-article h1 {
  margin-bottom: var(--s4);
}

.page {
  margin-inline: auto;
  max-width: var(--measure);
}

.invert {
  -webkit-filter: invert(100%);
  filter: invert(100%);
}

a {
  color: var(--clr-action);
  text-underline-offset: 18%;
  text-decoration-thickness: 1px;
}
a:visited {
  color: var(--clr-inactive);
}
a:hover {
  color: var(--clr-focus);
}

blockquote {
  margin-top: var(--s1);
  padding-inline: var(--s2);
  font-weight: 500;
  font-style: italic;
  border-left: 4px solid var(--clr-outline);
}

#page-navbar a {
  text-decoration: none;
}

sup a {
  text-decoration: none;
}
ol.footnotes a.backlink {
  text-decoration: none;
}
main {
}

article {
  margin-block: var(--s2);
}

.page {
  padding-inline: 1em;
}

p {
  margin-bottom: var(--s2);
}

section {
  display: block;
  margin-block: var(--s2);
}

section p {
  margin-inline: var(--s1);
}

.center {
  display: block;
  box-sizing: content-box;
  margin-inline: auto;
  max-inline-size: var(--measure);
}

footer {
  padding-block: var(--s1);
  border-top: 1px solid var(--clr-outline);
}

footer ul {
  list-style: none;

  & li {
    width: 100%;
    min-width: 16ch;
  }
}

footer a {
  font-weight: 400;
  text-decoration: none;
}

footer hr {
  margin-top: var(--s2);
  border: 0;
  height: 1px;
  background-image: linear-gradient(to right, rgba(0, 0, 0, 0), var(--clr-outline), rgba(0, 0, 0, 0));
}

#foot-line {
  padding: var(--s1);
}

.box {
  display: block;
  padding: var(--s1);
  border: var(--border-thin) solid var(--clr-outline);
  border-radius: var(--s-4);
  outline: var(--border-thin) solid transparent;
  outline-offset: calc(var(--border-thin) * -1);
}
.padded {
  display: block;
  padding: var(--s1);
}
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-justify { text-align: justify; }

.author {
  margin-top: var(--s0);
  font-size: var(--font-small);
}

.theme-toggle {
    position: absolute;
    top: 0;
    right: 0;
    padding: var(--s-1);
}

[data-theme-toggle] {
    padding: var(--s-1);
    line-height: 1;
  text-align: justify;
    border: none;
    background: none;
    user-select: none;

    svg > path {
        fill: var(--clr-inactive);
        stroke: var(--clr-inactive);
    }
}

.theme-toggle:hover [data-theme-toggle] {
  cursor: pointer;
}

.theme-toggle:hover [data-theme-toggle] svg > path {
    cursor: pointer;
    fill: var(--clr-focus);
    stroke: var(--clr-focus);
}

[data-theme-toggle] svg {
    width: var(--s1);
    height: var(--s1);
}

q {
    font-style: italic;
}

pre,
code {
  font-size: var(--font-small);
  font-family: var(--font-code);
  overflow-x: auto;
}

.license {
  overflow-x: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-size: 14px;
  margin-block: var(--s2);
}

.bg {
    border: 2px solid var(--color-bg-dim);
    border-radius: 12px;
    background-color: var(--color-bg-dim);
}

@media (prefers-reduced-motion: no-preference) {
    html:focus-within {
        scroll-behavior: smooth;
    }
}

#frontpage p {
  text-align: center;
}

#frontpage h1 {
  font-size: min(22vw, 200px);
  text-align: center;
}

#frontpage h2 {
  font-size: min(4vw, var(--s2));
  font-weight: normal;
  text-align: center;
}


#frontpage blockquote {
  text-align: center;
  border-left: none;
}

#frontpage #tldr {
  margin-block: var(--s4);
  color: var(--clr-secondary);
  text-align: justify;
}

header {
  margin-block: var(--s1);
}

#nav-back {
  text-decoration: none;
  font-weight: 900;
}

article .preamble {
  width: 100%;
  text-align: left;
  color: var(--clr-secondary);
}

article .preamble time {
  font-style: italic;
}

article p {
  margin-block: var(--s1);
}

.posts {
  margin-inline: var(--s1);
  line-height: 2;
}

.posts-date {
  padding-left: 1ch;
  color: var(--clr-secondary);
}

.breadcrumbs {
  font-weight: 900;
}

.breadcrumbs a {
  text-decoration: none;
}

.breadcrumbs a::after {
  content: " / ";
  color: var(--clr-outline);
}
