/*
 * forge.css — Forge's canonical token block
 * ----------------------------------------------------------------------------
 * Vellum Ink visual register (ADR 017). Hand-authored on :root so the
 * tokens are globally available to any element on the page. Consumers
 * use the tokens directly via var(--forge-*) or var(--vl-*), or via
 * the component CSS in forge.kit.css.
 *
 * Two token banks:
 *
 *   --forge-*   Semantic tokens (ADR 001). The bank that every Forge
 *               component consumes. Re-skinning Forge to a new register
 *               means changing these values; the components don't need
 *               to know. Names align with the prior semantic surface
 *               (surface/text/border/interactive) so existing adapters
 *               just pick up the new values.
 *
 *   --vl-*      Vellum-specific tokens. Glass tiers, navy-ink shadows,
 *               page gradient, pastel accents, severity surfaces, blur
 *               radii, motion easings, type families. These exist because
 *               Vellum needs more nuance than the bare semantic bank
 *               can express — they're the register's signature surface.
 *
 * Editing: change values directly here. ADR 010's DTCG pipeline is
 * retained as documentation of the prior architecture, but this file
 * is no longer regenerated from tokens/. See ADR 017.
 *
 * Lint: pnpm lint:system still enforces the semantic-tokens-only rule
 * (ADR 001) against this file. Don't pull base color refs into adapter
 * code; use var(--forge-*) or var(--vl-*).
 * ============================================================================
 */

