/* Cym semantic tokens. Every component reads these (or a palette constant from palette.css).
   The values are the live workbench's, measured 2026-11-23.
   The library default sits on the outermost Cym root only; a themed surface (ThemeProvider,
   ThemeSurface, the shell, a portal: `.c-theme-surface[data-cym-theme]`) sets light or dark on
   itself, and everything inside inherits from the nearest one, so a light panel inside a dark page
   (or the reverse) is drawn in its own theme. */

@font-face {
  font-family: "Cym DM Sans";
  src: url("../fonts/dm-sans.ttf") format("truetype");
  font-weight: 100 1000;
  font-style: normal;
  font-display: swap;
}

:where(.cym-ui):not(.cym-ui .cym-ui) {
  color-scheme: light;
  /* Surfaces and ink: the library's own defaults, outside any themed surface. */
  --c-bg: #fcfcfd;
  --c-panel: #ffffff;
  --c-input: #fcfcfc;
  --c-text: #2e3038;
  --c-muted: #73798c;
  --c-border: #e3e4e8;
  --c-soft: #f1f2f4;
  --c-accent: #f2330d;
  --c-accent-soft: #feebe7;
  --c-hover: #e4e6eb;

  /* Type, geometry and line. */
  --c-font: "Cym DM Sans", "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --c-font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --c-text-xs: 11px;
  --c-text-sm: 12px;
  --c-text-base: 14px;
  --c-text-md: 15px;
  --c-text-lg: 20px;
  --c-text-xl: 22px;
  --c-radius-xs: 4px;
  --c-radius-sm: 6px;
  --c-radius: 8px;
  --c-radius-md: 10px;
  --c-radius-card: 14px;
  --c-radius-lg: 16px;
  --c-radius-pill: 999px;
  --c-icon-stroke: 1.65;
  --c-focus: 2px solid var(--c-accent);
  --c-row-height: 34px;

  /* Page container. */
  --c-page-max: 1440px;
  --c-page-max-wide: 1608px;
  --c-page-gutter: 28px;
  --c-rail-collapse: 1100px;

  /* Elevation. */
  --c-shadow-pop: 0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a;
  --c-shadow-dialog: 0 24px 80px #0002;
  --c-shadow-float: 0 6px 20px rgba(0, 0, 0, 0.1);
  --c-overlay: #171b2540;

  /* Frosted corner icons over artwork: the same in both themes, since they sit on pictures. */
  --c-frost: rgba(23, 27, 37, 0.42);
  --c-frost-hover: rgba(23, 27, 37, 0.62);

  /* Status: the three calm pills (neutral, sage ok, coral attention) and the error line. */
  --c-ok-text: #3f765c;
  --c-ok-soft: rgba(89, 131, 111, 0.14);
  --c-attention-text: #c93314;
  --c-attention-soft: rgba(242, 51, 13, 0.12);
  --c-danger-text: #bd372c;
  --c-accent-text: #bb2d10;

  /* Controls. */
  --c-switch-off: #d6d9e0;
  --c-primary-hover: #454954;
  --c-tooltip-bg: #e2e4e9;
  --c-tooltip-text: #2e3038;

  /* The board behind a canvas of regions: a step below the page so region cards stand on it. */
  --c-canvas-bg: #f6f6f8;
  --c-canvas-dot: #d8d9df;
  --c-region-bg: #fcfcfd;
}

.cym-ui.c-theme-surface[data-cym-theme="light"] {
  --c-bg: #fcfcfd;
  --c-panel: #ffffff;
  --c-input: #fcfcfc;
  --c-text: #2e3038;
  --c-muted: #73798c;
  --c-border: #e3e4e8;
  --c-soft: #ebecef;
  --c-hover: #e3e4e8;
  --c-accent: #f2330d;
  --c-accent-soft: #feebe7;
  --c-ok-text: #3f765c;
  --c-ok-soft: rgba(89, 131, 111, 0.14);
  --c-attention-text: #c93314;
  --c-attention-soft: rgba(242, 51, 13, 0.12);
  --c-danger-text: #bd372c;
  --c-accent-text: #bb2d10;
  --c-overlay: #171b2540;
  --c-switch-off: #d6d9e0;
  --c-primary-hover: #454954;
  --c-canvas-bg: #f6f6f8;
  --c-canvas-dot: #d8d9df;
  --c-region-bg: #fcfcfd;
  color-scheme: light;
}

.cym-ui.c-theme-surface[data-cym-theme="dark"] {
  --c-bg: #0d0e12;
  --c-panel: #16181d;
  --c-input: #1e1f25;
  --c-text: #ebecef;
  --c-muted: #aaaebb;
  --c-border: #434651;
  --c-soft: #16181d;
  --c-hover: #2a2d36;
  --c-accent: #f2330d;
  --c-accent-soft: rgba(242, 51, 13, 0.2);
  --c-ok-text: #8fd1b1;
  --c-ok-soft: rgba(89, 131, 111, 0.24);
  --c-attention-text: #ff8c73;
  --c-attention-soft: rgba(242, 51, 13, 0.22);
  --c-danger-text: #ff7a5c;
  --c-accent-text: #ff7a5c;
  --c-overlay: #00000073;
  --c-switch-off: #434651;
  --c-primary-hover: #c6c9d2;
  --c-shadow-pop: 0 10px 15px -3px #00000059, 0 4px 6px -4px #00000059;
  --c-shadow-float: 0 6px 20px rgba(0, 0, 0, 0.4);
  /* Recessed: a step darker than the page, so region panels (#16181d) stand up from it. */
  --c-canvas-bg: #08090b;
  --c-canvas-dot: #262930;
  --c-region-bg: #111318;
  color-scheme: dark;
}
