/* ============================================================================
   Soundcheck — shared stylesheet
   Ported from docs/reference/x32-theme-church.html (the approved theme).
   One source of truth for the whole site. Tokens live in :root.
   See docs/DESIGN.md for the system; do not add page-local <style> blocks
   unless a page truly needs a one-off — reuse the components below instead.
   ========================================================================== */

/* ---- Self-hosted fonts (offline-capable; no CDN) --------------------------
   Manrope + Inter shipped as variable woff2 in assets/fonts/. One file per
   family covers the full weight range we use. latin subset only. ---------- */
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-var.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("../fonts/manrope-var.woff2") format("woff2");
  font-weight: 600 800;
  font-style: normal;
  font-display: swap;
}

/* ---- Design tokens (promoted from the mockup's .screen scope) ------------- */
:root {
  --bg:#f4f4f3; --surface:#ffffff; --surface-2:#eaf1f6;
  --fg:#2b2926; --muted:#6e675f; --lead:#47423c;
  --border:#e4e2dd;
  --brand-blue:#57a6cb; --accent:#2c7ea8; --accent-fg:#ffffff;
  --brown:#5a4130; --tan:#c6a878;

  --radius:14px; --chip-radius:999px; --btn-radius:999px;
  --shadow:0 4px 16px rgba(43,41,38,.09);
  --shadow-lg:0 12px 30px -12px rgba(43,41,38,.20);
  --btn-shadow:0 6px 16px rgba(44,126,168,.26);

  --font-display:"Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body:"Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --wrap:1060px;
}

/* ---- Reset / base --------------------------------------------------------- */
* { 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(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent); }

/* Skip link for keyboard users */
.skip-link {
  position: absolute; left: 8px; top: -48px;
  background: var(--surface); color: var(--accent);
  padding: 10px 14px; border-radius: 10px; z-index: 100;
  font-family: var(--font-display); font-weight: 700; font-size: 13px;
  text-decoration: none; box-shadow: var(--shadow);
  transition: top .15s ease;
}
.skip-link:focus { top: 8px; }

/* ---- Brand ribbon (blue book, brown base — echoes the logo) --------------- */
.brandline {
  height: 3px;
  background: linear-gradient(90deg,
    var(--brand-blue) 0%, var(--brand-blue) 62%,
    var(--brown) 62%, var(--brown) 100%);
}

/* ---- Top bar + nav -------------------------------------------------------- */
.app-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.app-top-inner {
  width: 100%; max-width: var(--wrap); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-weight: 800;
  letter-spacing: -.01em; color: var(--fg); font-size: 17px;
  text-decoration: none;
}
.brand svg { flex: none; }

.nav { display: flex; align-items: center; gap: 18px; }
.nav a {
  color: var(--muted); text-decoration: none;
  font-size: 13.5px; font-weight: 600;
  padding-bottom: 2px; border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--fg); }
.nav a.active { color: var(--fg); border-bottom-color: var(--brand-blue); }

/* Mobile menu toggle — button is the only bit of JS the header needs */
.nav-toggle {
  display: none; background: none; border: none; padding: 6px;
  color: var(--muted); cursor: pointer; border-radius: 8px;
}
.nav-toggle svg { width: 24px; height: 24px; display: block; }

@media (max-width: 640px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    padding: 6px 12px 12px;
    display: none;
  }
  .nav.open { display: flex; }
  .nav a {
    padding: 12px 8px; border-bottom: 1px solid var(--border);
    font-size: 15px;
  }
  .nav a:last-child { border-bottom: none; }
  .nav a.active { border-bottom-color: var(--border); color: var(--accent); }
}

/* ---- Page shell ----------------------------------------------------------- */
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 24px 20px 72px; }

/* ---- Breadcrumb ----------------------------------------------------------- */
.crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 16px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); text-decoration: underline; }
.crumbs span { opacity: .5; margin: 0 6px; }

/* ---- Typographic lockup: eyebrow / title / lead --------------------------- */
.eyebrow {
  font-family: var(--font-display); font-size: 11px; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase; color: var(--accent);
  display: inline-block; margin-bottom: 10px;
}
h1.title {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(27px, 6vw, 34px); line-height: 1.12;
  letter-spacing: -.02em; margin: 0 0 12px; color: var(--fg);
}
p.lead { margin: 0 0 22px; color: var(--lead); font-size: 15.5px; line-height: 1.55; }

