/* Planim site: design tokens, copied once from the desktop app
   (apps/desktop/src/index.css, "Halo 05 - Pill glass"). Values are verbatim;
   if a token changes in the app, change it here by hand.

   `data-theme="dark" | "light"` on <html> picks a theme (set early by
   theme.js from the saved choice). Without the attribute the page is dark,
   and light when the system asks for it, so it is right even without JS.
   Only the dark/light blocks below carry colours; nothing else in the site
   hard-codes a colour. */

:root {
  --spring: cubic-bezier(0.2, 1.25, 0.3, 1);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  /* Radii (utilities: rounded-ctl, rounded-card, rounded-pop, rounded-sheet) */
  --r-ctl: 10px; /* buttons, inputs, menu items */
  --r-card: 18px; /* cards */
  --r-pop: 16px; /* popovers */
  --r-sheet: 24px; /* modals */
}

@supports (transition-timing-function: linear(0, 1)) {
  :root {
    --spring: linear(
      0,
      0.0018,
      0.0069 1.15%,
      0.026 2.3%,
      0.0637,
      0.1135 5.18%,
      0.2229 7.78%,
      0.5977 15.84%,
      0.7014,
      0.7904,
      0.8641,
      0.9228,
      0.9676 28.8%,
      1.0032 31.68%,
      1.0225,
      1.0352 36.29%,
      1.0431 38.88%,
      1.046 42.05%,
      1.0448 44.35%,
      1.0407 47.23%,
      1.0118 61.63%,
      1.0025 69.41%,
      0.9981 80.35%,
      0.9992 99.94%
    );
  }
}

/* ---------- dark (default) ---------- */
:root,
:root[data-theme="dark"] {
  color-scheme: dark;

  --wall-base: #08151a;
  --blob-1: #0d5a53;
  --blob-2: #9c5222;
  --blob-3: #183a74;
  --blob-4: #35603a;
  --blob-5: #0f7182;
  --blob-opacity: 0.55;

  --glass: rgb(20 28 32 / 0.4);
  --glass-strong: rgb(18 25 29 / 0.6);
  --glass-dense: rgb(15 21 25 / 0.76);
  --glass-solid: #172024;
  --sheen: rgb(255 255 255 / 0.06);
  --rim: rgb(255 255 255 / 0.4);
  --rim-2: rgb(255 255 255 / 0.07);
  --hi: rgb(255 255 255 / 0.12);
  --lo: rgb(0 0 0 / 0.3);

  --line: rgb(255 255 255 / 0.11);
  --line-2: rgb(255 255 255 / 0.065);
  --fill: rgb(255 255 255 / 0.065);
  --fill-2: rgb(255 255 255 / 0.12);
  --seg-ind: rgb(255 255 255 / 0.16);
  --card: rgb(255 255 255 / 0.05);
  --card-hover: rgb(255 255 255 / 0.09);

  --ink: #eef4f4;
  --on-ink: #0c1a22;

  --live: #4ade80;
  --mid: #f2c14e;
  --lo-c: #ff9a6a;
  --warn-bg: rgb(245 170 60 / 0.12);
  --warn-line: rgb(245 170 60 / 0.5);
  --warn-text: #ffd59a;
  --ring-track: rgb(255 255 255 / 0.13);

  --shadow:
    0 1px 2px rgb(0 0 0 / 0.35), 0 12px 32px -6px rgb(0 0 0 / 0.5),
    0 40px 90px -30px rgb(0 0 0 / 0.65);
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.3), 0 4px 14px -6px rgb(0 0 0 / 0.45);

  --bg: #0e171b;
  --surface: #172024;

  --hairline: rgb(255 255 255 / 0.045);

  --text: #eef4f4;
  --text-secondary: rgb(238 244 244 / 0.76);
  --text-muted: rgb(238 244 244 / 0.62);
  --text-faint: rgb(238 244 244 / 0.48);

  --accent: #4fd1bb;
  --accent-contrast: #04231e;
  --ok: #4ade80;
  --info: #7cc0f2;
  --warn: var(--mid);
  --danger: #f87171;
  --on-danger: #2a0505;
}

