/* moonskill — a curriculum vitae, screened.
 *
 * A skill is a résumé and the client reading it is the one hiring. The page is
 * therefore an object: a sheet of paper on a desk, ruled and annotated. Type
 * carries the rest — a soft serif for the voice, a monospace for what a
 * machine reads, a hand for the reviewer's pen.
 */

/* HarmonyOS Sans SC, Latin subset, self-hosted so the page looks the same
   everywhere. The full family covers Chinese; this sheet is English. */
@font-face {
  font-family: "HarmonyOS Sans SC";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/harmonyos-sans-sc-regular.woff") format("woff");
}

@font-face {
  font-family: "HarmonyOS Sans SC";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/harmonyos-sans-sc-bold.woff") format("woff");
}

:root {
  --desk: #e3dbcb;
  --paper: #fbf7ee;
  --paper-shade: #f0e9d9;
  --ink: #191610;
  --ink-soft: #4b4437;
  --muted: #6e6555;
  --rule: #cfc5b1;
  --rule-soft: #e3dac7;
  --accent: #ad3a25;
  --accent-wash: #f2e0d7;
  --paper-edge: rgba(255, 255, 255, 0.65);
  --desk-light: rgba(255, 255, 255, 0.5);
  --desk-shade: rgba(96, 74, 44, 0.1);
  --display: "HarmonyOS Sans SC", "HarmonyOS Sans", ui-sans-serif, system-ui,
    "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --text: "HarmonyOS Sans SC", "HarmonyOS Sans", ui-sans-serif, system-ui,
    "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --pen: "Caveat", ui-rounded, "Segoe Print", cursive;
  --sheet: 1000px;
  color-scheme: light;
}

:root[data-theme="ink"] {
  --desk: #0c0b08;
  --paper: #17140f;
  --paper-shade: #1e1a14;
  --ink: #efe9dc;
  --ink-soft: #c9c1af;
  --muted: #948b78;
  --rule: #3a342a;
  --rule-soft: #2a251d;
  --accent: #d96a50;
  --accent-wash: #2c1c16;
  --paper-edge: rgba(255, 255, 255, 0.05);
  --desk-light: rgba(255, 255, 255, 0.04);
  --desk-shade: rgba(0, 0, 0, 0.55);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="paper"]) {
    --desk: #0c0b08;
    --paper: #17140f;
    --paper-shade: #1e1a14;
    --ink: #efe9dc;
    --ink-soft: #c9c1af;
    --muted: #948b78;
    --rule: #3a342a;
    --rule-soft: #2a251d;
    --accent: #d96a50;
    --accent-wash: #2c1c16;
    --paper-edge: rgba(255, 255, 255, 0.05);
    --desk-light: rgba(255, 255, 255, 0.04);
    --desk-shade: rgba(0, 0, 0, 0.55);
    color-scheme: dark;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 30px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}

body {
  margin: 0;
  padding-top: 46px;
  background-color: var(--desk);
  background-image:
    radial-gradient(150% 110% at 50% -25%, var(--desk-light), transparent 58%),
    radial-gradient(100% 70% at 50% 112%, var(--desk-shade), transparent 58%);
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--text);
  font-size: 17px;
  line-height: 1.6;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  transition: border-color 140ms linear, color 140ms linear;
}

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

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

code,
pre,
textarea,
.mono {
  font-family: var(--mono);
  font-variant-ligatures: no-contextual;
}

:not(pre) > code {
  font-size: 0.86em;
  padding: 0.06em 0.28em;
  background: var(--paper-shade);
  border-radius: 2px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  overflow-wrap: anywhere;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- the tab for the keyboard ---------- */

.skip {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 60;
  padding: 8px 14px 7px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--accent);
  border-radius: 3px;
  box-shadow: 3px 3px 0 0 var(--paper-shade);
  transform: translateY(-220%);
  transition: transform 160ms ease-out;
}

.skip:focus-visible {
  outline: none;
  border-width: 2px;
  padding: 7px 13px 6px;
  transform: none;
}

/* ---------- the sheet ---------- */

