h1 {
  display: flex;
  align-items: center;
  font-size: 2.618rem;
  margin-block-start: 0;
  margin-block-end: 1.5em;
}

h2 {
  color: var(--color-red);
  font-family: Georgia, "Times New Roman", Times, serif;
  font-style: italic;
  font-size: clamp(2rem, 10vw, 4.235rem);
  margin: 1.5em 0;
  line-height: 1;
}

h3 {
  font-size: 1.618rem;
  margin: 1em 0;
}

h1,
h2,
h3 {
  position: relative;
}

h1::after,
h2::after {
  content: "";
  color: var(--color-red);
  position: absolute;
  top: 100%;
  display: block;
  border-bottom: solid 0.125em;
  width: 2ch;
}

hr {
  border: 0;
  height: 2px;
  width: 1em;
  box-shadow: -1em 0 0 0 var(--color-yellow);
  margin: 3em 0;
}

nav {
  position: sticky;
  background: var(--bg);
  top: -1px;
  z-index: 1;
  text-align: center;
  padding: 0.5em 1em;
  margin: 0 -1em;
}

em {
  color: var(--color-yellow);
}

time {
  color: var(--color-yellow);
}

header {
  display: flex;
  flex-direction: column;
  margin-block-start: 1.5em;
}

header > time {
  order: -1;
}

/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 * Components
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */

/**/
.article-preview {
  display: flex;
  flex-direction: column;
}

.article-preview h3 {
  margin-block-start: 0;
}

.article-preview time {
  order: -1;
  line-height: var(--counter-size);
}

/**/
.icon {
  height: 1.25em;
  vertical-align: middle;
  width: 1.25em;
}

/**/
.footnotes {
  color: var(--color-dark-grey);
  font-size: 0.875rem;
}

.footnotes-list {
  padding-inline-start: 0;
}

.footnote-backref {
  font-size: 0.625rem;
}

.footnotes-item {
  margin-block: 1em;
}

/**/
.title > i {
  color: var(--color-yellow);
  font-size: 0.5em;
  margin-inline-start: 1em;
}

.title hr {
  margin: 0;
}

/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 * Projects
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */

body.project {
  & h1 {
    margin-block-end: 0;
  }

  & header > p {
    color: var(--color-grey);
    font-style: italic;
  }

  & :where(img, video) {
    border-radius: 0.5rem;
    overflow: hidden;
  }
}

/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 * Shiki
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */

.shiki {
  display: flex;
}

.shiki > [class^="language-"] {
  flex: 1;
  padding: 0;
}

.line {
  display: inline-block;
  position: relative;
  width: 100%;
}

.line:is(.diff, .highlighted)::before {
  background-color: var(--line-color);
  content: "";
  display: block;
  inset: 0;
  opacity: 0.1;
  margin-inline: -1rem;
  width: calc(100% + 2rem);
  pointer-events: none;
  position: absolute;
}

.line.diff:is(.add, .remove)::after {
  color: var(--line-color);
  content: var(--line-content);
  left: -1rem;
  position: absolute;
  text-align: center;
  width: 1rem;
}

.line.add {
  --line-color: var(--color-green);
  --line-content: "+";
}

.line.remove {
  --line-color: var(--color-red);
  --line-content: "-";
}

.line.highlighted {
  --line-color: var(--color-light-grey);
}
