/* ==========================================================================
   ВИЕРКОМ · основание: сброс, типографика, базовые элементы
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + var(--space-4));
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  font-feature-settings: "cv05" 1, "cv08" 1, "ss03" 1; /* «ł», «1», кириллические альтернаты Inter */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* --- заголовки ---------------------------------------------------------- */

h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--text-strong);
  font-weight: 800;
  line-height: var(--leading-tight);
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 {
  font-size: var(--text-4xl);
  font-weight: 900;
}

h2 {
  font-size: var(--text-3xl);
}

h3 {
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.01em;
}

h4 {
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: 0;
}

p {
  margin: 0 0 var(--space-4);
  text-wrap: pretty;
}

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

/* Ведущий абзац раздела: крупнее основного, но не заголовок. */
.lead {
  max-width: 62ch;
  color: var(--text);
  font-size: var(--text-lg);
  line-height: 1.6;
}

.muted {
  color: var(--text-muted);
}

small,
.small {
  font-size: var(--text-sm);
  line-height: 1.55;
}

strong,
b {
  font-weight: 650;
  color: var(--text-strong);
}

/* --- ссылки ------------------------------------------------------------- */

a {
  color: var(--accent);
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
  text-underline-offset: 0.2em;
  transition: color 0.15s var(--ease-out);
}

a:hover {
  color: var(--accent-2);
  text-decoration-color: currentColor;
}

/* --- обход клавиатурой -------------------------------------------------- */

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

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  z-index: 200;
  padding: var(--space-3) var(--space-5);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  border-radius: var(--radius);
  transition: top 0.2s var(--ease-out);
}

.skip-link:focus {
  top: var(--space-4);
  color: var(--on-accent);
}

/* --- списки ------------------------------------------------------------- */

ul,
ol {
  margin: 0 0 var(--space-4);
  padding-left: 1.25em;
}

li {
  margin-bottom: var(--space-2);
}

li::marker {
  color: var(--accent);
}

ul:last-child,
ol:last-child {
  margin-bottom: 0;
}

/* Список без маркеров, с изумрудной галочкой-чертой. */
.list-check {
  padding-left: 0;
  list-style: none;
}

.list-check li {
  position: relative;
  padding-left: 1.75em;
  margin-bottom: var(--space-3);
}

.list-check li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 0.85em;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

/* --- изображения -------------------------------------------------------- */

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

figure {
  margin: 0;
}

figcaption {
  margin-top: var(--space-3);
  color: var(--text-muted);
  font-size: var(--text-sm);
  line-height: 1.5;
}

/* --- таблицы ------------------------------------------------------------ */

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-raised);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  line-height: 1.5;
}

th,
td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

thead th {
  position: sticky;
  top: 0;
  background: var(--bg-sunken);
  color: var(--text-strong);
  font-weight: 600;
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: var(--bg-inset);
}

/* Код услуги в первой колонке — моноширинным, чтобы A1 и B5 стояли
   в столбик и читались как коды, а не как текст. */
.code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* --- служебное ---------------------------------------------------------- */

.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;
  border: 0;
}

hr {
  height: 1px;
  margin: var(--space-7) 0;
  border: 0;
  background: var(--border);
}

::selection {
  background: color-mix(in srgb, var(--accent) 30%, transparent);
  color: var(--text-strong);
}
