/* Theme tokens + prose styling for the static legal pages (privacy.html, terms.html,
   data-confidentiality.html).

   THE TOKEN VALUES BELOW ARE A COPY of the app's theme — the subset long-form prose needs — and a
   copy is exactly the drift class the theming work exists to kill. The copy is tolerated on two
   conditions: these pages cannot reach the app's <style> block (they must be public, standalone,
   and never boot the app), and tests/legal-pages.test.mjs asserts every value here equals the
   app's, per combination, so an edit to one place fails loudly. Do not change a colour here
   without changing it in pipeflowv2.html, and vice versa.

   Deliberate differences from the app, reported rather than snuck in: body copy is 15px (the
   app's 13px is dense-UI sizing, marginal for 200 lines of legal prose) and body text uses
   --text, not --text2 — --text2 is reserved for the header/footer meta. */

:root {
  --bg: #08070A;
  --surface: #0D0C10;
  --text: #EDE8DE;
  --text2: #8E8A82;
  --text3: #4E4B46;
  --border-a: 9%;
}
[data-theme="light"] {
  --bg: #F3F5F9;
  --surface: #FFFFFF;
  --text: #0B1120;
  --text2: #475569;
  --text3: #94A3B8;
  --border-a: 8%;
}
/* The 2x2 accent lookup — same cells, same values, same tiers as the app. */
[data-accent="gold"] {
  --accent: #D4B45F;
  --accent-text: #D4B45F;
}
[data-accent="blue"] {
  --accent: #5C85FF;
  --accent-text: #5C85FF;
}
[data-theme="light"][data-accent="gold"] {
  --accent: #EACE7E;
  --accent-text: #8B6418;
  --border-a: 14%;
}
[data-theme="light"][data-accent="blue"] {
  --accent: #0038E0;
  --accent-text: #0038E0;
}
:root { --border: color-mix(in srgb, var(--accent) var(--border-a), transparent); }

* { box-sizing: border-box; margin: 0; padding: 0; }
/* LIGATURES OFF AT THE ROOT, so it inherits to every element — headings, body copy, table cells,
   links, footer. The first fix set this on .legal-brand alone, which cured the wordmark's fl and
   left every other fi/fl/ff on the pages joining. Per-selector suppression is exactly how that
   class of miss happens, so the declaration lives where inheritance does the sweeping. Both
   properties, because coverage differs across browsers: font-variant-ligatures is the CSS-level
   switch, font-feature-settings turns the OpenType liga/clig features off underneath it. */
html { font-variant-ligatures: none; font-feature-settings: "liga" 0, "clig" 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 15px;
  line-height: 1.75;
}
.legal-wrap { max-width: 760px; margin: 0 auto; padding: 2rem 1.25rem 4rem; }

.legal-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; padding-bottom: 1.1rem; border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}
/* TYPOGRAPHY IS COPIED FROM THE APP and covered by the same sync test as the colours — the
   wordmark shipped in Fraunces, which is the app's PAGE-TITLE face, not its wordmark face, and
   Fraunces joins the fl in "Pipeflow" into a ligature. The app's .logo-text is Playfair Display
   with font-variant-ligatures: none for exactly that reason (pipeflowv2.html:503); this is that
   rule, same family, same ligature setting. Headings below stay Fraunces because the app's
   .page-title is Fraunces — the serif there is deliberate and shared. */
.legal-brand {
  font-family: 'Playfair Display', serif; font-size: 22px; font-weight: 600;
  font-variant-ligatures: none;
  color: var(--text); text-decoration: none;
}
.legal-nav { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; }
.legal-nav a { color: var(--text2); text-decoration: none; }
.legal-nav a:hover { color: var(--accent-text); }

.legal-doc h1 {
  font-family: 'Fraunces', serif; font-size: 30px; font-weight: 600;
  line-height: 1.25; margin: 0 0 1rem;
}
.legal-doc h2 {
  font-family: 'Fraunces', serif; font-size: 20px; font-weight: 600;
  margin: 2.2rem 0 0.7rem;
}
.legal-doc h3 { font-size: 15.5px; font-weight: 700; margin: 1.6rem 0 0.5rem; }
.legal-doc p { margin: 0.75rem 0; }
.legal-doc ul { margin: 0.75rem 0 0.75rem 1.4rem; }
.legal-doc li { margin: 0.35rem 0; }
.legal-doc hr { border: none; border-top: 1px solid var(--border); margin: 1.8rem 0; }
.legal-doc a { color: var(--accent-text); }
.legal-doc code {
  font-family: 'JetBrains Mono', monospace; font-size: 0.9em;
  background: color-mix(in srgb, var(--text) 7%, transparent);
  padding: 1px 5px; border-radius: 4px;
}
.legal-doc strong { color: var(--text); }

/* Tables — the Google-scopes and vendor tables. Wide content scrolls inside its own wrapper. */
.tbl-wrap { overflow-x: auto; margin: 1rem 0; }
.legal-doc table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.legal-doc th, .legal-doc td {
  text-align: left; vertical-align: top; padding: 8px 12px;
  border: 1px solid var(--border);
}
.legal-doc th { color: var(--text2); font-weight: 600; background: var(--surface); }

/* Placeholders — [LEGAL ENTITY NAME] and friends. Preserved visibly, styled so they cannot be
   mistaken for final text, never filled in with a guess. */
.ph {
  font-family: 'JetBrains Mono', monospace; font-size: 0.85em;
  color: var(--accent-text);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px dashed color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: 4px; padding: 0 5px; white-space: nowrap;
}

.legal-foot {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-top: 3rem; padding-top: 1.1rem; border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text2);
}
.legal-foot a { color: var(--accent-text); }

/* FOCUS. legal.css previously declared neither :focus nor :focus-visible, so the persistent box
   after a mouse click was the browser's default outline on a click-focused link. :focus-visible
   keeps the indicator for keyboard users and suppresses it for pointer clicks. */
a:focus:not(:focus-visible) { outline: none; }
a:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; border-radius: 2px; }
