/* Лендинг mentorika.fun: афиша. Цвета, отступы, радиусы и длительности только из tokens.css.
   Один документ на 1440 и 390. Все длительности кратны такту --beat, движение читается как один ритм. */

/* ---------- база ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--space-6); }
body {
  --gutter: var(--gutter-desktop);
  --section: var(--space-28);
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font: 400 var(--text-body)/1.55 var(--font-text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  caret-color: var(--coral);
  accent-color: var(--ink);
}
::selection { background: var(--coral-soft); color: var(--ink); }
.on-coral ::selection { background: var(--surface); color: var(--ink); }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 0.18em; }
a:not(.btn) { text-decoration: none; }
h1, h2, h3, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input { font: inherit; color: inherit; }
button { appearance: none; -webkit-appearance: none; }
[hidden] { display: none; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 6px; }
.on-coral :focus-visible { box-shadow: 0 0 0 2px var(--coral), 0 0 0 4px var(--on-coral); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: min(var(--content-max), 100%); margin-inline: auto; }
.band { padding-left: var(--gutter); padding-right: var(--gutter); }
.formula { font-variant-numeric: tabular-nums lining-nums; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; text-wrap: balance; }
h2 { font-size: var(--text-display-lg); line-height: 1.05; letter-spacing: -0.03em; }
h3 { font-size: var(--text-display-sm); line-height: 1.25; }
.lead { font-size: var(--text-lead); line-height: 1.5; }
.muted { color: var(--ink-muted); }
.caption { font: 600 var(--text-caption)/1.4 var(--font-text); letter-spacing: 0.02em; color: var(--ink-muted); }
.placeholder { padding: 0 6px; border-radius: 6px; background: var(--surface-sunken); color: var(--ink-muted); font-weight: 500; }
.section { padding-top: var(--section); }
.on-coral { background: var(--coral); color: var(--on-coral); }
.on-coral .muted, .on-coral .caption { color: var(--on-coral); opacity: 0.82; }

/* ---------- иконки: 24 px, линия 1,75, currentColor ---------- */
.icon { flex: none; width: var(--icon); height: var(--icon); fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.icon--flame { fill: var(--coral); stroke: var(--ink); stroke-width: 1.5; paint-order: stroke fill; }

/* ---------- кнопки: одна главная на экран, всё круглое ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-3);
  height: var(--control-md); min-height: var(--touch-min); padding: 0 24px;
  border: var(--rule-strong) solid transparent; border-radius: var(--radius-full);
  background: transparent; color: var(--ink);
  font: 600 16px/20px var(--font-text); text-decoration: none; white-space: nowrap;
  cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
  transition: background-color calc(var(--beat) / 4) var(--ease-out), border-color calc(var(--beat) / 4) var(--ease-out), transform calc(var(--beat) / 8) var(--ease-out);
}
.btn .icon { width: 20px; height: 20px; }
.btn--sm { height: var(--control-sm); min-height: var(--control-sm); padding: 0 14px; font-size: 14px; }
.btn--sm .icon { width: 18px; height: 18px; }
.btn--lg { height: var(--control-lg); padding: 0 30px; font-size: 18px; }
.btn--xl { height: var(--control-xl); padding: 0 32px; font-size: 18px; }
.btn--icon { width: var(--control-md); padding: 0; }
.btn--icon.btn--sm { width: var(--control-sm); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn--primary { background: var(--action); border-color: var(--action); color: var(--on-action); }
.btn--primary:hover:not(:disabled) { background: color-mix(in srgb, var(--action) 86%, var(--surface)); border-color: transparent; }
.btn--secondary { border-color: var(--ink); }
.btn--secondary:hover:not(:disabled) { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.on-coral .btn--secondary { background: var(--surface); border-color: var(--surface); color: var(--ink); }
.btn--ghost { padding: 0 16px; }
.btn--ghost:hover:not(:disabled), .btn--ghost[aria-pressed="true"] { background: color-mix(in srgb, var(--ink) 8%, transparent); }

/* ---------- чип, стрик, штамп ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border: 1.5px solid transparent; border-radius: var(--radius-full); font: 600 13px/16px var(--font-text); white-space: nowrap; }
.chip .icon { width: 16px; height: 16px; stroke-width: 2; }
.chip--soft { background: var(--surface-sunken); }
.chip--ink { background: var(--action); color: var(--on-action); }
.chip--muted { background: var(--surface-sunken); color: var(--ink-muted); }
.streak { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 4px 12px 4px 8px; border-radius: var(--radius-full); background: var(--surface-raised); font: 600 13px/18px var(--font-text); white-space: nowrap; }
.streak--soft { background: var(--surface-sunken); }
.streak .icon { width: 18px; height: 18px; }
.check { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--coral); color: var(--on-coral); }
.check .icon { width: 14px; height: 14px; stroke-width: 2.6; }

/* ---------- задача, строки решения, кружок вокруг ошибки ---------- */
.task { display: flex; flex-direction: column; gap: 6px; }
.task__formula { font: 600 var(--text-formula)/1.15 var(--font-display); letter-spacing: -0.02em; }
.lines { position: relative; display: flex; flex-direction: column; gap: var(--space-2); }
.lines > .caption { margin: 0 0 2px 4px; }
.line {
  display: flex; align-items: center; gap: var(--space-3);
  min-height: 60px; padding: 8px 14px;
  border: var(--rule-strong) solid transparent; border-radius: var(--radius-md); background: var(--surface);
  transition: border-color calc(var(--beat) / 4) var(--ease-out), background-color calc(var(--beat) / 4) var(--ease-out), opacity calc(var(--beat) / 4) var(--ease-out);
}
.line__num { display: inline-flex; align-items: center; justify-content: center; flex: none; width: var(--line-badge); height: var(--line-badge); border-radius: var(--radius-full); background: var(--surface-sunken); font: 700 13px/1 var(--font-text); }
.line__num .icon { width: 14px; height: 14px; stroke-width: 2.6; }
.line__text { flex: 1 1 auto; min-width: 0; min-height: 1.3em; font: 500 22px/1.3 var(--font-text); }
.line--active { border-color: var(--ink); }
.line--active .line__num, .line--ok .line__num { background: var(--action); color: var(--on-action); }
.line--ok .line__num { animation: stamp calc(var(--beat) / 2) var(--ease-out) both; }
.line--pending { opacity: 0.62; }
.line--broken { border-color: var(--coral); background: var(--coral-soft); }
.line--broken .line__num { background: var(--coral); color: var(--on-coral); }
.line__note { margin: 18px 0 0; font: 600 var(--text-caption)/1.4 var(--font-text); }
.line__note[hidden] { display: none; }
/* выноска: от подписи вверх к обведённому знаку, рисуется штрихом после кружка */
.leader { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.leader path { fill: none; stroke: var(--ink); stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 100; stroke-dashoffset: 100; }
.leader circle { fill: var(--ink); opacity: 0; transform-box: fill-box; transform-origin: center; }
.leader.is-drawn path { animation: draw calc(var(--beat) * 0.75) var(--ease-out) both; animation-delay: var(--beat); }
.leader.is-drawn circle { animation: pop calc(var(--beat) / 2) var(--ease-out) both; animation-delay: calc(var(--beat) * 1.75); }
.tok { position: relative; display: inline-block; padding: 0 0.12em; background: none; color: inherit; }
.tok__ring { position: absolute; left: -0.3em; top: -0.22em; width: calc(100% + 0.6em); height: calc(100% + 0.44em); overflow: visible; pointer-events: none; }
.tok__ring ellipse { fill: none; stroke: var(--coral); stroke-width: 2.25; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 0; transform: rotate(-4deg); transform-origin: center; }
.line--broken .tok__ring ellipse { animation: draw calc(var(--beat) * 1.5) var(--ease-out) both; }

/* ---------- реплика тьютора, маскот, точки подсказок ---------- */
.tutor__bubble { position: relative; flex: 1 1 auto; min-width: 0; min-height: 52px; padding: 14px 16px; border-radius: var(--radius-lg); border-bottom-left-radius: 4px; background: var(--action); color: var(--on-action); font: 400 17px/1.5 var(--font-text); }
.dots { display: none; align-items: center; gap: 5px; height: 26px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--on-action); animation: blink calc(var(--beat) * 0.75) var(--ease-out) 2; }
.dots i:nth-child(2) { animation-delay: calc(var(--beat) / 4); }
.dots i:nth-child(3) { animation-delay: calc(var(--beat) / 2); }
.disc { display: flex; align-items: flex-end; justify-content: center; flex: none; border-radius: var(--radius-full); background: var(--coral); overflow: hidden; }
.disc img { width: 72%; transform: translateY(8%); }

/* ---------- плашка афиши ---------- */
.plate { position: relative; z-index: 1; border-radius: var(--radius-2xl); background: var(--surface-raised); color: var(--ink); }
.plate__bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); min-height: var(--control-sm); }

