@charset "utf-8";
/* stelint site. One file, no build step.
   A light terminal: one monospace face, box-drawing rules, boxes with the
   title in the top border, and a small set of quiet colors. */

:root {
  --bg: #faf9f5;
  --bg-2: #f3f1ea;
  --bg-3: #ebe8de;
  --line: #dcd8cc;
  --rule: #c2bdb0;
  --ink: #1f1e1c;
  --ink-2: #45423c;
  --dim: #75716a;
  --faint: #a7a298;
  --accent: #c15f3c;
  --accent-2: #d77757;
  --accent-bg: #f6e7df;
  --ok: #2f7a3e;
  --ok-bg: #e5f0e3;
  --err: #a8323f;
  --err-bg: #f8e4e4;
  --blue: #4a5ab0;
  --violet: #7a4f9e;
  --amber: #8f6a22;
  --mono: "JetBrains Mono", "SF Mono", SFMono-Regular, Menlo, "Cascadia Mono", "Cascadia Code", Consolas,
    "DejaVu Sans Mono", "Liberation Mono", ui-monospace, monospace;
  --max: 1240px;
  --pad: clamp(18px, 4vw, 40px);
  --radius: 6px;
  --pos: 50%;
  /* a row of box-drawing characters, cut to the width of its box */
  --rule-chars: "────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────";
  color-scheme: light;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.65 var(--mono);
  font-variant-ligatures: none;
  overflow-x: hidden;
}

img,
svg {
  max-width: 100%;
}

a {
  color: inherit;
}

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

code,
pre,
kbd {
  font-family: var(--mono);
  font-size: 1em;
}

p code,
li code,
.lede code {
  color: var(--blue);
}

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

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
}

/* ---------- shared pieces ---------- */

/* the dot of a message, drawn so that no emoji font takes it */
.bul {
  display: inline-block;
  width: 0.62em;
  height: 0.62em;
  border-radius: 50%;
  background: currentColor;
  vertical-align: 0.06em;
}

/* a box with its title in the top border */
.box,
.file,
.part,
.step,
.viz,
.welcome,
.loop {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-width: 0;
}

.box-head,
.file-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: -0.78em 14px 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--dim);
  white-space: nowrap;
  min-width: 0;
}

.box-head > span,
.file-head > span {
  background: var(--bg);
  padding: 0 6px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.box-head code,
.file-head code {
  color: var(--ink);
}

.muted {
  color: var(--dim);
}

/* ---------- top bar ---------- */

.top {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
}

.top::after {
  content: var(--rule-chars);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  color: var(--line);
  line-height: 0.4;
  height: 0.5em;
  font-size: 15px;
  opacity: 0;
  transition: opacity 0.2s;
}

.top.scrolled::after {
  opacity: 1;
}

.top .wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 56px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  padding: 12px 0;
}

.brand-mark {
  width: 14px;
  height: 14px;
  display: inline-block;
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 0 0 0 50%;
  background: var(--accent-2);
}

.chip {
  font-size: 12px;
  color: var(--dim);
}

.chip::before {
  content: "[";
  color: var(--faint);
}

.chip::after {
  content: "]";
  color: var(--faint);
}

.nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav a {
  font-size: 13px;
  color: var(--dim);
  text-decoration: none;
  padding: 14px 10px;
  white-space: nowrap;
}

.nav a::before {
  content: "\00a0\00a0";
}

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

.nav a[aria-current="page"] {
  color: var(--ink);
}

.nav a[aria-current="page"]::before {
  content: "❯\00a0";
  color: var(--accent);
}

@media (max-width: 640px) {
  .top .wrap {
    gap: 10px;
  }
  .top .chip,
  .nav a[href="./"] {
    display: none;
  }
  .nav a {
    padding: 14px 6px;
    font-size: 12px;
  }
}

/* ---------- type ---------- */

h1,
h2,
h3 {
  font-family: var(--mono);
  font-weight: 700;
  margin: 0;
  text-wrap: balance;
}

