/* Design tokens of the surface: fills, lines, type, accent, status, shadows, radii, density, motion, messages;
   light and dark theme. The dark theme stands on its own, no inversion. */

@font-face { font-family: "Inter"; src: url("/ui/fonts/inter-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/ui/fonts/inter-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/ui/fonts/inter-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/ui/fonts/inter-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("/ui/fonts/space-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("/ui/fonts/space-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("/ui/fonts/space-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/ui/fonts/mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/ui/fonts/mono-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/ui/fonts/mono-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  /* Fills: neutral hierarchy */
  --sunken: #F1F1F3;
  --base: #FAFAFB;
  --raised: #FFFFFF;
  --hover: #F4F4F6;
  --active: #E9E9EC;
  --skeleton: #ECECEF;
  --scrim: rgba(24, 24, 27, 0.44);

  /* Lines: hairlines instead of shadows where possible */
  --line-subtle: #E8E8EB;
  --line-strong: #D8D8DD;

  /* Type */
  --ink: #18181B;
  --ink-2: #3F3F46;
  --ink-3: #71717A;
  --ink-disabled: #C6C6CC;
  --ink-inverse: #FFFFFF;

  /* Sidebar: dark counterpart of the light work area */
  --side-bg: #131318;
  --side-bg-deep: #0D0D11;
  --side-ink: #FAFAFA;
  --side-ink-2: #A1A1AA;
  --side-ink-3: #63636B;
  --side-line: rgba(255, 255, 255, 0.07);
  --side-hover: rgba(255, 255, 255, 0.055);
  --side-active: rgba(255, 255, 255, 0.09);

  /* Accent: brand and interaction, never status */
  --acc: #4F46E5;
  --acc-hover: #4338CA;
  --acc-active: #3730A3;
  --acc-soft: #A5B4FC;
  --acc-border: #C7D2FE;
  --accent-subtle: #EEF2FF;
  --acc-foreground: #FFFFFF;
  --focus-ring: 0 0 0 3px rgba(79, 70, 229, 0.16);

  /* Status: text, fill, border */
  --ok: #047857;       --ok-bg: #ECFDF5;      --ok-border: #A7F3D0;
  --warn: #B45309;     --warn-bg: #FFFBEB;    --warn-border: #FDE68A;
  --bad: #B91C1C;      --bad-bg: #FEF2F2;     --bad-border: #FECACA;
  --info: #0369A1;     --info-bg: #F0F9FF;    --info-border: #BAE6FD;
  --neutral: #57534E;  --neutral-bg: #F5F5F4; --neutral-border: #E7E5E4;

  /* Shadows: only for elevation */
  --e1: 0 1px 2px rgba(24, 24, 27, 0.05);
  --e2: 0 2px 6px rgba(24, 24, 27, 0.05), 0 8px 20px rgba(24, 24, 27, 0.06);
  --e3: 0 4px 10px rgba(24, 24, 27, 0.06), 0 16px 40px rgba(24, 24, 27, 0.10);
  --e4: 0 8px 16px rgba(24, 24, 27, 0.08), 0 28px 64px rgba(24, 24, 27, 0.16);

  /* Radii */
  --r-sm: 7px; --r-md: 10px; --r-lg: 14px; --r-xl: 20px; --r-pill: 999px;

  /* Type
     --font-body     body text
     --font-heading  headings, numbers, cards
     --font-sign     word mark of the sidebar
     --font-mono     code, identifiers, measurements */
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-heading: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-sign: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Density */
  --topbar-h: 60px;
  --sidebar-w: 256px;
  --rail-w: 68px;
  --row-h: 44px;
  --input-h: 36px;

  /* Motion */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-1: 120ms; --dur-2: 200ms; --dur-3: 320ms;

  /* Messages: display time of a message and of an error message, exit animation, messages shown at once */
  --toast-duration: 4500ms; --toast-error-duration: 8000ms; --toast-exit-duration: 220ms; --toast-max: 3;

  /* Relative time: a time in the future beyond --ago-future shows its date; up to --ago-now it reads as now,
     up to --ago-minutes in minutes, up to --ago-hours in hours, later in days */
  --ago-future: 60s; --ago-now: 90s; --ago-minutes: 5400s; --ago-hours: 172800s;

  color-scheme: light;
}

/* Dark theme: cold graphite, the sidebar even deeper. Cards stand out from the area,
   not by shadows. The signal colours are more saturated than the status colours because they must work
   as a 2px edge. */
body.dark {
  --sunken: #08090B;
  --base: #0B0C0F;
  --raised: #141519;
  --hover: #1A1B20;
  --active: #212228;
  --skeleton: #1A1B20;
  --scrim: rgba(0, 0, 0, 0.68);

  --line-subtle: #1E1F25;
  --line-strong: #2C2E36;

  --ink: #F2F3F5;
  --ink-2: #9CA1AB;
  --ink-3: #6A6F79;
  --ink-disabled: #3A3D45;
  --ink-inverse: #0B0C0F;

  --side-bg: #08090B;
  --side-bg-deep: #050506;
  --side-line: rgba(255, 255, 255, 0.055);
  --side-hover: rgba(255, 255, 255, 0.05);
  --side-active: rgba(255, 255, 255, 0.085);

  --acc: #7C82F5;
  --acc-hover: #9DA2F9;
  --acc-active: #BFC3FB;
  --acc-soft: #5A5FE8;
  --acc-border: #31346E;
  --accent-subtle: rgba(124, 130, 245, 0.13);
  --focus-ring: 0 0 0 3px rgba(124, 130, 245, 0.24);

  --ok: #34D399;    --ok-bg: rgba(52, 211, 153, 0.11);      --ok-border: rgba(52, 211, 153, 0.28);
  --warn: #FBBF24;  --warn-bg: rgba(251, 191, 36, 0.11);    --warn-border: rgba(251, 191, 36, 0.28);
  --bad: #F87171;   --bad-bg: rgba(248, 113, 113, 0.11);    --bad-border: rgba(248, 113, 113, 0.28);
  --info: #60A5FA;  --info-bg: rgba(96, 165, 250, 0.11);    --info-border: rgba(96, 165, 250, 0.28);
  --neutral: #8A8F99; --neutral-bg: rgba(138, 143, 153, 0.09); --neutral-border: rgba(138, 143, 153, 0.24);

  /* Signal colours: the same as edge, dot and glow */
  --pres-work: #3B82F6;
  --pres-free: #22C55E;
  --pres-fail: #EF4444;
  --pres-off:  #4B4F58;

  --e1: 0 1px 2px rgba(0, 0, 0, 0.40);
  --e2: 0 2px 6px rgba(0, 0, 0, 0.40), 0 8px 20px rgba(0, 0, 0, 0.34);
  --e3: 0 4px 10px rgba(0, 0, 0, 0.46), 0 16px 40px rgba(0, 0, 0, 0.44);
  --e4: 0 8px 16px rgba(0, 0, 0, 0.50), 0 28px 64px rgba(0, 0, 0, 0.56);

  color-scheme: dark;
}
