/* ==========================================================================
   Venytrix UI Kit — Design Tokens
   --------------------------------------------------------------------------
   Direction: product UI (dense operator surface), not marketing.
   Personality: utility/dev — precision and density, calm chrome, ink-first.

   Colour thesis
   -------------
   The primary action is INK, not a brand hue. Colour is reserved for meaning:
   status (success/warning/danger) and one accent for interactive state.
   An accent-coloured button on every surface would drain the status palette of
   its meaning — the opposite of what an operator console needs.

   Scale roles (steps encode intent, not just lightness):
     100 background        200 hover bg        300 active bg
     400 border            500 hover border    600 active border
     700 solid fill        800 solid fill hover
     900 secondary text    1000 primary text
   Derive states by stepping the scale; never hand-pick a new colour per state.

   Themes: light is default; dark via [data-theme="dark"] or prefers-color-scheme.
   ========================================================================== */

:root {
  /* ---------------------------------------------------------------- ramps */

  /* Neutral — near-neutral with a barely-there cool tint, matching the cool
     accent. Deliberately NOT slate/blue-grey: that reads as the stock look. */
  --vx-neutral-0:    #ffffff;
  --vx-neutral-25:   #fcfcfc;
  --vx-neutral-50:   #f7f7f8;
  --vx-neutral-100:  #f1f1f3;
  --vx-neutral-200:  #e6e6e9;
  --vx-neutral-300:  #d5d6da;
  --vx-neutral-400:  #b0b2b8;
  --vx-neutral-500:  #8b8e96;
  --vx-neutral-600:  #6b6e77;
  --vx-neutral-700:  #52555d;
  --vx-neutral-800:  #3a3d44;
  --vx-neutral-900:  #26282e;
  --vx-neutral-950:  #17181c;
  --vx-neutral-1000: #0e0f12;

  /* Accent — one signal blue. Carries links, focus, selection, active nav and
     advisory states. Not a second brand colour: informational states reuse it
     instead of introducing a competing hue. */
  --vx-accent-100: #e7f0fb;
  --vx-accent-200: #d0e2f7;
  --vx-accent-300: #b0cef1;
  --vx-accent-400: #7dabe4;
  --vx-accent-500: #4a86d4;
  --vx-accent-600: #2a67ba;
  --vx-accent-700: #1a539d;   /* solid fill */
  --vx-accent-800: #154484;
  --vx-accent-900: #12365f;   /* secondary text */
  --vx-accent-1000:#0e2942;   /* primary text */

  /* Success — online presence, active device, allowed operation. */
  --vx-success-100: #e3f4ea;
  --vx-success-200: #c7e8d5;
  --vx-success-300: #96d3b0;
  --vx-success-400: #4fb27f;
  --vx-success-500: #2b9560;
  --vx-success-600: #1d7c4d;
  --vx-success-700: #16653e;
  --vx-success-800: #115032;
  --vx-success-900: #0e4028;
  --vx-success-1000:#0a2e1d;

  /* Warning — pending enrollment, quota pressure, ambiguous outcome. */
  --vx-warning-100: #fbf0dd;
  --vx-warning-200: #f6e0b8;
  --vx-warning-300: #eec784;
  --vx-warning-400: #dda23c;
  --vx-warning-500: #bd8113;
  --vx-warning-600: #9c680b;
  --vx-warning-700: #7e5308;
  --vx-warning-800: #654206;
  --vx-warning-900: #513504;
  --vx-warning-1000:#3a2503;

  /* Danger — revoked device, denied permission, destructive action. */
  --vx-danger-100: #fceceb;
  --vx-danger-200: #f8d6d4;
  --vx-danger-300: #f0b0ac;
  --vx-danger-400: #e07b75;
  --vx-danger-500: #cd4a43;
  --vx-danger-600: #b03730;
  --vx-danger-700: #8f2b26;
  --vx-danger-800: #73231f;
  --vx-danger-900: #5b1c19;
  --vx-danger-1000:#3f1310;

  /* ----------------------------------------------------------- typography */
  /* Inter variable, loaded with font-display: swap and its OpenType features
     enabled (see ui.css) — a configured Inter, not the browser default. */
  --vx-font-sans: "InterVariable", "Inter", system-ui, -apple-system,
                  "Segoe UI", sans-serif;
  /* Mono is load-bearing: UUIDs, paths, error codes, CLI, eyebrow labels. */
  --vx-font-mono: "JetBrains Mono", "Cascadia Mono", "SF Mono", "Consolas",
                  ui-monospace, monospace;

  /* Body is 16px at every breakpoint. Dense chrome (tables, controls, labels)
     steps down to 14px; 12px is incidental metadata only, never body or label. */
  --vx-text-xs:  0.75rem;    /* 12 — captions, table meta, badge text */
  --vx-text-sm:  0.875rem;   /* 14 — labels, controls, table cells     */
  --vx-text-md:  1rem;       /* 16 — body, everywhere                  */
  --vx-text-lg:  1.125rem;   /* 18 — card titles, dialog body          */
  --vx-text-xl:  1.375rem;   /* 22 — section titles                    */
  --vx-text-2xl: 1.75rem;    /* 28 — page titles                       */
  --vx-text-3xl: 2.25rem;    /* 36 — largest in product UI             */

  /* Two weights, reused everywhere: regular for body, semibold for emphasis. */
  --vx-weight-regular:  400;
  --vx-weight-semibold: 600;

  --vx-leading-tight:  1.2;
  --vx-leading-snug:   1.35;
  --vx-leading-normal: 1.55;

  --vx-tracking-tight: -0.014em;  /* headings above --vx-text-xl only */
  --vx-tracking-wide:  0.06em;    /* monospace eyebrow labels only    */

  /* -------------------------------------------------------------- spacing */
  /* 4px grid. */
  --vx-space-0:  0;
  --vx-space-1:  0.25rem;   /*  4 */
  --vx-space-2:  0.5rem;    /*  8 */
  --vx-space-3:  0.75rem;   /* 12 */
  --vx-space-4:  1rem;      /* 16 */
  --vx-space-5:  1.25rem;   /* 20 */
  --vx-space-6:  1.5rem;    /* 24 */
  --vx-space-8:  2rem;      /* 32 */
  --vx-space-10: 2.5rem;    /* 40 */
  --vx-space-12: 3rem;      /* 48 */
  --vx-space-16: 4rem;      /* 64 */

  /* --------------------------------------------------------------- radius */
  /* One family, three jobs. Small controls stay tight so they don't read as
     toys next to dense data; nested radii are derived with calc(), not eyeballed. */
  --vx-radius-control: 6px;
  --vx-radius-card:    10px;
  --vx-radius-overlay: 14px;
  --vx-radius-pill:    999px;

  /* ------------------------------------------------------------ elevation */
  /* One depth technique per surface class:
       - cards and panels: hairline border only, no shadow
       - genuinely floating layers (modal, menu, toast): layered shadow
     Shadows are never paired with a solid border — the ring IS the border. */
  --vx-shadow-raised:
    0 0 0 1px rgb(0 0 0 / 0.06),
    0 1px 2px -1px rgb(0 0 0 / 0.06),
    0 2px 4px 0 rgb(0 0 0 / 0.04);
  --vx-shadow-overlay:
    0 0 0 1px rgb(0 0 0 / 0.06),
    0 4px 8px -2px rgb(0 0 0 / 0.08),
    0 12px 24px -4px rgb(0 0 0 / 0.10);
  --vx-shadow-popover:
    0 0 0 1px rgb(0 0 0 / 0.06),
    0 2px 4px -1px rgb(0 0 0 / 0.06),
    0 8px 16px -4px rgb(0 0 0 / 0.08);

  /* --------------------------------------------------------------- motion */
  --vx-duration-fast:   140ms;
  --vx-duration-normal: 200ms;
  --vx-duration-slow:   320ms;
  --vx-ease-standard: cubic-bezier(0.2, 0, 0.15, 1);
  --vx-ease-out:      cubic-bezier(0.16, 1, 0.3, 1);

  /* -------------------------------------------------------------- z-index */
  --vx-z-sticky:   100;
  --vx-z-dropdown: 200;
  --vx-z-modal:    400;
  --vx-z-toast:    500;
  --vx-z-tooltip:  600;

  /* --------------------------------------------------------------- layout */
  --vx-sidebar-width: 236px;
  --vx-topbar-height: 52px;
  --vx-container-max: 1240px;
  --vx-prose-max:     68ch;
  --vx-control-height-sm: 30px;
  --vx-control-height-md: 36px;
  --vx-control-height-lg: 44px;
  --vx-focus-ring-width: 2px;
  --vx-focus-ring-offset: 2px;

  /* ------------------------------------------------------------ marketing */
  /* Marketing surfaces only — the public site. Product UI must never use
     these: a dashboard that reaches for editorial scale stops reading as an
     operator console. Nothing here overrides a product token; the block is
     purely additive, so removing it cannot break an existing component.

     The product scale tops out at --vx-text-3xl (36px), which is correct for
     a dense console and too small for a first viewport that has to land a
     category in five seconds. These four steps extend it upward and nothing
     else. Colour, radius, focus, motion and spacing rules are unchanged. */

  /* Fluid between a 360px and a 1280px viewport, then locked at both ends.
     The intercept is in rem, not px, so browser zoom and user font size still
     scale the result — a px intercept would pin the text at large zoom. */
  --vx-display-lg:   clamp(3rem,     2.413rem + 2.609vw, 4.5rem);  /* 48 → 72 — hero H1, one per page   */
  --vx-display-md:   clamp(2.5rem,   2.109rem + 1.739vw, 3.5rem);  /* 40 → 56 — section headings        */
  --vx-display-sm:   clamp(2rem,     1.804rem + 0.870vw, 2.5rem);  /* 32 → 40 — sub-heads, ROI figure   */
  --vx-text-lead:    clamp(1.125rem, 1.076rem + 0.217vw, 1.25rem); /* 18 → 20 — hero and section intros */

  /* Display sizes need less leading and tighter tracking than product
     headings; --vx-leading-tight (1.2) is loose once type passes ~40px. */
  --vx-leading-display:  1.06;
  --vx-tracking-display: -0.022em;

  /* Section rhythm. The product grid stops at 64px because console layouts
     never need more; editorial sections do. Same 4px grid, continued. */
  --vx-space-20: 5rem;    /*  80 — between subsections            */
  --vx-space-24: 6rem;    /*  96 — between sections, mobile       */
  --vx-space-32: 8rem;    /* 128 — between sections, desktop      */

  /* Measure. --vx-prose-max (68ch) is a docs measure and runs long under
     display type. Marketing copy columns are narrower on purpose. */
  --vx-measure-copy:   40rem;  /* 640 — body columns under a display heading */
  --vx-measure-narrow: 34rem;  /* 544 — hero subheads, standfirsts           */
}

