/* Marsho French
   Идея: французская школьная тетрадь. Чернила — тёмные блоки, лист — светлые,
   красная ручка учителя — действия и исправления, сиреневые линии Seyès — структура. */

:root {
  --ink: #0F1D4A;
  --ink-2: #172A63;
  --ink-line: rgba(185, 178, 242, .2);
  --on-ink: #EEF0FA;
  --on-ink-muted: #A9B1D6;

  --paper: #FAFAF7;
  --card: #FFFFFF;
  --text: #0F1D4A;
  --muted: #4E5878;
  --line: #E2E0EE;

  --seyes: 139, 127, 217;
  --red: #D62F35;
  --red-hover: #BC252B;
  --red-on-ink: #FF7A7C;
  --pen: #1F3FBF;
  --lilac: #B9B2F2;

  /* цвета имён в отзывах, все читаются на --ink-2 */
  --n1: #B9B2F2;
  --n2: #FF8F8F;
  --n3: #7ED6A5;
  --n4: #F2C46D;
  --n5: #7CC6F5;

  --f-display: "Spectral", Georgia, "Times New Roman", serif;
  --f-body: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;

  --max: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --margin-w: 168px;

  /* одна кривая для плавных переходов: быстрый старт, мягкая остановка */
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- База ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 76px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font: 400 1rem/1.6 var(--f-body);
  -webkit-font-smoothing: antialiased;
}

@media (min-width: 720px) {
  body { font-size: 1.0625rem; }
}

h1, h2, h3, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; }

