/* Математика — стиль «бумажная тетрадь»: тёплая бумага в клетку 5 мм, красная линия полей,
   синие чернила, жёлтый маркер под ключевыми словами, стикеры. */
:root {
  --paper: #fbf8f1;
  --paper-white: #fffefb;
  --grid: rgba(110, 155, 210, .22);
  --margin-red: #e2574c;
  --ink: #1f3a8a;
  --ink-hover: #18306f;
  --text: #1d2230;
  --mut: #5a6072;
  --line: #d5deea;
  --marker: #fff07a;
  --sticky: #fde68a;
  --sticky-blue: #d6ecfb;
  --cell: 20px; /* ≈ 5 мм клетки */
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --hand: "Caveat", "Segoe Print", cursive;

  --lf-fg: var(--text);
  --lf-muted: var(--mut);
  --lf-field: #fff;
  --lf-field-fg: var(--text);
  --lf-border: #c4cfdf;
  --lf-accent: #1f3a8a;
  --lf-accent-fg: #fff;
  --lf-chip: #fff;
  --lf-chip-active: #1f3a8a;
  --lf-chip-active-fg: #fff;
  --lf-radius: 6px;
  --lf-error: #c0392b;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--text); font: 15.5px/1.6 var(--sans);
  background-color: var(--paper);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: var(--cell) var(--cell); }
/* красная линия полей — на всю страницу */
body::before { content: ""; position: fixed; top: 0; bottom: 0; left: max(28px, calc(50% - 668px)); width: 2px; background: var(--margin-red); opacity: .75; z-index: 0; pointer-events: none; }
main, .foot { position: relative; z-index: 1; }
a { color: var(--ink); }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px 0 40px; }
svg { flex: 0 0 auto; }
/* маркер: тёмный текст на жёлтом */
mark { background: linear-gradient(transparent 52%, var(--marker) 52%, var(--marker) 94%, transparent 94%); color: inherit; padding: 0 .08em; }

