/*
  Фирменные цвета и шрифты Лемматики. Чтобы перекрасить всю платформу
  (например, под маскота), достаточно поменять значения в этом блоке.
  Сейчас стоит палитра маскота-лемминга (выбрана 23.10): оранжевый #ff7a2f,
  тёмно-синий #1e2a4a и светло-голубой фон. Оранжевый не годится для текста на
  светлом фоне (контраст 2,6:1): только фоны, плашки и текст на тёмно-синем;
  для оранжевого текста есть --accent-text. Тёмная тема переопределяет те же
  переменные ниже. Иконки приложения, manifest.webmanifest и offline.html в
  public/ повторяют цвета отсюда: при смене палитры поправьте их и перерисуйте
  иконки командой node scripts/pwa-icons.cjs.
*/
:root {
  color-scheme: light;
  --bg: #f2f7fd;
  --surface: #ffffff;
  --surface-2: #e6eef8;
  --ink: #1e2a4a;
  --muted: #4a5677;
  --border: #d3ddeb;
  --primary: #1e2a4a;
  --primary-hover: #2e3d66;
  --primary-ink: #ffffff;
  --primary-soft: #ffe7d6;
  --accent: #ff7a2f;
  --accent-ink: #1e2a4a;
  --link-underline: #ff7a2f;
  --progress-track: #dfe7f2;
  --progress-fill: #ff7a2f;
  --success: #1f7a4d;
  --success-soft: #e3f3ea;
  --warning: #8a5a00;
  --warning-soft: #fdf0d9;
  --danger: #b42318;
  --danger-soft: #fdeceb;
  /* Видеоплеер и эфир тёмные в обеих темах, поэтому тёмная тема их не переопределяет */
  --video-bg: #0b1020;
  --video-ink: #f4f5f2;
  --video-scrim: rgba(11, 16, 32, 0.72);
  --video-track: rgba(244, 245, 242, 0.32);
  --video-watermark: rgba(244, 245, 242, 0.5);
  --video-watermark-shadow: rgba(0, 0, 0, 0.6);

  /* Просмотр фото решений: тёмный в обеих темах, как в любой галерее.
     Пометки проверяющего рисуются поверх бумаги, поэтому их цвета тоже одни на обе темы. */
  --viewer-bg: #0e1426;
  --viewer-panel: #1c2540;
  --viewer-ink: #eceee8;
  --viewer-muted: #a3a9a2;
  --mark-red: #e03131;
  --mark-green: #2b8a3e;
  --mark-blue: #1c64f2;
  --mark-orange: #f08c00;
  --mark-halo: #ffffff;

  /* Печатные документы (акты выплат): лист бумаги светлый в обеих темах */
  --paper: #ffffff;
  --paper-ink: #1e2a4a;
  --paper-rule: #8792ab;

  --font-display: "Golos Text Variable", system-ui, sans-serif;
  --font-body: "Golos Text Variable", system-ui, sans-serif;
  /* Углы острые: карточки, поля и кнопки почти прямоугольные, плашки ещё острее */
  --radius: 6px;
  --radius-sm: 4px;
  --radius-xs: 2px;
  --shadow: 0 1px 0 rgba(30, 42, 74, 0.06);

  /* Платформа: глубина карточек, меню, роли. Логотип и вход их не используют. */
  --border-strong: #bccadd;
  --surface-hover: #f5f9fe;
  --row-hover: #f3f7fc;
  --accent-text: #c2410c;
  --accent-bar: #ff7a2f;
  --mascot-bg: #dff0ff;
  --accent-border: #ffc9a3;
  --nav-active-bg: #ffe7d6;
  --glow: rgba(255, 122, 47, 0.16);
  --shadow-card: 0 1px 0 rgba(30, 42, 74, 0.06);
  --shadow-lift: 0 3px 0 rgba(30, 42, 74, 0.1);
  --tip-bg: #1e2a4a;
  --tip-ink: #ffffff;
  --role-owner: #c2410c;
  --role-admin: #6d4ed8;
  --role-teacher: #1f6feb;
  --role-curator: #0f8a7e;
  --role-methodist: #b26b00;
  --role-sales: #c2367a;
  --role-accountant: #1f7a4d;
  --role-student: #8792ab;

  /* Графики аналитики: текущий период и период для сравнения. Пара проверена на различимость
     при дальтонизме и контраст к фону (dataviz validate_palette) отдельно для каждой темы. */
  --chart-cur: #d4561a;
  --chart-prev: #5d7bb0;
  --chart-grid: #e3eaf4;
  --chart-axis: #bccadd;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111a30;
  --surface: #18223d;
  --surface-2: #212d4d;
  --ink: #eef3ff;
  --muted: #a9b4d0;
  --border: #2c3a5e;
  --primary: #ff8a45;
  --primary-hover: #ffa36b;
  --primary-ink: #1e2a4a;
  --primary-soft: #3a2a22;
  --accent: #ff8a45;
  --accent-ink: #1e2a4a;
  --link-underline: #c96a2c;
  --progress-track: #2c3a5e;
  --progress-fill: #ff8a45;
  --success: #6fd6a2;
  --success-soft: #13301f;
  --warning: #f2c25b;
  --warning-soft: #33280f;
  --danger: #ff8f85;
  --danger-soft: #3a1a17;
  --shadow: none;

  --border-strong: #3a4a72;
  --surface-hover: #1d2846;
  --row-hover: #1c2643;
  --accent-text: #ffa36b;
  --accent-bar: #ff8a45;
  --mascot-bg: #2b3a67;
  --accent-border: #5a3a26;
  --nav-active-bg: rgba(255, 138, 69, 0.14);
  --glow: rgba(255, 138, 69, 0.08);
  --shadow-card: 0 1px 0 rgba(0, 0, 0, 0.35);
  --shadow-lift: 0 3px 0 rgba(0, 0, 0, 0.45);
  --tip-bg: #eef3ff;
  --tip-ink: #1e2a4a;
  --role-owner: #ff8a45;
  --role-admin: #b4a2ff;
  --role-teacher: #79b0ff;
  --role-curator: #5ad1c3;
  --role-methodist: #f2c25b;
  --role-sales: #ff8fc4;
  --role-accountant: #6fd6a2;
  --role-student: #8792ab;

  --chart-cur: #ff8a45;
  --chart-prev: #8ea8e0;
  --chart-grid: #243052;
  --chart-axis: #3a4a72;
}

/* Печать (сертификат, «Сохранить как PDF»): всегда светлая палитра, иначе на белой бумаге пропадёт текст */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  color-scheme: dark;
  --bg: #111a30;
  --surface: #18223d;
  --surface-2: #212d4d;
  --ink: #eef3ff;
  --muted: #a9b4d0;
  --border: #2c3a5e;
  --primary: #ff8a45;
  --primary-hover: #ffa36b;
  --primary-ink: #1e2a4a;
  --primary-soft: #3a2a22;
  --accent: #ff8a45;
  --accent-ink: #1e2a4a;
  --link-underline: #c96a2c;
  --progress-track: #2c3a5e;
  --progress-fill: #ff8a45;
  --success: #6fd6a2;
  --success-soft: #13301f;
  --warning: #f2c25b;
  --warning-soft: #33280f;
  --danger: #ff8f85;
  --danger-soft: #3a1a17;
  --shadow: none;

  --border-strong: #3a4a72;
  --surface-hover: #1d2846;
  --row-hover: #1c2643;
  --accent-text: #ffa36b;
  --accent-bar: #ff8a45;
  --mascot-bg: #2b3a67;
  --accent-border: #5a3a26;
  --nav-active-bg: rgba(255, 138, 69, 0.14);
  --glow: rgba(255, 138, 69, 0.08);
  --shadow-card: 0 1px 0 rgba(0, 0, 0, 0.35);
  --shadow-lift: 0 3px 0 rgba(0, 0, 0, 0.45);
  --tip-bg: #eef3ff;
  --tip-ink: #1e2a4a;
  --role-owner: #ff8a45;
  --role-admin: #b4a2ff;
  --role-teacher: #79b0ff;
  --role-curator: #5ad1c3;
  --role-methodist: #f2c25b;
  --role-sales: #ff8fc4;
  --role-accountant: #6fd6a2;
  --role-student: #8792ab;

  --chart-cur: #ff8a45;
  --chart-prev: #8ea8e0;
  --chart-grid: #243052;
  --chart-axis: #3a4a72;
} }
@media print {
  :root, :root[data-theme="dark"] {
    color-scheme: light;
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-2: #e6eef8;
    --ink: #1e2a4a;
    --muted: #4a5677;
    --border: #d3ddeb;
    --primary: #1e2a4a;
    --primary-soft: #ffe7d6;
    --accent: #ff7a2f;
    --accent-ink: #1e2a4a;
    --success: #1f7a4d;
    --success-soft: #e3f3ea;
    --shadow: none;
  }
}

/* Стили сайта школы. Цвета берутся из переменных theme.css кабинета (сервер вставляет их выше).
   Тема: по настройке системы (без JavaScript) или явный выбор кнопкой в шапке (data-theme на <html>,
   ставит /static/theme.js до отрисовки). Каждый блок токенов тёмной темы (:root с data-theme="dark") сервер сам повторяет
   внутри @media (prefers-color-scheme: dark) для :root:not([data-theme="light"]), поэтому тёмные
   значения пишем один раз и только токенами (без вложенных селекторов).
   Палитра маскота-лемминга: оранжевый, тёмно-синий и светло-голубой. Шапка, первый экран, призыв записаться
   и подвал (.band) в тёмной теме тёмно-синие, в светлой светло-голубые с оранжевыми акцентами; оранжевый для линий
   и текста на светлом фоне темнее (--accent-strong, контраст AA). Маскот: site_static/mascot (scripts/mascot).
   Встроенных стилей (style="…") нет: их не пускает CSP. */