.wrap {
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

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

:focus-visible {
  outline: 2px solid var(--pen);
  outline-offset: 3px;
  border-radius: 6px;
}
.ink :focus-visible,
.topbar :focus-visible { outline-color: var(--lilac); }

::selection { background: rgba(var(--seyes), .3); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* блок ниже экрана ждёт, пока до него докрутят, и мягко проявляется (script.js → setupReveal) */
.will-reveal { opacity: 0; }
@media print {
  .will-reveal { opacity: 1; }
}

/* ---------- Типографика ---------- */

.ink {
  background: var(--ink);
  color: var(--on-ink);
}

.eyebrow,
.sheet__margin {
  font: 500 .75rem/1.4 var(--f-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.eyebrow { color: var(--lilac); }

.display {
  font-family: var(--f-display);
  font-weight: 300;
  font-size: clamp(2.5rem, 1.4rem + 4.6vw, 5rem);
  line-height: 1.02;
  letter-spacing: -.015em;
  text-wrap: balance;
}
.display em { font-style: italic; }

.h2 {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(1.9rem, 1.3rem + 2.4vw, 3.1rem);
  line-height: 1.08;
  letter-spacing: -.01em;
  text-wrap: balance;
}

.lead {
  max-width: 34em;
  color: var(--on-ink-muted);
  font-size: clamp(1.05rem, 1rem + .3vw, 1.2rem);
  line-height: 1.55;
}

.sub {
  max-width: 40em;
  margin-top: 12px;
  color: var(--muted);
}
.ink .sub { color: var(--on-ink-muted); }

/* ---------- Кнопки ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font: 600 .95rem/1.2 var(--f-body);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease, box-shadow .25s ease, transform .2s ease;
}
/* при наведении красная ручка «растекается» мягким ореолом по чернилам */
.btn:hover {
  background: var(--red-hover);
  box-shadow:
    0 0 0 4px rgba(255, 122, 124, .14),
    0 12px 30px -10px rgba(255, 90, 95, .55);
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .btn:hover { transform: translateY(-2px); }
}
.btn:active {
  transform: translateY(1px);
  box-shadow: 0 0 0 4px rgba(255, 122, 124, .14);
}

.btn--sm {
  min-height: 38px;
  padding: 8px 16px;
  font-size: .875rem;
}

.btn--main {
  width: 100%;
  min-height: 58px;
  padding: 14px 16px;
  gap: 8px;
  font-size: 1rem;
}
@media (min-width: 520px) {
  .btn--main {
    width: auto;
    padding: 16px 28px;
    gap: 10px;
    font-size: 1.0625rem;
  }
}

.btn__icon {
  flex: none;
  width: 22px; height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linejoin: round;
}

.btn--ghost {
  background: transparent;
  color: var(--on-ink);
  border: 1px solid var(--ink-line);
}
.btn--ghost:hover {
  background: var(--ink-2);
  border-color: rgba(185, 178, 242, .5);
  box-shadow: none;
}

.cta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  margin-top: 32px;
}
.cta__hint {
  color: var(--on-ink-muted);
  font: 400 .78rem/1.5 var(--f-mono);
}

/* Короткий путь к ценам: на телефоне в шапке нет меню.
   Небольшая кнопка-контур — второе действие после красной; стрелка пару раз подсказывает «ниже» */
.cta__alt {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin-top: 8px;
  padding: 0 18px 0 20px;
  border: 1px solid rgba(185, 178, 242, .45);
  border-radius: 999px;
  background: rgba(185, 178, 242, .08);
  color: var(--on-ink);
  font-weight: 500;
  font-size: .95rem;
  text-decoration: none;
  transition: background-color .2s ease, border-color .2s ease;
}
.cta__alt:hover {
  background: rgba(185, 178, 242, .16);
  border-color: var(--lilac);
}
.cta__arrow {
  flex: none;
  width: 18px; height: 18px;
  fill: none;
  stroke: var(--lilac);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: nudge-down 1.4s var(--ease) 1.5s 4;
}
@keyframes nudge-down {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

/* тонкая линия под ссылкой; при наведении поверх неё красная ручка ведёт черту слева направо */
.link {
  padding-bottom: 3px;
  background:
    linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat,
    linear-gradient(rgba(214, 47, 53, .35), rgba(214, 47, 53, .35)) 0 100% / 100% 1px no-repeat;
  color: var(--red);
  font-weight: 600;
  text-decoration: none;
  transition: background-size .4s cubic-bezier(.6, 0, .3, 1);
}
.link:hover { background-size: 100% 2px, 100% 1px; }

/* ---------- Шапка ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 29, 74, .94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--ink-line);
  color: var(--on-ink);
}

.topbar__in {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 60px;
}

.logo {
  display: inline-flex;
  align-items: baseline;
  gap: .28em;
  font-family: var(--f-display);
  font-size: 1.35rem;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}
.logo__a { font-weight: 500; }
.logo__b { font-style: italic; font-weight: 300; color: var(--lilac); }

.topnav {
  display: none;
  gap: 28px;
  margin-left: auto;
  font-size: .95rem;
}
.topnav a {
  position: relative;
  color: var(--on-ink-muted);
  text-decoration: none;
  transition: color .2s ease;
}
.topnav a:hover,
.topnav a[aria-current="true"] { color: var(--on-ink); }

/* раздел, который сейчас на экране, подчёркнут красной ручкой (script.js → setupNav) */
.topnav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: -7px;
  height: 2px;
  border-radius: 2px;
  background: var(--red-on-ink);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .35s var(--ease);
}
.topnav a[aria-current="true"]::after { transform: scaleX(1); }

.topbar .btn { margin-left: auto; }

@media (min-width: 960px) {
  .topnav { display: flex; }
  .topbar .btn { margin-left: 0; }
}

/* ---------- Главный экран ---------- */

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-block: 44px 72px;
}

/* Свет настольной лампы на чернильном столе. Стоит над тетрадью,
   на компьютере мягко идёт за курсором (script.js → setupLamp) */
.hero__lamp {
  --size: 760px;
  --glow: .2;
  position: absolute;
  z-index: -1;
  left: 84%;
  top: 8%;
  width: var(--size);
  height: var(--size);
  margin: calc(var(--size) / -2) 0 0 calc(var(--size) / -2);
  background: radial-gradient(closest-side,
    rgba(185, 178, 242, var(--glow)),
    rgba(185, 178, 242, calc(var(--glow) * .4)) 48%,
    rgba(185, 178, 242, 0));
  pointer-events: none;
  transition: transform 1.1s cubic-bezier(.2, .75, .25, 1);
}
/* на широком экране лист закрывает центр света, поэтому свет ярче и чуть выше листа */
@media (min-width: 1024px) {
  .hero__lamp { --size: 1100px; --glow: .3; left: 72%; top: 38%; }
}

.hero__grid {
  display: grid;
  gap: 56px;
}

/* Ритм первого экрана: внутри группы 8–12 px, между группами 20–28 px, перед действием 32–40 px.
   Отступы растут вместе с заголовком: на телефоне 20/32 px, на широком экране 28/40 px */
.hero .lead {
  margin-top: clamp(20px, .95rem + .6vw, 28px);
  text-wrap: balance; /* строки вступления примерно равной длины, без висящего хвоста */
}
.hero .cta { margin-top: clamp(32px, 1.7rem + .6vw, 40px); }
/* главное во вступлении светлее и с новой строки, подробности приглушены */
.lead__key {
  display: block;
  color: var(--on-ink);
}

.hero__demo { max-width: 540px; }

.hero__label {
  margin-bottom: 14px;
  color: var(--on-ink-muted);
  font: 400 .78rem/1.5 var(--f-mono);
}

/* На телефоне и планшете первый экран — одна колонка с кнопкой во всю ширину.
   Выравниваем его по центру, как обложку: текст вокруг кнопки стоит с ней по одной оси. */
@media (max-width: 1023px) {
  .hero__text,
  .hero__label { text-align: center; }
  .hero .lead { margin-inline: auto; }
  .hero .cta { align-items: center; }
  .hero__demo { margin-inline: auto; }
  .scenes { justify-content: center; }
}

/* узкие телефоны (iPhone SE и mini, большинство Android — 360–375 px):
   надпись кнопки помещается в одну строку без значка */
@media (max-width: 389px) {
  .btn--main .btn__icon { display: none; }
}

@media (min-width: 1024px) {
  .hero { padding-block: 88px 120px; }
  .hero__grid {
    grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
    gap: 72px;
    align-items: center;
  }
  .hero__demo { justify-self: end; width: 100%; }
}

/* Переключатель ситуаций */

.scenes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.scenes__tab {
  min-height: 44px;
  padding: 9px 13px;
  border: 1px solid var(--ink-line);
  border-radius: 999px;
  background: transparent;
  color: var(--on-ink-muted);
  font: 500 .875rem/1 var(--f-body);
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background-color .15s ease;
}
.scenes__tab:hover {
  color: var(--on-ink);
  border-color: rgba(185, 178, 242, .5);
}
.scenes__tab[aria-selected="true"] {
  background: var(--paper);
  border-color: var(--paper);
  color: var(--ink);
}
/* на узких телефонах все четыре ситуации — в одну строку */
@media (max-width: 389px) {
  .scenes__tab { padding-inline: 9px; }
}

/* Тетрадный лист Seyès: тонкие линии каждые 8 px, основные каждые 32 px, красные поля.
   Линии намеренно бледные: это фон, текст поверх них должен читаться с телефона */

.cahier {
  --row: 32px;
  --fine: 8px;
  --mx: 48px;
  --off: 6px;

  position: relative;
  /* высота — по самой длинной ситуации, чтобы лист не прыгал при переключении и не пустовал */
  min-height: calc(var(--row) * 12);
  padding: 24px 22px 32px calc(var(--mx) + 16px);
  border-radius: 3px;
  background-color: #fff;
  background-image:
    linear-gradient(to right,
      transparent calc(var(--mx) - 1px),
      rgba(214, 47, 53, .55) calc(var(--mx) - 1px),
      rgba(214, 47, 53, .55) calc(var(--mx) + 1px),
      transparent calc(var(--mx) + 1px)),
    linear-gradient(to bottom, rgba(var(--seyes), .26) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(var(--seyes), .09) 1px, transparent 1px),
    linear-gradient(to right, #fff var(--mx), transparent var(--mx)),
    linear-gradient(to right, rgba(var(--seyes), .12) 1px, transparent 1px);
  background-size:
    100% 100%,
    100% var(--row),
    100% var(--fine),
    100% 100%,
    var(--row) 100%;
  background-position:
    0 0,
    0 var(--off),
    0 var(--off),
    0 0,
    var(--mx) 0;
  box-shadow:
    0 40px 80px -32px rgba(0, 0, 0, .6),
    0 14px 28px -14px rgba(0, 0, 0, .4);
  color: var(--pen);
  transform: rotate(-1deg);
}

/* на узких телефонах фразы переносятся чаще — лист выше */
@media (max-width: 389px) {
  .cahier { min-height: calc(var(--row) * 13.5); }
}

/* при смене ситуации старая фраза гаснет, новая проявляется (script.js → setupCahier) */
.cahier__body { transition: opacity .15s ease; }
.cahier.is-switching .cahier__body { opacity: 0; }

.cahier__date,
.cahier__title,
.cahier__line {
  font-family: var(--f-display);
  line-height: var(--row);
}

.cahier__date {
  font-style: italic;
  font-size: 1.125rem;
}

.cahier__title {
  margin-top: var(--fine);
  font-size: 1.3rem;
  text-align: center;
  text-decoration: underline;
  text-decoration-color: var(--red);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 6px;
}

/* строка ученика: над первой строкой — полстроки под исправление красной ручкой
   (оно всегда в первых словах фразы), перенос идёт через обычную строку, без пустого ряда */
.cahier__line {
  margin-top: var(--fine);
  padding-block: calc(var(--row) / 2);
  font-size: 1.375rem;
  font-style: italic;
}

.cahier__ru,
.cahier__note {
  font-family: var(--f-body);
  font-size: .9375rem;
  line-height: 24px;
}

.cahier__ru {
  margin-top: var(--fine);
  color: #464E72;
}

.cahier__note {
  margin-top: 16px;
  color: var(--red);
  font-weight: 500;
}

/* исправление красной ручкой */
.fix {
  position: relative;
  white-space: nowrap;
}

.fix s {
  position: relative;
  text-decoration: none;
}
.fix s::after {
  content: "";
  position: absolute;
  left: -3px; right: -3px;
  top: 55%;
  height: 2px;
  border-radius: 2px;
  background: var(--red);
  transform: rotate(-7deg) scaleX(0);
  transform-origin: left center;
  transition: transform .45s cubic-bezier(.6, 0, .3, 1) .2s;
}

.fix ins {
  position: absolute;
  left: 50%;
  bottom: 88%;
  color: var(--red);
  font-size: .95em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, 6px) rotate(-4deg);
  transition: opacity .3s ease .6s, transform .3s ease .6s;
}

/* вставка без зачёркивания: галочка снизу */
.fix--add {
  display: inline-block;
  width: 0;
}
.fix--add::before {
  content: "";
  position: absolute;
  left: 0;
  top: .1em;
  width: 9px; height: 9px;
  border-top: 2px solid var(--red);
  border-left: 2px solid var(--red);
  transform: translateX(-50%) rotate(45deg);
  opacity: 0;
  transition: opacity .3s ease .25s;
}
.fix--add ins { bottom: 1em; }

.cahier__note {
  opacity: 0;
  transition: opacity .4s ease .9s;
}

.is-drawn .fix s::after { transform: rotate(-7deg) scaleX(1); }
.is-drawn .fix ins { opacity: 1; transform: translate(-50%, 0) rotate(-4deg); }
.is-drawn .fix--add::before { opacity: 1; }
.is-drawn .cahier__note { opacity: 1; }

@media (min-width: 720px) {
  .cahier { --mx: 64px; padding-right: 32px; }
  .cahier__line { font-size: 1.5rem; }
}

/* ---------- Светлые «тетрадные» блоки ---------- */

.notebook { background: var(--paper); }

.sheet__grid { padding-block: 64px; }
.sheet + .sheet .sheet__grid { padding-top: 16px; }

.sheet__margin {
  margin-bottom: 14px;
  color: var(--red);
}

@media (min-width: 1024px) {
  /* красная линия полей проходит через все листы подряд */
  .sheet__grid {
    display: grid;
    grid-template-columns: var(--margin-w) minmax(0, 1fr);
    column-gap: 48px;
    padding-block: 104px;
    background: linear-gradient(rgba(214, 47, 53, .42), rgba(214, 47, 53, .42)) no-repeat;
    background-size: 1.5px 100%;
    background-position: calc(var(--gutter) + var(--margin-w) + 23px) 0;
  }
  .sheet + .sheet .sheet__grid { padding-top: 8px; }
  .sheet__margin {
    margin: 0;
    padding-top: 16px;
    text-align: right;
  }
}

/* С чем ко мне приходят: три ситуации, у каждой своя запись на пробный */

.needs {
  display: grid;
  gap: 16px;
  margin-top: 32px;
}
@media (min-width: 900px) {
  .needs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.need {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}

.need__title { font: 400 1.45rem/1.2 var(--f-display); }
.need__text { color: var(--muted); }

/* ссылка прижата к низу карточки: в ряду все три стоят на одной линии */
.need__cta {
  margin-top: auto;
  padding-top: 6px;
}

/* Преподаватель */

.teacher {
  display: grid;
  gap: 28px;
  margin-top: 32px;
}

.teacher__photo {
  position: relative;
  overflow: hidden;
  aspect-ratio: 5 / 4;
  border-radius: 6px;
  background: var(--ink);
}
.teacher__mono {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--lilac);
  font: italic 300 8rem/1 var(--f-display);
}
.teacher__photo img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 25%;
}
.teacher__photo figcaption {
  position: absolute;
  left: 14px; bottom: 12px;
  color: #fff;
  font: 500 .75rem/1 var(--f-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* на телефоне монограмма без фото занимала треть экрана: теперь это аватар с именем, как в мессенджере */
@media (max-width: 719px) {
  .teacher { gap: 20px; }
  .teacher__photo {
    display: flex;
    align-items: center;
    gap: 14px;
    overflow: visible;
    aspect-ratio: auto;
    border-radius: 0;
    background: none;
  }
  .teacher__mono {
    position: static;
    flex: none;
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--ink);
    font-size: 2rem;
  }
  .teacher__photo figcaption {
    position: static;
    color: var(--text);
  }
}

@media (min-width: 720px) {
  .teacher {
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 40px;
    align-items: start;
  }
  .teacher__photo { aspect-ratio: 4 / 5; }
}
@media (min-width: 1024px) {
  .teacher { grid-template-columns: 290px minmax(0, 1fr); gap: 56px; }
}

.teacher__intro {
  max-width: 36em;
  font-size: 1.125rem;
  line-height: 1.6;
}

.facts,
.terms {
  border-top: 1px solid var(--line);
}
.facts { margin-top: 28px; }

.facts > div,
.terms > div {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 16px;
  padding-block: 13px;
  border-bottom: 1px solid var(--line);
}

.facts dt,
.terms dt {
  padding-top: .15em;
  color: var(--muted);
  font: 500 .75rem/1.8 var(--f-mono);
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* Форматы и цены */

.prices__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px 32px;
}

.currency {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
}
.currency__btn {
  min-height: 40px;
  padding: 8px 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 500;
  font-size: .875rem;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
}
.currency__btn:hover { color: var(--text); }
.currency__btn[aria-pressed="true"] {
  background: var(--ink);
  color: #fff;
}

.plans {
  display: grid;
  gap: 16px;
  margin-top: 32px;
}
@media (min-width: 720px) {
  .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.plan {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  transition: border-color .25s ease, box-shadow .25s ease, transform .25s ease;
}
@media (min-width: 1024px) {
  .plan { padding: 28px; }
}

/* карточка приподнимается, как лист, который взяли со стола */
@media (hover: hover) {
  .plan:not(.plan--soon):hover {
    border-color: rgba(var(--seyes), .45);
    box-shadow:
      0 2px 4px -2px rgba(15, 29, 74, .08),
      0 24px 48px -28px rgba(15, 29, 74, .45);
  }
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .plan:not(.plan--soon):hover { transform: translateY(-4px); }
}

.plan__name {
  font: 400 1.6rem/1.15 var(--f-display);
}

.plan__meta {
  color: var(--muted);
  font: 400 .8rem/1.4 var(--f-mono);
}

.plan__price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin-top: 8px;
}
.plan__price > .money:first-child {
  font: 400 2.6rem/1 var(--f-display);
  font-variant-numeric: lining-nums;
  letter-spacing: -.01em;
}
.plan__old {
  color: var(--muted);
  font: 400 1.15rem/1 var(--f-display);
  text-decoration: line-through;
  text-decoration-color: var(--red);
  text-decoration-thickness: 2px;
}
.plan__unit {
  color: var(--muted);
  font-size: .95rem;
}

.plan__rows {
  margin-top: auto;
  padding-top: 8px;
}
.plan__rows li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding-block: 9px;
  border-bottom: 1px dashed var(--line);
  font-size: .95rem;
}
.plan__rows li:first-child { border-top: 1px solid var(--line); }
.plan__rows .money {
  font-family: var(--f-mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.plan__rows em {
  margin-left: 6px;
  color: var(--red);
  font: 500 .72rem/1 var(--f-mono);
  letter-spacing: .05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.plan__per {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font: 400 .8rem/1.4 var(--f-mono);
}

/* запись на пробный из карточки: сообщение в WhatsApp называет формат (script.js → CONFIG.messages) */
.plan__cta { padding-top: 4px; }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chips li {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(var(--seyes), .12);
  font-size: .85rem;
}

.plan--soon {
  grid-column: 1 / -1;
  border: 1.5px dashed rgba(var(--seyes), .55);
  background: transparent;
}
.plan--soon .plan__text { max-width: 40em; }

.tag {
  color: var(--red);
  font: 500 .72rem/1.4 var(--f-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.included { margin-top: 48px; }

.included__title {
  color: var(--muted);
  font: 500 .75rem/1.4 var(--f-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.included__list {
  display: grid;
  gap: 14px 32px;
  margin-top: 18px;
}
@media (min-width: 720px) {
  .included__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.included__list li {
  position: relative;
  padding-left: 30px;
  color: var(--muted);
}
/* галочка учителя */
.included__list li::before {
  content: "";
  position: absolute;
  left: 2px; top: .35em;
  width: 15px; height: 8px;
  border-left: 2px solid var(--red);
  border-bottom: 2px solid var(--red);
  transform: rotate(-45deg);
}
.included__list strong {
  display: block;
  color: var(--text);
  font-weight: 600;
}

.terms { margin-top: 40px; }
.terms dd { color: var(--muted); }
.terms__more {
  margin-top: 18px;
  font-size: .95rem;
}
.terms__more a {
  color: var(--muted);
  text-decoration: underline;
  text-decoration-color: rgba(var(--seyes), .6);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: color .2s ease;
}
.terms__more a:hover { color: var(--pen); }

/* ---------- Отзывы ---------- */

.reviews { padding-block: 72px 56px; }
.reviews .h2 { margin-top: 14px; }
@media (min-width: 1080px) {
  .reviews { padding-block: 112px 88px; }
}

.reviews__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px 32px;
}

/* стрелки для мыши и для тех, кто не привык листать вбок (script.js → setupReviews) */
.chat-nav { display: flex; gap: 8px; }
.chat-nav[hidden] { display: none; }
.chat-nav__btn {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  padding: 0;
  border: 1px solid var(--ink-line);
  border-radius: 50%;
  background: transparent;
  color: var(--on-ink);
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease, opacity .2s ease;
}
.chat-nav__btn svg {
  width: 20px; height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.chat-nav__btn:hover:not(:disabled) {
  background: var(--ink-2);
  border-color: rgba(185, 178, 242, .5);
}
.chat-nav__btn:disabled {
  opacity: .3;
  cursor: default;
}

/* Лента сообщений листается вбок и встаёт по карточкам; края ленты мягко гаснут.
   Маска срезает всё за рамкой, поэтому обводка фокуса — внутри. */
.chat-scroller {
  margin: 28px calc(var(--gutter) * -1) 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 var(--gutter), #000 calc(100% - var(--gutter)), transparent);
  mask-image: linear-gradient(to right, transparent, #000 var(--gutter), #000 calc(100% - var(--gutter)), transparent);
}
.chat-scroller::-webkit-scrollbar { display: none; }
.chat-scroller:focus-visible { outline-offset: -2px; }

/* поля сверху и снизу — чтобы подъём и свечение при наведении не обрезались */
.chat {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: max-content;
  padding: 6px var(--gutter) 28px;
}

.msg {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 12px;
  flex: none;
  width: min(84vw, 360px); /* на телефоне справа виден край следующего сообщения */
  scroll-snap-align: start;
  padding: 14px 16px 10px;
  border-radius: 18px 18px 18px 6px;
  background: var(--ink-2);
  font-size: .975rem;
  line-height: 1.55;
  transition: box-shadow .3s ease, transform .3s ease;
}
.msg__name,
.msg__text { flex-basis: 100%; }
.msg p + p { margin-top: .6em; }

/* длинное сообщение свёрнуто до 7 строк; кнопка плавно раскрывает его целиком */
.chat.is-clampable .msg__text {
  max-height: calc(1.55em * 7);
  overflow: hidden;
  transition: max-height .45s var(--ease);
}
.msg.is-clamped:not(.is-open) .msg__text {
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent);
  mask-image: linear-gradient(to bottom, #000 55%, transparent);
}

.msg__more {
  min-height: 40px;
  margin-top: 2px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--hue);
  font: 600 .9rem/1.2 var(--f-body);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  cursor: pointer;
}
.msg__more[hidden] { display: none; }

/* сообщение подсвечивается цветом имени автора */
@media (hover: hover) {
  .msg:hover {
    box-shadow:
      inset 0 0 0 1px color-mix(in srgb, var(--hue) 45%, transparent),
      0 18px 44px -22px color-mix(in srgb, var(--hue) 45%, transparent);
  }
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .msg:hover { transform: translateY(-3px); }
}

.msg__name {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  color: var(--hue);
  font-weight: 600;
}
.msg__ava {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--hue);
  color: var(--ink);
  font-size: .875rem;
}
.msg .msg__time {
  margin: 4px 0 0 auto;
  color: var(--on-ink-muted);
  font: 400 .72rem/1 var(--f-mono);
  text-align: right;
}

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

.steps {
  display: grid;
  margin-top: 36px;
  counter-reset: step;
}

.steps li {
  position: relative;
  padding: 20px 0 20px 56px;
  border-top: 1px solid var(--line);
  counter-increment: step;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 4px; top: 14px;
  color: var(--red);
  font: 300 2.25rem/1 var(--f-display);
}
.steps h3 {
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.35;
}
.steps p {
  margin-top: 6px;
  color: var(--muted);
}

@media (min-width: 900px) {
  .steps {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 28px;
  }
  .steps li {
    padding: 64px 0 0;
    border-top: 2px solid var(--ink);
  }
  .steps li::before { left: 0; top: 16px; }
}

/* ---------- Вопросы ---------- */

.faq {
  max-width: 820px;
  margin-top: 28px;
  border-top: 1px solid var(--line);
}

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

.faq summary {
  position: relative;
  padding: 20px 44px 20px 0;
  font-weight: 500;
  font-size: 1.075rem;
  line-height: 1.4;
  list-style: none;
  cursor: pointer;
  transition: color .2s ease;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--pen); }
.faq summary::after {
  content: "";
  position: absolute;
  right: 8px; top: 50%;
  width: 10px; height: 10px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-70%) rotate(45deg);
  transition: transform .3s var(--ease);
}
/* пока ответ плавно сворачивается, details ещё открыт — стрелку возвращаем сразу (script.js → setupFaq) */
.faq details[open]:not(.is-closing) summary::after { transform: translateY(-25%) rotate(-135deg); }

.faq details p {
  max-width: 42em;
  padding-bottom: 22px;
  color: var(--muted);
}

/* ---------- Финал и подвал ---------- */

.final { padding-block: 80px 56px; }
.final__title { max-width: 13em; }
.final .lead { margin-top: 20px; }

@media (min-width: 1024px) {
  .final { padding-block: 128px 72px; }
}

.social {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 40px;
  margin-top: 72px;
  padding-top: 28px;
  border-top: 1px solid var(--ink-line);
}
.social[hidden] { display: none; }
.social__text {
  max-width: 30em;
  color: var(--on-ink-muted);
}
.social__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.social__list a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid var(--ink-line);
  border-radius: 999px;
  font-size: .9rem;
  text-decoration: none;
  transition: background-color .2s ease, border-color .2s ease;
}
.social__list a:hover {
  border-color: var(--lilac);
  background: var(--ink-2);
}

.footer {
  padding-block: 28px;
  border-top: 1px solid var(--ink-line);
  color: var(--on-ink-muted);
  font-size: .85rem;
}
.footer__in {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
}
.logo--quiet {
  color: var(--on-ink);
  font-size: 1.1rem;
}
