:root {
  --color-primary: 11deg 80% 56%;
  --color-primary-faded: 264deg 64% 26%;
  --color-secondary: 236deg 100% 26%;
  --f0: #1a1a1a;
  --f1: #3e3e3e;
  --f2: #535353;
  --f3: #626262;
  --b0: #eee;
  --b1: #ccc;
  --b2: #aaa;
  --b3: #999;
  --b4: #777;
}

@media (prefers-color-scheme: dark) {
  :root {
    --b0: #1a1a1a;
    --b1: #3e3e3e;
    --b2: #535353;
    --b3: #626262;
    --b4: #777;
    --f0: #eee;
    --f1: #ccc;
    --f2: #aaa;
    --f3: #999;
  }
  :root.light {
    --f0: #1a1a1a;
    --f1: #3e3e3e;
    --f2: #535353;
    --f3: #626262;
    --b0: #eee;
    --b1: #ccc;
    --b2: #aaa;
    --b3: #999;
    --b4: #777;
  }
}

:root.dark {
  --b0: #1a1a1a;
  --b1: #3e3e3e;
  --b2: #535353;
  --b3: #626262;
  --b4: #777;
  --f0: #eee;
  --f1: #ccc;
  --f2: #aaa;
  --f3: #999;
}

body,
html {
  margin: 0;
}

body {
  font-family: "Circle", "Helvetica Neue", "Arial", "Nimbus Sans L",
    "Liberation Sans", sans-serif;
  background-color: var(--b0);
  letter-spacing: 0.02em;
  color: var(--f0);
}

p,
a,
h1,
h2,
h3,
h4 {
  font-size: 1em;
  color: inherit;
  margin: 0;
  padding: 0;
}
summary {
  user-select: none;
}
.prose h1 {
  font-size: 2em;
}

.prose h2 {
  font-size: 1.5em;
}

.prose h3 {
  font-size: 1.3em;
}

.prose h1,
.prose h2,
.prose h3 {
  margin-top: 45px;
  margin-bottom: 25px;
}

.prose p {
  margin-top: 10px;
  margin-bottom: 15px;
  line-height: 1.5;
}

.prose a {
  text-decoration: underline;
}

.blurb h1 {
  margin-bottom: 20px;
}

.blurb h2 {
  margin-bottom: 15px;
}

.blurb h3 {
  margin-bottom: 10px;
}

.blurb p {
  margin-bottom: 10px;
}

h1 {
  font-size: 1.5em;
  line-height: 1.1;
}

h2 {
  font-size: 1.3em;
  line-height: 1.1;
}

h3 {
  font-size: 1.15em;
  line-height: 1.1;
}

a {
  text-decoration: none;
}

button {
  font-size: inherit;
  font-family: inherit;
  background-color: #444;
  color: var(--f0);
  border: none;
  padding: 4px;
  cursor: pointer;
}

.loader {
  position: relative;
}
.loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.loader .loading {
  opacity: 0;
  transition: opacity 300ms;
}
.htmx-request .loader .loading,
.loader.htmx-request .loading {
  opacity: 1;
}
.loader .loaded {
  opacity: 1;
  transition: opacity 300ms;
}
.htmx-request .loader .loaded,
.loader.htmx-request .loaded {
  opacity: 0;
}

.card {
  display: block;
  box-sizing: border-box;
  border-radius: 12px;
  padding: 16px;
  margin: 16px 0;
}

.error {
  color: #ff8888;
}

.success {
  color: #88ff88;
}

input[type="text"].warning,
input[type="text"].invalidable:invalid {
  color: #ff8866;
  border-color: #ff8866;
}
input[type="text"].warning:focus {
  color: var(--f0);
  border-color: var(--f0);
}

textarea,
select,
input[type="text"],
input[type="number"],
input[type="email"] {
  font-family: inherit;
  font-size: inherit;
  background-color: transparent;
  color: var(--f0);
  border: 1px solid var(--f2);
  padding: 6px;
  border-radius: 4px;
  resize: none;
}

input[disabled] {
  font-family: inherit;
  font-size: inherit;
  color: var(--f1);
  padding: 6px;
  border-radius: 4px;
  border: 0.5px solid var(--b4);
}

/* layout */

.rh-layout {
  display: flex;
  gap: 20px;
  justify-content: center;
}

.rh-layout aside {
  width: 100%;
  /* max-width: 325px; */
  /* padding: 20px; */
}

.rh-layout #main {
  box-sizing: border-box;
  width: 100%;
  /* max-width: 650px; */
  /* padding: 20px; */
}