/* ---------- шапка: часть коралловой афиши ---------- */
.header { display: flex; align-items: center; justify-content: space-between; gap: var(--space-6); height: 72px; }
.brand { display: inline-flex; align-items: center; gap: var(--space-3); font: 700 20px/1 var(--font-display); letter-spacing: -0.01em; }
.disc--brand { width: 40px; height: 40px; background: var(--surface); }
.nav { display: flex; gap: var(--space-8); font: 500 16px/20px var(--font-text); }
.nav a { padding: 12px 0; border-bottom: var(--rule-strong) solid transparent; white-space: nowrap; transition: border-color calc(var(--beat) / 4) var(--ease-out); }
.nav a:hover { border-bottom-color: var(--cream-on-coral); }
.header__cta-short { display: none; }

/* ---------- первый экран: афиша с плашкой разбора ---------- */
.hero { padding-top: var(--space-4); padding-bottom: var(--space-16); }
.hero__grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: var(--space-16); align-items: start; padding-top: var(--space-12); }
.hero__copy { display: flex; flex-direction: column; gap: var(--space-8); }
.hero h1 { max-width: 15ch; font-size: var(--text-display-xl); line-height: 1; letter-spacing: -0.035em; }
.hero__s1 { display: block; text-wrap: balance; }
.hero h1 em { font-style: normal; text-decoration: underline; text-decoration-color: var(--cream-on-coral); text-decoration-thickness: 0.07em; text-underline-offset: 0.08em; }
.hero .lead { max-width: 30em; font-weight: 500; }
.hero__cta { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-4); }
.hero__note { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 8px 14px; border-radius: var(--radius-md); background: var(--surface); color: var(--ink); font: 500 14px/20px var(--font-text); }
.hero__note span + span::before { content: "·"; margin-right: 10px; color: var(--ink-muted); }
.hero__demo { position: relative; }
.peek { position: absolute; z-index: 0; right: 32px; top: -60px; width: 104px; transform: rotate(9deg); }
.demo { display: flex; flex-direction: column; gap: var(--space-4); padding: 20px 28px 28px; }
.demo .line { min-height: 56px; }
.demo .tutor__bubble { font-size: 16px; }
.demo .task__formula { font-size: var(--text-formula); }
.demo__form { display: flex; gap: var(--space-2); }
.demo__input { flex: 1 1 auto; min-width: 0; height: 52px; padding: 0 18px; border: 1.5px solid var(--line-strong); border-radius: var(--radius-full); background: var(--surface-raised); transition: border-color calc(var(--beat) / 4) var(--ease-out), background-color calc(var(--beat) / 4) var(--ease-out); }
.demo__input::placeholder { color: var(--ink-muted); }
.demo__input:disabled { background: var(--surface); }
.demo__form .btn--icon { width: 52px; height: 52px; }
.demo__actions { display: flex; gap: 6px; }
.demo__actions .btn { height: 40px; font-size: 15px; }
.demo__try { display: none; }
.demo[data-state="done"] .demo__actions { display: none; }
.demo[data-state="done"] .demo__try { display: flex; }
/* лента диалога: фиксированная высота, реплики прижаты к низу и прокручиваются как в чате */
.thread { display: flex; flex-direction: column; height: 236px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
.thread::-webkit-scrollbar { display: none; }
.thread__list { display: flex; flex-direction: column; gap: var(--space-2); margin-top: auto; }
.thread__list:empty::before { content: "Тьютор проверит, когда решение будет записано"; align-self: center; margin-bottom: var(--space-6); font: 500 var(--text-caption)/1.4 var(--font-text); color: var(--ink-muted); }
.turn { display: flex; align-items: flex-start; gap: var(--space-3); }
.turn .disc { width: var(--avatar); height: var(--avatar); margin-top: 2px; }
.turn--tutor .tutor__bubble { flex: 0 1 auto; max-width: calc(100% - var(--avatar) - var(--space-3)); }
.turn--child { justify-content: flex-end; }
.child__bubble { max-width: 78%; padding: 10px 14px; border-radius: var(--radius-lg); border-bottom-right-radius: 4px; background: var(--surface-sunken); color: var(--ink); font: 500 16px/1.4 var(--font-text); }
.tutor__bubble--typing { min-height: 44px; padding: 9px 16px; }
.tutor__bubble--typing .dots { display: inline-flex; }
.demo__play { flex: none; margin-left: auto; }
.demo[data-autoplay="off"] .demo__play .icon { display: none; }

/* ---------- типы ошибок: плакатная строка имён, читается в своём темпе ---------- */
.names { padding-top: var(--space-6); padding-bottom: var(--space-6); border-bottom: var(--rule) solid var(--line); }
.names__row { display: flex; align-items: baseline; gap: var(--space-6); }
.names__label { flex: none; font-size: var(--text-caption); line-height: 1.4; letter-spacing: 0.02em; white-space: nowrap; }
.names__list { display: grid; grid-template-columns: repeat(2, minmax(0, max-content)); gap: 6px var(--space-10); font: 700 20px/1.4 var(--font-display); letter-spacing: -0.02em; }
.names__list li { position: relative; padding-left: 22px; }
.names__list li::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 10px; height: 10px; border-radius: 50%; background: var(--coral); }

