/* ============================================================
   RETRO X7 — base / reset / a11y primitives
   ============================================================ */

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

html {
  scroll-behavior: smooth;
  /* Якорные переходы не должны прятать заголовок под фиксированной шапкой */
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--f-ui);
  font-size: var(--t-base);
  line-height: var(--lh-normal);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, p, figure, blockquote, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }

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

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

button, input, select, textarea {
  font: inherit;
  color: inherit;
  margin: 0;
}

button { background: none; border: 0; cursor: pointer; }

/* Убирает 300ms задержку тапа на сенсорных экранах (ui-ux-rules §2). */
a, button, [role='button'], [role='tab'], label, summary, input, select, textarea {
  touch-action: manipulation;
}

/* Текст лендинга можно выделять, включая подписи кнопок и карты. */
body, body *:not(video):not(canvas):not(svg):not(svg *) {
  -webkit-user-select: text;
  user-select: text;
}

::selection { background: var(--c-accent); color: var(--c-text-on-accent); }

/* --- Focus: ТЗ §13.3, всё управляется с клавиатуры --- */
:focus-visible {
  outline: 2px solid var(--c-accent-hi);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}
:focus:not(:focus-visible) { outline: none; }

/* --- Служебные --- */
.wrap {
  width: 100%;
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap--narrow { max-width: var(--page-narrow); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100px; left: var(--gutter);
  z-index: var(--z-modal);
  padding: 12px 20px;
  background: var(--c-accent);
  color: var(--c-text-on-accent);
  border-radius: var(--r-md);
  font-weight: 600;
  transition: top var(--d-fast) var(--e-out);
}
.skip-link:focus { top: 12px; }

[hidden] { display: none !important; }

/* Пока конфиг не загружен — не показываем «сырые» ключи i18n */
.is-booting [data-i18n]:empty::before { content: '\00a0'; }
