/* ===================================
   Инструкция «Как установить Dictator на Mac» (/mac-install/, /en/mac-install/).
   Просьба владельца 09.10.2026: коротко, без воды, каждый шаг объясняет
   картинка. Картинки — нарисованные здесь окна macOS с нашей иконкой
   (.mi-mock), а не снимки чужих инструкций. Движение только у курсора,
   переключателя и набираемого текста, и его нет при reduced-motion.
   Подключается после lp.css и берёт его переменные.
   =================================== */

.mi-read {
  max-width: 880px;
  margin: 0 auto;
}

.mi-hero {
  padding: 48px 0 10px;
  text-align: center;
}

.mi-hero h1 {
  margin-bottom: 10px;
}

.mi-hero .lp-sub {
  margin-left: auto;
  margin-right: auto;
}

.mi-hero .lp-cta-row,
.mi-hero .lp-under-cta {
  justify-content: center;
}

/* ---------- Шаги ---------- */

.mi-steps {
  display: grid;
  gap: 18px;
  margin: 34px 0 0;
  padding: 0;
  list-style: none;
}

.mi-card {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  padding: 22px;
  border: 1px solid var(--lp-border);
  border-radius: 20px;
  background: var(--lp-card);
  scroll-margin-top: 24px;
}

.mi-text {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 12px;
}

.mi-text p {
  grid-column: 1 / -1;
}

.mi-text h2 {
  margin: 0;
  font-size: 1.6rem;
  line-height: 1.2;
}

.mi-text p {
  margin: 0;
  margin-top: 10px;
  color: var(--lp-text-soft);
  font-size: 17px;
  line-height: 1.55;
}

.mi-text b {
  color: var(--lp-text);
}

.mi-num {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--lp-accent), var(--lp-accent-deep));
  color: #04121a;
  font-size: 17px;
  font-weight: 800;
}

kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 1px 7px;
  border: 1px solid var(--lp-border-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--lp-text);
  font-family: inherit;
  font-size: 0.9em;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
  white-space: nowrap;
}

.mi-after {
  margin: 22px 0 0;
  color: var(--lp-text-muted);
  font-size: 15.5px;
  text-align: center;
}

.mi-help {
  padding-top: 34px;
  scroll-margin-top: 24px;
}

.mi-help h2 {
  margin-bottom: 12px;
  font-size: 1.4rem;
}

.mi-help p b {
  color: var(--lp-text);
}

.mi-help-note {
  margin: 0 0 14px;
  font-size: 0.95rem;
  color: var(--lp-text-soft);
}

/* ---------- Нарисованные окна macOS ---------- */

.mi-mock {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: 22px;
  border-radius: 16px;
  background:
    radial-gradient(120% 90% at 20% 0%, rgba(124, 58, 237, 0.35), transparent 60%),
    radial-gradient(120% 90% at 100% 100%, rgba(18, 214, 223, 0.25), transparent 60%),
    #0d1422;
  overflow: hidden;
}

.mm-window {
  width: 100%;
  max-width: 320px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: #1e2230;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.mm-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  background: #2a2f3d;
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
}

.mm-bar i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff5f57;
}

.mm-bar i:nth-child(2) {
  background: #febc2e;
}

.mm-bar i:nth-child(3) {
  background: #28c840;
}

.mm-bar span {
  flex: 1;
  margin-right: 46px;
  text-align: center;
}

.mm-body {
  position: relative;
  padding: 18px;
}

.mm-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.mm-btn {
  padding: 4px 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.mm-btn-main {
  background: #0a84ff;
}

/* Шаг 1: файл в «Загрузках» */

.mm-files {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-height: 130px;
}

.mm-pkg {
  display: grid;
  justify-items: center;
  gap: 8px;
  color: #fff;
  font-size: 13px;
}

.mm-pkg-box {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 10px;
  background: linear-gradient(160deg, #c9a46c, #8b6a3e);
  box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.15);
}

.mm-pkg-box img {
  border-radius: 9px;
}

.mm-arrow {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #0a84ff;
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  animation: mm-bounce 1.6s ease-in-out infinite;
}

@keyframes mm-bounce {
  0%, 100% { transform: translateY(-4px); }
  50% { transform: translateY(5px); }
}

/* Шаг 2: установщик */

.mm-installer {
  display: grid;
  justify-items: center;
  gap: 14px;
}

.mm-app {
  border-radius: 13px;
}

.mm-lines {
  display: grid;
  justify-items: center;
  gap: 6px;
  width: 100%;
}

.mm-lines b {
  display: block;
  width: 80%;
  height: 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.14);
}

.mm-lines b:nth-child(2) {
  width: 64%;
}

.mm-lines b:nth-child(3) {
  width: 48%;
}

.mm-installer .mm-buttons {
  justify-self: stretch;
}

.mm-installer .mm-btn-main {
  animation: mm-press 3.2s ease-in-out infinite;
}

