/* ------------------------------------------------------------------------
   PasteDaemon Help.

   The same objects as the landing page: cream clipboard plates on a warm
   near-black field, with the icon's red spent only on things you can act on.
   Nothing is fetched from anywhere — the app is meant to work with no network
   at all, and a help page that went looking for a font would be a help page
   that is blank on a plane.
   ------------------------------------------------------------------------ */

:root {
  --field:      oklch(0.17 0.018 30);
  --field-deep: oklch(0.12 0.014 30);
  --red:        oklch(0.55 0.20 28);
  --red-deep:   oklch(0.46 0.17 28);
  --red-dark:   oklch(0.35 0.14 28);
  --plate:      oklch(0.985 0.012 85);
  --plate-edge: oklch(0.945 0.018 80);
  --ink:        oklch(0.29 0.06 30);
  --ink-soft:   oklch(0.46 0.04 40);
  --ink-faint:  oklch(0.63 0.03 50);
  --rule:       oklch(0.86 0.02 70);
  --on-field:      oklch(0.93 0.03 45);
  --on-field-soft: oklch(0.74 0.03 45);

  --font-display: ui-serif, "New York", Georgia, "Times New Roman", serif;
  --font-body: system-ui, -apple-system, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --radius: 24px;
  --sidebar: 268px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--field);
  background-image: linear-gradient(180deg, var(--field) 0%, var(--field-deep) 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.62;
}

a { color: inherit; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; border-radius: 4px; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 5;
  background: var(--plate); color: var(--ink); padding: 0.7rem 1rem; border-radius: 0 0 10px 0;
}
.skip:focus { left: 0; }

/* ------------------------------------------------------------------ Shell */

.shell {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  gap: clamp(1rem, 3vw, 2.5rem);
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 2.2rem) clamp(0.9rem, 3vw, 2rem) 4rem;
  align-items: start;
}

/* ---------------------------------------------------------------- Sidebar */

.sidebar {
  position: sticky;
  top: clamp(1rem, 3vw, 2.2rem);
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
  color: var(--on-field);
  padding-bottom: 1rem;
}

.brand {
  display: flex; align-items: center; gap: 0.65rem;
  text-decoration: none; color: var(--on-field);
  font-weight: 600; letter-spacing: -0.01em;
  margin: 0.35rem 0 1.6rem;
}
.brand svg { width: 34px; height: 34px; display: block; border-radius: 8px; flex: none; }
.brand span { display: flex; flex-direction: column; line-height: 1.15; }
.brand small {
  font-family: var(--font-mono); font-size: 0.66rem; font-weight: 400;
  letter-spacing: 0.16em; text-transform: uppercase; color: oklch(0.74 0.11 33);
}

.nav { list-style: none; margin: 0; padding: 0; }
.nav__item a {
  display: block; text-decoration: none;
  padding: 0.38rem 0.7rem; border-radius: 9px;
  color: var(--on-field-soft); font-size: 0.95rem;
  border-left: 2px solid transparent;
}
.nav__item a:hover { color: var(--on-field); background: oklch(1 0 0 / 0.05); }
.nav__item--here > a {
  color: var(--plate); background: oklch(1 0 0 / 0.08);
  border-left-color: var(--red); font-weight: 600;
}
.nav__item--child { margin-left: 0.85rem; }
.nav__item--child a { font-size: 0.88rem; }

.contents { margin-top: 1.8rem; padding-top: 1.2rem; border-top: 1px solid oklch(1 0 0 / 0.12); }
.contents__title {
  font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: oklch(0.62 0.02 45); margin: 0 0 0.5rem 0.7rem;
}
.contents ul { list-style: none; margin: 0; padding: 0; }
.contents a {
  display: block; text-decoration: none; color: var(--on-field-soft);
  font-size: 0.87rem; padding: 0.22rem 0.7rem; border-radius: 8px;
}
.contents a:hover { color: var(--on-field); background: oklch(1 0 0 / 0.05); }

/* ------------------------------------------------------------------ Plate */

.plate {
  background: linear-gradient(180deg, var(--plate) 0%, var(--plate-edge) 100%);
  border-radius: var(--radius);
  padding: clamp(1.8rem, 4vw, 3.4rem) clamp(1.3rem, 4vw, 3.4rem);
  box-shadow: 0 30px 70px -30px oklch(0 0 0 / 0.9), 0 2px 0 oklch(1 0 0 / 0.5) inset;
  overflow-wrap: break-word;
}

.eyebrow {
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-faint); margin: 0 0 0.8rem;
}

h1, h2, h3, h4 {
  font-family: var(--font-display); font-weight: 700; line-height: 1.1;
  letter-spacing: -0.02em; margin: 0; text-wrap: balance; color: var(--ink);
}
h1 { font-size: clamp(2rem, 4.4vw, 2.9rem); }
h2 {
  font-size: clamp(1.35rem, 2.6vw, 1.72rem);
  margin: 2.8rem 0 0.9rem; padding-top: 1.4rem;
  border-top: 1px solid var(--rule);
}
h3 { font-size: 1.16rem; margin: 1.9rem 0 0.6rem; }
h4 { font-size: 1rem; margin: 1.5rem 0 0.5rem; font-family: var(--font-body); }

