/* Copyright (C) 2026 Xfer Inc. All rights reserved.
   The SHRUB Operation Guide, as the Serum 2 User Guide looks: US Letter, Lato for the text and Raleway for the
   titles, green headings, the part's name over each page and the page's number under it. Printed by
   tools/manual/build.mjs (headless Chrome), and on shrub.audio/guide as a page (the screen's rules at the end). */
@font-face { font-family: Lato; src: url(fonts/Lato-Light.ttf); font-weight: 300; }
@font-face { font-family: Lato; src: url(fonts/Lato-Regular.ttf); font-weight: 400; }
@font-face { font-family: Lato; src: url(fonts/Lato-Italic.ttf); font-weight: 400; font-style: italic; }
@font-face { font-family: Lato; src: url(fonts/Lato-Bold.ttf); font-weight: 700; }
@font-face { font-family: Lato; src: url(fonts/Lato-Black.ttf); font-weight: 900; }
@font-face { font-family: Raleway; src: url(fonts/Raleway.ttf); font-weight: 100 900; }

:root {
  --green: #82c755;
  --green-dark: #5b9a35;
  --ink: #2b2a2a;
  --dim: #6b6a6a;
  --rule: #d9dcd6;
  --wash: #f3f6f0;
  --night: #1a1919;
}

@page {
  size: letter;
  margin: 0.85in 0.8in 0.8in 0.8in;
  @top-right { content: "SHRUB Operation Guide"; font: 300 10pt Lato, sans-serif; color: var(--dim); }
  @bottom-left { content: "SHRUB Operation Guide"; font: 400 9.5pt Lato, sans-serif; color: var(--dim); }
  @bottom-right { content: counter(page); font: 400 9.5pt Lato, sans-serif; color: var(--dim); }
}
@page cover { margin: 0; @top-right { content: none; } @bottom-left { content: none; } @bottom-right { content: none; } }
@page front { @top-right { content: none; } }
@page part1 { @top-right { content: "Part 1 · On the FM-1"; } }
@page part2 { @top-right { content: "Part 2 · The editor and the VST3"; } }
@page divider { margin: 0; @top-right { content: none; } @bottom-left { content: none; } @bottom-right { content: none; } }

