/* Главная «Красная ручка». Токены — в :root ниже; шрифты — в fonts.css. */
/* Сетка = клетка тетради. Каждый отступ кратен --cell, 12 колонок, справа красная линия полей.
   Сетку ломаем специально: «Проще.» и пятёрка заходят за поля, карточки лежат поверх колонок. */
:root {
  /* Цвет: бумага, свежий лист, графит, клетка, красная ручка */
  --paper: #EEF0EA;
  --sheet: #F8F9F5;
  --ink: #1C1D1A;
  --grid: #8FB0DA;
  --pen: #E5341F;
  --ink-soft: rgb(28 29 26 / .68);
  --ink-line: rgb(28 29 26 / .16);
  --grid-line: rgb(143 176 218 / .42);

  /* Шрифты: тяжёлый гротеск для крика, Голос для речи, моноширинный для кода */
  --f-display: "Dela Gothic One", "Golos Text", "PT Sans", sans-serif;
  --f-text: "Golos Text", "PT Sans", "Helvetica Neue", sans-serif;
  --f-mono: "JetBrains Mono", "PT Mono", monospace;            /* только код */

  /* Шкала размеров */
  --fs-1: .8125rem;
  --fs-2: 1rem;
  --fs-3: 1.3125rem;
  --fs-4: clamp(1.75rem, 1rem + 2.6vw, 3rem);
  --fs-5: clamp(2.25rem, .6rem + 4.6vw, 5.5rem);
  --fs-6: 17.2vw;
  --lh-tight: .92;
  --lh-text: 1.5;

  /* Сетка */
  --cell: 24px;
  --cols: 12;
  --fields: calc(var(--cell) * 4);
  --indent: calc(var(--cell) * 2);

  /* Движение. Ручку, карточки, буквы и курсор считает скрипт по физике (минимальный рывок, закон двух третей,
     трение, пружины). Кривые ниже только для наведения. */
  --ease-hand: cubic-bezier(.7, 0, .25, 1);
  --ease-out: cubic-bezier(.2, .8, .2, 1);
}
@media (max-width: 960px) {
  :root { --indent: 0px; }
}
@media (max-width: 720px) {
  :root { --cell: 16px; --fields: var(--cell); --fs-6: 19.7vw; }
}

html { background: var(--paper); color-scheme: light; }
[hidden] { display: none !important; }
img { max-width: 100%; }
/* Плавная прокрутка (Lenis) */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  margin: 0;
  position: relative;
  min-height: 100%;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: var(--cell) var(--cell);
  background-position: 16px 0;
  font: 400 var(--fs-2)/var(--lh-text) var(--f-text);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
/* Зерно бумаги */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 60;
  opacity: .5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .11 0 0 0 0 .11 0 0 0 0 .1 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}
/* Красная линия полей */
.fields-line {
  position: absolute;
  top: 0;
  bottom: 0;
  right: var(--fields);
  width: 2px;
  background: var(--pen);
  opacity: .5;
  pointer-events: none;
  z-index: 1;
}