@keyframes draw { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }
@keyframes stamp { from { transform: scale(1.6); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pop { from { transform: scale(0.4); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes blink { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }

/* ---------- ≤ 1200 ---------- */
@media (max-width: 1200px) {
  body { --gutter: 48px; --text-display-xl: 64px; }
  .hero__grid { gap: var(--space-10); }
}
/* ---------- ≤ 1100: ссылкам шапки не хватает места рядом с кнопкой ---------- */
@media (max-width: 1100px) {
  .nav { display: none; }
}
/* ---------- ≤ 960 ---------- */
@media (max-width: 960px) {
  .hero__grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-10); padding-top: var(--space-6); }
  .hero h1 { max-width: none; }
  .hero__demo { margin-top: var(--space-8); }
  .peek { right: 24px; top: -70px; width: 108px; }
}
/* ---------- ≤ 480: телефон 390 ---------- */
@media (max-width: 480px) {
  body { --gutter: var(--gutter-mobile); --section: var(--space-16); --text-display-xl: 40px; --text-display-lg: 32px; --text-display-md: 26px; --text-display-sm: 20px; --text-formula: 26px; --text-lead: 18px; }
  .header { height: 64px; }
  .brand { font-size: 18px; }
  .disc--brand { width: 36px; height: 36px; }
  .header__cta-full { display: none; }
  .header__cta-short { display: inline; }
  .hero { padding-top: var(--space-2); padding-bottom: var(--space-10); }
  .hero__grid { padding-top: var(--space-4); }
  .hero__copy { gap: var(--space-5); }
  .hero h1 { line-height: 1; }
  .hero .lead { line-height: 1.45; }
  .hero__cta, .hero__note { width: 100%; }
  .hero__cta .btn { width: 100%; height: var(--control-lg); padding: 0 24px; font-size: 17px; }
  .hero__demo { margin-top: var(--space-10); }
  .plate { border-radius: var(--radius-xl); }
  .demo { gap: var(--space-4); padding: 18px 16px 20px; }
  .line { min-height: 52px; padding: 6px 12px; }
  .line__text { font-size: 19px; }
  .tutor__bubble { font-size: 15px; line-height: 1.45; }
  .demo__actions .btn { padding: 0 12px; }
  .thread { height: 212px; }
  .child__bubble { max-width: 84%; font-size: 15px; }
  .peek { right: 12px; top: -62px; width: 92px; }
  .names__row { flex-direction: column; gap: var(--space-2); }
  .names__list { grid-template-columns: minmax(0, 1fr); gap: 4px; font-size: 17px; }
  .names__list li { padding-left: 18px; }
  .names__list li::before { width: 8px; height: 8px; top: 0.6em; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; }
  /* финальные состояния задаются явно, а не через свёрнутые анимации; селекторы не слабее анимирующих */
  .line--ok .line__num, .leader.is-drawn circle, .leader circle { animation: none; opacity: 1; transform: none; }
  .leader.is-drawn path, .leader path, .line--broken .tok__ring ellipse, .tok__ring ellipse { animation: none; stroke-dashoffset: 0; }
  .dots i { animation: none; opacity: 1; }
  .demo__play { display: none; }
}

/* ---------- три правила: плакатные колонки на жирной линейке ---------- */
.rules { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: var(--space-10); border-top: var(--rule-strong) solid var(--ink); }
.rule { display: flex; flex-direction: column; padding: var(--space-8) var(--space-8) var(--space-4) 0; }
.rule + .rule { padding-left: var(--space-8); border-left: var(--rule) solid var(--line); }
.rule:last-child { padding-right: 0; }
.rule h3 { font-size: 28px; line-height: 1.15; letter-spacing: -0.025em; }
.rule h3 + p { margin-top: var(--space-3); font-size: var(--text-body); line-height: 1.5; color: var(--ink-muted); }
.rule__state { display: flex; align-items: center; min-height: 40px; margin-bottom: var(--space-5); }
.line--mini { min-height: 40px; padding: 4px 12px 4px 6px; border-radius: var(--radius-full); background: var(--surface-raised); }
.line--mini .line__text { font-size: 18px; }
.returns { display: inline-flex; gap: 6px; }
.chip--ghost { border-color: var(--line-strong); color: var(--ink-muted); }

@media (max-width: 960px) {
  .rules { grid-template-columns: minmax(0, 1fr); }
  .rule { padding: var(--space-6) 0; }
  .rule + .rule { padding-left: 0; border-left: 0; border-top: var(--rule) solid var(--line); }
}
@media (max-width: 480px) {
  .rules { margin-top: var(--space-6); }
  .rule { padding: var(--space-5) 0; }
  .rule h3 { font-size: 22px; }
  .rule h3 + p { font-size: 16px; }
  .rule__state { margin-bottom: var(--space-4); }
}

/* ---------- маршрут урока: тропинка через пять остановок, диски стоят на ней в шахматном порядке ---------- */
.route { position: relative; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--space-4); margin-top: var(--space-16); }
.route__trail { position: absolute; z-index: 0; left: 0; top: 0; width: 100%; height: 176px; overflow: visible; }
.route__trail path { fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 1 11; clip-path: inset(-10px 0 -10px 0); transition: clip-path calc(var(--beat) * 4) var(--ease-out); }
.stop { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: var(--space-2); text-align: center; transition: opacity var(--beat) var(--ease-out) calc(var(--beat) / 2 * var(--i, 0) + var(--beat)), transform var(--beat) var(--ease-out) calc(var(--beat) / 2 * var(--i, 0) + var(--beat)); }
.stop:nth-of-type(even) { padding-top: 64px; }
.stop__art { display: grid; place-items: center; width: 112px; height: 112px; margin-bottom: var(--space-4); border: var(--rule-strong) solid var(--line); border-radius: 50%; background: var(--surface-raised); }
.picto { width: 60px; height: 60px; fill: var(--ink); }
.picto .tint { fill: var(--coral); opacity: 0.35; }
.stop h3 { max-width: 14ch; font-size: 20px; line-height: 1.25; text-wrap: balance; }
.stop p { max-width: 24ch; font-size: var(--text-small); line-height: 1.5; color: var(--ink-muted); }
.route.is-out .route__trail path { clip-path: inset(-10px 100% -10px 0); }
.route.is-out .stop { opacity: 0; transform: translateY(10px); }

@media (max-width: 1200px) {
  .stop h3 { font-size: 18px; }
  .stop__art { width: 100px; height: 100px; }
  .picto { width: 54px; height: 54px; }
}
@media (max-width: 960px) {
  .route { grid-template-columns: minmax(0, 1fr); gap: var(--space-6); margin-top: var(--space-8); }
  .route__trail { display: none; }
  .route::before { content: ""; position: absolute; z-index: 0; left: 39px; top: 40px; bottom: 40px; border-left: 2.5px dotted var(--ink); clip-path: inset(0 0 0 0); transition: clip-path calc(var(--beat) * 4) var(--ease-out); }
  .route.is-out::before { clip-path: inset(0 0 100% 0); }
  .stop, .stop:nth-of-type(even) { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 2px var(--space-4); align-items: start; padding-top: 0; text-align: left; }
  .stop__art { grid-row: 1 / 3; width: 80px; height: 80px; margin: 0; }
  .picto { width: 46px; height: 46px; }
  .stop h3, .stop p { max-width: none; }
}
@media (max-width: 480px) {
  .route { gap: var(--space-5); margin-top: var(--space-6); }
  .route::before { left: 35px; top: 36px; bottom: 36px; }
  .stop, .stop:nth-of-type(even) { grid-template-columns: 72px minmax(0, 1fr); }
  .stop__art { width: 72px; height: 72px; }
  .picto { width: 42px; height: 42px; }
  .stop h3 { font-size: 18px; }
  .stop p { font-size: 15px; }
}

/* ---------- как начать: три шага родителя, номера несут порядок ---------- */
.begin { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: var(--space-10); border-top: var(--rule-strong) solid var(--ink); }
.begin__step { display: flex; flex-direction: column; padding: var(--space-8) var(--space-8) var(--space-4) 0; }
.begin__step + .begin__step { padding-left: var(--space-8); border-left: var(--rule) solid var(--line); }
.begin__step:last-child { padding-right: 0; }
.begin__num { font: 700 28px/1 var(--font-display); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.begin__step h3 { margin-top: var(--space-5); font-size: 24px; line-height: 1.2; letter-spacing: -0.02em; }
.begin__step p { margin-top: var(--space-3); font-size: var(--text-body); line-height: 1.5; color: var(--ink-muted); }
.begin__ui { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: auto; padding-top: var(--space-5); }

@media (max-width: 960px) {
  .begin { grid-template-columns: minmax(0, 1fr); }
  .begin__step { padding: var(--space-6) 0; }
  .begin__step + .begin__step { padding-left: 0; border-left: 0; border-top: var(--rule) solid var(--line); }
}
@media (max-width: 480px) {
  .begin { margin-top: var(--space-6); }
  .begin__step { padding: var(--space-5) 0; }
  .begin__step h3 { margin-top: var(--space-3); font-size: 21px; }
  .begin__step p { font-size: 16px; }
}

/* ---------- родителям: текст и пример итогов недели, который заполняется на глазах ---------- */
.parents { display: grid; grid-template-columns: minmax(0, 1fr) 460px; gap: var(--space-16); align-items: start; }
.parents__text { display: flex; flex-direction: column; gap: var(--space-5); }
.parents__text .lead { font-size: 19px; }
.check-list { display: flex; flex-direction: column; margin-top: var(--space-2); border-top: var(--rule-strong) solid var(--ink); }
.check-list li { display: flex; align-items: flex-start; gap: 14px; padding: 14px 0; border-bottom: var(--rule) solid var(--line); font-size: 18px; line-height: 1.45; }
.digest { display: flex; flex-direction: column; gap: var(--space-5); padding: 20px 28px 28px; }
.digest__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); }
.digest__title { font: 700 22px/1.3 var(--font-display); letter-spacing: -0.01em; }
.digest__sub { font-size: 14px; line-height: 18px; color: var(--ink-muted); }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--space-2); }
.week__day { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: var(--touch-min); border: var(--rule-strong) solid transparent; border-radius: var(--radius-sm); background: var(--surface-sunken); color: var(--ink-muted); font: 600 13px/16px var(--font-text); transition: background-color calc(var(--beat) / 2) var(--ease-out) calc(var(--beat) / 4 * var(--i, 0)), color calc(var(--beat) / 2) var(--ease-out) calc(var(--beat) / 4 * var(--i, 0)); }
.week__day .icon { width: 14px; height: 14px; stroke-width: 2.4; transition: opacity calc(var(--beat) / 2) var(--ease-out) calc(var(--beat) / 4 * var(--i, 0)); }
.week__day--done { background: var(--action); color: var(--on-action); }
.week__day--today { border-color: var(--ink); color: var(--ink); }
.week__day--done.week__day--today { border-color: var(--coral); color: var(--on-action); }
.digest.is-out .week__day--done { background: var(--surface-sunken); color: var(--ink-muted); }
.digest.is-out .week__day .icon { opacity: 0; }
.digest__stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: var(--radius-md); background: var(--surface); }
.stat__value { font: 700 26px/30px var(--font-display); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat__label { font: 500 13px/18px var(--font-text); color: var(--ink-muted); }
.digest__label { margin-bottom: var(--space-2); }
.digest__row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: 12px 0; border-top: var(--rule) solid var(--line); }
.digest__row b { font: 600 15px/20px var(--font-text); }
.digest__row small { display: block; margin-top: 2px; font: 400 13px/18px var(--font-text); color: var(--ink-muted); }
.digest__val { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.digest__val b { font: 700 17px/22px var(--font-text); }
.digest__val span { font: 500 12px/16px var(--font-text); color: var(--ink-muted); }
.digest__topic { display: flex; justify-content: space-between; margin-bottom: var(--space-2); font: 600 15px/20px var(--font-text); }
.digest__topic .muted { font-weight: 500; }
.progress { position: relative; height: 10px; border-radius: var(--radius-full); background: var(--surface-sunken); overflow: hidden; }
.progress__fill { position: absolute; inset: 0; border-radius: var(--radius-full); background: var(--coral); transform: scaleX(var(--to, 0)); transform-origin: left center; transition: transform calc(var(--beat) * 2) var(--ease-out) calc(var(--beat) / 2); }
.digest.is-out .progress__fill { transform: scaleX(0); }
.digest__bot { display: flex; flex-direction: column; gap: var(--space-2); padding-top: var(--space-4); border-top: var(--rule) solid var(--line); }
.digest__bot .tutor__bubble { font-size: 15px; line-height: 1.45; padding: 12px 14px; }

@media (max-width: 1200px) {
  .parents { grid-template-columns: minmax(0, 1fr) 400px; gap: var(--space-12); }
}
@media (max-width: 960px) {
  .parents { grid-template-columns: minmax(0, 1fr); gap: var(--space-8); }
}
@media (max-width: 480px) {
  .parents__text .lead { font-size: 17px; }
  .check-list li { padding: 12px 0; font-size: 16px; }
  .digest { gap: var(--space-4); padding: 16px 16px 20px; }
  .digest__head { flex-direction: column; align-items: flex-start; gap: 2px; }
  .digest__title { font-size: 20px; }
  .digest__stats { gap: 6px; }
  .stat { padding: 12px; }
  .stat__value { font-size: 22px; line-height: 26px; }
}

/* ---------- что уже есть: задачник «сейчас» и «скоро» ---------- */
.honest { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-16); margin-top: var(--space-10); }
.honest__col h3 { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-3); font-size: 20px; line-height: 1.3; }
.honest__list { border-top: var(--rule-strong) solid var(--ink); }
.honest__list li { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-4); padding: 14px 0; border-bottom: var(--rule) solid var(--line); font-size: 18px; line-height: 1.45; }
.honest__list li span + span { flex: none; font: 500 var(--text-small)/1.4 var(--font-text); color: var(--ink-muted); white-space: nowrap; }
.free { display: flex; align-items: center; justify-content: space-between; gap: var(--space-8); margin-top: var(--space-12); padding: 28px 32px; border-radius: var(--radius-2xl); background: var(--surface-raised); }
.free__title { font: 600 22px/1.35 var(--font-text); }
.free p { margin-top: 4px; font-size: 16px; line-height: 1.5; color: var(--ink-muted); }

