/* ------------------------------------------------------------------
   AVI-OS — Design Tokens
   Black & white · glassmorphism · Apple-touch format
   Powered by BRA-IVA
   ------------------------------------------------------------------ */

:root {
  /* Brand — strict monochrome */
  --brand-50:  #fafafa;
  --brand-100: #f5f5f5;
  --brand-200: #e5e5e5;
  --brand-300: #d4d4d4;
  --brand-400: #a3a3a3;
  --brand-500: #737373;
  --brand-600: #525252;
  --brand-700: #404040;
  --brand-800: #262626;
  --brand-900: #171717;
  --brand-950: #0a0a0a;

  /* Ink stack */
  --ink-0:   #ffffff;
  --ink-50:  #fafafa;
  --ink-100: #f5f5f5;
  --ink-200: #e5e5e5;
  --ink-300: #d4d4d4;
  --ink-400: #a3a3a3;
  --ink-500: #737373;
  --ink-600: #525252;
  --ink-700: #404040;
  --ink-800: #262626;
  --ink-900: #171717;
  --ink-950: #0a0a0a;

  /* Semantic — dark mode primary (OLED) */
  --bg:             #0a0a0a;
  --bg-elevated:    #141414;
  --bg-sunken:      #070707;
  --surface:        #161616;
  --surface-2:      #1c1c1c;
  --border:         #242424;
  --border-strong:  #333333;
  --text:           #f0f0f0;
  --text-soft:      #c0c0c0;
  --text-muted:     #808080;
  --text-faint:     #484848;
  --text-inverse:   #0a0a0a;
  --accent:         #f0f0f0;
  --accent-soft:    rgba(255,255,255,.07);
  --accent-text:    #e0e0e0;

  /* Glass morphism */
  --glass-bg:       rgba(20,20,20,.72);
  --glass-bg-light: rgba(255,255,255,.06);
  --glass-border:   rgba(255,255,255,.10);
  --glass-blur:     blur(20px) saturate(180%);
  --glass-blur-sm:  blur(10px) saturate(150%);
  --glass-shadow:   0 8px 32px rgba(0,0,0,.60), inset 0 1px 0 rgba(255,255,255,.08);

  /* Status */
  --ok:      #4ade80;   --ok-bg:   rgba(74,222,128,.10);
  --warn:    #fbbf24;   --warn-bg: rgba(251,191,36,.10);
  --bad:     #f87171;   --bad-bg:  rgba(248,113,113,.10);
  --info:    #60a5fa;   --info-bg: rgba(96,165,250,.10);

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter",
               "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter",
               "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", SFMono-Regular,
               Menlo, Monaco, Consolas, monospace;

  --fs-2xs: 10px; --fs-xs: 11px; --fs-sm: 12px; --fs-md: 13px;
  --fs-lg: 15px;  --fs-xl: 17px; --fs-2xl: 20px; --fs-3xl: 26px;
  --fs-4xl: 32px; --fs-5xl: 40px; --fs-6xl: 52px;

  --lh-tight: 1.15; --lh-snug: 1.3; --lh-base: 1.5; --lh-loose: 1.65;
  --tracking-tight: -0.02em; --tracking-snug: -0.01em;
  --tracking-wide: 0.02em;   --tracking-caps:  0.09em;

  /* Radii — Apple-touch softness */
  --r-xs: 5px;  --r-sm: 8px;  --r-md: 11px; --r-lg: 14px;
  --r-xl: 18px; --r-2xl: 22px; --r-3xl: 28px; --r-pill: 999px;

  /* Shadows */
  --shadow-xs: 0 1px 3px rgba(0,0,0,.6);
  --shadow-sm: 0 2px 6px rgba(0,0,0,.65);
  --shadow-md: 0 4px 14px rgba(0,0,0,.70);
  --shadow-lg: 0 8px 28px rgba(0,0,0,.75);
  --shadow-xl: 0 16px 50px rgba(0,0,0,.80);
  --ring:        0 0 0 3px rgba(255,255,255,.12);
  --ring-error:  0 0 0 3px rgba(248,113,113,.25);

  /* Layout */
  --sidebar-w:    256px;
  --sidebar-w-sm: 64px;
  --topbar-h:     56px;
  --content-max:  1440px;

  /* Motion */
  --ease-out:   cubic-bezier(.16,1,.3,1);
  --ease-inout: cubic-bezier(.65,.05,.36,1);
  --t-fast: 90ms; --t-base: 160ms; --t-slow: 300ms;
}

/* Light theme override */
[data-theme="light"] {
  --bg:            #f5f5f5;
  --bg-elevated:   #ffffff;
  --bg-sunken:     #ebebeb;
  --surface:       #ffffff;
  --surface-2:     #f5f5f5;
  --border:        #e0e0e0;
  --border-strong: #c8c8c8;
  --text:          #111111;
  --text-soft:     #444444;
  --text-muted:    #6a6a6a;
  --text-faint:    #a0a0a0;
  --text-inverse:  #ffffff;
  --accent:        #111111;
  --accent-soft:   rgba(0,0,0,.05);
  --accent-text:   #222222;
  --glass-bg:      rgba(255,255,255,.75);
  --glass-bg-light:rgba(0,0,0,.03);
  --glass-border:  rgba(0,0,0,.08);
  --glass-blur:    blur(20px) saturate(140%);
  --glass-blur-sm: blur(10px) saturate(120%);
  --glass-shadow:  0 8px 32px rgba(0,0,0,.10), inset 0 1px 0 rgba(255,255,255,.9);
  --shadow-xs: 0 1px 3px rgba(0,0,0,.05);
  --shadow-sm: 0 2px 6px rgba(0,0,0,.06);
  --shadow-md: 0 4px 14px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 28px rgba(0,0,0,.10);
  --shadow-xl: 0 16px 50px rgba(0,0,0,.14);
  --ring:       0 0 0 3px rgba(0,0,0,.10);
  --ring-error: 0 0 0 3px rgba(220,38,38,.20);
  --ok:    #16a34a;   --ok-bg:   rgba(22,163,74,.08);
  --warn:  #d97706;   --warn-bg: rgba(217,119,6,.08);
  --bad:   #dc2626;   --bad-bg:  rgba(220,38,38,.08);
  --info:  #2563eb;   --info-bg: rgba(37,99,235,.08);
  color-scheme: light;
}

[data-theme="light"] ::selection { background: rgba(0,0,0,.15); color: var(--text); }
[data-theme="light"] ::-webkit-scrollbar-thumb { background: var(--border-strong); }
[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }
[data-theme="light"] .auth-root { background: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(0,0,0,.04), transparent); }