a { color: inherit; }
:focus-visible { outline: 2px dashed var(--pen); outline-offset: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Полоса во всю ширину экрана: поля страницы внутри, холст ручки дотягивается до края */
.band {
  --gut-l: max(16px, env(safe-area-inset-left, 0px));
  --gut-r: max(16px, env(safe-area-inset-right, 0px));
  position: relative;
  box-sizing: border-box;
  margin-left: calc(-1 * var(--gut-l));
  margin-right: calc(-1 * var(--gut-r));
  padding-left: calc(var(--gut-l) + var(--indent));
  padding-right: var(--gut-r);
}

/* Курсор: без скрипта простая ручка, со скриптом нарисованная */
@media (pointer: fine) {
  html { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Cpath d='M3 3l5.5 1.6L25 21.1 21.1 25 4.6 8.5z' fill='%23E5341F' stroke='%231C1D1A' stroke-width='1.2' stroke-linejoin='round'/%3E%3Cpath d='M3 3l3.4 1 -2.4 2.4z' fill='%231C1D1A'/%3E%3C/svg%3E") 2 2, auto; }
  a, button, label { cursor: pointer; }
  .has-pen, .has-pen * { cursor: none; }
}
.pen {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 70;
  pointer-events: none;
  filter: drop-shadow(3px 5px 2px rgb(28 29 26 / .24));
  transition: filter .28s var(--ease-out), opacity .18s linear;
  will-change: transform;
}
.pen.is-up { filter: drop-shadow(10px 16px 6px rgb(28 29 26 / .15)); }
.pen.is-off { opacity: 0; }
.pen svg { display: block; margin-top: -10px; overflow: visible; transform-origin: 0 10px; }
.pen .metal { fill: #8C8F88; }
.pen .metal-hi { fill: var(--sheet); opacity: .55; }
.pen .ball { fill: var(--pen); }
.pen .grip { fill: var(--ink); }
.pen .ridge { stroke: var(--sheet); stroke-opacity: .22; stroke-width: .8; }
.pen .barrel { fill: var(--pen); }
.pen .hi { fill: var(--sheet); opacity: .32; }
.pen .lo { fill: var(--ink); opacity: .16; }
.pen .cap { fill: var(--ink); }
.pen-trail { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 50; }

/* ---------------------------------------------------------------- шапка */
.top {
  position: relative;
  z-index: 6;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--cell);
  min-height: calc(var(--cell) * 4);
  padding-inline: var(--indent);
  padding-block: var(--cell) 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: calc(var(--cell) / 2);
  font-weight: 600;
  text-decoration: none;
  justify-self: start;
}
.brand__mark {
  display: grid;
  place-items: center;
  width: var(--cell);
  height: var(--cell);
  background: var(--ink);
  color: var(--paper);
  font: 400 .8125rem/1 var(--f-display);
}
.date {
  margin: 0;
  text-align: center;
  font-weight: 500;
  line-height: var(--cell);
}
.top__nav {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: calc(var(--cell) * 1.5);
}

/* Ссылка с рисованным подчёркиванием */
.link {
  position: relative;
  text-decoration: none;
  font: inherit;
  font-weight: 500;
  color: inherit;
  padding: 0 0 4px;
  border: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='6' viewBox='0 0 60 6'%3E%3Cpath d='M1 4 C 10 1, 20 5, 30 3 S 50 1, 59 3' fill='none' stroke='%23E5341F' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") 0 100% / 60px 6px repeat-x;
  transition: background-position .6s var(--ease-hand);
}
.link:hover { background-position: 60px 100%; }

/* Кнопка: прямой угол, при наведении ручка обводит её от руки */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: calc(var(--cell) * 2.5);
  padding-inline: var(--cell);
  border: 0;
  background: var(--ink);
  color: var(--paper);
  font: 600 var(--fs-2)/1.2 var(--f-text);
  text-decoration: none;
}
.btn--small { min-height: calc(var(--cell) * 1.75); font-size: .9375rem; padding-inline: calc(var(--cell) * .75); }
.btn__ink {
  position: absolute;
  left: -40px;
  top: -32px;
  width: calc(100% + 80px);
  height: calc(100% + 64px);
  pointer-events: none;
  opacity: 0;
  transition: opacity .35s var(--ease-out);
  mix-blend-mode: multiply;
}
.btn.is-ringed .btn__ink { opacity: 1; transition: none; }

/* ---------------------------------------------------------------- главный экран */
.hero {
  padding-block: calc(var(--cell) * 2) calc(var(--cell) * 4);
  overflow: clip;
  min-height: calc(var(--cell) * 48);
}
.hero__title {
  position: relative;
  z-index: 3;
  margin: 0;
  font-weight: 600;
}
.old {
  display: block;
  font-size: var(--fs-5);
  line-height: 1.04;
  letter-spacing: -.025em;
  max-width: 13em;
}
.old__line {
  display: block;
  text-decoration-color: var(--pen);
  text-decoration-thickness: .07em;
}
.js-ink .old__line { text-decoration: none; }
.enough {
  display: block;
  width: max-content;
  margin-top: .06em;
  margin-left: calc(var(--cell) * 2);
  font: 400 var(--fs-6)/.84 var(--f-display);
  letter-spacing: -.02em;
  text-transform: uppercase;
  rotate: -3deg;
  transform-origin: 20% 60%;
}
.enough__l { display: inline-block; will-change: transform; }
.hero__lead {
  position: relative;
  z-index: 3;
  max-width: 30ch;
  margin: calc(var(--cell) * 2) 0 0;
  font-size: var(--fs-3);
  line-height: 1.45;
}
.hero__actions {
  position: relative;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--cell) calc(var(--cell) * 2);
  margin-top: calc(var(--cell) * 2);
}

/* Слой красной ручки: зачёркивания и отметки рисует скрипт */
.ink-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 4;
  opacity: .94;
  mix-blend-mode: multiply;
}

/* ---------------------------------------------------------------- карточки */
.pile {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}
.card {
  position: absolute;
  left: var(--x);
  top: calc(var(--y) * var(--cell));
  width: calc(var(--w) * var(--cell));
  rotate: var(--r);
  font-size: .875rem;
  line-height: 1.4;
}
.card__face {
  position: relative;
  padding: calc(var(--cell) * .75);
  background: var(--sheet);
  box-shadow: 0 0 0 1px var(--ink-line), 3px 4px 0 rgb(28 29 26 / .06);
}
.card__tag {
  display: block;
  margin-bottom: 8px;
  font-size: var(--fs-1);
  font-weight: 500;
  color: var(--ink-soft);
  letter-spacing: .02em;
}
/* Скотч */
.tape::before {
  content: "";
  position: absolute;
  z-index: 2;
  top: -11px;
  left: 50%;
  width: 72px;
  height: 22px;
  translate: -50% 0;
  rotate: -4deg;
  background: rgb(248 249 245 / .62);
  box-shadow: 0 0 0 1px rgb(28 29 26 / .07);
}