/* ---------- вопросы: аккордеон на details ---------- */
.faq { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--space-16); align-items: start; margin-top: var(--space-10); }
.faq__col { border-top: var(--rule-strong) solid var(--ink); }
.faq details { border-bottom: var(--rule) solid var(--line); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-5) 0; list-style: none; cursor: pointer; font: 600 19px/1.35 var(--font-text); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .icon { flex: none; width: 22px; height: 22px; transition: transform calc(var(--beat) / 3) var(--ease-out); }
.faq details[open] summary .icon { transform: rotate(45deg); }
.faq p { padding: 0 var(--space-10) var(--space-5) 0; font-size: 16px; line-height: 1.55; color: var(--ink-muted); }
.faq p a { text-decoration: underline; text-decoration-color: var(--coral); text-decoration-thickness: 2px; }

@media (max-width: 960px) {
  .honest { grid-template-columns: minmax(0, 1fr); gap: var(--space-8); }
  .faq { grid-template-columns: minmax(0, 1fr); }
  .faq__col + .faq__col { border-top: 0; }
}
@media (max-width: 480px) {
  .honest { margin-top: var(--space-6); }
  .honest__list li { font-size: 16px; }
  .honest__list li span + span { font-size: 13px; }
  .free { flex-direction: column; align-items: stretch; gap: var(--space-4); margin-top: var(--space-8); padding: var(--space-5); border-radius: var(--radius-xl); }
  .free .btn { width: 100%; height: var(--control-lg); }
  .faq { margin-top: var(--space-6); }
  .faq summary { padding: var(--space-4) 0; font-size: 17px; }
  .faq p { padding-right: 0; font-size: 15px; }
}