/* ---------- Шрифт: тот же Golos Text, что у кабинета (@fontsource-variable), лежит в site_static/fonts ---------- */
@font-face {
  font-family: "Golos Text Variable"; font-style: normal; font-display: swap; font-weight: 400 900;
  src: url(/static/fonts/golos-text-cyrillic-ext-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: "Golos Text Variable"; font-style: normal; font-display: swap; font-weight: 400 900;
  src: url(/static/fonts/golos-text-cyrillic-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Golos Text Variable"; font-style: normal; font-display: swap; font-weight: 400 900;
  src: url(/static/fonts/golos-text-latin-ext-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Golos Text Variable"; font-style: normal; font-display: swap; font-weight: 400 900;
  src: url(/static/fonts/golos-text-latin-wght-normal.woff2) format("woff2-variations");
  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 {
  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 32px);
  --section: clamp(56px, 8vw, 96px);
  --orange: #ff7a2f;
  --orange-hover: #ff9150;
  --navy: #1e2a4a;
  --header-h: 68px;

  /* Светлая тема */
  --accent-strong: #c2410c;
  --band-bg: #eaf4ff;
  --header-bg: rgba(234, 244, 255, 0.86);
  --header-border: rgba(30, 42, 74, 0.08);
  --cta-bg: #dff0ff;
  --footer-bg: #dce9f8;
  --hero-glow-1: rgba(255, 122, 47, 0.22);
  --hero-glow-2: rgba(255, 122, 47, 0.12);
  --hero-glow-3: rgba(93, 123, 176, 0.12);
  --grid-line: rgba(30, 42, 74, 0.06);
  --art-stroke: rgba(194, 65, 12, 0.5);
  --art-soft: rgba(30, 42, 74, 0.2);
  --art-dot: #e0651c;
  --art-halo: rgba(255, 122, 47, 0.28);
  --art-trail: #ff7a2f;
  --art-formula: rgba(30, 42, 74, 0.42);
  --art-formula-accent: #c2410c;
  --pill-bg: rgba(255, 122, 47, 0.12);
  --pill-border: rgba(194, 65, 12, 0.3);
  --chip-bg: rgba(255, 255, 255, 0.75);
  --chip-border: rgba(30, 42, 74, 0.1);
  --focus-ring: rgba(255, 122, 47, 0.4);
  --orange-ring: inset 0 0 0 1px rgba(194, 65, 12, 0.35);
  --stars: #b07800;
  --field-bg: #f2f7fd;
  --show-moon: block;
  --show-sun: none;
  --card-hover-shadow: 0 14px 30px -18px rgba(30, 42, 74, 0.45);
  --sec-plain: #ffffff;
  --link-underline: #a9bbd8;
  --lesson-bg: var(--navy);
  --switch-on-bg: var(--navy);
  --switch-on-fg: #fff;
  --pc-curator-border: var(--navy);
  /* Плавность: частые действия быстрые, ease-out для появления, ease-in-out для перетекания цветов */
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
}
:root[data-theme="dark"] {
  --accent-strong: #ff8a45;
  --band-bg: #111a30;
  --header-bg: rgba(17, 26, 48, 0.86);
  --header-border: rgba(238, 243, 255, 0.08);
  --cta-bg: #111a30;
  --footer-bg: #111a30;
  --hero-glow-1: rgba(255, 138, 69, 0.18);
  --hero-glow-2: rgba(255, 138, 69, 0.08);
  --hero-glow-3: rgba(142, 168, 224, 0.08);
  --grid-line: rgba(238, 243, 255, 0.05);
  --art-stroke: rgba(255, 138, 69, 0.5);
  --art-soft: rgba(238, 243, 255, 0.2);
  --art-dot: #ff8a45;
  --art-halo: rgba(255, 138, 69, 0.2);
  --art-trail: #ff8a45;
  --art-formula: rgba(238, 243, 255, 0.32);
  --art-formula-accent: rgba(255, 138, 69, 0.75);
  --pill-bg: rgba(255, 138, 69, 0.08);
  --pill-border: rgba(255, 138, 69, 0.3);
  --chip-bg: rgba(238, 243, 255, 0.06);
  --chip-border: rgba(238, 243, 255, 0.12);
  --focus-ring: rgba(255, 138, 69, 0.3);
  --orange-ring: none;
  --stars: #f2c25b;
  --field-bg: #111a30;
  --show-moon: none;
  --show-sun: block;
  --card-hover-shadow: 0 14px 30px -18px rgba(0, 0, 0, 0.7);
  --sec-plain: var(--bg);
  --link-underline: #4d5f8a;
  --lesson-bg: #0a1124;
  --switch-on-bg: var(--ink);
  --switch-on-fg: var(--navy);
  --pc-curator-border: var(--muted);
}
/* Полосы бренда: шапка, первый экран, призыв записаться, подвал */
.band { --bg: var(--band-bg); background: var(--band-bg); color: var(--ink); }

/* ---------- Основа ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; }
html { scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  background: var(--bg); color: var(--ink); font-family: var(--font-body);
  font-size: 17px; line-height: 1.6; -webkit-text-size-adjust: 100%; text-rendering: optimizeLegibility;
  overflow-x: clip; min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--ink); text-decoration-color: var(--link-underline); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--ink); text-decoration-color: var(--primary); }
.band a:hover { color: var(--accent-strong); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.15; margin: 0 0 12px; overflow-wrap: break-word; letter-spacing: -0.01em; }
h1 { font-size: clamp(30px, 5.2vw, 60px); line-height: 1.08; }
h2 { font-size: clamp(24px, 3.4vw, 38px); }
h3 { font-size: 19px; line-height: 1.3; }
p { margin: 0 0 12px; }
img { max-width: 100%; height: auto; }
svg { flex: none; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); color: var(--ink); padding: 8px 12px; z-index: 100; border-radius: var(--radius-sm); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.wrap.narrow { max-width: calc(820px + 2 * var(--gutter)); }
.wrap.text { max-width: calc(760px + 2 * var(--gutter)); }
main { display: block; flex: 1 0 auto; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

/* ---------- Шапка ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg); border-bottom: 1px solid var(--header-border);
  backdrop-filter: saturate(160%) blur(12px); -webkit-backdrop-filter: saturate(160%) blur(12px);
}
.header-row { display: flex; align-items: center; gap: 16px; min-height: var(--header-h); }
.logo { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 19px; color: var(--ink); text-decoration: none; flex: none; }
.logo:hover { color: var(--ink); }
/* Логотип по наброску дизайнера: оранжевая «Л», мордочка лемминга вместо «а» */
.wordmark { display: inline-flex; align-items: center; font-family: var(--font-display); font-weight: 900; font-size: 24px; letter-spacing: -0.01em; line-height: 1; }
.wordmark .wm-l { color: var(--accent-strong); }
.wordmark .wm-face { width: 1.15em; height: 1.15em; margin: -0.12em 0.01em 0; }
.menu { flex: 1; display: flex; justify-content: center; gap: 2px; min-width: 0; }
.menu a {
  flex: none; padding: 8px 12px; border-radius: var(--radius-xs); color: var(--muted); text-decoration: none; font-weight: 500; font-size: 15px;
  transition: color 0.15s, background-color 0.15s;
}
.menu a:hover { color: var(--ink); background: var(--surface-2); }
.menu a[aria-current="page"] { color: var(--navy); background: var(--orange); }
.header-actions { display: flex; align-items: center; gap: 8px; flex: none; margin-left: auto; }
.header-actions .btn { min-height: 40px; }
.theme-toggle {
  width: 40px; height: 40px; padding: 0; border-radius: 50%; border: 1px solid var(--border); background: transparent; color: var(--ink);
  display: inline-grid; place-items: center; cursor: pointer; flex: none; transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.theme-toggle[hidden] { display: none; }
.theme-toggle:hover { background: var(--surface-2); border-color: var(--muted); }
.theme-toggle svg { width: 20px; height: 20px; display: block; }
.theme-toggle .i-moon { display: var(--show-moon); }
.theme-toggle .i-sun { display: var(--show-sun); }
@media (prefers-reduced-motion: no-preference) {
  .theme-toggle:hover svg { transform: rotate(-20deg); }
  .theme-toggle svg { transition: transform 0.3s; }
}

@media (max-width: 1080px) {
  .header-actions .btn.trial { display: none; }
}
/* Когда разделы уходят во второй ряд, «Записаться» снова помещается в первый */
@media (max-width: 920px) {
  .header-actions .btn.trial { display: inline-flex; }
}
/* Узкий телефон: тема остаётся системной, кнопка темы уступает место «Записаться» */
@media (max-width: 480px) {
  .header-actions .theme-toggle { display: none; }
  .header-actions { gap: 6px; }
  .header-actions .btn.small { padding-left: 10px; padding-right: 10px; font-size: 14px; }
  .site-header .wordmark { font-size: 20px; }
}
@media (max-width: 350px) {
  .header-actions .btn.small { padding-left: 8px; padding-right: 8px; font-size: 13px; }
  .site-header .wordmark { font-size: 17px; }
}
/* Телефон и планшет: логотип и «Войти» в первом ряду, разделы вторым рядом с прокруткой вбок (работает без JS) */
@media (max-width: 920px) {
  :root { --header-h: 108px; }
  .header-row { flex-wrap: wrap; row-gap: 0; padding-top: 10px; }
  .menu {
    order: 3; flex: 1 0 100%; justify-content: flex-start; overflow-x: auto; scrollbar-width: none;
    margin: 6px calc(-1 * var(--gutter)) 0; padding: 0 var(--gutter) 10px;
    mask-image: linear-gradient(90deg, transparent 0, #000 var(--gutter), #000 calc(100% - 28px), transparent);
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--gutter), #000 calc(100% - 28px), transparent);
  }
  .menu::-webkit-scrollbar { display: none; }
  .menu a { padding: 7px 12px; }
}

/* ---------- Кнопки, значки, карточки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 22px;
  border-radius: var(--radius-xs); border: 1px solid transparent; background: var(--primary); color: var(--primary-ink);
  font: inherit; font-weight: 650; font-size: 16px; line-height: 1.2; cursor: pointer; text-decoration: none; text-align: center;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.btn:hover { background: var(--primary-hover); color: var(--primary-ink); }
.btn.orange { background: var(--orange); color: var(--navy); box-shadow: var(--orange-ring); }
.btn.orange:hover { background: var(--orange-hover); color: var(--navy); box-shadow: 0 8px 28px rgba(255, 122, 47, 0.28); }
.btn.secondary { background: transparent; color: var(--ink); border-color: var(--border); }
.btn.secondary:hover { background: var(--surface-2); color: var(--ink); border-color: var(--muted); }
.btn.small { min-height: 40px; padding: 8px 16px; font-size: 15px; }
.btn.big { min-height: 56px; padding: 14px 28px; font-size: 17px; }
.btn .arrow { transition: transform 0.15s; }
.btn:hover .arrow { transform: translateX(3px); }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.row.center { justify-content: center; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: var(--radius-xs); font-size: 13px; font-weight: 600; background: var(--surface-2); color: var(--muted); line-height: 1.4; }
.badge.orange { background: var(--primary-soft); color: var(--ink); }
.badge.sample { background: var(--warning-soft); color: var(--warning); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card.narrow { max-width: 560px; margin: 0 auto; }
.grid {
  display: grid; gap: 20px; justify-content: center;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 360px));
}
.grid.wide { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.error { color: var(--danger); background: var(--danger-soft); padding: 12px 14px; border-radius: var(--radius-sm); }
.ok { color: var(--success); background: var(--success-soft); padding: 10px 14px; border-radius: var(--radius-sm); display: inline-block; }
ul.plain { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }

/* Карточка-ссылка: вся карточка кликабельна, а в доступном дереве одна ссылка (в заголовке) */
.linkcard { position: relative; transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s; }
.linkcard h2 a, .linkcard h3 a { text-decoration: none; color: inherit; }
.linkcard h2 a::after, .linkcard h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.linkcard:hover, .linkcard:focus-within { border-color: var(--primary); box-shadow: var(--card-hover-shadow); }
.linkcard:focus-within { outline: 3px solid var(--primary); outline-offset: 3px; }
.linkcard :focus-visible { outline: none; }
@media (prefers-reduced-motion: no-preference) {
  .linkcard:hover { transform: translate(-4px, -4px); }
}

/* ---------- Секции ---------- */
.section { padding: var(--section) 0; position: relative; }
.section.alt { background: var(--surface-2); }
.section.tight { padding: calc(var(--section) * 0.6) 0; }
.section-head { text-align: center; max-width: 760px; margin: 0 auto clamp(28px, 4vw, 44px); }
.section-head p { color: var(--muted); font-size: 18px; margin: 0; }
.section-head h2 { margin-bottom: 12px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 13px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.eyebrow::before { content: ""; width: 18px; height: 3px; border-radius: 2px; background: var(--accent-bar); }
.section-more { text-align: center; margin: 32px 0 0; }

/* ---------- Первый экран ---------- */
.hero { position: relative; overflow: hidden; isolation: isolate; text-align: center; padding: clamp(64px, 10vw, 128px) 0 clamp(72px, 10vw, 120px); }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background:
    radial-gradient(60% 55% at 50% 0%, var(--hero-glow-1), transparent 70%),
    radial-gradient(40% 40% at 85% 90%, var(--hero-glow-2), transparent 70%),
    radial-gradient(35% 35% at 10% 80%, var(--hero-glow-3), transparent 70%);
}
.hero-art { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.hero-art::before {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px; background-position: center top;
  mask-image: radial-gradient(75% 85% at 50% 35%, #000 20%, transparent 80%);
  -webkit-mask-image: radial-gradient(75% 85% at 50% 35%, #000 20%, transparent 80%);
}
.hero-art .art { position: absolute; top: 24px; height: calc(100% - 24px); width: clamp(150px, 29vw, 440px); }
.hero-art .art-l { left: max(0px, calc(50% - 780px)); }
.hero-art .art-r { right: max(0px, calc(50% - 780px)); }
.hero-art.small .art { opacity: 0.7; }
.hero-art .shape { fill: none; stroke: var(--art-stroke); stroke-width: 1.6; }
.hero-art .shape.soft { stroke: var(--art-soft); }
.hero-art .axis { stroke-dasharray: 4 6; }
.hero-art .trail { fill: none; stroke: var(--art-trail); stroke-width: 3; stroke-linecap: round; opacity: 0.8; }
.hero-art .tangent { fill: none; stroke: var(--art-formula-accent); stroke-width: 1.6; stroke-linecap: round; opacity: 0.8; }
.hero-art .dot { fill: var(--art-dot); }
.hero-art .halo { fill: var(--art-halo); }
.hero-art .formula { fill: var(--art-formula); font-family: var(--font-display); font-size: 22px; font-weight: 500; }
.hero-art .formula.orange { fill: var(--art-formula-accent); }
/* Движущаяся точка на параболе (SMIL): из CSS её не остановить, поэтому при «уменьшить движение» не показываем */
.hero-art .mover { display: none; }
/* Только transform и opacity: анимации идут на видеокарте и не двигают вёрстку */
@media (prefers-reduced-motion: no-preference) {
  .hero-art .mover { display: inline; }
  .hero-art .float-a { animation: float 14s ease-in-out infinite; }
  .hero-art .float-b { animation: float 18s ease-in-out -6s infinite reverse; }
  .hero-art .spin { transform-box: view-box; transform-origin: 170px 250px; animation: spin 24s linear infinite; }
  .hero-art .halo { transform-box: fill-box; transform-origin: center; animation: halo 3s ease-in-out infinite; }
  .hero-art .wave { animation: wave-flow 6s linear infinite; }
  .hero-art .wave-dot { animation: wave-ride 6s ease-in-out infinite; }
  .hero-art .drift { animation: drift 10s ease-in-out infinite; }
  .hero-art .drift.d2 { animation-delay: -2.5s; }
  .hero-art .drift.d3 { animation-delay: -5s; }
  .hero-art .drift.d4 { animation-delay: -7.5s; }
  .hero-art .pulse { animation: pulse 4s ease-in-out infinite; }
}
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes halo { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.45); opacity: 0.35; } }
/* Волна сдвигается ровно на период (120), точка ходит вверх-вниз между гребнем и впадиной */
@keyframes wave-flow { to { transform: translateX(-120px); } }
@keyframes wave-ride { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(56px); } }
@keyframes drift { 0%, 100% { opacity: 1; transform: translateY(0); } 50% { opacity: 0.45; transform: translateY(-8px); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
@media (max-width: 760px) {
  .hero-art .art { display: none; }
}
.hero-inner { max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; }
.hero .pill {
  display: inline-flex; align-items: center; gap: 10px; padding: 6px 16px 6px 8px; margin: 0 0 24px; border-radius: var(--radius-xs);
  border: 1px solid var(--pill-border); background: var(--pill-bg); color: var(--ink); font-size: 14px; font-weight: 600;
}
.hero .pill .dot { width: 22px; height: 22px; border-radius: 50%; background: var(--orange); display: grid; place-items: center; }
.hero .pill .dot svg { width: 12px; height: 12px; }
.hero h1 { margin: 0 0 20px; max-width: 16ch; text-wrap: balance; }
/* На телефоне слово «Олимпиадная» (около 6,8em) влезает целиком с запасом на крупный шрифт в настройках телефона */
@media (max-width: 600px) {
  .hero h1, .page-hero h1 { font-size: clamp(22px, calc((100vw - 32px) / 10.5), 30px); overflow-wrap: normal; hyphens: auto; }
}
.hero h1 .mark { color: var(--accent-strong); }

/* Главная: текст слева, лемминг с подсказкой справа (на узком экране под текстом) */
.hero-split { position: relative; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter);
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
.hero-home { padding-top: clamp(40px, 7vw, 88px); padding-bottom: clamp(40px, 7vw, 88px); }
.hero-home .hero-inner { margin: 0; align-items: flex-start; text-align: left; }
.hero-home .hero-inner .actions { justify-content: flex-start; }
/* На главной текст слева, поэтому графики занимают только поля по краям */
.hero-home .hero-art .art { width: min(440px, calc((100vw - var(--wrap)) / 2 - 12px)); }
.hero-home .hero-art .art-l { left: 0; }
.hero-home .hero-art .art-r { right: 0; }
@media (max-width: 1320px) { .hero-home .hero-art .art { display: none; } }
.hero-home .hero-text ul { justify-content: flex-start; }
.hero-mascot { position: relative; display: flex; flex-direction: column; align-items: center; }
.hero-mascot .mascot { width: min(100%, 400px); height: auto; filter: drop-shadow(0 18px 30px rgba(30, 42, 74, 0.14)); }
.hero-mascot::before { content: ""; position: absolute; z-index: -1; left: 50%; top: 58%; width: min(110%, 460px); aspect-ratio: 1; translate: -50% -50%; border-radius: 50%; background: var(--mascot-bg); }
.bubble {
  position: relative; margin: 0 0 12px; max-width: 330px; padding: 14px 18px; border-radius: var(--radius); background: var(--surface); color: var(--ink);
  font-weight: 700; font-size: 16px; line-height: 1.4; box-shadow: 0 14px 30px rgba(30, 42, 74, 0.12);
}
.bubble b { color: var(--accent-strong); }
.bubble .nobr { white-space: nowrap; }
.bubble::after { content: ""; position: absolute; left: 46%; bottom: -10px; width: 22px; height: 22px; background: var(--surface); rotate: 45deg; border-radius: 2px; }
@media (prefers-reduced-motion: no-preference) {
  .hero-mascot .mascot { animation: float 6s ease-in-out infinite; }
}
@media (max-width: 860px) {
  .hero-split { grid-template-columns: 1fr; }
  .hero-home .hero-inner { align-items: center; text-align: center; }
  .hero-home .hero-inner .actions { justify-content: center; }
  .hero-home .hero-text ul { justify-content: center; }
  .hero-mascot .mascot { width: 220px; }
  .hero-mascot::before { width: 260px; }
}
.hero-text { max-width: 680px; font-size: clamp(17px, 2vw, 20px); color: var(--muted); }
.hero-text p { margin: 0 0 18px; }
.hero-text ul { list-style: none; padding: 0; margin: 4px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.hero-text li {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: var(--radius-xs); font-size: 15px; font-weight: 500;
  background: var(--chip-bg); border: 1px solid var(--chip-border); color: var(--ink);
}
.hero-text li::before {
  content: ""; width: 7px; height: 12px; margin: -3px 2px 0 2px; border: solid var(--accent-strong); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); flex: none;
}
.hero .actions { margin-top: 36px; justify-content: center; }
@media (max-width: 560px) {
  .hero .actions { flex-direction: column; align-items: stretch; width: 100%; max-width: 360px; }
  .hero-text ul { flex-direction: column; align-items: center; }
}
.hero.page-hero { padding: clamp(48px, 7vw, 88px) 0 clamp(48px, 7vw, 80px); }
.page-hero h1 { max-width: 22ch; font-size: clamp(30px, 4.6vw, 52px); }
.page-hero .hero-text { font-size: 18px; }
.page-hero .actions { margin-top: 28px; }
/* Сразу после шапки страницы полный отступ секции давал пустую полосу */
.page-hero + .section { padding-top: clamp(28px, 4vw, 48px); }
.crumbs { margin: 0 0 18px; font-size: 14px; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent-strong); }
.hero .price-big { font-family: var(--font-display); font-size: clamp(28px, 4vw, 40px); font-weight: 700; color: var(--accent-strong); margin: 4px 0 8px; }

/* ---------- Преимущества ---------- */
.features { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.feature { text-align: center; padding: 32px 24px; }
.feature .icon {
  width: 60px; height: 60px; margin: 0 auto 18px; border-radius: var(--radius); display: grid; place-items: center;
  background: var(--navy); color: var(--orange); box-shadow: inset 0 0 0 1px rgba(255, 122, 47, 0.25);
}
.feature .icon svg { width: 28px; height: 28px; }
.feature h3 { margin-bottom: 8px; font-size: 18px; }
.feature p { color: var(--muted); margin: 0; font-size: 16px; }

/* Как проходит занятие: четыре шага по порядку */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); counter-reset: tl; }
.timeline li { counter-increment: tl; position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px 22px 22px; }
.timeline li::before {
  content: counter(tl); display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius); margin-bottom: 14px;
  background: var(--orange); color: var(--navy); font-family: var(--font-display); font-weight: 900; font-size: 18px;
}
.timeline .tl-time { position: absolute; top: 30px; right: 22px; font-size: 13px; font-weight: 700; color: var(--accent-strong); }
.timeline h3 { margin-bottom: 6px; }
.timeline p { margin: 0; color: var(--muted); font-size: 16px; }

/* Уровень недели: голова лемминга с настроением уровня */
.levels { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.level { text-align: center; display: flex; flex-direction: column; align-items: center; }
.level .level-pic { width: 112px; height: 112px; border-radius: var(--radius); background: var(--mascot-bg); margin-bottom: 12px; }
.level .badge { margin-bottom: 8px; }
.level h3 { margin-bottom: 6px; }
.level p:last-child { margin: 0; color: var(--muted); font-size: 16px; }
.level-down { border-style: dashed; }
/* Уровни нарастают: зелёный, светло-оранжевый, яркий оранжевый */
.badge.lvl-easy { background: var(--success-soft); color: var(--success); }
.badge.lvl-medium { background: var(--primary-soft); color: var(--ink); }
.badge.lvl-hard { background: var(--orange); color: var(--navy); font-weight: 800; }

/* Цены: два способа оплаты над тарифами */
.pay-ways { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); margin-bottom: clamp(28px, 4vw, 44px); }
.pay-ways h2 { font-size: 22px; margin: 8px 0 6px; }
.pay-ways p:last-child { margin: 0; }
@media (max-width: 560px) {
  .feature { display: grid; grid-template-columns: auto 1fr; column-gap: 16px; text-align: left; padding: 20px; align-items: start; }
  .feature .icon { grid-row: span 2; margin: 0; width: 52px; height: 52px; border-radius: var(--radius); }
  .feature h3 { font-size: 17px; margin: 2px 0 4px; }
  .feature p { font-size: 15px; }
}
.benefits { list-style: none; padding: 0; margin: 0; }
.benefits li { display: flex; gap: 14px; align-items: flex-start; text-align: left; }
.benefits li::before {
  content: ""; flex: none; width: 10px; height: 18px; margin: 2px 6px 0 6px; border: solid var(--link-underline); border-width: 0 3px 3px 0; transform: rotate(45deg);
}

/* ---------- Курсы ---------- */
.course-card { display: flex; flex-direction: column; gap: 14px; padding: 28px; overflow: hidden; }
.course-card .num {
  font-family: var(--font-display); font-weight: 800; font-size: 15px; color: var(--navy); background: var(--orange);
  width: 44px; height: 44px; border-radius: var(--radius); display: grid; place-items: center;
}
.course-card .top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.course-card h2, .course-card h3 { font-size: 21px; margin: 0; }
.course-card p { color: var(--muted); margin: 0; flex: 1; }
.course-card .more { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; color: var(--ink); margin-top: 6px; }
.course-card .more .arrow { transition: transform 0.2s; }
.course-card:hover .more .arrow { transform: translateX(4px); }
.course-card .motif { position: absolute; right: -28px; bottom: -28px; width: 120px; height: 120px; color: var(--primary-soft); pointer-events: none; z-index: 0; }
.course-card > :not(.motif) { position: relative; z-index: 1; }

/* ---------- Преподаватели ---------- */
.avatar {
  --size: 128px;
  width: var(--size); height: var(--size); border-radius: 50%; flex: none; display: grid; place-items: center; overflow: hidden;
  font-family: var(--font-display); font-weight: 800; font-size: calc(var(--size) * 0.32); letter-spacing: 0.02em;
  box-shadow: 0 0 0 4px var(--surface), 0 0 0 6px var(--orange);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.tone-0 { background: linear-gradient(135deg, #3a4f86, #1e2a4a 70%); color: var(--orange); }
.avatar.tone-1 { background: linear-gradient(135deg, #14484c, #0e1e22 70%); color: #6ee7d6; }
.avatar.tone-2 { background: linear-gradient(135deg, #40265c, #1e142c 70%); color: #c4a0ff; }
.avatar.tone-3 { background: linear-gradient(135deg, #563016, #28180e 70%); color: #ffb85c; }
.teacher-card { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 32px 24px 28px; }
.teacher-card .avatar { margin-bottom: 14px; }
.teacher-card h3 { margin: 0; }
.teacher-card p { color: var(--muted); margin: 0; font-size: 15px; }
.teachers-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 270px)); }
@media (max-width: 560px) {
  .teachers-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
  .teachers-grid > * { width: calc(50% - 6px); }
  .teacher-card { padding: 22px 12px 18px; }
  .teacher-card .avatar { --size: 92px; margin-bottom: 10px; }
  .teacher-card h3 { font-size: 15px; }
  .teacher-card p { font-size: 13px; }
}
.teacher-full { display: grid; grid-template-columns: auto 1fr; gap: clamp(20px, 4vw, 40px); align-items: center; padding: clamp(24px, 4vw, 40px); }
.teacher-full .avatar { --size: clamp(140px, 18vw, 200px); }
.teacher-full h2 { font-size: clamp(22px, 2.6vw, 30px); }
.teacher-full .headline { color: var(--muted); font-weight: 500; }
.teacher-full .prose { margin-top: 8px; }
.teacher-list { display: flex; flex-direction: column; gap: 20px; }
@media (max-width: 640px) {
  .teacher-full { grid-template-columns: 1fr; justify-items: center; text-align: center; }
}

/* ---------- Отзывы: крутёлка (ряд с прокруткой вбок; кнопки добавляет site.js) ---------- */
.carousel { display: flex; flex-direction: column; }
.carousel .section-head { order: 1; }
.carousel-track {
  order: 2; display: grid; grid-auto-flow: column; grid-auto-columns: min(86%, 370px); gap: 20px;
  overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; padding: 6px 4px 18px; scrollbar-width: thin;
  scroll-padding-inline: 4px;
}
.carousel-item { scroll-snap-align: start; display: flex; }
.carousel-item > .review { width: 100%; }
.carousel-track:focus-visible { outline: 3px solid var(--primary); outline-offset: 4px; border-radius: var(--radius); }
.carousel-nav { order: 3; display: flex; gap: 12px; justify-content: center; margin: 12px 0 0; }
.carousel-nav .btn { width: 48px; min-width: 48px; min-height: 48px; padding: 0; font-size: 24px; line-height: 1; }
.carousel-nav .btn:disabled { opacity: 0.35; cursor: default; }
.carousel .section-more { order: 4; }
@media (prefers-reduced-motion: no-preference) { .carousel-track { scroll-behavior: smooth; } }
.review { margin: 0; display: flex; flex-direction: column; gap: 10px; position: relative; padding: 28px; }
.review::before {
  content: "“"; position: absolute; top: 2px; right: 22px; font-family: var(--font-display); font-size: 88px; line-height: 1; color: var(--primary-soft);
}
.review > * { position: relative; }
.review .badge { align-self: flex-start; }
.review blockquote { margin: 0; white-space: pre-line; flex: 1; }
.review figcaption { color: var(--muted); font-size: 14px; display: flex; align-items: center; gap: 10px; }
.review figcaption .who { color: var(--ink); font-weight: 650; }
.review .mini { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--orange); color: var(--navy); font-family: var(--font-display); font-weight: 700; font-size: 14px; flex: none; }
.stars { color: var(--stars); letter-spacing: 3px; margin: 0; font-size: 18px; }

/* ---------- Блог ---------- */
.post-card { display: flex; flex-direction: column; gap: 10px; padding: 28px; }
.post-card h2, .post-card h3 { font-size: 20px; margin: 0; }
.post-card p { margin: 0; color: var(--muted); }
.post-card .date { font-size: 14px; color: var(--muted); }

/* ---------- Призыв записаться ---------- */
.cta { position: relative; overflow: hidden; isolation: isolate; border-top: 1px solid var(--border); --bg: var(--cta-bg); background: var(--cta-bg); }
.cta::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(50% 60% at 0% 100%, var(--hero-glow-1), transparent 70%),
    radial-gradient(40% 50% at 100% 0%, var(--hero-glow-2), transparent 70%);
}
.cta-grid { display: grid; grid-template-columns: 1fr minmax(0, 520px); gap: clamp(32px, 6vw, 72px); align-items: center; }
.cta-copy h2 { font-size: clamp(28px, 4vw, 44px); }
.cta-mascot { display: block; width: 116px; height: auto; margin: 0 0 8px -8px; }
.cta-copy > p { color: var(--muted); font-size: 18px; max-width: 520px; }
.steps { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-direction: column; gap: 18px; counter-reset: step; }
.steps li { display: flex; gap: 16px; align-items: flex-start; counter-increment: step; }
.steps li::before {
  content: counter(step); flex: none; width: 40px; height: 40px; border-radius: var(--radius-sm); display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 800; background: var(--orange); color: var(--navy);
}
.steps strong { display: block; color: var(--ink); }
.steps span { color: var(--muted); font-size: 15px; }
@media (max-width: 900px) {
  .cta-grid { grid-template-columns: 1fr; }
  .cta-copy { text-align: center; }
  .cta-mascot { margin: 0 auto 8px; }
  .cta-copy > p { margin-left: auto; margin-right: auto; }
  .steps { max-width: 420px; margin-left: auto; margin-right: auto; text-align: left; }
}

/* ---------- Формы ---------- */
.form { display: flex; flex-direction: column; gap: 14px; padding: clamp(22px, 4vw, 32px); width: 100%; }
.form h2 { font-size: 24px; margin-bottom: 4px; }
.form-center { max-width: 600px; margin: 0 auto; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 14px; font-weight: 600; color: var(--muted); }
.fields-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 520px) { .fields-2 { grid-template-columns: 1fr; } }
.input {
  width: 100%; min-height: 48px; padding: 11px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg); color: var(--ink); font: inherit; font-size: 16px; transition: border-color 0.15s, box-shadow 0.15s;
}
.input:hover { border-color: var(--muted); }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--glow); }
.input:focus, .input:focus-visible { box-shadow: 0 0 0 3px var(--focus-ring); }
textarea.input { resize: vertical; }
/* Поля формы на цветной полосе: фон как у страницы, а не у полосы */
.band .input { background: var(--field-bg); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); }
.check a { color: var(--ink); }
.check input { accent-color: var(--accent-strong); width: 18px; height: 18px; flex: none; margin: 2px 0 0; }
.form .btn[type="submit"] { width: 100%; margin-top: 4px; }
.form .note { color: var(--muted); font-size: 14px; margin: 0; text-align: center; }

/* ---------- Тексты (Markdown) ---------- */
.prose { overflow-wrap: break-word; }
.prose > :last-child { margin-bottom: 0; }
.prose h2 { font-size: clamp(22px, 3vw, 28px); margin-top: 32px; }
.prose h3 { margin-top: 24px; }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 14px; }
.prose li + li { margin-top: 4px; }
.prose a { color: var(--ink); }
.prose table { border-collapse: collapse; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--border); padding: 6px 10px; }
.prose pre { overflow-x: auto; background: var(--surface-2); padding: 12px; border-radius: var(--radius-sm); }
.prose blockquote { margin: 0 0 12px; padding-left: 14px; border-left: 3px solid var(--accent-bar); }
.math { font-family: ui-monospace, monospace; background: var(--surface-2); padding: 0 4px; border-radius: 2px; }
.math.display { display: block; padding: 8px 12px; margin: 8px 0; overflow-x: auto; }
.article { padding: clamp(24px, 5vw, 48px); }
.lead-text { font-size: 19px; color: var(--muted); }