.sheet {
  position: relative;
  /* the desk keeps a margin even when the window is narrow: a sheet that runs
     edge to edge stops being a sheet */
  max-width: min(var(--sheet), calc(100vw - 72px));
  margin: 0 auto 72px;
  padding: 0 66px 58px;
  background-color: var(--paper);
  border: 1px solid var(--rule);
  box-shadow:
    inset 0 1px 0 var(--paper-edge),
    9px 9px 0 0 var(--paper-shade),
    10px 10px 0 0 var(--rule);
}

/* the skip link lands here; the sheet is a place, not a control */
.sheet:focus {
  outline: none;
}

/* the clip that holds the sheet to whatever it is lying on */
.clip {
  position: absolute;
  top: -5px;
  right: 118px;
  width: 30px;
  height: 16px;
  transform: rotate(-3deg);
  color: var(--muted);
  pointer-events: none;
}

/* ---------- file tabs ---------- */

/* Tabs grow out of the sheet's top-left corner and end on its top edge, the
   way a folder's tabs do: flush with the paper's left border, the current one
   the same paper as the sheet so the edge runs through it. */
.tabs {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: flex-end;
  gap: 0;
  /* one pixel further than the padding, so the tab's border lands on the
     sheet's own border instead of beside it */
  margin: -26px 0 0 -67px;
  padding: 0;
}

.tab + .tab {
  /* the tabs sit side by side and share their borders */
  margin-left: -1px;
}

.tab {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 18px;
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--paper-shade);
  border: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  border-radius: 4px 4px 0 0;
  white-space: nowrap;
  transition: color 140ms linear, background-color 140ms linear;
}

.tab:hover {
  color: var(--ink);
  background: var(--paper);
  border-color: var(--rule);
}

.tab:first-child {
  /* the first tab is the sheet's corner, not a box beside it */
  border-top-left-radius: 0;
}

.tab[aria-current="page"] {
  color: var(--ink);
  background: var(--paper);
  border-color: var(--rule);
  border-bottom-color: var(--paper);
}

/* ---------- the document header ---------- */

.docline {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 16px 0 9px;
  border-bottom: 1px solid var(--ink);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.docline .ref {
  color: var(--ink);
}

.docline .right {
  margin-left: auto;
  display: flex;
  align-items: baseline;
  gap: 16px;
}

.theme {
  font: inherit;
  letter-spacing: 0.18em;
  text-transform: inherit;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 2px;
  color: var(--muted);
  padding: 3px 7px;
  cursor: pointer;
}

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

.theme:active,
.chip:active {
  transform: translateY(1px);
}

.masthead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 448px;
  column-gap: 56px;
  row-gap: 22px;
  padding: 30px 0 0;
  align-items: start;
}

.masthead h1 {
  grid-column: 1 / -1;
}

.masthead .role {
  grid-column: 1;
  margin-top: 0;
  max-width: 40ch;
  text-wrap: balance;
}

.masthead .fields {
  grid-column: 2;
  margin-top: 0;
}

h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(42px, 7.6vw, 104px);
  line-height: 0.95;
  letter-spacing: -0.032em;
  font-weight: 700;
  text-wrap: balance;
}

h1 .tld {
  color: var(--muted);
  font-weight: 300;
}

.role {
  margin: 18px 0 0;
  max-width: 33ch;
  font-size: clamp(18px, 1.9vw, 22px);
  line-height: 1.45;
  font-weight: 400;
  letter-spacing: -0.004em;
  color: var(--ink-soft);
}

.masthead--sub {
  grid-template-columns: minmax(0, 1fr);
  padding-top: 26px;
}

.masthead--sub h1 {
  font-size: clamp(32px, 5vw, 62px);
  letter-spacing: -0.028em;
}

.masthead--sub .role {
  max-width: 48ch;
}

/* ---------- ruled fields, the way a form asks ---------- */

.fields {
  margin: 30px 0 0;
  max-width: 448px;
  padding: 0;
  display: grid;
  gap: 4px;
  border-top: 1px solid var(--ink);
  padding-top: 12px;
}

