/* RHAgent Portal — Design Tokens (default: light) */

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

  --color-bg: #fafafa;
  --color-bg-elevated: #ffffff;
  --color-surface: #ffffff;
  --color-surface-2: #f0f0f0;
  --color-surface-3: #e8e8e8;
  --color-border: #eeeeee;
  --color-border-light: rgba(25, 26, 35, 0.08);
  --color-primary: #28b894;
  --color-primary-hover: #32e6b9;
  --color-primary-bright: #32e6b9;
  --color-primary-muted: rgba(40, 184, 148, 0.1);
  --color-accent: #168a70;
  --color-accent-muted: #e7f8f2;
  --color-text: #191a23;
  --color-text-secondary: #2d2f3a;
  --color-muted: rgba(25, 26, 35, 0.48);
  --color-success: #28b894;
  --color-warning: #d97706;
  --color-danger: #dc2626;
  --color-btn-dark: #1a1a1a;
  --color-nav-bg: rgba(255, 255, 255, 0.85);
  --color-nav-bg-scrolled: rgba(255, 255, 255, 0.95);
  --color-hero-title: #191a23;
  --color-link: #168a70;

  --font-sans: "DM Sans", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-display: "Space Grotesk", "DM Sans", "PingFang SC", sans-serif;
  --font-mono: "JetBrains Mono", "Consolas", monospace;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 2rem;
  --text-4xl: clamp(2.25rem, 5.5vw, 3.5rem);
  --text-5xl: clamp(2.75rem, 6vw, 4rem);

  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 40px;
  --space-2xl: 72px;
  --space-3xl: 112px;

  --max-width: 1200px;
  --nav-height: 72px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 999px;

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 4px 12px rgba(15, 23, 42, 0.06);
  --shadow-card: 0 12px 40px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 24px 64px rgba(15, 23, 42, 0.12);
  --shadow-glow: 0 12px 32px rgba(40, 184, 148, 0.18);

  --gradient-hero:
    radial-gradient(ellipse 90% 60% at 50% -10%, rgba(50, 230, 185, 0.14), transparent 65%),
    radial-gradient(ellipse 50% 40% at 90% 10%, rgba(40, 184, 148, 0.08), transparent 55%);
  --gradient-primary: linear-gradient(135deg, #32e6b9 0%, #28b894 100%);
  --gradient-cta: linear-gradient(135deg, #fafafa 0%, #e7f8f2 100%);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;

  --z-nav: 100;
  --z-overlay: 200;
}

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

  --color-bg: #0b0d12;
  --color-bg-elevated: #111318;
  --color-surface: #161922;
  --color-surface-2: #1c2030;
  --color-surface-3: #252a3a;
  --color-border: #2a3144;
  --color-border-light: rgba(255, 255, 255, 0.06);
  --color-primary: #32e6b9;
  --color-primary-hover: #5eecc8;
  --color-primary-bright: #32e6b9;
  --color-primary-muted: rgba(50, 230, 185, 0.12);
  --color-accent: #22d3ee;
  --color-accent-muted: rgba(34, 211, 238, 0.12);
  --color-link: #5eecc8;
  --color-btn-dark: #f1f5f9;
  --color-text: #f1f5f9;
  --color-text-secondary: #cbd5e1;
  --color-muted: #94a3b8;
  --color-nav-bg: rgba(11, 13, 18, 0.85);
  --color-nav-bg-scrolled: rgba(17, 19, 24, 0.95);
  --color-hero-title: #f8fafc;

  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow-card: 0 12px 40px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 48px rgba(50, 230, 185, 0.15);
  --gradient-hero: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(50, 230, 185, 0.12), transparent 70%);
  --gradient-cta: linear-gradient(135deg, #161922 0%, #1a1d2e 100%);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { display: block; max-width: 100%; height: auto; }

a {
  color: var(--color-link);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}
a:hover { color: var(--color-primary-hover); }

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 var(--space-md);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--color-text);
  font-family: var(--font-display);
}

p { margin: 0 0 var(--space-md); }
p:last-child { margin-bottom: 0; }

ul, ol { margin: 0 0 var(--space-md); padding-left: 1.25rem; }

code {
  font-family: var(--font-mono);
  background: var(--color-surface-2);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.88em;
}

::selection {
  background: rgba(40, 184, 148, 0.25);
  color: var(--color-text);
}

.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;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