/* Вопрос экзамена: карточка-каталожка с красной шапкой */
.c-csca .card__face { border-top: 3px solid var(--pen); }
.c-csca .q { margin: 0 0 10px; font-weight: 500; font-size: .9375rem; }
.c-csca ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.c-csca li { display: flex; gap: 8px; padding: 4px 6px; box-shadow: inset 0 0 0 1px var(--ink-line); }
.c-csca li b { font-weight: 600; }
.c-csca li.ok { box-shadow: inset 0 0 0 2px var(--ink); }

/* Код: тёмный лист */
.c-code .card__face { background: var(--ink); color: var(--paper); box-shadow: 3px 4px 0 rgb(28 29 26 / .1); }
.c-code .card__tag { color: rgb(238 240 234 / .62); }
.c-code pre { margin: 0; font: 500 .8125rem/1.6 var(--f-mono); white-space: pre; }
.c-code .out { margin-top: 10px; padding-top: 8px; border-top: 1px dashed rgb(238 240 234 / .3); color: var(--grid); }

/* Термин: синий стикер */
.c-term .card__face { background: var(--grid); box-shadow: 3px 4px 0 rgb(28 29 26 / .08); }
.c-term .en { display: block; font: 400 1.25rem/1.1 var(--f-display); }
.c-term .tr { display: block; margin-top: 6px; white-space: nowrap; }

/* Пуш: настоящая форма уведомления, у него углы скруглены */
.c-push .card__face, .c-pay .card__face { border-radius: 14px; padding: 12px 14px; }
.push__app { display: flex; justify-content: space-between; font-size: var(--fs-1); color: var(--ink-soft); margin-bottom: 4px; }
.push__title { display: block; font-weight: 600; }

/* Задача: оторванный листок в клетку */
.c-task .card__face {
  background:
    linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0 / 12px 12px,
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) 0 0 / 12px 12px,
    var(--sheet);
  clip-path: polygon(0 6px, 6% 0, 13% 5px, 21% 1px, 30% 6px, 38% 0, 47% 4px, 56% 0, 64% 6px, 73% 1px, 81% 5px, 90% 0, 100% 5px, 100% 100%, 0 100%);
  padding-top: calc(var(--cell) * 1.1);
}
.c-task .expr { display: block; font: 400 1.75rem/1.1 var(--f-display); }
.c-task .ans { display: inline-flex; align-items: baseline; gap: 10px; margin-top: 8px; font-weight: 600; font-size: 1.125rem; }
.c-task .tick { width: 26px; height: 22px; overflow: visible; }
.c-task .tick path { fill: none; stroke: var(--pen); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }

/* Доска: график */
.c-board .card__face { padding: 10px; }
.c-board svg { display: block; width: 100%; height: auto; }

/* Разбор ошибки */
.c-why .card__face { padding-left: calc(var(--cell) * 1.25); background: linear-gradient(90deg, transparent 12px, rgb(229 52 31 / .5) 12px, rgb(229 52 31 / .5) 14px, transparent 14px), var(--sheet); }
.c-why b { color: var(--pen); font-weight: 700; }

/* Раскладка карточек: компьютер. Сверху справа вопрос с разбором, под «Проще.» стопка, у края график */
.c-term  { --x: 41%; --y: .5; --w: 8;  --r: -6deg; }
.c-csca  { --x: 64%; --y: 2;  --w: 13; --r: 4deg; }
.c-why   { --x: 62%; --y: 8.4; --w: 10; --r: -4deg; }
.c-board { --x: 90%; --y: 24; --w: 9;  --r: 7deg; }
.c-code  { --x: 52%; --y: 29; --w: 11; --r: -5deg; }
.c-task  { --x: 72%; --y: 27; --w: 9;  --r: 5deg; }
.c-pay   { --x: 80%; --y: 33; --w: 11; --r: -4deg; }
.c-push  { --x: 60%; --y: 35.5; --w: 12; --r: 3deg; }

