:root {
  --paper: #f5f0e6;
  --paper-2: #ece4d5;
  --sheet: #fffdf8;
  --ink: #1d1a16;
  --ink-2: #4a443b;
  --muted: #7a7164;
  --rule: #d9cfbd;
  --accent: #b8401e;
  --accent-2: #2f5d50;
  --accent-soft: #f3dfd3;
  --code-bg: #221e19;
  --code-ink: #eee5d4;
  --code-dim: #a1957f;
  --shadow: 0 1px 0 #fff8 inset, 0 18px 40px -24px #3b2a1666;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #15130f;
    --paper-2: #1d1a15;
    --sheet: #1f1c17;
    --ink: #ebe3d4;
    --ink-2: #c8bea9;
    --muted: #978d7c;
    --rule: #3a342a;
    --accent: #f07a4f;
    --accent-2: #7fb8a5;
    --accent-soft: #3a2419;
    --code-bg: #0f0e0b;
    --code-ink: #ece2cf;
    --code-dim: #8c816d;
    --shadow: 0 18px 40px -24px #000c;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --paper: #15130f;
  --paper-2: #1d1a15;
  --sheet: #1f1c17;
  --ink: #ebe3d4;
  --ink-2: #c8bea9;
  --muted: #978d7c;
  --rule: #3a342a;
  --accent: #f07a4f;
  --accent-2: #7fb8a5;
  --accent-soft: #3a2419;
  --code-bg: #0f0e0b;
  --code-ink: #ece2cf;
  --code-dim: #8c816d;
  --shadow: 0 18px 40px -24px #000c;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; }

body {
  margin: 0;
  background: var(--paper);
  background-image: radial-gradient(color-mix(in srgb, var(--ink) 6%, transparent) 1px, transparent 1px);
  background-size: 22px 22px;
  color: var(--ink);
  font: 16px/1.7 "Source Serif 4", Georgia, serif;
}

code, pre, kbd, .mono { font-family: "JetBrains Mono", ui-monospace, Consolas, monospace; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }

.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: .7rem max(16px, calc((100vw - 1120px) / 2));
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}

.bar .mark { font: 600 1.1rem "Fraunces", Georgia, serif; color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.bar .mark b { color: var(--accent); }
.bar nav { display: flex; gap: 1.1rem; margin-left: auto; font: 500 .82rem "Inter", system-ui, sans-serif; }
.bar nav a { color: var(--ink-2); text-decoration: none; }
.bar nav a:hover { color: var(--accent); }
.bar .github { color: var(--ink-2); display: inline-flex; }
.bar .github:hover { color: var(--accent); }
.bar button {
  border: 1px solid var(--rule);
  background: var(--sheet);
  color: var(--ink-2);
  border-radius: 999px;
  padding: .2rem .7rem;
  white-space: nowrap;
  font: 500 .75rem "Inter", system-ui, sans-serif;
  cursor: pointer;
}

main { max-width: 1120px; margin: 0 auto; padding: 0 16px 5rem; }

.hero { padding: 4.5rem 0 2.2rem; max-width: 52rem; }
.kicker {
  font: 600 .72rem "Inter", system-ui, sans-serif;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--accent);
}

h1, h2, h3 { font-family: "Fraunces", Georgia, serif; font-weight: 600; letter-spacing: -.015em; line-height: 1.15; }
.hero h1 { font-size: clamp(2.4rem, 5.2vw, 4rem); margin: .6rem 0 1rem; }
.hero h1 em { font-style: italic; color: var(--accent); font-weight: 500; }
.hero p.lede { font-size: 1.14rem; color: var(--ink-2); margin: 0 0 1.6rem; max-width: 44rem; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; }

.install {
  display: inline-flex;
  align-items: center;
  gap: .8rem;
  padding: .55rem .9rem;
  border: 1px dashed var(--rule);
  border-radius: 10px;
  background: var(--sheet);
  font: .86rem "JetBrains Mono", monospace;
}
.install span { color: var(--muted); }
.button {
  display: inline-block;
  padding: .55rem 1rem;
  border-radius: 10px;
  background: var(--accent);
  color: #fff8f2;
  font: 600 .84rem "Inter", system-ui, sans-serif;
  text-decoration: none;
}
.button.quiet { background: transparent; color: var(--ink-2); border: 1px solid var(--rule); }
.button:hover { filter: brightness(1.06); }

