/* Cosmic AIO tokens. The only place a literal value is allowed.
   Mirrors docs/design/DESIGN_SYSTEM.md.

   Two palettes. Nebula is the default. Gold is the original warm one, kept whole so the
   decision is reversible: set data-palette="gold" on <html>, or load any page with
   ?palette=gold. See DESIGN_SYSTEM.md section 3. */

:root {
  /* ---------- Structure, shared by both palettes ---------- */

  --font-display: "Newsreader", Georgia, "Times New Roman", serif;
  --font-ui: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  --t-display-xl: 300 3.5rem/1.04 var(--font-display);
  --t-display-l: 300 2.375rem/1.1 var(--font-display);
  --t-display-m: 400 1.6875rem/1.2 var(--font-display);
  --t-title: 500 1.25rem/1.3 var(--font-ui);
  --t-subtitle: 500 1rem/1.45 var(--font-ui);
  --t-body: 400 0.9375rem/1.62 var(--font-ui);
  --t-body-s: 400 0.875rem/1.5 var(--font-ui);
  --t-label: 500 0.8125rem/1.3 var(--font-ui);
  --t-micro: 500 0.75rem/1.25 var(--font-ui);
  --t-mono: 400 0.8125rem/1.5 var(--font-mono);
  --t-mono-s: 400 0.75rem/1.45 var(--font-mono);

  --s-1: 2px;  --s-2: 4px;  --s-3: 6px;  --s-4: 8px;   --s-5: 12px;
  --s-6: 16px; --s-7: 20px; --s-8: 24px; --s-9: 32px;  --s-10: 40px;
  --s-11: 56px; --s-12: 72px; --s-13: 96px;

  --r-1: 4px;
  --r-2: 6px;
  --r-3: 8px;
  --r-pill: 999px;

  --w-prose: 66ch;
  --w-page: 1200px;
  --w-app: 1440px;
  --nav-w: 232px;
  --topbar-h: 52px;
  --row-h: 42px;
  --control-h: 34px;
  --control-h-lg: 40px;

  --dur-1: 120ms;
  --dur-2: 160ms;
  --dur-3: 220ms;
  --ease-out: cubic-bezier(0.22, 0.80, 0.30, 1);
  --ease-in: cubic-bezier(0.50, 0.00, 0.90, 0.40);

  --focus-ring: 0 0 0 2px var(--canvas), 0 0 0 4px var(--accent);

  --z-nav: 20;
  --z-menu: 40;
  --z-drawer: 50;
  --z-dialog: 60;
  --z-toast: 70;

  /* Status is the same in both palettes. It belongs to the message, not to the brand. */
  --ok: #79A98B;
  --ok-sunk: rgba(121, 169, 139, 0.14);
  --warn: #C9793C;
  --warn-sunk: rgba(201, 121, 60, 0.14);
  --danger: #C9564B;
  --danger-sunk: rgba(201, 86, 75, 0.14);

  --overlay: rgba(0, 0, 0, 0.62);
  --shadow-pop: 0 18px 40px rgba(0, 0, 0, 0.58), 0 2px 6px rgba(0, 0, 0, 0.42);
}

/* ---------- Palette: Nebula (default) ---------- */
/* Cool near-black with a violet cast. One accent: orchid. */

:root,
:root[data-palette="nebula"] {
  --canvas: #0C0B10;
  --canvas-sunk: #08070B;
  --surface: #15131B;
  --surface-raised: #1B1824;
  --surface-hover: #211D2B;
  --hairline: rgba(238, 234, 246, 0.08);
  --hairline-strong: rgba(238, 234, 246, 0.14);

  --text: #F1EDF6;
  --text-muted: #A39CB0;
  --text-tertiary: #8A8398;
  --text-faint: #6E6880;
  --text-inverse: #0C0B10;

  --accent: #C8A2D8;
  --accent-hover: #D7B6E4;
  --accent-line: rgba(200, 162, 216, 0.40);
  --accent-sunk: rgba(200, 162, 216, 0.13);

  /* The sky */
  --neb-1: #C98BC4;
  --neb-2: #7E7CC0;
  --neb-3: #B5617E;
  --neb-1-strength: 0.34;
  --neb-2-strength: 0.28;
  --neb-3-strength: 0.18;
  --star: #F4EFF8;
  --star-warm: #E0B8E8;

  /* The Event Horizon, from the hottest inner edge to the dimmest receding side */
  --eh-core: #FFF2FB;
  --eh-hot: #F3C9E8;
  --eh-mid: #C8A2D8;
  --eh-dim: #8E6BAE;
  --eh-dark: #52406B;
  --eh-aura-1: #E8BCE0;
  --eh-aura-2: #9B6FBF;
  --eh-aura-3: #6A4A8C;
}

/* ---------- Palette: Gold (the original) ---------- */
/* Warm near-black. One accent: paper gold. */

:root[data-palette="gold"] {
  --canvas: #0E0D0C;
  --canvas-sunk: #0A0908;
  --surface: #161412;
  --surface-raised: #1C1A17;
  --surface-hover: #211E1B;
  --hairline: rgba(244, 238, 226, 0.08);
  --hairline-strong: rgba(244, 238, 226, 0.14);

  --text: #F4EFE6;
  --text-muted: #A39B8E;
  --text-tertiary: #8A8277;
  --text-faint: #6F675C;
  --text-inverse: #0E0D0C;

  --accent: #D8B26A;
  --accent-hover: #E6C07A;
  --accent-line: rgba(216, 178, 106, 0.38);
  --accent-sunk: rgba(216, 178, 106, 0.12);

  --neb-1: #D8B26A;
  --neb-2: #7E93A8;
  --neb-3: #B86B3D;
  --neb-1-strength: 0.36;
  --neb-2-strength: 0.30;
  --neb-3-strength: 0.20;
  --star: #F4EFE6;
  --star-warm: #E6C07A;

  --eh-core: #FFF6E2;
  --eh-hot: #FFE3AE;
  --eh-mid: #E6C07A;
  --eh-dim: #A97B3C;
  --eh-dark: #6A4A26;
  --eh-aura-1: #F3DCA8;
  --eh-aura-2: #C98B4A;
  --eh-aura-3: #8A5A2E;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-1: 1ms;
    --dur-2: 1ms;
    --dur-3: 1ms;
  }
}
