:root {
  --font-family-mono: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas,
    Liberation Mono, monospace;
  --text-color: #2d2723;
  --background: #f8f4ed;
  --background-dusk: #1c1917;
  --inspector-margin: rgb(146 146 146 / 14.8%);
  --inspector-padding: rgb(146 146 146 / 21.6%);
  --inspector-border: rgb(233 233 233 / 55.5%);
  --inspector-border-width: rgb(127 127 127 / 56%);
  --inspector-content: rgb(190 190 190 / 9.3%);
  --inspector-tip: #f8f4edf5;
  --inspector-tag: #000;
  --token-name: #9c611f;
  --input-accent: #000;
  --blockquote-border: 0 0 0;
  --element-token-highlight: #000000;
}

/* dusk mode styles */

.bg-background-dusk {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  --token-name: #f29766;
  --inspector-tip: #1c1917f5;
  --inspector-tag: #fff;
  --inspector-margin: rgb(146 146 146 / 11.8%);
  --inspector-padding: rgb(146 146 146 / 21.6%);
  --inspector-border: rgb(233 233 233 / 15.1%);
  --inspector-content: rgb(190 190 190 / 2.7%);
  --text-color: #ccc;
  --blockquote-border: 255 255 255;
  --background: #1c1917;
  --element-token-highlight: #fff;
}

.bg-background-dusk a {
  color: #fff;
}

.bg-background-dusk a:hover,
.bg-background-dusk a:focus {
  opacity: 0.5;
}

.bg-background-dusk a:active {
  opacity: 0.8;
}

.bg-background-dusk .reference:target,
.bg-background-dusk .footnote:target {
  background-color: #f29766b5;
  color: #fff;
}

.bg-background-dusk img {
  filter: invert(1);
}

/* global elements */

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

html {
  overflow-x: hidden;
  line-height: 1.15;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--background);
  transition: background-color 120ms ease-in-out;
  margin: 0;
  overflow-x: hidden;
  color: var(--text-color);
  -webkit-text-size-adjust: none;
  -webkit-tap-highlight-color: rgba(0 0 0 / 0);
}

h1 {
  font-size: 2em;
  margin: 0.67em 0;
}

a {
  background-color: transparent;
  text-decoration: underline dotted;
}

hr {
  border-width: 4px;
  border-color: var(--inspector-border);
  box-sizing: content-box;
  height: 0;
  overflow: visible;
}

blockquote {
  font-style: italic;
  padding-left: 1rem;
  border-left: 2px dotted rgb(var(--blockquote-border) / 40%);
  hanging-punctuation: first allow-end last;
  text-wrap: pretty;
}

@media (max-width: 30em) {
  blockquote {
    margin-left: 1rem;
    margin-right: 1rem;
    border-color: rgb(var(--blockquote-border) / 20%);
  }
}

sub,
sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sup {
  top: -0.5em;
}

img {
  max-width: 100%;
  height: auto;
}

details {
  display: block;
  line-height: 1.45;
}

summary {
  cursor: pointer;
  display: list-item;
}

button,
input,
optgroup,
select,
textarea {
  font-family: inherit;
  font-size: 100%;
  line-height: 1.15;
  margin: 0;
}

[type="checkbox"],
[type="radio"] {
  box-sizing: border-box;
  padding: 0;
}

/* footnote styles */

.reference {
  margin-bottom: 1rem;
}

.reference:target,
.footnote:target {
  background-color: #ffff00;
}

.normal {
  font-weight: 400;
}

.i {
  font-style: italic;
}

.monospace {
  font-family: var(--font-family-mono);
}

.title-content-heading {
  font-size: clamp(2rem, 2vw, 3vw);
}

@media (max-width: 30em) {
  .title-content-heading {
    font-size: 1.9rem;
  }
}

#title-image {
  display: block;
  margin: 0 auto;
}

@media (min-width: 30em) {
  #title-image {
    width: 90%;
  }
}

.copy-content {
  font-size: clamp(1rem, 1.5vw, 3vw);
  line-height: 1.5em;
}

.measure-content {
  width: 50%;
  min-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 400px) {
  .measure-content {
    padding: 0 2em;
    min-width: 100vw;
  }
}