/* ---------------------------------------------------------------- задание 1: отметьте, что нужно */
.task {
  padding-block: calc(var(--cell) * 5) calc(var(--cell) * 7);
}
.task__kicker {
  margin: 0;
  font-size: var(--fs-1);
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  line-height: var(--cell);
  color: var(--ink-soft);
}
.task__title {
  position: relative;
  z-index: 3;
  max-width: 17em;
  margin: var(--cell) 0 0;
  font-size: var(--fs-4);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -.02em;
  text-wrap: balance;
}
.task__hint {
  margin: calc(var(--cell) / 2) 0 0;
  font-size: var(--fs-3);
  line-height: calc(var(--cell) * 1.5);
  color: var(--ink-soft);
}
.sheet { position: relative; z-index: 3; }
.sheet__list {
  list-style: none;
  margin: calc(var(--cell) * 2) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: calc(var(--cell) * 3);
  margin-right: calc(var(--fields) + var(--cell) * 1.5 - var(--gut-r));
}
.item {
  display: flex;
  align-items: flex-start;
  gap: calc(var(--cell) / 2);
  min-height: calc(var(--cell) * 2);
  padding-bottom: var(--cell);            /* свободная линия под строкой: место для пометки ручкой */
  box-sizing: border-box;
  font-size: 1.0625rem;
  line-height: var(--cell);
}
.item input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.item__box {
  flex: none;
  width: var(--cell);
  height: var(--cell);
  box-sizing: border-box;
  box-shadow: inset 0 0 0 1.5px var(--ink);
  transition: background-color .2s var(--ease-out);
}
.item:hover .item__box { background: rgb(143 176 218 / .3); }
.item input:focus-visible + .item__box { outline: 2px dashed var(--pen); outline-offset: 3px; }
.item__text { min-width: 0; }
/* Без скрипта галочку ставит браузер */
.sheet:not(.js-sheet) .item input:checked + .item__box { background: var(--ink); }
.sheet input:disabled + .item__box { opacity: 1; }
.sheet__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--cell) calc(var(--cell) * 2);
  margin-top: calc(var(--cell) * 2);
}
.sheet__note { margin: 0; color: var(--ink-soft); line-height: var(--cell); }
.sheet__result { margin-top: calc(var(--cell) * 3); }
.sheet__result[hidden] { display: none; }
.sheet__verdict {
  margin: 0;
  font-weight: 600;
  letter-spacing: -.025em;
}
.sheet__verdict span { display: block; }
.sheet__verdict .v1 { font-size: var(--fs-5); line-height: 1; width: fit-content; max-width: 100%; }
.sheet__verdict .v2 { margin-top: calc(var(--cell) / 2); font-size: var(--fs-4); line-height: 1.1; font-weight: 500; }
.sheet__result .hero__actions { margin-top: calc(var(--cell) * 1.5); }
.sheet__ink {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 4;
  opacity: .94;
  mix-blend-mode: multiply;
}


/* ---------------------------------------------------------------- задание 2: тетрадь листается прокруткой */
.flip { padding-block: calc(var(--cell) * 3) calc(var(--cell) * 4); }
.flip__title {
  margin: var(--cell) 0 0;
  max-width: 14em;
  font-size: var(--fs-4);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -.02em;
  text-wrap: balance;
}
/* Без скрипта кадры просто списком */
.flip__frames { list-style: none; margin: calc(var(--cell) * 2) 0 0; padding: 0; display: grid; gap: var(--cell); max-width: 44em; }
.flip__frames li { display: grid; grid-template-columns: calc(var(--cell) * 6) minmax(0, 1fr); gap: var(--cell); line-height: var(--cell); }
.flip__frames li::before { content: attr(data-time); font: 400 1.125rem/var(--cell) var(--f-display); }
.flip__frames b { display: block; font-weight: 600; }
.js-book .flip__frames { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.js-book .flip__track { height: calc(100vh + var(--n) * 58vh); }
.js-book .flip__stage {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  height: 100vh;
  height: 100svh;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: calc(var(--cell) * 13) minmax(0, 1fr);
  column-gap: calc(var(--cell) * 3);
  align-items: center;
  padding-block: calc(var(--cell) * 2);
  padding-right: calc(var(--fields) + var(--cell) - var(--gut-r));
}
.flip__index { position: relative; list-style: none; margin: calc(var(--cell) * 2) 0 0; padding: 0; }
.flip__tab {
  display: flex;
  align-items: baseline;
  gap: var(--cell);
  width: 100%;
  min-height: calc(var(--cell) * 2);
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-soft);
  font: 500 1rem/var(--cell) var(--f-text);
  text-align: left;
}
.flip__tab .t { min-width: 5.6em; font: 400 1.0625rem/var(--cell) var(--f-display); color: var(--ink); }
.flip__tab[aria-current="step"] { color: var(--ink); }
.flip__ring { position: absolute; inset: -16px -24px; width: calc(100% + 48px); height: calc(100% + 32px); pointer-events: none; mix-blend-mode: multiply; }
.flip__count { display: none; margin: 0; font: 400 1rem/1 var(--f-display); }

.book { position: relative; width: 100%; height: min(74vh, 640px); align-self: center; }
.book::before {                          /* тень раскрытой тетради на столе */
  content: "";
  position: absolute;
  inset: 3% 2% -2%;
  background: rgb(28 29 26 / .22);
  filter: blur(22px);
  border-radius: 8px;
}
/* Тетрадь рисует WebGL. Холст шире коробки: поднятый лист выходит за её края и не обрезается */
.book--gl canvas { position: absolute; left: -6%; top: -12%; width: 112% !important; height: 124% !important; pointer-events: none; }
.pg__phone { display: none; }