.bench {
  margin: 0 0 3.5rem;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.bench-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .6rem .8rem;
  border-bottom: 1px solid var(--rule);
  background: var(--paper-2);
  font: 500 .8rem "Inter", system-ui, sans-serif;
}
.bench-head .tabs { display: flex; gap: .25rem; }
.bench-head .tabs button {
  border: 0;
  background: transparent;
  color: var(--ink-2);
  padding: .32rem .8rem;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
}
.bench-head .tabs button[aria-pressed="true"] { background: var(--sheet); color: var(--accent); box-shadow: 0 1px 2px #0002; }
.bench-head .note { color: var(--muted); font-size: .76rem; }
.bench-head label { margin-left: auto; display: flex; align-items: center; gap: .35rem; color: var(--muted); cursor: pointer; }
.bench-body { display: grid; grid-template-columns: 1.25fr .85fr 1.2fr; height: 430px; }
.bench .pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.bench .pane + .pane { border-left: 1px solid var(--rule); }
.bench .pane h4 {
  margin: 0;
  padding: .5rem .9rem;
  font: 600 .66rem "Inter", system-ui, sans-serif;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px dotted var(--rule);
}
.bench .pane.result h4 + pre + h4 { border-top: 1px solid var(--rule); }
.bench textarea, .bench pre {
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: .85rem .95rem;
  border: 0;
  resize: none;
  background: transparent;
  color: var(--ink);
  font: .76rem/1.7 "JetBrains Mono", monospace;
  white-space: pre;
  overflow: auto;
  outline: none;
  tab-size: 2;
}
.bench textarea#data { color: var(--ink-2); }
.bench .out { background: color-mix(in srgb, var(--accent-soft) 35%, transparent); }
.bench .out.refused { color: var(--accent); white-space: pre-wrap; }
.bench .view { flex: 1; min-height: 0; overflow: auto; padding: .7rem 1rem; font-size: .95rem; }
.bench .view :is(h1, h2, h3) { font-size: 1.1rem; margin: .1rem 0 .3rem; }
.bench .view :is(p, ul) { margin: .25rem 0; }

.figures {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin: 1rem 0 4rem;
}
.figures div { padding: 1.2rem 1rem; text-align: center; }
.figures div + div { border-left: 1px solid var(--rule); }
.figures b { display: block; font: 600 2rem "Fraunces", Georgia, serif; color: var(--accent-2); }
.figures span { font: 500 .78rem "Inter", system-ui, sans-serif; color: var(--muted); letter-spacing: .04em; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 4.5rem; }
.feature {
  padding: 1.3rem 1.3rem 1.1rem;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: 12px;
  position: relative;
}
.feature::before {
  content: attr(data-n);
  position: absolute;
  top: .9rem;
  right: 1rem;
  font: italic 500 1.4rem "Fraunces", Georgia, serif;
  color: color-mix(in srgb, var(--accent) 45%, transparent);
}
.feature h3 { margin: 0 0 .4rem; font-size: 1.12rem; }
.feature p { margin: 0; color: var(--ink-2); font-size: .95rem; }

.doc { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 3rem; }
.doc aside { position: sticky; top: 5rem; align-self: start; font: 500 .84rem "Inter", system-ui, sans-serif; }
.doc aside a { display: block; padding: .25rem 0 .25rem .8rem; color: var(--ink-2); text-decoration: none; border-left: 2px solid var(--rule); }
.doc aside a:hover, .doc aside a.on { color: var(--accent); border-left-color: var(--accent); }
.doc section { padding-bottom: 2.4rem; border-bottom: 1px solid var(--rule); margin-bottom: 2.4rem; }
.doc section:last-child { border-bottom: 0; }
.doc h2 { font-size: 1.8rem; margin: 0 0 .8rem; }
.doc h3 { font-size: 1.2rem; margin: 1.6rem 0 .5rem; }
.doc p, .doc li { color: var(--ink-2); }

pre.code {
  background: var(--code-bg);
  color: var(--code-ink);
  padding: 1rem 1.1rem;
  border-radius: 10px;
  overflow-x: auto;
  font-size: .82rem;
  line-height: 1.6;
}
pre.code .c { color: var(--code-dim); }
pre.code .k { color: #f0a070; }
pre.code .s { color: #b6d39a; }
:not(pre) > code { background: var(--paper-2); padding: .08em .35em; border-radius: 5px; font-size: .86em; }

table { width: 100%; border-collapse: collapse; font-size: .92rem; margin: .8rem 0 1.2rem; }
th, td { text-align: left; padding: .5rem .7rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font: 600 .74rem "Inter", system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: .35rem; margin: .4rem 0 1.2rem; }
.chips code { background: var(--sheet); border: 1px solid var(--rule); padding: .12rem .5rem; border-radius: 6px; font-size: .78rem; }
.chips a { color: inherit; text-decoration: none; }
.chips a:hover code { border-color: var(--accent); color: var(--accent); }

footer { max-width: 1120px; margin: 0 auto; padding: 2rem 16px 3rem; color: var(--muted); font: .82rem "Inter", system-ui, sans-serif; border-top: 3px double var(--rule); }

@media (width <= 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 2.5rem; gap: 2rem; }
  .features { grid-template-columns: 1fr 1fr; }
  .figures { grid-template-columns: repeat(3, 1fr); }
  .figures div:nth-child(4) { border-left: 0; }
  .doc { grid-template-columns: minmax(0, 1fr); }
  .doc aside { display: none; }
  .bar nav { gap: .75rem; }
}

@media (width <= 560px) {
  .bar { gap: .5rem; padding-inline: 12px; }
  .bar nav { gap: .55rem; font-size: .78rem; }
  /* The theme switch keeps its place but drops its words on a phone. */
  .bar button { font-size: 0; padding: .2rem .5rem; }
  .bar button::before { content: "\25D0"; font-size: .95rem; line-height: 1; }
  .features { grid-template-columns: 1fr; }
  .figures { grid-template-columns: 1fr 1fr; }
  .figures div { border-left: 0 !important; }
}

.page main.doc { padding-top: 3rem; }
.page .lede { font-size: 1.08rem; color: var(--ink-2); max-width: 46rem; }
.page h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin: .4rem 0 .6rem; }
.bar nav a[aria-current="page"] { color: var(--accent); }

aside.index { font: 500 .82rem "Inter", system-ui, sans-serif; max-height: calc(100vh - 6rem); overflow-y: auto; }
aside.index .group { margin-bottom: 1.2rem; }
aside.index .group b { display: block; margin-bottom: .35rem; font: 600 .7rem "Inter", system-ui, sans-serif; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
aside.index a { display: block; padding: .18rem 0 .18rem .8rem; color: var(--ink-2); text-decoration: none; border-left: 2px solid var(--rule); }
aside.index a:hover, aside.index a.on { color: var(--accent); border-left-color: var(--accent); }

.reference section { padding-bottom: 2rem; margin-bottom: 2.5rem; border-bottom: 1px solid var(--rule); }
.reference h2 { font-size: 1.7rem; margin: 2rem 0 .4rem; }
.reference article { margin: 2rem 0 2.4rem; }
.reference h3 { font-size: 1.25rem; margin: 1.8rem 0 .5rem; }
.reference h3 a.self, h2.lead-in a { color: inherit; text-decoration: none; }
.reference h3 a.self:hover, h2.lead-in a:hover { color: var(--accent); }
.reference .kind { font: 600 .66rem "Inter", system-ui, sans-serif; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-2); vertical-align: middle; margin-right: .3rem; }
pre.sig {
  margin: .5rem 0;
  padding: .75rem 1rem;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  overflow-x: auto;
  font-size: .78rem;
  line-height: 1.55;
  white-space: pre;
}
.member { margin: 1rem 0 1.2rem; }
.member p, .reference article > p { margin: .35rem 0 0 .2rem; color: var(--ink-2); }
dl.fields { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1.2rem; margin: .8rem 0 1rem; font-size: .92rem; }
dl.fields dt { margin: 0; }
dl.fields dd { margin: 0; }
dl.fields dd p { margin: 0; color: var(--ink-2); }

.guide pre.code { white-space: pre; }
.next { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 1rem 0 4rem; }
.next a { display: block; padding: 1.2rem 1.3rem; background: var(--sheet); border: 1px solid var(--rule); border-radius: 12px; text-decoration: none; color: var(--ink); }
.next a b { display: block; font: 600 1.15rem "Fraunces", Georgia, serif; margin-bottom: .3rem; }
.next a span { color: var(--ink-2); font-size: .92rem; }
.next a:hover { border-color: var(--accent); }
.trio { margin: 1rem 0 1.4rem; }
.trio-note { max-width: 62ch; color: var(--ink-2); font-size: .95rem; margin: 0 0 .9rem; }
.trio-panes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.trio article {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.trio h4 {
  margin: 0;
  padding: .55rem .9rem .45rem;
  font: 600 .7rem "Inter", system-ui, sans-serif;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  border-bottom: 1px dotted var(--rule);
}
.trio h5 {
  margin: 0;
  padding: .45rem .9rem .35rem;
  font: 600 .62rem "Inter", system-ui, sans-serif;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}
.trio pre {
  margin: 0;
  padding: .75rem .9rem;
  font: .73rem/1.65 "JetBrains Mono", monospace;
  white-space: pre;
  overflow: auto;
  min-height: 0;
}
.trio pre.src { background: var(--code-bg); color: var(--code-ink); height: 9.5rem; }
.trio pre.out { border-top: 1px dashed var(--rule); color: var(--ink); flex: 1 1 auto; }
.trio-verdict { margin: 0 0 3.5rem; font: 500 .78rem "Inter", system-ui, sans-serif; color: var(--muted); letter-spacing: .02em; }
.trio-verdict b { color: var(--accent-2); font-weight: 600; }

.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin: 1rem 0 4rem; }
.duo pre.code { margin: 0; height: 100%; }
.duo h4 { margin: 0 0 .4rem; font: 600 .7rem "Inter", system-ui, sans-serif; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }

@media (width <= 900px) {
  .next, .duo, .trio-panes { grid-template-columns: minmax(0, 1fr); }
  aside.index { display: none; }
}

.lead-in { font-size: 1.6rem; margin: 0 0 1rem; }
.names { margin: 0 0 3rem; }
.names h3 { font: 600 .72rem "Inter", system-ui, sans-serif; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin: 1.2rem 0 .3rem; }

@supports not selector(::-webkit-scrollbar) {
  * { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--ink) 22%, transparent) transparent; }
}
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--ink) 18%, transparent); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: color-mix(in srgb, var(--accent) 55%, transparent); }
::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }

