/*
 * signet-tokens.css — the Signet design system, whole and self-contained.
 *
 * Version: 3.0.0 (2026-08-22) — the INSTRUMENT system.
 * Identity: warm bone paper, warm ink, the seal teal as the only accent,
 * pill buttons, Hanken Grotesk display over Space Mono machine values,
 * hairline rules.
 *
 * WHY THIS REPLACED 2.0.0
 * -----------------------
 * 2.0.0 was the LEDGER system (D128, 2026-08-08): a teal page ground with warm
 * paper cards. The marketing site moved past it on 2026-08-13 — **D187** ruled
 * the instrument: "the seal on the paper, not the paper dyed as the seal" —
 * and signetauth.com has rendered bone-paper-with-teal-seal ever since, while
 * this portal stayed on the teal ground. The operator ruled the conformance on
 * 2026-08-22: a customer walks signetauth.com → payment → this portal, and the
 * style break sat exactly at the money. Values follow the site's stylesheet
 * (bestauth site/lib/styles.ts, the D187 hallmark block); the dark theme
 * follows the site's night palette (2026-08-22). Do not relitigate the hue
 * here — it is a token.
 *
 * THE CONTRACT (unchanged from 1.0.0)
 * -----------------------------------
 * This file is the ONLY thing the two renders of the Signet console share:
 *   1. Signet Cloud (this repo) — aliases its --kp-* theme tokens to these.
 *   2. The engine's in-binary /admin (bestauth repo) — MAY inline this file
 *      verbatim in its base template (as of 2026-08-22 it does not yet).
 *
 * It is dependency-free BY DESIGN, and must stay that way:
 *   - no @import, no url(), no webfonts — nothing is ever fetched, so an
 *     air-gapped host renders the identical page at 2am. The system's real
 *     faces (Hanken Grotesk, Space Mono) are named FIRST in the stacks below
 *     and fall back to system faces wherever nobody has loaded them. Signet
 *     Cloud loads them from `/fonts.css`; the engine may choose not to.
 *   - custom properties only — no classes, no selectors that assume markup.
 *
 * EDITING RULES
 * -------------
 *   - Values may change; names may not. Both renders read the names.
 *   - Light is the identity default (`:root`). The instrument is a light
 *     system: bone paper ground, near-black warm ink, teal held to the seal,
 *     the focus ring, and the solid mark's signal. Dark lives under
 *     [data-theme="dark"] — the site's night palette — and the host page owns
 *     the attribute.
 *   - Keep the two themes in the same order, with the same names, so a diff of
 *     the file is a diff of the palette and nothing else.
 *   - Bump the version when values change.
 *
 * ⚠ ONE NAME COLLIDES WITH THE SYSTEM DOC. The doc's `--paper` is the warm CARD;
 *   this file's `--sg-paper` has meant the PAGE GROUND since 1.0.0 and both
 *   renders read it that way, so it keeps that meaning.
 *
 * CONTRAST NOTES. On the bone ground (#F5EFE3) the full ink is 13.9:1, the dim
 * ink 8.0:1, the muted ink 5.6:1 — unlike the teal ground, secondary text is
 * legible directly on the page, so --sg-ground-ink-dim is a real dim again.
 * The accent (#19A487) is NOT body text (2.7:1 on bone): it is a fill under
 * ink, a seal, a signal on the solid mark — the same law the site states.
 */