/* ---------------------------------------------------------------- задание 3: заявка */
.apply { padding-block: calc(var(--cell) * 6) calc(var(--cell) * 8); }
.apply__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: calc(var(--cell) * 3); margin-right: calc(var(--fields) + var(--cell) - var(--gut-r)); }
.apply__title {
  margin: var(--cell) 0 0;
  font: 400 clamp(2.75rem, 1rem + 5.6vw, 6.5rem)/.92 var(--f-display);
  letter-spacing: -.02em;
}
.apply__lead { margin: calc(var(--cell) * 1.5) 0 0; max-width: 30em; font-size: var(--fs-3); line-height: 1.45; }
.apply__form { position: relative; z-index: 3; display: grid; gap: calc(var(--cell) * 1.5); max-width: calc(var(--cell) * 24); align-content: start; }
.who { display: flex; flex-wrap: wrap; gap: calc(var(--cell) / 2) var(--cell); margin: 0; padding: 0; border: 0; }
.who__opt { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; line-height: var(--cell); }
.who__opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.who__dot { width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--ink); display: grid; place-items: center; }
.who__dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); transform: scale(0); transition: transform .25s var(--ease-out); }
.who__opt input:checked + .who__dot::after { transform: scale(1); }
.who__opt input:focus-visible + .who__dot { outline: 2px dashed var(--pen); outline-offset: 3px; }
.line { display: grid; gap: 2px; }
.line label { font-size: var(--fs-1); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-soft); line-height: var(--cell); }
.line .faint { text-transform: none; letter-spacing: 0; font-weight: 400; }
.line input {
  width: 100%;
  min-width: 0;
  height: calc(var(--cell) * 2);
  box-sizing: border-box;
  padding: 0 2px;
  border: 0;
  border-bottom: 1.5px solid var(--ink);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: 500 var(--fs-3)/1 var(--f-text);
  outline: none;
}
.line input::placeholder { color: rgb(28 29 26 / .35); }
.has-pen .line input { cursor: text; }
.consent { display: flex; align-items: flex-start; gap: calc(var(--cell) / 2); font-size: .9375rem; line-height: var(--cell); }
.consent input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.consent input:checked + .item__box { background: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink), inset 0 0 0 5px var(--paper); }
.consent input:focus-visible + .item__box { outline: 2px dashed var(--pen); outline-offset: 3px; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.apply__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--cell); margin-top: calc(var(--cell) / 2); }
.apply__note { margin: 0; color: var(--ink-soft); line-height: var(--cell); }
.apply__note.is-bad { color: var(--ink); font-weight: 500; }
.apply__done { position: relative; z-index: 3; max-width: calc(var(--cell) * 24); }
.apply__done[hidden] { display: none; }
.apply__done .apply__ok { margin: 0; font: 400 clamp(2.25rem, 1rem + 3.6vw, 4.5rem)/1 var(--f-display); width: fit-content; }
.apply__done p { margin: var(--cell) 0 0; font-size: var(--fs-3); line-height: 1.45; }
.apply__done .proto { font-size: var(--fs-1); color: var(--ink-soft); line-height: var(--cell); }
.apply__ink { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 4; mix-blend-mode: multiply; opacity: .94; }

/* ---------------------------------------------------------------- подвал: задняя обложка тетради */
.cover {
  z-index: 2;
  overflow: clip;
  background: var(--grid);
  color: var(--ink);
  padding-block: calc(var(--cell) * 4) calc(var(--cell) * 3 + env(safe-area-inset-bottom, 0px));
}
.cover__in { display: grid; grid-template-columns: minmax(0, 1fr); gap: calc(var(--cell) * 3); margin-right: calc(var(--fields) - var(--gut-r)); }
.cover__brand { display: grid; gap: calc(var(--cell) / 2); align-content: start; }
.cover__brand .brand { font-size: var(--fs-3); }
.cover__brand p { margin: 0; max-width: 24em; line-height: 1.45; }
.cover__links { display: flex; flex-wrap: wrap; gap: calc(var(--cell) / 2) calc(var(--cell) * 1.5); margin-top: var(--cell); }
.cover__links a { font-weight: 500; text-decoration: none; border-bottom: 1.5px solid rgb(28 29 26 / .4); line-height: 1.6; }
.cover__links a:hover { border-color: var(--ink); }
.times { position: relative; }
.times__head { margin: 0 0 calc(var(--cell) / 2); font: 400 1.125rem/1.2 var(--f-display); text-transform: uppercase; letter-spacing: .02em; }
.times__grid { display: grid; grid-template-columns: repeat(4, max-content); gap: var(--cell) calc(var(--cell) * 2); }
.times__col { margin: 0; padding: 0; list-style: none; font: 500 .875rem/1.55 var(--f-text); font-variant-numeric: tabular-nums; }
.times__col li { white-space: nowrap; }
.times__col .egg { position: relative; display: inline-block; }
.times__ink { position: absolute; inset: -20px; width: calc(100% + 40px); height: calc(100% + 40px); pointer-events: none; mix-blend-mode: multiply; }
.cover__fine { grid-column: 1 / -1; margin: 0; padding-top: var(--cell); border-top: 1.5px solid rgb(28 29 26 / .25); font-size: var(--fs-1); line-height: var(--cell); display: flex; flex-wrap: wrap; gap: calc(var(--cell) / 2) calc(var(--cell) * 1.5); }