/* ---------- финал: вторая афиша, маскот крупно ---------- */
.final { margin-top: var(--section); padding-top: 88px; }
.final__grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--space-12); align-items: end; padding-bottom: var(--space-16); }
.final h2 { max-width: 14ch; font-size: var(--text-display-xl); line-height: 1; letter-spacing: -0.035em; }
.final .lead { max-width: 30em; margin-top: var(--space-6); font-weight: 500; }
.final__cta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4) var(--space-6); margin-top: var(--space-8); }
.final__soon { font: 600 16px/20px var(--font-text); }
.final__mascot { justify-self: end; width: 320px; height: 320px; background: var(--surface); }
.final__mascot img { width: 78%; transform: translateY(6%); }

/* ---------- подвал: светлая плашка на коралле ---------- */
.footer-band { padding-bottom: var(--space-10); }
.footer { display: flex; flex-direction: column; gap: var(--space-6); padding: 28px 32px; border-radius: var(--radius-2xl); background: var(--surface); color: var(--ink); }
.footer__top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-10); }
.footer__logo { width: 220px; padding: 10px 16px; border-radius: var(--radius-md); background: var(--coral); }
.footer__links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-2) var(--space-10); font: 500 16px/28px var(--font-text); }
.footer__links a { text-decoration: underline; text-decoration-color: transparent; text-decoration-thickness: 2px; text-underline-offset: 4px; transition: text-decoration-color calc(var(--beat) / 4) var(--ease-out); }
.footer__links a:hover { text-decoration-color: var(--coral); }
.footer__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-2) var(--space-6); padding-top: var(--space-5); border-top: var(--rule) solid var(--line); font-size: 14px; line-height: 20px; color: var(--ink-muted); }

