/* Open Deck, Conning's tokens (DESIGN.md, shared with site/index.html): a near-white
   ground with a sea-glass lean and white surfaces told apart by tone, or deep navy in
   the evening; harbour navy for the brand and the one main button. Amber (lamp) only
   ever means "an agent needs you", teal (sea) only "an agent is working", red (bad)
   only "broke, or can't be undone". The theme follows the computer; a data-theme
   attribute on the root element overrides it. */

:root {
  color-scheme: light;

  --font: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Bricolage Grotesque", "Figtree", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --r-s: 10px; /* inputs, keys */
  --r-m: 18px; /* cards */
  --r-l: 24px; /* panels and dialogs */
  --r-pill: 9999px; /* buttons, chips, faces */

  --ground: oklch(0.975 0.005 170);
  --surface: oklch(1 0 0);
  --sunk: oklch(0.953 0.007 175);
  --line: oklch(0.905 0.01 190);
  --control: oklch(0.8 0.015 230);
  --ink: oklch(0.25 0.03 255);
  --muted: oklch(0.46 0.022 255);
  --faint: oklch(0.5 0.022 255);

  --harbour: oklch(0.39 0.1 256);
  --harbour-hover: oklch(0.33 0.1 256);
  --on-harbour: oklch(0.99 0.005 250);
  --harbour-soft: oklch(0.945 0.025 250);
  --harbour-text: oklch(0.39 0.1 256);

  --lamp: oklch(0.79 0.15 72);
  --lamp-soft: oklch(0.965 0.045 85);
  --lamp-ink: oklch(0.43 0.1 60);
  --on-lamp: oklch(0.25 0.05 60);
  --sea: oklch(0.62 0.11 185);
  --sea-soft: oklch(0.955 0.03 185);
  --sea-ink: oklch(0.4 0.075 190);
  --bad: oklch(0.55 0.18 27);
  --bad-soft: oklch(0.965 0.025 27);

  /* Crew tints: each agent's face, a pale fill with the dark of its own hue. */
  --sky-bg: oklch(0.91 0.055 245);
  --sky-ink: oklch(0.36 0.11 250);
  --rose-bg: oklch(0.915 0.05 5);
  --rose-ink: oklch(0.41 0.13 5);
  --moss-bg: oklch(0.915 0.06 128);
  --moss-ink: oklch(0.38 0.09 135);
  --lilac-bg: oklch(0.915 0.05 305);
  --lilac-ink: oklch(0.4 0.12 305);
  --slate-bg: oklch(0.91 0.015 240);
  --slate-ink: oklch(0.38 0.03 250);

  --term-bg: oklch(0.25 0.03 256);
  --term-ink: oklch(0.9 0.012 240);
  --term-dim: oklch(0.72 0.02 245);

  --scrim: oklch(0.25 0.03 255 / 0.38);
  --shadow-float: 0 18px 50px -12px oklch(0.25 0.04 255 / 0.28), 0 2px 6px oklch(0.25 0.04 255 / 0.08);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ground: oklch(0.205 0.022 255);
    --surface: oklch(0.25 0.024 255);
    --sunk: oklch(0.175 0.02 255);
    --line: oklch(0.32 0.022 255);
    --control: oklch(0.47 0.02 255);
    --ink: oklch(0.95 0.008 240);
    --muted: oklch(0.77 0.02 245);
    --faint: oklch(0.68 0.02 245);
    --harbour: oklch(0.82 0.08 245);
    --harbour-hover: oklch(0.88 0.06 245);
    --on-harbour: oklch(0.2 0.03 255);
    --harbour-soft: oklch(0.3 0.045 255);
    --harbour-text: oklch(0.84 0.08 245);
    --lamp: oklch(0.8 0.14 75);
    --lamp-soft: oklch(0.34 0.045 75);
    --lamp-ink: oklch(0.88 0.11 82);
    --on-lamp: oklch(0.22 0.04 60);
    --sea: oklch(0.72 0.11 185);
    --sea-soft: oklch(0.29 0.045 190);
    --sea-ink: oklch(0.86 0.08 185);
    --bad: oklch(0.72 0.15 27);
    --bad-soft: oklch(0.3 0.06 27);
    --sky-bg: oklch(0.38 0.07 250);
    --sky-ink: oklch(0.93 0.04 245);
    --rose-bg: oklch(0.38 0.07 5);
    --rose-ink: oklch(0.93 0.04 5);
    --moss-bg: oklch(0.38 0.06 135);
    --moss-ink: oklch(0.93 0.05 128);
    --lilac-bg: oklch(0.38 0.07 305);
    --lilac-ink: oklch(0.93 0.04 305);
    --slate-bg: oklch(0.36 0.02 250);
    --slate-ink: oklch(0.92 0.01 240);
    --term-bg: oklch(0.155 0.02 256);
    --term-ink: oklch(0.9 0.012 240);
    --term-dim: oklch(0.7 0.02 245);
    --scrim: oklch(0.1 0.02 255 / 0.6);
    --shadow-float: 0 18px 50px -12px oklch(0 0 0 / 0.6), 0 2px 6px oklch(0 0 0 / 0.3);
  }
}

/* An explicit theme choice on the root element wins over the computer's setting. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: oklch(0.205 0.022 255);
  --surface: oklch(0.25 0.024 255);
  --sunk: oklch(0.175 0.02 255);
  --line: oklch(0.32 0.022 255);
  --control: oklch(0.47 0.02 255);
  --ink: oklch(0.95 0.008 240);
  --muted: oklch(0.77 0.02 245);
  --faint: oklch(0.68 0.02 245);
  --harbour: oklch(0.82 0.08 245);
  --harbour-hover: oklch(0.88 0.06 245);
  --on-harbour: oklch(0.2 0.03 255);
  --harbour-soft: oklch(0.3 0.045 255);
  --harbour-text: oklch(0.84 0.08 245);
  --lamp: oklch(0.8 0.14 75);
  --lamp-soft: oklch(0.34 0.045 75);
  --lamp-ink: oklch(0.88 0.11 82);
  --on-lamp: oklch(0.22 0.04 60);
  --sea: oklch(0.72 0.11 185);
  --sea-soft: oklch(0.29 0.045 190);
  --sea-ink: oklch(0.86 0.08 185);
  --bad: oklch(0.72 0.15 27);
  --bad-soft: oklch(0.3 0.06 27);
  --sky-bg: oklch(0.38 0.07 250);
  --sky-ink: oklch(0.93 0.04 245);
  --rose-bg: oklch(0.38 0.07 5);
  --rose-ink: oklch(0.93 0.04 5);
  --moss-bg: oklch(0.38 0.06 135);
  --moss-ink: oklch(0.93 0.05 128);
  --lilac-bg: oklch(0.38 0.07 305);
  --lilac-ink: oklch(0.93 0.04 305);
  --slate-bg: oklch(0.36 0.02 250);
  --slate-ink: oklch(0.92 0.01 240);
  --term-bg: oklch(0.155 0.02 256);
  --term-ink: oklch(0.9 0.012 240);
  --term-dim: oklch(0.7 0.02 245);
  --scrim: oklch(0.1 0.02 255 / 0.6);
  --shadow-float: 0 18px 50px -12px oklch(0 0 0 / 0.6), 0 2px 6px oklch(0 0 0 / 0.3);
}