:root {
  /* ── the system's own names ─────────────────────────────────────────────── */
  --sg-ground: #f5efe3; /* page ground — warm bone, D187 */
  --sg-tint: #eae2d3; /* hover / raised wash, tracks the ground */
  --sg-card: #fcf9f2; /* the doc's `--paper`: the warm neutral card */
  --sg-warm: #e7ddcd; /* the heavier neutral card */
  --sg-band: #ede5d7; /* inset bands, input grounds, hovers */
  --sg-hair: rgba(23, 18, 12, 0.16); /* hairline rules */

  /* ── palette · light (the default — the instrument is light-first) ─────── */
  --sg-paper: var(--sg-ground); /* PAGE GROUND (see the collision note above) */
  --sg-surface: var(--sg-card); /* panel ground */
  --sg-surface-hi: var(--sg-band); /* raised ground, hover, input ground */
  --sg-border: var(--sg-hair); /* hairline rules */
  --sg-border-strong: rgba(23, 18, 12, 0.58); /* input borders: 4.2:1 on the band (non-text 3:1) */
  --sg-border-subtle: rgba(23, 18, 12, 0.1); /* rules inside a panel */
  --sg-ink: #17120c; /* primary text — never varies between themes' meaning */
  --sg-ink-dim: #47413a; /* secondary text (8.0:1 on ground) */
  --sg-ink-muted: #625d56; /* labels, captions (5.6:1 on ground) */
  --sg-ink-disabled: #6b6353; /* placeholders (4.75:1 on the band input ground) */
  --sg-accent: #19a487; /* the hue at full strength — fills, the seal */
  --sg-accent-hi: #10775f; /* a darker fill for hover (card text on it: 5.2:1) */
  --sg-accent-deep: #0f6e5a; /* the accent as TEXT on card/tint (5.6:1 on card) */
  --sg-accent-bg: #ddeee8; /* a quiet teal wash on the bone family */
  /* Ink laid ON the accent: card-white on #19A487 is only 3.09:1, the near-black
     is 5.98:1. Same choice the marketing site makes. */
  --sg-accent-ink: #17120c;
  --sg-danger: #a33622; /* 6.8:1 on card */
  --sg-danger-bg: #f6e2dc; /* danger ink on it: 5.4:1 */
  --sg-success: #0f6e5a; /* 6.0:1 on card */
  --sg-success-bg: #ddeee8;
  --sg-warn: #7e580e; /* 6.1:1 on card, 5.2:1 on its badge */
  --sg-warn-bg: #f2e7cb; /* warn ink on it: 5.2:1 */
  --sg-info: #2b5e7e; /* 7.0:1 on card */
  --sg-info-bg: #dce8ef; /* info ink on it: 5.7:1 */

  /* Text that sits DIRECTLY on the page ground rather than inside a card. On
     bone a genuine dim tone is legible (8.0:1), so the collapse the teal ground
     forced is over. */
  --sg-ground-ink: #17120c;
  --sg-ground-ink-dim: #47413a;

  /* ── chrome · THEME-INVARIANT ─────────────────────────────────────────────
     The console's sidebar and topbar are ink in BOTH themes — the concept's
     signature, and the same object as the site's ink colophon. */
  --sg-chrome: #17120c; /* the ink rail — the site's ink, warmed */
  --sg-chrome-hi: #201e18; /* its raised ground: hover, the org switcher */
  --sg-chrome-line: #2e2b23; /* its rules */
  --sg-chrome-line-hi: #37332a; /* its borders */
  --sg-chrome-ink: #fcf9f2; /* text on the rail */
  --sg-chrome-dim: #cfc9b8; /* its secondary text */
  --sg-chrome-muted: #8f8a7a; /* its mono micro-labels */

  /* ── the SOLID MARK — the system's strongest object ───────────────────────
     The primary button, the recommended tier, the top-tier badge. The
     instrument's law: ink fill + paper text, never a teal fill and never
     teal-on-ink text — so the signal on the mark is PAPER now, not the
     accent. (2.0.0 put the accent here; D187 forbids that pairing.) */
  --sg-solid: var(--sg-chrome); /* its ground */
  --sg-solid-hi: var(--sg-chrome-hi); /* its hover ground */
  --sg-solid-ink: #fcf9f2; /* the signal text on it: labels, prices */
  --sg-solid-text: var(--sg-chrome-ink); /* body text on it */
  --sg-solid-dim: var(--sg-chrome-dim); /* secondary text on it */

  /* The ring pressed around a ceremony card. */
  --sg-press-ring: #17120c;

  /* ── type — the instrument faces first, system stacks behind them ───────── */
  --sg-font:
    "Hanken Grotesk", ui-sans-serif, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --sg-font-mono:
    "Space Mono", ui-monospace, "IBM Plex Mono", "JetBrains Mono",
    SFMono-Regular, Menlo, Consolas, monospace;

  /* ── scale & spacing — 4px base, the rhythm both consoles already use ──── */
  --sg-text-xs: 11.5px;
  --sg-text-sm: 13px;
  --sg-text-md: 15px;
  --sg-text-lg: 17px;
  --sg-text-xl: 2.1rem;
  --sg-space-1: 4px;
  --sg-space-2: 8px;
  --sg-space-3: 16px;
  --sg-space-4: 24px;
  --sg-space-5: 40px;

  /* ── shape — the pill is load-bearing in this identity, not a preference ── */
  --sg-radius: 14px;
  --sg-radius-card: 22px;
  --sg-radius-lg: 28px;
  --sg-radius-pill: 999px;
  --sg-stroke: 1.5px; /* the system's border weight on pills and ceremonies */

  color-scheme: light;
}

