@font-face {
  font-family: "Sentient";
  src: url("/fonts/sentient-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Sentient";
  src: url("/fonts/sentient-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  --bg: #14110e;
  --raise: #312922;
  --ink: #f3ecdf;
  --body: #d9cfc0;
  --muted: #b3a394;
  --quiet: #a89886;
  --fill: #f3ecdf;
  --fill-ink: #14110e;
  --fill-hover: #e7dccb;
  color-scheme: dark;
}

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

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100svh;
  color: var(--ink);
  font-family: system-ui, "Segoe UI", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.55;
  background-color: var(--bg);
  background-image:
    radial-gradient(85% 70% at -12% -18%, rgba(236, 214, 180, 0.13), transparent 54%),
    url("/noise.png");
  background-size: auto, 160px 160px;
}

h1,
h2,
p {
  margin: 0;
}

a {
  color: var(--body);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

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

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

::selection {
  background: #3c342c;
  color: var(--ink);
}

.skip {
  position: absolute;
  left: 1.25rem;
  top: -4rem;
  background: var(--fill);
  color: var(--fill-ink);
  padding: 0.45rem 0.7rem;
  text-decoration: none;
}

.skip:focus {
  top: 0.75rem;
}

.frame {
  width: min(76rem, 100%);
  margin-inline: auto;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding-inline: clamp(1.25rem, 4vw, 2.75rem);
  padding-bottom: 1.35rem;
}

main {
  flex: 1;
  min-width: 0;
  padding-top: 2.75rem;
}

.mast {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.7rem 1.4rem;
  padding-top: 1.45rem;
}

.mark {
  font-family: "Sentient", "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  font-style: italic;
  font-weight: 400;
  font-size: 1.7rem;
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
}

h1.mark {
  font-size: 1.7rem;
}

.mark a {
  color: inherit;
  text-decoration: none;
}

.mark:hover,
.mark:hover a {
  color: #fff8ee;
}

.mast nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.15rem;
}

.mast nav a {
  font-size: 1rem;
}

body.home .frame {
  width: min(64rem, 100%);
}

body.home main {
  display: flex;
  flex-direction: column;
  justify-content: safe center;
  padding-top: 1.75rem;
  padding-bottom: 1.5rem;
}

.catalog {
  display: flex;
  flex-direction: column;
  gap: 2.75rem;
}

.entry {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: clamp(1rem, 3vw, 2.6rem);
  align-items: start;
  color: inherit;
  text-decoration: none;
}

.entry-body {
  container-type: inline-size;
  min-width: 0;
  max-width: 40rem;
}

.num {
  font-family: "Sentient", "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  font-weight: 400;
  font-size: clamp(3.25rem, 8vw, 7.6rem);
  line-height: 0.84;
  color: #cfc3b4;
}

.entry h2,
.doc h1 {
  font-family: "Sentient", "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--ink);
}

.entry h2 {
  font-size: clamp(2.05rem, 6vw, 4.5rem);
  line-height: 1.08;
}

@supports (width: 1cqw) {
  .entry h2 {
    font-size: clamp(2.05rem, 9.4cqw, 4.6rem);
  }
}

.entry h2 em,
.doc h1 em {
  font-style: italic;
  font-weight: 400;
}

.lede {
  margin-top: 1.15rem;
  max-width: 36rem;
  color: var(--body);
  font-size: 1.125rem;
  line-height: 1.55;
}

.facts {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.98rem;
}

.go {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 1.4rem;
  color: var(--body);
}

.arrow {
  display: block;
  flex: none;
}

.catalog .entry:not(:first-child) .num {
  font-size: clamp(1.55rem, 2vw, 2rem);
  line-height: 1;
  padding-top: 0.3rem;
}

.catalog .entry:not(:first-child) h2 {
  font-size: clamp(1.65rem, 3vw, 2.1rem);
}

.catalog .entry:not(:first-child) .lede {
  font-size: 1.02rem;
}

@media (max-width: 680px) {
  .entry {
    grid-template-columns: 1fr;
    row-gap: 0.4rem;
  }

  .num {
    font-size: 2.6rem;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .arrow {
    transition: transform 180ms ease;
  }

  .entry:hover .arrow {
    transform: translate(3px, -3px);
  }

  a,
  .mark {
    transition: color 160ms ease;
  }
}

.entry:hover .go,
.entry:hover h2 {
  color: #fff8ee;
}

.back {
  margin-bottom: 1.35rem;
}

.doc h1 {
  font-size: clamp(2rem, 5.6vw, 4.45rem);
  line-height: 1.08;
  max-width: 16em;
}

.section {
  margin-top: 3.15rem;
  max-width: 38rem;
  font-family: "Sentient", "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  font-weight: 400;
  font-size: clamp(1.65rem, 3vw, 2.1rem);
  line-height: 1.2;
}

.steps {
  list-style: none;
  margin: 1.2rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.95rem;
}

.steps li {
  display: grid;
  grid-template-columns: 6.6rem minmax(0, 32rem);
  gap: 0.25rem 1.2rem;
  align-items: baseline;
}

.lead {
  font-family: "Sentient", "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  font-style: italic;
  font-size: 1.4rem;
  line-height: 1.2;
  color: var(--ink);
}

.rest {
  color: var(--body);
}

@media (max-width: 460px) {
  .steps li {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }
}

.caveats {
  margin-top: 1.05rem;
  display: grid;
  gap: 0.8rem;
  max-width: 38rem;
}

.caveats p {
  color: var(--body);
}

.listing {
  position: relative;
  margin-top: 2.6rem;
  padding-bottom: 2.35rem;
  min-width: 0;
  max-width: 100%;
}

.listing::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-color: var(--raise);
  background-image: url("/noise.png");
  background-size: 160px 160px;
  clip-path: polygon(
    0 0,
    100% 0,
    100% calc(100% - 1.85rem),
    calc(100% - 1.85rem) 100%,
    0 100%
  );
  pointer-events: none;
}

.listing > * {
  position: relative;
  z-index: 1;
}

.listing-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  padding: 0.9rem 1.05rem 0.55rem 1.05rem;
}

