/* ion-tokens.css — the theme CONTRACT (New Age redesign 2026-05-30).
 *
 * Widgets READ these tokens; themes WRITE them; neither targets the other.
 * A widget that hardcodes a colour/radius/shadow is a bug. A theme that targets
 * a widget class is a bug. (spec §3)
 *
 * :root holds safe LIGHT defaults so the platform is fully styled even before a
 * theme class is applied. Theme files under themes/ redefine these under
 * .ion-theme-<slug>. The legacy --c-* tokens are ALIASED to --ion-* here so the
 * large body of existing markup that uses var(--c-*) themes for free.
 */
:root {
  /* surfaces */
  --ion-page-bg: #f5f5f7;
  --ion-page-bg-2: #e8e8ed;
  --ion-surface-bg: #ffffff;          /* cards, nav, modals */
  --ion-surface-bg-2: #f3f4f6;        /* table headers, help sections, insets */
  --ion-surface-fg: #1d1d1f;          /* primary text */
  --ion-surface-border: #d9dee6;      /* card / hairline borders (may be near-invisible glass) */
  --ion-input-border: #b6bcc7;        /* form-field outline — ALWAYS visibly distinct from the field bg */
  --ion-glass-blur: 0px;              /* light default = no glass; themes opt in */
  --ion-glass-tint: rgba(255,255,255,0.92);
  --ion-backdrop-tint: rgba(0,0,0,0.45);

  /* accent + status */
  --ion-accent: #007aff;
  --ion-accent-soft: #e8f0ff;
  --ion-accent-fg: #ffffff;           /* text on accent */
  --ion-focus-ring: 0 0 0 3px rgba(0,122,255,0.45);
  --ion-ok: #16a34a;
  --ion-warn: #ea580c;
  --ion-err: #dc2626;
  --ion-muted: #6b7280;

  /* radii */
  --ion-radius-sm: 6px;
  --ion-radius-md: 12px;
  --ion-radius-lg: 18px;
  --ion-radius-xl: 28px;

  /* elevation */
  --ion-elev-1: 0 1px 2px rgba(0,0,0,0.06);
  --ion-elev-2: 0 4px 12px rgba(0,0,0,0.10);
  --ion-elev-3: 0 12px 32px rgba(0,0,0,0.16);
  --ion-elev-4: 0 24px 60px rgba(0,0,0,0.22);

  /* motion */
  --ion-motion-spring: cubic-bezier(0.22, 1, 0.36, 1);
  --ion-motion-duration: 280ms;

  /* type */
  --ion-font-display: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", system-ui, sans-serif;
  --ion-font-mono: "JetBrains Mono", "SF Mono", ui-monospace, "Cascadia Code", monospace;

  /* signature / decoration (themes override) */
  --ion-text-shadow-glow: none;
  --ion-noise-url: none;
  --ion-scrollbar-thumb: #c4c8d0;
  --ion-scrollbar-track: transparent;

  /* ── legacy aliases: existing markup uses these → theme for free ── */
  --c-bg: var(--ion-page-bg);
  --c-fg: var(--ion-surface-fg);
  --c-border: var(--ion-surface-border);
  --c-accent: var(--ion-accent);
  --c-ok: var(--ion-ok);
  --c-warn: var(--ion-warn);
  --c-err: var(--ion-err);
  --c-muted: var(--ion-muted);
}

@media (prefers-reduced-motion: reduce) {
  :root { --ion-motion-duration: 0ms; }
}
