/* Токены вида школы одним модулем (приказ 236 п. 1, П3): шрифты макета и цвета `--tg-theme-*` с запасными, светлая и
   тёмная тема. Берут Mini App (`worker/miniapp_css.ts`: токены и компоненты `worker/miniapp.css`) и сборка комнаты урока
   и тетради (`board/room2.css`, `board/board.css` через `@import`). Второго набора токенов нет.
   Тёмная тема по `prefers-color-scheme`, `data-theme="dark"` (тема Telegram, `applyTgTheme`) или `data-tg="dark"`. */
@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/static/golos-text-cyrillic.woff2) format("woff2"); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/static/golos-text-latin.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Unbounded"; font-style: normal; font-weight: 500 700; font-display: swap; src: url(/static/unbounded-cyrillic.woff2) format("woff2"); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: "Unbounded"; font-style: normal; font-weight: 500 700; font-display: swap; src: url(/static/unbounded-latin.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
:root {
  --tg-theme-bg-color: #FFFFFF;
  --tg-theme-secondary-bg-color: #F2F1F5;
  --tg-theme-section-bg-color: #FFFFFF;
  --tg-theme-text-color: #121014;
  --tg-theme-hint-color: #6F6876;
  --tg-theme-subtitle-text-color: #69626F;
  --tg-theme-section-header-text-color: #6F6876;
  --tg-theme-link-color: #C2275A;
  --tg-theme-button-color: #D12C62;
  --tg-theme-button-text-color: #FFFFFF;
  --tg-theme-accent-text-color: #C2275A;
  --tg-theme-section-separator-color: #E4E1E8;
  --tg-theme-bottom-bar-bg-color: #F2F1F5;
  --accent: #D12C62;
  --on-accent: #FFFFFF;
  --accent-ink: #C2275A;
  --school-tint: #FBE4EC;
  --school-chip: #E8E6EC;
  --school-success: #167A46;
  --school-success-soft: #E0F3E8;
  --school-hero: #C8255A;
  --school-hero-2: #E9517F;
  --school-on-hero: #FFFFFF;
  --school-on-hero-soft: rgba(255, 255, 255, .2);
  --av-bg: #F7BCD0;
  --av-fg: #6A1232;
  /* приказ 123 (ДИЗАЙН_СИСТЕМА_362 р. 1.1): «опасно» (Telegram destructive_text_color), «ждёт» (жёлтая пара аватара 098),
     три пары аватаров 098; новых цветов нет, только имена */
  --tg-theme-destructive-text-color: #C62828;
  --av1-bg: #F6D58C; --av1-fg: #5A3B00;
  --av2-bg: #F7BCD0; --av2-fg: #6A1232;
  --av3-bg: #A9E0D6; --av3-fg: #0D4A41;
  --school-warn-soft: var(--av1-bg);
  --school-warn: var(--av1-fg);
  --school-danger-soft: color-mix(in srgb, var(--tg-theme-destructive-text-color) 14%, transparent);
  --shadow: rgba(48, 20, 40, .20);
  /* приказ 128 (ДИЗАЙН_СИСТЕМА_362 р. 1.1, компонент 15): тост */
  --school-toast-bg: rgba(24, 20, 28, .9);
  --school-toast-fg: #FFFFFF;
  --font-display: "Unbounded", "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Golos Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* приказ 263 п. 4: безопасные отступы: система (вырез, полоса «Домой») и поверх неё элементы Telegram в полноэкранном
     режиме (Bot API 8.0: `safeAreaInset` и `contentSafeAreaInset`, переменные `--tg-safe-area-inset-*`,
     `--tg-content-safe-area-inset-*`); без Telegram только `env()` */
  --safe-top: calc(max(env(safe-area-inset-top, 0px), var(--tg-safe-area-inset-top, 0px)) + var(--tg-content-safe-area-inset-top, 0px));
  --safe-bottom: calc(max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px)) + var(--tg-content-safe-area-inset-bottom, 0px));
  --safe-left: calc(max(env(safe-area-inset-left, 0px), var(--tg-safe-area-inset-left, 0px)) + var(--tg-content-safe-area-inset-left, 0px));
  --safe-right: calc(max(env(safe-area-inset-right, 0px), var(--tg-safe-area-inset-right, 0px)) + var(--tg-content-safe-area-inset-right, 0px));
  color-scheme: light;
}


