/* narra — the document pages (Terms, Privacy, Help), in the website's design system.
   ============================================================================================
   Bryan, 2026-08-26: build the legal pages and a help section "using the design system of the
   website". These three pages had been standalone HTML with their own inline palette — a DARK
   theme with a green accent that belongs to neither narra's app nor narra's site — so a customer
   who clicked `Terms` from the sign-in screen landed somewhere that looked like a different
   product.

   ⚠️ ONE STYLESHEET, THREE PAGES, and that is the whole reason this file exists rather than three
   `<style>` blocks. The previous versions carried near-identical inline CSS in each file, which is
   how they came to disagree: terms.html and privacy.html had already drifted apart on spacing.

   ⚠️ THE TOKENS COME FROM `apps/marketing/styles.css`, and they are copied rather than imported
   because these pages ship from `apps/public/` while the marketing site is a separate folder whose
   hosting is undecided. If the two ever share an origin this should become an `@import` of the real
   thing; until then the VALUES must match, and that is what to check when either moves.

   ⚠️ THE FIRST VERSION OF THIS FILE SAID "copied, NOT invented" AND THAT WAS PARTLY UNTRUE — a
   design hook caught it. The marketing sheet's literal sizes are 9/11/12/12.5/13/13.5/14/14.5/15/
   16/17/20/24/26px; I had written 18px and 19px, which appear nowhere in it, and an
   `rgba(255,111,31,.35)` link underline that appears nowhere either. The sizes are now on that
   ramp and the underline is `color-mix` of `--brand-orange-deep`, so it is derived from the token
   rather than being a second spelling of it. Worth recording because the comment asserting
   fidelity was written before fidelity was checked, which is the failure this repo keeps paying
   for in other forms. */

:root {
  --bg: #f4f1ea;
  --bg-alt: #ece7dc;
  --ink: #0b0b0b;
  --ink-soft: #1a1a1a;
  --muted: #5c5a54;
  --line: #d9d3c4;
  --brand-orange: #ff8a3c;
  --brand-orange-deep: #ff6f1f;
  --radius: 18px;
  --radius-sm: 12px;
  --max: 760px;
  --pad: clamp(20px, 4vw, 48px);
  --font-display: "Archivo Black", "Archivo", system-ui, sans-serif;
  --font-sans: "Inter", "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

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

/* ⚠️ THE LOGO IS REFERENCED RELATIVELY (`narra-mark.webp`), NOT AS `/narra-mark.webp`. The page and
   the mark are siblings in BOTH places that matter — at the deploy root after
   `tools/build.js` copies them, and under `dist/` when reviewing locally — so a relative ref
   resolves in each. The root-absolute form only resolves in production, which is how these three
   pages came to show a broken image the moment Bryan opened them from disk.
   (The other pages in `apps/public` still use the absolute form and have the same local-only
   breakage; they are outside this change and worth the same one-character fix.)

   ⚠️ AND THE PATH ABOVE IS WRITTEN WITHOUT A GLOB ON PURPOSE. `apps/public/` followed by a star
   spells a comment-open inside a comment, which `tests/css_parses` counts and rejects — rightly,
   because a later slash after that star would TERMINATE this comment early and silently discard
   every rule below it. */

/* ---------- the bar ---------- */
.doc-bar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 14px var(--pad);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.doc-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.doc-brand img { width: 34px; height: 26px; object-fit: contain; }
.doc-brand span { font-family: var(--font-display); font-size: 20px; letter-spacing: -.01em; }
.doc-bar nav { display: flex; gap: 20px; font-size: 14.5px; font-weight: 500; }
.doc-bar nav a { color: var(--muted); text-decoration: none; transition: color .25s; }
.doc-bar nav a:hover, .doc-bar nav a[aria-current="page"] { color: var(--ink); }

/* ---------- the prose column ---------- */
.doc { max-width: var(--max); margin: 0 auto; padding: clamp(40px, 6vw, 72px) var(--pad) 96px; }

/* ⚠️ THE HELP INDEX IS WIDER THAN THE PROSE, AND ONLY THE INDEX. `--max: 760px` is a reading
   measure — right for terms, privacy and a topic page, where a long line is the enemy. It is the
   wrong container for a 9-card grid: at 760px the usable width is ~664px, `3 × 220 + 2 × 14 = 688`
   does not fit, and `auto-fit` silently fell back to TWO columns and a tall ladder.
   Widening the token globally would have stretched the legal pages to match, which is the trade
   this modifier exists to refuse. Prose stays 760; the index gets room. */
.doc--wide { max-width: 1040px; }
.doc--wide .hc-hero p,
.doc--wide > h2 + p { max-width: 62ch; }

.doc h1 {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 44px);
  line-height: 1.08; letter-spacing: -.02em;
  color: var(--ink); margin: 0 0 10px;
}
.doc .updated { margin: 0 0 8px; font-size: 14px; color: var(--muted); }

