/* Socialmass design tokens. The ONLY file with raw colour values (OKLCH). Every other stylesheet uses var(--token).
   Source of truth for values and roles: DESIGN.md at the repo root. Load order on every page: tokens.css, app.css,
   then any page stylesheet (web/assets/<page>.css). */

@font-face {
  font-family: "Geist";
  src: url("/app/assets/fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/app/assets/fonts/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;

  /* ---- neutrals: cool-tinted (hue 260), never pure grey, never #000 or #fff ---- */
  --gray-0: oklch(99.6% 0.0015 260);   /* surface: cards, inputs, dialogs */
  --gray-50: oklch(97.4% 0.004 260);   /* canvas: app background and sidebar */
  --gray-100: oklch(94.6% 0.006 260);  /* muted fill: secondary buttons, chips, hover */
  --gray-150: oklch(92.4% 0.007 260);  /* pressed fill, selected row */
  --gray-200: oklch(91.2% 0.006 260);  /* hairline borders */
  --gray-300: oklch(84% 0.009 260);    /* input borders, strong dividers */
  --gray-400: oklch(70% 0.01 260);     /* disabled text, chart grid labels on dark */
  --gray-500: oklch(53% 0.012 262);    /* tertiary text, icons */
  --gray-600: oklch(46% 0.013 262);    /* secondary text */
  --gray-800: oklch(30% 0.013 262);    /* ink hover */
  --gray-900: oklch(21% 0.012 262);    /* ink: primary text and primary button */

  /* ---- accent: one clear blue for links, selection, focus and the chart line ---- */
  --blue-50: oklch(96.4% 0.02 262);
  --blue-100: oklch(92.5% 0.045 262);
  --blue-500: oklch(54.5% 0.2 262);
  --blue-600: oklch(49% 0.2 262);
  --blue-700: oklch(45% 0.2 262);

  /* ---- state: only for up, down, warning, error ---- */
  --green-50: oklch(96.5% 0.03 155);
  --green-600: oklch(52% 0.13 155);
  --green-700: oklch(47% 0.13 155);
  --red-50: oklch(96.5% 0.02 27);
  --red-600: oklch(54% 0.19 27);
  --red-700: oklch(48% 0.18 27);
  --amber-50: oklch(96.6% 0.04 82);
  --amber-100: oklch(92.5% 0.07 80);
  --amber-500: oklch(74% 0.15 72);
  --amber-700: oklch(51% 0.12 65);
  --amber-900: oklch(36% 0.07 65);

  /* ---- channel marks (official brand colours, used only inside .channel-mark) ---- */
  --brand-facebook: oklch(58% 0.22 262);
  --brand-ig-1: oklch(80% 0.16 85);
  --brand-ig-2: oklch(62% 0.24 25);
  --brand-ig-3: oklch(55% 0.25 345);
  --brand-ig-4: oklch(50% 0.22 290);

  /* ---- semantic roles (components use these, not the scales above) ---- */
  --bg-canvas: var(--gray-50);
  --bg-surface: var(--gray-0);
  --bg-muted: var(--gray-100);
  --bg-pressed: var(--gray-150);
  --bg-selected: var(--blue-50);
  --border: var(--gray-200);
  --border-strong: var(--gray-300);
  --fg: var(--gray-900);
  --fg-muted: var(--gray-600);
  --fg-subtle: var(--gray-500);
  --fg-disabled: var(--gray-400);
  --ink: var(--gray-900);
  --ink-hover: var(--gray-800);
  --on-ink: var(--gray-0);
  --accent: var(--blue-500);
  --accent-hover: var(--blue-600);
  --accent-fg: var(--blue-600);
  --accent-subtle: var(--blue-50);
  --accent-soft: var(--blue-100);
  --focus-ring: var(--blue-500);
  --success: var(--green-700);
  --success-subtle: var(--green-50);
  --danger: var(--red-600);
  --danger-hover: var(--red-700);
  --danger-subtle: var(--red-50);
  --warning: var(--amber-700);
  --warning-subtle: var(--amber-50);
  --warning-strong: var(--amber-500);
  --success-on-ink: oklch(82% 0.13 155);
  --danger-on-ink: oklch(76% 0.13 27);
  --notice-bg: var(--amber-50);
  --notice-border: var(--amber-100);
  --notice-fg: var(--amber-900);
  --chart-line: var(--blue-500);
  --chart-compare: var(--gray-300);
  --chart-grid: var(--gray-150);
  --chart-label: var(--gray-500);
  --auth-visual-bg: oklch(96.6% 0.0065 265);
  --scrim: oklch(21% 0.012 262 / 0.36);
  --shadow-color: oklch(21% 0.03 262);

  /* ---- type: Geist for everything, Geist Mono for ids and code. Fixed rem scale, ratio about 1.125 to 1.2 ---- */
  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --text-2xs: 0.6875rem; /* 11 */
  --text-xs: 0.75rem;    /* 12 */
  --text-sm: 0.8125rem;  /* 13 */
  --text-base: 0.875rem; /* 14: body and controls */
  --text-md: 1rem;       /* 16: phone inputs, lead text */
  --text-lg: 1.125rem;   /* 18: card titles */
  --text-xl: 1.375rem;   /* 22: section figures */
  --text-2xl: 1.625rem;  /* 26: page title */
  --text-3xl: 2rem;      /* 32: KPI figure */
  --text-4xl: 2.5rem;    /* 40: auth headline on wide screens */
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 650;
  --leading-tight: 1.15;
  --leading-snug: 1.3;
  --leading-normal: 1.5;
  --tracking-tight: -0.02em;
  --tracking-snug: -0.011em;
  --tracking-caps: 0.06em;

  /* ---- space: 4px base ---- */
  --space-0: 2px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 40px;
  --space-8: 48px;
  --space-9: 64px;
  --space-10: 96px;

  /* ---- shape ---- */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 999px;

  /* ---- control sizes ---- */
  --control-sm: 30px;
  --control-md: 36px;
  --control-lg: 44px;
  --row-h: 48px;
  --sidebar-w: 248px;
  --sidebar-w-collapsed: 64px;
  --tabbar-h: 60px;
  --page-max: 1240px;

  /* ---- elevation: flat at rest, shadow only on things that float ---- */
  --shadow-xs: 0 1px 2px oklch(21% 0.03 262 / 0.06);
  --shadow-sm: 0 1px 2px oklch(21% 0.03 262 / 0.06), 0 1px 3px oklch(21% 0.03 262 / 0.05);
  --shadow-md: 0 0 0 1px oklch(21% 0.03 262 / 0.06), 0 4px 8px -2px oklch(21% 0.03 262 / 0.08), 0 12px 28px -6px oklch(21% 0.03 262 / 0.14);
  --shadow-lg: 0 0 0 1px oklch(21% 0.03 262 / 0.05), 0 24px 56px -12px oklch(21% 0.03 262 / 0.28);

  /* ---- motion: 150 to 250ms, ease-out-quart, state changes only ---- */
  --ease-out: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-in: cubic-bezier(0.5, 0, 0.75, 0);
  --dur-fast: 150ms;
  --dur: 200ms;
  --dur-slow: 250ms;

  /* ---- layers ---- */
  --z-sticky: 20;
  --z-sidebar: 30;
  --z-dropdown: 100;
  --z-overlay: 300;
  --z-toast: 500;
  --z-tooltip: 600;

  /* ---- legacy aliases (pre-1.1 pages and phase branches still use these names; prefer the roles above) ---- */
  --canvas: var(--bg-canvas);
  --surface: var(--bg-surface);
  --surface-muted: var(--bg-muted);
  --text: var(--fg);
  --text-muted: var(--fg-muted);
  --primary: var(--ink);
  --on-primary: var(--on-ink);
  --outbound: var(--accent-subtle);
  --radius-panel: var(--radius-lg);
  --radius-card: 12px;
  --radius-bubble: 14px;
  --font: var(--font-sans);
  --rail: var(--sidebar-w);
}
