/* SD&I Services. Концепция «Регламент».
   Стили пишутся от телефона: S до 767 px, M от 768 px, L от 1024 px;
   колоночный блок включается от 1200 px. */

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

:root {
  --navy: #212146;
  --indigo: #353572;
  --violet: #5353a5;
  --white: #ffffff;
  --mist: #f5f5f9;
  --ink-2: #5a5a72;
  --on-dark-2: #c1c1cb;
  --line: #d0d0dc;
  --line-mid: #8a8aa0;

  --label: #5353a5;
  --rule-strong: #212146;
  --rule-weak: #d0d0dc;
  --focus: #5353a5;

  --cols: 4;
  --gutter: 16px;
  --margin: clamp(1.25rem, 5vw, 4rem);
  --section-y: 64px;
  --hero-top: 48px;
  --gap-label: 32px;
  --gap-head: 40px;
  --gap-block: 48px;
  --row-y: 20px;

  --fs-h1: clamp(2rem, 1.25rem + 3.4vw, 4rem);
  --fs-h2: clamp(1.625rem, 1.2rem + 1.9vw, 2.75rem);
  --fs-thesis: clamp(1.5rem, 1.1rem + 2.2vw, 3rem);
  --fs-figure: clamp(2.25rem, 1.6rem + 2.6vw, 3.5rem);
  --fs-h3: clamp(1.25rem, 1.15rem + 0.45vw, 1.5rem);
  --fs-lead: clamp(1.0625rem, 1rem + 0.4vw, 1.25rem);

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (min-width: 768px) {
  :root {
    --cols: 8;
    --gutter: 24px;
    --section-y: 88px;
    --hero-top: 64px;
    --gap-label: 40px;
    --gap-head: 48px;
    --gap-block: 64px;
    --row-y: 24px;
  }
}

@media (min-width: 1024px) {
  :root {
    --cols: 12;
    --gutter: 32px;
    --section-y: 120px;
    --hero-top: 88px;
    --gap-label: 48px;
    --gap-head: 64px;
    --gap-block: 88px;
    --row-y: 28px;
  }
}

/* ---------- Основа ---------- */

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

html {
  background: #ffffff;
  font-synthesis: none;
  scroll-behavior: auto;
  scroll-padding-top: 96px;
  scrollbar-gutter: stable;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (min-width: 1024px) {
  html {
    scroll-padding-top: 112px;
  }
}

/* Плавная прокрутка к якорям и к началу страницы: только если движение не ограничено в системе. */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

html.is-locked {
  overflow: hidden;
}

body {
  margin: 0;
  font-family: "Century Gothic", "CenturyGothic", "Jost", sans-serif;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0;
  font-variant-numeric: lining-nums tabular-nums;
  color: #212146;
  hyphens: manual;
  overflow-wrap: break-word;
}

h1,
h2,
h3,
h4,
h5,
h6,
b,
strong,
th,
button,
input,
dt {
  font-weight: 400;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd {
  margin: 0;
}

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

h1 {
  font-size: var(--fs-h1);
  line-height: 1.08;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

h2 {
  font-size: var(--fs-h2);
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h3 {
  font-size: var(--fs-h3);
  line-height: 1.3;
  letter-spacing: 0;
}

p {
  text-wrap: pretty;
}

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

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

button,
input {
  margin: 0;
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
}

/* Закрытый диалог скрыт всегда, в том числе там, где у браузера нет своих стилей для него. */
dialog:not([open]) {
  display: none;
}

[hidden] {
  display: none !important;
}

::selection {
  background: #353572;
  color: #ffffff;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

main:focus,
main:focus-visible,
.panel__title:focus,
.panel__title:focus-visible {
  outline: none;
}

.nw {
  white-space: nowrap;
}

/* ---------- Ссылка пропуска ---------- */

.skip {
  position: fixed;
  left: 8px;
  top: 8px;
  z-index: 200;
  padding: 12px 16px;
  background: #212146;
  color: #ffffff;
  transform: translateY(-200%);
}

.skip:focus {
  transform: none;
}

.skip:focus-visible {
  outline-color: #ffffff;
}

/* ---------- Полосы, контейнер, сетка ---------- */

.band {
  padding-block: var(--section-y);
}

.band--white {
  background: #ffffff;
  color: #212146;
}

.band--mist {
  background: #f5f5f9;
  color: #212146;
}

.band--navy {
  --label: #ffffff;
  --rule-strong: #ffffff;
  --rule-weak: #8a8aa0;
  --focus: #ffffff;
  background: #212146;
  color: #ffffff;
}

#top {
  padding-top: var(--hero-top);
}

.container {
  width: min(100% - 2 * var(--margin), 1280px);
  margin-inline: auto;
}

.cols {
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  column-gap: var(--gutter);
}

/* ---------- Текстовые стили ---------- */

.lead {
  max-width: 38rem;
  font-size: var(--fs-lead);
  line-height: 1.55;
}

.lead + .lead {
  margin-top: 16px;
}

.thesis {
  grid-column: 1 / -1;
  font-size: var(--fs-thesis);
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

@media (min-width: 1024px) {
  .thesis {
    grid-column: 1 / span 10;
  }
}

/* ---------- Метка-линейка и линейка без текста ---------- */

.rule-label {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.4;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-wrap: wrap;
  color: var(--label);
}

.rule-label::after {
  content: "";
  flex: 1 1 2rem;
  min-width: 2rem;
  height: 1px;
  margin-top: 0.7em;
  background: var(--rule-strong);
  transform-origin: 0 50%;
}

@media (min-width: 768px) {
  .rule-label {
    gap: 24px;
    font-size: 0.8125rem;
    letter-spacing: 0.16em;
  }
}

.rule-label + * {
  margin-top: var(--gap-label);
}

.rule-top {
  border-top: 1px solid var(--rule-strong);
  padding-top: var(--gap-label);
}

/* ---------- Кнопки ---------- */

.btn {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  padding: 0 28px;
  border: 1px solid;
  border-radius: 0;
  font-size: 1rem;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: background-color 200ms var(--ease), color 200ms var(--ease), border-color 200ms var(--ease);
}

/* Заливка при наведении и фокусе: слой под текстом кнопки растёт слева направо.
   Он лежит внутри рамки и ниже содержимого, поэтому подпись всегда остаётся поверх. */
.btn::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: -1;
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 200ms var(--ease);
}

.btn--compact {
  height: 44px;
  padding: 0 20px;
}

.btn--block {
  display: flex;
  width: 100%;
}

.btn--primary {
  background-color: #212146;
  border-color: #212146;
  color: #ffffff;
}

.btn--primary::before {
  background-color: #ffffff;
}

.btn--outline {
  background-color: transparent;
  border-color: #212146;
  color: #212146;
}

.btn--outline::before {
  background-color: #212146;
}

@media (hover: hover) {
  .btn:hover::before {
    transform: none;
  }

  .btn--primary:hover {
    color: #212146;
  }

  .btn--outline:hover {
    color: #ffffff;
  }
}

.btn:focus-visible::before {
  transform: none;
}

.btn--primary:focus-visible {
  color: #212146;
}

.btn--outline:focus-visible {
  color: #ffffff;
}

.btn--primary:active {
  border-color: #5353a5;
  color: #ffffff;
}

.btn--primary:active::before {
  background-color: #5353a5;
  transform: none;
}

.btn--outline:active {
  border-color: #353572;
  color: #ffffff;
}

.btn--outline:active::before {
  background-color: #353572;
  transform: none;
}

.btn--primary[aria-disabled="true"] {
  background-color: #f5f5f9;
  border-color: #d0d0dc;
  color: #5a5a72;
  cursor: default;
}

.btn--primary[aria-disabled="true"]::before {
  transform: scaleX(0);
}

[data-open-menu],
[data-close-menu],
[data-close-request] {
  min-width: 112px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-top: 32px;
}

@media (min-width: 768px) {
  .actions {
    margin-top: 40px;
  }
}

/* ---------- Шапка ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #ffffff;
  border-bottom: 1px solid #d0d0dc;
}

.site-header__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
}

.logo {
  display: block;
  flex: none;
  margin-right: auto;
}

.logo img {
  width: auto;
  max-width: none;
  height: 56px;
}

.site-nav {
  display: none;
}

.site-nav ul {
  display: flex;
  gap: 0 32px;
}

.site-nav a {
  position: relative;
  display: flex;
  align-items: center;
  height: 88px;
  border-top: 2px solid transparent;
  border-bottom: 2px solid transparent;
  font-size: 1rem;
  line-height: 1;
  white-space: nowrap;
  color: #212146;
  transition: color 120ms linear;
}

/* Линия под текстом пункта: при наведении и фокусе растёт слева направо,
   у текущей страницы и у раздела, который сейчас на экране, стоит постоянно.
   Нижний край шапки оставлен полосе прогресса чтения. */
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: calc(50% + 14px);
  height: 2px;
  background: #5353a5;
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 250ms var(--ease);
}

@media (hover: hover) {
  .site-nav a:hover {
    color: #5353a5;
  }

  .site-nav a:hover::after {
    transform: none;
  }
}

.site-nav a:focus-visible::after {
  transform: none;
}

.site-nav a:active {
  color: #353572;
}

.site-nav a[aria-current]::after {
  transform: none;
}

/* Полоса прогресса чтения. Создаётся скриптом; длину (scaleX) задаёт доля прокрутки страницы. */
.site-header__progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: #5353a5;
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
}

.site-header__row > [data-open-request] {
  display: none;
  margin-left: 24px;
}

.site-header__row > [data-open-menu] {
  margin-left: 24px;
}

@media (min-width: 768px) {
  .site-header__row > [data-open-request] {
    display: inline-flex;
  }

  .site-header__row > [data-open-menu] {
    margin-left: 12px;
  }
}

@media (min-width: 1024px) {
  .site-header__row {
    height: 88px;
  }

  .logo img {
    height: 64px;
  }

  .site-nav {
    display: block;
    margin-left: 24px;
  }

  .site-header__row > [data-open-request] {
    margin-left: 40px;
  }

  .site-header__row > [data-open-menu] {
    display: none;
  }
}

/* ---------- Первый экран ---------- */

.hero {
  row-gap: 24px;
}

.hero__title,
.hero__body {
  grid-column: 1 / -1;
}

@media (min-width: 768px) {
  .hero {
    row-gap: 32px;
  }

  .hero__body {
    grid-column: 1 / span 7;
  }
}

@media (min-width: 1024px) {
  .hero {
    row-gap: 40px;
  }

  .hero__title {
    grid-column: 1 / span 10;
  }

  .hero__body {
    grid-column: 7 / span 6;
  }
}

/* ---------- Цифры ---------- */

.facts {
  margin-top: var(--gap-block);
  border-top: 1px solid var(--rule-strong);
}

.facts__row {
  display: flex;
  flex-direction: column-reverse;
  row-gap: 4px;
  padding-block: var(--row-y);
  border-bottom: 1px solid var(--rule-weak);
}

.facts dd {
  font-size: var(--fs-figure);
  line-height: 1;
  letter-spacing: -0.01em;
  font-variant-numeric: lining-nums tabular-nums;
  white-space: nowrap;
}

.facts dt {
  font-size: var(--fs-lead);
  line-height: 1.55;
  color: #5a5a72;
}

@media (min-width: 768px) {
  .facts__row {
    display: grid;
    grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
    column-gap: var(--gutter);
    row-gap: 0;
    align-items: baseline;
  }

  .facts dd {
    grid-row: 1;
    grid-column: 1 / span 3;
  }

  .facts dt {
    grid-row: 1;
    grid-column: 4 / span 5;
  }
}

@media (min-width: 1024px) {
  .facts dd {
    grid-column: 1 / span 6;
  }

  .facts dt {
    grid-column: 7 / span 6;
  }
}

/* ---------- Шапка секции ---------- */

.section-head {
  row-gap: 16px;
  align-items: start;
}

.section-head > * {
  grid-column: 1 / -1;
}

.section-head + * {
  margin-top: var(--gap-head);
}

@media (min-width: 768px) {
  .section-head > :last-child {
    grid-column: 1 / span 7;
  }
}

@media (min-width: 1024px) {
  .section-head > :first-child {
    grid-column: 1 / span 5;
  }

  .section-head > :last-child {
    grid-column: 7 / span 6;
  }
}

/* ---------- Реестр ---------- */

.registry {
  border-top: 1px solid var(--rule-strong);
}

.registry > * {
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  column-gap: var(--gutter);
  row-gap: 8px;
  padding-block: var(--row-y);
  border-bottom: 1px solid var(--rule-weak);
}

.registry > * > * {
  grid-column: 1 / -1;
}

.registry p {
  max-width: 38rem;
}

.registry--flush {
  border-top: 0;
}

.registry--flush > :first-child {
  padding-top: 0;
}

@media (min-width: 768px) {
  .registry > * {
    align-items: baseline;
  }

  .registry > * > :first-child {
    grid-column: 1 / span 3;
  }

  .registry > * > :last-child {
    grid-column: 4 / span 5;
  }
}

@media (min-width: 1024px) {
  .registry > * > :first-child {
    grid-column: 1 / span 5;
  }

  .registry > * > :last-child {
    grid-column: 7 / span 6;
  }
}

/* ---------- «Почему именно мы?»: номера и названия ---------- */

.why__list {
  counter-reset: why;
}

.why__list > li {
  counter-increment: why;
  row-gap: 12px;
}

.why__head {
  display: flex;
  align-items: baseline;
  gap: 16px;
}

.why__head::before {
  content: counter(why, decimal-leading-zero);
  font-size: var(--fs-h3);
  line-height: 1.3;
  white-space: nowrap;
  color: #5353a5;
}

/* ---------- Команда ---------- */

.team > li {
  row-gap: 0;
}

.team > li > .team__role {
  margin-top: 8px;
}

.team > li > .team__text {
  margin-top: 12px;
}

.team__mark {
  margin-top: 4px;
  font-size: 0.75rem;
  line-height: 1.4;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #5353a5;
}

@media (min-width: 768px) {
  .team > li > .team__name {
    grid-column: 1 / span 3;
    grid-row: 1 / span 2;
  }

  .team > li > .team__role {
    grid-column: 4 / span 5;
    grid-row: 1;
    margin-top: 0;
  }

  .team > li > .team__text {
    grid-column: 4 / span 5;
    grid-row: 2;
  }

  .team__mark {
    margin-top: 8px;
    font-size: 0.8125rem;
    letter-spacing: 0.16em;
  }
}

@media (min-width: 1024px) {
  .team > li > .team__name {
    grid-column: 1 / span 3;
    grid-row: 1;
  }

  .team > li > .team__role {
    grid-column: 4 / span 3;
  }

  .team > li > .team__text {
    grid-column: 7 / span 6;
    grid-row: 1;
    margin-top: 0;
  }
}

/* ---------- Колоночный блок ---------- */

@media (min-width: 1200px) {
  .columns {
    display: grid;
    column-gap: var(--gutter);
    border-top: 0;
  }

  .columns--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .columns--4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .columns > li {
    display: block;
    padding: 24px 0 0;
    border-bottom: 0;
    border-top: 1px solid var(--rule-strong);
  }

  .columns--flush > li {
    padding-top: 0;
    border-top: 0;
  }

  .columns > li > p {
    margin-top: 12px;
  }

  .why__head {
    display: block;
  }

  .why__head::before {
    display: block;
    margin-bottom: 24px;
    font-size: var(--fs-figure);
    line-height: 1;
    letter-spacing: -0.01em;
  }
}

/* ---------- Отклик строк на наведение и фокус ---------- */

/* Строки услуг, преимуществ, команды, цифр и контактов; отдельно блок «Почему именно мы?».
   Маркер 2 px растёт слева направо поверх верхней линейки строки. Он стоит вне потока,
   поэтому высота строки и сами линейки не меняются. */
.registry:not(.columns) > *,
.facts__row,
.why__list > li {
  position: relative;
}

.registry:not(.columns) > *::before,
.facts__row::before,
.why__list > li::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -1px;
  height: 2px;
  background: var(--label);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 250ms var(--ease);
  pointer-events: none;
}

/* У первой строки перечня «под меткой» верхней линейки нет:
   маркер встаёт на её место, на расстоянии поля строки от текста. */
.registry--flush > :first-child::before {
  top: calc(-1px - var(--row-y));
}

@media (min-width: 1200px) {
  .columns--flush > li::before {
    top: calc(-1px - var(--row-y));
  }
}

/* Название строки (в цифрах это само число) сдвигается вправо на 8 px. */
.registry:not(.columns) > * > :first-child,
.facts__row > dd {
  transition: transform 250ms var(--ease);
}

.why__list > li {
  transition: opacity 250ms var(--ease);
}

@media (hover: hover) {
  .registry:not(.columns) > *:hover::before,
  .facts__row:hover::before,
  .why__list > li:hover::before {
    transform: none;
  }

  .registry:not(.columns) > *:hover > :first-child,
  .facts__row:hover > dd {
    transform: translateX(8px);
  }

  /* Наведением считается только сама колонка, а не промежуток между колонками. */
  .why__list {
    pointer-events: none;
  }

  .why__list > li {
    pointer-events: auto;
  }

  .why__list:hover > li:not(:hover) {
    opacity: 0.55;
  }
}

.registry:not(.columns) > *:focus-within::before,
.why__list > li:focus-within::before {
  transform: none;
}

.registry:not(.columns) > *:focus-within > :first-child {
  transform: translateX(8px);
}

.why__list:focus-within > li:not(:focus-within) {
  opacity: 0.55;
}

/* ---------- Призыв ---------- */

.cta {
  row-gap: 24px;
  align-items: start;
}

.cta > * {
  grid-column: 1 / -1;
}

.cta__action {
  justify-self: start;
}

@media (min-width: 768px) {
  .cta {
    row-gap: 32px;
  }

  .cta__body {
    grid-column: 1 / span 7;
  }
}

@media (min-width: 1024px) {
  .cta__title {
    grid-column: 1 / span 5;
  }

  .cta__body,
  .cta__action {
    grid-column: 7 / span 6;
  }
}

/* ---------- Подвал ---------- */

.site-footer {
  padding-bottom: 24px;
}

.contacts dt {
  color: #c1c1cb;
}

.contacts dd {
  font-size: var(--fs-h3);
  line-height: 1.3;
}

/* Поля со встречным отрицательным отступом дают зону нажатия не меньше 44 px, не меняя высоту строки. */
.contacts a {
  display: inline-block;
  margin-block: -12px;
  padding-block: 12px;
  color: #ffffff;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: #c1c1cb;
  text-underline-offset: 0.25em;
  overflow-wrap: anywhere;
}

@media (hover: hover) {
  .contacts a:hover {
    text-decoration-thickness: 2px;
    text-decoration-color: #ffffff;
  }
}

.contacts a:active {
  text-decoration-thickness: 2px;
  text-decoration-color: #ffffff;
}

.site-footer__bottom {
  margin-top: var(--gap-block);
  row-gap: 40px;
  align-items: start;
}

.site-footer__bottom > * {
  grid-column: 1 / -1;
}

.site-footer__logo {
  width: 240px;
  max-width: none;
  height: auto;
}

.site-footer__nav li {
  display: flex;
}

.site-footer__nav a {
  display: flex;
  align-items: center;
  height: 44px;
  color: #c1c1cb;
  text-underline-offset: 0.25em;
  transition: color 120ms linear;
}

@media (hover: hover) {
  .site-footer__nav a:hover {
    color: #ffffff;
    text-decoration-line: underline;
    text-decoration-thickness: 1px;
  }
}

.site-footer__nav a:active {
  color: #ffffff;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
}

.site-footer__copy {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--rule-weak);
  font-size: 0.875rem;
  line-height: 1.5;
  color: #c1c1cb;
}

@media (min-width: 768px) {
  .site-footer__copy {
    margin-top: 48px;
  }
}

@media (min-width: 1024px) {
  .site-footer__logo {
    grid-column: 1 / span 6;
  }

  .site-footer__nav {
    grid-column: 7 / span 6;
  }

  .site-footer__copy {
    margin-top: 64px;
  }
}

/* ---------- Кнопка «Наверх» ---------- */

/* Создаётся скриптом. Лежит ниже шапки (z-index 100) и ниже диалогов (верхний слой).
   Фон белый: кнопка проходит над светлыми и тёмными полосами.
   --lift задаёт скрипт: в самом низу страницы кнопка поднимается над строкой копирайта.
   Пока нет класса is-visible, кнопка не видна, не нажимается и не получает фокус.
   На узком экране скрипт снимает этот класс рядом с логотипом подвала: кнопка не заходит в его поле. */
.to-top {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 90;
  background-color: #ffffff;
  opacity: 0;
  visibility: hidden;
  transform: translateY(calc(0px - var(--lift, 0px)));
  transition: opacity 200ms ease-out, visibility 0s linear 200ms, color 200ms var(--ease), border-color 200ms var(--ease);
}

@keyframes to-top-in {
  from {
    transform: translateY(calc(8px - var(--lift, 0px)));
  }
}

.to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
  animation: to-top-in 200ms ease-out;
}