:root {
  --school-dark: #1A171D;
  --school-dark-text: #F4F1F6;
  --school-dark-hint: #ABA4B1;
  --school-dark-line: #2D2931;
  --school-dark-accent: #FF86AC;
}

/* Сайт школы (приказ 020, вид приказ 324 п. 10): дизайн-система 362 (prikazy/362-vlozheniya/ДИЗАЙН_СИСТЕМА_362.md), как
   Mini App: Unbounded в заголовках, Golos Text в тексте, акцент #D12C62 с белым текстом на нём, фон и чернила 362.
   Один источник токенов: `worker/school_tokens.css` (светлая тема, `SITE_CSS` в worker/site_static.ts берёт его первым);
   ниже только имена ролей сайта на эти токены, своих цветов нет. Телефон первым; цели касания от 44 px; движение только
   transform и opacity до 300 мс. Внешних адресов нет. Было (приказы 020, 023): Onest, жёлтая кнопка, крем и индиго. */

:root {
  --ink: var(--tg-theme-text-color);
  --ink-2: var(--tg-theme-subtitle-text-color);
  --h1-gray: var(--accent-ink);
  --nav: var(--tg-theme-text-color);
  --tile: var(--tg-theme-secondary-bg-color);
  --line: var(--tg-theme-section-separator-color);
  --ring: var(--tg-theme-section-separator-color);
  --dark: var(--school-dark);
  --dark-text: var(--school-dark-text);
  --dark-2: var(--school-dark-hint);
  --dark-line: var(--school-dark-line);
  --btn: var(--accent);
  --btn-text: var(--on-accent);
  --canvas: var(--tg-theme-bg-color);
  --link-on-dark: var(--school-dark-text);
  --focus: var(--tg-theme-text-color);
  --focus-on-dark: var(--school-dark-accent);
  --bar: color-mix(in srgb, var(--tg-theme-bg-color) 96%, transparent);
  --font: var(--font-body);
  --wrap: 1040px;
  --measure: 66ch;
  --radius: clamp(18px, 2.4vw, 24px);
  /* приказ 349 п. 3: на телефоне промежутки меньше (главная до 5 000 px на 390), на компьютере прежние */
  --gap-section: clamp(32px, 9vw, 120px);
  --gap-final: clamp(56px, 11vw, 144px);
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --h1: clamp(26px, calc(3.4vw + 12px), 56px);
  --h2: clamp(24px, 3.2vw, 40px);
  --head-h: 56px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  scroll-padding-top: var(--head-h);
  scroll-padding-bottom: 72px;
}

body {
  margin: 0;
  background: var(--canvas);
  font-size: 17px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
}

main {
  flex: 1;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.1;
  text-wrap: balance;
}

p,
li {
  text-wrap: pretty;
  /* приказ 324 п. 9: длинная почта или адрес в тексте документа переносится, на 320 px нет горизонтальной прокрутки */
  overflow-wrap: break-word;
}

p {
  margin: 0 0 1em;
}

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

a {
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

main a:not([class]) {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 8px;
}

/* Приказ 023: на тёмном финале и в подвале кольцо жёлтое (было 1,04:1) */
.final a:focus-visible,
.site-footer a:focus-visible {
  outline-color: var(--focus-on-dark);
}

b,
strong {
  font-weight: 600;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 20px;
}

.skip-link {
  position: absolute;
  left: 8px;
  top: -100px;
  z-index: 10;
  padding: 12px 16px;
  background: var(--ink);
  color: var(--canvas);
  border-radius: 999px;
}

.skip-link:focus {
  top: 8px;
}

/* Плашка листа ожидания до открытия (приказ 014 Т4) */
.mode-banner {
  padding: 10px 16px;
  background: var(--tile);
  border-bottom: 1px solid var(--line);
  text-align: center;
  font-size: 15px;
  line-height: 1.4;
}

.mode-banner .note {
  margin: 0 auto;
  max-width: 60ch;
}

/* Кнопка (приказ 324 п. 10): главная кнопка 362, акцент с белым текстом, скругление 14 px; нажатие scale(.97) 140 мс */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 26px;
  max-width: 100%;
  border-radius: 14px;
  background: var(--btn);
  color: var(--btn-text);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition:
    transform 140ms var(--ease),
    filter 140ms var(--ease);
}

