/* The manual reads like a well-set book: one column of text, generous margins, screenshots the full
   width of the measure. Typeface and colours follow the product itself, so the two feel like one thing. */

:root {
  color-scheme: light dark;

  --paper: #fdfdfc;
  --raised: #ffffff;
  --shade: #f4f5f3;
  --ink: #17191c;
  --ink-soft: #5a6069;
  --ink-faint: #8a9099;
  --line: #e4e5e1;
  --line-soft: #eeefeb;
  --mark: #1f5fbf;
  --mark-soft: #eef3fc;
  --badge: #b4402f;
  --sidebar: 296px;
  --measure: 760px;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 22, 26, .04), 0 8px 24px rgba(20, 22, 26, .06);

  --sans: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Libre Caslon Text", "Iowan Old Style", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #131417;
    --raised: #191b1f;
    --shade: #1e2126;
    --ink: #eceef0;
    --ink-soft: #a7aeb7;
    --ink-faint: #767d87;
    --line: #2a2e34;
    --line-soft: #23262b;
    --mark: #84b0f5;
    --mark-soft: #1a2434;
    --badge: #e0705c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.skip { position: absolute; left: -9999px; }
.skip:focus {
  left: 16px; top: 16px; z-index: 30;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--raised);
  box-shadow: var(--shadow);
}

::selection { background: var(--mark-soft); }

/* ---------------------------------------------------------------- contents */
#contents {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  padding: 30px 22px 40px 30px;
  border-right: 1px solid var(--line-soft);
  background: linear-gradient(180deg, var(--shade), var(--paper) 340px);
  overflow-y: auto;
  scrollbar-width: thin;
}

#contents .mark {
  margin: 0;
  font-family: var(--serif);
  font-size: 21px;
  letter-spacing: -.01em;
}

#contents .sub {
  margin: 1px 0 18px;
  color: var(--ink-faint);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .09em;
}

#toc {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
  counter-reset: part;
}

#toc li { counter-increment: part; }

#toc a {
  display: flex;
  gap: 10px;
  padding: 6px 10px 6px 8px;
  border-radius: 7px;
  color: var(--ink-soft);
  text-decoration: none;
  line-height: 1.35;
  transition: background .12s ease, color .12s ease;
}

#toc a::before {
  content: counter(part);
  flex: none;
  width: 18px;
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 11px;
  text-align: right;
  padding-top: 2px;
}

#toc a:hover { background: var(--line-soft); color: var(--ink); }

#toc a[aria-current="true"] {
  background: var(--mark-soft);
  color: var(--mark);
  font-weight: 500;
}

#toc a[aria-current="true"]::before { color: var(--mark); }

.printed {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
  font-size: 13px;
}

.printed a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-soft);
  text-decoration: none;
}

.printed a::before { content: "↓"; color: var(--ink-faint); }
.printed a:hover { color: var(--mark); }

/* ---------------------------------------------------------------- text */
#content {
  margin-left: var(--sidebar);
  padding: 64px 40px 120px;
  max-width: calc(var(--sidebar) + var(--measure) + 80px);
}

h1 {
  margin: 0 0 14px;
  font-family: var(--serif);
  font-size: 40px;
  line-height: 1.15;
  letter-spacing: -.015em;
  font-weight: 400;
}

section:first-of-type .lead {
  font-size: 19px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin-bottom: 26px;
}

h2 {
  margin: 76px 0 4px;
  padding-top: 30px;
  border-top: 1px solid var(--line-soft);
  font-family: var(--serif);
  font-size: 27px;
  line-height: 1.25;
  font-weight: 400;
  letter-spacing: -.01em;
  scroll-margin-top: 24px;
}

section:first-of-type h2 { border-top: 0; padding-top: 0; margin-top: 40px; }

h3 {
  margin: 32px 0 6px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .005em;
}

p { margin: 0 0 16px; max-width: var(--measure); }

b, strong { font-weight: 600; }

.lead { color: var(--ink-soft); }

.where {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 10px 0 20px;
  padding: 5px 12px 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--raised);
  color: var(--ink-soft);
  font-size: 12.5px;
  font-family: var(--mono);
}

.where::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--mark);
}

