/* Orange Thread LIVE OS: design tokens v1.0
   Source of truth for both the prototype and the React app (src/styles/tokens.css).
   Dark is the default. The theme comes from profiles.theme_preference and is applied as
   <html data-theme="dark|light">. Names follow shadcn/ui conventions where they overlap
   (background, foreground, border, ring, primary...) so shadcn components work unmodified. */

:root,
:root[data-theme="dark"] {
  color-scheme: dark;

  /* Surfaces: midnight navy, hue ~217. Elevation is expressed by lightness, not shadow. */
  --bg:            #0B1322;  /* app canvas, main content */
  --bg-sunken:     #08101C;  /* app sidebar, agenda rail, top bar */
  --surface:       #111C30;  /* inputs, popovers, dialogs, table header */
  --surface-hover: #16233A;  /* row hover, ghost button hover */
  --surface-active:#1B2A44;  /* selected row, pressed, active nav */
  --border:        #1E2A3F;  /* 1px dividers */
  --border-strong: #2B3A55;  /* input borders, focus-adjacent */

  /* Text */
  --text:   #E7ECF3;   /* 15.6:1 on --bg */
  --text-2: #A1ADBF;   /* secondary, metadata. 8.2:1 */
  --text-3: #7A889E;   /* tertiary text and placeholders. 4.9:1 on --bg, 5.3:1 on --bg-sunken (raised from #6C7A90 for WCAG AA, 1.11.0) */

  /* Brand: primary actions, active navigation, selected states. Never status. */
  --accent:        #F47721;
  --accent-hover:  #F68A3E;
  --accent-text:   #F7934F;                    /* orange used as text / icon */
  --accent-subtle: rgb(244 119 33 / .14);      /* selected-row tint, active agenda item */
  --on-accent:     #0B1322;                    /* 6.6:1. White on #F47721 is only 2.8:1 */

  /* Status. -text = foreground on --bg; -subtle = tinted background behind --text. */
  --success:        #5DA88A;  --success-text: #7CC0A4;  --success-subtle: rgb(93 168 138 / .17);
  --danger:         #D66C6C;  --danger-text:  #E89090;  --danger-subtle:  rgb(214 108 108 / .17);
  --info:           #7193BF;  --info-text:    #98B3D6;  --info-subtle:    rgb(113 147 191 / .17);
  --warning:        #E0B042;  --warning-text: #EBC46A;  --warning-subtle: rgb(224 176 66 / .16);  /* timers: last 10% of a section */

  --scrim: rgb(3 7 14 / .62);
  --shadow-pop: 0 0 0 1px var(--border-strong), 0 12px 32px rgb(0 0 0 / .45);
  --av-l: 32%; --av-t: 86%;   /* avatar tint lightness: background / initials */
}

:root[data-theme="light"] {
  color-scheme: light;

  --bg:            #FAF9F7;  /* warm white */
  --bg-sunken:     #F3F1ED;
  --surface:       #FFFFFF;
  --surface-hover: #F0EEEA;
  --surface-active:#E9E6E0;
  --border:        #E4E0D9;
  --border-strong: #D3CEC5;

  --text:   #1C232E;   /* charcoal with a navy cast. 15.0:1 */
  --text-2: #566070;   /* 6.0:1 */
  --text-3: #666E7A;   /* tertiary text and placeholders. 5.1:1 on --surface (raised from #7D8591 for WCAG AA, 1.11.0) */

  --accent:        #F47721;
  --accent-hover:  #E2681A;
  --accent-text:   #A84B0A;                    /* 4.9:1 on --accent-subtle */
  --accent-subtle: #FDEBDD;
  --on-accent:     #1C232E;                    /* 5.7:1 */

  --success:        #5DA88A;  --success-text: #2D7457;  --success-subtle: #E3F1EA;
  --danger:         #D66C6C;  --danger-text:  #A94444;  --danger-subtle:  #F9E6E5;
  --info:           #7193BF;  --info-text:    #3F6290;  --info-subtle:    #E6EDF6;
  --warning:        #E0B042;  --warning-text: #8A6410;  --warning-subtle: #FAF0D5;

  --scrim: rgb(28 35 46 / .32);
  --shadow-pop: 0 0 0 1px var(--border), 0 12px 32px rgb(28 35 46 / .14);
  --av-l: 88%; --av-t: 28%;
}

:root {
  /* Type: Inter for all UI (see design doc §2.4 for why not Rift/Montserrat). */
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, monospace;   /* code only; numbers use tabular Inter */

  --fs-display: 24px;  --lh-display: 32px;   /* page / section title */
  --fs-title:   16px;  --lh-title:   24px;   /* block heading */
  --fs-body:    14px;  --lh-body:    20px;
  --fs-table:   13px;  --lh-table:   20px;
  --fs-meta:    12px;  --lh-meta:    16px;
  --fs-micro:   11px;  --lh-micro:   16px;   /* rail group labels only */
  --fs-timer:   28px;  --lh-timer:   32px;

  /* Spacing: 4px grid */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;

  /* Radius */
  --r-sm: 4px;   /* badges, checkboxes, table cell controls */
  --r-md: 6px;   /* buttons, inputs, menu items */
  --r-lg: 8px;   /* dialogs, popovers, drawers */

  /* Sizing */
  --row-h: 40px;         /* desktop table row */
  --ctl-sm: 28px; --ctl-md: 32px; --ctl-lg: 36px;
  --touch: 44px;         /* minimum on coarse pointers */
  --rail-w: 232px; --notes-w: 300px; --topbar-h: 48px;

  --ease: cubic-bezier(.2, 0, 0, 1);
  --dur: 120ms;
}
