/* ============================================================
   manual.css — the editorial theme for the HTML manuals.
   Long-form reading: generous measure, real hierarchy, printable.
   ============================================================ */
:root {
  --cream: #fbf9f3; --cream-2: #f4efe1; --paper: #fff;
  --ink: #1a0e1d; --ink-soft: #6b5f70; --ink-faint: #726970;
  --wine: #5d1e3a; --wine-deep: #3d0d24; --gold: #b48a44;
  --rule: #d8d0bf; --rule-soft: #ebe4d2;
  --measure: 68ch;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
/* overflow-x lives on html, not body: on body it computes overflow-y to auto,
   which turns body into its own scroll box and stops the contents links from
   jumping to their headings. */
html { scroll-behavior: smooth; overflow-x: hidden; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  background: var(--cream); color: var(--ink);
  font-family: 'Instrument Sans', system-ui, sans-serif;
  font-size: 17px; line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
/* clear the sticky masthead when a contents link lands on a heading */
h2[id], h3[id], h4[id] { scroll-margin-top: 84px; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--wine); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--wine); outline-offset: 3px; }

.skip { position: absolute; left: -9999px; background: var(--wine); color: var(--cream); padding: 12px 20px; z-index: 100; }
.skip:focus { left: 0; }

/* ---- masthead ---- */
.bar { border-bottom: 1px solid var(--rule); background: rgba(251,249,243,.95); position: sticky; top: 0; z-index: 40; backdrop-filter: blur(8px); }
.bar__in { max-width: 1180px; margin: 0 auto; padding: 14px clamp(18px,4vw,32px); display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.bar__brand { font-family: 'Fraunces', Georgia, serif; font-weight: 400; font-size: 1.3rem; letter-spacing: .14em; color: var(--ink); text-decoration: none; }
.bar__doc { font-size: .66rem; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-faint); font-weight: 600; }
.bar__spacer { flex: 1; }
.bar__link { font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 600; color: var(--ink-soft); text-decoration: none; }
.bar__link:hover { color: var(--wine); }

/* ---- layout: sticky contents rail + body ---- */
.shell { max-width: 1180px; margin: 0 auto; padding: clamp(24px,5vw,56px) clamp(18px,4vw,32px) 5rem; display: grid; gap: clamp(24px,4vw,56px); grid-template-columns: 1fr; }
@media (min-width: 1000px) { .shell { grid-template-columns: 240px minmax(0,1fr); } }
.toc { align-self: start; }
@media (min-width: 1000px) { .toc { position: sticky; top: 84px; max-height: calc(100vh - 110px); overflow-y: auto; } }
.toc__title { font-size: .64rem; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-soft); font-weight: 600; margin: 0 0 .9rem; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc li { margin-bottom: .1rem; }
.toc a { display: block; padding: 5px 0; font-size: .84rem; color: var(--ink-soft); text-decoration: none; border-bottom: 1px solid transparent; line-height: 1.35; }
.toc a:hover { color: var(--ink); }
.toc a.is-sub { padding-left: 12px; font-size: .78rem; color: var(--ink-faint); }
.toc a.is-active { color: var(--wine); font-weight: 600; }

/* ---- document ---- */
.doc { min-width: 0; }
.doc__eyebrow { font-size: .68rem; letter-spacing: .24em; text-transform: uppercase; color: var(--ink-soft); font-weight: 600; margin: 0 0 .8rem; }
.doc__title {
  font-family: 'Fraunces', Georgia, serif; font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1;
  font-weight: 350; font-size: clamp(2.1rem,5vw,3.4rem); line-height: 1.02; letter-spacing: -.025em; margin: 0;
}
.doc__title em { font-style: italic; color: var(--wine); }
.doc__lede { font-size: 1.1rem; line-height: 1.7; color: var(--ink-soft); max-width: var(--measure); margin: 1.3rem 0 0; }
.doc__meta { margin-top: 1.6rem; padding-top: 1.2rem; border-top: 1px solid var(--rule); font-size: .82rem; color: var(--ink-faint); }

h2 {
  font-family: 'Fraunces', Georgia, serif; font-variation-settings: "opsz" 96, "SOFT" 100, "WONK" 1;
  font-weight: 400; font-size: clamp(1.5rem,3vw,2rem); line-height: 1.15; letter-spacing: -.015em;
  margin: 3.2rem 0 1rem; padding-top: 1.6rem; border-top: 1px solid var(--ink);
}
h3 { font-family: 'Fraunces', Georgia, serif; font-weight: 400; font-size: 1.22rem; margin: 2.2rem 0 .6rem; }
h4 { font-size: .96rem; font-weight: 700; margin: 1.6rem 0 .4rem; letter-spacing: .01em; }
p { margin: 0 0 1.1rem; max-width: var(--measure); }
ul, ol { max-width: var(--measure); padding-left: 1.3rem; margin: 0 0 1.2rem; }
li { margin-bottom: .45rem; }
strong { font-weight: 700; }

