/* Heselion design tokens: the one source of colour, type, space, shape, depth and
   motion for the app, the public pages and the Visual Engine (tokens.js mirrors
   these values for canvas and WebGL code; a test keeps the two equal).
   DESIGN.md explains the rules behind them. Every name starts with --dm- so it
   never collides with the older local names, which now map onto these. */

:root {
  /* Ground and surfaces */
  --dm-ground: #060a1a;
  --dm-rail: #0c1330;
  --dm-elevated: #131b3c;
  --dm-raised: #1b2550;
  --dm-well: rgba(3, 5, 10, 0.42);

  /* Brand: measured from the official Heselion logos (packages/shared/brand) */
  --dm-ink: #f5f7ff;
  --dm-muted: #949cb0;
  --dm-faint: #7d86a0;
  --dm-prose-muted: #a6afc2; /* long reading text on dark pages, lighter for contrast */
  --dm-ink-on-light: #10131c;

  /* Meaning: violet selects and acts, cyan is live, magenta is music */
  --dm-violet: #fd8601; /* Heselion: the brand orange is the accent; the name stays for every stylesheet using it */
  --dm-violet-ink: #ffb45c;
  --dm-cyan: #00ddf5;
  --dm-magenta: #ff4ac8;

  /* State */
  --dm-ok: #3ee0a1;
  --dm-warn: #ffd45e;
  --dm-bad: #ff6b7d;
  --dm-bad-ink: #ffa3ae;

  /* Glass and lines */
  --dm-glass: rgba(17, 21, 34, 0.78);
  --dm-glass-strong: rgba(17, 21, 34, 0.92);
  --dm-glass-raised: rgba(25, 30, 44, 0.86);
  --dm-blur: blur(22px) saturate(150%);
  --dm-blur-light: blur(10px);
  --dm-edge: rgba(255, 255, 255, 0.08);
  --dm-edge-strong: rgba(255, 255, 255, 0.16);
  --dm-edge-solid: #26305a; /* an opaque hairline for pages without glass */
  --dm-line: rgba(255, 255, 255, 0.07);
  --dm-surface: rgba(255, 255, 255, 0.04);
  --dm-surface-hover: rgba(255, 255, 255, 0.07);
  --dm-surface-press: rgba(255, 255, 255, 0.1);
  --dm-scrim: rgba(9, 11, 18, 0.72);

  /* Depth */
  --dm-sheen: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  --dm-lift: 0 18px 40px -18px rgba(0, 0, 0, 0.7), 0 2px 6px rgba(0, 0, 0, 0.25);
  --dm-sheet-lift: 0 40px 90px -30px rgba(0, 0, 0, 0.85);
  --dm-ring: 0 0 0 2px var(--dm-ground), 0 0 0 4px var(--dm-violet);

  /* Shape */
  --dm-r-xs: 8px;
  --dm-r-sm: 12px;
  --dm-r-md: 16px;
  --dm-r-lg: 22px;
  --dm-r-pill: 999px;

  /* Space */
  --dm-s1: 4px;
  --dm-s2: 8px;
  --dm-s3: 12px;
  --dm-s4: 16px;
  --dm-s5: 20px;
  --dm-s6: 24px;
  --dm-s7: 40px;
  --dm-gutter: clamp(16px, 6.4vw, 112px);

  /* Type: Archivo is the one face; size and weight make hierarchy */
  --dm-font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --dm-mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --dm-display-xl: clamp(2.75rem, 7vw, 6.5rem);
  --dm-display: clamp(1.6rem, 3.2vw, 2rem);
  --dm-headline: clamp(1.4rem, 2.6vw, 1.75rem);
  --dm-title: 1.15rem;
  --dm-body: 15px;
  --dm-label: 0.82rem;
  --dm-weight-display: 640;
  --dm-track-display: -0.035em;

  /* Motion: short and eased; --dm-cine only for page-level scene changes */
  --dm-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dm-spring: cubic-bezier(0.2, 0.85, 0.25, 1.1);
  --dm-fast: 140ms;
  --dm-med: 240ms;
  --dm-slow: 420ms;
  --dm-cine: 900ms;

  /* Layers on cinematic pages: a WebGL canvas under the HTML */
  --dm-z-canvas: 0;
  --dm-z-content: 1;
  --dm-z-chrome: 10;
  --dm-z-overlay: 100;
}

@media (prefers-reduced-transparency: reduce) {
  :root {
    --dm-glass: var(--dm-rail);
    --dm-glass-strong: var(--dm-rail);
    --dm-glass-raised: var(--dm-elevated);
    --dm-blur: none;
    --dm-blur-light: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --dm-fast: 1ms;
    --dm-med: 1ms;
    --dm-slow: 1ms;
    --dm-cine: 1ms;
  }
}