.lede {
  font-size: 1.14rem; color: var(--ink-soft); margin: 1rem 0 0;
  max-width: 62ch;
}

p { margin: 1rem 0; max-width: 74ch; }
ul, ol { margin: 1rem 0; padding-left: 1.35rem; max-width: 74ch; }
li { margin: 0.4rem 0; }
li > code:first-child { font-weight: 600; }

hr { border: 0; border-top: 1px solid var(--rule); margin: 2.4rem 0; }

blockquote {
  margin: 1.4rem 0; padding: 0.1rem 0 0.1rem 1.1rem;
  border-left: 3px solid var(--red); color: var(--ink-soft);
  max-width: 72ch;
}

strong { font-weight: 650; color: var(--ink); }

/* --------------------------------------------------------------- Monotype */

code {
  font-family: var(--font-mono); font-size: 0.88em;
  background: oklch(0.93 0.015 75); border: 1px solid oklch(0.88 0.02 75);
  border-radius: 5px; padding: 0.08em 0.32em;
  overflow-wrap: anywhere;
}
pre {
  margin: 1.3rem 0; padding: 1rem 1.1rem;
  background: var(--field); color: oklch(0.93 0.02 70);
  border-radius: 12px; overflow-x: auto; line-height: 1.55;
}
pre code {
  background: none; border: 0; padding: 0; font-size: 0.86rem; color: inherit;
  overflow-wrap: normal;
}

kbd {
  font: 600 0.82rem/1 var(--font-mono);
  background: oklch(1 0 0 / 0.6); border: 1px solid var(--rule);
  border-bottom-width: 2px; border-radius: 6px; padding: 0.3rem 0.4rem; color: var(--ink);
}

/* ---------------------------------------------------------------- Tables */

.scroller { overflow-x: auto; margin: 1.4rem 0; }
table { border-collapse: collapse; width: 100%; font-size: 0.94rem; }
th, td {
  text-align: left; vertical-align: top;
  padding: 0.6rem 0.9rem 0.6rem 0;
  border-bottom: 1px solid var(--rule);
}
th {
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-faint); font-weight: 500;
  border-bottom-color: var(--ink-faint);
  white-space: nowrap;
}
td code { white-space: nowrap; }

/* --------------------------------------------------- The reference's rows */

.keyword-index {
  margin: 1.6rem 0 0;
  padding: 1.1rem 1.2rem;
  background: oklch(0.955 0.014 80);
  border: 1px solid var(--rule); border-radius: 14px;
  font-size: 0.9rem; line-height: 2.1;
}
.keyword-index > div { margin: 0.15rem 0; }
.keyword-index a { text-decoration: none; }
/* A keyword is one word wherever it is written, so it does not break across
   two lines here either. */
.keyword-index code { white-space: nowrap; }
.keyword-index a:hover code { border-color: var(--red); color: var(--red-deep); }
.keyword-index__section {
  display: inline-block; min-width: 6.4rem;
  font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-faint);
}

.action {
  margin: 1.6rem 0;
  padding: 1.2rem 1.4rem;
  background: oklch(1 0 0 / 0.55);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--red-dark);
  border-radius: 0 14px 14px 0;
  scroll-margin-top: 1.5rem;
}
.action > :first-child { margin-top: 0; }
.action > :last-child { margin-bottom: 0; }
.action__name {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; margin: 0;
}
.action__name code {
  font-size: 1.02rem; font-weight: 700; background: none; border: 0; padding: 0;
  color: var(--red-deep);
}
.action__kind {
  font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-faint); white-space: nowrap;
}
.action__what { margin: 0.15rem 0 0.9rem; color: var(--ink-soft); font-size: 0.98rem; }
.action pre { margin: 0.9rem 0; }

/* --------------------------------------------------------------- Colophon */

.colophon {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  margin: 1.4rem 0.4rem 0;
  font-size: 0.85rem; color: oklch(0.6 0.02 45);
}
.colophon a { color: oklch(0.72 0.09 33); text-decoration: none; }
.colophon a:hover { color: var(--plate); }

/* -------------------------------------------------------------- Narrower */

@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; max-height: none; overflow: visible; }
  .nav { display: flex; flex-wrap: wrap; gap: 0.2rem; }
  .nav__item--child { margin-left: 0; }
  .nav__item a { padding: 0.3rem 0.6rem; border-left: 0; }
  .nav__item--here > a { border-left: 0; box-shadow: inset 0 -2px 0 var(--red); }
  .contents { display: none; }
}

/* ----------------------------------------------------------- On paper */

@media print {
  body { background: #fff; }
  .sidebar, .skip, .colophon { display: none; }
  .shell { display: block; padding: 0; }
  .plate { box-shadow: none; border-radius: 0; padding: 0; background: #fff; }
  pre { background: #f4f4f4; color: #000; }
}