.file {
  margin-right: auto;
  font-family: ui-monospace, "Cascadia Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.84rem;
  color: var(--quiet);
}

.copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 6.6rem;
  min-height: 2.6rem;
  padding: 0.45rem 0.85rem;
  border: 0;
  background: var(--fill);
  color: var(--fill-ink);
  font: 0.98rem system-ui, "Segoe UI", sans-serif;
  cursor: pointer;
}

.copy:hover {
  background: var(--fill-hover);
}

.listing-scroll {
  overflow: auto;
  padding: 0.2rem 0 0.85rem 0.45rem;
  font-family: ui-monospace, "Cascadia Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.8125rem;
  line-height: 1.6;
  scrollbar-color: #5c5148 transparent;
}

@media (min-width: 760px) {
  .listing-scroll {
    font-size: 0.875rem;
  }
}

.row {
  display: grid;
  grid-template-columns: 2.5rem max-content;
}

.ln {
  text-align: right;
  padding-right: 0.85rem;
  color: var(--quiet);
  user-select: none;
}

.src {
  white-space: pre;
  padding-right: 1.4rem;
  color: var(--ink);
}

.k { color: #f0d3a4; }
.s { color: #e0b48a; }
.r { color: #e7c3a8; }
.n { color: #f0dcc0; }
.f { color: #fff6ea; }
.c { color: #b3a394; }

.foot {
  padding-top: 2.4rem;
  max-width: 36rem;
  color: var(--muted);
  font-size: 0.98rem;
}

.missing h1 {
  font-family: "Sentient", "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.15;
  max-width: 16ch;
}

.missing .lede {
  margin-bottom: 1.4rem;
}