/* ---------- Курс ---------- */
.course-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: clamp(24px, 4vw, 48px); align-items: start; }
.course-aside { position: sticky; top: calc(var(--header-h) + 20px); display: flex; flex-direction: column; gap: 16px; }
.course-aside .card { padding: 24px; }
.course-aside h2 { font-size: 20px; }
@media (max-width: 960px) {
  .course-layout { grid-template-columns: 1fr; }
  .course-aside { position: static; }
}
.program { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; counter-reset: mod; }
.program > li { counter-increment: mod; padding: 20px 22px 20px 72px; position: relative; }
.program > li::before {
  content: counter(mod, decimal-leading-zero); position: absolute; left: 20px; top: 18px; width: 36px; height: 36px; border-radius: var(--radius-sm);
  display: grid; place-items: center; background: var(--orange); color: var(--navy); font-family: var(--font-display); font-size: 13px; font-weight: 700;
}
.program strong { font-family: var(--font-display); font-weight: 600; font-size: 17px; }
.program ul { margin: 8px 0 0; padding-left: 18px; color: var(--muted); }

/* ---------- Цены ---------- */
.price { font-family: var(--font-display); font-size: 30px; font-weight: 800; line-height: 1.1; margin: 4px 0 8px; }
.price s { font-size: 18px; font-weight: 500; }
.tariff { display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 28px; text-align: center; }
.tariff .badge { align-self: center; }
.tariff h3 { margin: 6px 0 0; }
.tariff .prose { text-align: left; }
.tariff .btn { margin-top: auto; }
.tariff .spacer { flex: 1; min-height: 12px; }
.tariff-group + .tariff-group { margin-top: clamp(40px, 6vw, 64px); }
.tariff-group > h2 { text-align: center; font-size: clamp(22px, 3vw, 28px); margin-bottom: 24px; }
.tariff-group > h2 a { text-decoration: none; }