h1 {
  font-size: clamp(30px, 5.6vw, 64px);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

h2 {
  position: relative;
  font-size: clamp(20px, 2.4vw, 27px);
  line-height: 1.3;
  letter-spacing: -0.015em;
  max-width: 40ch;
  padding-left: 1.5em;
}

/* the dot of a reply in a session */
h2::before {
  content: "";
  position: absolute;
  left: 0.2em;
  top: 0.48em;
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
  background: var(--accent-2);
}

h2.wide {
  max-width: 52ch;
}

h3 {
  font-size: 16px;
  line-height: 1.4;
}

p {
  text-wrap: pretty;
}

.lede {
  color: var(--ink-2);
  font-size: 15px;
  max-width: 68ch;
  margin: 16px 0 0;
}

/* the text under a heading starts under the words of the heading */
section > .wrap > .lede,
section > .wrap > p,
.std > div > .lede,
.split > div > .lede,
.split > div > p {
  padding-left: calc(1.5 * clamp(20px, 2.4vw, 27px));
}

.split > div > p:not(.lede) {
  color: var(--ink-2);
}

section {
  position: relative;
  padding: clamp(56px, 8vw, 96px) 0 0;
}

/* a rule of box-drawing characters above each section, with its number */
section[data-n]::before {
  content: "── " attr(data-n) " " var(--rule-chars);
  display: block;
  width: calc(100% - 2 * var(--pad));
  max-width: calc(var(--max) - 2 * var(--pad));
  margin: 0 auto clamp(36px, 5vw, 56px);
  white-space: nowrap;
  overflow: hidden;
  color: var(--rule);
  font-size: 13px;
  line-height: 1;
}

/* ---------- hero ---------- */

.hero {
  padding-top: clamp(36px, 6vw, 72px);
}

.welcome {
  border-color: var(--accent-2);
  padding: clamp(26px, 4vw, 44px) clamp(18px, 3.4vw, 40px) clamp(22px, 3vw, 34px);
}

.welcome .eyebrow {
  position: absolute;
  top: -0.8em;
  left: 18px;
  margin: 0;
  padding: 0 8px;
  background: var(--bg);
  font-size: 13px;
  line-height: 1.5;
  color: var(--dim);
  white-space: nowrap;
}

.welcome .eyebrow .n {
  color: var(--accent);
  font-weight: 700;
}

.welcome .eyebrow .n::before {
  content: "✻ ";
}

.welcome .eyebrow .n::after {
  content: " ·";
  color: var(--faint);
  font-weight: 400;
}

.hero h1 .ok {
  color: var(--accent);
}

.hero-sub {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  margin-top: clamp(22px, 3vw, 34px);
  border-top: 1px solid var(--accent-bg);
}

.hero-sub > div:first-child {
  padding: 22px clamp(18px, 3vw, 34px) 4px 0;
}

.hero-sub .lede {
  margin: 0;
  font-size: 15px;
}

@media (max-width: 860px) {
  .hero-sub {
    grid-template-columns: minmax(0, 1fr);
  }
  .hero-sub > div:first-child {
    padding-right: 0;
  }
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 4px;
  font: 600 14px/1 var(--mono);
  text-decoration: none;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.btn:hover {
  border-color: var(--ink);
}

.btn.primary {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.btn.primary::before {
  content: "❯";
  color: var(--accent-2);
}

.btn.primary:hover {
  background: #000;
}

/* a session of an agent in the hero */

.term {
  border-left: 1px solid var(--accent-bg);
  font-size: 13px;
  line-height: 1.6;
  padding: 22px 0 4px clamp(18px, 3vw, 34px);
  min-width: 0;
  min-height: 330px;
}

@media (max-width: 860px) {
  .term {
    border-left: 0;
    border-top: 1px solid var(--accent-bg);
    padding-left: 0;
    min-height: 0;
  }
}

.term .ln {
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 1.6em;
  position: relative;
}

.term .tool {
  padding-left: 2ch;
  margin-top: 10px;
}

.term .tool:first-child {
  margin-top: 0;
}

.term .tool .bul {
  position: absolute;
  left: 0;
  top: 0.48em;
}

.term .tool b {
  font-weight: 700;
}

.term .out {
  padding-left: 5ch;
  color: var(--ink-2);
}

/* the elbow under a call: drawn, because few fonts have it */
.term .out.first::before {
  content: "";
  position: absolute;
  left: 2ch;
  top: 0.05em;
  width: 1.2ch;
  height: 0.75em;
  border-left: 1px solid var(--faint);
  border-bottom: 1px solid var(--faint);
}

.term .bul.ok,
.term .o {
  color: var(--ok);
}

.term .bul.err,
.term .e {
  color: var(--err);
}

.term .d {
  color: var(--dim);
}

.term .sp {
  color: var(--accent-2);
}

.term .spin {
  margin-top: 10px;
  color: var(--accent);
}

.term .spin .d {
  color: var(--faint);
}

/* the input box under the session */
.term .prompt {
  margin-top: 16px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 4px 0;
}

.term .prompt .ps {
  color: var(--dim);
}

.term .hint {
  font-size: 12px;
  color: var(--faint);
  padding: 2px 0 0 2ch;
}

.caret {
  display: inline-block;
  width: 0.6em;
  height: 1.15em;
  vertical-align: -0.22em;
  background: var(--ink);
  opacity: 0.75;
  animation: blink 1.05s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* stat strip */

.strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-top: clamp(40px, 6vw, 64px);
}

.strip > div {
  padding: 18px 0 16px 20px;
  border-right: 1px solid var(--line);
}

.strip > div:first-child {
  padding-left: 0;
}

.strip > div:last-child {
  border-right: 0;
}

.strip .v {
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  display: block;
}

.strip .k {
  font-size: 12px;
  color: var(--dim);
  display: block;
  margin-top: 6px;
}

.strip .v .arrow {
  color: var(--faint);
  font-weight: 400;
}

.strip .v .ok {
  color: var(--ok);
}

.strip .v .err {
  color: var(--err);
}

.strip.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 760px) {
  .strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .strip > div:nth-child(2) {
    border-right: 0;
  }
}

/* ---------- the compare editor ---------- */

.stage {
  margin-top: 36px;
  position: relative;
}

.under-tabs {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}

.tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  flex: 0 0 auto;
  appearance: none;
  border: 0;
  background: none;
  color: var(--dim);
  font: 13px/1 var(--mono);
  padding: 14px 14px 12px;
  min-height: 44px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-bottom: 2px solid transparent;
}

.tab:first-child {
  padding-left: 2px;
}

.tab:hover {
  color: var(--ink);
}

.tab[aria-selected="true"] {
  color: var(--ink);
  font-weight: 700;
  border-bottom-color: var(--accent-2);
}

.tab .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
}

