/* Gardo design tokens — the single source for every dashboard and landing surface.
   Values are the binding visual spec: .omo/evidence/design/ideal-state.md §4.
   styles.css, start.css, operator.css and ../landing/site/v2.css consume this file;
   legacy variable names below are aliases kept until each surface PR renames them.
   Both appearances are designed (IS2-62): one :root of light values plus one
   prefers-color-scheme: dark block of pairings; surfaces never hard-code colors.
   apps/landing/site/tokens.css is a byte-identical copy of this file. */

:root {
  color-scheme: light dark;

  --bg-canvas: #fafaf8;
  --bg-canvas-alt: #f4f3ef;
  --bg-surface: #ffffff;

  --ink-primary: #201f1b;
  --ink-secondary: #57544c;
  --ink-disabled: #8e8b82;

  --border: #e6e3dc;
  --border-strong: #d5d1c7;

  --accent: #0d5c46;
  --accent-hover: #0a4a38;
  --accent-pressed: #093f30;
  --accent-on: #ffffff;
  --accent-tint: #e7f0ec;    /* selected/active wash */

  --status-success-text: #1f6b45;
  --status-success-tint: #e8f2ec;
  --status-success-border: #9ad8ad;
  --status-warning-text: #8a5a00;
  --status-warning-tint: #fbf3dc;
  --status-danger-text: #a83226;
  --status-danger-tint: #f9ece8;
  --status-danger-border: #f2c6bd;
  --status-info-text: #33567f;
  --status-info-tint: #eaf0f6;
  --status-neutral-text: #57544c;
  --status-neutral-tint: #f0efea;

  --disabled-bg: #e9e7e1;
  --disabled-text: #57544c;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-16: 64px;
  --space-24: 96px;

  --radius-control: 8px;
  --radius-card: 12px;
  --radius-dialog: 16px;
  --radius-pill: 999px;

  --motion-fast: 150ms;
  --motion-panel: 250ms;
  --motion-press: 100ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --font-sans: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --text-caption: 12px;
  --text-secondary: 14px;
  --text-body: 16px;
  --text-lead: 18px;
  --text-h4: 20px;
  --text-h3: 24px;
  --text-h2: 30px;
  --text-h1: 36px;
  --text-h1-lg: 40px;

  --shadow-overlay: 0 1px 2px rgb(32 31 27 / 5%), 0 4px 12px rgb(32 31 27 / 4%);
  --scrim: rgb(32 31 27 / 35%);

  /* Legacy aliases — consumed by styles.css/start.css/operator.css, landing v2.css
     and inline app.js styles (var(--s2), var(--s3)). Off-scale steps map to the
     nearest scale step. Do not add new usages. */
  --ink: var(--ink-primary);
  --mut: var(--ink-secondary);
  --chip: var(--accent-tint);
  --muted: var(--ink-secondary);
  --faint: var(--ink-disabled);
  --acc: var(--accent);
  --acc-h: var(--accent-hover);
  --acc-d: var(--accent-pressed);
  --card: var(--bg-surface);
  --accent-depth: var(--accent-pressed);   /* old 3D edge color; edges are removed */
  --lavender: var(--accent-tint);          /* selected/active wash only */
  --lavender-deep: var(--accent-tint);
  --page: var(--bg-canvas);
  --paper: var(--bg-surface);
  --line: var(--border);
  --success: var(--status-success-text);
  --success-wash: var(--status-success-tint);
  --warning: var(--status-warning-text);
  --warning-wash: var(--status-warning-tint);
  --danger: var(--status-danger-text);
  --danger-wash: var(--status-danger-tint);
  --info: var(--status-info-text);
  --info-wash: var(--status-info-tint);
  --neutral: var(--status-neutral-text);
  --neutral-wash: var(--status-neutral-tint);

  --s1: var(--space-1);
  --s2: var(--space-2);
  --s3: var(--space-3);
  --s4: var(--space-4);
  --s5: var(--space-6);   /* was 20px; snaps to the scale */
  --s6: var(--space-6);
  --s8: var(--space-8);
  --s10: var(--space-12); /* was 40px; snaps to the scale */
  --s12: var(--space-12);
  --s16: var(--space-16);

  --t12: var(--text-caption);
  --t13: var(--text-secondary); /* was 13px; floor for secondary text is 14px */
  --t14: var(--text-body);      /* was 14px; body is 16px */
  --t16: var(--text-body);
  --t18: var(--text-lead);
  --t20: var(--text-h4);
  --t24: var(--text-h3);
  --t28: var(--text-h3);        /* was 28px; nearest scale step */
  --t32: 32px;                  /* mobile h1 step */
  --t40: var(--text-h1-lg);
  --t48: 48px;                  /* landing display handled by clamp in v2.css */

  --r8: var(--radius-control);
  --r12: var(--radius-card);
  --r16: var(--radius-dialog);
  --r24: var(--radius-dialog);  /* was 24px; dialogs are 16px */
  --pill: var(--radius-pill);

  --shadow-card: none;          /* borders carry cards; shadow only on dialogs */
  --shadow-dialog: var(--shadow-overlay);

  --body-font: var(--font-sans);
  --display-font: var(--font-sans);
  --emphasis-font: var(--font-sans); /* serif accents are banned */
  --mono-font: var(--font-mono);
}

/* Dark appearance (IS2-62/IS2-55): same warm neutrals, rotated for contrast.
   The accent flips to a light green so accent text and fills stay >= 4.5:1 on
   the dark canvas; accent-on pairs with it. Fixed dark marketing panels keep
   their own literal colors in v2.css and do not flip. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-canvas: #191915;
    --bg-canvas-alt: #1f1f1a;
    --bg-surface: #242420;

    --ink-primary: #ecebe4;
    --ink-secondary: #b3b0a5;
    --ink-disabled: #77746a;

    --border: #3a3931;
    --border-strong: #4a4940;

    --accent: #58c9a4;
    --accent-hover: #6bd6b3;
    --accent-pressed: #46b892;
    --accent-on: #0a2e22;
    --accent-tint: #1d3a30;

    --status-success-text: #7fd6a8;
    --status-success-tint: #1a2e23;
    --status-success-border: #2f5e44;
    --status-warning-text: #dcaf54;
    --status-warning-tint: #32280f;
    --status-danger-text: #ef9c8d;
    --status-danger-tint: #38211c;
    --status-danger-border: #6e3a33;
    --status-info-text: #a7c6e8;
    --status-info-tint: #202b38;
    --status-neutral-text: #b3b0a5;
    --status-neutral-tint: #262621;

    --disabled-bg: #2e2d28;
    --disabled-text: #b3b0a5;

    --shadow-overlay: 0 1px 2px rgb(0 0 0 / 45%), 0 4px 12px rgb(0 0 0 / 35%);
    --scrim: rgb(0 0 0 / 60%);
  }
}