/* Body headings within prose pages */
.prose h2 { font-family: var(--font-display); font-weight: 800; font-size: 22px; letter-spacing: -.015em; margin: 34px 0 12px; }
.prose h3 { font-family: var(--font-display); font-weight: 700; font-size: 17px; margin: 26px 0 8px; }
.prose p { margin: 0 0 16px; color: var(--lead); }
.prose a { color: var(--accent); }

/* ---- Callout / aside ------------------------------------------------------ */
.callout {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; margin: 0 0 22px;
  box-shadow: var(--shadow);
}
.callout .clabel {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-size: 10.5px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: var(--brown);
  margin-bottom: 7px;
}
.callout .clabel::before {
  content: ""; width: 15px; height: 15px; border-radius: 999px;
  background: var(--brown); display: inline-block;
}
.callout p { margin: 0; font-size: 14px; color: var(--fg); }

/* ---- Parameter table ------------------------------------------------------ */
.table-scroll { overflow-x: auto; margin: 0 0 22px; }
table.params { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 420px; }
table.params th, table.params td { text-align: left; padding: 9px 11px; border-bottom: 1px solid var(--border); }
table.params thead th {
  font-family: var(--font-display); font-size: 10px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted); font-weight: 700;
}
table.params td.num { font-variant-numeric: tabular-nums; color: var(--lead); }
table.params td.src { font-weight: 700; color: var(--fg); }
table.params tbody tr:last-child td { border-bottom: none; }

/* ---- Link chips ----------------------------------------------------------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip {
  font-size: 13px; font-weight: 600; color: var(--fg); text-decoration: none;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--chip-radius); padding: 8px 14px;
  display: inline-flex; align-items: center; gap: 7px;
  box-shadow: var(--shadow);
  transition: border-color .15s ease, transform .15s ease;
}
.chip:hover { border-color: var(--accent); transform: translateY(-1px); }
.chip svg { width: 14px; height: 14px; color: var(--accent); flex: none; }

/* ---- Primary button ------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--accent); color: var(--accent-fg); text-decoration: none;
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
  padding: 14px 20px; border-radius: var(--btn-radius);
  box-shadow: var(--btn-shadow);
  transition: filter .15s ease, transform .15s ease;
}
.btn:hover { filter: brightness(1.07); transform: translateY(-1px); }
.btn.block { width: 100%; }

/* ---- Related-links footer ------------------------------------------------- */
.related { border-top: 1px solid var(--border); padding-top: 18px; margin-top: 8px; }
.related .rlabel {
  font-family: var(--font-display); font-size: 10px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 12px; font-weight: 700;
}

/* ---- Site footer ---------------------------------------------------------- */
.site-foot {
  border-top: 1px solid var(--border); background: var(--surface);
  color: var(--muted); font-size: 13px;
}
.site-foot-inner {
  max-width: var(--wrap); margin: 0 auto; padding: 22px 20px;
  display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; justify-content: space-between;
}
.site-foot a { color: var(--muted); text-decoration: none; }
.site-foot a:hover { color: var(--accent); text-decoration: underline; }
.site-foot .foot-tag { font-family: var(--font-display); color: var(--brown); font-weight: 600; }

/* ---- Focus + motion (a11y floor) ----------------------------------------- */
a:focus-visible, .chip:focus-visible, .btn:focus-visible,
.card:focus-visible, .nav-toggle:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  .chip, .btn, .card, .skip-link { transition: none; }
}

/* ==========================================================================
   HOME-ONLY components (router page). Same token language as above.
   ========================================================================== */

/* Hero lockup */
.hero { margin: 8px 0 6px; }
.hero-lockup {
  display: flex; align-items: center; gap: 16px;
  padding: 22px 24px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.hero-lockup::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg,
    var(--brand-blue) 0%, var(--brand-blue) 62%,
    var(--brown) 62%, var(--brown) 100%);
}
.hero-mark { display: inline-flex; flex: none; }
.hero-text { display: flex; flex-direction: column; }
.hero-name {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(28px, 8vw, 34px); letter-spacing: -.02em;
  color: var(--fg); line-height: 1;
}
.hero-tag {
  font-family: var(--font-body); font-size: 15px; font-weight: 500;
  color: var(--brown); margin-top: 8px;
}
.hero-sub { margin: 18px 2px 0; color: var(--lead); font-size: 15.5px; max-width: 60ch; }

