/* Atrium UI v1: the family's shared design tokens.
   The source is Atrium's frontend/ui/v1/; every module console carries a byte-identical copy at its
   own ui/v1/, because each backend now serves its console itself and a module must still look right
   standalone. No CDN. The version is in the path so a change here cannot break a module that has not
   moved to it yet: v2 is a new directory, never an edit that changes what v1 means.

   Values are a reproduction of legalwork's look (eigenweltlabs/legalwork, MIT, frozen at 8255eba9):
   packages/ui/src/styles/tokens.css and apps/app/src/index.css. Prefix `--at-` on purpose: the
   consoles already use `--accent` for three different things, and an unprefixed shared name would
   collide with all of them. A console maps its own names onto these in an alias block; nothing else
   in a console should hold a raw colour.

   Two deliberate departures from legalwork:
   - status colours used as TEXT keep the family's darker shades (`--at-*-text`): legalwork's
     #12a150 on white is ~3:1, and text needs 4.5:1. The bright shade stays for fills and icons.
   - no "blackout" theme: light and dark only.
   - dark status colours are the family's own (legalwork defines only their soft grounds there), and
     `--at-text-secondary` is one step between legalwork's primary and secondary text, because the
     consoles use three text weights where legalwork uses two. */

@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("InterVariable.woff2") format("woff2");
}

:root {
  color-scheme: light;

  /* surfaces */
  --at-chrome: #f7f7f8;
  --at-sidebar: #f7f7f8;
  --at-canvas: #ffffff;
  --at-surface: #ffffff;
  --at-surface-hover: #f7f7f8;
  --at-sunken: #f7f7f8;
  --at-overlay: rgba(20, 22, 28, .28);
  --at-glass: rgba(255, 255, 255, .76);
  --at-glass-strong: rgba(255, 255, 255, .94);
  --at-glass-blur: 16px;

  /* text */
  --at-text: #0d0d0f;
  --at-text-content: #1a1c1f;
  --at-text-secondary: #52525a;
  --at-text-muted: #6c6c76;
  --at-text-faint: #8f8f98;
  --at-text-placeholder: #75757e;
  --at-text-inverse: #ffffff;

  /* lines and states */
  --at-border-subtle: rgba(13, 13, 15, .06);
  --at-border: rgba(13, 13, 15, .10);
  --at-border-strong: rgba(13, 13, 15, .16);
  --at-hover: rgba(13, 13, 15, .04);
  --at-active: rgba(13, 13, 15, .07);
  --at-selected: #efeff1;
  --at-focus-ring: rgba(53, 53, 59, .24);

  /* the one filled control colour: monochrome, like the family's chrome already is */
  --at-primary: #252529;
  --at-primary-hover: #35353b;
  --at-primary-active: #151518;
  --at-primary-fg: #ffffff;

  /* status: bright for fills and icons, -text for words, -soft for grounds */
  --at-success: #12a150;
  --at-success-text: #1f7a4d;
  --at-success-soft: #e7f6ee;
  --at-warning: #e5920b;
  --at-warning-text: #9a6200;
  --at-warning-soft: #fdf3e2;
  --at-danger: #e5484d;
  --at-danger-hover: #d13c41;
  --at-danger-text: #b02525;
  --at-danger-soft: #fdeaeb;

  /* elevation */
  --at-shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --at-shadow-sm: 0 1px 3px rgba(16, 24, 40, .07), 0 1px 2px rgba(16, 24, 40, .04);
  --at-shadow-md: 0 6px 16px rgba(16, 24, 40, .10), 0 2px 5px rgba(16, 24, 40, .05);
  --at-shadow-lg: 0 16px 40px rgba(16, 24, 40, .14), 0 4px 10px rgba(16, 24, 40, .06);
  --at-shadow-pop: 0 8px 28px rgba(16, 24, 40, .12);

  /* shape: legalwork's shadcn radius is 0.625rem; its components land on these steps */
  --at-radius-xs: 4px;
  --at-radius-sm: 6px;
  --at-radius-md: 8px;
  --at-radius-lg: 10px;
  --at-radius-xl: 13px;
  --at-radius-2xl: 17px;
  --at-radius-3xl: 20px;
  --at-radius-full: 9999px;

  /* type */
  --at-font-sans: "Inter Variable", "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --at-font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --at-tracking-body: -0.011em;
  --at-tracking-head: -0.022em;
  --at-tracking-title: -0.035em;

  /* motion */
  --at-ease: cubic-bezier(.2, 0, 0, 1);
  --at-ease-out: cubic-bezier(.16, 1, .3, 1);
  --at-dur-fast: 140ms;
  --at-dur-base: 180ms;
  --at-dur-slow: 240ms;

  /* shell geometry */
  --at-sidebar-w: 240px;
  --at-sidebar-min-w: 56px;
  --at-topbar-h: 48px;
  --at-window-curve: 18px;
  --at-content-max: 72rem;
  --at-control-h: 36px;
  --at-control-h-sm: 32px;
}