@media (width <= 980px) {
  .bench-body { grid-template-columns: 1fr 1fr; height: auto; }
  .bench .pane { height: 300px; }
  .bench .pane.result { grid-column: 1 / -1; height: 420px; }
  .bench .pane.result { border-left: 0; border-top: 1px solid var(--rule); }
  .bench-head .note { display: none; }
}
@media (width <= 600px) {
  .bench-body { grid-template-columns: 1fr; }
  .bench .pane + .pane { border-left: 0; border-top: 1px solid var(--rule); }
}

code, pre, textarea { font-variant-ligatures: none; }
.hero { max-width: 64rem; }
.duo { row-gap: 1.6rem; }
.duo h4 { margin-bottom: .5rem; }

/* ---- Built-ins demo blocks ---- */
.demo {
  margin: 1rem 0 1.5rem;
  border: 1px solid var(--rule);
  border-radius: 12px;
  overflow: hidden;
  background: var(--sheet);
  box-shadow: 0 1px 0 #fff8 inset;
}
.demo > .demo-label {
  display: block;
  padding: .34rem .9rem;
  font: 600 .64rem "Inter", system-ui, sans-serif;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--paper-2);
  border-bottom: 1px solid var(--rule);
}
.demo pre.code {
  margin: 0;
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid var(--rule);
  background: var(--code-bg);
}
.demo .demo-data {
  color: var(--code-dim);
  font-size: .78rem;
}
.demo .demo-out {
  display: block;
  padding: .8rem 1.1rem;
  font: .86rem/1.65 "JetBrains Mono", monospace;
  color: var(--ink);
  background: color-mix(in srgb, var(--accent-soft) 32%, transparent);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  min-height: 1.1rem;
}
.demo .demo-out.refused { color: var(--accent); }

p.note {
  margin: 0;
  padding: .7rem .95rem;
  border-top: 1px solid var(--rule);
  border-left: 3px solid var(--accent-2);
  background: color-mix(in srgb, var(--accent-soft) 24%, transparent);
  color: var(--ink-2);
  font-size: .92rem;
  line-height: 1.6;
}

.reference .alias {
  font: 500 .82rem "Inter", system-ui, sans-serif;
  color: var(--muted);
  margin-left: .4rem;
}
.reference article > p { margin-left: 0; }

@media (width <= 980px) {
  .demo { margin: 1rem 0 1.3rem; }
}

html, button, input, textarea, select { font-variant-ligatures: no-contextual; }

/* The page scroll bar hides while the page stands at its top and shows from
   the first scroll on. It keeps its width either way, so nothing shifts. */
@supports selector(::-webkit-scrollbar) {
  html.at-top::-webkit-scrollbar-thumb { background: transparent; border-color: transparent; box-shadow: none; }
}
@supports not selector(::-webkit-scrollbar) {
  html.at-top { scrollbar-color: transparent transparent; }
}