/* ---------- плавающая кнопка: после первого экрана, до финала ---------- */
.float { position: fixed; z-index: 20; left: 50%; bottom: 28px; transform: translate(-50%, 12px); opacity: 0; pointer-events: none; transition: opacity calc(var(--beat) / 3) var(--ease-out), transform calc(var(--beat) / 3) var(--ease-out); }
.float[data-visible="true"] { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.float .btn { box-shadow: var(--shadow-float); }

@media (max-width: 960px) {
  .final__grid { grid-template-columns: minmax(0, 1fr); }
  .final__mascot { justify-self: start; width: 200px; height: 200px; }
  .footer__top { flex-direction: column; align-items: flex-start; }
  .footer__links { justify-content: flex-start; }
}
@media (max-width: 480px) {
  .final { padding-top: 56px; }
  .final__grid { gap: var(--space-6); padding-bottom: var(--space-10); }
  .final .lead { margin-top: var(--space-4); }
  .final__cta .btn { width: 100%; height: var(--control-lg); }
  .final__mascot { justify-self: end; width: 140px; height: 140px; }
  .footer-band { padding-bottom: calc(var(--space-16) + var(--safe-bottom) + 40px); }
  .footer { padding: var(--space-5); border-radius: var(--radius-xl); }
  .footer__logo { width: 180px; }
  .footer__links { flex-direction: column; gap: 4px; font-size: 15px; }
  .float { left: var(--space-4); right: var(--space-4); bottom: calc(var(--space-4) + var(--safe-bottom)); transform: translateY(12px); }
  .float[data-visible="true"] { transform: none; }
  .float .btn { width: 100%; height: var(--control-lg); }
}

/* ---------- модалка старта: два выбора, потом контакт, на выходе своя ссылка ---------- */
.modal { width: min(520px, calc(100% - 32px)); max-height: calc(100% - 32px); margin: auto; padding: 0; border: 0; border-radius: var(--radius-2xl); background: var(--surface-raised); color: var(--ink); overflow: auto; }
.modal::backdrop { background: var(--scrim); }
.modal__form { position: relative; display: flex; flex-direction: column; gap: var(--space-5); padding: 28px 32px 28px; }
.modal__close { position: absolute; top: 16px; right: 16px; }
.modal__head { display: flex; flex-direction: column; gap: var(--space-3); padding-right: 48px; }
.modal__title { font-size: var(--text-display-md); line-height: 1.1; letter-spacing: -0.025em; }
.modal__progress { display: inline-grid; grid-template-columns: repeat(3, 22px); gap: 4px; }
.modal__progress i { height: 6px; border-radius: var(--radius-full); background: var(--surface-sunken); }
.modal__progress i[hidden] { display: none; }
.modal__progress .is-done { background: var(--action); }
.modal__progress .is-now { background: var(--coral); }
.step { display: flex; flex-direction: column; gap: var(--space-3); margin: 0; padding: 0; border: 0; min-width: 0; }
.step[hidden] { display: none; }
.step legend, .step h3 { padding: 0; font: 700 20px/1.3 var(--font-text); letter-spacing: 0; }
.step legend { margin-bottom: var(--space-2); }
.choice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
.choice__item { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border: var(--rule-strong) solid var(--line); border-radius: var(--radius-md); cursor: pointer; transition: border-color calc(var(--beat) / 4) var(--ease-out), background-color calc(var(--beat) / 4) var(--ease-out); }
.choice__item input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.choice__item:has(input:checked) { border-color: var(--ink); background: var(--surface); }
.choice__item:has(input:focus-visible) { box-shadow: var(--focus-ring); }
.choice__item:has(input:disabled) { opacity: 0.5; cursor: not-allowed; }
.choice__name { font: 600 17px/1.3 var(--font-text); }
.choice__note { font: 500 var(--text-caption)/1.4 var(--font-text); color: var(--ink-muted); }
.field { display: flex; flex-direction: column; gap: 6px; font: 600 14px/1.4 var(--font-text); }
.field input { height: 52px; padding: 0 16px; border: 1.5px solid var(--line-strong); border-radius: var(--radius-md); background: var(--surface-raised); font: 500 17px/1.3 var(--font-text); }
.field input::placeholder { color: var(--ink-muted); }
.consent { display: flex; align-items: flex-start; gap: 10px; font: 400 var(--text-small)/1.5 var(--font-text); }
.consent input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; }
.consent a { text-decoration: underline; text-decoration-color: var(--coral); text-decoration-thickness: 2px; }
.modal__hint { font: 400 var(--text-small)/1.5 var(--font-text); color: var(--ink-muted); }
.modal__error { padding: 10px 14px; border-radius: var(--radius-md); background: var(--coral-soft); font: 500 var(--text-small)/1.5 var(--font-text); }
.modal__error[hidden] { display: none; }
.modal__actions { display: flex; justify-content: flex-end; gap: var(--space-2); }
.modal__actions [hidden] { display: none; }
.step--done p { font-size: var(--text-body); line-height: 1.5; }
.step--done .btn { align-self: flex-start; }
.step--done .btn[hidden] { display: none; }
.modal__skip { font: 500 var(--text-small)/1.5 var(--font-text); color: var(--ink-muted); }
.modal__skip a { text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 480px) {
  .modal { width: calc(100% - 24px); max-height: calc(100% - 24px); border-radius: var(--radius-xl); }
  .modal__form { gap: var(--space-4); padding: 20px 18px 22px; }
  .modal__actions { flex-direction: column-reverse; }
  .modal__actions .btn { width: 100%; }
  .step--done .btn { align-self: stretch; }
}