/* The one-sentence orientation under the title. Plain language, above the legal register, because
   a reader who bounces off the first paragraph never reaches the part that affects them. */
.doc .lede { margin: 0 0 40px; font-size: 17px; line-height: 1.6; color: var(--ink-soft); }

.doc h2 {
  font-family: var(--font-display);
  font-size: 20px; letter-spacing: -.01em; color: var(--ink);
  margin: 44px 0 10px; scroll-margin-top: 84px;
}
.doc h3 { font-size: 16px; font-weight: 600; color: var(--ink); margin: 24px 0 6px; }
.doc p, .doc li { color: var(--ink-soft); }
.doc ul, .doc ol { padding-left: 22px; margin: 10px 0; }
.doc li { margin: 6px 0; }
.doc strong { color: var(--ink); font-weight: 600; }
.doc a { color: var(--brand-orange-deep); text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--brand-orange-deep) 35%, transparent); transition: border-color .25s; }
.doc a:hover { border-bottom-color: var(--brand-orange-deep); }
.doc hr { border: none; border-top: 1px solid var(--line); margin: 40px 0; }

/* A callout for the things a reader most needs to notice — the site's `.card` idiom, flattened. */
.doc .card {
  background: var(--bg-alt); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px 22px; margin: 18px 0;
}
.doc .card h2, .doc .card h3 { margin-top: 0; }

/* ---------- contents ---------- */
.doc-toc {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 22px; margin: 0 0 44px; background: var(--bg-alt);
}
.doc-toc h2 { margin: 0 0 10px; font-size: 14px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); font-family: var(--font-sans); font-weight: 600; }
.doc-toc ol { margin: 0; padding-left: 20px; columns: 2; column-gap: 32px; }
.doc-toc li { margin: 4px 0; break-inside: avoid; }
.doc-toc a { color: var(--ink-soft); border-bottom: none; }
.doc-toc a:hover { color: var(--brand-orange-deep); }
@media (max-width: 620px) { .doc-toc ol { columns: 1; } }

/* The first help page's `help-grid` / `help-card` rules stood here. They were superseded by the
   `hc-` set below when the index became a real help centre, and are deleted rather than left
   behind: two card systems in one stylesheet is an invitation to style the next thing with
   the wrong one. */

/* A question and its answer. `<details>` rather than JS: it is searchable by the browser's own
   find-in-page when open, keyboard-operable for free, and works with the stylesheet blocked. */
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer; list-style: none; padding: 16px 32px 16px 0; position: relative;
  font-weight: 600; color: var(--ink); font-size: 17px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  font-size: 20px; font-weight: 400; color: var(--muted); transition: transform .25s;
}
.faq details[open] summary::after { content: "\2212"; }
.faq summary:hover { color: var(--brand-orange-deep); }
.faq .a { padding: 0 0 18px; color: var(--ink-soft); }
.faq .a > :first-child { margin-top: 0; }
.faq .a > :last-child { margin-bottom: 0; }