/* Обводка фокуса внутри кнопки: она видна на любой полосе, над которой кнопка окажется. */
.to-top:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: -6px;
}

/* Залитая кнопка того же цвета, что тёмная полоса: белая рамка сохраняет её очертания над такой полосой. */
@media (hover: hover) {
  .to-top:hover {
    border-color: #ffffff;
  }
}

.to-top:focus-visible,
.to-top:active {
  border-color: #ffffff;
}

@media (min-width: 768px) {
  .to-top {
    right: 24px;
    bottom: 24px;
  }
}

/* ---------- Меню (S и M) ---------- */

.menu {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  border: 0;
  padding: 0;
  background: #ffffff;
  color: #212146;
  overflow-y: auto;
}

.menu::backdrop {
  background: #ffffff;
}

.menu__bar {
  border-bottom: 1px solid #d0d0dc;
}

.menu__bar-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 80px;
}

.menu__body {
  padding-block: 32px 40px;
}

.menu__list {
  border-top: 1px solid #212146;
}

.menu__list li {
  border-bottom: 1px solid #d0d0dc;
}

.menu__list a {
  display: flex;
  align-items: center;
  min-height: 64px;
  font-size: var(--fs-h3);
  line-height: 1.3;
  color: #212146;
  transition: color 120ms linear;
}

