/* ДВИЖОК format-choice · экран «Выберите режим обучения».
   Кадр наставника на всю ширину: лицо сверху, ладони вверх внизу.
   Заголовок экрана виден только диктору. На широком окне три кнопки стоят одним рядом
   над ладонями: крайние лежат на руках, наставник их протягивает.
   На телефоне кадр целиком, кнопки под ним столбцом. */

.format-choice {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.format-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
}
.format-stage {
  display: grid;
  gap: var(--space-16);
}
.format-art-wrap {
  min-width: 0;
  /* Края кадра растворяются в бумаге страницы со всех сторон: рамки у иллюстрации нет. */
  -webkit-mask-image: linear-gradient(to right, transparent, var(--ink) 14%, var(--ink) 86%, transparent),
    linear-gradient(to bottom, transparent, var(--ink) 16%, var(--ink) 96%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, var(--ink) 14%, var(--ink) 86%, transparent),
    linear-gradient(to bottom, transparent, var(--ink) 16%, var(--ink) 96%, transparent);
  mask-composite: intersect;
}
.format-art {
  display: block;
  width: 100%;
  height: auto;
}
.format-copy {
  min-width: 0;
}
.format-copy h1 {
  margin: 0 0 var(--space-18);
}
/* Широкое окно: кадр 16:9, три кнопки одним рядом над ладонями. Кадр и кнопки
   в одной ячейке, поэтому экран не растёт. Положение ряда — доли кадра 1280×720:
   ладони на высоте 84–95 %, их середины на 23 и 75 % ширины. Проценты отступа считаются
   от ширины кадра: 7 % ширины = 12,5 % высоты при 16:9. */
@media (min-width: 821px) {
  .format-stage {
    grid-template-areas: 'stage';
    position: relative;
    width: min(100%, calc((100svh - var(--header-h) - var(--space-28) - var(--space-24) - var(--space-16)) * 16 / 9));
    margin-inline: auto;
    aspect-ratio: 16 / 9;
  }
  .format-art-wrap,
  .format-copy {
    grid-area: stage;
  }
  .format-art {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
  }
  .format-copy {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    width: auto;
    height: 100%;
    justify-self: stretch;
    align-self: stretch;
    padding: 0 0 7%;
  }
  /* Ряд уже кадра: середины крайних карточек приходятся на ладони. */
  .format-copy .format-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: var(--space-14);
    width: 84%;
    margin-inline: auto;
  }
  .format-copy .format-option {
    gap: var(--space-12);
    padding: var(--space-16);
  }
  .format-options > li {
    display: flex;
  }
  .format-option {
    height: 100%;
  }
}
.format-options {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-18);
}
/* Кнопка режима — вся карточка. Нажатие вдавливает её в тень. */
.format-option {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: var(--space-18);
  padding: var(--space-18) var(--space-20);
  background: var(--surface);
  border: var(--border-frame) solid var(--ink);
  box-shadow: var(--shadow-button);
  color: var(--ink);
  text-align: left;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.format-option:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-button-hover);
}
.format-option:active {
  transform: translate(4px, 4px);
  box-shadow: var(--shadow-ink-sm);
}
.format-option:focus-visible {
  outline: var(--border-frame) solid var(--accent);
  outline-offset: var(--space-4);
}
.format-option-num {
  /* Высота плашки — строка заголовка: номер и название стоят на одной линии. */
  display: inline-flex;
  align-items: center;
  height: calc(var(--text-lead) * 1.2);
  padding: 0 var(--space-8);
  background: var(--accent);
  color: var(--ink-on-dark);
  font-family: var(--font-title);
  font-size: var(--text-caption);
  font-weight: var(--weight-bold);
  letter-spacing: 0.04em;
}
.format-option-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-width: 0;
}
.format-option-title {
  font-family: var(--font-title);
  font-size: var(--text-lead);
  font-weight: var(--weight-bold);
  line-height: 1.2;
}
.format-option-text {
  color: var(--muted);
  font-weight: var(--weight-regular);
  font-size: var(--text-body);
  line-height: 1.45;
}
.format-option-arrow {
  align-self: center;
  display: inline-flex;
  color: var(--accent);
}
.format-option-arrow svg {
  width: 22px;
  height: 22px;
}

@media (prefers-reduced-motion: reduce) {
  .format-option {
    transition: none;
  }
  .format-option:hover {
    transform: none;
  }
}

@media (max-width: 820px) {
  /* Телефон: кадр целиком над кнопками, лицо по центру. */
  .format-art-wrap {
    aspect-ratio: 16 / 9;
  }
  .format-art {
    height: 100%;
    object-fit: cover;
    object-position: center center;
  }
  .format-option {
    gap: var(--space-12);
    padding: var(--space-14) var(--space-16);
  }
}
