/* ==========================================================================
   GeniPilot design tokens — the single source (docs/04-design-brief.md §6.1)
   Values are measured, not invented: the brand teal and the full spacing /
   radius / shadow / type / duration scale come from the extension's :root
   (sidebar.css), which was the only complete one in the product on 2026-11-01.
   The text and status colours are the §4 accessibility fixes, each checked at
   4.5:1 on white and on --surface-page by tests/test_design_tokens.cjs.

   Every surface aliases its own historic names onto these, so existing rules
   keep working while there is only one place to change a value:
     templates/assets/css/style.css   --body-color, --accent-color, …
     templates/assets/css/instagram.css  --ig-*
     extension/sidebar.css / login.css   --color-*
     extension/signal.css                --ink, --green, …
   Load this file BEFORE the surface stylesheet, everywhere.
   ========================================================================== */

:root {
  /* Brand */
  --brand-primary: #016b61;        /* the one teal: actions, links, active state */
  --brand-primary-dark: #014d46;   /* hover / pressed */
  --brand-primary-light: #70b2b2;
  --brand-accent: #9ecfd4;
  --brand-accent-light: #c5e5e7;
  --brand-lime: #d8f3a8;
  --brand-cream: #e5e9c5;
  --brand-ink: #0a2a25;            /* the Studio / Signal dark teal ink */
  --brand-bright: #00a699;         /* the second stop of the brand gradient only */
  --brand-amber: #f3a712;
  --brand-sky: #3f7cac;
  /* Tints. A hover or a ring is the brand hue at an alpha, not a new colour, so
     the channels live here and every `rgba(var(--brand-primary-rgb), a)` reads
     the same teal. `--brand-ink-raised` is the lighter stop of the dark rail. */
  --brand-primary-rgb: 1, 107, 97;
  --brand-ink-raised: #0d3530;

  /* Gradients — one definition so the bright stop is not repeated per panel */
  --gradient-brand: linear-gradient(135deg, var(--brand-primary), var(--brand-bright));
  --gradient-brand-deep: linear-gradient(135deg, var(--brand-ink) 0%, var(--brand-primary) 60%, var(--brand-bright) 100%);

  /* Text. --text-secondary replaces #788094 (3.95:1), #718096 (4.02:1) and the
     Studio/Signal #6b7f7b (4.25:1). It is 4.97:1 on white and 4.58:1 on
     --surface-page, because the app page is tinted and a grey that only passes
     on white fails where it is actually read. */
  --text-primary: #0f172a;
  --text-secondary: #667085;
  --text-secondary-rgb: 102, 112, 133;
  --text-muted: #667085;
  --text-tertiary: #667085;
  --text-inverse: #ffffff;
  --text-on-primary: #ffffff;

  /* Surfaces. Three off-whites were doing one job; these are the two that mean
     something: the app page and the card on top of it. */
  --surface-page: #f0f7f6;
  --surface-soft: #f8fafa;
  --surface-card: #ffffff;
  --surface-hover: #f0f7f6;
  --surface-active: #e0f2f1;
  --surface-glass: rgba(255, 255, 255, 0.7);

  /* Lines */
  --border-default: #d6e5e3;
  --border-light: #e8f1ef;

  /* Status. --state-success replaces #059669 (3.77:1), #10b981 and #22c55e as
     text, and is dark enough to carry white labels on the fill. */
  --state-success: #047857;
  --state-success-soft: rgba(4, 120, 87, 0.1);
  --state-success-rgb: 4, 120, 87;
  /* Danger was the tailwind red #dc2626: 4.83:1 on white, but 4.45:1 on this
     app's tinted page surface. The error text is read on the surface, so the
     token carries the value that clears there, and white still clears on it. */
  --state-danger: #b91c1c;
  --state-danger-soft: rgba(185, 28, 28, 0.1);
  --state-warning: #d97706;
  --state-warning-text: #b45309;   /* the readable pair of the amber badge */
  --state-warning-soft: rgba(217, 119, 6, 0.12);
  /* #0284c7 was 4.10:1 on white and is used as running text (the sidebar's
     "running" status), so the info colour steps down to the sky-700 value. */
  --state-info: #0369a1;

  /* Purple is a marketing and login accent, never body copy. The fill is the
     original violet; the text value is what replaces it as a link colour. */
  --accent-purple: #8b5cf6;
  --accent-purple-dark: #7c3aed;
  --accent-purple-light: #a78bfa;
  --accent-purple-text: #6d28d9;

  /* Focus — one ring for the whole product, 6.41:1 against white */
  --focus-ring: 3px solid var(--brand-primary);
  --focus-ring-offset: 2px;
  --focus-glow: rgba(1, 107, 97, 0.25);

  /* Spacing (4 / 8 / 12 / 16 / 24 / 32) */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 0.75rem;
  --spacing-lg: 1rem;
  --spacing-xl: 1.5rem;
  --spacing-2xl: 2rem;

  /* Radius */
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1.125rem;
  --radius-xl: 1.5rem;
  --radius-2xl: 2rem;
  --radius-full: 9999px;

  /* Type */
  --font-heading: 'Sora', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --line-height-body: 1.6;

  /* Elevation — the extension's teal-tinted family, everywhere */
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.08), 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(1, 107, 97, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 8px 24px rgba(1, 107, 97, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-xl: 0 16px 40px rgba(1, 107, 97, 0.15), 0 8px 16px rgba(0, 0, 0, 0.08);

  /* Motion */
  --duration-fast: 150ms;
  --duration-base: 200ms;
  --duration-slow: 300ms;
  --ease-panel: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: var(--duration-fast) ease-in-out;
  --transition-base: var(--duration-base) ease-in-out;
  --transition-slow: var(--duration-slow) ease-in-out;

  /* Stacking */
  --z-header: 100;
  --z-composer: 90;
  --z-toast: 200;
}

/* The default ring. Surfaces that reset `outline` on a control restate this
   value rather than dropping the affordance (docs/04-design-brief.md §4). */
:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-ring-offset);
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --duration-fast: 0ms;
    --duration-base: 0ms;
    --duration-slow: 0ms;
  }
}