.btn:active {
  transform: scale(0.97);
}

/* приказ 324 п. 9: на 320 px кнопка с полным текстом без горизонтальной прокрутки */
@media (max-width: 380px) {
  .btn {
    padding: 0 16px;
    font-size: 16px;
  }
}

.btn-sm {
  min-height: 36px;
  padding: 0 16px;
  font-size: 13px;
}

@media (hover: hover) and (pointer: fine) {
  .btn:hover {
    filter: brightness(0.96);
  }

  .site-footer a:hover {
    color: var(--dark-text);
    text-decoration: underline;
  }
}

/* Шапка: липкая 48 px, белый 96 % без размытия (приказ 324 п. 9: без backdrop-filter) */
.site-header {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--bar);
  border-bottom: 1px solid var(--line);
}

.header-row {
  position: relative;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.logo {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Шапка (приказ 324 п. 2, 3): имя, разделы якорями, «Войти», кнопка; текущий пункт `aria-current` подчёркиванием.
   Телефон (до 760 px): имя, «Войти», бургер 44x44 на `<details>` (без скрипта), лист под шапкой строками 48 px. */
.head-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-right: auto;
}

.head-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--nav);
  font-size: 15px;
  text-decoration: none;
  white-space: nowrap;
}

.head-nav a:hover,
.head-nav a[aria-current] {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.35em;
}

.head-right {
  flex: none;
  display: flex;
  align-items: center;
  gap: 16px;
}

.head-login {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 4px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.head-ico {
  flex: none;
}

.menu {
  display: none;
}

.burger {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  border-radius: 12px;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}

.burger::-webkit-details-marker {
  display: none;
}

.menu-sheet {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 4;
  display: flex;
  flex-direction: column;
  padding: 8px 20px 20px;
  background: var(--canvas);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 12px 32px var(--shadow);
}

/* закрытый лист не занимает места (Chrome держит раскладку закрытого `<details>`: лишняя ширина на 320 px) */
details.menu:not([open]) .menu-sheet {
  display: none;
}

.menu-sheet a:not(.btn) {
  display: flex;
  align-items: center;
  min-height: 48px;
  color: var(--ink);
  font-size: 17px;
  text-decoration: none;
}

.menu-sheet a[aria-current] {
  text-decoration: underline;
  text-underline-offset: 0.35em;
}

.menu-sheet hr {
  width: 100%;
  margin: 8px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.menu-sheet .btn {
  width: 100%;
  min-height: 48px;
  margin-top: 12px;
}

/* до 1023 px (планшет) разделы в меню: имя школы, «Войти» и кнопка шапки помещаются без обрезки (критик 324, 768-880 px) */
@media (max-width: 1023px) {
  .head-nav {
    display: none;
  }

  .menu {
    display: block;
  }
}

@media (max-width: 760px) {
  .header-cta {
    display: none;
  }

  .head-right {
    gap: 8px;
  }

  details.menu[open] > summary::before {
    content: "";
    position: fixed;
    inset: 48px 0 0;
    z-index: 3;
    background: color-mix(in srgb, var(--tg-theme-text-color) 32%, transparent);
  }
}

/* приказ 324 п. 3: открыто меню, липкая кнопка скрыта */
body:has(details.menu[open]) .sticky-bar {
  display: none !important;
}

/* Вход `/auth/email` и кабинет `/app` без входа (приказ 326 п. 4): шапка сайта, карточка по центру, кнопки от 48 px
   (WCAG 2.5.8, Apple HIG 44 pt); стили встроены частью этого файла по разметке (`slim`, приказ 313 п. 3). */
.auth-main {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(32px, 8vh, 96px) 16px 48px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  padding: clamp(24px, 5vw, 40px);
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px var(--shadow);
}

.auth-card h1 {
  margin: 0 0 16px;
  font-size: clamp(26px, 4vw, 34px);
}

.auth-card p {
  color: var(--ink-2);
}

.auth-card form p,
.auth-card .auth-btns {
  margin: 0 0 16px;
}

.auth-card .btn {
  display: flex;
  width: 100%;
  min-height: 48px;
  border: 0;
  font-family: inherit;
  cursor: pointer;
}

.auth-card .btn + .btn {
  margin-top: 12px;
}

.auth-card .btn-ink {
  background: transparent;
  box-shadow: inset 0 0 0 2px var(--ink);
  color: var(--ink);
}

.auth-card label {
  display: block;
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
}

.auth-card input {
  display: block;
  width: 100%;
  min-height: 48px;
  margin-top: 6px;
  padding: 0 14px;
  border: 1px solid var(--ring);
  border-radius: 12px;
  background: var(--canvas);
  color: var(--ink);
  font: inherit;
}

.auth-card input:focus-visible,
.auth-card .btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.auth-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0 16px;
  font-size: 14px;
}

.auth-or::before,
.auth-or::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--line);
}