/* ---- figures (screen captures) ---- */
figure { margin: 1.8rem 0; max-width: 100%; }
figure img { border: 1px solid var(--rule); box-shadow: 0 1px 3px rgba(26,14,29,.06), 0 14px 32px -20px rgba(26,14,29,.3); background: var(--paper); }
/* ---- videos (2026-10-11): the explainer videos, playable in place ---- */
figure video { display: block; width: 100%; max-width: 760px; aspect-ratio: 16 / 9; background: var(--ink); border: 1px solid var(--rule); }
@media print { figure.video { display: none; } }
figcaption { margin-top: .7rem; font-size: .82rem; color: var(--ink-faint); line-height: 1.55; max-width: var(--measure); }
figcaption b { color: var(--ink-soft); font-weight: 600; }

/* ---- callouts ---- */
.note, .warn { border-left: 3px solid var(--gold); background: var(--cream-2); padding: 1rem 1.2rem; margin: 1.6rem 0; max-width: var(--measure); font-size: .95rem; }
.note p:last-child, .warn p:last-child { margin-bottom: 0; }
.warn { border-left-color: var(--wine); }
.note__label, .warn__label { display: block; font-size: .62rem; letter-spacing: .18em; text-transform: uppercase; font-weight: 700; color: var(--gold); margin-bottom: .4rem; }
.warn .warn__label { color: var(--wine); }
/* A second, quieter line inside a note — the caveat after the point. */
.note p.muted, .warn p.muted { color: var(--ink-soft); font-size: .89rem; }

/* ---- steps ---- */
.steps { list-style: none; padding: 0; counter-reset: step; max-width: var(--measure); }
.steps > li { counter-increment: step; position: relative; padding-left: 2.6rem; margin-bottom: 1.5rem; }
.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: -1px;
  width: 1.85rem; height: 1.85rem; border-radius: 50%; border: 1px solid var(--wine); color: var(--wine);
  font-family: 'IBM Plex Mono', monospace; font-size: .8rem; display: flex; align-items: center; justify-content: center;
}
.steps > li > strong:first-child { display: block; margin-bottom: .25rem; }

/* ---- tables ---- */
.scroll { overflow-x: auto; margin: 1.4rem 0; }
table { width: 100%; border-collapse: collapse; min-width: 480px; font-size: .92rem; }
caption { text-align: left; font-size: .82rem; color: var(--ink-faint); margin-bottom: .6rem; }
th, td { padding: 9px 12px; text-align: left; vertical-align: top; }
thead th { font-size: .6rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); font-weight: 600; border-bottom: 1px solid var(--ink); white-space: nowrap; }
tbody tr + tr td, tbody tr + tr th { border-top: 1px solid var(--rule-soft); }
tbody tr:hover td, tbody tr:hover th { background: var(--cream-2); }
td.num, th.num { text-align: right; font-family: 'IBM Plex Mono', monospace; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---- test questions ---- */
.q { border-top: 1px solid var(--rule-soft); padding: 1.4rem 0; max-width: var(--measure); }
.q:first-of-type { border-top: 1px solid var(--ink); }
.q__n { font-family: 'IBM Plex Mono', monospace; font-size: .78rem; color: var(--gold); font-weight: 500; }
.q__stem { margin: .35rem 0 .8rem; font-weight: 500; }
.q__opts { list-style: upper-alpha; margin: 0 0 .9rem; padding-left: 1.6rem; }
.q__opts li { margin-bottom: .3rem; }
.q__ans { font-size: .88rem; background: var(--cream-2); border-left: 3px solid var(--gold); padding: .6rem .9rem; }
.q__ans b { font-family: 'IBM Plex Mono', monospace; color: var(--wine); }
.answers-toggle { margin: 1.2rem 0 2rem; }
.btn {
  font: inherit; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 600;
  border-radius: 999px; border: 1px solid var(--ink); background: transparent; color: var(--ink);
  padding: 8px 20px; cursor: pointer; text-decoration: none; display: inline-block;
}
.btn:hover { background: var(--wine); border-color: var(--wine); color: var(--cream); }
body.hide-answers .q__ans { display: none; }

/* ---- footer ---- */
.foot { border-top: 1px solid var(--ink); margin-top: 4rem; padding: 2rem 0 3rem; font-size: .8rem; color: var(--ink-faint); max-width: var(--measure); }

/* ---- print ---- */
@media print {
  body { background: #fff; font-size: 11pt; }
  .bar, .toc, .answers-toggle, .skip { display: none !important; }
  .shell { display: block; max-width: none; padding: 0; }
  h2 { page-break-after: avoid; }
  figure, .q, table { page-break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
  figure img { box-shadow: none; }
}

/* "Dashboard" — session-nav.js rewrites this to the reader's own dashboard when
   they have a session, so a manual is never a dead end. Styled as a pill because
   getting back is an action, not another cross-reference. */
.bar__back {
  margin-left: auto; font-size: .68rem; letter-spacing: .14em; text-transform: uppercase;
  font-weight: 600; text-decoration: none; white-space: nowrap;
  border: 1px solid var(--ink); border-radius: 999px; padding: 6px 14px; color: var(--ink);
}
.bar__back:hover { background: var(--wine); border-color: var(--wine); color: var(--cream); }
/* the compact pill is fine under a mouse; on touch it has to clear 44px */
@media (pointer: coarse) {
  .bar__back { display: inline-flex; align-items: center; min-height: 44px; padding: 6px 18px; }
}
