/**
 * docEvault — design tokens
 *
 * ONE definition of the palette, consumed by every surface.
 *
 * This file exists because the palette had drifted into three copies: the app
 * declared :root variables in docevault.html, the help center had its own
 * hardcoded set in help-content/_theme.css, and privacy.html / terms.html used
 * literal hex with no accent at all. That is why the help center ended up green
 * while the product was purple — nothing tied them together. Recoloring without
 * fixing that would just drift again.
 *
 * Consumers:
 *   privacy.html, terms.html     <link rel="stylesheet" href="/theme.css">
 *   help-content/_theme.css      inlined by build-help.js
 *   docevault.html               :root mirrored inline (single-file by design;
 *                                keep in sync with this file by hand)
 *
 * Naming: --de-<role>. Roles, not appearances — so "primary" can change hue
 * without every call site reading as a lie.
 */

:root {
  /* ── Ground ──────────────────────────────────────────────────────────────
     Warm off-white rather than a cool grey. The old --bg (#f9f8fc) carried a
     blue cast that read as generic software chrome; this sits closer to paper,
     which suits a product people print from. */
  --de-paper      : #faf9f7;
  --de-paper-2    : #f2f0ec;   /* recessed panels, table stripes */
  --de-paper-3    : #e8e5df;   /* borders on paper */
  --de-white      : #ffffff;   /* cards lifted off the ground */

  /* ── Ink ─────────────────────────────────────────────────────────────────
     Near-black with a slight violet bias so it belongs to the brand rather
     than reading as default #333. */
  --de-ink        : #14161c;   /* headings, primary text */
  --de-ink-2      : #3c3f4d;   /* body text */
  --de-ink-3      : #656776;   /* secondary text */
  --de-ink-4      : #81838f;   /* captions, placeholders */

  /* ── Brand ───────────────────────────────────────────────────────────────
     Deep indigo. The logo already resolved to indigo at its lower edge while
     the CSS had drifted violet (#6c3fc5); this reconciles the two and drops
     the "AI purple" association the old violet carried. */
  --de-primary       : #4338a8;
  --de-primary-hover : #372e8f;
  --de-primary-soft  : #edebf9;   /* tinted backgrounds on paper */
  --de-primary-line  : #d5d0f0;   /* tinted borders */
  --de-primary-lift  : #a99ef0;   /* the accent ON dark grounds */

  /* ── Dark ground ─────────────────────────────────────────────────────────
     Indigo-tinted rather than neutral black, so dark bands read as owned by
     the brand instead of as an absence of colour. */
  --de-night      : #16142b;
  --de-night-2    : #201d3a;   /* raised surfaces on night */
  --de-night-line : #2f2b4d;

  /* ── Semantic ────────────────────────────────────────────────────────────
     Deliberately NOT the brand hue. The old palette used teal for both
     "complete" and (in the help center) for brand, so a success colour was
     doing identity work. Forest is far enough from indigo to never be
     mistaken for it. */
  --de-ok         : #1f6f4a;
  --de-ok-soft    : #e4f1ea;
  --de-warn       : #945e11;
  --de-warn-soft  : #fbf1e0;
  --de-danger     : #b03024;
  --de-danger-soft: #fbeae8;
  --de-info       : #24559b;
  --de-info-soft  : #e8effa;

  /* ── Type ────────────────────────────────────────────────────────────────
     Unchanged: Syne for display, Inter for text. Both already in use and both
     still current — the identity problem was colour, not typography. */
  --de-font-display: 'Syne', 'Inter', system-ui, sans-serif;
  --de-font-text   : 'Inter', system-ui, -apple-system, sans-serif;
  --de-font-mono   : ui-monospace, Menlo, Consolas, monospace;

  /* ── Shape & depth ───────────────────────────────────────────────────── */
  --de-r-sm : 8px;
  --de-r    : 12px;
  --de-r-lg : 18px;
  --de-shadow    : 0 2px 12px rgba(20, 22, 28, 0.06);
  --de-shadow-lg : 0 12px 40px rgba(20, 22, 28, 0.12);
}

/*
 * Legacy aliases.
 *
 * docevault.html has 226 usages of var(--purple) and 87 of var(--teal). These
 * map the old names onto the new values so the recolour lands without a
 * 300-call-site find-and-replace, which is where a manual sweep would miss one
 * and leave a stray violet in a modal nobody opens often.
 *
 * New code uses the --de-* names. These are a migration aid, not an API.
 */
:root {
  --ink: var(--de-ink); --ink2: var(--de-ink-2);
  --ink3: var(--de-ink-3); --ink4: var(--de-ink-4);

  --bg: var(--de-paper); --bg2: var(--de-paper-2); --bg3: var(--de-paper-3);
  --white: var(--de-white); --border: var(--de-paper-3);

  --purple: var(--de-primary); --purple-bg: var(--de-primary-soft);

  /* Teal kept as the success colour it always semantically was, now forest. */
  --teal: var(--de-ok); --teal-bg: var(--de-ok-soft); --teal-dark: #17553a;

  --blue: var(--de-info);   --blue-bg: var(--de-info-soft);
  --amber: var(--de-warn);  --amber-bg: var(--de-warn-soft);
  --red: var(--de-danger);  --red-bg: var(--de-danger-soft);

  --shadow: var(--de-shadow); --shadow-lg: var(--de-shadow-lg);
}