.auth-card .err {
  color: var(--tg-theme-destructive-text-color);
}

.auth-card a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

/* Первый экран: по центру, H1 в две строки, вторая серая */
.hero {
  padding-top: clamp(40px, 8vw, 96px);
  padding-bottom: 32px;
  text-align: center;
}

.h1 {
  max-width: 14em;
  margin: 0 auto;
  font-size: var(--h1);
}

.h1-gray {
  display: block;
  color: var(--h1-gray);
}

.hero .sub {
  max-width: 30ch;
  margin: clamp(16px, 2.2vw, 24px) auto 0;
  font-size: clamp(17px, 1.7vw, 22px);
  line-height: 1.42;
}

.hero-btns {
  max-width: 460px;
  margin: clamp(24px, 3vw, 32px) auto 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 28px;
}

.hero-note {
  max-width: 46ch;
  margin: 12px auto 0;
  font-size: 13px;
  color: var(--ink-2);
}

.hero-disc {
  max-width: 52ch;
  margin: 8px auto 0;
  font-size: 13px;
  color: var(--ink-2);
}

/* Плитка «Основатель школы»: фото 3:2 на телефоне, сбоку на компьютере */
.founder {
  margin-top: clamp(24px, 4vw, 48px);
  background: var(--tile);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
}

.founder-photo {
  flex: 1 1 400px;
  min-width: 0;
  width: 100%;
  height: auto;
  min-height: 460px;
  align-self: stretch;
  object-fit: cover;
  object-position: 50% 30%;
}