/* Coarse pointers get 44px minimum touch targets regardless of density. */
@media (pointer: coarse) {
  :root {
    --vx-control-height-sm: 40px;
    --vx-control-height-md: 44px;
    --vx-control-height-lg: 48px;
  }
}

/* ==========================================================================
   Semantic tokens — LIGHT (default)
   ========================================================================== */
:root,
:root[data-theme="light"] {
  color-scheme: light;

  /* surfaces */
  --vx-canvas:         var(--vx-neutral-50);
  --vx-surface:        var(--vx-neutral-0);
  --vx-surface-sunken: var(--vx-neutral-100);
  --vx-surface-hover:  var(--vx-neutral-50);
  --vx-surface-active: var(--vx-neutral-100);
  --vx-surface-inverse:var(--vx-neutral-900);
  --vx-overlay-scrim:  rgb(14 15 18 / 0.4);

  /* text — four contrast levels, in order of importance */
  --vx-text:           var(--vx-neutral-950);
  --vx-text-secondary: var(--vx-neutral-700);
  --vx-text-muted:     var(--vx-neutral-600);
  --vx-text-faint:     var(--vx-neutral-500);
  --vx-text-inverse:   var(--vx-neutral-0);
  --vx-text-link:      var(--vx-accent-700);

  /* borders — opacity-based so they sit correctly on any surface */
  --vx-border:        rgb(14 15 18 / 0.10);
  --vx-border-strong: rgb(14 15 18 / 0.18);
  --vx-border-subtle: rgb(14 15 18 / 0.06);

  /* ink — the primary action */
  --vx-ink:        var(--vx-neutral-950);
  --vx-ink-hover:  var(--vx-neutral-800);
  --vx-ink-active: var(--vx-neutral-700);
  --vx-ink-text:   var(--vx-neutral-0);

  /* accent — interactive state, selection, advisory */
  --vx-accent:        var(--vx-accent-700);
  --vx-accent-hover:  var(--vx-accent-800);
  --vx-accent-bg:     var(--vx-accent-100);
  --vx-accent-bg-hover: var(--vx-accent-200);
  --vx-accent-border: var(--vx-accent-300);
  --vx-accent-text:   var(--vx-accent-900);

  /* status */
  --vx-success:        var(--vx-success-700);
  --vx-success-bg:     var(--vx-success-100);
  --vx-success-border: var(--vx-success-300);
  --vx-success-text:   var(--vx-success-900);

  --vx-warning:        var(--vx-warning-700);
  --vx-warning-bg:     var(--vx-warning-100);
  --vx-warning-border: var(--vx-warning-300);
  --vx-warning-text:   var(--vx-warning-900);

  --vx-danger:         var(--vx-danger-700);
  --vx-danger-hover:   var(--vx-danger-800);
  --vx-danger-bg:      var(--vx-danger-100);
  --vx-danger-border:  var(--vx-danger-300);
  --vx-danger-text:    var(--vx-danger-900);
  /* Solid fill is its own role: --vx-danger is tuned for text, icons and
     borders, and is too light in dark mode to carry white label text. */
  --vx-danger-solid:       var(--vx-danger-700);
  --vx-danger-solid-hover: var(--vx-danger-800);
  --vx-danger-on-solid:    #ffffff;

  /* neutral status — offline, retired, disabled */
  --vx-quiet:        var(--vx-neutral-600);
  --vx-quiet-bg:     var(--vx-neutral-100);
  --vx-quiet-border: var(--vx-neutral-300);

  /* form controls */
  --vx-field-bg:           var(--vx-neutral-0);
  --vx-field-border:       rgb(14 15 18 / 0.18);
  --vx-field-border-hover: rgb(14 15 18 / 0.30);
  --vx-field-placeholder:  var(--vx-neutral-500);
  --vx-field-disabled-bg:  var(--vx-neutral-100);

  /* code / terminal */
  --vx-code-bg:     var(--vx-neutral-100);
  --vx-code-text:   var(--vx-neutral-800);
  --vx-terminal-bg:     var(--vx-neutral-1000);
  --vx-terminal-text:   #d7d8dc;
  --vx-terminal-dim:    #8b8e96;
  --vx-terminal-stderr: var(--vx-danger-300);
  --vx-terminal-ok:     var(--vx-success-300);

  --vx-focus-ring: var(--vx-accent-600);
}

