/* Tractrix design tokens — single source for web, platform and docs. See brand/README.md. */
:root {
  /* Core */
  --tx-navy: #0B2545;        /* Ink Navy — primary, competence/trust */
  --tx-blue: #1F5FAD;        /* Tractrix Blue — interactive, links, primary buttons */
  --tx-blue-600: #174C8C;    /* hover/pressed */
  --tx-sky: #DCE8F6;         /* tint for selected / info surfaces */
  --tx-amber: #F2A900;       /* Signal Amber — taxiway-marking accent; ≤10% of any layout */
  --tx-amber-ink: #8A5A00;   /* amber-family text on light surfaces (AA) */
  /* Neutrals */
  --tx-graphite: #1C2430;    /* body text */
  --tx-slate: #5B6B7F;       /* secondary text */
  --tx-mist: #E3E8EF;        /* rules, borders */
  --tx-paper: #F7F8FA;       /* page background */
  --tx-white: #FFFFFF;
  /* Data / status */
  --tx-envelope: #1F5FAD;    /* swept envelope */
  --tx-clearance: #7A5CC7;   /* clearance envelope */
  --tx-track: #0E8C7A;       /* gear/wingtip tracks */
  --tx-ok: #1E7F4F;
  --tx-warn: #B7791F;
  --tx-danger: #C0392B;
  /* Type */
  --tx-font-sans: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --tx-font-serif: "IBM Plex Serif", Georgia, "Times New Roman", serif;
  --tx-font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  /* Scale (1.25 major third, 16px base) */
  --tx-fs-xs: 0.8rem; --tx-fs-sm: 0.875rem; --tx-fs-base: 1rem; --tx-fs-md: 1.25rem;
  --tx-fs-lg: 1.563rem; --tx-fs-xl: 1.953rem; --tx-fs-2xl: 2.441rem; --tx-fs-3xl: 3.052rem;
  /* Space (8pt) and shape */
  --tx-space-1: 4px; --tx-space-2: 8px; --tx-space-3: 12px; --tx-space-4: 16px; --tx-space-5: 24px;
  --tx-space-6: 32px; --tx-space-7: 48px; --tx-space-8: 64px; --tx-space-9: 96px;
  --tx-radius-sm: 4px; --tx-radius: 8px; --tx-radius-lg: 14px;
  --tx-shadow: 0 1px 2px rgba(11,37,69,.06), 0 4px 16px rgba(11,37,69,.08);
  /* Motion */
  --tx-ease: cubic-bezier(.2,.0,.0,1); --tx-dur-fast: 120ms; --tx-dur: 220ms; --tx-dur-slow: 480ms;

  /* ---- Added in 1.1.0 (additive; no existing value changed) ---- */
  /* Text-safe inks for data colours whose base value is graphics-only (<4.5:1 on white) */
  --tx-warn-ink: #8F5B0A;    /* 5.72:1 on white; use for warning TEXT (base --tx-warn is 3.64:1: icons/fills only) */
  --tx-track-ink: #0B6E60;   /* 6.15:1 on white; use for track-colour TEXT (base --tx-track is 4.16:1) */
  /* Motion system (see brand/motion/MOTION.md). Legacy --tx-ease / --tx-dur* above remain valid aliases. */
  --tx-ease-settle: cubic-bezier(.2,0,0,1);   /* entrances, expansions (== --tx-ease) */
  --tx-ease-exit: cubic-bezier(.4,0,1,1);     /* exits, dismissals */
  --tx-ease-move: cubic-bezier(.4,0,.2,1);    /* on-screen position changes */
  --tx-ease-trace: cubic-bezier(.65,0,.35,1); /* signature: the tractrix trace (symmetric, no overshoot) */
  --tx-dur-instant: 90ms;    /* state flips */
  --tx-dur-quick: 120ms;     /* == --tx-dur-fast: press, hover, chips */
  --tx-dur-standard: 220ms;  /* == --tx-dur: dropdowns, tooltips, tabs */
  --tx-dur-deliberate: 360ms;/* modals, sheets, route changes */
  --tx-dur-slow-2: 480ms;    /* == --tx-dur-slow: large surfaces, chart transitions */
  --tx-dur-signature: 840ms; /* the mark's trace reveal; nothing runs longer */
  /* Line heights and tracking */
  --tx-lh-tight: 1.15; --tx-lh-snug: 1.3; --tx-lh-body: 1.55;
  --tx-track-display: -0.015em; --tx-track-caps: 0.08em;
  /* Layout */
  --tx-container: 1200px; --tx-gutter: 24px; --tx-columns: 12;
  /* Dark theme primitives (use via [data-theme="dark"] mapping below) */
  --tx-night: #07182E;       /* dark page background */
  --tx-night-2: #10223D;     /* dark raised surface */
  --tx-night-3: #1A3152;     /* dark hover / selected surface */
  --tx-night-line: #2A4166;  /* dark borders */
  --tx-blue-300: #7FAEE6;    /* interactive on dark: 7.72:1 on night */
  --tx-fog: #B8C7DB;         /* secondary text on dark: 9.28:1 on night-2 */
  --tx-ok-300: #5FC99A; --tx-warn-300: #F0B35A; --tx-danger-300: #F08A7E;
  --tx-clearance-300: #A58BE8; --tx-track-300: #3CC2AE; --tx-envelope-300: #8FB3E8;

  /* Semantic aliases (theme-switchable). Prefer these in new UI code. */
  --tx-bg: var(--tx-paper); --tx-surface: var(--tx-white); --tx-text: var(--tx-graphite);
  --tx-text-2: var(--tx-slate); --tx-line: var(--tx-mist); --tx-link: var(--tx-blue);
  --tx-accent: var(--tx-amber);
}

/* Dark theme: honour OS preference unless the page forces light; or force with data-theme="dark". */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --tx-bg: var(--tx-night); --tx-surface: var(--tx-night-2); --tx-text: var(--tx-paper);
    --tx-text-2: var(--tx-fog); --tx-line: var(--tx-night-line); --tx-link: var(--tx-blue-300);
  }
}
:root[data-theme="dark"] {
  --tx-bg: var(--tx-night); --tx-surface: var(--tx-night-2); --tx-text: var(--tx-paper);
  --tx-text-2: var(--tx-fog); --tx-line: var(--tx-night-line); --tx-link: var(--tx-blue-300);
}

/* Reduced motion: 1ms (not 0) so transitionend/animationend still fire for scripts. */
@media (prefers-reduced-motion: reduce) {
  :root { --tx-dur-quick: 1ms; --tx-dur-standard: 1ms; --tx-dur-deliberate: 1ms; --tx-dur-signature: 1ms;
          --tx-dur-fast: 1ms; --tx-dur: 1ms; --tx-dur-slow: 1ms; --tx-dur-slow-2: 1ms; }
}
