/* Nova Space for the apps (editor, Forms, Animate, Studio, Audio, Animate 3D): the colours, fonts and buttons of the site,
   calmer than the pages (a soft glow at the top only, nothing behind the tools). It is loaded after an app's own CSS and works
   through the tokens each app already uses, so every panel, list and sheet changes colour by itself.
   The apps are dark (as before). Colours to change are here, next to the ones of the pages in nova-space.css. */

/* The two fonts are kept on the site (assets/fonts, SIL Open Font License), so an app loads nothing from another server. */
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 200 900; font-display: swap; src: url('/assets/fonts/unbounded-latin.woff2') format('woff2'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 200 800; font-display: swap; src: url('/assets/fonts/plus-jakarta-sans-latin.woff2') format('woff2'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-style: italic; font-weight: 200 800; font-display: swap; src: url('/assets/fonts/plus-jakarta-sans-italic-latin.woff2') format('woff2'); }

:root {
  /* the brand (same as nova-space.css) */
  --sp-pink: #ff2e93; --sp-orange: #ff8a00; --sp-cyan: #00e5ff; --sp-blue: #3a6bff; --sp-violet: #9b5cff; --sp-green: #2bff88;
  --sp-btn: linear-gradient(100deg in oklch, #0061d6, #6a2fe0 55%, #c8106a);
  --sp-btn-solid: #6a2fe0;
  --sp-head: 'Unbounded', system-ui, sans-serif;
  --sp-body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;

  /* Forms, Animate, Studio, Audio, Animate 3D */
  --bg: #05040f;
  --panel: #0f0d27;
  --panel-2: #191641;
  --line: #2c2856;
  --text: #f4f2ff;
  --muted: #b3b0d6;
  --accent: #00e5ff;
  --accent-ink: #03121a;
  --danger: #ff5c8a;
  --stage: #080718;

  /* the editor */
  --bg-base: #07061a;
  --bg-panel: #100e28;
  --bg-elevated: #181538;
  --bg-hover: #221e48;
  --bg-active: #2c2766;
  --bg-header: #0b0a20;
  --bg-track: #0c0b22;
  --bg-ruler: #07061a;
  --border: #2c2856;
  --border-strong: #3d3878;
  --border-subtle: #1c1940;
  --text-primary: #f4f2ff;
  --text-secondary: #c9c6e8;
  --text-muted: #8d89b3;
  --accent-dim: #2d55d1;
  --accent-bg: rgba(58, 107, 255, .2);
  --accent-bright: #7aa0ff;
  --clip-selected-glow: rgba(155, 92, 255, .45);
  --font-ui: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif;
}
/* the editor's accent is a blue that white words can sit on (4.8 : 1); the small apps keep cyan under dark words */
:root:has(#btn-beat-detect) { --accent: #3a6bff; }

/* the sky: a soft glow at the top of the screen and a few stars; the tools sit on their own panels */
body {
  font-family: var(--sp-body);
  background-color: var(--bg, #05040f);
  background-image:
    radial-gradient(60% 40% at 85% -5%, rgba(155, 92, 255, .28), transparent 70%),
    radial-gradient(50% 35% at 5% -5%, rgba(0, 229, 255, .18), transparent 70%),
    radial-gradient(1px 1px at 20% 30%, rgba(255, 255, 255, .35), transparent),
    radial-gradient(1px 1px at 70% 60%, rgba(255, 255, 255, .3), transparent);
  background-attachment: fixed, fixed, scroll, scroll;
  background-size: auto, auto, 420px 420px, 420px 420px;
  -webkit-font-smoothing: antialiased;
}
body ::selection { background: var(--sp-violet); color: #fff; }

/* headings and app names in the display font */
:where(h1, h2, .fm-brand, .an-brand, .st-brand, .au-brand, .a3-brand) { font-family: var(--sp-head); letter-spacing: -.02em; }

/* the main button of every app: white words on the brand gradient */
:is(.fm-primary, .an-primary, .st-primary, .au-primary, .a3-primary, .vt-primary):not(:disabled) {
  background-color: var(--sp-btn-solid);
  background-image: var(--sp-btn);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 10px 30px -12px rgba(155, 92, 255, .85), inset 0 1px 0 rgba(255, 255, 255, .3);
}
:is(.fm-primary, .an-primary, .st-primary, .au-primary, .a3-primary, .vt-primary):not(:disabled) :is(svg, .ic) { color: #fff; }

/* keyboard focus: the same clear cyan ring as the pages (an app's own ring wins where it has one) */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible { outline: 3px solid var(--sp-cyan); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  :is(.fm-primary, .an-primary, .st-primary, .au-primary, .a3-primary, .vt-primary) { transition: none; }
}