/* ---------- Вопросы ---------- */
.faq { padding: 0; overflow: hidden; }
.faq summary {
  cursor: pointer; font-weight: 650; font-size: 18px; padding: 20px 64px 20px 24px; list-style: none; position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 20px; top: 50%; translate: 0 -50%; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; background: var(--surface-2); font-family: var(--font-display); font-size: 18px; transition: rotate 0.2s, background-color 0.2s;
}
.faq[open] summary::after { content: "−"; background: var(--orange); color: var(--navy); }
.faq summary:hover::after { background: var(--primary-soft); }
.faq .prose { padding: 0 24px 22px; color: var(--muted); }
.faq summary:focus-visible { outline-offset: -3px; border-radius: var(--radius); }

/* ---------- Простые страницы ---------- */
.notice { text-align: center; padding: clamp(32px, 6vw, 56px); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.notice-mascot { width: 150px; height: auto; margin-bottom: 8px; }
.notice h1 { font-size: clamp(26px, 4vw, 38px); }
.notice p { color: var(--muted); max-width: 460px; }
.empty { text-align: center; color: var(--muted); padding: 24px; }
.contacts-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 560px); gap: clamp(24px, 4vw, 48px); align-items: start; }
@media (max-width: 860px) { .contacts-grid { grid-template-columns: 1fr; } }
.contact-list { list-style: none; padding: 0; margin: 20px 0 0; display: flex; flex-direction: column; gap: 12px; }
.contact-list a { display: inline-flex; align-items: center; gap: 12px; font-weight: 600; text-decoration: none; }
.contact-list .ci { width: 40px; height: 40px; border-radius: var(--radius-sm); display: grid; place-items: center; background: var(--navy); color: var(--orange); }
.contact-list .ci svg { width: 18px; height: 18px; }
.contact-list a:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--primary); }