/* Search box (progressive-enhancement stub; usable box now, wired later) */
.search { margin: 22px 0 8px; }
.search label { display: block; font-family: var(--font-display); font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.search-field { position: relative; display: flex; align-items: center; }
.search-field svg { position: absolute; left: 14px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.search input {
  width: 100%; font-family: var(--font-body); font-size: 15px; color: var(--fg);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--chip-radius); padding: 13px 16px 13px 42px;
  box-shadow: var(--shadow);
}
.search input::placeholder { color: var(--muted); }
.search input:focus { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 1px; }

/* Search results (Home) — live client-side filter, progressive enhancement */
.search-results {
  list-style: none; margin: 8px 0 0; padding: 6px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow-lg);
}
.search-results[hidden] { display: none; }
.search-results a {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--fg);
}
.search-results a:hover, .search-results a:focus { background: var(--surface-2); outline: none; }
.search-results .sr-title { font-family: var(--font-display); font-weight: 600; font-size: 15px; }
.search-results .sr-sec { font-size: 12px; color: var(--muted); flex: none; white-space: nowrap; }
.search-results .sr-none { padding: 10px 12px; color: var(--muted); font-size: 14px; }

/* Intent router cards */
.section-label {
  font-family: var(--font-display); font-size: 11px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
  margin: 34px 2px 14px;
}
.cards { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 620px) { .cards { grid-template-columns: 1fr 1fr; } }

.card {
  display: flex; align-items: flex-start; gap: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
  text-decoration: none; color: var(--fg);
  box-shadow: var(--shadow);
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.card-ic {
  flex: none; width: 44px; height: 44px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--accent);
}
.card-ic svg { width: 22px; height: 22px; }
.card-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.card-title {
  font-family: var(--font-display); font-weight: 700; font-size: 16.5px;
  letter-spacing: -.01em; display: inline-flex; align-items: center; gap: 6px;
}
.card-title .arrow { color: var(--accent); transition: transform .15s ease; }
.card:hover .card-title .arrow { transform: translateX(3px); }
.card-desc { font-size: 13.5px; color: var(--muted); line-height: 1.45; }

/* Featured "start" card spans full width on 2-col */
@media (min-width: 620px) { .card.wide { grid-column: 1 / -1; } }

/* "Coming soon" card — a non-link placeholder on hub/index pages */
.card.soon { opacity: .62; cursor: default; }
.card.soon:hover { transform: none; border-color: var(--border); box-shadow: var(--shadow); }
.card .soon-tag {
  display: inline-block; font-family: var(--font-display); font-size: 10px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
  border: 1px solid var(--border); border-radius: 999px; padding: 2px 8px; margin-top: 6px;
}
/* Number badge inside a card icon tile (Guide parts) */
.card-ic .num { font-family: var(--font-display); font-weight: 800; font-size: 18px; color: var(--accent); }

/* ==========================================================================
   ARTICLE PAGES — the reading measure + prose primitives used by Start Here,
   the Guide, and the How-to pattern below. Wrap article content in `.doc`.
   ========================================================================== */
.doc { max-width: 720px; }
.doc > h2 {
  font-family: var(--font-display); font-weight: 800; font-size: 21px;
  letter-spacing: -.015em; line-height: 1.2; margin: 34px 0 12px; color: var(--fg);
}
.doc > h3 { font-family: var(--font-display); font-weight: 700; font-size: 17px; margin: 24px 0 8px; color: var(--fg); }
.doc > p { margin: 0 0 16px; color: var(--lead); }
.doc a { color: var(--accent); }
.doc strong { color: var(--fg); font-weight: 700; }
.doc ul, .doc ol { margin: 0 0 18px; padding-left: 1.3em; color: var(--lead); }
.doc li { margin: 0 0 8px; }
.doc blockquote { margin: 0 0 20px; }

/* Inline code + preformatted blocks */
.doc code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em;
  background: var(--surface-2); padding: 1px 5px; border-radius: 4px; color: var(--fg);
}
.doc pre {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 16px; overflow-x: auto; margin: 0 0 20px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; color: var(--fg);
}
.doc pre code { background: none; padding: 0; }

/* Signal-flow chain — wrapping pills, phone-friendly (used for the channel chain) */
ul.flow { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 22px; padding: 0; }
ul.flow li {
  font-family: var(--font-display); font-weight: 600; font-size: 12.5px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px;
  padding: 5px 11px; color: var(--fg);
}
ul.flow li.arr { background: none; border: none; padding: 0 1px; color: var(--muted); font-weight: 700; }

