/* markedin.io design tokens — canonical source.
   Version 001-003 · 2026-06-16
   Edit this file directly. STYLE-GUIDE.html and mockups consume it. */

:root {
  /* === Brand === */
  --color-primary: #F59E0B;
  --color-primary-light: #FCD34D;
  --color-primary-dark: #D97706;
  --color-secondary: #818CF8;
  --color-secondary-light: #A5B4FC;
  --color-secondary-dark: #6366F1;
  --color-accent: #818CF8;

  --on-bright: #1A1613;
  --on-dark: #FAF8F5;

  /* === Semantic === */
  --color-success: #10B981;
  --color-warning: #F59E0B;
  --color-error: #EF4444;
  --color-info: #3B82F6;
  --color-success-bg: rgba(16, 185, 129, 0.10);
  --color-warning-bg: rgba(245, 158, 11, 0.10);
  --color-error-bg: rgba(239, 68, 68, 0.10);
  --color-info-bg: rgba(59, 130, 246, 0.10);
  /* Muted, deep, AA-on-tint text shades — pair each with its `-bg` for badges /
     status labels. Desaturated to match the warm, restrained register of the
     `.tag` text colours (the mid-tone --color-{semantic} fails 4.5:1 as text on
     its own 10% tint AND reads too vibrant against the rest of the palette; these
     clear ~7:1 and sit quietly). */
  --color-success-text: #2E4A38;
  --color-warning-text: #5E471C;
  --color-error-text: #7F2F2F;
  --color-info-text: #2C467D;

  /* Foreground on a SOLID semantic fill — white text + spinner on the
     high-emphasis solid destructive button (.btn-destructive-strong). White
     reads on the error red in both themes, so it is defined once here and not
     theme-overridden. (The `-text` shades above are for text on the 10% `-bg`
     tints; this is for ink on the full-saturation fill.) */
  --on-error: #FFFFFF;

  /* === Gray scale === */
  --color-gray-50: #FDFCFB;
    --color-gray-100: #F7F5F3;
    --color-gray-200: #EDE9E5;
    --color-gray-300: #DDD6CF;
    --color-gray-400: #B8AFA5;
    --color-gray-500: #847A6E;
    --color-gray-600: #5C5449;
    --color-gray-700: #3D362E;
    --color-gray-800: #2A2420;
    --color-gray-900: #1A1613;
  
  /* === Surface === */
  --surface-bg: var(--color-gray-50);
  --surface-card: #FFFFFF;
  --surface-elevated: #FFFFFF;
  --surface-code: var(--color-gray-100);

  /* Source-editor text selection (CodeMirror). A soft cool periwinkle-gray —
     visible on the near-white editor, dark text stays readable. */
  --editor-selection: #DBDDF1;

  /* Page + form-field text selection (FEAT-005-R27). Extends the editor
     selection so selection is consistent app-wide; tracks both themes via the
     editor token's own dark override. Change here to diverge from the editor. */
  --selection-bg: var(--editor-selection);

  /* === Border === */
  --border-default: var(--color-gray-200);
  --border-subtle: var(--color-gray-100);

  /* === Text === */
  --text-primary: var(--color-gray-900);
  --text-secondary: var(--color-gray-600);
  --text-tertiary: var(--color-gray-500);
  --text-muted: var(--color-gray-400);

  /* === Input === */
  --input-bg: #FFFFFF;
  --input-border: var(--color-gray-300);
  --input-focus-ring: rgba(245, 158, 11, 0.15);

  /* === Tags === */
  --tag-schema-bg: #E8EDF5;
  --tag-schema-text: #2C447A;
    --tag-visibility-bg: #E8F0E9;
  --tag-visibility-text: #2F4A35;
    --tag-state-bg: #F5E8DA;
  --tag-state-text: #5A4220;
    --tag-category-bg: #EFE5F5;
  --tag-category-text: #4F3A6E;
  
  /* === Typography === */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-secondary: 'Crimson Pro', Georgia, serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Monaco, Consolas, monospace;

  --font-size-xs: 0.8125rem;  /* 13px — the minimum UI text size (was 12px; bumped to clear the floor for tags/badges/btn-sm) */
    --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-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;
    --font-size-5xl: 3rem;
  
  /* === Spacing === */
  --spacing-unit: 0.5rem;
  --space-1: 0.5rem;
    --space-2: 1rem;
    --space-3: 1.5rem;
    --space-4: 2rem;
    --space-6: 3rem;
    --space-8: 4rem;
    --space-12: 6rem;
  
  /* === Shape === */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 1rem;
  --radius-full: 9999px;

  /* === Shadow === */
  --shadow-sm: 0 1px 2px 0 rgba(33, 30, 24, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(33, 30, 24, 0.07), 0 2px 4px -1px rgba(33, 30, 24, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(33, 30, 24, 0.08), 0 4px 6px -2px rgba(33, 30, 24, 0.03);
  --shadow-xl: 0 20px 25px -5px rgba(33, 30, 24, 0.10), 0 10px 10px -5px rgba(33, 30, 24, 0.04);
  --shadow-glow: 0 0 20px rgba(245, 158, 11, 0.15);

  /* === Transition === */
  --transition-fast: 150ms ease-out;
  --transition-base: 250ms ease-out;
  --transition-slow: 350ms ease-out;

  /* === Icon === */
  --icon-sm: 16px;
  --icon-md: 20px;
  --icon-lg: 24px;
  --icon-xl: 32px;
}

:root[data-theme="dark"] {
  /* === Brand === */
  --color-primary: #FCD34D;
  --color-primary-light: #FEF3C7;
  --color-primary-dark: #F59E0B;
  --color-secondary: #A5B4FC;
  --color-secondary-light: #C7D2FE;
  --color-secondary-dark: #818CF8;
  --color-accent: #A5B4FC;

  /* === Semantic === */
  --color-success: #34D399;
  --color-warning: #FCD34D;
  --color-error: #F87171;
  --color-info: #60A5FA;
  --color-success-bg: rgba(52, 211, 153, 0.12);
  --color-warning-bg: rgba(252, 211, 77, 0.12);
  --color-error-bg: rgba(248, 113, 113, 0.12);
  --color-info-bg: rgba(96, 165, 250, 0.12);
  /* Light, AA-on-dark-tint text shades for badges/status labels. */
  --color-success-text: #6EE7B7;
  --color-warning-text: #FCD34D;
  --color-error-text: #FCA5A5;
  --color-info-text: #93C5FD;

  /* === Gray scale === */
  --color-gray-50: #1A1D2E;
    --color-gray-100: #22253A;
    --color-gray-200: #2C2F45;
    --color-gray-300: #3F4357;
    --color-gray-400: #5E6278;
    --color-gray-500: #8B8FA8;
    --color-gray-600: #B4B7C9;
    --color-gray-700: #D1D3E0;
    --color-gray-800: #E5E7F0;
    --color-gray-900: #F5F6FA;
  
  /* === Surface === */
  --surface-bg: #0F1116;
  --surface-card: #1A1D2E;
  --surface-elevated: #22253A;
  --surface-code: #14161E;

  /* Source-editor text selection (CodeMirror). A slate-indigo — clearly lighter
     than the near-black surface so the band reads, dark enough that light text
     stays legible. */
  --editor-selection: #354063;

  /* === Border === */
  --border-default: #2C2F45;
  --border-subtle: #22253A;

  /* === Text === */
  --text-primary: var(--color-gray-900);
  --text-secondary: var(--color-gray-600);
  --text-tertiary: var(--color-gray-500);
  --text-muted: var(--color-gray-400);

  /* === Input === */
  --input-bg: #22253A;
  --input-border: #3F4357;
  --input-focus-ring: rgba(252, 211, 77, 0.20);

  /* === Tags === */
  --tag-schema-bg: rgba(165, 180, 252, 0.15);
  --tag-schema-text: #A5B4FC;
    --tag-visibility-bg: rgba(52, 211, 153, 0.15);
  --tag-visibility-text: #6EE7B7;
    --tag-state-bg: rgba(252, 211, 77, 0.15);
  --tag-state-text: #FCD34D;
    --tag-category-bg: rgba(196, 167, 231, 0.15);
  --tag-category-text: #D8B4FE;
  
  /* === Shadow === */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.30);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.40), 0 2px 4px -1px rgba(0, 0, 0, 0.30);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.50), 0 4px 6px -2px rgba(0, 0, 0, 0.40);
  --shadow-glow: 0 0 30px rgba(252, 211, 77, 0.12);
}