.lh-solid {
  line-height: 1;
}

/* typography helpers */

.word-wrap {
  word-break: break-all;
}

/* animate the tag entering with the inspector */

@keyframes append-animate {
  from {
    transform: scale(0.9);
    opacity: 0;
    max-height: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
    max-height: 1em;
  }
}

/* dusk stars */

.star {
  position: absolute;
  background-color: #fff;
  transform: rotate(45deg);
  width: 4px;
  height: 4px;
}

.w-checkbox {
  vertical-align: middle;
  width: 16px;
  height: 16px;
  accent-color: var(--input-accent);
}

/* button link */

.button-link {
  text-decoration: none;
  color: #000;
  opacity: 1;
  border-style: dotted;
  border-width: 2px;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}

.button-link,
.button-link:focus,
.button-link:hover {
  transition: opacity 0.15s ease-in;
}
.button-link:focus,
.button-link:hover {
  opacity: 0.5;
}
.button-link:active {
  opacity: 0.8;
  transition: opacity 0.15s ease-out;
}

/* spacing */

.pv5 {
  padding-top: 4rem;
  padding-bottom: 3rem;
}

.ma0 {
  margin: 0;
}

.mr2 {
  margin-right: 0.5rem;
}

.mb1 {
  margin-bottom: 0.25rem;
}

.mt0 {
  margin-top: 0;
}

.mv5 {
  margin-top: 4rem;
  margin-bottom: 4rem;
}

.mv7 {
  margin-top: 16rem;
  margin-bottom: 16rem;
}

/* dom inspector */

.element-token {
  margin-top: 0.25rem;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  color: rgba(146 146 146 / 20%);
  transition: color 120ms ease-in-out;
}

.token-name {
  color: var(--token-name);
}

.element-token:last-child {
  color: var(--element-token-highlight);
  animation: append-animate 120ms ease-in-out;
}

#support {
  font-family: var(--font-family-mono);
  display: flex;
  position: fixed;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
  bottom: 2rem;
  right: 2rem;
}

@media (max-width: 30em) {
  #support {
    bottom: 1rem;
    right: 1rem;
  }
}

#taglist {
  font-size: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  margin-bottom: 0.5rem;
}

#inspect-controls {
  font-size: 0.75rem;
  display: flex;
  align-items: baseline;
  padding: 0.5rem 1rem;
  pointer-events: auto;
  background-color: var(--inspector-tip);
  transition: background-color 120ms ease-in-out;
}

.inspect-ornament {
  left: 0;
  right: 0;
  pointer-events: none;
}

.inspect-ornament::after,
.inspect-ornament::before {
  font-family: var(--font-family-mono);
  font-weight: 100;
  content: "+";
  position: absolute;
  opacity: 0.15;
  top: -1em;
}

.inspect-ornament::before {
  right: -1em;
}

.inspect-ornament::after {
  left: -1em;
}

.inspect-top {
  top: 0;
}

.inspect-bottom {
  bottom: -0.9em;
}

.dom-inspector {
  position: fixed;
  pointer-events: none;
  outline-color: var(--inspector-border);
  outline-style: outset;
  outline-width: 5px;
}

.dom-inspector > div {
  position: absolute;
}

.dom-inspector .tips {
  font-family: var(--font-family-mono);
  color: var(--inspector-tag);
  font-size: 12px;
  background-color: var(--inspector-tip);
  padding: 10px;
  position: fixed;
  display: none;
  box-shadow: 0 0 2rem 0rem #e7e3dd;
}

.bg-background-dusk .dom-inspector .tips {
  box-shadow: 0 0 2rem 0rem #433e35;
}

.dom-inspector .tips .size {
  margin-left: 1em;
  opacity: 0.75;
}

.dom-inspector-theme-default .margin {
  background-color: var(--inspector-margin);
}

.dom-inspector-theme-default .border {
  background-color: var(--inspector-border-width);
}

.dom-inspector-theme-default .padding {
  background-color: var(--inspector-padding);
}

.dom-inspector-theme-default .content {
  background-color: var(--inspector-content);
}