/* ==========================================================================
   Semantic tokens — DARK

   Not an inversion: contrast ratios are held, shadows are dropped entirely
   (they either vanish or go harsh on dark), and depth comes from surface
   brightness plus a hairline inset ring.
   ========================================================================== */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    --vx-canvas:         var(--vx-neutral-1000);
    --vx-surface:        var(--vx-neutral-950);
    --vx-surface-sunken: #121317;
    --vx-surface-hover:  #1c1e23;
    --vx-surface-active: #24262c;
    --vx-surface-inverse:var(--vx-neutral-100);
    --vx-overlay-scrim:  rgb(5 5 7 / 0.65);

    --vx-text:           #ededef;
    --vx-text-secondary: #b9bbc1;
    --vx-text-muted:     #94969e;
    --vx-text-faint:     #74767e;
    --vx-text-inverse:   var(--vx-neutral-1000);
    --vx-text-link:      var(--vx-accent-300);

    --vx-border:        rgb(255 255 255 / 0.10);
    --vx-border-strong: rgb(255 255 255 / 0.18);
    --vx-border-subtle: rgb(255 255 255 / 0.06);

    /* Ink inverts: on dark, the highest-contrast action is near-white. */
    --vx-ink:        #ededef;
    --vx-ink-hover:  #ffffff;
    --vx-ink-active: #d5d6da;
    --vx-ink-text:   var(--vx-neutral-1000);

    --vx-accent:        var(--vx-accent-400);
    --vx-accent-hover:  var(--vx-accent-300);
    --vx-accent-bg:     rgb(74 134 212 / 0.14);
    --vx-accent-bg-hover: rgb(74 134 212 / 0.22);
    --vx-accent-border: rgb(74 134 212 / 0.34);
    --vx-accent-text:   var(--vx-accent-300);

    --vx-success:        var(--vx-success-400);
    --vx-success-bg:     rgb(79 178 127 / 0.14);
    --vx-success-border: rgb(79 178 127 / 0.32);
    --vx-success-text:   var(--vx-success-300);

    --vx-warning:        var(--vx-warning-400);
    --vx-warning-bg:     rgb(221 162 60 / 0.14);
    --vx-warning-border: rgb(221 162 60 / 0.32);
    --vx-warning-text:   var(--vx-warning-300);

    --vx-danger:         var(--vx-danger-400);
    --vx-danger-hover:   var(--vx-danger-300);
    --vx-danger-bg:      rgb(224 123 117 / 0.14);
    --vx-danger-border:  rgb(224 123 117 / 0.32);
    --vx-danger-text:    var(--vx-danger-300);
    /* Darker fill in dark mode so white label text still clears AA. */
    --vx-danger-solid:       var(--vx-danger-600);
    --vx-danger-solid-hover: var(--vx-danger-700);
    --vx-danger-on-solid:    #ffffff;

    --vx-quiet:        #94969e;
    --vx-quiet-bg:     rgb(255 255 255 / 0.06);
    --vx-quiet-border: rgb(255 255 255 / 0.14);

    --vx-field-bg:           #121317;
    --vx-field-border:       rgb(255 255 255 / 0.16);
    --vx-field-border-hover: rgb(255 255 255 / 0.28);
    --vx-field-placeholder:  #74767e;
    --vx-field-disabled-bg:  rgb(255 255 255 / 0.04);

    --vx-code-bg:   #121317;
    --vx-code-text: #d0d1d6;
    --vx-terminal-bg:   #0b0c0e;
    --vx-terminal-text: #d7d8dc;

    --vx-focus-ring: var(--vx-accent-400);

    /* No shadows in dark. Depth is surface brightness + inset hairline. */
    --vx-shadow-raised:  none;
    --vx-shadow-overlay: inset 0 0 0 1px rgb(255 255 255 / 0.06);
    --vx-shadow-popover: inset 0 0 0 1px rgb(255 255 255 / 0.06);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --vx-canvas:         var(--vx-neutral-1000);
  --vx-surface:        var(--vx-neutral-950);
  --vx-surface-sunken: #121317;
  --vx-surface-hover:  #1c1e23;
  --vx-surface-active: #24262c;
  --vx-surface-inverse:var(--vx-neutral-100);
  --vx-overlay-scrim:  rgb(5 5 7 / 0.65);

  --vx-text:           #ededef;
  --vx-text-secondary: #b9bbc1;
  --vx-text-muted:     #94969e;
  --vx-text-faint:     #74767e;
  --vx-text-inverse:   var(--vx-neutral-1000);
  --vx-text-link:      var(--vx-accent-300);

  --vx-border:        rgb(255 255 255 / 0.10);
  --vx-border-strong: rgb(255 255 255 / 0.18);
  --vx-border-subtle: rgb(255 255 255 / 0.06);

  --vx-ink:        #ededef;
  --vx-ink-hover:  #ffffff;
  --vx-ink-active: #d5d6da;
  --vx-ink-text:   var(--vx-neutral-1000);

  --vx-accent:        var(--vx-accent-400);
  --vx-accent-hover:  var(--vx-accent-300);
  --vx-accent-bg:     rgb(74 134 212 / 0.14);
  --vx-accent-bg-hover: rgb(74 134 212 / 0.22);
  --vx-accent-border: rgb(74 134 212 / 0.34);
  --vx-accent-text:   var(--vx-accent-300);

  --vx-success:        var(--vx-success-400);
  --vx-success-bg:     rgb(79 178 127 / 0.14);
  --vx-success-border: rgb(79 178 127 / 0.32);
  --vx-success-text:   var(--vx-success-300);

  --vx-warning:        var(--vx-warning-400);
  --vx-warning-bg:     rgb(221 162 60 / 0.14);
  --vx-warning-border: rgb(221 162 60 / 0.32);
  --vx-warning-text:   var(--vx-warning-300);

  --vx-danger:         var(--vx-danger-400);
  --vx-danger-hover:   var(--vx-danger-300);
  --vx-danger-bg:      rgb(224 123 117 / 0.14);
  --vx-danger-border:  rgb(224 123 117 / 0.32);
  --vx-danger-text:    var(--vx-danger-300);
  /* Darker fill in dark mode so white label text still clears AA. */
  --vx-danger-solid:       var(--vx-danger-600);
  --vx-danger-solid-hover: var(--vx-danger-700);
  --vx-danger-on-solid:    #ffffff;

  --vx-quiet:        #94969e;
  --vx-quiet-bg:     rgb(255 255 255 / 0.06);
  --vx-quiet-border: rgb(255 255 255 / 0.14);

  --vx-field-bg:           #121317;
  --vx-field-border:       rgb(255 255 255 / 0.16);
  --vx-field-border-hover: rgb(255 255 255 / 0.28);
  --vx-field-placeholder:  #74767e;
  --vx-field-disabled-bg:  rgb(255 255 255 / 0.04);

  --vx-code-bg:   #121317;
  --vx-code-text: #d0d1d6;
  --vx-terminal-bg:   #0b0c0e;
  --vx-terminal-text: #d7d8dc;

  --vx-focus-ring: var(--vx-accent-400);

  --vx-shadow-raised:  none;
  --vx-shadow-overlay: inset 0 0 0 1px rgb(255 255 255 / 0.06);
  --vx-shadow-popover: inset 0 0 0 1px rgb(255 255 255 / 0.06);
}
