/* Живая тетрадь. Бумага остаётся неподвижной под текстом. */
:root {
  --field: clamp(8px, 3.9vw, 56px);
  --paper-line: color-mix(in srgb, var(--c1) 23%, transparent);
  --hand: 600 26px/1.1 Caveat, cursive;
}
body { isolation: isolate; position: relative; }
body::before {
  background-image: linear-gradient(90deg, transparent var(--field), var(--margin) var(--field), var(--margin) calc(var(--field) + 1.5px), transparent calc(var(--field) + 1.5px)),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px), linear-gradient(var(--grid) 1px, transparent 1px), var(--diagonal);
  background-size: 100% 100%, 28px 28px, 28px 28px, 100% 100%;
}
main.frame { width: min(1120px, calc(100% - max(11vw, 42px))); }
.hand, .page-note { display: block; font: var(--hand); color: var(--pen); }
.brand img { box-shadow: 0 0 0 1px var(--margin), 0 0 15px var(--c1s); }
.topbar { top: 6px; }
.bar.frame { width: min(calc(100% - 32px), 1352px); gap: clamp(8px, 1vw, 16px); }
.bar::before { background: var(--card); }
.desktop-nav { display: flex; gap: clamp(8px, .75vw, 15px); margin-inline: auto; }
.desktop-nav a { padding-inline: 5px; font-size: 14px; }
.bar .desktop-launch { flex: 0 0 auto; }
.bar .desktop-launch .launch { width: auto; }
.primary { white-space: nowrap; background: #7540db; font-weight: 700; border-color: #ba9bff99; box-shadow: 0 3px 12px #9a65fa59, 0 7px 30px #8950ed50; }
.primary:hover, .primary:focus-visible { background: #804ae4; }
.primary::before, .home-hero .primary::before { animation: none; inset: 0; opacity: 0; box-shadow: 0 1px 14px #b58aff72, 0 6px 36px #a172ff55; transition: opacity .2s; }
.primary:hover::before, .primary:focus-visible::before { opacity: 1; }
.primary::after { content: ""; height: 4px; position: absolute; bottom: 6px; left: 15%; width: 66%; border-bottom: 2px solid #fff9; border-radius: 50%; transform: scaleX(0) rotate(-1deg); transform-origin: left; transition: transform .24s; }
.primary:hover::after, .primary:focus-visible::after { transform: scaleX(1) rotate(-1deg); }
.cta-short { display: none; }
@media (min-width:1181px) and (max-width:1320px) {
  .cta-full { display: none; }
  .cta-short { display: inline; }
}
@media (max-width:1180px) { .desktop-nav { display: none; } }
.menu-panel { width: min(345px, 100%); border-color: var(--margin); }
.home-hero {
  grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr);
  gap: clamp(22px, 5vw, 80px); align-items: center;
  padding: clamp(32px, 4vw, 66px) 0 clamp(58px, 6vw, 96px);
}
.home-hero h1 { font-size: clamp(42px, 4.8vw, 72px); letter-spacing: -.075em; font-weight: 640; line-height: 1.08; }
.brand-note { letter-spacing: 0; margin-bottom: 19px; transform: rotate(-3deg); transform-origin: left; width: fit-content; }
.home-hero h1 em { white-space: nowrap; position: relative; }
.home-hero h1 em::after, .scribble::after { content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 7px; border-bottom: 2px solid var(--pen); border-radius: 0 0 50% 35%; transform: rotate(-1.3deg); }
.scribble::after { bottom: 4px; }
.hero-copy>.lead { font-size: clamp(19px, 1.65vw, 25px); margin: 24px 0 0; line-height: 1.4; }
.lead strong { color: var(--ink); font-weight: 550; }
.phone-note { margin: 4px 0 28px 24px; width: fit-content; transform: rotate(-4deg); }
.phone-note span { display: inline-block; transform: rotate(12deg); }
.actions { gap: 8px 20px; }
.home-hero .primary { padding: 14px 22px; }
.hero-note { margin-top: 16px; }
.role-links { gap: 7px; margin-top: 12px; }
.role-links a { min-height: 44px; padding: 8px 12px; border: 1px solid var(--line-2); border-bottom: 2px solid var(--c1); border-radius: 11px 11px 3px 3px; background: var(--card); text-decoration: none; color: var(--ink); }
.role-links a:nth-child(2) { border-bottom-color: var(--c2); }
.role-links a:nth-child(3) { border-bottom-color: var(--c3); }
.phone-stage { position: relative; display: grid; justify-items: start; padding: 8px 0 0 8px; min-width: 0; }
.phone {
  color-scheme: dark; --ink: #f3f1fa; --ink-2: #c2bdd6; --card: #201d33; --bg-2: #12111e;
  --em: #d3baff; --okc: #60e7b5; --pen: #ffc968; --c1: #b69af9; --line-2: #494459; --accent: var(--c1);
  position: relative; width: min(100% - 45px, 354px); padding: 9px;
  color: var(--ink); border: 2px solid #50495d; border-radius: 45px; background: #08080c;
  box-shadow: 0 0 0 2px #15131c, inset 0 0 0 1px #9992a4, 0 24px 50px -22px #000b, 0 0 42px -20px #9168ef55;
  transform: rotate(2deg);
}
.phone::before { content: ""; position: absolute; width: 3px; height: 30px; border-radius: 3px; top: 94px; left: -5px; background: #66606f; box-shadow: 0 38px #66606f; }
.glass { position: relative; border-radius: 34px; background: #161425; padding: 0 clamp(12px,1.3vw,20px) 18px; min-height: 430px; display: flex; flex-direction: column; }
.device-top { display: flex; justify-content: center; align-items: center; position: relative; height: 44px; margin-bottom: 12px; }
.device-top i { background: #050508; width: 77px; height: 18px; border-radius: 22px; }
.device-top b { position: absolute; right: 8px; width: 14px; height: 8px; border: 1px solid #c8c0d8; border-radius: 2px; box-shadow: inset 8px 0 #c8c0d8; }
.device-home { margin: 25px auto -8px; width: 31%; height: 4px; border-radius: 10px; background: #b5afc6; }
.phone-task { flex: 1; scroll-margin-top: 90px; }
.phone-subject, .screen-meta { font: 600 15px/1.3 Onest,sans-serif; color: var(--em); }
.phone-task h2 { font: 650 clamp(20px, 1.7vw, 25px)/1.2 Unbounded,sans-serif; margin: 8px 0 16px; }
.phone-task .quiz-grid { display: block; border: 1px solid #3c374f; border-radius: 16px; background: #201d32; padding: 15px; }
.phone-task .exercise-prompt { font-size: 16px; }
.phone-task .equation { color: #efebff; font: 600 clamp(28px, 2.7vw, 40px)/1.2 Caveat,cursive; margin: 5px 0 19px; white-space: nowrap; }
.phone-task .quiz-controls { width: 100%; gap: 7px; }
.phone-task .quiz-controls label { flex: 1 1 85px; }
[data-check] { color: #fff; background: #7040cd; border-color: #a07ada; font-weight: 650; }
.phone-task [data-check] { padding-inline: 10px; }
.phone-task .feedback:not(:empty) { font-size: 15px; }
.phone-task .answer-box { font-size: 15px; }
.phone-task [data-reset] { background: #2a263c; }
.portrait { pointer-events: none; position: relative; inset: auto; max-width: 100%; width: auto; height: auto; aspect-ratio: auto; }
.sa__poster { width: 100%; height: 100%; object-fit: contain; object-position: center bottom; }
.phone-stage>.portrait { position: absolute; z-index: 1; width: clamp(94px,10.5vw,158px); right: -5%; bottom: -6px; transform: rotate(-4deg); }
.sections { gap: clamp(54px, 6vw, 91px); padding-bottom: 85px; }
.section, .solo { position: relative; padding: 0; border: 0; background: transparent; border-radius: 0; min-width: 0; }
.section h2 { font-size: clamp(25px, 2.65vw, 40px); margin: 0 0 14px; line-height: 1.17; }
.section>p { max-width: 75ch; }
@media(prefers-reduced-motion: no-preference) {
  .js .section.reveal-animated { animation: notebook-appear .6s ease-out both; }
}
@keyframes notebook-appear { from { opacity: 0; } to { opacity: 1; } }
.task-sheet, .sections>.quiz { background: var(--card); border: 1px solid var(--margin); border-radius: 7px 22px 22px 7px; padding: clamp(20px, 3vw, 38px); box-shadow: 0 5px 0 -2px var(--bg-2), 0 6px 0 -2px var(--paper-line); }
.task-sheet .sheet-heading .hand { font-size: 21px; margin: 0 0 6px; }
.quiz-grid { align-items: start; }
.task-sheet .quiz-grid { grid-template-columns: minmax(0,1.4fr) minmax(0,1fr); }
.steps { margin: 12px 0; padding: 0; }
.step-num, .steps li::before {
  width: 30px; height: 30px; border: 1.6px solid currentColor; border-radius: 49% 53% 45% 50%;
  font: 650 24px/1 Caveat,cursive; color: var(--accent); background: var(--bg-2); transform: rotate(-7deg);
}
.subjects { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); align-items: center; gap: clamp(18px,4vw,60px); }
.subject-copy>.link-row { margin-bottom: 6px; }
.fan { display: flex; align-items: center; justify-content: center; isolation: isolate; padding: 13px 10px 5px; min-width: 0; }
.screen-card { --tab: var(--c1); position: relative; flex: 1 1 0; min-width: 0; min-height: 178px; padding: 18px 12px 12px; display: flex; flex-direction: column; align-items: start; gap: 8px; background: var(--card); border: 1px solid var(--margin); border-top: 4px solid var(--tab); border-radius: 16px; color: var(--ink); text-decoration: none; box-shadow: 0 8px 18px -8px #0007; transform: rotate(-8deg) translateY(8px); transform-origin: center bottom; }
.screen-card:nth-child(2) { --tab: var(--c2); z-index: 1; transform: translateY(-8px); }
.screen-card:nth-child(3) { --tab: var(--c3); transform: rotate(8deg) translateY(8px); }
.screen-card strong { font-size: clamp(14px,1.17vw,17px); line-height: 1.2; }
.screen-meta { color: var(--tab); }
.screen-sample { color: var(--ink-2); font: 600 20px/1.02 Caveat,cursive; }
.screen-card .icon { margin-top: auto; color: var(--tab); }
.mistakes { padding-right: clamp(116px,16vw,215px); }
.mistakes>.portrait, .fees>.portrait { position: absolute; right: 3%; top: 50%; transform: translateY(-50%); width: clamp(90px,10vw,148px); max-height: 100%; }
.path::after, .max { background: var(--c1); }
.path button { --accent: var(--c1); }
.path .active .step-num { background: var(--accent); color: var(--bg); outline-width: 1px; }
.topics { gap: 14px; }
.trust .topic, .news-card { border: 1px solid var(--paper-line); border-top: 3px solid var(--c1); border-radius: 6px 17px 17px 6px; background: var(--card); }
.trust .topic { display: grid; align-content: center; grid-template-columns: 35px 1fr; column-gap: 12px; padding: 20px; }
.trust .topic .icon { width: 30px; height: 30px; color: var(--c1); }
.trust .topic p { grid-column: 2; margin-top: 3px; }
.trust .topic h3, .news-card h3 { letter-spacing: -.02em; }
.trust .topic .bank-date { color: var(--pen); font: 600 21px/1.2 Caveat,cursive; }
.trust .topic p a { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; }
.trust .topic:nth-child(2) { background: var(--c3s); border-color: var(--paper-line); border-top-color: var(--c3); }
.trust .topic:nth-child(2) .icon { color: var(--c3); }
.fees { padding: 6px clamp(115px,20vw,270px) 6px 21px; border-left: 2px solid var(--pen); }
.price-line { color: var(--pen); font: 650 clamp(23px,2.1vw,34px)/1.2 Caveat,cursive; }
.news-card small { font: 600 22px/1 Caveat,cursive; color: var(--pen); }
.news-card:nth-child(3n+2) { border-top-color: var(--c2); background: var(--c2s); }
.news-card:nth-child(3n) { border-top-color: var(--c3); background: var(--c3s); }
.inner-hero { position: relative; grid-template-columns: minmax(0,1fr) minmax(105px,21%); gap: 6%; padding: 24px 0 clamp(55px,6vw,90px); }
.inner-hero .portrait { width: min(100%,160px); justify-self: center; transform: rotate(3deg); }
.inner-hero h1 { font-size: clamp(34px,4.2vw,58px); }
.page-note { width: fit-content; margin-bottom: 9px; transform: rotate(-3deg); }
.inner-hero ~ .sections>.section:not(.quiz) { border-left: 2px solid var(--paper-line); padding-left: clamp(14px,2vw,26px); }
.inner-hero ~ .sections>.section:nth-child(3n+2) { border-color: var(--c2); }
.inner-hero ~ .sections>.section:nth-child(3n) { border-color: var(--c3); }
.solo { padding: clamp(50px,8vw,110px) 0; }
.help-btn { color: var(--ink); background: var(--card); border-color: var(--margin); font: 650 21px/1.1 Caveat,cursive; }
@media(min-width:811px) {
  .help-btn { flex-direction: column-reverse; gap: 6px; padding: 0; background: transparent; border: 0; box-shadow: none; }
  .help-btn span { border: 1px solid #ad8ae1; border-radius: 14px 14px 3px 14px; background: #faf8ff; color: #262034; padding: 10px 14px; }
  .help-btn img { width: 52px; height: 52px; align-self: end; border-radius: 0; object-fit: contain; }
}
.doodle-layer { position: absolute; inset: 0; pointer-events: none; overflow: clip; z-index: -1; }
.pencil-line { position: absolute; width: max-content; max-width: min(350px,80vw); color: var(--pencil); white-space: pre-line; font: 600 clamp(19px,1.85vw,28px)/1.05 Caveat,cursive; opacity: .72; }
.pencil-line cite { display: block; margin-top: 3px; font: inherit; color: var(--pen); }
.pencil-line .result { color: var(--pen); }
.pencil-line .under { border-bottom: 1.5px solid currentColor; border-radius: 30%; }
.pencil-line .circle { border: 1px solid currentColor; border-radius: 50%; padding-inline: 3px; }
.pencil-line .check::after { content: " ✓"; color: var(--okc); }
@media (max-width:900px) {
  .home-hero { gap: 20px; grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  .phone-stage>.portrait { right: -4px; width: 83px; }
  .phone { width: calc(100% - 27px); }
  .subjects { grid-template-columns: 1fr; }
  .fan { width: min(100%,520px); margin-inline: auto; }
}
@media (max-width:620px) {
  :root { --field: 8px; }
  main.frame { width: calc(100% - 42px); }
  .bar.frame { width: calc(100% - 20px); }
  .home-hero { grid-template-columns: 1fr; padding: 24px 0 54px; gap: 20px; }
  .home-hero h1 { font-size: clamp(36px,9vw,52px); }
  .brand-note { margin-bottom: 6px; font-size: 22px; }
  .hero-copy>.lead { font-size: 17px; margin: 12px 0; }
  .hero-copy>.lead br { display: none; }
  .phone-note { display: none; }
  .actions { gap: 4px 12px; }
  .home-hero .primary { padding: 10px 12px; font-size: 14px; }
  .scribble { font-size: 14px; }
  .hero-note { margin-top: 6px; }
  .role-links { margin-top: 4px; }
  .phone-stage { width: min(100%,365px); margin-inline: auto; padding: 8px; }
  .phone { width: calc(100% - 30px); transform: rotate(1deg); }
  .glass { min-height: 335px; }
  .device-top { margin-bottom: 0; height: 34px; }
  .phone-stage>.portrait { width: 77px; bottom: -12px; right: -2px; }
  .sections { gap: 54px; padding-bottom: 60px; }
  .section h2 { font-size: 25px; }
  .section .quiz-grid { grid-template-columns: 1fr; }
  .section .path { margin-top: 12px; }
  .mistakes { padding: 0; }
  .mistakes>.portrait { top: auto; bottom: 5px; transform: none; right: 4px; width: 76px; }
  .mistakes .path { margin-right: 86px; }
  .fees { padding: 0 0 0 15px; }
  .fees>.portrait { position: relative; float: right; top: auto; right: 0; transform: none; width: 64px; margin: 4px 0 3px 8px; }
  .fan { padding: 8px 7px; }
  .screen-card { min-height: 142px; padding: 12px 8px; border-radius: 12px; transform: rotate(-4deg) translateY(4px); }
  .screen-card:nth-child(3) { transform: rotate(4deg) translateY(4px); }
  .screen-sample { font-size: 17px; }
  .inner-hero { display: block; padding: 12px 0 50px; }
  .inner-hero>.portrait { float: right; width: 60px; margin: -5px 0 -20px 10px; }
  .inner-hero::after { content: ""; display: block; clear: both; }
  .inner-hero h1 { font-size: clamp(29px,7vw,38px); }
  .page-note { font-size: 22px; }
  .pencil-line { font-size: 19px; }
}
@media(prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none!important; transition: none!important; scroll-behavior: auto!important; }
}
.icon-btn { justify-content: center; }
.bar .desktop-launch .launch, .bar .desktop-launch [data-launch] { width: 100%; }
@media(max-width:620px) { .bar>.brand { width: 150px; flex: 0 0 150px; } }
.crumbs>span:last-child { color: var(--pen); font: 600 21px/1.1 Caveat,cursive; }
.note-arrow { width: 52px; height: 26px; margin-right: 5px; vertical-align: middle; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.phone-task .quiz-grid { border-top: 2px solid #9375ce; }
.fan .screen-card { border: 4px solid var(--card-2); outline: 1px solid var(--line-2); border-radius: 22px; background: var(--bg-2); min-height: 215px; gap: 5px; padding: 18px 10px 12px; box-shadow: inset 0 0 0 1px var(--line-2), 0 10px 22px -12px #000b; }
.screen-card::before { content: ""; height: 4px; width: 27px; align-self: center; border-radius: 8px; background: var(--line-2); margin: -9px 0 7px; }
.screen-fragment { display: block; width: 100%; margin-top: 5px; border-left: 2px solid var(--tab); padding: 7px 5px; border-radius: 3px; background: var(--card-2); color: var(--ink); font: 600 18px/1.15 Caveat,cursive; }
.screen-card .icon { width: 18px; height: 18px; }
.pencil-op { margin-inline: .12em; }
.pencil-arrow { display: inline-block; vertical-align: middle; width: .9em; height: .07em; background: currentColor; position: relative; }
.pencil-arrow::after { content: ""; position: absolute; right: 0; top: -.13em; width: .24em; height: .24em; border-right: 1.5px solid; border-top: 1.5px solid; transform: rotate(45deg); }
@media(min-width:1181px) {
  .desktop-nav { display: grid; grid-template-columns: 67px 69px 80px 44px 44px 114px 71px 120px; }
  .bar .desktop-launch { width: 190px; }
  .desktop-launch .launch, .desktop-launch .primary { width: 100%; }
}
@media(min-width:1181px) and (max-width:1320px) { .bar .desktop-launch { width: 108px; } }
@media(min-width:621px) and (max-width:1180px) { .bar .desktop-launch { width: 190px; } }
@media(max-width:620px) {
  .fan .screen-card { min-height: 174px; padding: 14px 6px 9px; border-width: 3px; border-radius: 15px; }
  .screen-card::before { margin-top: -6px; }
  .screen-fragment { font-size: 16px; }
}