.bubble-inline {
  display: inline-block;
  box-sizing: border-box;
  vertical-align: middle;
  padding: 10px 14px;
  border-radius: 999px;
  text-decoration: none;
}

.bubble {
  display: flex;
  justify-content: start;
  align-items: center;
  gap: 8px;
  font-weight: bold;
  box-sizing: border-box;
  width: 100%;
  padding: 14px;
  border-radius: 999px;
  text-decoration: none;
}

.board {
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  box-sizing: border-box;
  width: 100%;
  padding: 16px;
  border-radius: 8px;
  text-decoration: none;
}

.brick {
  display: inline-block;
  box-sizing: border-box;
  padding: 6px 8px;
  border-radius: 6px;
  text-decoration: none;
  width: fit-content;
}

.dot {
  border-radius: 50%;
  display: inline-block;
  width: 14px;
  height: 14px;
}

header {
  padding: 30px 0;
}

header h1 {
  font-size: 40px;
}

/* Neutral colors */

.n0 {
  background-color: var(--b1);
}
.n1 {
  background-color: var(--b2);
}
.n2 {
  background-color: var(--b3);
}
.n0.hoverable:hover,
.n1.hoverable:hover,
.n2.hoverable:hover {
  filter: invert(20%);
  cursor: pointer;
}
.n0.hoverable:disabled,
.n1.hoverable:disabled,
.n2.hoverable:disabled {
  cursor: inherit;
  filter: brightness(0.6);
}

/* utility classes */
.fc {
  display: flex;
  flex-direction: column;
}
.fr {
  display: flex;
  flex-direction: row;
}
.frw {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
}
.hidden {
  display: none !important;
}
.jc {
  justify-content: center;
}
.jb {
  justify-content: space-between;
}
.ja {
  justify-content: space-around;
}
.js {
  justify-content: start;
}
.je {
  justify-content: end;
}
.js {
  justify-content: start;
}
.as {
  align-items: start;
}
.af {
  align-items: stretch;
}
.ae {
  align-items: end;
}
.ac {
  align-items: center;
}
.wfc {
  width: fit-content;
}
.wf {
  width: 100%;
}
.f1 {
  color: var(--f1);
}
.f2 {
  color: var(--f2);
}
.f3 {
  color: var(--f3);
}
.b0 {
  background-color: var(--b0);
}
.b1 {
  background-color: var(--b1);
}
.b2 {
  background-color: var(--b2);
}
.b3 {
  background-color: var(--b3);
}
.b4 {
  background-color: var(--b4);
}
.g0 {
  gap: 0px;
}
.g1 {
  gap: 4px;
}
.g2 {
  gap: 8px;
}
.g3 {
  gap: 12px;
}
.g4 {
  gap: 16px;
}
.g5 {
  gap: 20px;
}
.g6 {
  gap: 24px;
}
.g7 {
  gap: 28px;
}
.s-2 {
  font-size: 0.75em;
}
.s-1 {
  font-size: 0.9em;
}
.s0 {
  font-size: 1em;
}
.s1 {
  font-size: 1.15em;
}
.s2 {
  font-size: 1.3em;
}
.s3 {
  font-size: 1.45em;
}
.s4 {
  font-size: 1.6em;
}
.br0 {
  border-radius: 0;
}
.br1 {
  border-radius: 4px;
}
.br2 {
  border-radius: 8px;
}
.bc1 {
  border-color: var(--b4);
}
.bc2 {
  border-color: var(--f3);
}
.bw0 {
  border-style: solid;
  border-width: 0px;
}
.bw1 {
  border-style: solid;
  border-width: 1px;
}
.bw2 {
  border-style: solid;
  border-width: 2px;
}
.p0 {
  padding: 0px;
}
.p1 {
  padding: 4px;
}
.p2 {
  padding: 8px;
}
.p3 {
  padding: 12px;
}
.p4 {
  padding: 16px;
}
.mono {
  font-family: monospace;
}
.pre-line {
  white-space: pre-line;
}
.pre {
  white-space: pre;
}
.break {
  word-break: break-all;
}
.scroll-x {
  scroll-x: auto;
}

.colorful {
  background-image: linear-gradient(
    158deg,
    hsl(var(--color-primary-faded)) 1%,
    hsl(var(--color-primary))
  );
  color: white;
}

.colorful.hoverable:hover {
  filter: invert(20%);
}

.colorful.hoverable:disabled {
  display: none;
  background-image: none;
  filter: grayscale(85%);
}