@media (hover: hover) {
  .menu__list a:hover {
    color: #5353a5;
  }
}

.menu__list a:active {
  color: #353572;
}

.menu__list a[aria-current="page"] {
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: #5353a5;
  text-underline-offset: 0.25em;
}

.menu__body > .btn {
  margin-top: 32px;
}

/* ---------- Панель заявки ---------- */

.panel {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(100%, 480px);
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  border: 0;
  padding: 0;
  background: #ffffff;
  color: #212146;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.panel::backdrop {
  background: rgba(33, 33, 70, 0.6);
}

.panel__inner {
  box-sizing: border-box;
  min-height: 100%;
  padding: 0 20px 32px;
}

@media (min-width: 768px) {
  .panel__inner {
    padding: 0 40px 40px;
  }
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
}

@keyframes backdrop-in {
  from {
    opacity: 0;
  }
}

.panel[open] {
  animation: panel-in 200ms ease-out;
}

.panel[open]::backdrop {
  animation: backdrop-in 200ms ease-out;
}

.panel__bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 80px;
}

@media (min-width: 1024px) {
  .panel__bar {
    height: 88px;
  }
}

.panel__title {
  margin-top: 16px;
  font-size: 2rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.request-form {
  margin-top: 32px;
}

.field + .field {
  margin-top: 24px;
}

.field label {
  display: block;
  font-size: 0.875rem;
  line-height: 1.4;
}

.field input {
  display: block;
  width: 100%;
  height: 52px;
  margin-top: 8px;
  padding: 0 16px;
  border: 1px solid #8a8aa0;
  border-radius: 0;
  background-color: #ffffff;
  font-size: 1rem;
  line-height: 1.5;
  color: #212146;
  -webkit-appearance: none;
  appearance: none;
}

@media (hover: hover) {
  .field input:hover {
    border-color: #212146;
  }
}

.field input:focus-visible {
  border-color: #212146;
  outline: 2px solid #5353a5;
  outline-offset: 2px;
}

.field input[aria-invalid="true"] {
  border-color: #212146;
  border-left-width: 4px;
  padding-left: 13px;
}

.field input[readonly] {
  background-color: #f5f5f9;
  border-color: #d0d0dc;
  color: #5a5a72;
}

/* Сплошная внутренняя заливка без смещения и размытия: единственный способ перекрыть цвет автозаполнения. */
.field input:autofill {
  -webkit-text-fill-color: #212146;
  box-shadow: 0 0 0 100px #ffffff inset;
  filter: none;
}

.field input:-webkit-autofill {
  -webkit-text-fill-color: #212146;
  box-shadow: 0 0 0 100px #ffffff inset;
  filter: none;
}

.field__error,
.request-form__alert {
  font-size: 0.875rem;
  line-height: 1.4;
  color: #212146;
}

.field__error:not(:empty) {
  margin-top: 8px;
}

.request-form__alert:not(:empty) {
  margin-top: 40px;
}

.request-form__alert a {
  color: #212146;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: #5353a5;
  text-underline-offset: 0.25em;
  overflow-wrap: anywhere;
  transition: color 120ms linear;
}

@media (hover: hover) {
  .request-form__alert a:hover {
    color: #5353a5;
  }
}

.request-form__alert a:active {
  color: #353572;
}

.request-form .btn {
  margin-top: 40px;
}

.request-form__alert:not(:empty) + .btn {
  margin-top: 16px;
}

.request-form__consent {
  margin-top: 16px;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #212146;
}

.request-done {
  margin-top: 16px;
}

.request-done p {
  font-size: var(--fs-lead);
  line-height: 1.55;
  color: #212146;
}

.request-done .btn {
  margin-top: 40px;
}

/* ---------- Появление: первый экран при загрузке ---------- */

/* Анимации с заполнением «до начала»: начальное состояние действует с первой отрисовки,
   конечное совпадает с обычным видом, поэтому содержимое видно и в том случае,
   если скрипт не загрузился. Движутся только transform и opacity, раскладка не меняется. */
@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

@keyframes draw-line {
  from {
    transform: scaleX(0);
  }
}

html.js #top .rule-label::after {
  animation: draw-line 600ms var(--ease) both;
}