/* ── шапка ── */
.top { position: sticky; top: 0; z-index: 20; background: rgba(251, 248, 241, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; justify-content: space-between; height: 62px; gap: 16px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 19px; }
.logo svg { width: 30px; height: 30px; }
.logo span { line-height: 1.05; padding-left: 10px; border-left: 2px solid var(--ink); }
.logo small { display: block; font: 600 11px/1 var(--sans); color: var(--mut); margin-top: 4px; }
.role { display: flex; padding: 3px; gap: 2px; background: #fff; border: 1.5px solid var(--ink); border-radius: 10px; }
.role button { font: 700 13.5px var(--sans); color: var(--ink); background: none; border: 0; padding: 7px 16px; border-radius: 7px; cursor: pointer; }
.role button.is-active { background: var(--ink); color: #fff; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 52px; padding: 0 30px; border-radius: 10px; background: var(--ink); color: #fff; font: 800 16.5px var(--sans); text-decoration: none; white-space: nowrap; box-shadow: 0 3px 0 #132561; transition: background .15s, transform .15s; }
.btn:hover { background: var(--ink-hover); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #132561; }
.btn-sm { height: 38px; padding: 0 18px; font-size: 14px; box-shadow: none; background: #fff; color: var(--ink); border: 1.5px solid var(--ink); }
.btn-sm:hover { background: var(--ink); color: #fff; }

/* ── первый экран ── */
.hero { position: relative; padding: 34px 0 30px; background: rgba(253, 230, 138, .13); }
/* контент первого экрана — над холстом с формулами */
.hero-grid, .facts { position: relative; z-index: 1; }
.hero-grid > *, .inside > *, .form-wrap > *, .faq-wrap > *, .gift > *, .founder > *, .grades > *, .steps > * { min-width: 0; }
.hero-grid { display: grid; grid-template-columns: 1fr 1.02fr; gap: 44px; align-items: center; }
.kicker { justify-self: start; display: inline-block; margin: 0 0 14px; padding: 4px 14px 5px; background: var(--sticky); font: 700 22px/1 var(--hand); color: #2b2b2b; rotate: -1.5deg; box-shadow: 0 4px 10px rgba(0, 0, 0, .08); }
h1 { font-size: 46px; line-height: 1.1; font-weight: 800; color: #141826; }
.lead { margin: 16px 0 0; font-size: 16.5px; color: #3a4052; max-width: 580px; }
.points { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 12px; }
.points li { display: flex; gap: 12px; align-items: center; }
.points svg { width: 36px; height: 36px; padding: 7px; background: #fff; border: 1.5px solid var(--ink); border-radius: 10px; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.points b { font-size: 15.5px; font-weight: 700; color: #141826; }
.points span { font-size: 14px; color: var(--mut); }
.cta-row { display: flex; align-items: center; gap: 20px; margin-top: 22px; flex-wrap: wrap; }
.micro { margin: 10px 0 0; font-size: 13.5px; color: var(--mut); }
.trust { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; padding-top: 12px; border-top: 1.5px dashed #b9c6da; font-size: 13.5px; font-weight: 600; color: #3a4052; max-width: 580px; }
.trust svg { width: 20px; height: 20px; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.gift-chip { display: flex; align-items: center; gap: 10px; text-decoration: none; font-size: 13px; line-height: 1.35; color: var(--mut); }
.gift-chip b { display: block; color: var(--text); font-weight: 700; font-size: 14px; }
.gift-chip svg { width: 38px; height: 38px; padding: 7px; border-radius: 8px; background: var(--sticky); fill: none; stroke: #6b4e00; stroke-width: 1.6; stroke-linejoin: round; transform: rotate(-4deg); }

.hero-visual { position: relative; }
.hero-stack { position: relative; padding: 0 0 40px 0; }
.hero-photo img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 6px; border: 8px solid #fff; box-shadow: 0 18px 40px rgba(31, 58, 138, .16); transform: rotate(1deg); }
.note-card { position: absolute; left: -26px; bottom: 0; width: 330px; padding: 14px 18px 12px 26px; background: var(--paper-white);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 16px 16px;
  border: 1px solid var(--line); box-shadow: 0 14px 30px rgba(20, 30, 60, .18); transform: rotate(-2deg); font: 600 22px/1.3 var(--hand); color: var(--ink); }
.note-card::before { content: ""; position: absolute; left: 14px; top: 0; bottom: 0; width: 1.5px; background: var(--margin-red); opacity: .7; }
.note-card p { margin: 0; white-space: nowrap; }
.note-h { font-size: 25px; font-weight: 700; margin-bottom: 4px !important; }
.note-card .n { display: inline-grid; place-items: center; width: 24px; height: 24px; margin-right: 8px; border: 1.5px solid var(--ink); border-radius: 50%; font-size: 17px; line-height: 1; }
.note-card mark { font-weight: 700; }
.sticky { position: absolute; right: -10px; top: -18px; width: 168px; padding: 16px 16px 18px; background: var(--sticky); font: 700 23px/1.12 var(--hand); color: #2b2b2b; box-shadow: 0 10px 20px rgba(0, 0, 0, .14); transform: rotate(4deg); }
.sticky::after { content: ""; position: absolute; left: 18px; right: 30px; bottom: 10px; height: 3px; border-radius: 3px; background: var(--ink); opacity: .7; transform: rotate(-3deg); }

.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 26px; }
.facts div { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 10px 16px; }
.facts b { display: block; font: 700 25px/1.05 var(--hand); color: var(--ink); }
.facts span { font-size: 13.5px; color: var(--mut); }

/* ── секции ── */
.sec { padding: 76px 0; border-top: 1px solid var(--line); }
.sec-white { background-color: rgba(255, 254, 251, .82); }
.sec-tight { padding: 30px 0; }
.sec-k { margin: 0 0 8px; font: 700 23px/1.1 var(--hand); color: var(--ink); }
.sec-k span { margin-right: 10px; color: var(--margin-red); }
h2 { font-size: 35px; line-height: 1.16; font-weight: 800; max-width: 780px; color: #141826; }

.steps { list-style: none; padding: 0; margin: 32px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.steps li { position: relative; padding: 18px 18px 20px; background: #fff; border: 1px solid var(--line); border-radius: 4px; box-shadow: 0 6px 16px rgba(31, 58, 138, .06); }
.step-n { display: inline-grid; place-items: center; width: 38px; height: 38px; border: 2px solid var(--ink); border-radius: 50%; font: 700 24px/1 var(--hand); color: var(--ink); }
.steps h3 { margin: 12px 0 6px; font-size: 17px; font-weight: 800; }
.steps p { margin: 0; font-size: 14.5px; color: #4a5064; }

.inside { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; margin-top: 30px; }
.inside-side { display: grid; gap: 18px; }
.shot { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; box-shadow: 0 12px 30px rgba(31, 58, 138, .1); }
.shot img, .shot video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; background: #f2f5fa; }
.shot figcaption { padding: 10px 14px; font-size: 13.5px; color: var(--mut); border-top: 1px solid var(--line); }

.program { margin-top: 34px; }
.program-h { display: grid; grid-template-columns: auto 1fr; gap: 8px 28px; align-items: baseline; }
.program-h h3 { font: 700 34px/1 var(--hand); color: var(--ink); }
.program-h p { margin: 0; color: #4a5064; max-width: 760px; }
.grades { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-top: 18px; }
.grade { background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--ink); border-radius: 4px; padding: 12px 14px 14px; }
.grade b { font: 700 25px/1 var(--hand); color: var(--ink); }
.grade ul { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 5px; }
.grade li { font-size: 13.5px; line-height: 1.35; color: #3a4052; padding-left: 12px; position: relative; }
.grade li::before { content: ""; position: absolute; left: 0; top: .62em; width: 6px; height: 1.5px; background: var(--ink); }
.program-extra { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 22px; }
.tag-sticky { padding: 14px 18px; background: var(--sticky); box-shadow: 0 8px 18px rgba(0, 0, 0, .08); transform: rotate(-.6deg); font-size: 14.5px; color: #3a3220; }
.tag-sticky b { display: block; font: 700 24px/1.1 var(--hand); color: #2b2b2b; margin-bottom: 2px; }
.tag-blue { background: var(--sticky-blue); color: #22344d; transform: rotate(.6deg); }

/* подарок */
.gift { display: grid; grid-template-columns: 400px 1fr; gap: 64px; align-items: center; }
.gift-cover { position: relative; }
.gift-cover img { display: block; width: 100%; aspect-ratio: 210 / 297; object-fit: cover; background: #fff; border: 1px solid var(--line); box-shadow: 0 24px 50px rgba(31, 58, 138, .18); transform: rotate(-2deg); }
.tape { position: absolute; top: -12px; left: 50%; width: 110px; height: 28px; margin-left: -55px; background: rgba(253, 230, 138, .75); transform: rotate(-4deg); box-shadow: 0 2px 4px rgba(0, 0, 0, .08); }
.gift-text > p { color: #3a4052; font-size: 16px; max-width: 620px; margin: 14px 0 0; }
.gift-list { list-style: none; padding: 0; margin: 18px 0 26px; display: grid; gap: 10px; }
.gift-list li { display: flex; gap: 12px; font-size: 15px; }
.gift-list svg { width: 22px; height: 22px; fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; margin-top: 1px; }

/* кто ведёт */
.founder { display: grid; grid-template-columns: 1.3fr 1fr; gap: 48px; align-items: center; }
.founder-card { display: flex; gap: 26px; align-items: flex-start; }
.founder-emblem { flex: 0 0 auto; width: 104px; height: 104px; display: grid; place-items: center; background: var(--sticky-blue); border-radius: 4px; transform: rotate(-3deg); box-shadow: 0 8px 16px rgba(0, 0, 0, .08); }
.founder-emblem svg { width: 58px; height: 58px; fill: none; stroke: var(--ink); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.founder-card p:not(.sec-k) { margin: 14px 0 0; color: #3a4052; font-size: 16px; }
.nums { display: grid; gap: 10px; }
.nums div { display: flex; align-items: baseline; gap: 16px; padding: 12px 18px; background: #fff; border: 1px solid var(--line); border-radius: 4px; }
.nums b { flex: 0 0 120px; font: 700 36px/1 var(--hand); color: var(--ink); }
.nums span { color: #3a4052; font-size: 14.5px; }

.reviews-empty { display: flex; gap: 14px; align-items: center; padding: 18px 22px; border: 2px dashed #a9b8d0; border-radius: 8px; background: rgba(255, 255, 255, .7); color: var(--mut); }
.reviews-empty svg { width: 28px; height: 28px; fill: none; stroke: var(--ink); stroke-width: 1.7; stroke-linejoin: round; }
.reviews-empty b { display: block; color: var(--text); font: 700 24px/1.1 var(--hand); }
.reviews-empty span { font-size: 14px; }

.faq-wrap { display: grid; grid-template-columns: 340px 1fr; gap: 48px; }
.faq-side { color: var(--mut); font-size: 14.5px; margin-top: 12px; }
.faq details { background: #fff; border: 1px solid var(--line); border-radius: 6px; margin-bottom: 10px; }
.faq summary { list-style: none; cursor: pointer; padding: 15px 50px 15px 18px; font-weight: 700; font-size: 16px; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 18px; top: 7px; font: 700 30px/1.2 var(--hand); color: var(--ink); }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0; padding: 0 18px 16px; color: #4a5064; font-size: 15px; }

.sec-form { background-color: rgba(214, 236, 251, .35); }
.form-wrap { display: grid; grid-template-columns: 1fr 1.15fr; gap: 48px; align-items: start; }
.ticks { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 10px; }
.ticks li { display: flex; gap: 12px; font-size: 15.5px; }
.ticks svg { width: 22px; height: 22px; fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; margin-top: 1px; }
.hand-note { margin: 26px 0 0; display: inline-block; font: 700 30px/1 var(--hand); color: var(--ink); padding: 8px 18px; border: 2px solid var(--ink); border-radius: 50% 46% 52% 44% / 60% 52% 48% 40%; transform: rotate(-6deg); }
.form-card { padding: 24px; background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 18px 40px rgba(31, 58, 138, .12); position: relative; }
.form-card::before { content: ""; position: absolute; top: -12px; right: 40px; width: 96px; height: 26px; background: rgba(253, 230, 138, .8); transform: rotate(3deg); }

.foot { border-top: 1px solid var(--line); padding: 26px 0 32px; font-size: 13.5px; color: var(--mut); background: rgba(251, 248, 241, .9); }
.foot-in { display: grid; gap: 8px; }
.foot a { color: var(--mut); }
.foot-links { display: flex; gap: 18px; flex-wrap: wrap; }

/* ── адаптив ── */
/* ── волна 2: фон, край листа, ховеры ── */
.hero-canvas { opacity: 1; }
/* край оторванного листа: тот же полупрозрачный тон, что у первого экрана, поверх клетки следующего блока */
.hero-edge { position: absolute; left: 0; top: 100%; width: 100%; height: 18px; z-index: 2; pointer-events: none; }
.edge-fill { fill: rgba(253, 230, 138, .13); }
.edge-line { fill: none; stroke: rgba(31, 58, 138, .28); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.hero + .sec { border-top: 0; padding-top: 92px; }
.btn { transition: background .15s, transform .15s, box-shadow .15s, translate .2s; }
.btn:hover { translate: 0 -1px; }
.gift-chip svg { transition: rotate .2s; }
.gift-chip:hover svg { rotate: 8deg; }
/* карточки: подъём (translate) + рамка чернилами; transform не трогаем — им пользуется появление при прокрутке */
main :is(.steps li, .facts > div, .grade, .shot, .nums > div, .tag-sticky, .faq details, .note-card) {
  transition: translate .2s ease, box-shadow .2s ease, border-color .2s ease; }
.motion main :is(.steps li, .facts > div, .grade, .shot, .nums > div, .tag-sticky, .faq details) {
  transition-property: opacity, transform, translate, box-shadow, border-color;
  transition-duration: .65s, .65s, .2s, .2s, .2s;
  transition-timing-function: ease, cubic-bezier(.2, .7, .2, 1), ease, ease, ease;
  transition-delay: var(--rv-d, 0ms), var(--rv-d, 0ms), 0s, 0s, 0s; }
main :is(.steps li, .facts > div, .grade, .shot, .nums > div):hover { translate: 0 -4px; border-color: var(--ink); box-shadow: 0 14px 28px rgba(31, 58, 138, .14); }
main .tag-sticky:hover { translate: 0 -3px; box-shadow: 0 14px 26px rgba(0, 0, 0, .12); }
main .faq details:hover { border-color: var(--ink); box-shadow: 0 6px 16px rgba(31, 58, 138, .08); }
/* наклон шагов — через rotate, чтобы не спорить с появлением */
.steps li:nth-child(odd) { transform: none; rotate: -.6deg; }
.steps li:nth-child(even) { transform: none; rotate: .6deg; }

@media (max-width: 1100px) {
  .hero-grid, .founder, .form-wrap, .faq-wrap, .gift { grid-template-columns: 1fr; gap: 30px; }
  .hero-visual { max-width: 640px; }
  .note-card { left: 10px; }
  .sticky { right: 6px; }
  .steps { grid-template-columns: 1fr 1fr; }
  .inside { grid-template-columns: 1fr; }
  .grades { grid-template-columns: repeat(3, 1fr); }
  .gift-cover { max-width: 340px; }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  body::before { left: 10px; }
  .wrap { padding: 0 16px 0 22px; }
  .top-in { height: 56px; gap: 8px; }
  .logo span { display: none; }
  .role button { padding: 6px 9px; font-size: 12.5px; }
  .btn-sm { padding: 0 11px; font-size: 13px; height: 34px; }
  .hero { padding: 24px 0 20px; }
  h1 { font-size: 31px; }
  .lead { font-size: 15.5px; }
  h2 { font-size: 26px; }
  .sec { padding: 50px 0; }
  .cta-row .btn { width: 100%; }
  .hero-stack { padding-bottom: 0; }
  .hero-photo img { transform: none; border-width: 5px; }
  .note-card { position: relative; left: 0; bottom: auto; width: auto; margin-top: -18px; font-size: 19px; }
  .note-card p { white-space: normal; }
  .sticky { width: 128px; font-size: 18px; padding: 10px 12px 14px; top: -12px; right: -4px; }
  .facts { grid-template-columns: 1fr 1fr; gap: 10px; }
  .facts > div:last-child { grid-column: 1 / -1; }
  .hero + .sec { padding-top: 64px; }
  .steps { grid-template-columns: 1fr; }
  .steps li { rotate: 0deg !important; }
  .program-h { grid-template-columns: 1fr; }
  .grades { grid-template-columns: 1fr 1fr; }
  .program-extra { grid-template-columns: 1fr; }
  .nums b { flex-basis: 90px; font-size: 30px; }
  .founder-card { flex-direction: column; gap: 16px; }
  .founder-emblem { width: 72px; height: 72px; }
  .founder-emblem svg { width: 40px; height: 40px; }
  .form-card { padding: 16px; }
}