.field {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.field dt {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.field .dots {
  flex: 1 1 auto;
  min-width: 12px;
  border-bottom: 2px dotted var(--rule);
  transform: translateY(-3px);
}

.field dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink);
  text-align: right;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.field dd a {
  border: 0;
}

/* ---------- sections ---------- */

.section {
  margin-top: 64px;
  scroll-margin-top: 26px;
}

.sec {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 13px;
  padding-top: 9px;
  border-top: 1px solid var(--ink);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.sec .n {
  color: var(--accent);
  letter-spacing: 0.1em;
}

.sec .t {
  color: var(--ink);
}

.sec .of {
  margin-left: auto;
  color: var(--muted);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  font-variant-numeric: tabular-nums;
}

.lede {
  margin: 20px 0 0;
  font-size: 20px;
  line-height: 1.5;
  max-width: 42ch;
  letter-spacing: -0.006em;
  color: var(--ink-soft);
}

.section p {
  margin: 16px 0 0;
  max-width: 62ch;
  text-wrap: pretty;
}

.section p:first-child {
  margin-top: 0;
}

.section strong {
  font-weight: 600;
}

/* a CV entry: what on the left, what happened on the right */
.entry {
  display: grid;
  grid-template-columns: 186px minmax(0, 1fr);
  gap: 36px;
  padding: 18px 0 20px;
  border-bottom: 1px solid var(--rule-soft);
}

.entry:first-of-type {
  border-top: 1px solid var(--rule-soft);
}

.entry .meta {
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.7;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.entry .meta b {
  display: block;
  color: var(--ink);
  font-weight: 400;
  font-size: 11px;
}

.entry h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.012em;
  line-height: 1.25;
  text-wrap: balance;
}

.entry p {
  margin: 7px 0 0;
  max-width: 56ch;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.55;
  text-wrap: pretty;
}

/* ---------- the reviewer's pen ---------- */

.pen {
  font-family: var(--pen);
  font-size: 22px;
  line-height: 1.25;
  color: var(--accent);
  transform: rotate(-1.6deg);
  transform-origin: left center;
  display: inline-flex;
  align-items: flex-start;
  gap: 6px;
  margin: 14px 0 0;
  opacity: 0.9;
}

.pen svg {
  width: 46px;
  height: 26px;
  flex: 0 0 auto;
  margin-top: -6px;
  overflow: visible;
}

/* ---------- tiers, indented by depth ---------- */

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

.tiers li {
  position: relative;
  padding: 15px 0 15px calc(var(--depth) * 34px + 34px);
  border-bottom: 1px solid var(--rule-soft);
}

.tiers li::before {
  content: "";
  position: absolute;
  left: calc(var(--depth) * 34px + 12px);
  top: 26px;
  width: 12px;
  height: 1px;
  background: var(--accent);
}

.tiers .label {
  display: block;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.tiers .what {
  display: block;
  margin-top: 6px;
  font-size: 17px;
  line-height: 1.5;
}

.tiers .how {
  display: block;
  margin-top: 5px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

/* ---------- the screening form ---------- */

.form {
  margin: 20px 0 0;
  border: 1px solid var(--ink);
  background: var(--paper);
  position: relative;
}

.form-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  padding: 7px 12px;
  border-bottom: 1px solid var(--ink);
  background: var(--paper-shade);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.form-head .state {
  margin-left: auto;
  color: var(--accent);
}

.form-head .state[data-clean="true"] {
  color: var(--ink-soft);
}

.form-head .root-label {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}

.form-head input.root {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--ink-soft);
  padding: 1px 3px;
  width: 13ch;
}

.form-head input.root:focus {
  outline: none;
  border-bottom-color: var(--accent);
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, 1fr);
}

.form-grid > .pane {
  min-width: 0;
  position: relative;
}

.form-grid > .pane + .pane {
  border-left: 1px solid var(--rule);
}

.pane-doc::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--accent);
  opacity: 0.4;
  pointer-events: none;
}

.form textarea {
  display: block;
  width: 100%;
  height: 272px;
  padding: 12px 16px 12px 26px;
  border: 0;
  resize: vertical;
  background-color: var(--paper);
  background-image: repeating-linear-gradient(
    to bottom,
    var(--paper) 0 23px,
    var(--rule-soft) 23px 24px
  );
  background-attachment: local;
  color: var(--ink);
  font-size: 13px;
  line-height: 24px;
  tab-size: 2;
}

.form textarea:focus {
  outline: none;
}

/* the browser's resize grip is a bright square in the dark theme */
.form textarea::-webkit-resizer {
  background: transparent;
}

.verdicts {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 272px;
  overflow-y: auto;
}

.verdicts li {
  padding: 8px 16px 9px 26px;
  border-bottom: 1px solid var(--rule-soft);
  position: relative;
}