/* ---------------------------------------------------------------- 404: работа над ошибками */
.lost {
  position: fixed;
  inset: 0;
  z-index: 40;
  overflow: auto;
  box-sizing: border-box;
  padding: calc(var(--cell) * 4 + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) calc(var(--cell) * 4) max(calc(16px + var(--indent)), env(safe-area-inset-left, 0px));
  background-color: var(--paper);
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: var(--cell) var(--cell);
  background-position: 16px 0;
}
.lost[hidden] { display: none; }
.lost__inner { position: relative; max-width: calc(var(--cell) * 36); }
.lost__code { display: block; margin-top: var(--cell); font: 400 clamp(6rem, 26vw, 22rem)/.8 var(--f-display); letter-spacing: -.03em; }
.lost__title { margin: calc(var(--cell) * 1.5) 0 0; font-size: var(--fs-4); font-weight: 600; line-height: 1.1; letter-spacing: -.02em; }
.lost__path { display: inline-block; margin-top: var(--cell); font: 500 var(--fs-3)/1.4 var(--f-mono); overflow-wrap: anywhere; }
.lost__text { margin: var(--cell) 0 0; max-width: 30em; font-size: var(--fs-3); line-height: 1.45; }
.lost__ink { position: absolute; inset: -64px; width: calc(100% + 128px); height: calc(100% + 128px); pointer-events: none; mix-blend-mode: multiply; }
.is-lost main, .is-lost .top, .is-lost .cover { visibility: hidden; }

@media (min-width: 960px) {
  .apply__grid { grid-template-columns: minmax(0, 1fr) minmax(0, calc(var(--cell) * 22)); align-items: start; }
  .cover__in { grid-template-columns: minmax(0, 1fr) max-content; }
}


/* ---------------------------------------------------------------- задача 3: тарифы как школьная задача */
.price { padding-block: calc(var(--cell) * 6) calc(var(--cell) * 7); }
.price__title { margin: var(--cell) 0 0; font-size: var(--fs-5); font-weight: 600; line-height: 1; letter-spacing: -.025em; max-width: 12em; text-wrap: balance; }
.price__grid { position: relative; z-index: 3; display: grid; grid-template-columns: minmax(0, 1fr); gap: calc(var(--cell) * 2) calc(var(--cell) * 4); margin-top: calc(var(--cell) * 3); margin-right: calc(var(--fields) + var(--cell) - var(--gut-r)); }
.given__h { margin: 0; font: 400 1.25rem/var(--cell) var(--f-display); }
.given__h + * { margin-top: var(--cell); }
.given { display: grid; gap: var(--cell); align-content: start; }
.given__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: calc(var(--cell) / 2) var(--cell); min-height: calc(var(--cell) * 2); border-bottom: 1.5px dashed rgb(28 29 26 / .25); font-size: 1.0625rem; }
.given__row > span:first-child { color: var(--ink-soft); }
.given__check { flex-wrap: nowrap; justify-content: flex-start; align-items: flex-start; gap: calc(var(--cell) / 2); cursor: pointer; padding-block: 10px; line-height: 1.4; }
.given__check .item__box { flex: none; margin-top: 2px; }
.given__check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.given__check input:checked + .item__box { background: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink), inset 0 0 0 5px var(--paper); }
.given__check input:focus-visible + .item__box { outline: 2px dashed var(--pen); outline-offset: 3px; }
.given__check span:last-child { color: var(--ink); }
.stepper { display: inline-flex; align-items: stretch; box-shadow: inset 0 0 0 1.5px var(--ink); }
.stepper button { width: calc(var(--cell) * 1.75); border: 0; background: none; color: var(--ink); font: 600 1.25rem/1 var(--f-text); }
.stepper button:hover { background: rgb(143 176 218 / .35); }
.stepper input { width: 3.2em; height: calc(var(--cell) * 1.75); border: 0; border-inline: 1.5px solid var(--ink); background: var(--sheet); color: var(--ink); font: 600 1.125rem/1 var(--f-text); text-align: center; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.period { display: inline-flex; box-shadow: inset 0 0 0 1.5px var(--ink); }
.period label { position: relative; }
.period input { position: absolute; opacity: 0; inset: 0; }
.period span { display: block; padding: 6px 12px; font-weight: 500; line-height: 1.4; }
.period input:checked + span { background: var(--ink); color: var(--paper); }
.period input:focus-visible + span { outline: 2px dashed var(--pen); outline-offset: 2px; }
.solve { display: grid; align-content: start; }
.solve__lines { margin: var(--cell) 0 0; padding-left: 1.4em; display: grid; gap: calc(var(--cell) / 2); font-size: var(--fs-3); line-height: 1.4; }
.solve__lines li::marker { font: 400 1rem var(--f-display); }
.solve__lines .calc { font-family: var(--f-mono); font-size: .95em; }
.answer { margin: calc(var(--cell) * 1.5) 0 0; font-size: clamp(1.5rem, 1rem + 1.4vw, 2.25rem); font-weight: 600; line-height: 1.15; letter-spacing: -.015em; }
.answer__h { display: block; margin-bottom: 10px; font: 400 1.25rem/var(--cell) var(--f-display); }
.answer__v { white-space: nowrap; }
.price__trial { margin: var(--cell) 0 calc(var(--cell) * 1.5); color: var(--ink-soft); line-height: 1.45; max-width: 32em; }
.solve .btn { justify-self: start; }
.plans-wrap { position: relative; z-index: 3; margin-top: calc(var(--cell) * 4); margin-right: calc(var(--fields) + var(--cell) - var(--gut-r)); overflow-x: auto; }
.plans { width: 100%; min-width: 620px; border-collapse: collapse; font-size: 1rem; font-variant-numeric: tabular-nums; }
.plans th, .plans td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1.5px solid rgb(28 29 26 / .18); line-height: 1.4; }
.plans thead th { font: 400 1.25rem/1.2 var(--f-display); border-bottom: 2px solid var(--ink); }
.plans tbody th { font-weight: 500; color: var(--ink-soft); width: 32%; }
.plans .no { color: rgb(28 29 26 / .4); }
.plans [data-col].is-pick { background: rgb(248 249 245 / .7); }
.price__ink { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 4; mix-blend-mode: multiply; opacity: .94; }

