/* Design tokens: scales (theme independent), then light / dark colour themes. Same names as ui-library.farhan.app.
   Breakpoints (media queries cannot read custom properties): 640px mobile · 860px sheet switches to true A4 width */

:root {
  /* knobs */
  --space-unit: 4px;
  --radius-scale: 1;
  --type-scale: 1;

  /* spacing */
  --space-0-5: calc(var(--space-unit) * .5);
  --space-1: var(--space-unit);
  --space-1-5: calc(var(--space-unit) * 1.5);
  --space-2: calc(var(--space-unit) * 2);
  --space-2-5: calc(var(--space-unit) * 2.5);
  --space-3: calc(var(--space-unit) * 3);
  --space-4: calc(var(--space-unit) * 4);
  --space-5: calc(var(--space-unit) * 5);
  --space-6: calc(var(--space-unit) * 6);
  --space-8: calc(var(--space-unit) * 8);
  --space-12: calc(var(--space-unit) * 12);

  /* type */
  --font-sans: 'Geist', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
  --text-2xs: calc(10px * var(--type-scale));
  --text-xs: calc(11px * var(--type-scale));
  --text-sm: calc(12px * var(--type-scale));
  --text-base: calc(13px * var(--type-scale));
  --text-md: calc(14px * var(--type-scale));
  --text-lg: calc(16px * var(--type-scale));
  --text-xl: calc(18px * var(--type-scale));
  --text-3xl: calc(24px * var(--type-scale));
  --text-4xl: calc(32px * var(--type-scale));
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --tracking-tight-heading: -0.035em;
  --tracking-snug: -0.02em;
  --tracking-body: -0.011em;
  --tracking-eyebrow: .1em;

  /* radius */
  --radius-xs: calc(4px * var(--radius-scale));
  --radius-sm: calc(6px * var(--radius-scale));
  --radius-md: calc(8px * var(--radius-scale));
  --radius-lg: calc(12px * var(--radius-scale));
  --radius-2xl: calc(20px * var(--radius-scale));
  --radius-full: 9999px;
  --radius-control: var(--radius-md);
  --radius-card: var(--radius-lg);
  --radius-overlay: var(--radius-2xl);
  --radius-badge: var(--radius-xs);

  /* motion */
  --duration-fast: .15s;
  --duration-base: .2s;
  --ease-soft: cubic-bezier(.16, 1, .3, 1);

  /* sizing */
  --control-h-sm: 30px;
  --control-h-md: 36px;
  --control-h-lg: 44px;
  --icon-btn: 32px;
  --blur-md: 12px;
  --topbar-h: 56px;
  --dock-h: 68px;
  --focus-offset: 2px;

  /* stacking */
  --z-dock: 20; --z-nav: 50; --z-toast: 60; --z-skip: 100;

  /* A4 sheet */
  --sheet-w: 210mm;
  --sheet-h: 297mm;
  --sheet-pad: 18mm;

  /* The sheet is paper: it keeps the library's light values in both themes so it matches the PDF */
  --paper: #FFFFFF;
  --paper-text: #0A0A0A;
  --paper-muted: #66666E;
  --paper-line: #E4E4E7;
  --paper-field: #F1F1F2;
  --paper-field-hover: #F4F4F5;
  --paper-border-hover: #D4D4D8;
  --paper-ring: rgba(10, 10, 10, .08);
  --paper-focus: rgba(14, 165, 233, .5);
  --paper-guide: #D4D4D8;
  --doc-accent: #18181b;
}

/* Light is the default; dark is [data-theme="dark"] (library values) */
:root, [data-theme="light"] {
  color-scheme: light;
  --bg: #FAFAFA;
  --surface: #FFFFFF;
  --surface-raised: #F1F1F2;
  --surface-hover: #F4F4F5;
  --border: #E4E4E7;
  --border-hover: #D4D4D8;
  --border-subtle: #EDEDEF;
  --text-primary: #0A0A0A;
  --text-secondary: #52525B;
  --text-muted: #66666E;
  --accent: #0A0A0A;
  --on-accent: #FFFFFF;
  --accent-subtle: rgba(10, 10, 10, .05);
  --focus-ring: rgba(14, 165, 233, .5);
  --fg-rgb: 10, 10, 10;
  --bg-rgb: 250, 250, 250;
  --overlay: rgba(10, 10, 10, .45);
  --shadow-sheet: 0 10px 25px -8px rgba(15, 15, 20, .12), 0 0 0 1px rgba(15, 15, 20, .05);
  --shadow-modal: 0 20px 50px rgba(15, 15, 20, .22);
  --dot: rgba(10, 10, 10, .07);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #151515;
  --surface: #202020;
  --surface-raised: #242424;
  --surface-hover: #262626;
  --border: #363636;
  --border-hover: #484848;
  --border-subtle: #2C2C2C;
  --text-primary: #F5F5F5;
  --text-secondary: #A3A3A3;
  --text-muted: #949494;
  --accent: #F5F5F5;
  --on-accent: #151515;
  --accent-subtle: rgba(255, 255, 255, .06);
  --focus-ring: rgba(56, 189, 248, .5);
  --fg-rgb: 245, 245, 245;
  --bg-rgb: 21, 21, 21;
  --overlay: rgba(0, 0, 0, .7);
  --shadow-sheet: 0 12px 30px -10px rgba(0, 0, 0, .8), 0 0 0 1px rgba(255, 255, 255, .06);
  --shadow-modal: 0 20px 50px rgba(0, 0, 0, .8);
  --dot: rgba(255, 255, 255, .05);
}
