/* Scenic User Guide, for stageglass.app/scenic/guide/.
   Generated pages share this sheet. Tokens and type follow the site's Run Sheet direction
   (website/styles/homepage.css): stage white ground, ink text, one run blue, take orange for warnings,
   Barlow Condensed headlines, Instrument Sans body, IBM Plex Mono labels. */

:root {
  --stage: #f3f6fa;
  --stage-2: #e8edf3;
  --paper: #ffffff;
  --slate: #c7ced8;
  --ink: #10141a;
  --ink-2: #2a313b;
  --muted: #59616d;
  --blue: #245cff;
  --blue-soft: #dce5ff;
  --orange: #ff6038;
  --orange-soft: #ffe6df;
  --green: #0f8a4a;
  --green-soft: #ddf3e6;
  --screen: #07090d;
  --rule: #d5dbe3;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --top: 60px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--stage);
  color: var(--ink);
  font: 400 17px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-underline-offset: .2em; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 3px; }
[id] { scroll-margin-top: calc(var(--top) + 20px); }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: fixed; z-index: 100; left: 12px; top: -60px; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 6px; }
.skip:focus { top: 12px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(243, 246, 250, .92);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.topbar__inner {
  max-width: 1440px; margin: 0 auto; min-height: var(--top);
  display: flex; align-items: center; gap: 14px; padding: 8px 24px;
}
.topbar__brand, .topbar__title { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; }
.topbar__brand span { font: 700 20px/1 var(--display); letter-spacing: .01em; text-transform: uppercase; }
.topbar__title { padding-left: 14px; border-left: 1px solid var(--rule); }
.topbar__title span { font: 600 15px/1.2 var(--body); }
.preview-pill {
  font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase;
  color: var(--orange); border: 1px solid currentColor; border-radius: 999px; padding: 6px 10px; white-space: nowrap;
}
.search { position: relative; margin-left: auto; width: min(360px, 40vw); }
.search input {
  width: 100%; height: 40px; padding: 0 36px 0 14px;
  font: 400 15px/1 var(--body); color: var(--ink);
  background: var(--paper); border: 1px solid var(--slate); border-radius: 8px;
  -webkit-appearance: none; appearance: none;
}
.search input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.search__key {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font: 500 12px/1 var(--mono); color: var(--muted); border: 1px solid var(--slate); border-radius: 4px; padding: 3px 6px;
  pointer-events: none;
}
.search input:focus + .search__key { display: none; }
.search__results {
  position: absolute; right: 0; top: calc(100% + 6px); width: min(520px, 92vw); max-height: 70vh; overflow: auto;
  margin: 0; padding: 6px; list-style: none;
  background: var(--paper); border: 1px solid var(--slate); border-radius: 10px;
  box-shadow: 0 18px 50px rgba(16, 20, 26, .18);
}
.search__results li a { display: block; padding: 10px 12px; border-radius: 6px; color: var(--ink); text-decoration: none; }
.search__results li a:hover, .search__results li[aria-selected="true"] a { background: var(--blue-soft); }
.search__results .r-where { display: block; font: 500 11px/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.search__results .r-head { display: block; font-weight: 600; margin: 2px 0; }
.search__results .r-snip { display: block; font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.search__results mark { background: #fff1a8; color: inherit; border-radius: 2px; }
.search__results .r-none { padding: 12px; color: var(--muted); font-size: 15px; }

/* ---------- layout ---------- */
.layout {
  max-width: 1440px; margin: 0 auto;
  display: grid; grid-template-columns: 272px minmax(0, 1fr) 232px; gap: 48px;
  padding: 0 24px;
}
.chapters, .toc { position: sticky; top: calc(var(--top) + 24px); align-self: start; max-height: calc(100vh - var(--top) - 48px); overflow: auto; padding: 0 0 24px; }
.chapters { padding-top: 0; }
.chapters__fold > summary, .toc__fold > summary {
  list-style: none; cursor: default;
  font: 500 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
  padding: 4px 0 12px;
}
.chapters__fold > summary::-webkit-details-marker, .toc__fold > summary::-webkit-details-marker { display: none; }
.chapters__list { list-style: none; margin: 0; padding: 0; }
.chapters__list a {
  display: flex; gap: 10px; align-items: baseline;
  padding: 6px 10px; margin: 1px 0; border-radius: 6px;
  color: var(--ink-2); text-decoration: none; font-size: 15px; line-height: 1.35;
}
.chapters__list a:hover { background: var(--stage-2); color: var(--ink); }
.chapters__list a[aria-current="page"] { background: var(--paper); color: var(--ink); font-weight: 600; box-shadow: inset 3px 0 0 var(--blue); }
.chapters__list .num { flex: 0 0 auto; width: 20px; font: 500 12px/1.35 var(--mono); color: var(--muted); }
.chapters__list a[aria-current="page"] .num { color: var(--blue); }
.chapters__extra { margin: 18px 10px 0; font-size: 14px; }
.chapters__extra a { color: var(--muted); }

.toc ol { list-style: none; margin: 0; padding: 0 0 0 12px; border-left: 1px solid var(--rule); }
.toc a { display: block; padding: 4px 0; color: var(--muted); text-decoration: none; font-size: 14px; line-height: 1.35; }
.toc a:hover { color: var(--ink); }
.toc a.is-active { color: var(--blue); font-weight: 600; }
.toc .toc__l3 a { padding-left: 12px; font-size: 13px; }

.content { min-width: 0; padding: 40px 0 0; outline: none; }

/* ---------- prose ---------- */
.prose { max-width: 46rem; }
.eyebrow { font: 500 12px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--blue); margin: 0 0 14px; }
.prose h1 {
  font: 800 clamp(40px, 6vw, 64px)/.95 var(--display); letter-spacing: -.005em; text-transform: uppercase;
  margin: 0 0 28px; max-width: 18ch;
}
.prose h2 {
  font: 700 32px/1.05 var(--display); letter-spacing: .005em; text-transform: uppercase;
  margin: 56px 0 14px; padding-top: 22px; border-top: 1px solid var(--rule);
}
.prose h3 { font: 700 20px/1.25 var(--body); margin: 34px 0 8px; }
.prose h4 { font: 600 17px/1.3 var(--body); margin: 26px 0 6px; }
.prose h2, .prose h3, .prose h4 { position: relative; }
.hlink { position: absolute; left: -1.1em; width: 1em; color: var(--slate); text-decoration: none; font-weight: 400; opacity: 0; }
.prose h2 .hlink { top: 22px; }
.prose :is(h2, h3, h4):hover .hlink { opacity: 1; }
.prose p, .prose li { color: var(--ink-2); }
.prose p { margin: 0 0 16px; }
.prose > p:first-of-type { font-size: 19px; line-height: 1.55; color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.3rem; margin: 0 0 18px; }
.prose li { margin: 6px 0; }
.prose li > ul, .prose li > ol { margin: 6px 0 0; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 40px 0; }

.prose ol.steps { list-style: none; counter-reset: step; padding-left: 0; }
.prose ol.steps > li { counter-increment: step; position: relative; padding-left: 2.6rem; margin: 12px 0; }
.prose ol.steps > li::before {
  content: counter(step, decimal-leading-zero); position: absolute; left: 0; top: .22em;
  font: 500 13px/1 var(--mono); letter-spacing: .04em; color: var(--blue);
}

code {
  font: 400 .88em/1.4 var(--mono); background: var(--stage-2); border: 1px solid var(--rule);
  border-radius: 4px; padding: .08em .35em; color: var(--ink); overflow-wrap: anywhere;
}
pre { background: var(--screen); color: #e8edf3; border-radius: 10px; padding: 16px 18px; overflow: auto; margin: 0 0 18px; }
pre code { background: none; border: 0; padding: 0; color: inherit; font-size: 14px; }
kbd {
  display: inline-block; min-width: 1.6em; text-align: center;
  font: 500 .82em/1.5 var(--mono); color: var(--ink);
  background: var(--paper); border: 1px solid var(--slate); border-bottom-width: 2px; border-radius: 5px;
  padding: 0 .4em; white-space: nowrap;
}

.table-wrap { overflow-x: auto; margin: 0 0 22px; border: 1px solid var(--rule); border-radius: 10px; background: var(--paper); }
table { border-collapse: collapse; width: 100%; font-size: 15px; line-height: 1.45; }
th, td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--rule); }
th { font: 500 11px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: var(--stage); }
tr:last-child td { border-bottom: 0; }
td code { white-space: nowrap; }
td:first-child { color: var(--ink); }

.callout { margin: 0 0 22px; padding: 14px 18px 4px; border-radius: 10px; border: 1px solid var(--rule); background: var(--paper); border-left: 4px solid var(--blue); }
.callout__label { font: 500 11px/1 var(--mono) !important; letter-spacing: .1em; text-transform: uppercase; margin: 2px 0 10px !important; color: var(--blue) !important; }
.callout--tip { border-left-color: var(--green); }
.callout--tip .callout__label { color: var(--green) !important; }
.callout--warning { border-left-color: var(--orange); background: #fffaf8; }
.callout--warning .callout__label { color: #d6401c !important; }
.callout--onset { border-left-color: var(--ink); background: var(--screen); border-color: var(--screen); }
.callout--onset p, .callout--onset li { color: #dfe5ee; }
.callout--onset strong { color: #fff; }
.callout--onset .callout__label { color: #8fb0ff !important; }
.callout--onset a { color: #8fb0ff; }

.shot { margin: 8px 0 26px; }
.shot img { border-radius: 10px; border: 1px solid var(--rule); background: var(--screen); }
.shot figcaption { font-size: 14px; color: var(--muted); margin-top: 8px; }

/* Chapter cards on the guide home */
.prose .cards { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

/* ---------- pager and footer ---------- */
.pager { max-width: 46rem; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 56px 0 0; }
.pager a {
  display: block; padding: 16px 18px; border: 1px solid var(--rule); border-radius: 10px; background: var(--paper);
  color: var(--ink); text-decoration: none; font-weight: 600; line-height: 1.3;
}
.pager a:hover { border-color: var(--blue); }
.pager span { display: block; font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; font-weight: 500; }
.pager__next { text-align: right; grid-column: 2; }
.guide-foot { max-width: 46rem; margin: 48px 0 0; padding: 22px 0 48px; border-top: 1px solid var(--rule); font-size: 14px; color: var(--muted); }
.guide-foot p { margin: 0 0 6px; }
.guide-foot a { color: var(--muted); }

/* ---------- print page ---------- */
.content--print { max-width: 52rem; margin: 0 auto; padding: 32px 24px 0; }
.print-note { font-size: 14px; color: var(--muted); }
.print-chapter + .print-chapter { margin-top: 72px; padding-top: 24px; border-top: 3px solid var(--ink); }

/* ---------- narrower screens ---------- */
@media (max-width: 1200px) {
  .layout { grid-template-columns: 248px minmax(0, 1fr); gap: 40px; }
  .toc { display: none; }
}
@media (max-width: 900px) {
  :root { --top: 56px; }
  body { font-size: 16px; }
  .topbar__inner { flex-wrap: wrap; gap: 8px 12px; padding: 8px 16px; }
  .topbar__brand span { display: none; }
  .topbar__title { padding-left: 10px; }
  .preview-pill { font-size: 10px; padding: 5px 8px; }
  .search { order: 5; width: 100%; margin: 0 0 4px; }
  .search__key { display: none; }
  .search__results { left: 0; right: 0; width: auto; }
  .layout { display: block; padding: 0 16px; }
  .chapters { position: static; max-height: none; overflow: visible; margin: 14px 0 0; padding: 0; }
  .chapters__fold { border: 1px solid var(--rule); border-radius: 10px; background: var(--paper); }
  .chapters__fold > summary { cursor: pointer; padding: 14px 16px; display: flex; justify-content: space-between; }
  .chapters__fold > summary::after { content: "+"; font-size: 16px; line-height: 11px; }
  .chapters__fold[open] > summary::after { content: "–"; }
  .chapters__list { padding: 0 6px 8px; }
  .chapters__extra { display: none; }
  .toc { display: block; position: static; max-height: none; overflow: visible; margin: 0; padding: 0; }
  .toc:empty { display: none; }
  .content { padding-top: 24px; }
  .prose h1 { font-size: clamp(36px, 11vw, 48px); max-width: none; }
  .prose h2 { font-size: 27px; margin-top: 44px; }
  .hlink { display: none; }
  .prose > p:first-of-type { font-size: 17px; }
  .prose .cards { grid-template-columns: 1fr; }
  .pager { grid-template-columns: 1fr; }
  .pager__next { grid-column: 1; }
  th, td { padding: 9px 11px; }
}
/* On a phone the "On this page" box sits at the top of the article; JS moves it there. */
.toc--inline { margin: 0 0 24px; }
.toc--inline .toc__fold { border: 1px solid var(--rule); border-radius: 10px; background: var(--paper); }
.toc--inline .toc__fold > summary { cursor: pointer; padding: 14px 16px; display: flex; justify-content: space-between; }
.toc--inline .toc__fold > summary::after { content: "+"; font-size: 16px; line-height: 11px; }
.toc--inline .toc__fold[open] > summary::after { content: "–"; }
.toc--inline ol { margin: 0 16px 14px; }

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

/* ---------- print ---------- */
@media print {
  @page { margin: 16mm 14mm; }
  body { background: #fff; font-size: 11pt; color: #000; }
  .topbar, .chapters, .toc, .pager, .skip, .hlink, .print-note, .search { display: none !important; }
  .layout { display: block; padding: 0; }
  .content, .content--print { padding: 0; max-width: none; }
  .prose { max-width: none; }
  .prose h1 { font-size: 30pt; }
  .prose h2 { font-size: 18pt; break-after: avoid; }
  .prose h3 { break-after: avoid; }
  .prose p, .prose li { color: #000; }
  a { color: #000; }
  .table-wrap, .callout, .shot, pre { break-inside: avoid; }
  .table-wrap { overflow: visible; border-color: #999; }
  .callout--onset { background: #fff; border-color: #000; }
  .callout--onset p, .callout--onset li, .callout--onset strong { color: #000; }
  .print-chapter { break-before: page; border-top: 0 !important; margin-top: 0 !important; }
  .print-chapter:first-child { break-before: auto; }
  .guide-foot { border-top: 1px solid #999; }
}