* { box-sizing: border-box; }
html { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
body { margin: 0; color: var(--ink); font: 400 10.5pt/1.55 Lato, sans-serif; }
img { max-width: 100%; }
a { color: var(--green-dark); text-decoration: none; }
strong { font-weight: 700; }
code, .key { font: 700 9.5pt/1 "Courier New", monospace; }

/* ---------------------------------------------------------------- the cover */
.cover {
  page: cover;
  position: relative;
  height: 11in;
  width: 8.5in;
  overflow: hidden;
  background: radial-gradient(5in 4in at 50% 30%, rgba(60, 120, 40, 0.35), transparent 70%), var(--night);
  color: #e8ecea;
  break-after: page;
}
.cover .xfer { position: absolute; top: 0.7in; left: 50%; width: 2.1in; transform: translateX(-50%); image-rendering: pixelated; }
.cover .title { position: absolute; top: 2.55in; left: 50%; width: 6.1in; transform: translateX(-50%); image-rendering: pixelated; }
.cover .tree { position: absolute; top: 4.25in; left: 50%; width: 3.3in; transform: translateX(-50%); image-rendering: pixelated; }
.cover .guide {
  position: absolute;
  left: 0.75in;
  bottom: 1.05in;
  margin: 0;
  font: 800 74pt/0.9 Raleway, sans-serif;
  letter-spacing: -0.01em;
  color: transparent;
  -webkit-text-stroke: 1.6pt #c9d1cc;
  background: url(img/cover-fill.png) center / cover;
  -webkit-background-clip: text;
  background-clip: text;
}
.cover .for { position: absolute; left: 0.8in; bottom: 0.62in; margin: 0; font: 300 12pt Lato, sans-serif; color: #b4bdb8; }

/* ---------------------------------------------------------------- front matter */
.front { page: front; }
.colophon { break-after: page; font-size: 9.5pt; color: #444; }
.colophon h1 { margin: 0 0 0.2in; font: 600 20pt Raleway, sans-serif; color: var(--ink); }
.colophon p { margin: 0 0 0.11in; }
.colophon .small { font-size: 8.5pt; color: var(--dim); }

.toc { break-after: page; }
.toc h1 { margin: 0 0 0.3in; font: 300 30pt Lato, sans-serif; color: var(--green); }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc li { display: flex; align-items: baseline; gap: 0.08in; margin: 0; }
.toc li a { color: var(--ink); }
.toc li::after { content: ""; order: 1; flex: 1; border-bottom: 1px dotted #aaa; transform: translateY(-3pt); }
.toc li .n { order: 2; min-width: 0.3in; text-align: right; }
.toc li.part { margin-top: 0.16in; font: 700 12pt Raleway, sans-serif; color: var(--green-dark); }
.toc li.part a { color: var(--green-dark); }
.toc li.ch { margin-top: 0.06in; font-size: 11pt; }
.toc li.sub { padding-left: 0.22in; font-size: 9.5pt; color: #555; }
.toc li.sub a { color: #555; }

/* ---------------------------------------------------------------- the parts */
.part1 { page: part1; }
.part2 { page: part2; }
.divider {
  page: divider;
  height: 11in;
  width: 8.5in;
  position: relative;
  background: var(--night);
  color: #e8ecea;
  break-before: page;
  break-after: page;
  overflow: hidden;
}
.divider .num { position: absolute; top: 1.2in; left: 0.8in; font: 300 15pt Lato, sans-serif; letter-spacing: 0.3em; text-transform: uppercase; color: var(--green); }
.divider h1 { position: absolute; top: 1.6in; left: 0.8in; right: 0.8in; margin: 0; font: 700 44pt/1.05 Raleway, sans-serif; color: #f1f4f2; }
.divider p { position: absolute; top: 3.2in; left: 0.8in; width: 4.6in; margin: 0; font: 300 13pt/1.55 Lato, sans-serif; color: #c4ccc7; }
.divider img { position: absolute; right: -0.3in; bottom: -0.2in; width: 6.4in; opacity: 0.95; border-radius: 10px; }
.divider img.pixel { image-rendering: pixelated; width: 4in; right: 0.6in; bottom: 0.6in; border-radius: 0; }

h1.chapter { break-before: page; margin: 0 0 0.18in; font: 300 26pt/1.15 Lato, sans-serif; color: var(--green); }
.divider + h1.chapter, .divider + section > h1.chapter:first-child { break-before: auto; }
h2 { margin: 0.26in 0 0.08in; font: 700 13pt/1.3 Lato, sans-serif; color: var(--green); break-after: avoid; }
h3 { margin: 0.18in 0 0.05in; font: 700 10.5pt Lato, sans-serif; color: var(--ink); break-after: avoid; }
p { margin: 0 0 0.1in; }
ul, ol { margin: 0 0 0.12in; padding-left: 0.24in; }
li { margin: 0.03in 0; }
.lede { font: 300 12pt/1.55 Lato, sans-serif; color: #3a3a3a; }

/* the tips: a sprout where Serum's guide has its light bulb */
.tip, .note {
  display: grid;
  grid-template-columns: 0.36in 1fr;
  gap: 0.1in;
  margin: 0.12in 0 0.14in;
  padding: 0.1in 0.14in;
  background: var(--wash);
  border-left: 3px solid var(--green);
  border-radius: 0 6px 6px 0;
  break-inside: avoid;
}
.tip::before, .note::before { content: ""; width: 0.3in; height: 0.3in; background: url(img/sprout.svg) center / contain no-repeat; }
.note { border-left-color: #e0a441; background: #fbf6ec; }
.note::before { background-image: url(img/heads-up.svg); }
.tip p:last-child, .note p:last-child { margin-bottom: 0; }

/* pictures */
figure { margin: 0.12in 0 0.16in; break-inside: avoid; }
figure img { display: block; max-height: 3.5in; width: auto; margin: 0 auto; border-radius: 6px; border: 1px solid #c9ccc6; }
figure:not(.side figure) figcaption { text-align: center; }
figure img.screen { image-rendering: pixelated; border-radius: 8px; border: 0; }
figcaption { margin-top: 0.05in; font: 700 9pt Lato, sans-serif; color: var(--ink); }
.side { display: grid; grid-template-columns: 1fr 2.3in; gap: 0.22in; align-items: start; break-inside: avoid; }
.side.left { grid-template-columns: 2.3in 1fr; }
.side figure { margin-top: 0.02in; }
.screens { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.12in; margin: 0.1in 0 0.16in; }
.screens figure { margin: 0; }
.screens img { image-rendering: pixelated; border-radius: 6px; border: 0; }
.screens figcaption { text-align: center; font-size: 7.5pt; letter-spacing: 0.08em; text-transform: uppercase; color: #4a6e33; }

/* the knob tables: a page of a part a row, its four knobs across */
table { width: 100%; border-collapse: collapse; margin: 0.08in 0 0.16in; font-size: 9.5pt; break-inside: avoid; }
th, td { padding: 0.045in 0.07in; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); }
th { font: 700 8.5pt Lato, sans-serif; letter-spacing: 0.04em; text-transform: uppercase; color: #fff; background: #3c4a3a; }
th:first-child { border-radius: 4px 0 0 0; }
th:last-child { border-radius: 0 4px 0 0; }
tbody tr:nth-child(even) td { background: #f7f8f6; }
td.k { font-weight: 700; white-space: nowrap; }
table.knobs td:first-child { width: 0.75in; color: var(--dim); }
table.knobs td:not(:first-child) { width: 22%; }
table.knobs td b { display: block; font-weight: 700; }
table.knobs td span { font-size: 8.5pt; color: var(--dim); }
.alg { margin: -0.08in 0 0.14in; font-size: 9.5pt; color: #444; }
.alg b { color: var(--green-dark); }

.cols { columns: 2; column-gap: 0.3in; }
.cols li, .cols p { break-inside: avoid; }
.chips { margin: 0.04in 0 0.12in; font-size: 8.6pt; line-height: 1.75; color: #3c4a3a; }
.chips span { display: inline-block; margin: 0 0.04in 0.03in 0; padding: 0 0.07in; border: 1px solid #c3d6b6; border-radius: 9px; background: #f4f9f0; white-space: nowrap; }
.button { display: inline-block; padding: 0 0.06in; border: 1px solid #9aa39a; border-radius: 3px; font: 700 8.5pt/1.35 Lato, sans-serif; letter-spacing: 0.03em; background: #f1f2ef; color: #222; white-space: nowrap; }
.keep { break-inside: avoid; }
.page-break { break-before: page; }
.signoff { margin-top: 0.3in; font: italic 400 11pt Lato, sans-serif; color: #444; }

/* ---------------------------------------------------------------- on a screen: one long page, the cover and the
   parts' dividers as dark bands across it, the contents without page numbers */
nav.web { display: none; }
@media screen {
  html { background: #dfe3dc; scroll-behavior: smooth; }
  body { max-width: 9in; margin: 0 auto; padding: 0 0.7in 0.9in; background: #fff; font-size: 17px;
         box-shadow: 0 0 40px rgba(0, 0, 0, 0.12); }
  nav.web { display: flex; gap: 1.2em; justify-content: flex-end; margin: 0 -0.7in; padding: 10px 0.7in;
            background: var(--night); font: 700 14px Lato, sans-serif; }
  nav.web a:first-child { margin-right: auto; color: #e8ecea; }
  .cover, .divider { width: auto; height: auto; margin: 0 -0.7in 0.5in; padding: 0.6in 0.7in; }
  .cover.cover > *, .divider.divider > * { position: static; transform: none; }   /* over the print's placings */
  .cover { text-align: center; }
  .cover img { display: block; margin: 0 auto 0.3in; }
  .cover .xfer { width: 1.8in; }
  .cover .title { width: 5.4in; max-width: 100%; }
  .cover .tree { width: 2.6in; }
  .cover .guide { display: inline-block; font-size: clamp(44px, 9vw, 86px); }
  .cover .for { margin-top: 0.25in; }
  .divider { margin-top: 0.7in; }
  .divider .num { margin-bottom: 0.1in; }
  .divider h1 { font-size: clamp(30px, 5vw, 50px); margin-bottom: 0.2in; }
  .divider p { width: auto; max-width: 5in; }
  .divider img { display: block; width: 100%; max-width: 6.4in; margin: 0.4in auto 0; }
  .divider img.pixel { width: 2.6in; }
  .colophon { padding-bottom: 0.2in; border-bottom: 1px solid var(--rule); font-size: 15px; }
  .colophon .small { font-size: 13px; }
  .toc { margin: 0.4in 0; }
  .toc li::after, .toc li .n { display: none; }
  .toc li.ch { font-size: 17px; }
  .toc li.sub { font-size: 15px; }
  h1.chapter { margin-top: 0.8in; padding-top: 0.3in; border-top: 1px solid var(--rule); }
  .divider + h1.chapter, .divider + section > h1.chapter:first-child { margin-top: 0; padding-top: 0; border: 0; }
  h1, h2, h3 { scroll-margin-top: 16px; }
  table { font-size: 15px; }
  th { font-size: 13px; }
  table.knobs td span { font-size: 13px; }
  code, .key { font-size: 15px; }
  figcaption { font-size: 14px; }
  .screens figcaption { font-size: 11px; }
  .chips, .alg { font-size: 14px; }
  .button { font-size: 13px; }
}
@media screen and (max-width: 760px) {
  body { padding: 0 18px 40px; }
  nav.web, .cover, .divider { margin-left: -18px; margin-right: -18px; padding-left: 18px; padding-right: 18px; }
  .side, .side.left { grid-template-columns: 1fr; }
  .screens { grid-template-columns: repeat(2, 1fr); }
  .cols { columns: 1; }
  table { display: block; overflow-x: auto; }
}
