/* ─────────────────────────────────────────────────────────────
   Clyffe — Design system tokens (single source of truth for web apps)
   Reconciled with the canonical design system (clyffe-io/design-system,
   tokens/). Consumed by Clyffe.Web, Clyffe.PartnerAdmin.Web and
   Clyffe.Auth.Web via _content/Clyffe.DesignSystem/clyffe-tokens.css.

   These names are the only token names. There is no second, --clyffe-*
   prefixed family: one existed until #576 and app.css reached for both
   interchangeably, which is how four ways to draw a status happened.
   Pages consume these tokens and never declare a value of their own;
   TokenFamilyTests fails the build if either rule is broken. A value
   that belongs to the brand is added to the design system first, then
   reconciled here — never invented in this file. See ADR 0015.
   ───────────────────────────────────────────────────────────── */
:root {
    /* ── Brand base palette ── */
    --navy: #1e1d79;        /* Deep Navy — primary, structure, authority */
    --white: #ffffff;       /* White — content areas, generous space */
    --ink: #091204;         /* Ink — body text (warm black) */
    --parchment: #fdf0d5;   /* Parchment / Cream — warm surfaces */
    --ember: #d66320;       /* Ember — action & alert (use sparingly) */
    --cove: #468189;        /* Cove — secondary, supporting */

    /* ── Text-safe accents (#2053) ──
       Ember and Cove are for marks: fills and tints without text on them, borders, icons. As text
       Ember is 3.7:1 on white and Cove 4.4:1, both under the 4.5:1 floor, and white on either fill
       is the same. Text, and a fill that carries white text, reads these instead.
       TextContrastTests pins each against the surfaces it sits on. Ember-text was darkened a step
       for the Portal's glass (ADR 0041): on the glass over the darkest wash it reads 4.8:1, where
       #b4501d read 4.2:1. Cove-text reads 4.6:1 there unchanged. */
    --ember-text: #a64a1b;  /* 5.8:1 on white; white on it 5.8:1 */
    --cove-text: #3c6f76;   /* 5.6:1 on white; white on it 5.6:1 */

    /* ── Navy tints (structure without harshness) ── */
    --navy-90: rgba(30, 29, 121, 0.90);
    --navy-60: rgba(30, 29, 121, 0.60);
    --navy-40: rgba(30, 29, 121, 0.40);
    --navy-15: rgba(30, 29, 121, 0.15);
    --navy-10: rgba(30, 29, 121, 0.10);
    --navy-08: rgba(30, 29, 121, 0.08);
    --navy-05: rgba(30, 29, 121, 0.05);
    --navy-03: rgba(30, 29, 121, 0.03);

    /* ── Ink tints (text hierarchy on light) ── */
    --ink-90: rgba(9, 18, 4, 0.90);
    --ink-65: rgba(9, 18, 4, 0.65);
    --ink-50: rgba(9, 18, 4, 0.50);
    --ink-40: rgba(9, 18, 4, 0.40);
    --ink-25: rgba(9, 18, 4, 0.25);

    /* ── Cream tints (text hierarchy on navy) ── */
    --cream-90: rgba(253, 240, 213, 0.90);
    --cream-50: rgba(253, 240, 213, 0.50);
    --cream-30: rgba(253, 240, 213, 0.30);

    /* ── White tints (text/structure on navy) ── */
    --white-60: rgba(255, 255, 255, 0.60);
    --white-45: rgba(255, 255, 255, 0.45);
    --white-25: rgba(255, 255, 255, 0.25);
    /* The sidebar's organisation tile (#2235), and the hairline above Clyffe's signature at its foot. */
    --white-16: rgba(255, 255, 255, 0.16);
    --white-14: rgba(255, 255, 255, 0.14);
    --white-08: rgba(255, 255, 255, 0.08);
    --white-05: rgba(255, 255, 255, 0.05);
    --white-03: rgba(255, 255, 255, 0.03);

    /* ── Accent tints ── */
    --ember-12: rgba(214, 99, 32, 0.12);
    --ember-08: rgba(214, 99, 32, 0.08);
    --cove-45: rgba(70, 129, 137, 0.45);
    --cove-12: rgba(70, 129, 137, 0.12);
    --cove-08: rgba(70, 129, 137, 0.08);
    --parchment-50: rgba(253, 240, 213, 0.50);
    --parchment-30: rgba(253, 240, 213, 0.30);

    /* ── Support-surface status family (epic #1501 decision 16, ADR 0030) ──
       Technical health on the admin site reads Red, Amber or Green. An exception, for
       Clyffe.PartnerAdmin.Web only, to the design system's no red/green rule: the customer
       surface never uses these, and TokenFamilyTests fails if src/Clyffe.Web names one. */
    --status-red: #d92d20;
    --status-amber: #f5a524;
    --status-green: #17a34a;

    /* ── Semantic aliases ── */
    --surface-page: var(--white);
    --surface-canvas: #fafafa;
    --surface-card: var(--white);
    --surface-warm: var(--parchment);
    --surface-inverse: var(--navy);
    --surface-sunken: var(--navy-03);

    --border-hairline: var(--navy-08);
    --border-strong: var(--navy-15);
    --border-inverse: var(--white-08);

    --text-display: var(--navy);
    --text-heading: var(--navy);
    --text-body: var(--ink-65);
    --text-strong: var(--navy);
    --text-muted: var(--ink-65);
    --text-on-navy: var(--white);
    --text-on-navy-muted: var(--white-45);
    --text-label: var(--cove-text);

    --action-primary: var(--navy);
    --action-primary-text: var(--text-on-navy);
    --action-attention: var(--ember-text);
    --action-secondary: var(--cove-text);
    /* The primary button in a module setup's room, and nowhere else (epic #2085 P8, decision 10):
       cove, at the text-safe step, since white on the mark colour is 4.4:1. */
    --action-setup: var(--cove-text);

    /* The keyboard focus indicator. Solid Cove holds 3:1 against white, parchment and navy, the
       contrast WCAG asks of a focus indicator; the 45% tint it replaced measured 1.8:1 on white (#1652). */
    --focus-ring: var(--cove);

    /* ── Typography ── */
    --font-display: 'Crimson Pro', Georgia, 'Times New Roman', serif;
    --font-body: 'Hanken Grotesk', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

    --weight-display-light: 200;
    --weight-display: 300;
    --weight-display-medium: 500;
    --weight-body: 300;
    /* A sidebar row's label (#2235): the mock's 400, between body and medium. */
    --weight-body-regular: 400;
    --weight-body-medium: 500;
    --weight-body-semibold: 600;
    --weight-mono: 400;

    --text-display-size: 40px;
    --text-title-size: 32px;
    --text-h1-size: 26px;
    /* A settings page's section headings (Values, Schedule, Name and look): between h1 and h2,
       as the Hub mock's r3 and s4 draw them (#2070). */
    --text-section-size: 22px;
    --text-h2-size: 18px;
    --text-body-size: 15px;
    --text-caption-size: 12px;
    /* A sidebar row's label (#2235). */
    --text-nav-size: 14px;
    --text-mono-size: 11px;
    --text-code-size: 12px;
    --text-eyebrow-size: 12px;

    --leading-display: 1.15;
    --leading-heading: 1.3;
    --leading-body: 1.7;
    --leading-relaxed: 1.8;
    --leading-ui: 1.4;

    --tracking-display: -0.5px;
    --tracking-body: 0;
    --tracking-ui: 0.3px;
    --tracking-label: 3px;
    --tracking-mono: 0.5px;

    /* ── Spacing (8px base — favour the larger end) ── */
    --space-0: 0;
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 16px;
    --space-4: 24px;
    --space-5: 32px;
    --space-6: 48px;
    --space-7: 64px;
    --space-8: 96px;
    --space-9: 128px;

    --pad-card: 28px;
    --pad-card-lg: 40px;
    --gap-content: 24px;
    --gap-section: 96px;
    --row-height: 48px;

    /* The content column a page sits in: the design system's ~1040px, centred, with the shell's
       gutters around it (README "Layout rules"). Declared once so a page that adopts the column
       reads it here rather than writing the number (epic #1772, P6). */
    --content-width: 1040px;

    /* ── Breakpoints — there are two, and these are they.
       Named here so one file answers "where does the layout change?". They are
       MudBlazor's own Sm and Md boundaries deliberately: the drawer takes a
       `Breakpoint` in C# and MudTable ships `.mud-xs-table` / `.mud-sm-table` at
       exactly these widths, so a third set of numbers would mean the CSS and the
       framework disagreeing about where a phone stops.

       CSS cannot interpolate a custom property into a media condition —
       `@media (max-width: var(--bp-md))` is invalid — so a stylesheet still writes
       the number. What makes this the single source is the gate:
       ResponsiveContractTests reads the two values out of this block and fails any
       `@media` width in the app stylesheets that is not one of them. Before #584
       there were six (599, 600, 700, 768, 900, 959), and the 768 one contradicted
       the drawer's own 960 by a device class. ── */
    --bp-sm: 600px;         /* at or below: phone. Tables stack, columns go single-file. */
    --bp-md: 960px;         /* at or below: the sidebar is a rail, not a labelled column. */

    /* ── Control heights — one height per size, for every control that can sit in a
       row with another. MudBlazor sizes buttons by padding alone, so an outlined
       button, a filled one and a button inside a file-upload wrapper each land on a
       slightly different height; pinning the height is what keeps a row level. ── */
    --control-height-sm: 32px;
    --control-height-md: 40px;
    --control-height-lg: 48px;

    /* The sidebar (#2235): a row's icon, and the organisation's tile at its head. */
    --icon-size-nav: 20px;
    --sidebar-badge-size: 36px;
    --sidebar-badge-radius: 10px;

    /* The label line at the top of a stat card. Fixed so a card whose label carries a
       chip and one whose label is plain text still put their figures on one line. */
    --stat-label-height: 24px;

    /* ── Radii — small, architectural; pill only for badges/tags/avatars ── */
    --radius-xs: 2px;
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-pill: 999px;

    /* ── Elevation — cards are flat; shadows for floating layers only (glass below is the Portal's) ── */
    --shadow-none: none;
    --shadow-raised: 0 1px 2px rgba(30, 29, 121, 0.04);
    --shadow-overlay: 0 8px 28px rgba(9, 18, 4, 0.10), 0 2px 6px rgba(9, 18, 4, 0.05);
    --shadow-dialog: 0 24px 64px rgba(9, 18, 4, 0.18);

    /* ── Glass — the Portal only (ADR 0041, epic #2203) ──
       Every other host, and every floating layer, stays on the flat set above. Only
       clyffe-glass.css reads these, under .clyffe-glass, so a page never declares a glass value.
       Section-level surfaces are glass; rows, chips, inputs and cells never are. */
    --radius-glass: 22px;
    --radius-glass-tile: 12px;
    /* TextContrastTests holds every text token on this fill, and on the strong fill's most
       see-through stop, over the darkest wash. */
    --surface-glass: rgba(255, 255, 255, 0.5);
    --surface-glass-strong: linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.62));
    --border-glass: 1px solid rgba(255, 255, 255, 0.8);
    /* An inner highlight along the top edge, then the soft lift. */
    --shadow-glass: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 12px 32px rgba(30, 29, 121, 0.07);
    --shadow-glass-item: inset 0 1px 0 rgba(255, 255, 255, 0.95), 0 1px 2px rgba(30, 29, 121, 0.06), 0 4px 14px rgba(30, 29, 121, 0.06);
    /* Under 20px, as the motion standards keep every blur; the 24px and 28px of the CEO's canvas
       are not carried. */
    --blur-glass: blur(16px) saturate(160%);
    /* The floating sidebar's navy panel. White nav text holds 4.5:1 on it over a white card
       scrolled beneath, the lightest thing behind it (TextContrastTests). */
    --surface-glass-navy: rgba(30, 29, 121, 0.84);
    /* The sidebar's active item: a lighter pill on the navy panel (#2233). */
    --surface-glass-navy-active: rgba(255, 255, 255, 0.15);
    --border-glass-navy: 1px solid rgba(255, 255, 255, 0.14);
    --shadow-glass-navy: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 16px 40px rgba(30, 29, 121, 0.22);
    /* The colour the glass is for: without it a translucent card reads as plain white. Painted
       once, static, behind the Portal's content. */
    --wash-navy: radial-gradient(50% 45% at 12% 4%, rgba(30, 29, 121, 0.18), transparent 70%);
    --wash-cool: radial-gradient(45% 40% at 88% 8%, rgba(70, 129, 137, 0.26), transparent 70%);
    --wash-warm: radial-gradient(55% 50% at 68% 62%, rgba(253, 240, 213, 0.95), transparent 72%);
    --wash-ember: radial-gradient(40% 35% at 96% 98%, rgba(214, 99, 32, 0.12), transparent 70%);
    --focus-shadow: 0 0 0 3px var(--focus-ring);

    --border-width: 1px;
    /* An active tab's underline and a step's ring: a mark that says where the reader is (#2070). */
    --border-width-indicator: 2px;
    --border-card: 1px solid var(--border-hairline);

    /* ── Motion — nothing snaps; everything flows ── */
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
    /* A sheet sliding in from an edge (the assistant): iOS's drawer curve. */
    --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
    --duration-instant: 100ms;
    --duration-micro: 200ms;
    --duration-panel: 300ms;
    /* The entrance rise (.clyffe-rise): one 60ms step between children. */
    --duration-stagger: 60ms;
    /* A celebration (a countdown at zero, a goal reached, a birthday; epic #1883 decision 45):
       rare and once per device, so it may run long and overshoot. Overshoot moves a transform,
       never opacity, which clamps. The plugin's tokens/effects.css carries the same two. */
    --ease-overshoot: cubic-bezier(0.34, 1.56, 0.64, 1);
    --duration-celebrate: 1400ms;
    /* The handoff from a guided setup to the area's page (epic #2085 decision 3, ADR 0040 §I):
       played once, the first time an area is turned on, so it too may run long. clyffe-handoff.js
       times every part of it as a share of this. The plugin's tokens/effects.css carries it. */
    --duration-handoff: 2100ms;
    /* Words that just changed (a policy line rewritten by an answer): marked long enough to read,
       then the mark fades. One use only, approved by the user on 7 Nov 2026 (Trust and
       compliance mock). Its consumer fades the colour on --ease-out and keeps the fade under
       reduced motion, since it moves nothing. The plugin's tokens/effects.css carries it, and
       the motion skill's STANDARDS.md its limits. */
    --duration-highlight: 2400ms;
    /* One large card that slides, grows and flips in a single motion: opening a module's setup
       from its card (clyffe-flip.js, ADR 0040 §I, #2200), the Trust and compliance mock's Start
       day. Outside the panel step by the user's approval on 7 Nov 2026 (Trust and compliance
       mock), extended to the module setups on 10 Nov 2026. Its consumer moves transform only, on
       --ease-in-out, and under reduced motion sets the end state with no travel. The plugin's tokens/effects.css carries it. */
    --duration-flip: 900ms;
    /* A control's hover and press: the properties it changes, never all of them. */
    --transition-micro: background-color var(--duration-micro) var(--ease-out),
        border-color var(--duration-micro) var(--ease-out),
        box-shadow var(--duration-micro) var(--ease-out),
        color var(--duration-micro) var(--ease-out),
        opacity var(--duration-micro) var(--ease-out),
        transform var(--duration-micro) var(--ease-out);

    --blur-overlay: blur(8px);
    --scrim: rgba(9, 18, 4, 0.32);

    --hover-opacity: 0.85;
    --press-scale: 0.98;
}