/* Курсор: стрелка, которая подъезжает к «Продолжить» и нажимает. */
.mm-cursor {
  position: absolute;
  right: 26px;
  bottom: 6px;
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 18px solid #fff;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.6));
  transform: rotate(-28deg);
  animation: mm-cursor 3.2s ease-in-out infinite;
}

@keyframes mm-cursor {
  0% { transform: translate(-70px, 40px) rotate(-28deg); opacity: 0; }
  20% { opacity: 1; }
  50%, 62% { transform: translate(0, 0) rotate(-28deg); }
  56% { transform: translate(0, 2px) rotate(-28deg) scale(0.9); }
  100% { transform: translate(0, 0) rotate(-28deg); opacity: 1; }
}

@keyframes mm-press {
  0%, 52%, 64%, 100% { filter: none; }
  56% { filter: brightness(0.8); box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.35); }
}

/* Шаг 3: окно macOS и переключатель */

.mi-mock-access {
  gap: 14px;
}

.mm-alert {
  display: grid;
  justify-items: center;
  gap: 10px;
  width: 100%;
  max-width: 250px;
  padding: 16px 14px 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background: #2a2f3d;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  color: #fff;
  text-align: center;
}

.mm-alert img {
  border-radius: 8px;
}

.mm-alert p {
  margin: 0;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.35;
}

.mm-alert .mm-buttons {
  justify-content: center;
}

.mm-alert .mm-btn-main {
  animation: mm-press 3.2s ease-in-out infinite;
}

.mm-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 250px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: #1e2230;
  color: #fff;
  font-size: 13px;
}

.mm-row img {
  border-radius: 6px;
}

.mm-row span:first-of-type {
  flex: 1;
}

.mm-toggle {
  position: relative;
  width: 34px;
  height: 20px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.22);
  animation: mm-toggle-track 3.2s ease-in-out infinite;
}

.mm-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  animation: mm-toggle-knob 3.2s ease-in-out infinite;
}

@keyframes mm-toggle-track {
  0%, 40% { background: rgba(255, 255, 255, 0.22); }
  55%, 100% { background: #28c840; }
}

@keyframes mm-toggle-knob {
  0%, 40% { transform: translateX(0); }
  55%, 100% { transform: translateX(14px); }
}

/* Шаг 4: строка меню, клавиши, текст в поле */

.mi-mock-speak {
  align-content: start;
  gap: 18px;
  padding-top: 0;
}

.mm-menubar {
  display: flex;
  align-items: center;
  gap: 12px;
  width: calc(100% + 44px);
  height: 26px;
  margin: 0 -22px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 12px;
}

.mm-apple {
  font-weight: 700;
}

.mm-menubar-gap {
  flex: 1;
}

.mm-menubar img {
  border-radius: 4px;
  box-shadow: 0 0 0 3px rgba(18, 214, 223, 0.45);
}

.mm-keys {
  display: flex;
  gap: 8px;
}

.mm-keys kbd {
  min-width: 44px;
  padding: 6px 10px;
  border-radius: 9px;
  font-size: 20px;
  animation: mm-key 3.6s ease-in-out infinite;
}

@keyframes mm-key {
  0%, 8%, 100% { transform: none; background: rgba(255, 255, 255, 0.06); }
  4% { transform: translateY(2px); background: rgba(18, 214, 223, 0.35); }
}

.mm-field {
  width: 100%;
  max-width: 290px;
  min-height: 40px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: #1e2230;
  color: #fff;
  font-size: 14px;
  text-align: left;
}

/* Текст «набирается» слева направо: ширина растёт ступенями по буквам. */
.mm-typed {
  display: inline-block;
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  vertical-align: bottom;
  border-right: 2px solid var(--lp-accent);
  animation: mm-type 3.6s steps(26, end) infinite;
}

@keyframes mm-type {
  0%, 12% { max-width: 0; }
  60%, 100% { max-width: 100%; }
}

/* Без движения — сразу итоговое состояние. */
@media (prefers-reduced-motion: reduce) {
  .mm-arrow,
  .mm-cursor,
  .mm-installer .mm-btn-main,
  .mm-alert .mm-btn-main,
  .mm-toggle,
  .mm-toggle::after,
  .mm-keys kbd,
  .mm-typed {
    animation: none;
  }

  .mm-toggle {
    background: #28c840;
  }

  .mm-toggle::after {
    transform: translateX(14px);
  }

  .mm-typed {
    max-width: 100%;
  }

  .mm-cursor {
    display: none;
  }
}

@media (max-width: 720px) {
  .mi-hero {
    padding-top: 28px;
  }

  .mi-card {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 14px;
  }

  .mi-text h2 {
    font-size: 1.35rem;
  }

  .mi-text p {
    font-size: 16px;
  }

  .mi-mock {
    min-height: 190px;
  }
}
