/* Missionplane on the Sendplane design system: tokens.
 *
 * The three colour blocks are the Sendplane tenant console's tokens, verbatim
 * from the "Sendplane" Design System artifact (tokens.json), which was synced
 * from anyplane-io/sendplane apps/web/app/globals.css at main@5658dbe.
 * Missionplane adopts that theme whole (docs/design-system.md). Change a value
 * only by re-syncing from Sendplane; test/design-system.test.ts compares them.
 *
 * <html data-theme> is "light", "dark" or "system"; js/theme.js sets it from
 * the saved preference before the first paint. Without it the page is light.
 */

@font-face {
  font-family: Inter;
  src: url("/css/fonts/inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --fg-primary: #171716;
  --fg-secondary: #6f6d68;
  --fg-tertiary: #74716b;
  --fg-inverse: #ffffff;
  --surface-canvas: #f7f7f5;
  --surface-primary: #ffffff;
  --surface-elevated: #fbfbfa;
  --surface-inset: #f1f0ed;
  --surface-sidebar: #fbfbfa;
  --border-subtle: #e8e6e1;
  --border-default: #d9d6cf;
  --border-strong: #bdb9b0;
  --focus-ring: #5945e8;
  --interactive-primary: #171716;
  --interactive-primary-hover: #302e2b;
  --interactive-selected: #edebe7;
  --success-fg: #13714f;
  --success-bg: #e9f6f0;
  --success-border: #a8d8c6;
  --warning-fg: #8b5105;
  --warning-bg: #fff4df;
  --warning-border: #e5c382;
  --danger-fg: #ae343d;
  --danger-bg: #ffedef;
  --danger-border: #e7b7bc;
  --info-fg: #514b79;
  --info-bg: #f4f2ff;
  --info-border: #d2ccf5;
  --shadow-color: rgb(23 23 22 / .14);
  --field-placeholder: #74716b;
  --scrim: rgb(23 23 22 / .38);
  --ink: var(--fg-primary);
  --muted: var(--fg-secondary);
  --quiet: var(--fg-tertiary);
  --line: var(--border-subtle);
  --surface: var(--surface-primary);
  --canvas: var(--surface-canvas);
  --soft: var(--surface-inset);
  --accent: #5945e8;
  --accent-dark: #4937ca;
  --success: var(--success-fg);
  --warning: var(--warning-fg);
  --danger: var(--danger-fg);
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --fg-primary: #f2f1ed;
  --fg-secondary: #bbb8b0;
  --fg-tertiary: #918e86;
  --fg-inverse: #171716;
  --surface-canvas: #121311;
  --surface-primary: #1a1a18;
  --surface-elevated: #22221f;
  --surface-inset: #151513;
  --surface-sidebar: #151514;
  --border-subtle: #302f2c;
  --border-default: #44423d;
  --border-strong: #5b5851;
  --focus-ring: #9386ff;
  --interactive-primary: #f2f1ed;
  --interactive-primary-hover: #d8d6d0;
  --interactive-selected: #302e2b;
  --success-fg: #77d9ad;
  --success-bg: #15352a;
  --success-border: #2e674f;
  --warning-fg: #f0bd70;
  --warning-bg: #382a14;
  --warning-border: #725324;
  --danger-fg: #ff969c;
  --danger-bg: #3d1d22;
  --danger-border: #76333c;
  --info-fg: #d1caff;
  --info-bg: #29243f;
  --info-border: #574d80;
  --shadow-color: rgb(0 0 0 / .44);
  --field-placeholder: #918e86;
  --scrim: rgb(0 0 0 / .64);
  --accent: #9386ff;
  --accent-dark: #b1a8ff;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    --fg-primary: #f2f1ed;
    --fg-secondary: #bbb8b0;
    --fg-tertiary: #918e86;
    --fg-inverse: #171716;
    --surface-canvas: #121311;
    --surface-primary: #1a1a18;
    --surface-elevated: #22221f;
    --surface-inset: #151513;
    --surface-sidebar: #151514;
    --border-subtle: #302f2c;
    --border-default: #44423d;
    --border-strong: #5b5851;
    --focus-ring: #9386ff;
    --interactive-primary: #f2f1ed;
    --interactive-primary-hover: #d8d6d0;
    --interactive-selected: #302e2b;
    --success-fg: #77d9ad;
    --success-bg: #15352a;
    --success-border: #2e674f;
    --warning-fg: #f0bd70;
    --warning-bg: #382a14;
    --warning-border: #725324;
    --danger-fg: #ff969c;
    --danger-bg: #3d1d22;
    --danger-border: #76333c;
    --info-fg: #d1caff;
    --info-bg: #29243f;
    --info-border: #574d80;
    --shadow-color: rgb(0 0 0 / .44);
    --field-placeholder: #918e86;
    --scrim: rgb(0 0 0 / .64);
    --accent: #9386ff;
    --accent-dark: #b1a8ff;
    color-scheme: dark;
  }
}

/* The code surface. Sendplane's code editor is dark in every theme
 * (studio-code-bg and studio-code-fg in tokens.json); rendered Markdown code
 * blocks use it too, which also suits the vendored highlight theme. */
:root {
  --studio-code-bg: #171716;
  --studio-code-fg: #e8e7e4;
}

/* The design system's named type, shape, depth and layout values. Shadows and
 * rings derive from the colour tokens, so dark mode needs no copy of them. */
:root {
  --font-sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "SFMono-Regular", Consolas, monospace;

  --radius-hairline: 4px;
  --radius-code: 5px;
  --radius-tag: 6px;
  --radius-chip: 7px;
  --radius-control: 8px;
  --radius-button: 9px;
  --radius-callout: 10px;
  --radius-group: 11px;
  --radius-menu: 12px;
  --radius-panel: 13px;
  --radius-dialog: 15px;
  --radius-card: 16px;
  --radius-pill: 999px;
  --radius-round: 50%;

  --shadow-control: 0 1px 2px var(--shadow-color);
  --shadow-segment: 0 1px 3px var(--shadow-color);
  --shadow-panel: 0 2px 8px var(--shadow-color);
  --shadow-lift: 0 3px 10px var(--shadow-color);
  --shadow-toast: 0 8px 24px var(--shadow-color);
  --shadow-auth: 0 16px 48px var(--shadow-color);
  --shadow-menu: 0 18px 48px var(--shadow-color), 0 2px 8px var(--shadow-color);
  --shadow-card: 0 18px 60px var(--shadow-color);
  --shadow-dialog: 0 24px 80px var(--shadow-color);
  --brand-mark-inset: inset 0 0 0 1px color-mix(in srgb, var(--fg-inverse) 12%, transparent);
  --focus-field: 0 0 0 3px var(--focus-ring);

  --sidebar-width: 246px;
  --page-max: 1100px;
  --control-height: 38px;
  --control-height-compact: 30px;
  --menu-width: 280px;
  --popover-width: 300px;
  --dialog-width: 620px;
  --auth-card-width: 430px;
  --avatar-size: 32px;
  --brand-mark-size: 28px;

  /* Missionplane's spacing steps for its own components (the design system
   * names recurring px values rather than a scale). */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* Stacking order: the design system's menu, popover and skip-link layers,
   * plus the dashboard's toasts, dialogs and command palette above them. */
  --z-menu: 20;
  --z-popover: 21;
  --z-dialog: 40;
  --z-command-palette: 50;
  --z-toast: 60;
  --z-skip-link: 100;
}