html.js .hero__title {
  animation: rise-in 500ms var(--ease) 100ms both;
}

html.js .hero__body {
  animation: rise-in 500ms var(--ease) 220ms both;
}

/* Строки цифр идут следом. Здесь заполнение только «до начала» (backwards):
   после анимации число должно свободно сдвигаться при наведении. */
html.js .facts__row > * {
  animation: rise-in 450ms var(--ease) 340ms backwards;
}

html.js .facts__row:nth-child(2) > * {
  animation-delay: 400ms;
}

html.js .facts__row:nth-child(3) > * {
  animation-delay: 460ms;
}

html.js .facts__row:nth-child(n + 4) > * {
  animation-delay: 520ms;
}

/* ---------- Появление при прокрутке ---------- */

/* Классы reveal--* ставит скрипт и только тем блокам, которые при загрузке лежат ниже окна.
   Без скрипта и без IntersectionObserver этих классов нет, и ничего не скрыто.
   У строк движется содержимое, а не сама строка: линейки стоят на месте. */
html.js .reveal--line:not(.is-in)::after {
  transform: scaleX(0);
}

html.js .reveal--self:not(.is-in),
html.js .reveal--row:not(.is-in) > * {
  opacity: 0;
  animation: none;
}

html.js .reveal--line.is-in::after {
  animation: draw-line 600ms var(--ease) var(--step, 0ms) backwards;
}

