/* ---------------------------------------------------------------------------
   base.css — шрифты, сброс, дизайн-токены, базовая типографика.
   Токены сняты напрямую с узлов Figma (переменных и стилей в макете нет).
   Источник значений: docs/ТЗ-верстка-astro.md §3.
   --------------------------------------------------------------------------- */

/* Euclid Circular B — Swiss Typefaces, платный. Файлы в /fonts/.
   Не публиковать отдельно от проекта и не передавать третьим лицам. */

@font-face {
  font-family: 'Euclid Circular B';
  src: url('/fonts/EuclidCircularB-Regular.woff2') format('woff2'),
       url('/fonts/EuclidCircularB-Regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Euclid Circular B';
  src: url('/fonts/EuclidCircularB-Medium.woff2') format('woff2'),
       url('/fonts/EuclidCircularB-Medium.woff') format('woff');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Euclid Circular B';
  src: url('/fonts/EuclidCircularB-Semibold.woff2') format('woff2'),
       url('/fonts/EuclidCircularB-Semibold.woff') format('woff');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Euclid Circular B';
  src: url('/fonts/EuclidCircularB-Bold.woff2') format('woff2'),
       url('/fonts/EuclidCircularB-Bold.woff') format('woff');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* --- Токены ---------------------------------------------------------------- */

:root {
  --font-sans: 'Euclid Circular B', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --color-bg: #1f1f1f;
  --color-text: #ffffff;
  --color-surface-dark: #010101;
  --color-black: #000000;
  --color-accent: #da251e;
  --color-surface-light: #eaeaea;
  --color-control: #303030;
  --color-text-muted: #8e8e8e;
  --color-badge-bg: #d0ffcb;
  --color-badge-icon: #00c532;
  --color-icon-dark: #2a2a2a;

  /* Скругления. В макете стоят 70/60/53/10 — при фактических размерах это полный
     овал, поэтому pill = 9999px, а не число из Figma. */
  --radius-card: 28px;
  --radius-control: 20px;
  --radius-pill: 9999px;
}

/* --- Сброс ------------------------------------------------------------------ */

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

html {
  /* Запрет синтеза начертаний: если запрошенный вес не совпадает с загруженным
     файлом точно, Windows «дорисовывает» жирность сам — и текст перестаёт
     совпадать с макетом. Все используемые веса — строго 400/500/600/700. */
  font-synthesis: none;
}

body,
h1, h2, h3, h4, h5, h6,
p, ul, ol, figure {
  margin: 0;
}

ul, ol {
  padding: 0;
  list-style: none;
}

img, svg, video, picture {
  display: block;
}

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

a {
  color: inherit;
  text-decoration: none;
}

/* Спрятать визуально, оставив скринридерам (радио размеров и т.п.). */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* --- База ------------------------------------------------------------------- */

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  /* Сглаживание: действует на macOS. Windows (DirectWrite) эти свойства
     игнорирует — там паритет с Figma дают font-synthesis, точные веса
     и letter-spacing из токенов. */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