.founder-text {
  flex: 1 1 400px;
  min-width: 0;
  padding: clamp(22px, 5vw, 64px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.founder-text h2 {
  margin-bottom: 16px;
  font-size: clamp(24px, 3vw, 40px);
}

.founder-text ul {
  padding-left: 20px;
}

/* Число подписчиков канала под текстом плитки (приказ 052): 15 px, приглушённым ink-2 (на плитке от 4,5:1) */
.founder-subs {
  margin-top: 16px;
  font-size: 15px;
  color: var(--ink-2);
}

/* Строка подписчиков ссылкой на канал (приказ 269 п. 1): тот же цвет, подчёркиванием */
.founder-subs a {
  color: inherit;
  text-underline-offset: 3px;
}

/* Разделы главной */
.section {
  padding-top: var(--gap-section);
}

.h2 {
  font-size: var(--h2);
  text-align: center;
}

.block-text {
  max-width: var(--measure);
  margin: clamp(24px, 3vw, 40px) auto 0;
}

.block-text ul {
  padding-left: 20px;
}

.block-text li {
  margin-bottom: 8px;
}

/* Как это работает: 4 шага в ряд, до 600 px столбиком */
.steps ol {
  list-style: none;
  counter-reset: step;
  margin: clamp(28px, 4vw, 56px) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 40px;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding-top: 46px;
  line-height: 1.45;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 32px;
  height: 32px;
  border: 1px solid var(--ring);
  border-radius: 999px;
  background: var(--canvas);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 600;
}

.steps .block-text {
  margin-top: 32px;
}

/* Цены: плитка на уровень, цена за урок крупно, строки товаров таблицей */
.tiers {
  margin-top: clamp(28px, 4vw, 48px);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.tiers-title {
  margin-top: clamp(28px, 4vw, 48px);
  font-size: 19px;
  text-align: center;
  letter-spacing: -0.01em;
}

.tiers-title + .tiers,
.prices > .tiers:first-child {
  margin-top: 20px;
}

.tier {
  background: var(--tile);
  border-radius: var(--radius);
  padding: clamp(24px, 3vw, 36px);
}

.tier-head {
  margin: 0 0 8px;
  font-size: 21px;
  font-weight: 600;
}

.tier-head-rub {
  display: block;
  margin-top: 2px;
  font-size: 17px;
  font-weight: 500;
}

.nw {
  white-space: nowrap;
}

.tier-row {
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.tier-label {
  margin: 0;
  font-size: 15px;
  color: var(--ink-2);
}

.tier-price {
  margin: 2px 0 0;
  font-size: 19px;
  font-variant-numeric: tabular-nums;
}

.tier-price b {
  font-weight: 600;
}

.tier-sep {
  color: var(--ink-2);
}

.tier s.old {
  color: var(--ink-2);
  font-size: 0.85em;
  font-weight: 400;
}

/* Плашка кода пробного (приказ 279 п. 2, дизайн штаба): на телефоне столбцом, кнопка во всю ширину */
.promo {
  margin-top: 20px;
  background: var(--btn);
  color: var(--btn-text);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: grid;
  gap: 12px;
}

.promo-text p {
  margin: 0;
}

.promo-text .promo-title {
  margin-bottom: 4px;
  font-size: 19px;
  font-weight: 600;
}

.promo-code {
  justify-self: start;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.08em;
  border: 2px dashed currentColor;
  border-radius: 12px;
  padding: 4px 14px;
  user-select: all;
}

.promo-btn {
  background: var(--ink);
  color: var(--canvas);
  width: 100%;
}

.promo-rule,
.tiers-notes p {
  max-width: var(--measure);
  margin: 12px 0 0;
  font-size: 15px;
  color: var(--ink-2);
}

@media (min-width: 761px) {
  .promo {
    grid-template-columns: 1fr auto auto;
    align-items: center;
  }

  .promo-btn {
    width: auto;
  }
}

/* Вопросы: аккордеон на details, без скриптов */
.faq {
  max-width: 760px;
  margin: 0 auto;
  border-top: 1px solid var(--line);
}

.faq-item {
  border-bottom: 1px solid var(--line);
}

.faq-item summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding: 12px 0;
  cursor: pointer;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  flex: 0 0 auto;
  font-size: 22px;
  color: var(--ink-2);
  transition: transform 200ms var(--ease);
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.faq-item summary h2,
.faq-item summary h3 {
  margin: 0;
  font-size: 19px;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.faq-a {
  padding: 0 0 16px;
  max-width: var(--measure);
  color: var(--nav);
}

.faq-a ul {
  padding-left: 20px;
}

/* Приказ 349 п. 2: строка цен над свёрнутой таблицей; таблица в том же аккордеоне, что вопросы (`faq-item`) */
.price-line {
  max-width: var(--measure);
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.45;
}

.all-prices {
  max-width: 760px;
  border-top: 1px solid var(--line);
}

.all-prices summary span {
  font-size: 17px;
  font-weight: 600;
}

/* Финал: тёмная плитка во всю ширину, продолжается подвалом; та же жёлтая кнопка */
.final {
  margin-top: var(--gap-final);
  background: var(--dark);
  color: var(--dark-text);
}

.final-in {
  padding: clamp(48px, 11vw, 144px) 20px;
  text-align: center;
}

.final .h1-gray {
  color: var(--dark-2);
}

.final h2 {
  max-width: 18ch;
  margin: 0 auto;
  font-size: clamp(26px, 4.6vw, 56px);
  line-height: 1.12;
  letter-spacing: -0.01em;
}

/* Подвал (приказ 324 п. 4): тёмный, 4 группы (компьютер колонками, телефон 2x2), ссылки светлые, заголовки групп
   приглушённые, строки 44 px; ниже полоса: школа и продавец, почта, Niko Tax, оплата. */
.site-footer {
  margin-top: var(--gap-section);
  background: var(--dark);
  color: var(--dark-2);
  font-size: 14px;
}

main:has(.final) + .site-footer {
  margin-top: 0;
}

.footer-in {
  padding-top: 48px;
  padding-bottom: 40px;
}

main:has(.final) + .site-footer .footer-in {
  padding-top: 8px;
  border-top: 1px solid var(--dark-line);
}

.foot-groups {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  padding-top: 32px;
}

.foot-group h2 {
  margin: 0 0 8px;
  color: var(--dark-2);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.foot-group ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer a {
  color: var(--link-on-dark);
}

.foot-group a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  text-decoration: none;
}

.soc svg {
  flex: none;
  width: 20px;
  height: 20px;
}

.foot-founder {
  margin-top: 4px;
  font-size: 13px;
}

.foot-strip {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--dark-line);
  font-size: 13px;
}

.site-footer p {
  margin: 0 0 0.6em;
}

/* приказ 326 п. 9: ссылки строк подвала (почта, Niko Tax) тоже зоной касания 44 px */
.site-footer p > a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

@media (max-width: 760px) {
  .foot-groups {
    grid-template-columns: 1fr 1fr;
    gap: 24px 16px;
  }

  .foot-group a {
    min-height: 44px;
  }

  /* приказ 349 п. 3: третья группа (документы) на всю ширину в две колонки: подвал короче на телефоне */
  .foot-group:nth-child(3) {
    grid-column: 1 / -1;
  }

  .foot-group:nth-child(3) ul {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 16px;
  }
}

/* «Оставайтесь на связи» на /contacts (приказ 324 п. 5): тот же список светлым */
.text .soc {
  list-style: none;
  padding: 0;
}

.text .soc a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
}

/* Документы, /teach, /contacts: текст колонкой до 70 знаков */
.page {
  padding: clamp(24px, 5vw, 56px) 20px 0;
}

.text {
  max-width: var(--measure);
}

.text h1 {
  font-size: var(--h2);
  margin-bottom: 24px;
}

.text h2 {
  margin: 40px 0 12px;
  font-size: clamp(22px, 2.6vw, 32px);
  line-height: 1.15;
}

.text h3 {
  margin: 24px 0 8px;
  font-size: 19px;
  letter-spacing: -0.01em;
}

.text ul,
.text ol {
  padding-left: 22px;
}

.text li {
  margin-bottom: 6px;
}

.page-btns {
  margin-top: 32px;
}

/* /teach: фото Никиты под первой кнопкой (приказ 022 п. 11) */
.teach-photo {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 24px;
  border-radius: var(--radius);
  object-fit: cover;
}

/* /teach: ссылка на анкету без Telegram под кнопкой бота (приказ 035 п. 11) */
.teach-web {
  margin: 16px 0 0;
}

/* /teach: строка-ссылка на канал основателя под фото (приказ 269 п. 3) */
.teach-yt {
  margin: 12px 0 0;
  font-size: 15px;
}

/* Липкая кнопка: только телефон, появляется после первого экрана (scroll-timeline), без скриптов */
.sticky-bar {
  display: none;
}

@media (max-width: 760px) {
  .header-cta {
    display: none;
  }

  .hero-btns {
    flex-direction: column;
    align-items: stretch;
  }

  /* приказ 349 п. 3: фото ниже на телефоне, главная до 5 000 px на 390 */
  .founder-photo {
    aspect-ratio: 2 / 1;
    height: auto;
    min-height: 0;
    flex-basis: 100%;
  }

  .h2 {
    text-align: left;
  }

  .tiers-title {
    text-align: left;
  }

  .footer-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px;
  }

  .sticky-bar {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 4;
    padding: 8px 16px calc(8px + env(safe-area-inset-bottom));
    background: var(--bar);
    border-top: 1px solid var(--line);
  }

  .sticky-bar .btn {
    display: flex;
    width: 100%;
    min-height: 48px;
  }

  .has-sticky .footer-in {
    padding-bottom: calc(40px + 64px + env(safe-area-inset-bottom));
  }

  @supports (animation-timeline: scroll()) {
    .sticky-bar {
      animation: show-bar linear both;
      animation-timeline: scroll(root);
      animation-range: 420px 520px;
    }
  }

  /* приказ 324 п. 1: со скриптом сайта липкая кнопка ровно после ухода кнопки первого экрана */
  .js-sticky .sticky-bar {
    display: none;
    animation: none;
  }

  .js-sticky .sticky-bar.on {
    display: block;
  }
}

@keyframes show-bar {
  from {
    opacity: 0;
    transform: translateY(100%);
    visibility: hidden;
  }

  to {
    opacity: 1;
    transform: none;
    visibility: visible;
  }
}

@media (max-width: 600px) {
  .steps ol {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .steps li {
    padding: 4px 0 0 48px;
  }

  /* приказ 349 п. 3: текст раздела ближе к заголовку, карточка преподавателя и первый экран плотнее на телефоне */
  .block-text {
    margin-top: 16px;
  }

  .hero {
    padding-top: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }

  .btn:active {
    transform: none;
  }

  /* без движения, но по-прежнему только после первого экрана (без скрипта: шагом по прокрутке, не сразу) */
  .sticky-bar {
    animation-timing-function: steps(1, end) !important;
  }
}

/* Приказ 197 п. 5: строка «Пробный урок от» под кнопкой первого экрана (`switches.site_prices`) */
.hero-price {
  margin: 12px auto 0;
  font-size: 15px;
  color: var(--ink-2);
}

/* Приказ 197 п. 15: карусель «Кто преподаёт» без скриптов. Лента прокручивается пальцем, колесом и клавишами
   (`scroll-snap`); движение только CSS-анимацией `transform` по второй копии ленты, круг 120 с (не быстрее 60 с);
   стоп при наведении, фокусе, нажатии и переключателем «Остановить» (WCAG 2.2.2); при reduced motion движения нет. */
.tcar {
  margin-top: 24px;
}

.tcar-stop {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.tcar-btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--ring);
  border-radius: 999px;
  font-size: 15px;
  cursor: pointer;
}

.tcar-stop:focus-visible + .tcar-btn {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.tcar-g,
.tcar-stop:checked + .tcar-btn .tcar-p {
  display: none;
}

.tcar-stop:checked + .tcar-btn .tcar-g {
  display: inline;
}

.tcar-view {
  margin-top: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
}

.tcar-track {
  display: flex;
  width: max-content;
  animation: tcar-run 120s linear infinite;
}

.tcar-view:hover .tcar-track,
.tcar-view:focus-within .tcar-track,
.tcar-view:active .tcar-track,
.tcar-stop:checked ~ .tcar-view .tcar-track {
  animation-play-state: paused;
}

@keyframes tcar-run {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tcar-track {
    animation: none;
  }
  .tcar-list.tcar-copy {
    display: none;
  }
}

.tcar-list {
  display: flex;
  gap: 16px;
  margin: 0;
  padding: 0 16px 8px 0;
  list-style: none;
}

.tc {
  scroll-snap-align: start;
  width: 240px;
  flex: none;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--tile);
}

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

.tc-ph {
  display: block;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
}

/* приказ 352 п. 4: заглушка без фото как в Mini App (`.av.ph`): инициалы цветом акцента на тоне школы */
.tc-in {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--school-tint);
  color: var(--accent-ink);
  font-size: 28px;
  font-weight: 600;
}

.tc-n {
  margin: 12px 0 0;
  font-size: 18px;
  font-weight: 600;
}

.tc-l,
.tc-a {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--ink-2);
}