.tab .dot.md {
  background: var(--blue);
}

.toggle {
  display: inline-flex;
  gap: 4px;
  margin-left: auto;
  padding-bottom: 4px;
}

.toggle button {
  appearance: none;
  border: 1px solid transparent;
  background: none;
  color: var(--dim);
  font: 12px/1 var(--mono);
  padding: 0 10px;
  min-height: 32px;
  border-radius: 4px;
  cursor: pointer;
}

.toggle button:hover {
  color: var(--ink);
  border-color: var(--line);
}

.toggle button.on {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

.pain-line {
  font-size: 13px;
  line-height: 1.5;
  color: var(--dim);
  margin: 14px 0 0;
  min-height: 1.5em;
}

.pain-line::before {
  content: "※ ";
  color: var(--accent-2);
}

.pain-line b {
  color: var(--ink);
}

.compare-wrap {
  position: relative;
  margin-top: 14px;
}

.compare {
  position: relative;
  display: grid;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.pane {
  grid-area: 1 / 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.pane.before {
  background: #fcf6f4;
}

.pane.after {
  background: #f6f9f3;
  clip-path: inset(0 0 0 var(--pos));
  -webkit-clip-path: inset(0 0 0 var(--pos));
}

.pane-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.4;
  color: var(--dim);
  white-space: nowrap;
}

.pane.after .pane-head {
  justify-content: flex-end;
}

.pane-head .count {
  font-weight: 700;
}

.pane.before .count {
  color: var(--err);
}

.pane.before .count::before {
  content: "✗ ";
}

.pane.after .count {
  color: var(--ok);
}

.pane.after .count::before {
  content: "✓ ";
}

.code {
  margin: 0;
  padding: 14px 0 20px;
  font-size: 13px;
  line-height: 1.7;
  counter-reset: ln;
  flex: 1;
  min-width: 0;
}

.code .l {
  display: block;
  padding: 0 18px 0 58px;
  position: relative;
  white-space: pre;
  min-height: 1.7em;
}

.code .l::before {
  counter-increment: ln;
  content: counter(ln);
  position: absolute;
  left: 0;
  width: 38px;
  text-align: right;
  color: var(--faint);
}

.code .l.has-err::after {
  content: "✗";
  position: absolute;
  left: 44px;
  top: 0;
  font-size: 11px;
  color: var(--err);
}

@media (max-width: 900px) {
  .code {
    font-size: 12px;
  }
  .code .l {
    white-space: pre-wrap;
    word-break: break-word;
    padding-left: 44px;
    padding-right: 12px;
  }
  .code .l::before {
    width: 28px;
  }
  .code .l.has-err::after {
    left: 32px;
  }
}

/* syntax */
.s-mk {
  color: var(--faint);
}
.s-doc {
  color: var(--ink-2);
}
.s-code {
  color: var(--blue);
}
.s-h {
  color: var(--ink);
  font-weight: 700;
}
.s-kw {
  color: var(--violet);
}
.s-ty {
  color: var(--amber);
}
.s-p {
  color: var(--dim);
}
.s-q {
  color: var(--dim);
}
.s-b {
  color: var(--ink);
  font-weight: 700;
}
.s-fence {
  color: var(--faint);
}
.pane.after .s-doc {
  color: var(--ink);
}

.x {
  text-decoration: underline wavy var(--err);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  text-decoration-skip-ink: none;
  background: var(--err-bg);
  border-radius: 2px;
  cursor: help;
  outline: none;
}

.x:hover,
.x:focus,
.x.hot {
  background: #f0c9cb;
}

/* the handle */

.handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos);
  width: 44px;
  margin-left: -22px;
  cursor: ew-resize;
  z-index: 5;
  display: flex;
  justify-content: center;
  touch-action: none;
  outline: none;
}