/* ---------- документ: политика и согласие ---------- */
.doc { width: min(760px, 100%); margin-inline: auto; padding: var(--space-16) 0; }
.doc h1 { font-size: var(--text-display-lg); line-height: 1.05; letter-spacing: -0.03em; }
.doc .lead { margin-top: var(--space-6); }
.doc__meta { margin-top: var(--space-4); font-size: var(--text-small); line-height: 1.5; color: var(--ink-muted); }
.doc h2 { margin-top: var(--space-12); padding-top: var(--space-5); border-top: var(--rule-strong) solid var(--ink); font-size: var(--text-display-sm); line-height: 1.25; letter-spacing: -0.02em; }
.doc h2 + p, .doc h2 + ul { margin-top: var(--space-4); }
.doc p, .doc li { line-height: 1.6; }
.doc p + p { margin-top: var(--space-3); }
.doc__list { display: flex; flex-direction: column; gap: var(--space-3); }
.doc__list li { position: relative; padding-left: var(--space-6); }
.doc__list li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 10px; height: 10px; border-radius: 50%; background: var(--coral); }
.doc a:not(.btn) { text-decoration: underline; text-decoration-color: var(--coral); text-decoration-thickness: 2px; }
.doc__footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-3); width: min(760px, 100%); margin-inline: auto; padding: var(--space-6) 0 var(--space-12); border-top: var(--rule) solid var(--line); font-size: var(--text-small); }
.doc__footer a { font-weight: 600; text-decoration: underline; text-decoration-color: var(--coral); text-decoration-thickness: 2px; }

@media (max-width: 480px) {
  .doc { padding: var(--space-10) 0 var(--space-12); }
  .doc h2 { margin-top: var(--space-8); }
}