/* ---------- light ---------- */
:root[data-theme="light"] {
  color-scheme: light;

  --wall-base: #c9d9d1;
  --blob-1: #69c2a8;
  --blob-2: #f2a260;
  --blob-3: #77a5e3;
  --blob-4: #ebcf86;
  --blob-5: #3b9287;
  --blob-opacity: 0.5;

  --glass: rgb(255 255 255 / 0.48);
  --glass-strong: rgb(250 252 252 / 0.68);
  --glass-dense: rgb(247 250 250 / 0.8);
  --glass-solid: #eef3f2;
  --sheen: rgb(255 255 255 / 0.6);
  --rim: rgb(255 255 255 / 0.95);
  --rim-2: rgb(255 255 255 / 0.3);
  --hi: rgb(255 255 255 / 0.75);
  --lo: rgb(0 0 0 / 0.04);

  --line: rgb(12 26 34 / 0.11);
  --line-2: rgb(12 26 34 / 0.07);
  --fill: rgb(12 26 34 / 0.05);
  --fill-2: rgb(12 26 34 / 0.09);
  --seg-ind: rgb(255 255 255 / 0.92);
  --card: rgb(255 255 255 / 0.52);
  --card-hover: rgb(255 255 255 / 0.74);

  --ink: #10202a;
  --on-ink: #ffffff;

  --live: #15a34a;
  --mid: #a76a00;
  --lo-c: #c2410c;
  --warn-bg: rgb(240 160 40 / 0.13);
  --warn-line: rgb(200 120 20 / 0.55);
  --warn-text: #7f4505;
  --ring-track: rgb(12 26 34 / 0.1);

  --shadow:
    0 1px 2px rgb(16 32 40 / 0.06), 0 10px 30px -6px rgb(16 40 48 / 0.2),
    0 40px 80px -30px rgb(16 40 48 / 0.38);
  --shadow-sm: 0 1px 2px rgb(16 32 40 / 0.07), 0 4px 14px -6px rgb(16 40 48 / 0.18);

  --bg: #e9f0ee;
  --surface: #f6f9f8;

  --hairline: rgb(12 26 34 / 0.05);

  --text: #0c1a22;
  --text-secondary: rgb(12 26 34 / 0.74);
  --text-muted: rgb(12 26 34 / 0.62);
  --text-faint: rgb(12 26 34 / 0.5);

  --accent: #0b8574;
  --accent-contrast: #ffffff;
  --ok: #15803d;
  --info: #1f6fb2;
  --warn: var(--mid);
  --danger: #d93036;
  --on-danger: #ffffff;
}

/* ---------- light by system preference, until the user chooses ---------- */
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    color-scheme: light;

    --wall-base: #c9d9d1;
    --blob-1: #69c2a8;
    --blob-2: #f2a260;
    --blob-3: #77a5e3;
    --blob-4: #ebcf86;
    --blob-5: #3b9287;
    --blob-opacity: 0.5;

    --glass: rgb(255 255 255 / 0.48);
    --glass-strong: rgb(250 252 252 / 0.68);
    --glass-dense: rgb(247 250 250 / 0.8);
    --glass-solid: #eef3f2;
    --sheen: rgb(255 255 255 / 0.6);
    --rim: rgb(255 255 255 / 0.95);
    --rim-2: rgb(255 255 255 / 0.3);
    --hi: rgb(255 255 255 / 0.75);
    --lo: rgb(0 0 0 / 0.04);

    --line: rgb(12 26 34 / 0.11);
    --line-2: rgb(12 26 34 / 0.07);
    --fill: rgb(12 26 34 / 0.05);
    --fill-2: rgb(12 26 34 / 0.09);
    --seg-ind: rgb(255 255 255 / 0.92);
    --card: rgb(255 255 255 / 0.52);
    --card-hover: rgb(255 255 255 / 0.74);

    --ink: #10202a;
    --on-ink: #ffffff;

    --live: #15a34a;
    --mid: #a76a00;
    --lo-c: #c2410c;
    --warn-bg: rgb(240 160 40 / 0.13);
    --warn-line: rgb(200 120 20 / 0.55);
    --warn-text: #7f4505;
    --ring-track: rgb(12 26 34 / 0.1);

    --shadow:
      0 1px 2px rgb(16 32 40 / 0.06), 0 10px 30px -6px rgb(16 40 48 / 0.2),
      0 40px 80px -30px rgb(16 40 48 / 0.38);
    --shadow-sm: 0 1px 2px rgb(16 32 40 / 0.07), 0 4px 14px -6px rgb(16 40 48 / 0.18);

    --bg: #e9f0ee;
    --surface: #f6f9f8;

    --hairline: rgb(12 26 34 / 0.05);

    --text: #0c1a22;
    --text-secondary: rgb(12 26 34 / 0.74);
    --text-muted: rgb(12 26 34 / 0.62);
    --text-faint: rgb(12 26 34 / 0.5);

    --accent: #0b8574;
    --accent-contrast: #ffffff;
    --ok: #15803d;
    --info: #1f6fb2;
    --warn: var(--mid);
    --danger: #d93036;
    --on-danger: #ffffff;
  }
}