.handle::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: var(--accent-2);
}

.knob {
  position: absolute;
  top: 50%;
  width: 34px;
  height: 34px;
  margin-top: -17px;
  border-radius: 4px;
  background: var(--bg);
  border: 1px solid var(--accent-2);
  display: grid;
  place-items: center;
  transition: background 0.15s;
}

.handle:hover .knob,
.handle:focus-visible .knob,
.compare.dragging .knob {
  background: var(--accent-bg);
}

.knob svg {
  width: 16px;
  height: 16px;
  stroke: var(--accent);
}

/* below the editor */

.meta {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 20px;
  margin-top: 30px;
}

@media (max-width: 860px) {
  .meta {
    grid-template-columns: minmax(0, 1fr);
    gap: 30px;
  }
}

.box-head {
  margin-bottom: 6px;
}

.diags {
  list-style: none;
  margin: 0;
  padding: 4px 0 8px;
  max-height: 320px;
  overflow: auto;
  font-size: 12.5px;
  line-height: 1.5;
  scrollbar-width: thin;
  scrollbar-color: var(--rule) transparent;
}

.diags li {
  padding: 6px 16px;
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 10px;
  cursor: default;
  border-left: 2px solid transparent;
}

.diags li:hover,
.diags li.hot {
  background: var(--err-bg);
  border-left-color: var(--err);
}

.diags .pos {
  color: var(--faint);
}

.diags .rule {
  color: var(--err);
  font-weight: 700;
}

.diags .msg {
  color: var(--ink-2);
}

.diags .help {
  display: block;
  color: var(--dim);
}

.diags .help::before {
  content: "help: ";
  color: var(--faint);
}

.dict {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.dict td {
  padding: 8px 16px;
  border-bottom: 1px dashed var(--line);
  vertical-align: top;
  color: var(--ink-2);
}

.dict tr:last-child td {
  border-bottom: 0;
}

.dict td:first-child {
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  width: 1%;
}

.box-foot {
  padding: 10px 16px 12px;
  font-size: 12px;
  color: var(--dim);
  border-top: 1px solid var(--line);
  margin: 0;
}

/* tooltip */

.tip {
  position: fixed;
  z-index: 100;
  max-width: min(380px, calc(100vw - 24px));
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 8px 11px;
  font: 12px/1.5 var(--mono);
  color: var(--ink-2);
  box-shadow: 0 6px 20px rgba(60, 50, 30, 0.1);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.1s;
}

.tip.on {
  opacity: 1;
}

.tip .rule {
  color: var(--err);
  font-weight: 700;
}

.tip .help {
  color: var(--dim);
  display: block;
  margin-top: 4px;
}

/* ---------- single sentences ---------- */

.pains {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 30px 20px;
  margin-top: 44px;
}

@media (max-width: 1100px) {
  .pains {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .pains {
    grid-template-columns: minmax(0, 1fr);
  }
}

.pain {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 18px 18px;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.pain .tag {
  position: absolute;
  top: -0.78em;
  left: 12px;
  padding: 0 6px;
  background: var(--bg);
  font-size: 12px;
  line-height: 1.5;
  color: var(--err);
}

.pain h3 {
  margin: 0 0 14px;
  font-size: 14px;
}

/* the cards of the other ways to control the text of an agent */
.pain > p {
  margin: 0;
  font-size: 14px;
  color: var(--ink-2);
}

.alts .pain h3 {
  color: var(--ink);
}

.after-pains {
  margin-top: 36px;
}

/* the two texts as the lines of a diff */
.quote {
  position: relative;
  margin: 0;
  padding: 8px 12px 8px 2.4ch;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-2);
  background: var(--err-bg);
  border-radius: 3px;
}

.quote::before {
  content: "-";
  position: absolute;
  left: 0.8ch;
  color: var(--err);
}

.quote s {
  text-decoration: underline wavy var(--err);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  text-decoration-skip-ink: none;
  color: var(--err);
}

.quote.ok {
  background: var(--ok-bg);
  color: var(--ink);
  margin-top: auto;
}

.quote.ok::before {
  content: "+";
  color: var(--ok);
}

.case-diags {
  list-style: none;
  margin: 10px 0 14px;
  padding: 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--dim);
}

.case-diags li {
  padding: 1px 0 1px 2.4ch;
  position: relative;
}

.case-diags li::before {
  content: "✗";
  position: absolute;
  left: 0.7ch;
  color: var(--err);
}

.case-diags .rule {
  color: var(--err);
  font-weight: 700;
}

/* ---------- the rules ---------- */

.std {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 80px);
  align-items: start;
}