.verdicts li::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 15px;
  width: 6px;
  height: 6px;
  background: var(--accent);
}

.verdicts li:last-child {
  border-bottom: 0;
}

.verdicts .kind {
  display: block;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--accent);
}

.verdicts .message {
  display: block;
  margin-top: 3px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink-soft);
}

.verdicts .empty {
  padding: 26px 20px 26px 26px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
}

.verdicts .empty::before {
  display: none;
}

.form-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 12px;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.chip {
  font: inherit;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 2px;
  color: var(--muted);
  padding: 4px 8px;
  cursor: pointer;
}

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

.chip[aria-pressed="true"] {
  color: var(--accent);
  border-color: var(--accent);
}

/* ---------- figures as form lines ---------- */

.figures {
  margin: 30px 0 0;
  padding: 0;
  display: grid;
  gap: 0;
  border-top: 1px solid var(--rule-soft);
  padding-top: 8px;
}

.figure {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 0;
}

.figure dt {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.figure .dots {
  flex: 1;
  border-bottom: 2px dotted var(--rule);
  transform: translateY(-5px);
}

.figure dd {
  margin: 0;
  font-family: var(--display);
  font-size: 28px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--ink);
  min-width: 2ch;
  text-align: right;
}

/* ---------- references ---------- */

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

.refs li {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule-soft);
}

.refs .who {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink);
  border-bottom: 1px solid var(--rule);
  flex: 0 0 auto;
}

.refs .what {
  color: var(--muted);
  font-size: 14.5px;
  min-width: 0;
}

/* ---------- code listings ---------- */

.code {
  margin: 16px 0 0;
  border: 1px solid var(--rule);
  background: var(--paper-shade);
  overflow: hidden;
}

.code-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 11px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.code-head .copy {
  margin-left: auto;
  font: inherit;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  padding: 2px 0;
}

.code-head .copy:hover {
  color: var(--accent);
}

.code-head .copy.is-done {
  color: var(--accent);
}

pre {
  margin: 0;
  padding: 14px 15px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink);
  tab-size: 2;
}

.out {
  padding: 10px 15px;
  border-top: 1px solid var(--rule);
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre;
}

/* ---------- tables ---------- */

table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 0;
  font-size: 15px;
}

th {
  text-align: left;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 400;
  padding: 0 14px 7px 0;
  border-bottom: 1px solid var(--ink);
}

td {
  padding: 10px 14px 10px 0;
  border-bottom: 1px solid var(--rule-soft);
  vertical-align: top;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}

td code {
  background: none;
  border: 0;
  padding: 0;
  font-size: 11.5px;
  color: var(--ink);
}

/* ---------- the index, which is also the scrollbar ---------- */

.index {
  position: fixed;
  top: 50%;
  right: 20px;
  transform: translateY(-50%);
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: flex-end;
}

.index a {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
  border: 0;
  padding: 3px 0;
  opacity: 0.62;
  transition: opacity 160ms linear, color 160ms linear,
    transform 160ms ease-out;
}

.index a .mark {
  width: 18px;
  height: 1px;
  background: currentColor;
  transition: width 160ms ease;
}

.index a:hover {
  opacity: 1;
  color: var(--ink);
  transform: translateX(-3px);
}

.index a[aria-current="true"] {
  opacity: 1;
  color: var(--ink);
}

.index a[aria-current="true"] .mark {
  width: 34px;
  background: var(--accent);
}

/* ---------- footer ---------- */

.foot {
  margin-top: 52px;
  padding-top: 14px;
  border-top: 1px solid var(--ink);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: end;
}

.signature {
  font-family: var(--pen);
  font-size: 27px;
  line-height: 1;
  color: var(--ink);
  transform: rotate(-2deg);
  transform-origin: left bottom;
}

.foot .small {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: right;
  line-height: 1.8;
}

.foot .small a {
  border-bottom: 1px solid transparent;
}

.foot .small a:hover {
  border-bottom-color: var(--accent);
}

/* ---------- api reference ---------- */

.api-list {
  border-top: 1px solid var(--rule-soft);
  margin-top: 6px;
}

.api-group {
  margin: 26px 0 0;
  padding-top: 6px;
  border-top: 1px solid var(--rule-soft);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 400;
}