/* Dark, twice: once for "system" when the OS is dark (unless the person chose light), once for an
   explicit choice. The same two selectors every console already uses, so a console's pre-paint
   script keeps working unchanged. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --at-chrome: #242424;
    --at-sidebar: #151515;
    --at-canvas: #181818;
    --at-surface: #1d1d1d;
    --at-surface-hover: #242424;
    --at-sunken: #222222;
    --at-overlay: rgba(0, 0, 0, .55);
    --at-glass: rgba(29, 29, 29, .78);
    --at-glass-strong: rgba(29, 29, 29, .96);
    --at-text: #eeeeee;
    --at-text-content: #e5e5e5;
    --at-text-secondary: #c4c4c4;
    --at-text-muted: #adadad;
    --at-text-faint: #949494;
    --at-text-placeholder: #a1a1a1;
    --at-text-inverse: #141414;
    --at-border-subtle: rgba(255, 255, 255, .07);
    --at-border: rgba(255, 255, 255, .11);
    --at-border-strong: rgba(255, 255, 255, .18);
    --at-hover: rgba(255, 255, 255, .05);
    --at-active: rgba(255, 255, 255, .09);
    --at-selected: rgba(255, 255, 255, .08);
    --at-focus-ring: rgba(255, 255, 255, .32);
    --at-primary: #eeeeee;
    --at-primary-hover: #ffffff;
    --at-primary-active: #dddddd;
    --at-primary-fg: #141414;
    --at-success: #3cc47c;
    --at-success-text: #5cc98f;
    --at-success-soft: #10241a;
    --at-warning: #f0a830;
    --at-warning-text: #e8b45c;
    --at-warning-soft: #29200e;
    --at-danger: #f06a6e;
    --at-danger-hover: #f58588;
    --at-danger-text: #f08a80;
    --at-danger-soft: #200c10;
    --at-shadow-xs: 0 1px 2px rgba(0, 0, 0, .4);
    --at-shadow-sm: 0 1px 3px rgba(0, 0, 0, .45);
    --at-shadow-md: 0 6px 16px rgba(0, 0, 0, .5);
    --at-shadow-lg: 0 16px 40px rgba(0, 0, 0, .55);
    --at-shadow-pop: 0 8px 28px rgba(0, 0, 0, .5);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --at-chrome: #242424;
  --at-sidebar: #151515;
  --at-canvas: #181818;
  --at-surface: #1d1d1d;
  --at-surface-hover: #242424;
  --at-sunken: #222222;
  --at-overlay: rgba(0, 0, 0, .55);
  --at-glass: rgba(29, 29, 29, .78);
  --at-glass-strong: rgba(29, 29, 29, .96);
  --at-text: #eeeeee;
  --at-text-content: #e5e5e5;
  --at-text-secondary: #c4c4c4;
  --at-text-muted: #adadad;
  --at-text-faint: #949494;
  --at-text-placeholder: #a1a1a1;
  --at-text-inverse: #141414;
  --at-border-subtle: rgba(255, 255, 255, .07);
  --at-border: rgba(255, 255, 255, .11);
  --at-border-strong: rgba(255, 255, 255, .18);
  --at-hover: rgba(255, 255, 255, .05);
  --at-active: rgba(255, 255, 255, .09);
  --at-selected: rgba(255, 255, 255, .08);
  --at-focus-ring: rgba(255, 255, 255, .32);
  --at-primary: #eeeeee;
  --at-primary-hover: #ffffff;
  --at-primary-active: #dddddd;
  --at-primary-fg: #141414;
  --at-success: #3cc47c;
  --at-success-text: #5cc98f;
  --at-success-soft: #10241a;
  --at-warning: #f0a830;
  --at-warning-text: #e8b45c;
  --at-warning-soft: #29200e;
  --at-danger: #f06a6e;
  --at-danger-hover: #f58588;
  --at-danger-text: #f08a80;
  --at-danger-soft: #200c10;
  --at-shadow-xs: 0 1px 2px rgba(0, 0, 0, .4);
  --at-shadow-sm: 0 1px 3px rgba(0, 0, 0, .45);
  --at-shadow-md: 0 6px 16px rgba(0, 0, 0, .5);
  --at-shadow-lg: 0 16px 40px rgba(0, 0, 0, .55);
  --at-shadow-pop: 0 8px 28px rgba(0, 0, 0, .5);
}