:root {
  /* ------------------------------------------------------------------------
   * PAGE CANVAS — cool slate linear wash, deepest at the top band. Canvas
   * temperature and construction are theme-owned (ADR 031): theme spec S6
   * holds only that a fixed gradient canvas exists. The theme spec's revision
   * log (docs/forge/register/vellum-ink.md) records each before/after.
   * ------------------------------------------------------------------------ */
  --vl-page-gradient: linear-gradient(
    178deg,
    oklch(0.898 0.036 238) 0%,
    oklch(0.948 0.020 240) 40%,
    oklch(0.978 0.010 242) 100%
  );
  --forge-surface-page: oklch(0.972 0.010 240);

  /* ------------------------------------------------------------------------
   * GLASS TIERS — alpha-on-cool-white surfaces. Used with backdrop-filter
   * for the letterpress-on-vellum look. The six rungs must stay translucent
   * and ascend in opacity inset < well < chrome < content < content-hover
   * < deep (theme spec S3); the alphas themselves are theme-owned.
   * ------------------------------------------------------------------------ */
  --vl-surface-content:        rgba(250, 252, 255, 0.82);
  --vl-surface-content-hover:  rgba(250, 252, 255, 0.90);
  --vl-surface-chrome:         rgba(250, 252, 255, 0.76);
  --vl-surface-deep:           rgba(250, 252, 255, 0.92);
  --vl-surface-well:           rgba(250, 252, 255, 0.60);
  --vl-surface-inset:          rgba(250, 252, 255, 0.52);
  --vl-blur-chrome:  22px;
  --vl-blur-content: 20px;
  --vl-blur-deep:    28px;

  /* ------------------------------------------------------------------------
   * SURFACE FALLBACKS — solid tones for browsers without backdrop-filter.
   * Also used directly when a flat surface is desired (card bodies,
   * surfaces that don't sit on the gradient).
   * ------------------------------------------------------------------------ */
  --forge-surface-primary:   oklch(0.985 0.006 242);
  --forge-surface-secondary: oklch(0.948 0.014 240);
  --forge-surface-tertiary:  oklch(0.905 0.018 240);
  /* Zebra-stripe fill for Table body rows; one step darker than --forge-surface-primary. */
  --vl-surface-stripe:       oklch(0.960 0.010 241);

  /* ------------------------------------------------------------------------
   * TEXT — navy ink hierarchy (the brand mark's dot-field navy). Chroma falls
   * as lightness rises and the hue rotates toward the canvas, so tertiary
   * settles into the paper instead of reading as a separate blue.
   * ------------------------------------------------------------------------ */
  --forge-text-primary:   oklch(0.215 0.070 268);
  --forge-text-secondary: oklch(0.410 0.048 262);
  --forge-text-tertiary:  oklch(0.570 0.034 250);

  /* ------------------------------------------------------------------------
   * SKELETON — loading placeholder tone (kit .vl-skeleton). A tone
   * derived from the muted ink so a skeleton reads on BOTH the solid
   * surfaces and the translucent Vellum glass tiers; the previous
   * white-on-white base washed out on --vl-surface-content. `base` = the
   * resting block / gradient edges, `shine` = the lighter band the shimmer
   * sweeps. `duration` is tokenised so a consumer can retune the rhythm
   * without overriding the (unlayered) kit class.
   * ------------------------------------------------------------------------ */
  --vl-skeleton-base:     color-mix(in oklch, var(--forge-text-tertiary) 24%, var(--forge-surface-primary));
  --vl-skeleton-shine:    color-mix(in oklch, var(--forge-text-tertiary) 11%, var(--forge-surface-primary));
  --vl-skeleton-duration: 2000ms;

  /* ------------------------------------------------------------------------
   * SELECT CHEVRON — component-internal: the native Select's dropdown arrow
   * as a data-URI image (consumed as bg-[image:var(--vl-select-chevron)]).
   * A data URI cannot resolve var(), so the stroke is a literal: the
   * rendered sRGB hex of --forge-text-tertiary (re-hex it whenever that
   * token moves). Keep the SVG percent-encoded: a raw # (the stroke's %23)
   * would end the URI at a fragment.
   * ------------------------------------------------------------------------ */
  --vl-select-chevron: url('data:image/svg+xml;utf8,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20width=%2712%27%20height=%2712%27%20viewBox=%270%200%2024%2024%27%20fill=%27none%27%20stroke=%27%2369798b%27%20stroke-width=%272%27%3E%3Cpolyline%20points=%276%209%2012%2015%2018%209%27/%3E%3C/svg%3E');

  /* ------------------------------------------------------------------------
   * BORDERS + HAIRLINES.
   * ------------------------------------------------------------------------ */
  --forge-border-default: oklch(0.820 0.016 240);
  --forge-border-strong:  oklch(0.700 0.022 240);
  --vl-border-subtle:     rgba(250, 252, 255, 0.68);
  --vl-border-hairline:   rgba(3, 8, 90, 0.22);

  /* ------------------------------------------------------------------------
   * BRAND — BlueOcean brand primary (ADR 019). The VALUE is the one locked
   * entry in docs/forge/protected-tokens.yaml (ADR 031; checked by
   * pnpm audit:protected-tokens), so no exploration verb or candidate bank
   * may recolor it; its page COVERAGE is explorable.
   * Distinct from the interactive cyan below — the relationship
   * (whether interactive rebases onto brand) is deliberately open,
   * reserved for the first design-phase exploration. Authored as hex:
   * the brand equity is defined in hex and the invariant check needs
   * an exact literal (≈ oklch(0.4791 0.2837 267.87); the rounded
   * 3-decimal oklch does NOT round-trip to this hex).
   * ------------------------------------------------------------------------ */
  --forge-brand-primary: #262DF9;

  /* ------------------------------------------------------------------------
   * INTERACTIVE — the brand mark's outer-ring cyan, darkened for use on
   * paper. Leads the page; reserved for primary actions and active states.
   * Every step is authored inside the sRGB gamut (at or just under its
   * highest in-gamut chroma): an out-of-gamut oklch is gamut-mapped by the
   * browser, so the rendered color — and every contrast ratio computed from
   * the token — would silently drift from the authored value.
   * ------------------------------------------------------------------------ */
  --forge-interactive-default: oklch(0.47 0.095 232);
  --forge-interactive-hover:   oklch(0.40 0.080 232);
  --forge-interactive-active:  oklch(0.34 0.068 232);
  --forge-interactive-focus-ring: oklch(0.60 0.12 232 / 0.50);
  --forge-text-on-brand:       oklch(0.985 0.005 242);

  /* ------------------------------------------------------------------------
   * INVERSE PAIR — dark surface + light text for tooltips and other
   * inverted UI surfaces. Mirrors of the primary text + primary surface
   * tokens above so the contrast is symmetric.
   * ------------------------------------------------------------------------ */
  --forge-surface-inverse: oklch(0.215 0.070 268);
  --forge-text-on-inverse: oklch(0.985 0.005 242);

  /* ------------------------------------------------------------------------
   * NARRATIVE TONE ACCENTS — intensified pastels (DECISIONS row 004).
   * Lavender / sage / peach pairs for narrative cards, tone tags, callouts.
   * Surface is the glass tint; text is the darkened ink to pair against it.
   * ------------------------------------------------------------------------ */
  --vl-accent-lavender-surface: rgba(208, 196, 232, 0.72);
  --vl-accent-lavender-text:    oklch(0.28 0.10 290);
  --vl-accent-sage-surface:     rgba(196, 220, 200, 0.72);
  --vl-accent-sage-text:        oklch(0.26 0.085 140);
  --vl-accent-peach-surface:    rgba(238, 214, 205, 0.74);
  --vl-accent-peach-text:       oklch(0.30 0.09 38);

  /* ------------------------------------------------------------------------
   * MONOGRAM TONES — one per person, for an Avatar's initials (ENG-5420).
   * Hues sit clear of the narrative pastels, info, and the status and
   * sentiment colours, so a tone says who someone is and nothing else.
   * Surfaces alternate light and deeper by hue so neighbours stay apart at
   * 24px. Surface is the glass tint; text is the ink to pair against it.
   * ------------------------------------------------------------------------ */
  --vl-monogram-orchid-surface:  oklch(0.86 0.085 322 / 0.80);
  --vl-monogram-orchid-text:     oklch(0.32 0.100 322);
  --vl-monogram-magenta-surface: oklch(0.80 0.085 342 / 0.80);
  --vl-monogram-magenta-text:    oklch(0.32 0.100 342);
  --vl-monogram-rose-surface:    oklch(0.86 0.078 2 / 0.80);
  --vl-monogram-rose-text:       oklch(0.32 0.100 2);
  --vl-monogram-gold-surface:    oklch(0.80 0.085 86 / 0.80);
  --vl-monogram-gold-text:       oklch(0.32 0.063 86);
  --vl-monogram-olive-surface:   oklch(0.86 0.085 106 / 0.80);
  --vl-monogram-olive-text:      oklch(0.32 0.066 106);
  --vl-monogram-teal-surface:    oklch(0.80 0.085 182 / 0.80);
  --vl-monogram-teal-text:       oklch(0.32 0.055 182);
  --vl-monogram-aqua-surface:    oklch(0.86 0.085 198 / 0.80);
  --vl-monogram-aqua-text:       oklch(0.32 0.052 198);
  --vl-monogram-sky-surface:     oklch(0.80 0.085 214 / 0.80);
  --vl-monogram-sky-text:        oklch(0.32 0.054 214);

  /* ------------------------------------------------------------------------
   * ITALIC ACCENT INK — cool letterpress tint for serif italic emphasis.
   * Used as color: on .vl-text-italic so italic passages read as a
   * second, softer ink.
   * ------------------------------------------------------------------------ */
  --vel-accent-italic-color: oklch(0.30 0.03 255);

  /* ------------------------------------------------------------------------
   * SEVERITY (ADR 004) — paired surface + text. Never chrome alone.
   * Threat severity uses --vl-sev-*; feedback severity (alerts) uses
   * --vl-info / --vl-success / --vl-warn / --vl-danger.
   * ------------------------------------------------------------------------ */
  --vl-sev-high-surface:   rgba(248, 184, 168, 0.72);
  --vl-sev-high-text:      oklch(0.32 0.16 30);
  --vl-sev-medium-surface: rgba(244, 212, 188, 0.72);
  --vl-sev-medium-text:    oklch(0.32 0.13 60);
  --vl-sev-low-surface:    rgba(210, 214, 222, 0.66);
  --vl-sev-low-text:       oklch(0.38 0.024 250);

  --vl-info-surface:    rgba(208, 220, 232, 0.72);
  --vl-info-text:       oklch(0.34 0.08 245);
  --vl-success-surface: rgba(196, 220, 200, 0.72);
  --vl-success-text:    oklch(0.30 0.10 145);
  --vl-warn-surface:    rgba(244, 212, 188, 0.74);
  --vl-warn-text:       oklch(0.32 0.13 60);
  --vl-danger-surface:  rgba(248, 184, 168, 0.72);
  --vl-danger-text:     oklch(0.32 0.16 30);

  /* ------------------------------------------------------------------------
   * SENTIMENT / TREND — how a reading moved: up (positive), down (negative),
   * or flat (neutral). Stat and MetricTile deltas, trend chips, chart marks.
   * A fourth vocabulary, deliberately separate from the three above:
   * sentiment is not threat severity (--vl-sev-*), not feedback (--vl-info /
   * success / warn / danger), and not narrative tone (--vl-accent-*). Keeping
   * it apart lets a market where red reads as "up" flip trend colors without
   * touching an alert or a severity badge.
   * Positive and negative are constrained families in
   * docs/forge/protected-tokens.yaml; neutral is theme-owned, like low
   * severity. The tints composite almost identically to the success and
   * danger surfaces, so beside a severity badge the ink and the label tell
   * the two apart, never the tint (gate G-A11Y-01: a sign, arrow, or word
   * always travels with the color). The text inks are authored inside the
   * sRGB gamut so the token is the color that ships; their contrast is gated
   * by audit:contrast on Stat's marked delta and the Stat preview's trend
   * chips. neutral-fill is for non-text graphics only (bars, sparklines,
   * 3:1) and fails as text; use neutral-text for words and numbers.
   * neutral-text sits close to --forge-text-secondary, so "flat" is always
   * said in words, never left to the ink.
   * ------------------------------------------------------------------------ */
  --vl-sentiment-positive-surface: rgba(196, 226, 204, 0.80);
  --vl-sentiment-positive-text:    oklch(0.41 0.098 156);
  --vl-sentiment-negative-surface: rgba(248, 204, 194, 0.84);
  --vl-sentiment-negative-text:    oklch(0.46 0.184 24);
  --vl-sentiment-neutral-text:     oklch(0.43 0.012 245);
  --vl-sentiment-neutral-fill:     oklch(0.58 0.012 245);

  /* ------------------------------------------------------------------------
   * SEMANTIC SEVERITY (ADR 004 + ADR 018) — the agnostic --forge-* bank
   * that components consume. Saturated `*-default` / `*-hover` colors for
   * button fills and border accents; tone-on-tone `*-surface` + `*-text`
   * pairs for badges, cards, and inline severity callouts. Hues match
   * the Vellum --vl-* siblings above (warm red, peach amber, sage green)
   * rather than the legacy cool primaries — keeps the register
   * consistent across the agnostic and Vellum-specific banks.
   * ------------------------------------------------------------------------ */
  --forge-danger-default:  oklch(0.50 0.20 30);
  --forge-danger-hover:    oklch(0.42 0.21 30);
  --forge-danger-surface:  var(--vl-danger-surface);
  --forge-danger-text:     var(--vl-danger-text);

  --forge-warning-default: oklch(0.60 0.16 60);
  --forge-warning-surface: var(--vl-warn-surface);
  --forge-warning-text:    var(--vl-warn-text);

  --forge-success-default: oklch(0.50 0.13 145);
  --forge-success-surface: var(--vl-success-surface);
  --forge-success-text:    var(--vl-success-text);

  /* ------------------------------------------------------------------------
   * SHADOWS — navy ink (the brand mark's dot-field navy), every tier
   * multi-layer (theme spec S4). Four tiers for resting / hover / popover /
   * control layers — control is for small raised controls (active pills,
   * toggles, switch thumbs) that sit inside a surface rather than on the page.
   * ------------------------------------------------------------------------ */
  --vl-shadow-rest:    0 10px 28px -10px rgba(3, 8, 90, 0.22),
                       0 2px 5px        rgba(3, 8, 90, 0.10);
  --vl-shadow-hover:   0 26px 64px -10px rgba(3, 8, 90, 0.30),
                       0 6px 16px       rgba(3, 8, 90, 0.16);
  --vl-shadow-popover: 0 24px 60px -12px rgba(3, 8, 90, 0.34),
                       0 6px 18px       rgba(3, 8, 90, 0.16);
  --vl-shadow-control: 0 1px 2px         rgba(3, 8, 90, 0.12),
                       0 3px 8px -3px  rgba(3, 8, 90, 0.18);

  /* ------------------------------------------------------------------------
   * SCRIM — the modal backdrop behind Dialog and Drawer, in the shadow ink.
   * Consumed from ::backdrop, which inherits custom properties from its
   * dialog (Chrome 122+, Safari 17.4+, Firefox 120+).
   * ------------------------------------------------------------------------ */
  --vl-scrim: rgba(3, 8, 90, 0.36);

  /* ------------------------------------------------------------------------
   * RADII.
   * ------------------------------------------------------------------------ */
  --vl-radius-card:       18px;
  --vl-radius-card-sm:    14px;
  --vl-radius-chart:      16px;
  --vl-radius-chip:       999px;
  --vl-radius-control:    12px;
  --vl-radius-control-sm: 8px;

  /* ------------------------------------------------------------------------
   * MOTION.
   * ------------------------------------------------------------------------ */
  --vl-motion-ease:     cubic-bezier(0.2, 0.7, 0.2, 1);
  --vl-motion-duration: 240ms;
  --vl-motion-fast:     140ms;

  /* ------------------------------------------------------------------------
   * TYPE — serif for display, system sans for body, JetBrains-or-system
   * for mono. Vellum's display register is Source Serif 4; load it via
   * @font-face or Google Fonts in the consumer's HTML.
   * ------------------------------------------------------------------------ */
  --vl-font-serif: "Source Serif 4", "Source Serif Pro", "Newsreader", ui-serif, Georgia, "Times New Roman", serif;
  --vl-font-sans:  ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", "Arial", sans-serif;
  --vl-font-mono:  "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Monaco, "Cascadia Code", "Roboto Mono", monospace;
  --vl-letter-display: -0.020em;
  --vl-letter-sans:    -0.005em;

  /* An 11px step below Tailwind's text-xs, for compact interactive labels
   * (segmented controls) — the type scale otherwise uses Tailwind's
   * built-in steps. */
  --vl-font-size-2xs: 0.6875rem;

  /* ------------------------------------------------------------------------
   * SPACING SCALE — documentation reference. Components use literal px
   * tuned to their context; the scale is here so designers can sanity-check
   * that values fall on a consistent grid.
   * ------------------------------------------------------------------------ */
  --vl-space-1:  4px;
  --vl-space-2:  8px;
  --vl-space-3:  12px;
  --vl-space-4:  16px;
  --vl-space-5:  20px;
  --vl-space-6:  24px;
  --vl-space-8:  32px;
  --vl-space-12: 48px;
}
