/* Twin — style tokens v1 */

:root {
  /* Цвета — Light theme (основная) */
  --bg: #FFFFFF;
  --bg-elevated: #F7F7F9;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F2F2F5;
  --border: #E4E4E7;
  --border-strong: #C9C9CE;

  --fg: #0A0A0B;
  --fg-muted: #52525B;
  --fg-subtle: #8E8E93;

  --accent: #0099CC;
  --accent-hover: #00B8E6;
  --accent-soft: rgba(0, 153, 204, 0.08);
  --accent-glow: 0 0 60px rgba(0, 153, 204, 0.12);

  --success: #00A86B;
  --warning: #D97706;
  --danger: #DC2626;

  /* Типографика */
  --font-sans: 'Geist', 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'Geist Mono', 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.5rem;
  --text-2xl: 2rem;
  --text-3xl: 2.75rem;
  --text-4xl: 4rem;

  --leading-tight: 1.1;
  --leading-snug: 1.3;
  --leading-normal: 1.5;
  --leading-relaxed: 1.6;

  --tracking-tight: -0.02em;
  --tracking-normal: 0;
  --tracking-wide: 0.04em;

  /* Сетка и пространство */
  --container-max: 1200px;
  --container-pad: 24px;
  --container-pad-mobile: 16px;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Радиусы */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Тени */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.08);
  --shadow-glow: var(--accent-glow);

  /* Переходы */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Z-index */
  --z-base: 0;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-modal: 300;
  --z-toast: 400;
}

/* Dark theme — опционально для отдельных блоков */
[data-theme="dark"] {
  --bg: #0A0A0B;
  --bg-elevated: #14141A;
  --bg-card: #1A1A22;
  --bg-card-hover: #22222C;
  --border: #2A2A33;
  --border-strong: #3A3A44;

  --fg: #FAFAFA;
  --fg-muted: #A1A1AA;
  --fg-subtle: #71717A;

  --accent: #00D9FF;
  --accent-hover: #4FE5FF;
  --accent-soft: rgba(0, 217, 255, 0.1);
  --accent-glow: 0 0 60px rgba(0, 217, 255, 0.15);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
}

/* Reset + базовые правила */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv11', 'ss01';
}

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

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-hover);
}

button {
  font-family: inherit;
  cursor: pointer;
}

code, pre, kbd, samp {
  font-family: var(--font-mono);
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 700;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--fg);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }

@media (max-width: 768px) {
  :root {
    --text-4xl: 2.5rem;
    --text-3xl: 2rem;
    --text-2xl: 1.5rem;
    --container-pad: var(--container-pad-mobile);
  }
}

/* Focus */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

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

/* Selection */
::selection {
  background: var(--accent-soft);
  color: var(--accent);
}