.api-item,
.api-type {
  padding: 12px 0 14px;
  border-bottom: 1px solid var(--rule-soft);
}

.api-type {
  border-bottom: 0;
  padding-top: 22px;
}

.api-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.api-name {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink);
  background: none;
  border: 0;
  padding: 0;
  overflow-wrap: anywhere;
}

.api-kind {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.api-sig {
  margin: 5px 0 0;
  padding: 0;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--ink-soft);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  overflow: visible;
}

.api-doc {
  margin-top: 8px;
  max-width: 68ch;
  font-size: 14.5px;
  line-height: 1.58;
  color: var(--ink-soft);
}

.api-doc p {
  margin: 5px 0 0;
}

.api-methods {
  padding-left: 16px;
  border-left: 1px solid var(--rule);
  border-top: 0;
}

.api-methods .api-item:last-child {
  border-bottom: 0;
}

.api-members {
  margin-top: 8px;
  font-size: 12.5px;
}

.api-members th {
  padding-bottom: 4px;
  border-bottom: 1px solid var(--rule-soft);
}

.api-members td {
  padding: 6px 12px 6px 0;
  line-height: 1.45;
}

.api-members td:nth-child(2) {
  font-family: var(--mono);
  font-size: 11px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.api-impl {
  margin: 7px 0 0;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
}

.api-impl code {
  font-size: 10px;
  background: none;
  border: 0;
  padding: 0;
}

/* ---------- the corpus, as a list of files ---------- */

.corpus {
  margin: 16px 0 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 44px;
}

.case {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 7px 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--rule-soft);
  font: inherit;
  text-align: left;
  cursor: pointer;
  color: var(--ink);
  min-width: 0;
}

.case:hover {
  color: var(--accent);
}

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

.case .dir {
  font-family: var(--mono);
  font-size: 12px;
  min-width: 0;
  flex: 0 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.case .tag {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: var(--accent);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
}

.case .tag::before {
  content: "\00b7";
  margin-right: 6px;
  color: var(--rule);
}

.case .tag[data-clean="true"] {
  color: var(--muted);
}

/* ---------- scrollbars: ours ---------- */

@supports selector(::-webkit-scrollbar) {
  html::-webkit-scrollbar {
    width: 12px;
    height: 12px;
  }

  html::-webkit-scrollbar-track {
    background: transparent;
  }

  html::-webkit-scrollbar-button,
  .form textarea::-webkit-scrollbar-button,
  .verdicts::-webkit-scrollbar-button,
  .code::-webkit-scrollbar-button {
    display: none;
    width: 0;
    height: 0;
    background: transparent;
  }

  html::-webkit-scrollbar-corner,
  .code ::-webkit-scrollbar-corner,
  .code::-webkit-scrollbar-corner,
  .verdicts::-webkit-scrollbar-corner,
  textarea::-webkit-scrollbar-corner {
    background: transparent;
  }

  html::-webkit-scrollbar-thumb {
    background: transparent;
    border: 4px solid transparent;
    background-clip: content-box;
    border-radius: 99px;
  }

  .code ::-webkit-scrollbar,
  .code::-webkit-scrollbar,
  .verdicts::-webkit-scrollbar,
  textarea::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }

  .code ::-webkit-scrollbar-track,
  .code::-webkit-scrollbar-track,
  .verdicts::-webkit-scrollbar-track,
  textarea::-webkit-scrollbar-track {
    background: transparent;
  }

  .code ::-webkit-scrollbar-thumb,
  .code::-webkit-scrollbar-thumb,
  .verdicts::-webkit-scrollbar-thumb,
  textarea::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--ink) 12%, transparent);
    border-radius: 99px;
  }

  .code:hover::-webkit-scrollbar-thumb,
  .verdicts:hover::-webkit-scrollbar-thumb,
  textarea:hover::-webkit-scrollbar-thumb,
  .code ::-webkit-scrollbar-thumb:hover {
    background: color-mix(in srgb, var(--ink) 32%, transparent);
  }
}

@supports not selector(::-webkit-scrollbar) {
  html {
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
  }

  .code,
  .verdicts,
  textarea {
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--ink) 18%, transparent) transparent;
  }
}

/* ---------- back to the top ---------- */

