:root {
  --bg-primary: #2B303B;
  --bg-secondary: #343D46;
  --bg-tertiary: #4F5B66;
  --fg-primary: #A7ADBA;
  --fg-secondary: #C0C5CE;
  --fg-highlight-1: #96B5B4;
  --fg-highlight-2: #8FA1B3;
  --fg-highlight-3: #B48EAD;
}

:root, html {
  background-color: var(--bg-primary);
  color: var(--fg-primary);
  font-family: Liberation Sans, Arial, sans-serif;
  box-sizing: border-box;
}

* {
  background-color: inherit;
  max-width: 100%;
}

*, *:before, *:after {
  box-sizing: inherit;
}

*:last-child {
  margin-bottom: 0;
}

*:first-child {
  margin-top: 0;
}

body {
  line-height: 1.3;
}

body, main, section {
  padding: 0;
  margin: 0;
}

body {
  top: 0;
  left: 0;
  min-height: 100vh;
}

.no-margins {
  margin: 0;
}

.content {
  max-width: 70ch;
  padding: 2ch;
  margin: auto;
}

.alternative-background {
  background-color: var(--bg-secondary);
  color: var(--fg-secondary);
}

.text-small {
  font-size: .8em;
}

a {
  color: var(--fg-highlight-1);
  text-decoration: dotted underline;
}

h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a.plain {
  text-decoration: none;
}

a:hover, a:visited:not([href="/"]) {
  color: var(--fg-highlight-2);
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 0.5em 0;
}

*[id] > a[href^="#"]:only-child {
  text-decoration: none !important;
  color: inherit !important;
}

*[id] > a[href^="#"]:only-child:hover {
  overflow: visible;
}

*[id] > a[href^="#"]:only-child:hover::before {
  content: '🔗';
  font-size: .8em;
  padding: 0 .5em;
  width: 1em;
  overflow: visible;
  margin-left: -2em;
  margin-top: .2em;
  position: absolute;
}

ol, ul {
  padding-left: 24px;
}

article > header, article > div, article > footer {
  margin: 0 0 2em 0;
}

p, h1, h2, h3, h4, h5, h6, time {
  overflow: hidden;
  text-overflow: ellipsis;
}

pre {
  font-family: monospace;
  background-color: var(--bg-secondary);
  padding: 1em;
}

code {
  font-family: monospace;
  background-color: var(--bg-secondary);
  padding: .02em .4em;
  border-radius: .4em;
  font-size: .9em;
  white-space: nowrap;
}

kbd {
  display: inline-block;
  padding: .1em .3em .2em;
  font-family: monospace;
  line-height: normal;
  line-height: .8em;
  font-size: .8em;
  vertical-align: middle;
  color: var(--fg-secondary);
  background-color: var(--bg-secondary);
  border: solid 1px var(--fg-primary);
  border-bottom-color: var(--fg-primary);
  border-radius: 6px;
  box-shadow: inset 0 -.1em 0 var(--fg-primary);
}

a:hover > kbd {
  box-shadow: none;
  padding: .1em .3em .1em;
  margin: .1em 0 0 0;
}

blockquote {
  margin-left: 0;
  padding-left: 6px;
  border-left: solid 2px var(--bg-tertiary);
  color: var(--fg-primary);
}
blockquote::before {
  content: '“';
}
blockquote::after {
  content: '”';
}

.row {
  display: flex;
  flex-direction: row;
  column-gap: 8px;
}

.column {
  display: flex;
  flex-direction: column;
  row-gap: 8px;
}

.items-center {
  display: flex;
  align-items: center;
}

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

.space-around {
  display: flex;
  justify-content: space-around;
}

.flex-end {
  display: flex;
  justify-content: flex-end;
}

.wrap {
  flex-wrap: wrap;
}

.flex-1 {
  flex: 1;
}

.flex-2 {
  flex: 2;
}

.card {
  list-style: none;
  display: flex;
  flex-direction: column;
  border-radius: 5px;
  border: 1px solid var(--bg-secondary);
  padding: 8px;
  overflow: hidden;
}
.alternative-background .card {
  border: 1px solid var(--bg-tertiary);
}
.card.highlight {
  border-color: var(--fg-highlight-1);
}

.card-annotation {
  background-color: var(--bg-secondary);
  font-family: monospace;
  font-size: .7em;
  padding: 2px 8px;
  margin: -8px -8px 0 -8px;
  text-transform: uppercase;
  user-select: none;
  color: var(--fg-primary);
  max-width: none;
  display: flex;
  flex-wrap: wrap-reverse;
  justify-content: space-between;
}
.alternative-background .card-annotation {
  background-color: var(--bg-tertiary);
  color: var(--fg-secondary);
}
.highlight .card-annotation {
  background-color: var(--fg-highlight-1);
  color: var(--bg-primary);
}


.avatar {
  width: 128px;
  min-height: 64px;
  max-height: 128px;
  margin: -96px auto -32px;
  background-color: initial;
}
.avatar img {
  overflow: hidden;
  border: 4px solid var(--fg-highlight-1);
  border-radius: 50%;
  object-fit: cover;
  width: 100%;
  height: 100%;
}
.pre-avatar {
  padding-bottom: 120px;
}
.post-avatar {
  padding-top: 32px;
}


.align-right {
  text-align: right;
}


time {
  font-size: .9em;
  white-space: nowrap;
  color: var(--fg-highlight-3);
}
time.time-end::before {
  content: '»';
  margin-right: 8px;
}


@media screen and (max-width: 200px) {
  body {
    font-size: 0.9em;
  }

  ul, ol {
    padding-left: 12px;
  }

  h1 { font-size: 1.2em; }
  h2 { font-size: 1.1em; }
  h3 { font-size: 0.9em; }
  h4 { font-size: 0.8em; }
  h5 { font-size: 0.7em; }
  h6 { font-size: 0.6em; }

  .card {
    margin: 0 calc(-2ch + 4px);
    max-width: calc(100% + 4ch);
  }

  .text-small {
    font-size: .6em;
  }
}