/* ---------------------------------------------------------------- screenshots */
figure { margin: 26px 0 10px; max-width: var(--measure); }

.shot {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--raised);
  box-shadow: var(--shadow);
  overflow: hidden;
  line-height: 0;
}

.shot img { width: 100%; height: auto; display: block; }

.badge {
  position: absolute;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--badge);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  box-shadow: 0 0 0 2px var(--raised), 0 2px 6px rgba(0,0,0,.28);
}

figcaption {
  margin-top: 10px;
  color: var(--ink-faint);
  font-size: 13px;
}

/* ---------------------------------------------------------------- numbered notes */
ol.callouts {
  margin: 22px 0 0;
  padding: 18px 20px;
  max-width: var(--measure);
  list-style: none;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--shade);
}

ol.callouts li {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  font-size: 15px;
  line-height: 1.6;
}

ol.callouts li + li {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

ol.callouts .n {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-top: 2px;
  border-radius: 999px;
  background: var(--badge);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

ul.plain {
  margin: 0 0 16px;
  padding: 0;
  max-width: var(--measure);
  list-style: none;
}

ul.plain li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 9px;
}

ul.plain li::before {
  content: "";
  position: absolute;
  left: 4px; top: 11px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--ink-faint);
}

.aside {
  margin: 24px 0;
  padding: 18px 22px;
  max-width: var(--measure);
  border: 1px solid var(--line);
  border-left: 3px solid var(--mark);
  border-radius: 4px var(--radius) var(--radius) 4px;
  background: var(--mark-soft);
}

.aside h3 { margin-top: 0; color: var(--mark); }
.aside p:last-child { margin-bottom: 0; }

/* ---------------------------------------------------------------- search */
.search-opener {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-bottom: 22px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--raised);
  color: var(--ink-faint);
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
  transition: border-color .12s ease, color .12s ease;
}

.search-opener::before { content: "⌕"; font-size: 17px; line-height: 1; }
.search-opener span { flex: 1; text-align: left; }
.search-opener:hover { border-color: var(--ink-faint); color: var(--ink-soft); }

kbd {
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--shade);
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 11px;
}

.finder {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  justify-content: center;
  padding-top: 11vh;
  background: rgba(12, 14, 17, .5);
  backdrop-filter: blur(3px);
}

.finder[hidden] { display: none; }

.finder-box {
  width: min(660px, calc(100vw - 32px));
  max-height: 68vh;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--raised);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .35);
  overflow: hidden;
}

.finder-box input {
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  padding: 17px 20px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 16.5px;
  outline: none;
}

.finder-box input::placeholder { color: var(--ink-faint); }

#finder-results {
  margin: 0;
  padding: 8px;
  list-style: none;
  overflow-y: auto;
}

#finder-results li {
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
}

#finder-results li[aria-selected="true"] { background: var(--mark-soft); }

.finder-where {
  display: block;
  color: var(--mark);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .02em;
}

.finder-text {
  display: block;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.5;
}

#finder-results mark {
  background: transparent;
  color: var(--ink);
  font-weight: 600;
}

.finder-none { color: var(--ink-faint); cursor: default !important; }

.finder-hint {
  margin: 0;
  padding: 9px 16px;
  border-top: 1px solid var(--line-soft);
  background: var(--shade);
  color: var(--ink-faint);
  font-size: 12px;
}

.finder-hint kbd { margin-right: 4px; }

/* ---------------------------------------------------------------- small screens */
@media (max-width: 1000px) {
  #contents {
    position: static;
    width: auto;
    padding: 20px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: var(--shade);
  }
  #toc { columns: 2; column-gap: 20px; }
  #content { margin-left: 0; padding: 32px 16px 80px; max-width: none; }
  h1 { font-size: 31px; }
  h2 { font-size: 23px; margin-top: 52px; }
}

@media (max-width: 560px) {
  #toc { columns: 1; }
}

/* ---------------------------------------------------------------- print (the PDF uses print.css) */
@media print {
  #contents, .skip, .finder { display: none; }
  #content { margin: 0; max-width: none; padding: 0; }
  body { font-size: 11pt; }
  h2 { break-before: page; }
  section:first-of-type h2 { break-before: auto; }
  figure, .aside, ol.callouts li { break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
}