/* ---------------------------------------------------------------- для родителей: дневник */
.par { padding-block: calc(var(--cell) * 5) calc(var(--cell) * 6); }
.par__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: calc(var(--cell) * 3); align-items: center; margin-right: calc(var(--fields) + var(--cell) - var(--gut-r)); }
.par__title { margin: var(--cell) 0 0; font-size: var(--fs-4); font-weight: 600; line-height: 1.1; letter-spacing: -.02em; max-width: 14em; text-wrap: balance; }
.par__lead { margin: var(--cell) 0 0; max-width: 32em; font-size: var(--fs-3); line-height: 1.45; }
.par__facts { list-style: none; margin: var(--cell) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 12px; }
.par__facts li { padding: 4px 10px; box-shadow: inset 0 0 0 1.5px rgb(28 29 26 / .35); font-weight: 500; line-height: 1.4; }
.par__price { margin: calc(var(--cell) * 1.5) 0 var(--cell); font-size: var(--fs-3); }
.par__price b { font: 400 var(--fs-4)/1 var(--f-display); margin-right: .2em; }
.diary {
  position: relative;
  padding: calc(var(--cell) * 1.25);
  rotate: -1.6deg;
  background:
    repeating-linear-gradient(var(--sheet) 0 31px, rgb(143 176 218 / .55) 31px 32px),
    var(--sheet);
  box-shadow: 0 0 0 1px var(--ink-line), 0 18px 30px -16px rgb(28 29 26 / .35);
}
.diary__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; font: 400 1.125rem/1 var(--f-display); text-transform: uppercase; }
.diary__head span:last-child { font: 500 .875rem/1 var(--f-text); text-transform: none; color: var(--ink-soft); }
.diary__t { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.diary__t th { padding: 6px 8px; text-align: left; font-size: var(--fs-1); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-soft); border-bottom: 1.5px solid rgb(229 52 31 / .55); }
.diary__t td { height: 47px; padding: 0 8px; vertical-align: middle; border-right: 1px solid rgb(229 52 31 / .35); }
.diary__t td:last-child { border-right: 0; width: 34%; }
.diary__t td:nth-child(2) { width: 18%; }
.diary__sign { display: flex; justify-content: space-between; margin-top: 12px; font-size: var(--fs-1); color: var(--ink-soft); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.diary__ink { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; mix-blend-mode: multiply; }

/* ---------------------------------------------------------------- вопросы к параграфу */
.faq { padding-block: calc(var(--cell) * 4) calc(var(--cell) * 2); }
.faq__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: calc(var(--cell) * 2) calc(var(--cell) * 4); margin-right: calc(var(--fields) + var(--cell) - var(--gut-r)); }
.faq__title { margin: var(--cell) 0 0; font-size: var(--fs-4); font-weight: 600; line-height: 1.1; letter-spacing: -.02em; }
.faq__list { list-style: none; margin: 0; padding: 0; counter-reset: q; display: grid; gap: calc(var(--cell) * 1.5); }
.faq__list li { counter-increment: q; display: grid; grid-template-columns: calc(var(--cell) * 2) minmax(0, 1fr); column-gap: calc(var(--cell) / 2); }
.faq__list li::before { content: counter(q) "."; grid-row: span 2; font: 400 1.375rem/1.3 var(--f-display); }
.faq__list h3 { margin: 0; font-size: var(--fs-3); font-weight: 600; line-height: 1.3; }
.faq__list p { margin: 6px 0 0; max-width: 40em; font-size: 1.0625rem; line-height: 1.5; color: var(--ink-soft); }