.std .facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.fact {
  padding: 18px 16px 18px 0;
  border-bottom: 1px solid var(--line);
}

.fact:nth-child(2n) {
  padding-left: 18px;
  border-left: 1px solid var(--line);
}

.fact .v {
  font-size: clamp(32px, 4vw, 46px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  display: block;
  color: var(--accent);
}

.fact .k {
  display: block;
  margin-top: 10px;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.5;
}

@media (max-width: 860px) {
  .std {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- two parts ---------- */

.duo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px minmax(0, 1fr);
  align-items: stretch;
  margin-top: 44px;
}

.part {
  padding: 24px 22px 14px;
}

.part.core {
  border-color: var(--ink-2);
}

.part .kind {
  position: absolute;
  top: -0.78em;
  left: 12px;
  padding: 0 6px;
  background: var(--bg);
  font-size: 12px;
  line-height: 1.5;
  color: var(--dim);
}

.part.core .kind {
  color: var(--ink);
}

.part h3 {
  font-size: 20px;
  margin: 0 0 12px;
}

.part.agent h3 {
  color: var(--accent);
}

.part ul {
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--ink-2);
  font-size: 14px;
}

.part li {
  padding: 9px 0 9px 2.4ch;
  border-top: 1px dashed var(--line);
  position: relative;
}

.part li::before {
  content: "-";
  position: absolute;
  left: 0.4ch;
  color: var(--faint);
}

.wire {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
  padding: 0 10px;
}

.wire .w {
  position: relative;
  height: 1px;
  background: var(--rule);
  overflow: visible;
}

.wire .w span {
  position: absolute;
  top: -3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.wire .w.to span {
  background: var(--ink);
  animation: run-r 2.4s cubic-bezier(0.6, 0, 0.4, 1) infinite;
}

.wire .w.back span {
  background: var(--accent-2);
  animation: run-l 2.4s cubic-bezier(0.6, 0, 0.4, 1) infinite 1.2s;
}

.wire .w label {
  position: absolute;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 11px;
  line-height: 1;
  color: var(--dim);
  top: -18px;
}

.wire .w.to label::after {
  content: " →";
}

.wire .w.back label::before {
  content: "← ";
}

.wire .w.back label {
  top: 10px;
}

@keyframes run-r {
  0% {
    left: 0;
    opacity: 0;
  }
  15%,
  85% {
    opacity: 1;
  }
  100% {
    left: calc(100% - 7px);
    opacity: 0;
  }
}

@keyframes run-l {
  0% {
    left: calc(100% - 7px);
    opacity: 0;
  }
  15%,
  85% {
    opacity: 1;
  }
  100% {
    left: 0;
    opacity: 0;
  }
}

@media (max-width: 860px) {
  .duo {
    grid-template-columns: minmax(0, 1fr);
  }
  .wire {
    flex-direction: row;
    height: 90px;
    justify-content: center;
    gap: 80px;
  }
  .wire .w {
    width: 1px;
    height: 100%;
  }
  .wire .w span {
    left: -3px !important;
  }
  .wire .w.to span {
    animation-name: run-d;
  }
  .wire .w.back span {
    animation-name: run-u;
  }
  .wire .w label {
    top: 50% !important;
    left: 12px;
    right: auto;
    white-space: nowrap;
  }
  .wire .w.to label {
    left: auto;
    right: 12px;
  }
  .wire .w.to label::after {
    content: " ↓";
  }
  .wire .w.back label::before {
    content: "↑ ";
  }
}

@keyframes run-d {
  0% {
    top: 0;
    opacity: 0;
  }
  15%,
  85% {
    opacity: 1;
  }
  100% {
    top: calc(100% - 7px);
    opacity: 0;
  }
}

@keyframes run-u {
  0% {
    top: calc(100% - 7px);
    opacity: 0;
  }
  15%,
  85% {
    opacity: 1;
  }
  100% {
    top: 0;
    opacity: 0;
  }
}

/* the loop, as a list of tasks */

.loop {
  margin-top: 34px;
  padding: 18px 20px 14px;
  display: grid;
  gap: 2px;
  font-size: 14px;
}

.loop > div {
  position: relative;
  display: grid;
  grid-template-columns: 2.4ch 13ch minmax(0, 1fr);
  color: var(--ink-2);
}

.loop > div::before {
  content: "☐";
  color: var(--faint);
}

.loop .s {
  color: var(--dim);
  font-size: 13px;
}

.loop > div.done {
  color: var(--faint);
  text-decoration: line-through;
  text-decoration-color: var(--faint);
}

.loop > div.done::before {
  content: "☒";
  color: var(--ok);
}

.loop > div.done .s {
  color: var(--faint);
}

.loop > div.lit {
  color: var(--ink);
  font-weight: 700;
}

.loop > div.lit::before {
  content: "◼";
  color: var(--accent-2);
}

.loop > div.lit .s {
  color: var(--accent);
}

@media (max-width: 560px) {
  .loop > div {
    grid-template-columns: 2.4ch minmax(0, 1fr);
  }
  .loop .s {
    grid-column: 2;
  }
  .loop > div > :not(.s) {
    grid-column: 2;
  }
}

/* ---------- dictionary section ---------- */

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 72px);
  align-items: start;
}