/* ---------- Подвал ---------- */
.site-footer { padding: clamp(48px, 7vw, 80px) 0 0; border-top: 1px solid var(--border); --bg: var(--footer-bg); background: var(--footer-bg); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(2, minmax(0, 1fr)); gap: clamp(28px, 5vw, 64px); }
.footer-brand p { color: var(--muted); max-width: 360px; margin: 16px 0 22px; }
.site-footer h2 { font-family: var(--font-body); font-size: 13px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 6px 0 16px; }
.footer-links { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-links a { color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 10px; }
.footer-links a:hover { color: var(--accent-strong); }
.footer-links svg { width: 18px; height: 18px; color: var(--accent-strong); }
.footer-bottom {
  margin-top: clamp(40px, 6vw, 64px); padding: 22px 0 28px; border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; font-size: 14px; color: var(--muted);
}
.footer-bottom p { margin: 0; }
.legal-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.legal-links a { color: var(--muted); text-decoration: none; }
.legal-links a:hover { color: var(--accent-strong); text-decoration: underline; text-decoration-color: var(--accent-strong); text-decoration-thickness: 1px; }
@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; text-align: center; }
  .footer-brand p { margin-left: auto; margin-right: auto; }
  .footer-links { align-items: center; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .legal-links { justify-content: center; }
}

/* Ловушка для ботов: люди её не видят */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

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

/* ---------- Наши результаты (олимпиады) ---------- */
.results-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 400px)); justify-content: center; }
.result { display: flex; gap: 16px; align-items: flex-start; padding: 22px; }
.result .medal {
  flex: none; width: 52px; height: 52px; border-radius: var(--radius); display: grid; place-items: center;
  background: var(--surface-2); color: var(--ink);
}
.result.winner .medal { background: var(--orange); color: var(--navy); box-shadow: 0 0 0 4px rgba(255, 122, 47, 0.14); }
.result .medal svg { width: 28px; height: 28px; }
.result-body { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.result-body .badge { align-self: flex-start; margin: 0 0 4px; }
.result h3 { margin: 0; font-size: 20px; }
.result .grade { margin: 0 0 6px; color: var(--muted); font-size: 15px; }
.result .olymp { margin: 0; font-weight: 550; line-height: 1.4; overflow-wrap: anywhere; }
.result .meta { margin: 0; color: var(--muted); font-size: 14px; }

/* ---------- Направления и цены (site.PROGRAMS, site.PLANS) ---------- */
.programs { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.program-card { padding: 28px; }
.program-card .top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.program-card .num { font-family: var(--font-display); font-weight: 900; font-size: 28px; color: var(--accent-strong); }
.program-card h2, .program-card h3 { font-size: clamp(20px, 2.4vw, 24px); margin: 0 0 8px; }
.program-card .topics { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 14px 0; }
.program-card .topics li { font-size: 14px; padding: 4px 10px; border-radius: 999px; background: var(--mascot-bg); }
.program-card p:last-child { margin: 0; }
.sub-head { margin: clamp(32px, 5vw, 48px) 0 20px; font-size: clamp(20px, 2.6vw, 24px); }
.plans { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.plan { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 26px 22px; }
.plan h3 { margin: 6px 0 0; font-size: 18px; }
.plan p:last-child { margin: 0; }
.plan-curator { border-color: var(--orange); }
.plans-note { display: flex; gap: 16px; align-items: center; margin-top: 20px; }
.plans-note .plans-pic { width: 64px; height: 64px; flex: none; border-radius: var(--radius); background: var(--mascot-bg); }
.plans-note p { margin: 0; }
@media (max-width: 560px) {
  .plans-note { align-items: flex-start; }
}

/* ---------- Курсы вкладками (радиокнопки + CSS, без скриптов) ---------- */
.ptabs { position: relative; }
.ptab-input { position: absolute; opacity: 0; pointer-events: none; }
.ptab-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--border); border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; background: var(--surface-2); }
.ptab { display: flex; flex-direction: column; gap: 2px; padding: 16px 20px; cursor: pointer; border-top: 3px solid transparent; transition: background .15s; min-width: 0; }
.ptab + .ptab { border-left: 1px solid var(--border); }
.ptab:hover { background: var(--surface); }
.ptab-title { font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--ink); }
.ptab-aud { white-space: nowrap; font-size: 13px; font-weight: 600; color: var(--muted); }
.ptab-panel { display: none; grid-template-columns: minmax(0, 240px) minmax(0, 1fr); gap: clamp(20px, 4vw, 48px); align-items: start;
  background: var(--surface); border: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); box-shadow: var(--shadow); padding: clamp(20px, 4vw, 40px); }
#ptab-1:checked ~ .ptab-panel-1, #ptab-2:checked ~ .ptab-panel-2, #ptab-3:checked ~ .ptab-panel-3 { display: grid; animation: ptab-in .25s ease; }
#ptab-1:checked ~ .ptab-list .ptab:nth-child(1), #ptab-2:checked ~ .ptab-list .ptab:nth-child(2), #ptab-3:checked ~ .ptab-list .ptab:nth-child(3) { background: var(--surface); border-top-color: var(--orange); }
#ptab-1:focus-visible ~ .ptab-list .ptab:nth-child(1), #ptab-2:focus-visible ~ .ptab-list .ptab:nth-child(2), #ptab-3:focus-visible ~ .ptab-list .ptab:nth-child(3) { outline: 2px solid var(--orange); outline-offset: -4px; }
@keyframes ptab-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ptab-panel { animation: none !important; } }
.ptab-art { border-radius: var(--radius); background: var(--mascot-bg); display: grid; place-items: center; padding: 16px; position: sticky; top: calc(var(--header-h) + 16px); }
.ptab-pic { width: 100%; max-width: 220px; height: auto; }
.ptab-body { min-width: 0; }
.ptab-body .eyebrow { margin: 0 0 8px; }
.ptab-head { font-size: clamp(24px, 3.2vw, 34px); margin: 0 0 14px; text-wrap: balance; }
.ptab-pitch { font-size: 17px; margin: 0 0 22px; max-width: 62ch; }
.ptab-benefits { list-style: none; padding: 0; margin: 0 0 22px; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.ptab-benefits li { display: flex; gap: 12px; align-items: flex-start; }
.ptab-benefits .icon { flex: none; width: 36px; height: 36px; border-radius: var(--radius-xs); background: var(--primary-soft); color: var(--accent-strong); display: grid; place-items: center; }
.ptab-benefits .icon svg { width: 20px; height: 20px; }
.ptab-benefits strong { display: block; font-family: var(--font-display); font-size: 15px; margin-bottom: 2px; }
.ptab-benefits div span { font-size: 14px; color: var(--muted); }
.ptab-topics-label { margin: 0 0 8px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.ptabs .topics { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 12px; }
.ptabs .topics li { font-size: 14px; padding: 4px 10px; border-radius: 999px; background: var(--mascot-bg); }
.ptab-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); }
.ptab-price { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 24px; color: var(--ink); }
@media (max-width: 760px) {
  .ptab-list { grid-template-columns: minmax(0, 1fr); }
  .ptab + .ptab { border-left: 0; border-top: 1px solid var(--border); }
  #ptab-1:checked ~ .ptab-list .ptab:nth-child(1), #ptab-2:checked ~ .ptab-list .ptab:nth-child(2), #ptab-3:checked ~ .ptab-list .ptab:nth-child(3) { box-shadow: inset 4px 0 0 var(--orange); border-top-color: var(--border); }
  .ptab { flex-direction: row; justify-content: space-between; align-items: baseline; gap: 12px; padding: 14px 18px; border-top-width: 1px; }
  .ptab:first-child { border-top-color: transparent; }
  .ptab-panel { grid-template-columns: minmax(0, 1fr); }
  .ptab-art { position: static; padding: 10px; }
  .ptab-pic { max-width: 150px; }
  .ptab-foot .btn { width: 100%; justify-content: center; }
}

/* ---------- Как устроены все курсы: чек-лист на листе в клетку ---------- */
.format { margin-top: clamp(36px, 5vw, 56px); display: grid; gap: 18px; padding: clamp(22px, 3vw, 32px) clamp(18px, 3vw, 34px) clamp(24px, 3vw, 34px) clamp(46px, 5vw, 64px);
  background-color: var(--surface); background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px); background-size: 22px 22px;
  border-left: 3px solid var(--orange); border-radius: 4px; box-shadow: var(--shadow); }
.format-title { margin: 0; font-size: clamp(20px, 2.6vw, 24px); }
.format-title span { background: linear-gradient(transparent 62%, var(--primary-soft) 62%); padding: 0 4px; }
.format-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.format-list li { position: relative; font-size: 16.5px; max-width: 72ch; }
.format-list strong { color: var(--ink); }
.format-list .tick { position: absolute; left: -32px; top: -4px; font-size: 24px; font-weight: 900; color: var(--orange); transform: rotate(-6deg); }
.format { grid-template-columns: minmax(0, 1fr) auto; }
.format > :not(.format-pic) { grid-column: 1; }
.format-pic { grid-column: 2; grid-row: 1 / span 2; align-self: center; width: clamp(150px, 18vw, 220px); height: auto; }
@media (max-width: 760px) { .format { grid-template-columns: minmax(0, 1fr); } .format-pic { display: none; } }