.tc-t {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
}

.tc-t li {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--ring);
}

.tcar-cta {
  margin: 16px 0 0;
}

/* Страница для блогеров `/blog` (приказ 203): кнопки рядом, снимки Mini App сеткой, на телефоне в столбик */
.blog-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 20px 0;
}

.btn-line {
  background: transparent;
  box-shadow: inset 0 0 0 2px var(--btn);
  color: inherit;
}

.shots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin: 8px 0 24px;
}

.shot {
  margin: 0;
}

.shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
  box-shadow: 0 2px 12px var(--shadow);
}

.shot figcaption {
  margin-top: 8px;
  font-size: 14px;
  opacity: 0.8;
}

/* Отзывы учеников (приказ 151 п. 4): число, средняя оценка уроков, последние отзывы плитками */
.revs-n, .revs-avg { margin: 0 0 8px; color: var(--ink-2); max-width: var(--measure); }
.revs { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.rev { background: var(--tile); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; line-height: 1.5; overflow-wrap: anywhere; }

/* страница /go/<метка> (приказ 303 Р3): строка и кнопка с отступом от шапки */
.go-page {
  padding-top: 32px;
  padding-bottom: 48px;
}

/* Строка под главной кнопкой (приказ 324 п. 1): «Не подошёл преподаватель...» и «Нет Telegram? Войти почтой» */
.btn-note {
  margin: 12px 0 0;
  color: var(--ink-2);
  font-size: 15px;
}

.final .btn-note {
  color: var(--dark-2);
}

.final .btn-note a,
.final .no-tg a {
  color: var(--link-on-dark);
}

/* Раздел статей (приказ 324 п. 7): список карточками, статья колонкой текста, крошки, блок записи в конце */
.crumbs ol {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  color: var(--ink-2);
  font-size: 14px;
}

.crumbs li + li::before {
  content: "\203A";
  margin-right: 8px;
}

.crumbs a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink-2);
}

