/* Tase Design System — Canonical Tokens
 * Synchronized with DESIGN-PHILOSOPHY.md, tokens/tase-tokens.json,
 * and tasecode crates/desktop/kit/src/theme.rs.
 * Self-hosted fonts: zero external requests.
 */

@font-face {
  font-family: "Inter";
  src: url("../assets/fonts/Inter.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("../assets/fonts/JetBrainsMono.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

:root,
[data-theme="dark"] {
  color-scheme: dark;

  /* Neutral graphite ladder */
  --bg: #141417;
  --surface: #101013;
  --raised: #1d1d22;
  --overlay: #1d1d22;
  --sunken: #18181c;
  --hover: #26262d;
  --selected: rgba(124, 134, 255, 0.14);

  /* Edges */
  --hairline: #2a2a31;
  --border: #3a3a43;

  /* Ink */
  --text: #e9e9ee;
  --muted: #9d9da8;
  --faint: #6c6c77;

  /* Single accent: indigo */
  --accent: #7c86ff;
  --accent-hover: #959dff;
  --accent-strong: #5d61f0;
  --accent-strong-hover: #6e72f5;
  --on-accent: #ffffff;
  --accent-soft: rgba(124, 134, 255, 0.14);
  --accent-text: #8b93ff;

  /* Honest states */
  --live: #22c55e;
  --live-text: #22c55e;
  --live-soft: rgba(34, 197, 94, 0.12);
  --warn: #f59e0b;
  --warn-text: #f59e0b;
  --warn-soft: rgba(245, 158, 11, 0.10);
  --danger: #ef4444;
  --danger-text: #f87171;
  --danger-soft: rgba(239, 68, 68, 0.12);
  --info: #38bdf8;
  --info-soft: rgba(56, 189, 248, 0.12);

  /* Diff & syntax */
  --diff-add: rgba(34, 197, 94, 0.12);
  --diff-add-gutter: rgba(34, 197, 94, 0.20);
  --diff-del: rgba(239, 68, 68, 0.12);
  --diff-del-gutter: rgba(239, 68, 68, 0.20);
  --syn-kw: #c58af9;
  --syn-str: #72d9a6;
  --syn-fn: #8b93ff;
  --syn-num: #f2c06b;
  --syn-com: #6c6c77;
  --syn-type: #7adbe8;

  /* Depth & chrome */
  --sheen: linear-gradient(180deg, rgba(255, 255, 255, 0.035) 0%, rgba(255, 255, 255, 0) 100%);
  --bar-bg: rgba(16, 16, 19, 0.76);
  --bar-solid: #101013;
  --scrim: rgba(0, 0, 0, 0.52);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.28), 0 4px 12px rgba(0, 0, 0, 0.16);
  --shadow-overlay: 0 8px 24px rgba(0, 0, 0, 0.38), 0 2px 6px rgba(0, 0, 0, 0.24);
  --ambient-glow: radial-gradient(ellipse 72% 320px at 50% 0%, rgba(124, 134, 255, 0.09) 0%, rgba(124, 134, 255, 0) 100%);

  /* Typography */
  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Spacing grid (4px base + approved half-steps) */
  --s-0-5: 2px;
  --s-1: 4px;
  --s-1-5: 6px;
  --s-2: 8px;
  --s-3: 12px;
  --s-3-5: 14px;
  --s-4: 16px;
  --s-6: 24px;
  --s-7: 28px;
  --s-8: 32px;
  --s-12: 48px;
  --s-16: 64px;

  /* Radii */
  --r-4: 4px;
  --r-6: 6px;
  --r-8: 8px;
  --r-10: 10px;
  --r-12: 12px;
  --r-14: 14px;
  --r-16: 16px;
  --r-full: 999px;

  /* Geometry */
  --header-h: 56px;
  --sidebar-w: 280px;
  --col-w: 740px;
  --max-w: 1120px;

  /* Motion */
  --t-state: 180ms;
  --t-sheet: 260ms;
  --t-exit: 140ms;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

  --bg: #ffffff;
  --surface: #f7f7f8;
  --raised: #f3f3f5;
  --overlay: #ffffff;
  --sunken: #f6f6f8;
  --hover: #e9e9ee;
  --selected: rgba(79, 70, 229, 0.10);

  --hairline: #e4e4ea;
  --border: #d5d5dd;

  --text: #19191d;
  --muted: #5f5f6b;
  --faint: #8e8e99;

  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-strong: #4338ca;
  --accent-strong-hover: #3730a3;
  --on-accent: #ffffff;
  --accent-soft: rgba(79, 70, 229, 0.10);
  --accent-text: #4f46e5;

  --live: #15803d;
  --live-text: #137333;
  --live-soft: rgba(21, 128, 61, 0.10);
  --warn: #b45309;
  --warn-text: #a1460a;
  --warn-soft: rgba(180, 83, 9, 0.10);
  --danger: #dc2626;
  --danger-text: #b91c1c;
  --danger-soft: rgba(220, 38, 38, 0.08);
  --info: #0369a1;
  --info-soft: rgba(3, 105, 161, 0.10);

  --diff-add: rgba(34, 197, 94, 0.10);
  --diff-add-gutter: rgba(34, 197, 94, 0.18);
  --diff-del: rgba(239, 68, 68, 0.10);
  --diff-del-gutter: rgba(239, 68, 68, 0.18);
  --syn-kw: #7e22ce;
  --syn-str: #15803d;
  --syn-fn: #4338ca;
  --syn-num: #b45309;
  --syn-com: #767683;
  --syn-type: #0369a1;

  --sheen: linear-gradient(180deg, rgba(255, 255, 255, 0.72) 0%, rgba(255, 255, 255, 0) 100%);
  --bar-bg: rgba(255, 255, 255, 0.78);
  --bar-solid: #ffffff;
  --scrim: rgba(25, 25, 29, 0.28);
  --shadow-card: 0 1px 2px rgba(25, 25, 29, 0.06), 0 4px 12px rgba(25, 25, 29, 0.04);
  --shadow-overlay: 0 8px 24px rgba(25, 25, 29, 0.12), 0 2px 6px rgba(25, 25, 29, 0.06);
  --ambient-glow: radial-gradient(ellipse 72% 320px at 50% 0%, rgba(79, 70, 229, 0.065) 0%, rgba(79, 70, 229, 0) 100%);
}
