/* PF.TOOL — единая design system (Search ops console) */
:root {
  /* Surfaces — layering */
  --surface-base: #0c0c0e;
  --surface-raised: #141418;
  --surface-floating: #1e1e24;

  --bg-core: var(--surface-base);
  --bg-core-secondary: var(--surface-raised);
  --bg-card: var(--surface-floating);
  --bg-card-hover: #26262e;
  --bg-gradient-center: #1a1814;

  /* Brand */
  --accent: #e8a317;
  --accent-hover: #f0b429;
  --accent-muted: rgba(232, 163, 23, 0.14);
  --accent-glow: rgba(232, 163, 23, 0.35);
  --secondary: #5eead4;
  --secondary-muted: rgba(94, 234, 212, 0.12);

  --text-main: #f4f4f5;
  --text-muted: #9ca3af;
  --text-inverse: #0c0c0e;

  --border: #2a2a32;
  --border-subtle: #1f1f26;
  --success: #34d399;

  --nav-border: var(--border);
  --footer-bg: var(--surface-base);
  --footer-border: var(--border-subtle);

  /* Typography */
  --font-display: 'Unbounded', 'Golos Text', sans-serif;
  --font-body: 'Golos Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-family: var(--font-body);

  --text-display: clamp(2.25rem, 5vw, 3.5rem);
  --text-h2: clamp(1.75rem, 3vw, 2rem);
  --text-h3: 1.25rem;
  --text-body: 1rem;
  --text-sm: 0.875rem;
  --text-xs: 0.75rem;
  --leading-body: 1.7;
  --tracking-display: -0.03em;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  /* Shadows — color-tinted, layered */
  --shadow-raised:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 8px 24px -8px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.04);
  --shadow-floating:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 24px 48px -16px rgba(232, 163, 23, 0.12),
    0 16px 32px -12px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(232, 163, 23, 0.08);

  /* Motion */
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --duration-fast: 0.15s;
  --duration-normal: 0.25s;
}

[data-theme='light'] {
  --surface-base: #fafafa;
  --surface-raised: #ffffff;
  --surface-floating: #f4f4f5;

  --bg-core: var(--surface-base);
  --bg-core-secondary: var(--surface-raised);
  --bg-card: var(--surface-floating);
  --bg-card-hover: #eaeaec;
  --bg-gradient-center: #fef3c7;

  --accent: #c7860a;
  --accent-hover: #a86f08;
  --accent-muted: rgba(199, 134, 10, 0.12);
  --accent-glow: rgba(199, 134, 10, 0.25);
  --secondary: #0d9488;
  --secondary-muted: rgba(13, 148, 136, 0.1);

  --text-main: #18181b;
  --text-muted: #52525b;
  --text-inverse: #ffffff;

  --border: #e4e4e7;
  --border-subtle: #f0f0f2;

  --nav-border: var(--border);
  --footer-bg: var(--surface-base);
  --footer-border: var(--border-subtle);

  --shadow-raised:
    0 1px 0 rgba(255, 255, 255, 0.8) inset,
    0 8px 24px -8px rgba(0, 0, 0, 0.08),
    0 0 0 1px rgba(0, 0, 0, 0.04);
  --shadow-floating:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 24px 48px -16px rgba(199, 134, 10, 0.15),
    0 16px 32px -12px rgba(0, 0, 0, 0.1),
    0 0 0 1px rgba(199, 134, 10, 0.1);
}

/* Grain overlay utility */
.pf-grain {
  position: relative;
}

.pf-grain::before {
  content: '';
  pointer-events: none;
  position: absolute;
  inset: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 0;
}

.pf-grain > * {
  position: relative;
  z-index: 1;
}

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