.stati-list {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: grid;
  gap: 16px;
}

.stati-card {
  padding: 20px 24px;
  border-radius: var(--radius);
  background: var(--tile);
}

.stati-card h2 {
  margin: 0 0 8px;
  font-size: clamp(19px, 2.2vw, 24px);
  line-height: 1.2;
}

.stati-card h2 a {
  color: var(--ink);
  text-decoration: none;
}

.stati-card h2 a:hover {
  text-decoration: underline;
}

.stati-card p {
  margin: 0 0 8px;
}

.stati-meta {
  color: var(--ink-2);
  font-size: 14px;
}

.stati-end {
  margin-top: 40px;
  padding: 24px;
  border-radius: var(--radius);
  background: var(--school-tint);
}

.stati-end h2 {
  margin: 0 0 16px;
  font-size: clamp(20px, 2.4vw, 28px);
}

.stati-related {
  margin-top: 40px;
}

/* Спрайт значков площадок (приказ 324 п. 5): символы без своего места на странице */
.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* Приказ 334b ответ 1: плашка о cookie Метрики внизу экрана; пока видна, липкая кнопка записи стоит над ней
   (`--ym-h` ставит скрипт меток) и низ страницы не закрыт */
.ym-note {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
  background: var(--canvas);
  border-top: 1px solid var(--line);
}

