/* Manual page — построено на токенах и базе ../css/style.css */

/* Hero */

.m-hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: 128px var(--gutter) 48px;
}

.m-hero__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
}

.m-hero__back {
  color: var(--muted);
  transition: color 0.2s ease;
  white-space: nowrap;
}

.m-hero__back:hover {
  color: var(--ink);
}

.m-hero__title {
  margin: 28px 0 20px;
  font-size: clamp(3.4rem, 11vw, 10rem);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.055em;
  user-select: none;
}

.m-hero__lead {
  max-width: 540px;
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  line-height: 1.5;
  color: var(--ink);
  text-wrap: pretty;
}

.m-toc {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: clamp(40px, 6vw, 72px);
  border: 1px solid var(--line);
  background: var(--line);
}

.m-toc a {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 22px 24px;
  background: var(--paper);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}

.m-toc a .mono {
  color: var(--faint);
  transition: color 0.3s var(--ease);
}

.m-toc a:hover {
  background: var(--ink);
  color: var(--paper);
}

.m-toc a:last-child {
  grid-column: 2 / -1;
}

/* Steps */

.m-steps {
  border-top: 1px solid var(--line);
}

.m-step {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  padding: 32px 0;
  border-bottom: 1px solid var(--line);
}

.m-step__num {
  padding-top: 0.45em;
  color: var(--faint);
  letter-spacing: 0.1em;
}

.m-step__title {
  margin-bottom: 10px;
  font-size: clamp(1.3rem, 2vw, 1.8rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.m-step__text {
  max-width: 640px;
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--muted);
  text-wrap: pretty;
}

.m-step__text strong {
  color: var(--ink);
  font-weight: 600;
}

.m-step__text--after {
  margin-top: 12px;
}

.m-link {
  color: var(--ink);
  border-bottom: 1px solid var(--line-strong);
  transition: border-color 0.2s ease;
}

.m-link:hover {
  border-color: var(--ink);
}

/* Скриншот */

.m-shot {
  max-width: 400px;
  margin: 24px 0 0;
  border: 1px solid var(--line-strong);
}

.m-shot img {
  width: 100%;
  height: auto;
}

.m-shot figcaption {
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  color: var(--faint);
}

/* Адрес провайдера */

.m-code {
  display: inline-block;
  margin: 14px 0 0;
  padding: 10px 16px;
  border: 1px solid var(--line-strong);
  background: #fafafa;
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.01em;
  user-select: all;
}

/* Модели для старта */

.m-models {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.m-model {
  padding: 9px 14px;
  border: 1px solid var(--line-strong);
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

/* Statements и сетки */

.m-statement {
  max-width: 900px;
  font-size: clamp(1.6rem, 3.2vw, 2.8rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.m-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: clamp(32px, 5vw, 56px);
  border: 1px solid var(--line);
  background: var(--line);
}

.m-grid__item {
  padding: 28px;
  background: var(--paper);
}

.m-grid__key {
  margin-bottom: 10px;
  color: var(--faint);
  letter-spacing: 0.1em;
}

.m-grid__text {
  max-width: 340px;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--muted);
  text-wrap: pretty;
}

.m-expand {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: start;
  margin-top: clamp(32px, 5vw, 64px);
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

.m-expand__title {
  font-size: clamp(1.3rem, 2vw, 1.8rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.m-expand__text {
  max-width: 480px;
  margin-top: 12px;
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--muted);
  text-wrap: pretty;
}

.m-expand__list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 6px;
}

.m-expand__list li {
  padding: 9px 14px;
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.m-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(24px, 4vw, 64px);
  margin-top: clamp(32px, 5vw, 56px);
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.m-cols p {
  max-width: 460px;
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--muted);
  text-wrap: pretty;
}

/* Интерфейс */

.m-ui {
  border-top: 1px solid var(--line);
}

.m-ui__row {
  display: grid;
  grid-template-columns: 84px minmax(200px, 320px) minmax(0, 1fr);
  gap: 24px;
  align-items: baseline;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}

.m-ui__num {
  color: var(--faint);
  letter-spacing: 0.1em;
}

.m-ui__title {
  font-size: clamp(1.3rem, 2vw, 1.7rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.m-ui__text {
  max-width: 640px;
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--muted);
  text-wrap: pretty;
}

/* Первые задачи */

.m-asks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
}

.m-ask {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 190px;
  padding: 28px;
  background: var(--paper);
}

.m-ask__label {
  color: var(--faint);
  letter-spacing: 0.1em;
}

.m-ask__text {
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.m-ask__hint {
  margin-top: auto;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--muted);
  text-wrap: pretty;
}

/* Финальный блок */

.m-final {
  padding: clamp(72px, 10vw, 144px) max(var(--gutter), calc((100% - var(--max)) / 2 + var(--gutter)));
  background: var(--ink);
  color: var(--paper);
}

.m-final .index {
  color: var(--faint);
}

.m-final__title {
  margin: 28px 0 24px;
  font-size: clamp(2.8rem, 7vw, 6.5rem);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.055em;
}

.m-final__text {
  max-width: 460px;
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  line-height: 1.5;
  color: #b9b9b9;
  text-wrap: pretty;
}

.m-final__actions {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: clamp(32px, 5vw, 48px);
  flex-wrap: wrap;
}

.m-final__back {
  color: var(--paper);
  border-bottom-color: #555;
}

.m-final__back:hover {
  color: var(--paper);
  border-bottom-color: var(--paper);
}

/* Responsive */

@media (max-width: 900px) {
  .m-hero {
    padding-top: 104px;
  }

  .m-toc {
    grid-template-columns: 1fr;
  }

  .m-step {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .m-ui__row {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .m-ui__text {
    grid-column: 2;
  }

  .m-grid {
    grid-template-columns: 1fr;
  }

  .m-expand {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .m-cols {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .m-asks {
    grid-template-columns: 1fr;
  }

  .m-ask {
    min-height: 0;
  }
}

@media (max-width: 640px) {
  .m-hero__top {
    flex-direction: column;
    gap: 12px;
  }

  .m-step {
    row-gap: 10px;
    padding: 24px 0;
  }

  .m-shot {
    max-width: 100%;
  }

  .m-final__actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
}