html.js .reveal--self.is-in,
html.js .reveal--row.is-in > * {
  animation: rise-in 450ms var(--ease) var(--step, 0ms) backwards;
}

/* Очередь появления: шаг 60 мс, не больше шести ступеней (от 0 до 300 мс). */
.step-1 {
  --step: 60ms;
}

.step-2 {
  --step: 120ms;
}

.step-3 {
  --step: 180ms;
}

.step-4 {
  --step: 240ms;
}

.step-5 {
  --step: 300ms;
}

/* ---------- Без JS ---------- */

html.no-js [data-open-menu],
html.no-js [data-open-request] {
  display: none !important;
}

.no-js .cta .actions {
  display: none;
}

.no-js .site-header {
  position: static;
}

.no-js .site-header__row {
  flex-wrap: wrap;
  height: auto;
}

.no-js .logo {
  margin-block: 12px;
}

.no-js .site-nav {
  display: block;
  flex: 0 0 100%;
}

.no-js .site-nav ul {
  flex-wrap: wrap;
  gap: 0 24px;
}

.no-js .site-nav a {
  height: 44px;
}

@media (min-width: 1024px) {
  .no-js .site-header {
    position: sticky;
  }

  .no-js .site-header__row {
    flex-wrap: nowrap;
    height: 88px;
  }

  .no-js .logo {
    margin-block: 0;
  }

  .no-js .site-nav {
    flex: 0 1 auto;
  }

  .no-js .site-nav ul {
    flex-wrap: nowrap;
    gap: 0 32px;
  }

  .no-js .site-nav a {
    height: 88px;
  }
}

/* ---------- Низкое окно: шапка не закреплена ---------- */

@media (max-height: 499px) {
  html {
    scroll-padding-top: 24px;
  }

  .site-header,
  .no-js .site-header {
    position: static;
  }

  /* Шапка не закреплена, значит и полосе прогресса у её края места нет. */
  .site-header__progress {
    display: none;
  }
}

/* ---------- Движение ---------- */

/* Движение ограничено в системе: переходов и анимаций нет, плавной прокрутки нет (см. html выше),
   счётчики и появление скрипт не запускает. Состояния наведения, полоса прогресса
   и отметка текущего раздела остаются, но меняются мгновенно. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after,
  *::backdrop {
    transition: none !important;
    animation: none !important;
  }
}

/* Страховка: при ограниченном движении и при печати помеченные блоки видны всегда. */
@media print, (prefers-reduced-motion: reduce) {
  html.js .reveal--line::after {
    transform: none !important;
  }

  html.js .reveal--self,
  html.js .reveal--row > * {
    opacity: 1 !important;
  }
}

@media print {
  .site-header__progress,
  .to-top {
    display: none;
  }
}
