@font-face {
  font-family: "Chivo Mono";
  font-style: normal;
  font-weight: 300;
  src: url("../fonts/ChivoMono-Light.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Chivo Mono";
  font-style: normal;
  font-weight: 400;
  src: url("../fonts/ChivoMono-Regular.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Chivo Mono";
  font-style: italic;
  font-weight: 400;
  src: url("../fonts/ChivoMono-Italic.ttf") format("truetype");
  font-display: swap;
}

:root,
[data-theme="light"] {
  --background: #fff;
  --foreground: #000;
  --ui-1: #000;
  --ui-2: #0e0e0e;
  --accent: #2f2bd6;
}

[data-theme="dark"] {
  --background: #0c0c0c;
  --foreground: #ededed;
  --ui-1: #ededed;
  --ui-2: #ededed;
  --accent: #ff6a00;
}

::selection {
  background: var(--accent);
  color: var(--background);
}

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

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--background);
  color: var(--ui-2);
  font-family: "Chivo Mono", ui-monospace, monospace;
  font-size: 15px;
  font-weight: 300;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

@media (max-width: 640px) {
  body {
    font-size: 14px;
  }

  .stack {
    gap: 1.75rem;
  }

  .block-head {
    padding: 0.2rem 0;
  }
}

.skip {
  position: absolute;
  left: -999px;
}

.skip:focus {
  left: 8px;
  top: 8px;
  background: var(--ui-1);
  color: var(--background);
  padding: 4px 8px;
}

.page {
  width: 100%;
  max-width: 48rem;
  margin: 0 auto;
  padding: clamp(20px, 8vw, 200px) 1rem 4rem;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

h1 {
  margin: 0;
  font-size: 15px;
  font-weight: 300;
  color: var(--ui-1);
}

h1 a {
  color: inherit;
  text-decoration: none;
}

h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 300;
  color: var(--ui-2);
}

.icon-btn {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 8px;
  margin: 0;
  color: var(--ui-1);
  cursor: pointer;
  border-radius: 999px;
  line-height: 0;
}

.icon-btn:hover {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
}

.icon-btn:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
}

.icon-sun,
.icon-moon {
  display: none;
}

/* show the current mode's icon; on hover, preview the mode a click switches to */
[data-theme="light"] .icon-sun,
[data-theme="light"] .icon-btn:hover .icon-moon,
[data-theme="dark"] .icon-moon,
[data-theme="dark"] .icon-btn:hover .icon-sun {
  display: block;
}

[data-theme="light"] .icon-btn:hover .icon-sun,
[data-theme="dark"] .icon-btn:hover .icon-moon {
  display: none;
}

.lede {
  margin: 0 0 1.75rem;
  color: var(--ui-2);
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--accent);
}

a:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.block-head,
.item-head {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  width: fit-content;
  display: block;
  font: inherit;
  color: var(--ui-2);
  cursor: pointer;
  text-align: left;
}

.block-head:focus-visible,
.item-head:focus-visible {
  outline: 1px solid var(--ui-1);
  outline-offset: 3px;
}

.block-body {
  padding: 0.5rem 0 0;
}

.block-body p {
  margin: 0 0 0.75rem;
  max-width: 62ch;
  text-wrap: balance;
}

.block-body p:last-child {
  margin-bottom: 0;
}

.list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.list li + li {
  margin-top: 0.85rem;
}

.item-body {
  padding: 0.55rem 0 0;
}

.cred {
  margin: 0 0 0.55rem;
}

.embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: transparent;
  line-height: 0;
}

.embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
}

.group + .group {
  margin-top: 1.4rem;
}

.group h3 {
  margin: 0 0 0.4rem;
  font-size: 15px;
  font-weight: 400;
  color: var(--ui-1);
}

.plain {
  margin: 0;
  padding: 0;
  list-style: none;
}

.plain li {
  margin: 0 0 0.2rem;
}

.links {
  padding-top: 0.5rem;
}

.links a {
  margin-right: 1rem;
}