/* ==========================================================================
   HOW-TO PAGE PATTERN — the approved structure for all 11 "Do It on the X32"
   pages: Why am I doing this / The short version / Before you start /
   Step by step / What good looks like / If it goes wrong / Related.
   Canonical skeleton: docs/reference/howto-template.html. See docs/DESIGN.md.
   ========================================================================== */

/* Shared little section label (reused by .why and .tldr) */
.why .clabel, .tldr .clabel {
  display: block; font-family: var(--font-display); font-size: 10.5px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; margin-bottom: 7px;
}

/* "Why am I doing this?" — accent lead callout, the page's reason for existing */
.why {
  background: var(--surface-2); border: 1px solid var(--border);
  border-left: 4px solid var(--accent); border-radius: var(--radius);
  padding: 15px 18px; margin: 0 0 24px;
}
.why .clabel { color: var(--accent); }
.why p { margin: 0; font-size: 15px; color: var(--fg); }

/* "The short version" — the scannable TL;DR card for people who just need the reminder */
.tldr {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; margin: 0 0 26px; box-shadow: var(--shadow);
}
.tldr .clabel { color: var(--brown); }
.tldr ol { margin: 0; padding-left: 1.25em; color: var(--fg); }
.tldr ol li { margin: 5px 0; }

/* "Before you start" — checklist with accent ticks */
ul.checklist { list-style: none; margin: 0 0 24px; padding: 0; }
ul.checklist li { position: relative; padding-left: 30px; margin: 0 0 12px; color: var(--lead); }
ul.checklist li::before {
  content: ""; position: absolute; left: 2px; top: 4px; width: 16px; height: 16px;
  background: no-repeat center / contain
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232c7ea8' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
}

/* "Step by step" — numbered blocks with accent badges */
ol.steps { list-style: none; counter-reset: step; margin: 0 0 26px; padding: 0; }
ol.steps > li { position: relative; padding-left: 48px; margin: 0 0 22px; counter-increment: step; }
ol.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 32px; height: 32px; border-radius: 999px; background: var(--accent); color: var(--accent-fg);
  font-family: var(--font-display); font-weight: 700; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
ol.steps > li .step-title {
  font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--fg);
  margin: 4px 0 6px; line-height: 1.25;
}
ol.steps > li p { margin: 0 0 10px; color: var(--lead); }
ol.steps > li p:last-child { margin-bottom: 0; }

/* Warning callout — genuine safety/damage notes (e.g. ribbon mics + phantom).
   Deliberately off-palette (amber) so it reads as an alert, not a normal aside. */
.warn {
  background: #fdf6ec; border: 1px solid #f0e0c6; border-left: 4px solid #c8862a;
  border-radius: var(--radius); padding: 15px 18px; margin: 0 0 24px;
}
.warn .clabel {
  display: block; font-family: var(--font-display); font-size: 10.5px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: #a9691a; margin-bottom: 6px;
}
.warn p { margin: 0 0 10px; font-size: 14.5px; color: var(--fg); }
.warn p:last-child { margin-bottom: 0; }

/* Tick-box checklist — native checkboxes, no JS. For Sunday runbooks the
   volunteer can actually tap through. State doesn't persist (by design — no
   storage dependency); it's a single-pass, top-to-bottom checklist. */
ul.tasklist { list-style: none; margin: 0 0 24px; padding: 0; }
ul.tasklist li { margin: 0 0 10px; }
ul.tasklist label { display: flex; gap: 11px; align-items: flex-start; cursor: pointer; color: var(--lead); }
ul.tasklist input[type="checkbox"] {
  margin: 3px 0 0; width: 18px; height: 18px; flex: none; accent-color: var(--accent); cursor: pointer;
}
ul.tasklist label:hover { color: var(--fg); }

/* "If it goes wrong" — symptom/fix pairs (a definition list is the right semantics).
   dl.glossary shares the styling for term/definition lists. */
dl.troubles, dl.glossary { margin: 0 0 24px; }
dl.troubles dt, dl.glossary dt { font-family: var(--font-display); font-weight: 700; color: var(--fg); margin: 18px 0 5px; }
dl.troubles dt:first-child, dl.glossary dt:first-child { margin-top: 0; }
dl.troubles dd, dl.glossary dd { margin: 0; color: var(--lead); }
dl.glossary dd { margin-left: 0; }
