/* ========================================
   OPENMINDED BOT — DESIGN SYSTEM v2
   Based on Claude Design Reference
   ======================================== */

/* ----------------------------------------
   CSS Tokens
   ---------------------------------------- */
:root {
  /* Accent */
  --accent: #FF007F;
  --accent-hover: #D60068;
  --accent-ink: #B80059;
  --accent-soft: rgba(255, 0, 127, 0.08);
  --accent-muted: rgba(255, 0, 127, 0.05);
  --accent-glow: rgba(255, 0, 127, 0.22);

  /* Neutral — Light Theme */
  --bg: #FFFFFF;
  --surface: #FAF7F9;
  --surface-2: #F2ECF0;
  --surface-hover: #F0F0F4;
  --text: #14141A;
  --text-muted: #5A5A66;
  --text-inverse: #FFFFFF;
  --ink: #16121A;
  --muted: #6B6470;
  --border: #ECE5EA;
  --border-strong: #D1D1DB;

  /* Radii */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-pill: 999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(22, 18, 26, 0.06);
  --shadow-md: 0 12px 32px rgba(22, 18, 26, 0.10);
  --shadow-lg: 0 16px 40px rgba(20, 20, 26, 0.12);
  --shadow-accent: 0 10px 30px rgba(255, 0, 127, 0.28);

  /* Layout & Motion */
  --container: 1140px;
  --gap: 24px;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --bg-rgb: 255, 255, 255;

  /* Fonts */
  --font-display: 'Unbounded', system-ui, -apple-system, sans-serif;
  --font-body: 'Golos Text', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

  /* Typography Scale */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1.0625rem;
  --text-lg: 1.25rem;
  --text-xl: 1.5rem;
  --text-2xl: clamp(1.6rem, 3vw, 2.4rem);
  --text-3xl: clamp(2.2rem, 5vw, 3.8rem);

  /* Motion */
  --transition-fast: 0.15s ease;
  --transition-base: 0.2s ease;

  /* Legacy aliases for backward compatibility */
  --bg-base: var(--bg);
  --bg-surface: var(--surface);
  --bg-elevated: var(--surface-hover);
  --bg-overlay: rgba(255, 255, 255, 0.9);
  --text-primary: var(--text);
  --text-secondary: var(--text-muted);
  --color-primary: var(--accent);
  --color-primary-hover: var(--accent-hover);
  --color-primary-soft: var(--accent-soft);
  --color-secondary: #00E5FF;
  --color-secondary-hover: #33EBFF;
  --color-secondary-soft: rgba(0, 229, 255, 0.08);
  --color-success: #39FF14;
  --color-warning: #FFB800;
  --color-error: #FF3366;
  --color-info: #00E5FF;
  --radius-button: var(--r-md);
  --radius-card: var(--r-lg);
  --radius-tag: var(--r-sm);
  --radius-pill: 9999px;
}

/* ----------------------------------------
   Dark Theme
   ---------------------------------------- */
[data-theme="dark"] {
  --bg: #0A0A0F;
  --surface: #14141A;
  --surface-hover: #1E1E28;
  --text: #F0F0F5;
  --text-muted: #9A9AA8;
  --text-inverse: #14141A;
  --border: #2A2A36;
  --border-strong: #3A3A48;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
  --accent-soft: rgba(255, 0, 127, 0.12);
  --accent-muted: rgba(255, 0, 127, 0.06);

  /* Legacy aliases */
  --bg-base: var(--bg);
  --bg-surface: var(--surface);
  --bg-elevated: var(--surface-hover);
  --bg-overlay: rgba(10, 10, 15, 0.9);
  --text-primary: var(--text);
  --text-secondary: var(--text-muted);
  --bg-rgb: 10, 10, 15;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0A0A0F;
    --surface: #14141A;
    --surface-hover: #1E1E28;
    --text: #F0F0F5;
    --text-muted: #9A9AA8;
    --text-inverse: #14141A;
    --border: #2A2A36;
    --border-strong: #3A3A48;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
    --accent-soft: rgba(255, 0, 127, 0.12);
    --accent-muted: rgba(255, 0, 127, 0.06);

    --bg-base: var(--bg);
    --bg-surface: var(--surface);
    --bg-elevated: var(--surface-hover);
    --bg-overlay: rgba(10, 10, 15, 0.9);
    --text-primary: var(--text);
    --text-secondary: var(--text-muted);
    --bg-rgb: 10, 10, 15;
  }
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

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

/* Отключаем transition при загрузке, чтобы не было мигания темы */
html.no-transitions body {
  transition: none !important;
}

html.no-transitions *,
html.no-transitions *::before,
html.no-transitions *::after {
  transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
  body {
    transition: none;
  }
}

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

p, li, td, th, label {
  color: var(--text);
}

::selection {
  background: var(--accent);
  color: var(--text-inverse);
}

/* ----------------------------------------
   Focus States
   ---------------------------------------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ----------------------------------------
   Icon Box (Lucide icons container)
   ---------------------------------------- */
.icon-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--accent-soft);
  border-radius: var(--r-md);
  color: var(--accent);
  flex-shrink: 0;
}

.icon-box svg,
.icon-box [data-lucide] {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

/* ----------------------------------------
   Mesh Gradient (Hero background)
   ---------------------------------------- */
.mesh-gradient {
  background:
    radial-gradient(ellipse at 20% 30%, rgba(255, 0, 127, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(0, 229, 255, 0.04) 0%, transparent 50%);
}

/* ----------------------------------------
   Badge
   ---------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: var(--text-xs);
  font-weight: 700;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge--accent {
  background: var(--accent);
  color: var(--text-inverse);
}