[data-theme="dark"] {
  /* The site's night palette (2026-08-22): the instrument at night — the same
     warm ink family as the code plate, bone text, teal constant. The ground
     steps ABOVE the chrome tokens' floor so the ink rail still separates. */
  --sg-paper: #171309;
  --sg-surface: #211b10;
  --sg-surface-hi: #292217;
  --sg-border: rgba(237, 232, 218, 0.15);
  --sg-border-strong: rgba(237, 232, 218, 0.45);
  --sg-border-subtle: rgba(237, 232, 218, 0.08);
  --sg-ink: #ede8da;
  --sg-ink-dim: #c0b9a9;
  --sg-ink-muted: #9c9581;
  --sg-ink-disabled: #9a927d; /* 5.1:1 on a raised panel */
  --sg-accent: #22b597; /* the seal teal lifted one step for dark grounds —
     the same lift signetauth.com's night palette makes; hue and role held */
  --sg-accent-hi: #2fc9a8;
  --sg-accent-deep: #6fdcc2; /* the accent as TEXT on ink */
  --sg-accent-bg: rgba(34, 181, 151, 0.16);
  --sg-accent-ink: #17120c; /* unchanged: ink is what goes ON the teal */
  --sg-danger: #f08573; /* 5.2:1 on its own badge over a panel */
  --sg-danger-bg: rgba(240, 133, 115, 0.16);
  --sg-success: #6fdcc2;
  --sg-success-bg: rgba(111, 220, 194, 0.14);
  --sg-warn: #e0b25a;
  --sg-warn-bg: rgba(224, 178, 90, 0.14);
  --sg-info: #7fb4d9;
  --sg-info-bg: rgba(127, 180, 217, 0.14);

  --sg-ground-ink: #ede8da;
  --sg-ground-ink-dim: #c0b9a9;

  /* The solid mark inverts, the same way the site's ink-fill buttons do at
     night: bone fill, ink text. An ink pill on an ink page is not a mark, and
     D187's no-teal-fill law holds in the dark too. */
  --sg-solid: #ede8da;
  --sg-solid-hi: #fcf9f2;
  --sg-solid-ink: #17120c;
  --sg-solid-text: #17120c;
  --sg-solid-dim: rgba(23, 18, 12, 0.72);

  --sg-press-ring: rgba(237, 232, 218, 0.34);

  /* The ground name still resolves for anything quoting the system directly. */
  --sg-ground: #171309;
  --sg-tint: #292217;
  --sg-card: #211b10;
  --sg-warm: #241e13;
  --sg-band: #1d1811;
  --sg-hair: rgba(237, 232, 218, 0.15);

  color-scheme: dark;
}
