/*
 * pss design tokens: the single source for spacing, type, radius, motion and status colours.
 * Colours of the page itself (--bg --surface --text --muted --line --brand --brand-ink --link --accent) come from the user's
 * rapttor/yii2-themes theme; the default ("system") is pss-light by day and pss-dark by night (see common/config/main.php).
 * Everything else in ui.css and public.css uses these tokens only.
 */
:root {
  /* type: one sans-serif, the system stack (no font download, no layout shift) */
  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: var(--font-ui);
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --fs-sm: .875rem;
  --fs-base: 1rem;
  --fs-lg: clamp(1.0625rem, 1.02rem + .2vw, 1.1875rem);
  --fs-h3: clamp(1.125rem, 1.05rem + .35vw, 1.3125rem);
  --fs-h2: clamp(1.25rem, 1.12rem + .6vw, 1.625rem);
  --fs-h1: clamp(1.625rem, 1.3rem + 1.4vw, 2.25rem);
  --fs-display: clamp(2.25rem, 1.4rem + 4vw, 4rem);
  --lh-body: 1.55;
  --lh-tight: 1.2;

  /* spacing: 4px scale */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-6: 24px; --s-8: 32px; --s-12: 48px; --s-16: 64px;

  /* radius */
  --r-sm: 8px; --r-ctl: 10px; --r-card: 12px; --r-sheet: 14px;

  /* motion */
  --t-fast: 150ms; --t-base: 200ms; --ease: cubic-bezier(.2, .7, .2, 1);

  /* layout */
  --gutter: var(--s-4); --bar-h: 56px; --tab-h: 60px; --tap: 44px;
  --safe-b: env(safe-area-inset-bottom, 0px);

  /* status: always paired with a word or a shape, never colour alone */
  --ok: #0f7a4f; --bad: #c4262b; --warn: #94580a;
  --ok-soft: color-mix(in srgb, var(--ok) 11%, var(--surface));
  --bad-soft: color-mix(in srgb, var(--bad) 11%, var(--surface));
  --warn-soft: color-mix(in srgb, var(--warn) 12%, var(--surface));
  --brand-soft: color-mix(in srgb, var(--brand) 10%, var(--surface));
  --hover: color-mix(in srgb, var(--text) 5%, var(--surface));
  --ring: color-mix(in srgb, var(--brand) 60%, transparent);
  --shadow: 0 1px 2px color-mix(in srgb, var(--text) 8%, transparent);
  --shadow-pop: 0 8px 24px color-mix(in srgb, var(--text) 14%, transparent);
}
:root[data-mode="dark"] { --ok: #4fd6a0; --bad: #ff8a8c; --warn: #f0b45a; }
@media (prefers-color-scheme: dark) { :root:not([data-mode="light"]) { --ok: #4fd6a0; --bad: #ff8a8c; --warn: #f0b45a; } }
@media (min-width: 840px) { :root { --gutter: var(--s-8); --bar-h: 60px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; } }
