/* Design tokens of Geruchslost AI - the only place for colours, sizes, durations and curves.
   Source: design Y (chosen 27.11.), same names and values as its prototype. Areas
   (app/static/css/<area>.css) use these variables and define no values of their own.
   Loaded after Basecoat, before app.css. Breakpoints: 760 px (mobile) and 2200 px (WQHD).
   No gradients, no glow, no glass: depth is four flat surfaces and three hairlines. */

:root {
  color-scheme: dark;

  /* Surfaces: the ground and four steps. */
  --bg: #000;
  --s1: #0a0a0a;
  --s2: #111111;
  --s3: #161616;
  --s4: #1f1f1f;
  /* Hairlines. */
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .12);
  --line-soft: rgba(255, 255, 255, .05);
  /* Text: three roles (--fg-3 up to --s3, never on --s4). */
  --fg: #ededed;
  --fg-2: #a1a1a1;
  --fg-3: #808080;
  /* Accent: one colour, three roles. */
  --accent: #8b5cf6;        /* graphics, progress, focus */
  --accent-solid: #7c4ff0;  /* primary button (white on it 5:1) */
  --accent-solid-h: #8358f2;
  --accent-fg: #a78bfa;     /* text and icons on black */
  --accent-tint: rgba(139, 92, 246, .12);
  --accent-tint-2: rgba(139, 92, 246, .2);
  --accent-line: rgba(139, 92, 246, .36);
  --on-accent: #fff;
  --on-accent-tint: rgba(0, 0, 0, .2);  /* keycap on the primary button */
  /* State - only for meaning. */
  --ok: #46c57e;
  --ok-tint: rgba(70, 197, 126, .12);
  --warn: #e0a23a;
  --warn-tint: rgba(224, 162, 58, .12);
  --err: #f0596b;
  --err-fg: #ff8e9b;
  --err-tint: rgba(240, 89, 107, .12);
  --err-tint-2: rgba(240, 89, 107, .2);
  --err-line: rgba(240, 89, 107, .32);
  /* Radii: nested (card > control > small > keycap). */
  --r-card: 12px;
  --r-ctl: 8px;
  --r-sm: 6px;
  --r-xs: 4px;
  /* Type: Geist for everything, Geist Mono for numbers in tables, ids, times and code. */
  --sans: 'Geist', system-ui, sans-serif;
  --mono: 'Geist Mono', ui-monospace, monospace;
  --t-xs: 12px;
  --t-sm: 13px;
  --t-base: 14px;
  --t-lg: 16px;
  --t-h1: 24px;
  --t-num: 32px;
  --t-hero: 44px;
  /* Grid (8 px). */
  --pad: 40px;
  --gap: 24px;
  --card-pad: 24px;
  --row: 48px;
  --ctl: 36px;
  --sidebar: 232px;
  --topbar: 56px;
  /* Motion: one curve, three durations. Nothing moves on load. */
  --ease: cubic-bezier(.22, .8, .24, 1);
  --d1: 120ms;
  --d2: 180ms;
  --d3: 240ms;

  /* Not in the prototype, same system: overlays, charts, code, layers. */
  --overlay: rgba(0, 0, 0, .64);
  --shadow-overlay: 0 24px 64px rgba(0, 0, 0, .7);
  --chart-accent: #a78bfa;
  --chart-1: #d9ccff;
  --chart-2: #b39cff;
  --chart-3: #8b6cf5;
  --chart-4: #7456dc;
  --chart-rest: #262626;
  --chart-rest-hover: #3a3a3a;
  --code-string: #c9c9c9;
  --read-chat: 760px;
  --read-guide: 720px;
  --bottombar-h: 0px;  /* design Y has no bottom bar; the chat still subtracts this name */
  --z-topbar: 20;
  --z-sidebar: 30;
  --z-overlay: 50;
  --z-toast: 60;

  /* Legacy names of the ground steps, as plain values in both themes: the theme miniatures in
     Settings read them from this block (app/core/settings/page.py). */
  --bg-0: #000; --bg-1: #0a0a0a; --bg-2: #111111; --bg-3: #161616; --bg-4: #1f1f1f; --bg-5: #262626;
}

/* WQHD: the same composition one step larger (pages add columns in their own CSS). */
@media (min-width: 2200px) {
  :root {
    --t-xs: 13px; --t-sm: 14px; --t-base: 15px; --t-lg: 17px; --t-h1: 28px; --t-num: 36px; --t-hero: 48px;
    --pad: 64px; --gap: 32px; --card-pad: 32px; --row: 52px; --ctl: 40px; --sidebar: 264px; --topbar: 64px;
  }
}
@media (max-width: 760px) {
  :root { --pad: 16px; --gap: 16px; --card-pad: 20px; --t-hero: 40px; --t-h1: 22px; }
}

/* Theme "graphite" (Settings): only the ground changes; --fg-3 follows to keep its contrast. */
:root[data-theme="graphite"] {
  --bg: #0e0e0e;
  --s1: #141414;
  --s2: #1a1a1a;
  --s3: #202020;
  --s4: #282828;
  --fg-3: #8f8f8f;
  --chart-rest: #303030;
  --bg-0: #0e0e0e; --bg-1: #141414; --bg-2: #1a1a1a; --bg-3: #202020; --bg-4: #282828; --bg-5: #303030;
}

/* Basecoat reads these names; its classes stay untouched. Two of its names are ours with
   another meaning (--accent is the violet, --sidebar a width), so the colours Basecoat
   derives from them are set directly. */
:root,
:root.dark {
  --background: var(--bg);
  --foreground: var(--fg);
  --card: var(--s1);
  --card-foreground: var(--fg);
  --popover: var(--s2);
  --popover-foreground: var(--fg);
  --primary: var(--accent-solid);
  --primary-foreground: var(--on-accent);
  --secondary: var(--s2);
  --secondary-foreground: var(--fg);
  --muted: var(--s2);
  --muted-foreground: var(--fg-3);
  --accent-foreground: var(--fg);
  --destructive: var(--err);
  --border: var(--line);
  --input: var(--line-2);
  --ring: var(--accent);
  --radius: var(--r-ctl);
  --color-accent: var(--s4);
  --color-sidebar: var(--bg);
  --sidebar-foreground: var(--fg-2);
  --sidebar-primary: var(--accent-solid);
  --sidebar-primary-foreground: var(--on-accent);
  --sidebar-accent: var(--s2);
  --sidebar-accent-foreground: var(--fg);
  --sidebar-border: var(--line);
  --sidebar-ring: var(--accent);
}

/* Reduced motion (system setting or Settings -> data-motion="reduced"): durations collapse,
   nothing stays hidden because of it. app.css switches the animations off. */
:root[data-motion="reduced"] {
  --d2: 0ms; --d3: 0ms;
}
@media (prefers-reduced-motion: reduce) {
  :root:not([data-motion="full"]) {
    --d2: 0ms; --d3: 0ms;
  }
}
