/* ===========================================================================
   Шрифты — со своего домена. Ни одной внешней ссылки в рантайме.
   =========================================================================== */

@font-face {
  font-family: 'PT Sans Narrow';
  font-style: normal; font-weight: 400; font-display: swap;
  src: url('../fonts/pt-sans-narrow-400-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'PT Sans Narrow';
  font-style: normal; font-weight: 400; font-display: swap;
  src: url('../fonts/pt-sans-narrow-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'PT Sans Narrow';
  font-style: normal; font-weight: 700; font-display: swap;
  src: url('../fonts/pt-sans-narrow-700-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'PT Sans Narrow';
  font-style: normal; font-weight: 700; font-display: swap;
  src: url('../fonts/pt-sans-narrow-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

/* IBM Plex Sans — вариативная, один файл на все веса 100–700 */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal; font-weight: 100 700; font-display: swap;
  src: url('../fonts/ibm-plex-sans-var-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal; font-weight: 100 700; font-display: swap;
  src: url('../fonts/ibm-plex-sans-var-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal; font-weight: 400; font-display: swap;
  src: url('../fonts/ibm-plex-mono-400-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal; font-weight: 400; font-display: swap;
  src: url('../fonts/ibm-plex-mono-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal; font-weight: 500; font-display: swap;
  src: url('../fonts/ibm-plex-mono-500-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal; font-weight: 500; font-display: swap;
  src: url('../fonts/ibm-plex-mono-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ===========================================================================
   Сброс и основа
   =========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--toc-h) + 1rem);
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--text);
  font-size: var(--t-base);
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-variant-numeric: proportional-nums;
}

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

/* --- заголовки: узкий плотный дисплей, отрицательный трекинг на крупном --- */
h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 700;
  margin: 0;
  text-wrap: balance;
  hyphens: manual;
}

h1 {
  font-size: var(--t-hero);
  line-height: 0.94;
  letter-spacing: -0.022em;
  text-transform: uppercase;
}
h2 {
  font-size: clamp(1.9rem, 4.2vw, var(--t-3xl));
  line-height: 1.02;
  letter-spacing: -0.016em;
  text-transform: uppercase;
}
h3 {
  font-size: clamp(1.4rem, 2.6vw, var(--t-xl));
  line-height: 1.08;
  letter-spacing: -0.01em;
}
h4 {
  font-size: var(--t-md);
  line-height: 1.18;
  letter-spacing: -0.005em;
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: inherit; text-decoration-color: var(--line-2); text-underline-offset: 0.18em; }
a:hover { text-decoration-color: currentColor; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: var(--r-1);
}

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

strong, b { font-weight: 600; }

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: var(--s-7) 0;
}

/* Цифры в ценах, расписании, счётчиках — табличные, чтобы колонки не прыгали */
table, time {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

/* --- служебное ---------------------------------------------------------- */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.skip-link {
  position: absolute; left: var(--s-4); top: var(--s-4);
  z-index: 200;
  transform: translateY(-200%);
  background: var(--brand); color: var(--on-brand);
  padding: var(--s-3) var(--s-5);
  font-weight: 600;
  transition: transform var(--d-2) var(--e-in);
}
.skip-link:focus { transform: translateY(0); }

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