@media (min-width: 960px) {
  .price__grid { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
  .par__grid { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); }
  .faq__grid { grid-template-columns: calc(var(--cell) * 12) minmax(0, 1fr); }
}

/* ---------------------------------------------------------------- телефон и узкие экраны */
@media (min-width: 1200px) {
  .enough { margin-left: calc(var(--cell) * 5); }
}
@media (min-width: 1440px) {
  /* Задание: слева вопрос и кнопка, справа лист, итог на всю ширину */
  .task { display: grid; grid-template-columns: calc(var(--cell) * 14) minmax(0, 1fr); column-gap: calc(var(--cell) * 3); align-content: start; }
  .task > .task__kicker, .task > .task__title, .task > .task__hint { grid-column: 1; }
  .sheet { display: contents; }
  .sheet__list { grid-column: 2; grid-row: 1 / span 4; align-self: start; margin-top: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: calc(var(--cell) * 2); margin-right: calc(var(--fields) + var(--cell) * 1.5 - var(--gut-r)); }
  .sheet__actions { grid-column: 1; grid-row: 4; align-self: start; margin-top: calc(var(--cell) * 2); }
  .sheet__result { grid-column: 1 / -1; grid-row: 5; margin-top: calc(var(--cell) * 4); }
}
@media (max-width: 1199px) {
  .c-why { display: none; }
  .sheet__list { column-gap: calc(var(--cell) * 2); }
}
@media (max-width: 960px) {
  .top { grid-template-columns: 1fr auto; }
  .date { grid-column: 1 / -1; grid-row: 2; text-align: left; }
  .c-why, .c-board { display: none; }
}
@media (max-width: 720px) {
  .top__nav .btn { display: none; }
  .hero { padding-block: calc(var(--cell) * 2) calc(var(--cell) * 3); min-height: 0; }
  .enough { margin-left: 0; margin-top: .12em; }
  .hero__lead { margin-top: calc(var(--cell) * 2.5); }
  .pile { position: relative; inset: auto; height: calc(var(--cell) * 33); margin-top: calc(var(--cell) * 4); }
  .card { font-size: .8125rem; }
  .c-csca  { --x: 0%;  --y: 0;    --w: 17; --r: -3deg; }
  .c-term  { --x: 58%; --y: -1.8; --w: 10; --r: 7deg; }
  .c-code  { --x: 36%; --y: 8.5;  --w: 14; --r: 4deg; }
  .c-task  { --x: 52%; --y: 18.5; --w: 10; --r: 6deg; }
  .c-push  { --x: 0%;  --y: 26.5; --w: 13.5; --r: 2deg; }
  .c-pay   { display: none; }
  .task { padding-block: calc(var(--cell) * 4) calc(var(--cell) * 6); }
  .sheet__list { grid-template-columns: minmax(0, 1fr); grid-auto-rows: auto; margin-right: var(--cell); }
  .item { min-height: calc(var(--cell) * 3); padding-block: calc(var(--cell) / 2); box-sizing: border-box; font-size: .9375rem; line-height: calc(var(--cell) * 1.5); gap: calc(var(--cell) * .75); padding-right: calc(var(--cell) * 3.75); }
  .sheet__list li + li .item { margin-top: calc(var(--cell) * -.5); }
  .item__box { margin-top: 4px; }
  .js-book .flip__stage { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr auto; row-gap: var(--cell); align-items: stretch; padding-right: 0; padding-block: calc(var(--cell) * 2); }
  .flip__index { display: none; }
  .flip__count { display: block; }
  .book { height: auto; min-height: 0; align-self: stretch; overflow: hidden; }
  .book::before { display: none; }
  .book--gl canvas { left: 0; top: 0; width: 100% !important; height: 100% !important; }
  .flip__title { font-size: 1.5rem; }
  .price, .par { padding-block: calc(var(--cell) * 4) calc(var(--cell) * 5); }
  .price__title { font-size: 2.25rem; }
  .price__grid, .par__grid, .faq__grid, .plans-wrap { margin-right: 0; }
  .diary { rotate: -1deg; padding: var(--cell); }
  .diary__t td:last-child { width: 30%; }
  .top__nav .hide-phone { display: none; }
  .plans { min-width: 0; font-size: .8125rem; }
  .plans th, .plans td { padding: 7px 5px; }
  .plans thead th { font-size: .875rem; }
  .plans tbody th { width: 30%; }
  .answer { font-size: 1.375rem; }
  .apply { padding-block: calc(var(--cell) * 4) calc(var(--cell) * 6); }
  .apply__grid { margin-right: var(--cell); }
  .cover__in { margin-right: 0; }
  .times__grid { grid-template-columns: repeat(2, max-content); column-gap: calc(var(--cell) * 3); }
  .times__col.hide-phone { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .link, .btn__ink, .item__box { transition: none; }
  .pen-trail { display: none; }
}