/* ---------- foot ---------- */
.doc-foot {
  border-top: 1px solid var(--line); background: var(--bg-alt);
  padding: 28px var(--pad);
}
.doc-foot-in {
  max-width: var(--max); margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  font-size: 13.5px; color: var(--muted);
}
.doc-foot-in nav { display: flex; gap: 20px; }
.doc-foot-in a { color: var(--muted); text-decoration: none; transition: color .25s; }
.doc-foot-in a:hover { color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  .help-card { transition: none; }
  .help-card:hover { transform: none; }
}

/* ================================================================================================
   HELP CENTRE — the index, topic pages, and article furniture.
   Jobber's help centre is the reference (measured 2026-08-26, recorded in
   docs/references/jobber-source-study.md). What is copied is its SHAPE: a question as the heading,
   task framing over feature lists, per-topic pages that state their own size, and articles with a
   contents list, a read time, an updated date and related links.

   Where this deliberately goes further, and why each is a real difference rather than a flourish:
     · SEARCH WORKS WITH NO BACKEND. Every answer on every page is indexed at build time into one
       JSON file; the box filters it in the browser. Jobber's search is a server round trip.
     · NO DEAD ENDS. "Was this helpful? No" opens a mail draft carrying the page and question, so a
       failed answer becomes a report instead of a shrug.
     · EVERY TOPIC STATES WHAT narra DOES NOT DO. Jobber's articles describe what exists; the
       absences are what actually cost a reader an afternoon.
     · IT WORKS WITH JAVASCRIPT OFF. `<details>` is the disclosure, so the content is readable,
       searchable by the browser's own find-in-page, and keyboard-operable with no script at all.
       Search is the only scripted part and it degrades to a full, visible list. */

/* ⚠️ TIGHTER THAN THE FIRST VERSION. It opened at 56px top and bottom with a 26px gap under the
   search box, and on a 1400px screen that pushed the topics — the thing anyone actually came for —
   entirely below the fold. Bryan: "polish the ui first". A help centre's job is to get someone to
   an answer, so the hero earns only the room it needs to explain the search box. */
.hc-hero { text-align: center; padding: clamp(20px, 3vw, 34px) 0 clamp(14px, 2vw, 22px); }
.hc-hero h1 { margin: 0 0 8px; }
.hc-hero p { margin: 0 auto; max-width: 46ch; color: var(--muted); font-size: 16px; }