/* A tab lying on the desk rather than on the sheet: it appears once the reader
   is deep enough that the header is out of reach. */
.totop {
  position: fixed;
  z-index: 40;
  right: 22px;
  bottom: 22px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px 7px;
  font-family: var(--mono);
  font-size: 9.5px;
  line-height: 1;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 3px;
  box-shadow: 3px 3px 0 0 var(--paper-shade);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 180ms linear, transform 200ms ease-out,
    visibility 0s linear 200ms;
}

.totop.is-on {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}

.totop:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.totop .arrow {
  font-size: 12px;
  letter-spacing: 0;
  line-height: 0.8;
}

@media (prefers-reduced-motion: reduce) {
  .totop {
    transition: none;
    transform: none;
  }
}

@media print {
  .totop {
    display: none;
  }
}

/* ---------- narrow ---------- */

@media (width <= 1280px) {
  .index {
    display: none;
  }
}

@media (width <= 860px) {
  body {
    padding-top: 32px;
    font-size: 16px;
    background-image: none;
  }

  .sheet {
    max-width: none;
    margin: 0 0 40px;
    padding: 0 24px 40px;
    border-left: 0;
    border-right: 0;
    box-shadow: none;
  }

  .clip {
    display: none;
  }

  .tabs {
    margin: -24px 0 0 -24px;
    gap: 3px;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .tab {
    height: 24px;
    padding: 0 12px;
    font-size: 8.5px;
    letter-spacing: 0.1em;
    white-space: nowrap;
  }

  .masthead {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

  .masthead h1,
  .masthead .role,
  .masthead .fields {
    grid-column: 1;
  }

  .entry {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .entry .meta {
    font-size: 10px;
  }

  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .form-grid > .pane + .pane {
    border-left: 0;
    border-top: 1px solid var(--rule);
  }

  .verdicts {
    max-height: 240px;
  }

  .tiers li {
    padding-left: calc(var(--depth) * 18px + 22px);
  }

  .tiers li::before {
    left: calc(var(--depth) * 18px + 4px);
    width: 9px;
  }

  .corpus {
    grid-template-columns: minmax(0, 1fr);
  }

  .foot {
    grid-template-columns: minmax(0, 1fr);
  }

  .foot .small {
    text-align: left;
  }

  .totop {
    right: 10px;
    bottom: 10px;
    padding: 7px 9px 6px;
    font-size: 11px;
    gap: 0;
  }

  .totop .label {
    display: none;
  }
}

@media (width <= 620px) {
  .docline {
    font-size: 9.5px;
    letter-spacing: 0.12em;
    gap: 10px;
    flex-wrap: wrap;
  }

  .docline > span:nth-child(3) {
    display: none;
  }

  /* the source link is repeated in the footer; here it only forces a wrap */
  .docline .right > a {
    display: none;
  }

  .docline .right {
    gap: 10px;
  }
}

@media (width <= 380px) {
  /* below this the file line cannot hold the page's name and its code */
  .docline > span:nth-child(2) {
    display: none;
  }
}

@media print {
  /* ink on white whatever the screen was set to: a dark theme printed to a
     dark page is a page nobody can read. */
  :root,
  :root[data-theme="ink"] {
    --desk: #fff;
    --paper: #fff;
    --paper-shade: #f2f2f2;
    --ink: #000;
    --ink-soft: #2c2c2c;
    --muted: #5a5a5a;
    --rule: #b9b9b9;
    --rule-soft: #dcdcdc;
    --accent: #a3301c;
    --accent-wash: #f0e4df;
    --paper-edge: transparent;
  }

  /* the printed page is narrower than any screen this was laid out for */
  .masthead {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 14px;
  }

  .masthead h1,
  .masthead .role,
  .masthead .fields {
    grid-column: 1;
  }

  .entry,
  .code,
  .tiers li,
  .figure {
    break-inside: avoid;
  }

  .tabs,
  .index,
  .clip,
  .form-foot,
  .code-head .copy,
  .totop,
  .skip,
  .theme {
    display: none;
  }

  body {
    padding: 0;
    background: #fff;
    color: #000;
    font-size: 10.5pt;
    line-height: 1.5;
    background-image: none;
  }

  .sheet {
    max-width: none;
    margin: 0;
    padding: 0 10mm;
    border: 0;
    box-shadow: none;
  }
}
