/* =========================================================
   АО «ЦЕНТРОЭЛЕКТРОНАЛАДКА» — DESIGN TOKENS
   Палитра выведена из корпоративной эмблемы (синий щит,
   монограмма ЦЭН, опора ЛЭП): глубокий графит, техническая
   белизна, стальной серый, корпоративный синий,
   один акцент — электрик-блю (LIVE CIRCUIT).
   ========================================================= */

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

html {
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  hanging-punctuation: first last;
  scroll-padding-top: 88px;
}

:root,
[data-theme="light"] {
  /* ---- Surfaces ---- */
  --color-bg: #f5f6f7;
  --color-surface: #ffffff;
  --color-surface-2: #fbfbfc;
  --color-surface-offset: #eceef0;
  --color-surface-offset-2: #e2e5e8;
  --color-surface-dynamic: #d8dce0;
  --color-divider: #dde1e4;
  --color-border: #cdd2d7;

  /* ---- Text (graphite scale) ---- */
  --color-text: #14171b;
  --color-text-muted: #565d66;
  --color-text-faint: #939aa2;
  --color-text-inverse: #f5f6f7;

  /* ---- Corporate blue (from emblem) ---- */
  --color-navy: #0b2540;
  --color-steel: #4a5a6b;

  /* ---- Primary accent — Electric Blue (LIVE CIRCUIT) ---- */
  --color-primary: #0072e8;
  --color-primary-hover: #0058b3;
  --color-primary-active: #00408a;
  --color-primary-highlight: #d6e7fb;
  --color-primary-glow: #3fa1ff;

  /* ---- Warning / Error (used sparingly, for placeholders only) ---- */
  --color-warning: #a15c00;
  --color-warning-highlight: #f3e3cc;
  --color-error: #a3243f;
  --color-error-highlight: #f1d9de;
  --color-success: #216b3e;

  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-full: 9999px;

  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);

  --shadow-sm: 0 1px 2px rgba(11, 20, 32, 0.06);
  --shadow-md: 0 6px 20px rgba(11, 20, 32, 0.08);
  --shadow-lg: 0 20px 48px rgba(11, 20, 32, 0.14);

  --content-narrow: 640px;
  --content-default: 880px;
  --content-wide: 1240px;
  --content-full: 100%;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', 'SF Mono', monospace;
}

[data-theme="dark"] {
  --color-bg: #0d1117;
  --color-surface: #12161d;
  --color-surface-2: #161b23;
  --color-surface-offset: #1a2029;
  --color-surface-offset-2: #1f2732;
  --color-surface-dynamic: #29323e;
  --color-divider: #232b35;
  --color-border: #313b47;

  --color-text: #e7eaee;
  --color-text-muted: #9aa4b1;
  --color-text-faint: #5c6774;
  --color-text-inverse: #14171b;

  --color-navy: #a9c6e8;
  --color-steel: #8b9bac;

  --color-primary: #3fa1ff;
  --color-primary-hover: #6bb6ff;
  --color-primary-active: #9acaff;
  --color-primary-highlight: #1c3450;
  --color-primary-glow: #3fa1ff;

  --color-warning: #d99b45;
  --color-warning-highlight: #3a2c17;
  --color-error: #e0708a;
  --color-error-highlight: #3a1f27;
  --color-success: #5cbf85;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.55);
}

/* ---- Type scale ---- */
:root {
  --text-xs: clamp(0.75rem, 0.72rem + 0.15vw, 0.8125rem);
  --text-sm: clamp(0.875rem, 0.84rem + 0.2vw, 0.9375rem);
  --text-base: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  --text-lg: clamp(1.125rem, 1.05rem + 0.4vw, 1.375rem);
  --text-xl: clamp(1.375rem, 1.2rem + 0.9vw, 1.875rem);
  --text-2xl: clamp(1.875rem, 1.4rem + 2vw, 2.75rem);
  --text-3xl: clamp(2.25rem, 1.4rem + 3.5vw, 3.75rem);
  --text-hero: clamp(2.5rem, 1rem + 5.5vw, 5.25rem);
}

/* ---- Spacing ---- */
:root {
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;
}

body {
  min-height: 100dvh;
  line-height: 1.6;
  font-family: var(--font-body, sans-serif);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}
ul[role="list"], ol[role="list"] { list-style: none; }
input, button, textarea, select { font: inherit; color: inherit; }

h1, h2, h3, h4, h5, h6 {
  text-wrap: balance;
  line-height: 1.12;
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.01em;
}
p, li, figcaption { text-wrap: pretty; }

::selection {
  background: color-mix(in oklab, var(--color-primary) 30%, transparent);
  color: var(--color-text);
}

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

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

button { cursor: pointer; background: none; border: none; }
table { border-collapse: collapse; width: 100%; }

a, button, [role="button"], [role="link"], input, textarea, select {
  transition:
    color var(--transition-interactive),
    background var(--transition-interactive),
    border-color var(--transition-interactive),
    box-shadow var(--transition-interactive);
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