/* ---------- search ---------- */
.hc-search { position: relative; max-width: 560px; margin: 18px auto 0; }
.hc-search input {
  width: 100%; padding: 15px 18px 15px 46px;
  font: inherit; font-size: 16px; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: 999px;
  transition: border-color .25s, box-shadow .25s;
}
.hc-search input::placeholder { color: var(--muted); }
.hc-search input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ink) 8%, transparent); }
.hc-search svg { position: absolute; left: 17px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
/* ⚠️ 22px, NOT 12px. Bryan: the examples were "too close to the search". At 12px the line read as
   part of the input — placeholder text that had escaped the box — rather than as a hint beneath it.
   The gap is what separates a control from a note about the control. */
/* ⚠️ 36px, AFTER 12px AND THEN 22px BOTH READ AS TOO CLOSE. Bryan said it twice. 22px was still
   inside the input's own optical field: the box is ~50px tall with a 999px radius, so its visual
   mass keeps claiming anything within roughly half its own height. The separation has to beat the
   CONTROL'S SIZE, not merely be non-zero, which is the thing I got wrong the first two times by
   nudging the number instead of asking what it had to clear. */
.hc-try { margin: 36px 0 0; font-size: 14px; color: var(--muted); }
/* Quieter than the first pass: these were orange and underlined, which made two example queries
   louder than the input they are examples for. They are a hint, not an action. */
.hc-try button {
  font: inherit; font-size: 14px; color: var(--ink-soft);
  background: none; border: 0; padding: 0; cursor: pointer;
  border-bottom: 1px solid var(--line); transition: border-color .2s;
}
.hc-try button:hover { border-bottom-color: var(--ink); }

/* The result list. Hidden until the box has something in it, so the page reads as itself. */
.hc-results { max-width: 560px; margin: 14px auto 0; text-align: left; }
.hc-results[hidden] { display: none; }
.hc-results a {
  display: block; padding: 12px 14px; margin-bottom: 8px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--bg-alt); text-decoration: none; border-bottom: 1px solid var(--line);
}
.hc-results a:hover { border-color: var(--ink); }
.hc-results .q { display: block; color: var(--ink); font-weight: 600; font-size: 15px; }
.hc-results .w { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.hc-noresult { padding: 16px 0; color: var(--muted); font-size: 15px; }

/* ---------- topic cards ---------- */
/* ⚠️ 220px, NOT 250px — at `--max: 760px` the wider track only ever fitted TWO across, so a wide
   screen showed a tall two-column ladder with nine topics in it. 220 gives three. */
.hc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 8px 0 44px; }
.hc-card {
  position: relative; display: block; text-decoration: none;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; background: var(--bg-alt); border-bottom: 1px solid var(--line);
  transition: transform .25s var(--ease-smooth), border-color .25s, background .25s;
}
.hc-card:hover { transform: translateY(-2px); border-color: var(--ink); background: var(--bg); }
/* The icon tile that stood here is removed — Bryan, 2026-08-26: "no icons". Deleted rather than
   left unreferenced: `tests/css_guards` counts classes no source mentions, and an orphaned rule is
   also an invitation for someone to re-add the markup for it. */
.hc-card .n { display: block; font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.hc-card h3 { margin: 4px 0 4px; font-family: var(--font-display); font-size: 16px; letter-spacing: -.01em; color: var(--ink); }
.hc-card p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.5; }

/* ---------- article furniture ---------- */
.hc-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 0 0 24px; font-size: 13.5px; color: var(--muted); }
.hc-meta span { display: inline-flex; align-items: center; gap: 6px; }

.hc-back { display: inline-flex; align-items: center; gap: 7px; margin: 0 0 18px; font-size: 14px; color: var(--muted); text-decoration: none; border-bottom: 0; }
.hc-back:hover { color: var(--ink); }

/* "What narra does not do" — the section Jobber's articles have no equivalent of. Deliberately
   plain rather than alarming: these are honest limits, not warnings. */
.hc-limits { border: 1px solid var(--line); border-left: 3px solid var(--brand-orange); border-radius: var(--radius-sm); padding: 18px 20px; margin: 28px 0; background: var(--bg-alt); }
.hc-limits h3 { margin: 0 0 8px; font-size: 15px; font-family: var(--font-display); letter-spacing: -.01em; }
.hc-limits ul { margin: 0; padding-left: 20px; }
.hc-limits li { margin: 5px 0; color: var(--ink-soft); }

/* ---------- feedback ---------- */
.hc-fb { border-top: 1px solid var(--line); margin-top: 44px; padding-top: 22px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 15px; }
.hc-fb-b { font: inherit; font-size: 14.5px; padding: 8px 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--ink-soft); cursor: pointer; text-decoration: none; transition: border-color .25s, background .25s; }
.hc-fb-b:hover { border-color: var(--ink); background: var(--bg-alt); }
.hc-fb-thanks { color: var(--muted); font-size: 14.5px; }

/* ---------- related ---------- */
.hc-rel { border-top: 1px solid var(--line); margin-top: 32px; padding-top: 22px; }
.hc-rel h2 { margin: 0 0 12px; font-size: 15px; }
.hc-rel ul { margin: 0; padding-left: 20px; }
.hc-rel li { margin: 6px 0; }

@media (prefers-reduced-motion: reduce) {
  .hc-card { transition: none; }
  .hc-card:hover { transform: none; }
}