/* Крупная цифра над тарифами: оранжевый градиент */
.save-card { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; max-width: 760px; margin: 0 auto 28px; padding: 22px 28px; border-radius: var(--radius); background: linear-gradient(110deg, var(--orange), #ffb067); color: var(--navy); }
.save-card .save-value { margin: 0; padding-right: 24px; border-right: 2px solid rgba(30, 42, 74, 0.25); font-family: var(--font-display); font-weight: 900; font-size: clamp(36px, 6vw, 48px); line-height: 1.1; white-space: nowrap; }
.save-card .save-text { margin: 0; flex: 1 1 260px; min-width: 0; font-size: 18px; font-weight: 600; }
@media (max-width: 560px) {
  .save-card .save-value { padding-right: 0; border-right: 0; }
}

/* Путь ребёнка: лесенка 01–05. Линия серая; при наведении на шаг она заполняется оранжевым до этого шага */
.path { --step: 56px; --gap: 16px; --dot: 48px; --off: var(--border); --on: var(--orange); list-style: none; margin: 0; padding: 0; display: grid; gap: var(--gap); grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: stretch; }
.path li { --on-n: 0; --on-a: 0; --d: calc(var(--i) * 160ms); position: relative; display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.path li:nth-child(1) { --i: 0; margin-top: calc(var(--step) * 4); }
.path li:nth-child(2) { --i: 1; margin-top: calc(var(--step) * 3); }
.path li:nth-child(3) { --i: 2; margin-top: calc(var(--step) * 2); }
.path li:nth-child(4) { --i: 3; margin-top: var(--step); }
.path li:nth-child(5) { --i: 4; }
.path:has(li:nth-child(1):hover) li:nth-child(-n+1), .path:has(li:nth-child(1) :focus-visible) li:nth-child(-n+1) { --on-n: 1; }
.path:has(li:nth-child(2):hover) li:nth-child(-n+2){ --on-n: 1; }
.path:has(li:nth-child(2):hover) li:nth-child(-n+1){ --on-a: 1; }
.path:has(li:nth-child(3):hover) li:nth-child(-n+3){ --on-n: 1; }
.path:has(li:nth-child(3):hover) li:nth-child(-n+2){ --on-a: 1; }
.path:has(li:nth-child(4):hover) li:nth-child(-n+4){ --on-n: 1; }
.path:has(li:nth-child(4):hover) li:nth-child(-n+3){ --on-a: 1; }
.path:has(li:nth-child(5):hover) li:nth-child(-n+5){ --on-n: 1; }
.path:has(li:nth-child(5):hover) li:nth-child(-n+4){ --on-a: 1; }
.path .path-n {
  position: relative; z-index: 1; display: grid; place-items: center; width: var(--dot); height: var(--dot); margin-left: 22px; border-radius: 50%;
  border: 3px solid var(--off); background: var(--surface); color: var(--muted); font-family: var(--font-display); font-weight: 900; font-size: 17px;
  transition: background-color .25s ease var(--d), border-color .25s ease var(--d), color .25s ease var(--d), box-shadow .25s ease var(--d);
}
.path li::before, .path li::after { content: ""; position: absolute; transition: border-color .25s ease; }
/* Вход в шаг: от середины промежутка до номера */
.path li::before { top: calc(var(--dot) / 2 - 1.5px); left: calc(var(--gap) / -2); width: calc(var(--gap) / 2 + 22px); border-top: 3px solid var(--off); transition-delay: calc(var(--d) - 80ms); }
.path li:first-child::before { left: -24px; width: 46px; }
/* Выход: вправо до середины промежутка и вверх на ступень */
.path li::after { top: calc(var(--dot) / 2 - var(--step) - 1.5px); left: calc(22px + var(--dot) / 2); right: calc(var(--gap) / -2 - 1.5px); height: var(--step); border-bottom: 3px solid var(--off); border-right: 3px solid var(--off); border-bottom-right-radius: 10px; transition-delay: calc(var(--d) + 80ms); }
.path li.path-goal::after { top: calc(var(--dot) / 2 - 1.5px); right: 18px; height: 0; border-right: 0; border-radius: 0; }
/* Заполненные части */
.path li::before { border-top-color: color-mix(in srgb, var(--on) calc(var(--on-n) * 100%), var(--off)); }
.path li::after { border-bottom-color: color-mix(in srgb, var(--on) calc(var(--on-a) * 100%), var(--off)); border-right-color: color-mix(in srgb, var(--on) calc(var(--on-a) * 100%), var(--off)); }
.path li .path-n { border-color: color-mix(in srgb, var(--on) calc(var(--on-n) * 100%), var(--off)); background: color-mix(in srgb, var(--on) calc(var(--on-n) * 100%), var(--surface)); color: color-mix(in srgb, var(--navy) calc(var(--on-n) * 100%), var(--muted)); }
.path .path-flag { position: absolute; top: calc(var(--dot) / 2 - 34px); right: 0; width: 20px; height: 34px; border-left: 3px solid var(--off); transition: border-color .25s ease calc(var(--d) + 160ms); }
.path .path-flag::after { content: ""; position: absolute; top: 0; left: 0; width: 18px; height: 14px; background: var(--off); clip-path: polygon(0 0, 100% 50%, 0 100%); transition: background-color .25s ease calc(var(--d) + 160ms); }
.path li.path-goal:hover::after { border-bottom-color: var(--on); }
.path li.path-goal:hover .path-flag { border-left-color: var(--on); }
.path li.path-goal:hover .path-flag::after { background: var(--on); }
.path .path-card { flex: 1; padding: 20px; background: var(--surface); border: 1px solid var(--border); border-top: 4px solid var(--orange); border-radius: var(--radius); transition: transform .2s ease, box-shadow .2s ease; }
.path li:hover .path-card { transform: translateY(-4px); box-shadow: var(--card-hover-shadow); }
.path li:hover .path-n { box-shadow: 0 6px 18px rgba(255, 122, 47, 0.45); }
.path .path-when { margin: 0 0 8px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.path h3 { margin-bottom: 8px; }
.path .path-card > p:last-of-type { margin: 0; color: var(--muted); font-size: 16px; }
.path a.path-link { display: flex; flex-direction: column; color: inherit; text-decoration: none; }
.path a.path-link:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 3px; }
.path .path-go { margin-top: auto; padding-top: 14px; font-weight: 700; color: var(--accent-strong); }
.path .path-goal .path-n { width: calc(var(--dot) + 8px); height: calc(var(--dot) + 8px); margin-top: -4px; margin-bottom: -4px; margin-left: 18px; font-size: 19px; }
.path .path-goal .path-card { background: var(--navy); border: 2px solid var(--orange); border-top-width: 4px; color: #fff; box-shadow: 0 16px 40px rgba(30, 42, 74, 0.28); }
.path .path-goal h3 { color: #fff; }
.path .path-goal .path-when { color: var(--orange); }
.path .path-goal .path-card > p:last-of-type { color: #dfe6f5; }
@media (prefers-reduced-motion: reduce) {
  .path .path-n, .path li::before, .path li::after, .path .path-flag, .path .path-flag::after, .path .path-card { transition: none; }
}
/* Телефон и планшет: шаги друг под другом, линия идёт вниз слева и заполнена целиком */
@media (max-width: 960px) {
  .path { grid-template-columns: 1fr; gap: 18px; }
  .path li, .path li:nth-child(n), .path:has(li:hover) li { --on-n: 1; --on-a: 1; margin-top: 0; flex-direction: row; align-items: flex-start; gap: 16px; }
  .path .path-n, .path .path-goal .path-n { margin: 0; flex: none; }
  .path .path-goal .path-n { margin-left: -4px; margin-right: -4px; }
  .path li::after, .path li::before, .path .path-flag { display: none; }
  .path li:not(:last-child)::after { display: block; top: var(--dot); bottom: -18px; left: calc(var(--dot) / 2 - 1.5px); right: auto; width: 0; height: auto; border: 0; border-left: 3px solid var(--on); border-radius: 0; }
  .path li:hover .path-card { transform: none; }
}

/* Учебный год: вертикальная линия на телефоне, горизонтальная на широком экране */
.year { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); }
.year li { position: relative; min-width: 0; padding: 26px 16px 8px 0; border-top: 2px solid var(--border); }
.year li::before { content: ""; position: absolute; top: -8px; left: 0; width: 14px; height: 14px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 4px var(--bg); }
.year .year-when { margin: 0 0 4px; font-size: 13px; font-weight: 700; color: var(--accent-strong); }
.year h3 { margin-bottom: 4px; font-size: 18px; }
.year p:last-child { margin: 0; color: var(--muted); font-size: 15px; }

/* Кому подойдёт */
.fits { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.fit h3 { margin: 10px 0 6px; }
.fit p:last-child { margin: 0; color: var(--muted); font-size: 16px; }
.fits-note { margin: 24px 0 0; font-size: 17px; }

/* Демо-урок */
.demo-video { margin: 0 auto; max-width: 960px; display: grid; gap: 10px; }
.demo-video video { width: 100%; aspect-ratio: 16 / 9; display: block; border-radius: var(--radius); background: #0b1020; border: 1px solid var(--border); }
.demo-video figcaption { text-align: center; }

/* Оплата по QR самозанятого */
.qr-pay { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.qr-pay h1 { font-size: clamp(22px, 3.4vw, 30px); margin: 0; }
.qr-pay .price-big { font-family: var(--font-display); font-size: clamp(28px, 4vw, 40px); font-weight: 700; color: var(--accent-strong); margin: 0; }
.qr-img { width: min(280px, 100%); height: auto; border-radius: var(--radius); border: 1px solid var(--border); background: #fff; padding: 8px; }
.qr-steps { text-align: left; margin: 0; padding-left: 22px; display: grid; gap: 6px; max-width: 480px; }
.qr-payee { margin: 0; }
.qr-details { color: var(--muted); font-size: 14px; max-width: 480px; }
.qr-details p { margin: 0; }
.qr-pay .ok { color: var(--accent-strong); font-weight: 600; max-width: 480px; }
.qr-pay .note { color: var(--muted); font-size: 14px; margin: 0; }
.qr-pay .muted { color: var(--muted); margin: 0; }

/* ---------- Правки «без шаблона» (ветка site-plain): первый экран, уровни, преподаватели, занятие ---------- */
/* В этих блоках заголовок по левому краю и без подписи сверху */
.plain .section-head { text-align: left; margin-left: 0; max-width: 720px; }
.plain .section-more { text-align: left; }

/* Первый экран: ровный фон без сетки и пятен, список без рамок */
.hero-home::before, .hero-home .hero-art::before { display: none; }
.hero-home .hero-mascot::before { display: none; }
.hero-home .hero-mascot .mascot { filter: none; }
.hero-home .hero-text ul { flex-direction: column; flex-wrap: nowrap; gap: 6px; align-items: flex-start; }
.hero-home .hero-text li { background: none; border: 0; padding: 0; border-radius: 0; font-size: 17px; font-weight: 500; }
.hero-home .hero-text li::before { width: 10px; height: 2px; margin: 0 4px 0 0; border: 0; background: var(--accent-strong); transform: none; }
@media (max-width: 860px) { .hero-home .hero-text ul { align-items: flex-start; text-align: left; } }

/* Уровни недели: без рамок, линия сверху, текст слева */
.levels { gap: 28px; }
.level { background: none; border: 0; border-top: 2px solid var(--border); border-radius: 0; box-shadow: none; padding: 18px 0 0; text-align: left; align-items: flex-start; }
.level-down { border-top-style: dashed; }
.level .level-pic { width: 84px; height: 84px; background: none; margin: 0 0 8px -6px; }

/* Как проходит занятие: карточки остаются, вместо оранжевого квадрата с цифрой время крупно сверху */
.timeline li { padding: 22px 22px 22px; }
.timeline li::before { display: none; }
.timeline .tl-time { position: static; display: block; margin: 0 0 10px; font-family: var(--font-display); font-size: 22px; font-weight: 800; line-height: 1.1; color: var(--ink); }
.timeline .tl-time::after { content: ""; display: block; width: 28px; height: 2px; margin-top: 10px; background: var(--accent-strong); }
.plain .teachers-grid { justify-content: start; }

/* =====================================================================
   Обновление главной (декабрь 2026): полировка, первый экран с доской, короткий ритм,
   цены с переключателем, цвет по делу, плавность. Блоки идут поверх стилей выше.
   ===================================================================== */
/* ===== 1. Полировка: вид тот же, исправлены мелочи по скиллам ===== */

/* Заголовки без висячих слов, абзацы без одиноких слов в конце (Vercel, better-typography) */
h1, h2, h3, .ptab-head { text-wrap: balance; }
p, li, blockquote, figcaption { text-wrap: pretty; }
/* «мате-матика»: слова и так влезают, автоперенос не нужен (site.css: hyphens: auto) */
@media (max-width: 600px) { .hero h1, .page-hero h1 { hyphens: manual; } }

/* Цифры одинаковой ширины: суммы и номера стоят ровно */
.price, .save-value, .ptab-price, .tl-time, .path-n, .pc-price { font-variant-numeric: tabular-nums; }

/* Кнопки «нажимаются» (emil-design-eng: 100–160 мс, scale 0.97), без задержки двойного тапа */
a, button, label, summary, input, select, textarea { touch-action: manipulation; }
.btn { transition: background-color .15s, color .15s, border-color .15s, box-shadow .15s, transform .12s ease-out; }
.btn:active { transform: scale(.97); }
.btn:active .arrow { transform: translateX(3px); }

/* Звёзды отзывов: #b07800 давал 3,8:1, токен предупреждения даёт AA в обеих темах */
.stars { color: var(--warning); }

/* Длинные примечания не тянутся на 1200 px: 70 знаков в строке */
.section-more.small { max-width: 72ch; }
.section-more.small:not(.plain .section-more) { margin-left: auto; margin-right: auto; }

/* Преподаватели: 5 в ряд на широком экране, 3 + 2 на планшете, без одинокой карточки */
@media (min-width: 1100px) { .teachers-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (min-width: 640px) and (max-width: 1099px) { .teachers-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 639px) {
  .teachers-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .teachers-grid > :last-child:nth-child(odd) { grid-column: 1 / -1; justify-self: center; width: calc(50% - 10px); }
}

/* Форма: галочки крупнее, вся строка согласия нажимается */
.check { min-height: 44px; padding: 6px 0; align-items: center; }
.check input { width: 22px; height: 22px; margin: 0; }

/* Телефон: шапка в одну строку, разделы в раскрывающемся меню (работает без JS) */
.mnav { display: none; }
@media (max-width: 920px) {
  :root { --header-h: 64px; }
  .header-row { flex-wrap: nowrap; padding-top: 0; }
  .site-header .menu { display: none; }
  .header-actions .btn { min-height: 44px; }
  .header-actions .btn.secondary { display: none; }
  .mnav { display: block; position: relative; flex: none; }
  .mnav > summary {
    list-style: none; width: 44px; height: 44px; display: grid; place-items: center; cursor: pointer;
    border: 1px solid var(--border); border-radius: var(--radius-xs); color: var(--ink);
  }
  .mnav > summary::-webkit-details-marker { display: none; }
  .mnav > summary svg { width: 22px; height: 22px; }
  .mnav[open] > summary { background: var(--surface-2); }
  .mnav .mnav-panel {
    position: absolute; right: 0; top: calc(100% + 8px); width: min(280px, calc(100vw - 2 * var(--gutter)));
    display: flex; flex-direction: column; padding: 8px; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: 0 18px 40px -16px rgba(30, 42, 74, .35);
  }
  .mnav .mnav-panel a { min-height: 44px; display: flex; align-items: center; padding: 0 12px; text-decoration: none; color: var(--ink); font-weight: 500; border-radius: var(--radius-xs); }
  .mnav .mnav-panel a:hover { background: var(--surface-2); }
  .mnav .mnav-panel a.mnav-login { margin-top: 6px; border-top: 1px solid var(--border); border-radius: 0; padding-top: 6px; }
}
/* Меню свернулось в кнопку, место освободилось: кнопка темы снова видна на телефонах от 375px (уже 375 тема остаётся системной) */
@media (min-width: 375px) and (max-width: 480px) { .header-actions .theme-toggle { display: inline-grid; width: 44px; height: 44px; } .header-actions .theme-toggle[hidden] { display: none; } }

/* ===== 2. Живой первый экран: математика внутри композиции, а не в полях ===== */
.hero-v2 { text-align: left; padding: clamp(28px, 5vw, 72px) 0 clamp(36px, 5vw, 64px); }
.hero-v2::before { display: none; }
.hero-v2-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.hero-v2 h1 { margin: 0 0 18px; max-width: 13ch; font-size: clamp(34px, 5vw, 64px); }
.hero-v2-sub { font-size: clamp(18px, 1.6vw, 21px); color: var(--muted); max-width: 30ch; margin: 0 0 28px; }
.hero-v2-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; margin: 0; }
.hero-v2-link { font-weight: 650; text-decoration-thickness: 2px; text-underline-offset: 4px; }

/* Доска: клетчатая карточка с графиками, лемминг стоит у левого края и показывает на неё */
.board-wrap { position: relative; padding: 0 0 0 clamp(48px, 7vw, 110px); }
.board {
  position: relative; border-radius: var(--radius); border: 1px solid var(--border); background-color: var(--surface);
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 28px 28px; background-position: -1px -1px; box-shadow: 0 30px 60px -40px rgba(30, 42, 74, .55);
}
.board svg { display: block; width: 100%; height: auto; }
.board .axis { stroke: var(--muted); stroke-width: 1.4; opacity: .55; fill: none; }
.board .curve { stroke: var(--accent-strong); stroke-width: 3; fill: none; stroke-linecap: round; }
.board .ring { stroke: var(--ink); stroke-width: 2; fill: none; opacity: .55; }
.board .radius { stroke: var(--ink); stroke-width: 2; }
.board .trail { stroke: var(--orange); stroke-width: 4; fill: none; stroke-linecap: round; }
.board .dot { fill: var(--orange); }
.board .dot.ink { fill: var(--ink); }
.board .halo { fill: var(--orange); opacity: .22; }
.board .tangent { stroke: var(--ink); stroke-width: 2; stroke-linecap: round; opacity: .7; }
.board .f { font-family: var(--font-display); font-size: 21px; font-weight: 600; fill: var(--muted); }
.board .f.acc { fill: var(--accent-strong); font-weight: 700; }
.board-mascot { position: absolute; left: 0; bottom: -18px; width: clamp(120px, 15vw, 200px); height: auto; pointer-events: none; }

/* Движение: точка бежит по параболе, радиус вращается, ореол дышит, лемминг чуть покачивается.
   При «уменьшить движение» всё стоит, движущейся точки нет (SMIL из CSS не остановить). */
.board .mover { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .board .mover { display: inline; }
  .board .spin { transform-box: view-box; transform-origin: 112px 118px; animation: spin 18s linear infinite; }
  .board .halo { transform-box: fill-box; transform-origin: center; animation: halo 3s ease-in-out infinite; }
  .board-mascot { animation: float 6s ease-in-out infinite; }
}

/* Полоса фактов: то, что раньше было списком в первом экране */
.facts { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.facts-list { list-style: none; margin: 0 auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.facts-list li { padding: 22px 20px; display: flex; flex-direction: column; gap: 2px; }
.facts-list li + li { border-left: 1px solid var(--border); }
.facts-list b { font-family: var(--font-display); font-size: clamp(22px, 2.4vw, 28px); font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums; }
.facts-list span { color: var(--muted); font-size: 15px; line-height: 1.4; }

@media (max-width: 860px) {
  .hero-v2-grid { grid-template-columns: 1fr; gap: 28px; }
  .hero-v2 h1 { font-size: clamp(30px, 8.4vw, 44px); }
  .hero-v2-actions .btn { flex: 1 1 100%; }
  .hero-v2-link { margin: 0 auto; }
  .board-wrap { padding-left: 72px; }
  .board-mascot { width: 104px; bottom: -10px; }
  .facts-list { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0; }
  .facts-list li { padding: 16px var(--gutter); }
  .facts-list li:nth-child(3) { border-left: 0; }
  .facts-list li:nth-child(n+3) { border-top: 1px solid var(--border); }
}

/* ===== 3. Короче и ритмичнее: меньше блоков, разные схемы, одна тёмно-синяя полоса ===== */

/* Как проходит занятие: одна полоса на 90 минут, длина кусков пропорциональна времени */
.lesson-band { background: var(--lesson-bg); color: #eef3ff; }
.lesson-band h2 { color: #fff; }
.lesson-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px 48px; align-items: end; margin-bottom: 36px; }
.lesson-top p { margin: 0; color: #c9d3ea; font-size: 18px; }
.lesson-bar { display: grid; grid-template-columns: 15fr 10fr 60fr 5fr; gap: 4px; height: 64px; margin: 0 0 18px; }
.lesson-bar span { border-radius: var(--radius-xs); display: flex; align-items: center; padding: 0 14px; font-weight: 700; font-size: 15px; color: var(--navy); white-space: nowrap; overflow: hidden; }
.seg-1 { background: #9cc7ef; } .seg-2 { background: rgba(238, 243, 255, .22); color: #eef3ff !important; }
.seg-3 { background: var(--orange); } .seg-4 { background: #ffd36b; padding: 0 !important; justify-content: center; font-size: 13px !important; }
.lesson-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.lesson-steps li { padding-top: 14px; border-top: 3px solid; }
.lesson-steps li:nth-child(1) { border-color: #9cc7ef; } .lesson-steps li:nth-child(2) { border-color: rgba(238, 243, 255, .35); }
.lesson-steps li:nth-child(3) { border-color: var(--orange); } .lesson-steps li:nth-child(4) { border-color: #ffd36b; }
.lesson-steps h3 { color: #fff; margin: 0 0 4px; font-size: 18px; }
.lesson-steps .t { display: block; font-size: 14px; font-weight: 700; color: #9cc7ef; margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.lesson-steps p { margin: 0; color: #c9d3ea; font-size: 15.5px; }
.lesson-band .lesson-note { margin: 28px 0 0; color: #aab6d3; font-size: 15px; max-width: 72ch; }
@media (max-width: 860px) {
  .lesson-top { grid-template-columns: 1fr; }
  .lesson-bar { height: 44px; } .lesson-bar span { font-size: 13px; padding: 0 8px; }
  .lesson-bar .seg-2 b, .lesson-bar .seg-1 b, .lesson-bar .seg-4 b { display: none; }
  .lesson-steps { grid-template-columns: 1fr 1fr; gap: 20px 16px; }
}

/* Преподаватели: без рамок, в одну строку; на телефоне лента с прокруткой вбок */
.teachers-grid { gap: 20px; }
.teachers-grid .teacher-card { background: none; border: 0; box-shadow: none; padding: 0; }
.teachers-grid .avatar { width: 132px; height: 132px; }
@media (min-width: 1100px) { .teachers-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (max-width: 1099px) {
  .teachers-grid { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; margin: 0 calc(-1 * var(--gutter)); padding-left: var(--gutter); padding-right: var(--gutter); scrollbar-width: thin; }
  .teachers-grid .teacher-card { flex: 0 0 170px; scroll-snap-align: start; }
  .teachers-grid .avatar { width: 112px; height: 112px; }
}

/* Курсы: после вкладок сразу «Группы этого года» (блок «Как устроены все курсы» остался на странице «Курсы») */
.ptabs + .sub-head { margin-top: clamp(36px, 5vw, 56px); }

/* Результаты и отзывы: одна секция */
.results-join { padding-bottom: 24px; }
.reviews-join { padding-top: 24px; background: transparent; }
.reviews-join .reviews-head { margin-bottom: 20px; }
.reviews-join .reviews-sub { font-size: clamp(20px, 2.4vw, 24px); margin: 0; }

/* Путь ребёнка: на фоне второго уровня, чтобы не сливался с отзывами */
.path-alt { background: var(--surface-2); }

/* Призыв: без повторного списка шагов (они уже есть в «От заявки до результата») */
.cta-copy .steps { display: none; }

/* ===== 4. Цены, которые продают: период переключателем, две карточки вместо четырёх ===== */
.pricing { position: relative; max-width: 980px; margin: 0 auto; }
/* Радиокнопки спрятаны, но остаются в фокусе клавиатуры; работает без JavaScript */
.per-input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.per-switch { display: flex; width: max-content; max-width: 100%; margin: 0 auto 28px; padding: 4px; gap: 4px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.per-switch label { min-height: 44px; display: inline-flex; align-items: center; gap: 10px; padding: 0 20px; border-radius: var(--radius-sm); font-weight: 650; cursor: pointer; color: var(--muted); transition: background-color .15s, color .15s; }
.per-switch label:hover { color: var(--ink); }
.per-save { font-size: 13px; font-weight: 700; padding: 2px 8px; border-radius: var(--radius-xs); background: var(--success-soft); color: var(--success); font-variant-numeric: tabular-nums; }
#per-year:checked ~ .per-switch label[for="per-year"], #per-month:checked ~ .per-switch label[for="per-month"] { background: var(--switch-on-bg); color: var(--switch-on-fg); }
#per-year:focus-visible ~ .per-switch label[for="per-year"], #per-month:focus-visible ~ .per-switch label[for="per-month"] { outline: 3px solid var(--primary); outline-offset: 2px; }

.price-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.pc { display: flex; flex-direction: column; gap: 6px; padding: clamp(24px, 3vw, 32px); text-align: left; }
.pc h3 { margin: 0; font-size: 22px; }
/* Плашка сидит на рамке карточки и не сдвигает цену: строки обеих карточек на одной высоте */
.pc-tag { position: absolute; top: -13px; left: clamp(22px, 3vw, 30px); margin: 0; font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: var(--radius-xs); background: var(--navy); color: #fff; }
.pc-curator { position: relative; border: 2px solid var(--pc-curator-border); }
.pc-price { margin: 10px 0 0; font-family: var(--font-display); font-weight: 800; font-size: clamp(34px, 4vw, 44px); line-height: 1.05; }
.pc-price small { font-size: 17px; font-weight: 600; color: var(--muted); }
.pc-sub { margin: 0 0 14px; color: var(--muted); font-size: 15.5px; min-height: 3.2em; }
.pc-sub b { color: var(--success); font-weight: 700; }
.pc-list { list-style: none; margin: 0 0 22px; padding: 16px 0 0; border-top: 1px solid var(--border); display: grid; gap: 8px; flex: 1; }
.pc-list li { position: relative; padding-left: 26px; font-size: 15.5px; }
.pc-list li::before { content: ""; position: absolute; left: 2px; top: .45em; width: 7px; height: 12px; border: solid var(--success); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.pc .btn { align-self: stretch; }
/* Показываем цену выбранного периода */
.pc .m { display: none; }
#per-month:checked ~ .price-cards .y { display: none; }
#per-month:checked ~ .price-cards .m { display: inline; }
.pricing-note { margin: 20px auto 0; text-align: center; max-width: 72ch; }
@media (max-width: 720px) {
  .price-cards { grid-template-columns: 1fr; }
  .per-switch { width: 100%; } .per-switch label { flex: 1; justify-content: center; padding: 0 10px; }
}

/* ===== 5. Цвет по делу и движение по делу ===== */

/* Фоны секций различимы: обычные белые, второго уровня голубые (раньше #f2f7fd и #e6eef8 почти сливались) */
.section:not(.alt):not(.band):not(.lesson-band):not(.path-alt) { background: var(--sec-plain); }
a:hover { text-decoration-color: var(--accent-strong); }

/* Оранжевый только для действий и главных цифр: значки, полоски и иконки уходят в тёмно-синий */
.badge.orange { background: var(--surface-2); color: var(--ink); }
.eyebrow::before { background: var(--ink); opacity: .5; }
.timeline .tl-time::after { background: var(--ink); opacity: .35; }
.plan-curator { border-color: var(--border-strong); }
.ptab-benefits .icon { background: var(--surface-2); color: var(--ink); }
.footer-links svg { color: var(--muted); }
.course-card .motif { color: var(--surface-2); }
.course-card .num { background: var(--surface-2); color: var(--ink); }
.format { border-left-color: var(--ink); }
.review .mini { background: var(--surface-2); color: var(--ink); }
.format-list .tick { color: var(--success); }
.save-card { background: var(--navy); color: #fff; }
.save-card .save-value { color: var(--orange); border-right-color: rgba(255, 255, 255, .25); }
/* Победитель олимпиады остаётся оранжевым: это главная награда, а не украшение */
.result.prize .medal { background: var(--surface-2); color: var(--ink); }

/* Аватары без фото: палитра бренда вместо случайных бирюзы, фиолетового и коричневого */
.avatar.tone-0 { background: linear-gradient(135deg, #2e3d66, #1e2a4a 70%); color: var(--orange); }
.avatar.tone-1 { background: linear-gradient(135deg, #2e3d66, #1e2a4a 70%); color: #9cc7ef; }
.avatar.tone-2 { background: linear-gradient(135deg, #3a4f86, #24325a 70%); color: #ffc9a3; }
.avatar.tone-3 { background: linear-gradient(135deg, #24325a, #141c33 70%); color: #eef3ff; }

/* Карточки при наведении мягко приподнимаются вместо жёсткой оранжевой тени */
.linkcard:hover { transform: translateY(-3px); }

/* Первый экран старой версии: формулы больше не мерцают и не плавают без цели */
.hero-art .drift, .hero-art .pulse { animation: none !important; }

/* Появление при прокрутке (CSS, без библиотек). Где браузер не умеет, всё просто видно сразу */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .level, .teacher-card, .timeline li, .lesson-steps li, .course-card, .plan, .pc, .result, .path li, .ptabs, .format, .save-card, .per-switch {
      animation: rise linear both; animation-timeline: view(); animation-range: entry 5% cover 22%;
    }
    .level:nth-child(2), .teacher-card:nth-child(2), .lesson-steps li:nth-child(2), .course-card:nth-child(2), .pc:nth-child(2), .path li:nth-child(2) { animation-range: entry 12% cover 26%; }
    .level:nth-child(3), .teacher-card:nth-child(3), .lesson-steps li:nth-child(3), .course-card:nth-child(3), .path li:nth-child(3) { animation-range: entry 19% cover 30%; }
    .level:nth-child(4), .teacher-card:nth-child(4), .lesson-steps li:nth-child(4), .path li:nth-child(4) { animation-range: entry 26% cover 34%; }
    .teacher-card:nth-child(5), .path li:nth-child(5) { animation-range: entry 33% cover 38%; }
    .lesson-bar span { animation: grow linear both; animation-timeline: view(); animation-range: entry 10% cover 30%; transform-origin: left center; }
  }
}
@keyframes rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes grow { from { transform: scaleX(0.2); opacity: 0; } to { transform: none; opacity: 1; } }

/* ===== 6. Плавность: мягкие переходы везде, где что-то меняется. Только CSS.
   Частые действия (наведение, нажатие) быстрые: 80–250 мс. Редкие (первый экран, смена темы) длиннее.
   При «уменьшить движение» в системе ничего из этого не работает. ===== */

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }

  /* Смена темы: фон, текст и рамки перетекают, а не перещёлкиваются */
  body, .band, .section, .site-header, .site-footer, .facts, .card, .input, .board, .ptab, .ptab-list, .badge, .per-switch, .lesson-band {
    transition: background-color .4s var(--ease-io), border-color .4s var(--ease-io), color .4s var(--ease-io);
  }
  .linkcard { transition: background-color .4s var(--ease-io), border-color .25s, transform .35s var(--ease-out), box-shadow .35s var(--ease-out); }

  /* Кнопки: лёгкий подъём при наведении, быстрое «нажатие» */
  .btn { transition: background-color .2s var(--ease-out), color .2s, border-color .2s, box-shadow .3s var(--ease-out), transform .2s var(--ease-out); }
  .btn.orange:hover { transform: translateY(-2px); }
  .btn:active, .btn.orange:active { transform: scale(.97); transition-duration: .08s; }
  .btn .arrow { transition: transform .25s var(--ease-out); }
  a { transition: text-decoration-color .2s var(--ease-out), color .2s var(--ease-out); }

  /* Шапка: при прокрутке плавно появляется тень (по прокрутке, без скриптов) */
  @supports (animation-timeline: scroll()) {
    .site-header { animation: header-lift linear both; animation-timeline: scroll(root); animation-range: 0 140px; }
  }

  /* Первый экран: один раз при открытии. Заголовок не прячем: он главный элемент страницы и должен быть виден сразу */
  .hero-v2-sub { animation: enter .7s var(--ease-out) .05s both; }
  .hero-v2-actions { animation: enter .7s var(--ease-out) .15s both; }
  .board { animation: board-in .9s var(--ease-out) .1s both; }
  .board .curve { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.6s var(--ease-io) .45s forwards; }
  .board .ring { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.1s var(--ease-io) .3s forwards; }
  .board .axis { animation: fade .6s var(--ease-out) .2s both; }
  .board .f { animation: fade .6s var(--ease-out) 1.2s both; }
  .board .f.acc { animation-delay: 1.6s; }
  .board .mover { animation: fade .4s var(--ease-out) 1.9s both; }
  .board .spin { animation: fade .5s var(--ease-out) 1.3s both, spin 18s linear 1.3s infinite; }
  .board .dot.ink { animation: fade .4s var(--ease-out) .3s both; }
  .board-mascot { animation: mascot-in .9s var(--ease-out) .55s both, float 6s ease-in-out 1.5s infinite; }
  .facts-list li { animation: enter .6s var(--ease-out) both; }
  .facts-list li:nth-child(1) { animation-delay: .35s; } .facts-list li:nth-child(2) { animation-delay: .43s; }
  .facts-list li:nth-child(3) { animation-delay: .51s; } .facts-list li:nth-child(4) { animation-delay: .59s; }

  /* Вкладки курсов: новая вкладка проявляется, полоска активной вкладки перетекает */
  .ptab-panel { animation: panel-in .4s var(--ease-out); }
  .ptab { transition: background-color .25s var(--ease-out), border-color .3s var(--ease-out), color .2s; }

  /* Уровни и преподаватели: живой отклик на наведение */
  .level .level-pic { transition: transform .4s var(--ease-out); }
  .level:hover .level-pic { transform: translateY(-6px) rotate(-4deg); }
  .teacher-card .avatar { transition: transform .4s var(--ease-out), box-shadow .4s var(--ease-out); }
  .teacher-card:hover .avatar { transform: translateY(-4px) scale(1.03); box-shadow: 0 16px 30px -18px rgba(30, 42, 74, .55); }

  /* Меню на телефоне раскрывается из своей кнопки */
  .mnav[open] .mnav-panel { animation: menu-in .22s var(--ease-out); transform-origin: top right; }
  .mnav > summary svg { transition: transform .25s var(--ease-out); }
  .mnav[open] > summary svg { transform: rotate(90deg); }
}

/* Переключатель цен: подложка ездит между «За год» и «Помесячно», цифры перетекают.
   Обе цены лежат в одной ячейке, поэтому карточка не прыгает по высоте */
.per-switch { display: grid; grid-template-columns: 1fr 1fr; position: relative; isolation: isolate; }
.per-switch label { justify-content: center; background: none !important; position: relative; z-index: 1; }
.per-switch::before { content: ""; position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 6px); border-radius: var(--radius-sm); background: var(--switch-on-bg); }
#per-month:checked ~ .per-switch::before { transform: translateX(calc(100% + 4px)); }
#per-year:checked ~ .per-switch label[for="per-year"], #per-month:checked ~ .per-switch label[for="per-month"] { color: var(--switch-on-fg); }
.pc-price, .pc-sub { display: grid; }
.pc-price > span, .pc-sub > span { grid-area: 1 / 1; }
.pc .m, #per-month:checked ~ .price-cards .y { display: inline; opacity: 0; visibility: hidden; transform: translateY(8px); }
.pc .y, #per-month:checked ~ .price-cards .m { display: inline; opacity: 1; visibility: visible; transform: none; }
@media (prefers-reduced-motion: no-preference) {
  .per-switch::before { transition: transform .35s var(--ease-out), background-color .4s var(--ease-io); }
  .per-switch label { transition: color .25s var(--ease-out); }
  .pc-price > span, .pc-sub > span { transition: opacity .3s var(--ease-out), transform .4s var(--ease-out), visibility 0s linear .3s; }
  .pc .y, #per-month:checked ~ .price-cards .m { transition: opacity .3s var(--ease-out) .06s, transform .4s var(--ease-out) .06s, visibility 0s; }
}

@keyframes enter { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes board-in { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes mascot-in { from { opacity: 0; transform: translateX(-24px) rotate(-6deg); } to { opacity: 1; transform: none; } }
@keyframes panel-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes menu-in { from { opacity: 0; transform: scale(.96) translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes header-lift { to { box-shadow: 0 12px 32px -20px rgba(30, 42, 74, .5); } }

@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --accent-strong: #ff8a45;
  --band-bg: #111a30;
  --header-bg: rgba(17, 26, 48, 0.86);
  --header-border: rgba(238, 243, 255, 0.08);
  --cta-bg: #111a30;
  --footer-bg: #111a30;
  --hero-glow-1: rgba(255, 138, 69, 0.18);
  --hero-glow-2: rgba(255, 138, 69, 0.08);
  --hero-glow-3: rgba(142, 168, 224, 0.08);
  --grid-line: rgba(238, 243, 255, 0.05);
  --art-stroke: rgba(255, 138, 69, 0.5);
  --art-soft: rgba(238, 243, 255, 0.2);
  --art-dot: #ff8a45;
  --art-halo: rgba(255, 138, 69, 0.2);
  --art-trail: #ff8a45;
  --art-formula: rgba(238, 243, 255, 0.32);
  --art-formula-accent: rgba(255, 138, 69, 0.75);
  --pill-bg: rgba(255, 138, 69, 0.08);
  --pill-border: rgba(255, 138, 69, 0.3);
  --chip-bg: rgba(238, 243, 255, 0.06);
  --chip-border: rgba(238, 243, 255, 0.12);
  --focus-ring: rgba(255, 138, 69, 0.3);
  --orange-ring: none;
  --stars: #f2c25b;
  --field-bg: #111a30;
  --show-moon: none;
  --show-sun: block;
  --card-hover-shadow: 0 14px 30px -18px rgba(0, 0, 0, 0.7);
  --sec-plain: var(--bg);
  --link-underline: #4d5f8a;
  --lesson-bg: #0a1124;
  --switch-on-bg: var(--ink);
  --switch-on-fg: var(--navy);
  --pc-curator-border: var(--muted);
} }
