/* Design tokens — BRAND.md §3.
 *
 * Production inverts the mockups: :root carries dark, and light arrives via
 * prefers-color-scheme. A stored preference overrides both by stamping
 * data-theme on the root element, which is why every value is declared three
 * times rather than once with a media query.
 *
 * The accent is chosen for what it cannot say. It marks what responds to you —
 * focus, links, reader position, selection feedback — and never what the
 * document did. No finding is ever coloured. */

:root {
  /* The one colour outside the neutral set, and the argument for it.
   *
   * The rule it bends says no red, amber or green under any circumstance, and it exists so
   * nothing ever colours a finding about a document. This is not that: it appears only
   * while a pointer is over a closed uploader or a file is being dragged onto one, never at
   * rest, and at a moment when no document exists to make a claim about. That is the same
   * category the accent already covers — a fact about the reader, not about the file.
   *
   * Amber rather than red, and not as a softening: a gate that reopens on a timer is a
   * wait, and red would say something worse than the truth. Desaturated on purpose — a
   * closed door, not an alarm. */
  --blocked-ink: #b08a52;
  --paper: #0b0c0e;
  --card: #131619;
  --card-2: #1a1d22;
  --well: #08090b;

  --fg: #edeff2;
  --body: #c8ccd2;
  --muted: #969ba3;
  --faint: #6d727a;

  --line: #23262b;
  --line-strong: #2f333a;

  --signal: #5aa9f0;
  --signal-press: #4695dc;
  --signal-ink: #041a2e;
  --signal-dim: rgba(90, 169, 240, 0.13);
  --signal-line: rgba(90, 169, 240, 0.3);

  /* Bar ink is tuned per theme, not inherited: a solid dark block on white
     reads heavier than a solid light block on black. */
  --bar-ink: #c8ccd2;
  --glow: rgba(90, 169, 240, 0.055);
  --lift: none;
  --drop: 0 14px 32px -24px rgba(0, 0, 0, 0.95);
  --inset-hi: inset 0 1px 0 rgba(255, 255, 255, 0.04);

  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", "JetBrains Mono", Menlo,
    Consolas, monospace;
  --r-card: 12px;
  --r-control: 8px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* Fallback only. With JavaScript, theme.js stamps data-theme on the root from
   the reader's local clock — light 08:00–20:00, dark otherwise — and a stored
   choice outranks both. This block is what a reader without JavaScript gets. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    /* The one colour outside the neutral set, and the argument for it.
     *
     * The rule it bends says no red, amber or green under any circumstance, and it exists so
     * nothing ever colours a finding about a document. This is not that: it appears only
     * while a pointer is over a closed uploader or a file is being dragged onto one, never at
     * rest, and at a moment when no document exists to make a claim about. That is the same
     * category the accent already covers — a fact about the reader, not about the file.
     *
     * Amber rather than red, and not as a softening: a gate that reopens on a timer is a
     * wait, and red would say something worse than the truth. Desaturated on purpose — a
     * closed door, not an alarm. */
    --blocked-ink: #8f6b2c;
    --paper: #f6f7f9;
    --card: #ffffff;
    --card-2: #edeff3;
    --well: #e9ecf1;

    --fg: #14171b;
    --body: #3b4149;
    --muted: #676e78;
    --faint: #8b919b;

    --line: #e2e5ea;
    --line-strong: #d2d6dd;

    --signal: #1b6fd0;
    --signal-press: #155ab0;
    --signal-ink: #ffffff;
    --signal-dim: rgba(27, 111, 208, 0.09);
    --signal-line: rgba(27, 111, 208, 0.34);

    --bar-ink: #565d67;
    --glow: rgba(27, 111, 208, 0.04);
    --lift: 0 1px 2px rgba(16, 24, 40, 0.04), 0 2px 6px -2px rgba(16, 24, 40, 0.07);
    --drop: 0 10px 26px -20px rgba(16, 24, 40, 0.55);
    --inset-hi: none;
  }
}

/* An explicit choice wins over the system in both directions. */
:root[data-theme="light"] {
  /* The one colour outside the neutral set, and the argument for it.
   *
   * The rule it bends says no red, amber or green under any circumstance, and it exists so
   * nothing ever colours a finding about a document. This is not that: it appears only
   * while a pointer is over a closed uploader or a file is being dragged onto one, never at
   * rest, and at a moment when no document exists to make a claim about. That is the same
   * category the accent already covers — a fact about the reader, not about the file.
   *
   * Amber rather than red, and not as a softening: a gate that reopens on a timer is a
   * wait, and red would say something worse than the truth. Desaturated on purpose — a
   * closed door, not an alarm. */
  --blocked-ink: #8f6b2c;
  --paper: #f6f7f9;
  --card: #ffffff;
  --card-2: #edeff3;
  --well: #e9ecf1;

  --fg: #14171b;
  --body: #3b4149;
  --muted: #676e78;
  --faint: #8b919b;

  --line: #e2e5ea;
  --line-strong: #d2d6dd;

  --signal: #1b6fd0;
  --signal-press: #155ab0;
  --signal-ink: #ffffff;
  --signal-dim: rgba(27, 111, 208, 0.09);
  --signal-line: rgba(27, 111, 208, 0.34);

  --bar-ink: #565d67;
  --glow: rgba(27, 111, 208, 0.04);
  --lift: 0 1px 2px rgba(16, 24, 40, 0.04), 0 2px 6px -2px rgba(16, 24, 40, 0.07);
  --drop: 0 10px 26px -20px rgba(16, 24, 40, 0.55);
  --inset-hi: none;
}

@media print {
  :root, :root[data-theme="light"], :root[data-theme="dark"] {
    --paper: #fff; --card: #fff; --card-2: #fff; --well: #f4f5f7;
    --fg: #000; --body: #1a1a1a; --muted: #444; --faint: #666;
    --line: #ccc; --line-strong: #bbb; --bar-ink: #333; --glow: transparent;
    --lift: none; --drop: none; --inset-hi: none;
  }
}