.ym-note[hidden] {
  display: none;
}

.ym-in {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
}

.ym-in p {
  margin: 0;
  font-size: 15px;
}

.ym-ok {
  min-height: 44px;
  border: 0;
  font-family: inherit;
  font-size: 15px;
  cursor: pointer;
}

body.ym-ask {
  padding-bottom: var(--ym-h, 0);
}

.ym-ask .sticky-bar {
  bottom: var(--ym-h, 0);
}

/* приказ 349 п. 3: карточка преподавателя плотнее на телефоне (после основных правил карусели, чтобы перекрыть их) */
@media (max-width: 600px) {
  .tc {
    padding: 16px;
  }

  .tc-ph {
    width: 72px;
    height: 72px;
  }

  .tcar {
    margin-top: 16px;
  }

  /* строка аккордеона 48 px: зона касания не меньше 44 px */
  .faq-item summary {
    min-height: 48px;
    padding: 8px 0;
  }
}

/* Приказ 369: страница «Блогерам»: строка с почтой под кнопкой и строка о пометке рекламы после вопросов */
.bloggers-mail {
  margin: 8px 0 0;
}

.bloggers-faq {
  margin: 0;
}

.bloggers-ad {
  margin-top: 24px;
  color: var(--ink-2);
}

/* Приказ 195 п. 2: строка «Нет Telegram? Оставьте заявку» под главной кнопкой первого экрана и финала. Файл подключается
   только при switches.web_lead = on (при off главная и style.css символ в символ как до приказа). Размер и цвет как у
   подписи hero-note; на тёмном финале серым финала. */
.no-tg {
  max-width: 46ch;
  margin: 12px auto 0;
  font-size: 13px;
  color: var(--ink-2);
}

.no-tg a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

.final .no-tg {
  color: var(--dark-2);
}
