/* ============================================
   GLOBALS — Reset, Variables, Base Styles
   ============================================ */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Brand */
  --saffron: #ff9933;
  --india-green: #22c55e;
  --primary: #f97316;
  --primary-dim: rgba(249, 115, 22, 0.12);
  --primary-glow: rgba(249, 115, 22, 0.3);
  --accent: #fb923c;
  --accent-2: #fbbf24;

  /* Dark Theme (default) */
  --bg:        #0a0a0f;
  --bg-2:      #0d0d13;
  --bg-3:      #111118;
  --bg-4:      #16161e;
  --surface:   #111118;
  --surface-2: #18181f;
  --surface-3: #1e1e27;
  --surface-4: #252530;

  --border:        rgba(255, 255, 255, 0.06);
  --border-2:      rgba(255, 255, 255, 0.10);
  --border-3:      rgba(255, 255, 255, 0.14);
  --border-accent: rgba(249, 115, 22, 0.20);

  --text:   #eeeef3;
  --text-2: rgba(238, 238, 243, 0.60);
  --text-3: rgba(238, 238, 243, 0.35);
  --text-4: rgba(238, 238, 243, 0.20);
  --text-inv: #0a0a0f;

  /* Gradients */
  --grad-brand: linear-gradient(135deg, #f97316 0%, #fb923c 50%, #fbbf24 100%);
  --grad-brand-soft: linear-gradient(135deg, rgba(249,115,22,0.14) 0%, rgba(251,191,36,0.05) 100%);
  --grad-subtle: linear-gradient(135deg, rgba(249,115,22,0.05), rgba(251,191,36,0.02));

  /* Shadows */
  --shadow-xs: 0 1px 3px rgba(0,0,0,0.5);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.6);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.7);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.8);
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.9);
  --shadow-glow: 0 0 40px rgba(249,115,22,0.15);

  /* Radii */
  --r-xs:   4px;
  --r-sm:   6px;
  --r-md:   10px;
  --r-lg:   14px;
  --r-xl:   18px;
  --r-2xl:  24px;
  --r-full: 9999px;

  /* Spacing */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;

  /* Transitions */
  --t-fast: 0.15s ease;
  --t-base: 0.2s ease;
  --t-slow: 0.35s ease;

  /* Layout */
  --sidebar-w: 260px;
  --header-h:  56px;
  --msg-max-w: 780px;
  --input-max-w: 760px;
}

/* Light Theme */
[data-theme="light"] {
  --bg:        #f4f4f8;
  --bg-2:      #ededf2;
  --bg-3:      #e6e6ec;
  --bg-4:      #dddde4;
  --surface:   #ffffff;
  --surface-2: #f2f2f7;
  --surface-3: #e9e9ef;
  --surface-4: #e0e0e8;

  --border:        rgba(0, 0, 0, 0.07);
  --border-2:      rgba(0, 0, 0, 0.11);
  --border-3:      rgba(0, 0, 0, 0.16);
  --border-accent: rgba(249, 115, 22, 0.22);

  --text:   #0c0c12;
  --text-2: rgba(12, 12, 18, 0.58);
  --text-3: rgba(12, 12, 18, 0.36);
  --text-4: rgba(12, 12, 18, 0.20);
  --text-inv: #f4f4f8;

  --shadow-xs: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.14);
  --shadow-glow: 0 0 30px rgba(249,115,22,0.10);
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-2);
  border-radius: var(--r-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--text-4); }

/* Focus */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* Selection */
::selection {
  background: var(--primary-dim);
  color: var(--text);
}

/* Utilities */
.hidden { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.gradient-text {
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