@media (max-width: 860px) {
  .split {
    grid-template-columns: minmax(0, 1fr);
  }
}

.file pre {
  margin: 0;
  padding: 12px 16px 14px;
  font-size: 12.5px;
  line-height: 1.7;
  overflow-x: auto;
  color: var(--ink-2);
  scrollbar-width: thin;
}

.file pre .c {
  color: var(--faint);
}

.file pre .k {
  color: var(--violet);
}

.file pre .s {
  color: var(--ok);
}

.file pre .h {
  color: var(--ink);
  font-weight: 700;
}

.file pre .e {
  color: var(--err);
}

.file pre .o {
  color: var(--ok);
}

.file pre .d {
  color: var(--dim);
}

.file pre .cy {
  color: var(--blue);
}

.file + .file {
  margin-top: 28px;
}

.textlink {
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
}

.textlink:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ---------- try ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 44px;
}

.step {
  padding: 24px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.step .num {
  position: absolute;
  top: -0.78em;
  left: 12px;
  padding: 0 6px;
  background: var(--bg);
  font-size: 12px;
  line-height: 1.5;
  font-weight: 700;
  color: var(--accent);
}

.step p {
  margin: 0;
  color: var(--ink-2);
  font-size: 14px;
}

/* a command in an input box: rules above and under it */
.cmd {
  margin-top: auto;
  position: relative;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  font-size: 12.5px;
  line-height: 1.7;
  padding: 9px 44px 9px 0;
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.cmd .ps {
  color: var(--dim);
  user-select: none;
}

.copy {
  position: absolute;
  right: 0;
  top: 50%;
  margin-top: -19px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.copy:hover {
  color: var(--ink);
  background: var(--bg-2);
}

.copy.done {
  color: var(--ok);
}

.copy svg {
  width: 15px;
  height: 15px;
}

@media (max-width: 860px) {
  .steps {
    grid-template-columns: minmax(0, 1fr);
    gap: 30px;
  }
}

.note {
  margin-top: 26px;
  padding: 0 0 0 2.4ch;
  position: relative;
  color: var(--dim);
  font-size: 14px;
}

.note::before {
  content: "※";
  position: absolute;
  left: 0;
  color: var(--accent-2);
}

.note p {
  margin: 0;
}

.note p + p {
  margin-top: 6px;
}

/* ---------- footer: a status line ---------- */

footer {
  margin-top: clamp(80px, 12vw, 140px);
  padding: 0 0 48px;
  font-size: 12px;
  color: var(--dim);
}

footer::before {
  content: var(--rule-chars);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  color: var(--rule);
  font-size: 13px;
  line-height: 1;
  margin-bottom: 14px;
}

footer .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 24px;
  align-items: start;
}

footer p {
  margin: 0;
  max-width: 80ch;
}

footer .pass {
  color: var(--ok);
  white-space: nowrap;
}

@media (max-width: 640px) {
  footer .wrap {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- page: how ---------- */

.page-hero {
  padding-top: clamp(40px, 7vw, 80px);
}

.page-hero h1 {
  font-size: clamp(30px, 5vw, 56px);
}

.page-hero h1::before {
  content: "❯ ";
  color: var(--accent-2);
}

section.page-hero > .wrap > .lede {
  padding-left: 0;
}

.page-hero .file {
  margin-top: 44px;
}

.pipeline {
  margin-top: 44px;
  position: relative;
}

.pstep {
  position: relative;
  padding: 0 0 44px 34px;
  display: grid;
  align-items: start;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  gap: 16px 36px;
}

/* the line from one step to the next */
.pstep::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 1.35em;
  bottom: 0.2em;
  width: 1px;
  background: var(--line);
}

.pstep:last-child {
  padding-bottom: 0;
}

.pstep:last-child::after {
  display: none;
}

.pstep::before {
  content: "";
  position: absolute;
  left: 1px;
  top: 0.32em;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--faint);
}

.pstep.done::before {
  background: var(--ok);
}

.pstep.fail::before {
  background: var(--err);
}

.pstep .no {
  font-size: 12px;
  color: var(--dim);
}

.pstep h3 {
  margin: 6px 0 8px;
  font-size: 18px;
}

.pstep .side p + p {
  margin-top: 10px;
}

.pstep .side p {
  margin: 0;
  color: var(--ink-2);
  font-size: 14px;
}

.viz {
  padding: 16px 18px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-2);
  overflow-x: auto;
}

.viz .row {
  white-space: pre;
}

.viz .faint {
  color: var(--faint);
}

.viz .cy {
  color: var(--blue);
}

.viz .ok {
  color: var(--ok);
}

.viz .err {
  color: var(--err);
  font-weight: 700;
}

.viz.report .row {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.viz .e {
  color: var(--err);
  font-weight: 700;
}

.viz .c {
  color: var(--faint);
}

.viz .lbl {
  font-size: 12px;
  color: var(--dim);
  display: block;
  margin: 14px 0 8px;
}

.viz .lbl::before {
  content: "── ";
  color: var(--rule);
}

.viz .lbl:first-child {
  margin-top: 0;
}

.toks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tok {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 6px 8px 5px;
  font-size: 13px;
  line-height: 1;
  color: var(--ink);
  background: var(--bg);
}

.tok small {
  font-size: 10px;
  color: var(--dim);
}

.tok.cd {
  color: var(--blue);
}

.tok.bad {
  border-color: #e3b4b8;
  background: var(--err-bg);
}

.tok.bad small {
  color: var(--err);
}

.tok.good {
  border-color: #b9d4b6;
  background: var(--ok-bg);
}

.tok.good small {
  color: var(--ok);
}

@media (max-width: 860px) {
  .pstep {
    grid-template-columns: minmax(0, 1fr);
    padding-left: 28px;
  }
}

/* reveal on scroll */

.rv {
  opacity: 0;
  transition: opacity 0.5s ease-out;
}

.rv.in {
  opacity: 1;
}

.no-js .rv {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .rv {
    opacity: 1;
    transition: none;
  }
  .wire .w span,
  .caret {
    animation: none;
  }
  html {
    scroll-behavior: auto;
  }
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- why ---------- */

.why {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
  margin-top: 44px;
}

.values {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.value {
  padding: 20px 20px 22px 0;
  border-bottom: 1px solid var(--line);
}

.value:nth-child(2n) {
  padding-left: 20px;
  border-left: 1px solid var(--line);
}

.value h3 {
  font-size: 15px;
  padding-left: 2.2ch;
  position: relative;
}

.value h3::before {
  content: "❯";
  position: absolute;
  left: 0;
  color: var(--accent-2);
}

.value p {
  margin: 8px 0 0;
  padding-left: 2.2ch;
  color: var(--ink-2);
  font-size: 14px;
}

.analogy {
  margin-top: 8px;
}

.analogy table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin: 6px 0 4px;
}

.analogy th {
  text-align: left;
  font-weight: 400;
  color: var(--dim);
  padding: 6px 16px;
  border-bottom: 1px solid var(--line);
}

.analogy td {
  padding: 8px 16px;
  border-bottom: 1px dashed var(--line);
  color: var(--ink-2);
  vertical-align: top;
}

.analogy tr:last-child td {
  border-bottom: 0;
}

.analogy td:last-child {
  color: var(--accent);
  font-weight: 700;
}

@media (max-width: 960px) {
  .why {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .values {
    grid-template-columns: minmax(0, 1fr);
  }
  .value:nth-child(2n) {
    padding-left: 0;
    border-left: 0;
  }
}

/* ---------- layered dictionaries ---------- */

.layers {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: clamp(28px, 4vw, 48px);
  align-items: start;
  margin: 44px 0 20px;
}

@media (max-width: 960px) {
  .layers {
    grid-template-columns: minmax(0, 1fr);
  }
}

.layer-files {
  font-size: 13px;
  line-height: 1.7;
  min-width: 0;
}

.tree-root {
  font-weight: 700;
}

.tree-name {
  display: flex;
  gap: 1ch;
  align-items: baseline;
  flex-wrap: wrap;
  font-weight: 700;
}

.tree-name .scope {
  margin-left: auto;
  font-weight: 400;
  color: var(--blue);
  font-size: 12px;
}

.tree-terms {
  display: grid;
  grid-template-columns: 4ch minmax(0, 1fr);
  color: var(--ink-2);
  padding-bottom: 10px;
}

.tree-terms i {
  font-style: normal;
  color: var(--faint);
}

/* a term of two words stays on one line */
.tree-terms .t {
  white-space: nowrap;
}

.tree-terms b {
  color: var(--accent);
}

.layer-files .br {
  color: var(--faint);
  font-weight: 400;
}

.layer-runs .file pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.file pre .ps {
  color: var(--dim);
  user-select: none;
}

.file pre b {
  color: var(--accent);
}

/* ---------- the files of the project in the editor ---------- */

.pr {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.files {
  font-size: 13px;
  line-height: 1.6;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 0 10px;
  position: sticky;
  top: 72px;
}

.ft-root,
.ft-dir {
  display: flex;
  align-items: center;
  min-height: 30px;
  padding: 0 14px;
  white-space: pre;
  color: var(--ink-2);
}

.ft-root {
  font-weight: 700;
  color: var(--ink);
}

.files .br {
  color: var(--faint);
}

.ft-file {
  appearance: none;
  display: flex;
  align-items: baseline;
  width: 100%;
  border: 0;
  border-left: 2px solid transparent;
  background: none;
  padding: 0 12px;
  align-items: center;
  font: inherit;
  color: var(--ink-2);
  text-align: left;
  white-space: pre;
  cursor: pointer;
  min-height: 30px;
}

.ft-file:hover {
  background: var(--bg-2);
  color: var(--ink);
}

.ft-file[aria-selected="true"] {
  background: var(--accent-bg);
  border-left-color: var(--accent-2);
  color: var(--ink);
  font-weight: 700;
}

.ft-file .nm {
  overflow: hidden;
  text-overflow: ellipsis;
}

.ft-n {
  margin-left: auto;
  padding-left: 10px;
  font-size: 11px;
  font-weight: 400;
}

.ft-n .e {
  color: var(--err);
}

.ft-n .ar {
  color: var(--faint);
  padding: 0 0.5ch;
}

.ft-n .o {
  color: var(--ok);
}

.file-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  min-height: 40px;
}

.file-path {
  font-weight: 700;
  font-size: 14px;
}

.file-bar .toggle {
  padding-bottom: 0;
}

.pr-main .pain-line {
  margin-top: 8px;
}

.dict-scroll {
  max-height: 340px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--rule) transparent;
}

.dict .dict-src td {
  position: sticky;
  top: 0;
  font-weight: 700;
  color: var(--ink);
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
}

.dict .dict-src span {
  float: right;
  font-weight: 400;
  color: var(--blue);
  font-size: 12px;
}

@media (max-width: 900px) {
  .pr {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
  .files {
    position: static;
  }
}

/* the line under the buttons of the hero */
.proof {
  margin: 16px 0 0;
  font-size: 12px;
  color: var(--ok);
}

.proof::before {
  content: "✓ ";
}

.hero-sub .lede + .lede {
  margin-top: 12px;
}

/* the two ways to install */
.step .cmd {
  margin-top: 4px;
}

.step-list {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  font-size: 13px;
  color: var(--ink-2);
}

.step-list li {
  position: relative;
  padding: 7px 0 7px 2.4ch;
  border-top: 1px dashed var(--line);
}

.step-list li:first-child {
  border-top: 0;
}

.step-list li::before {
  content: "-";
  position: absolute;
  left: 0.4ch;
  color: var(--faint);
}

.note .cmd {
  margin: 10px 0 14px;
  max-width: 640px;
}

/* four steps: two in a row */
#try .steps {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 860px) {
  #try .steps {
    grid-template-columns: minmax(0, 1fr);
  }
}
