/* Лендинг для гостя. Только для templates/landing.html; токены — из app.css.
   Направление: тетрадь в клетку и красная ручка проверяющего. Индиго — единственный
   акцент интерфейса, --pen — только пометка на главном. Пересобрано по unslop
   (Damir Sokolovsky, @heydamir, CC BY 4.0). */

.lp {
  --lp-ease: cubic-bezier(.22, 1, .36, 1);
  --lp-cell: 24px;
  --lp-grid: color-mix(in srgb, var(--grid-ink) 70%, transparent);
  background: var(--paper); color: var(--ink); font-family: var(--ui);
}
.lp * { box-sizing: border-box; }
/* Под подвалом не должен проступать фон кабинета. */
body:has(.lp) { background: var(--paper); }
.wrap { width: min(1200px, calc(100% - 48px)); margin-inline: auto; }
.lp h1, .lp h2, .lp h3 { text-wrap: balance; }
.lp p, .lp li, .lp blockquote { text-wrap: pretty; }
.lp :focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: 16px; top: -48px; z-index: 100; padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); background: var(--ink); color: var(--paper); }
.skip:focus { top: 16px; }
.ico { flex: 0 0 auto; width: 20px; height: 20px; }

/* Тетрадный лист: белая страница в клетку с волосяной рамкой. */
.sheet-page {
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  background-color: var(--paper-2);
  background-image: linear-gradient(var(--lp-grid) 1px, transparent 1px), linear-gradient(90deg, var(--lp-grid) 1px, transparent 1px);
  background-size: var(--lp-cell) var(--lp-cell); background-position: -1px -1px;
}

/* Кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; font-weight: 600; line-height: 1; text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color .16s var(--lp-ease), border-color .16s var(--lp-ease), color .16s var(--lp-ease), transform .12s var(--lp-ease); }
.btn:active { transform: translateY(2px); }
.btn-lg { min-height: 48px; padding: 0 var(--space-6); border-radius: var(--radius-sm); font-size: var(--fs-base); }
.btn-sm { min-height: 36px; padding: 0 var(--space-4); border-radius: 10px; font-size: var(--fs-sm); }
.btn-primary { color: var(--on-primary); background: var(--primary-button, var(--primary)); box-shadow: var(--press); }
.btn-primary:hover { color: var(--on-primary); background: var(--primary-dark); }
.btn-primary:active { box-shadow: none; }
.btn-ghost { color: var(--ink); background: var(--paper-2); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--ink-2); }

/* Шапка */
.nav { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--paper) 94%, transparent); border-bottom: 1px solid var(--line); }
.nav-in { display: flex; align-items: center; gap: var(--space-6); height: 64px; }
.nav-logo { line-height: 0; margin-right: auto; }
.nav-logo .logo-word { height: 26px; }
.nav-links { display: flex; gap: var(--space-6); }
.nav-links a, .nav-login { color: var(--ink-2); font-size: var(--fs-sm); font-weight: 500; text-decoration: none; transition: color .16s var(--lp-ease); }
.nav-links a:hover, .nav-login:hover { color: var(--ink); }
.nav-toggle { display: none; position: relative; width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; cursor: pointer; }
.nav-toggle span { position: absolute; left: 11px; right: 11px; height: 2px; border-radius: 2px; background: var(--ink); transition: transform .2s var(--lp-ease); }
.nav-toggle span:first-child { top: 15px; } .nav-toggle span:last-child { top: 23px; }
.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }
.menu { position: fixed; inset: 64px 0 0; z-index: 40; display: flex; flex-direction: column; gap: var(--space-5); padding: var(--space-8) var(--space-6); background: var(--paper); opacity: 0; transition: opacity .2s var(--lp-ease); }
.menu.is-open { opacity: 1; }
.menu a:not(.btn) { color: var(--ink); font: 600 var(--fs-2xl) var(--display); text-decoration: none; }
.menu .btn { margin-top: var(--space-4); }

/* Первый экран */
.hero { padding: 56px 0 72px; }
.hero-in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: 64px; align-items: center; }
.hero-title { margin: 0; font: 600 clamp(2.4rem, 4.4vw, 3.9rem)/1.06 var(--display); letter-spacing: -.025em; color: var(--ink); }
.hero-sub { max-width: 36rem; margin: var(--space-6) 0 var(--space-8); color: var(--ink-2); font-size: var(--fs-lg); line-height: 1.6; }
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4) var(--space-6); }
.hero-link { color: var(--link); font-weight: 600; text-decoration: none; }
.hero-link:hover { text-decoration: underline; text-underline-offset: 4px; }

.hero-visual { position: relative; margin: 0; padding-bottom: 216px; }
.traj { padding: var(--space-6) var(--space-6) var(--space-4); }
.traj-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-1) var(--space-3); margin-bottom: var(--space-3); font: 600 var(--fs-base) var(--display); }
.traj-meta { color: var(--muted); font: 400 var(--fs-xs) var(--ui); }
.scan { position: absolute; left: -24px; bottom: 0; width: 42%; padding: var(--space-2); border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper-2); box-shadow: var(--shadow-lift); color: var(--muted); text-decoration: none; transform: rotate(-2deg); transition: transform .2s var(--lp-ease); }
.scan:hover { transform: rotate(0); }
.scan img { display: block; width: 100%; height: auto; border-radius: 6px; }
.scan-cap { display: block; padding: var(--space-2) var(--space-1) var(--space-2-5); font-size: var(--fs-xs); line-height: 1.35; }

/* Траектория */
.hc { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--data); }
.hc-area { fill: var(--primary-soft); opacity: .6; }
.hc-line { fill: none; stroke: var(--primary); stroke-width: 3; stroke-linecap: round; }
.hc-target { stroke: var(--muted-2); stroke-width: 1.5; stroke-dasharray: 4 6; }
.hc-mock circle { fill: var(--paper-2); stroke: var(--primary); stroke-width: 2.5; }
.hc-mock text, .hc-note, .hc-months text { font-size: 11px; fill: var(--muted); }
.hc-now { fill: var(--ink); }
.hc-goal { fill: var(--primary); }
.hc-goal-t { font-size: 13px; font-weight: 600; fill: var(--ink); }
.hc-pen { fill: none; stroke: var(--pen); stroke-width: 2.5; stroke-linecap: round; }

/* Секции */
.sec { padding: 72px 0; }
.sec-title { margin: 0 0 48px; font: 600 clamp(1.9rem, 3.2vw, 2.7rem)/1.12 var(--display); letter-spacing: -.02em; color: var(--ink); }

.pr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-6); }
.pr-col { padding: var(--space-8); border-radius: var(--radius); }
.pr-before { border: 1px solid var(--line); color: var(--ink-2); }
.pr-after { border: 1px solid var(--line); background: var(--paper-2); box-shadow: var(--shadow); color: var(--ink); }
.pr-k { margin: 0 0 var(--space-4); color: var(--muted); font-size: var(--fs-sm); font-weight: 600; }
.pr-after .pr-k { color: var(--link); }
.pr-col ul { display: grid; gap: var(--space-3); margin: 0; padding: 0; list-style: none; }
.pr-col li { display: flex; gap: var(--space-3); font-size: var(--fs-base); line-height: 1.6; }
.pr-col li::before { content: ""; flex: 0 0 6px; height: 6px; margin-top: .72em; border-radius: 50%; background: currentColor; opacity: .45; }

.tagline { padding: var(--space-2) 0 var(--space-6); }
.tg { margin-block: 0; font: 600 clamp(1.7rem, 3vw, 2.5rem)/1.2 var(--display); letter-spacing: -.02em; color: var(--ink-2); }
.pen-under { position: relative; color: var(--ink); white-space: nowrap; }
.pen-under::after { content: ""; position: absolute; left: -2%; right: -2%; bottom: -.16em; height: .3em; background: var(--pen);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12' preserveAspectRatio='none'%3E%3Cpath d='M2 8 C 40 4, 90 3, 140 5 S 190 7, 198 4' fill='none' stroke='black' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12' preserveAspectRatio='none'%3E%3Cpath d='M2 8 C 40 4, 90 3, 140 5 S 190 7, 198 4' fill='none' stroke='black' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat; }

.ben-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 64px; margin: 0; padding: 0; list-style: none; }
.ben-list li { padding: var(--space-6) 0 var(--space-8); border-top: 1px solid var(--line-strong); }
.ben-list b { display: block; font: 600 var(--fs-xl)/1.3 var(--display); color: var(--ink); }
.ben-list p { margin: var(--space-2) 0 0; max-width: 32rem; color: var(--ink-2); font-size: var(--fs-base); line-height: 1.6; }

/* Как это работает: пять шагов подряд, без перехвата прокрутки */
.steps { display: grid; margin: 0; padding: 0; list-style: none; }
.step { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 64px; align-items: center; padding: 48px 0; border-top: 1px solid var(--line-strong); }
.step-when { display: flex; align-items: center; gap: var(--space-2); margin: 0 0 var(--space-3); color: var(--link); font-size: var(--fs-sm); font-weight: 600; }
.step-when .num { display: inline-grid; place-items: center; width: 24px; height: 24px; border: 1.5px solid currentColor; border-radius: 6px; font: 600 var(--fs-xs) var(--data); }
.step-copy h3 { margin: 0 0 var(--space-3); font: 600 clamp(1.4rem, 2.2vw, 1.85rem)/1.2 var(--display); color: var(--ink); }
.step-copy p:last-child { margin: 0; max-width: 30rem; color: var(--ink-2); font-size: var(--fs-base); line-height: 1.6; }
.step-art { display: grid; place-items: center; min-height: 320px; padding: 40px 32px; overflow: hidden; }

/* Отзывы и вопросы */
.rv-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px; }
.rv { margin: 0; padding-top: var(--space-6); border-top: 1px solid var(--line-strong); }
.rv blockquote { margin: 0 0 var(--space-5); color: var(--ink); font-size: var(--fs-lg); line-height: 1.6; }
.rv figcaption b { display: block; font-size: var(--fs-base); font-weight: 600; }
.rv figcaption span { display: block; margin-top: var(--space-0-5); color: var(--muted); font-size: var(--fs-sm); }

.faq { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 64px; }
.faq .sec-title { margin: 0; }
.faq-list details { border-bottom: 1px solid var(--line-strong); }
.faq-list summary { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); padding: var(--space-5) 0; color: var(--ink); font: 500 var(--fs-lg)/1.4 var(--display); cursor: pointer; list-style: none; transition: color .16s var(--lp-ease); }
.faq-list summary:hover { color: var(--link); }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary .ico { color: var(--muted); transition: transform .18s var(--lp-ease); }
.faq-list details[open] summary .ico { transform: rotate(45deg); }
.faq-list details p { max-width: 64ch; margin: 0 0 var(--space-6); color: var(--ink-2); font-size: var(--fs-base); line-height: 1.6; }
.faq-list a { color: var(--link); }

/* Финал */
.final-in { padding: 64px 48px; text-align: center; }
.final-in h2 { max-width: 40rem; margin: 0 auto var(--space-3); font: 600 clamp(1.8rem, 3vw, 2.5rem)/1.15 var(--display); letter-spacing: -.02em; }
.final-in > p { max-width: 36rem; margin: 0 auto var(--space-8); color: var(--ink-2); font-size: var(--fs-lg); line-height: 1.6; }
.final-cta { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-3); }

.foot { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-6); padding: var(--space-8) 0 48px; border-top: 1px solid var(--line); color: var(--muted); font-size: var(--fs-sm); }
.foot span { margin-right: auto; }
.foot a { color: var(--ink-2); }

/* Иллюстрации шагов: общая геометрия и цвета из токенов */
.lp { --pl-budget: var(--line-strong); --pl-ink: var(--ink-2); --pl-learn: var(--primary); --pl-rev: var(--warning);
  --m-edge: var(--line-strong); --m-node: var(--muted-2); --m-ring: var(--paper-2); --m-a: var(--success); --m-c: var(--primary); --m-d: var(--muted-2); --m-label: var(--ink);
  --e-track: var(--line); --e-goal: var(--success); --e-bgc: var(--paper-2); --e-ink: var(--ink); }

.art-diag { position: relative; width: 100%; max-width: 420px; padding-top: var(--space-6); }
.sheet { padding: var(--space-6); border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.sheet-k { margin: 0 0 var(--space-2); padding-right: 64px; color: var(--muted); font: 600 var(--fs-xs) var(--ui); }
.sheet-t { margin: 0 0 var(--space-4); padding-right: 64px; font-size: var(--fs-md); line-height: 1.55; }
.sheet-t b { font-family: var(--data); }
.sheet-a { display: flex; align-items: center; gap: var(--space-2); }
.sheet-a span { flex: 1; padding: var(--space-2-5) var(--space-3-5); border: 1.5px solid var(--primary); border-radius: 10px; font: 600 var(--fs-base) var(--data); }
.sheet-a i { font-style: normal; color: var(--muted); }
.sheet-a b { padding: var(--space-2-5) var(--space-4); border-radius: 10px; color: var(--on-primary); background: var(--primary-button, var(--primary)); font-size: var(--fs-sm); }
.ring { position: absolute; right: -16px; top: -8px; width: 96px; }
.ring-bg { fill: var(--card); stroke: var(--gray-soft); stroke-width: 8; }
.ring-fg { fill: none; stroke: var(--primary); stroke-width: 8; stroke-linecap: round; transform: rotate(-90deg); transform-origin: center; }
.ring-n { font: 600 30px var(--data); fill: var(--ink); } .ring-c { font: 500 12px var(--ui); fill: var(--muted); }

.art-map { width: 100%; } .art-map svg { display: block; width: 100%; height: auto; overflow: visible; }
.m-e { stroke: var(--m-edge); stroke-width: 1.4; } .m-n { fill: var(--m-node); }
.m-path { fill: none; stroke: var(--primary); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.m-halo { opacity: .16; } .m-c { stroke: var(--m-ring); stroke-width: 3; }
.m-s0, .m-s1 { fill: var(--m-a); } .m-s2 { fill: var(--m-c); } .m-s3 { fill: var(--m-d); }
.m-l { font: 600 14px var(--ui); fill: var(--m-label); }
.art-cap { margin: var(--space-2) 0 0; color: var(--muted); font-size: var(--fs-sm); line-height: 1.45; text-align: center; }

.art-plan { position: relative; width: 100%; max-width: 460px; }
.budget { position: absolute; left: 0; right: 0; top: 40px; border-top: 2px dashed var(--pl-budget); }
.budget span { position: absolute; right: 0; top: -24px; color: var(--pl-ink); font-size: var(--fs-xs); font-weight: 600; }
.cols { position: relative; display: grid; grid-template-columns: repeat(7, 1fr); gap: var(--space-2); align-items: end; height: 220px; }
.col { display: grid; grid-template-rows: 1fr auto; height: 100%; text-align: center; }
.col b { margin-top: var(--space-2); color: var(--pl-ink); font-size: var(--fs-xs); font-weight: 600; }
.stack { display: flex; flex-direction: column-reverse; gap: var(--space-1); }
.cap { display: block; height: calc(var(--h) * 2px); border-radius: 4px; background: var(--pl-learn); }
.cap.rev { background: var(--pl-rev); }
.ghost-cap { border: 2px solid transparent; background: var(--pl-learn); transition: background-color .5s var(--lp-ease) 1s, border-color .5s var(--lp-ease) 1s; }
.step.is-on .ghost-cap { border-color: var(--pl-budget); border-style: dashed; background: transparent; }
.cap.moved { box-shadow: 0 0 0 2px var(--pl-ink) inset; opacity: 0; transform: translate(calc(var(--dx) * -1 * (100% + 8px)), 64px);
  transition: transform .9s var(--lp-ease) 1.1s, opacity .3s var(--lp-ease) 1.1s; }
.step.is-on .cap.moved { opacity: 1; transform: none; }
.legend { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); justify-content: center; margin-top: var(--space-4); color: var(--pl-ink); font-size: var(--fs-xs); font-weight: 600; }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: var(--space-1-5); border-radius: 3px; background: var(--pl-learn); vertical-align: -1px; }
.legend .rev::before { background: var(--pl-rev); }
.legend .mvd::before { background: transparent; box-shadow: 0 0 0 2px var(--pl-ink) inset; }

.art-report { position: relative; width: 100%; max-width: 400px; padding-top: 40px; }
.note { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.note.back { position: absolute; top: 0; left: 28px; right: 28px; display: flex; justify-content: space-between; padding: var(--space-3-5) var(--space-5) 40px; opacity: .7; transform: scale(.94); font-size: var(--fs-sm); }
.note.back span { color: var(--muted); }
.note.front { position: relative; padding: var(--space-5); }
.note-h { display: grid; grid-template-columns: auto 1fr auto; gap: var(--space-3); align-items: center; }
.ava { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--on-primary); background: var(--primary); font: 600 var(--fs-base) var(--display); }
.note-h b { display: block; font: 600 var(--fs-md) var(--display); } .note-h small { color: var(--muted); font-size: var(--fs-xs); }
.mini { width: 64px; } .mini .ring-bg { stroke-width: 7; } .mini .ring-fg { stroke-width: 7; stroke: var(--success); } .mini-n { font: 600 22px var(--data); fill: var(--ink); }
.note-v { margin: var(--space-4) 0; padding: var(--space-3-5); border-radius: var(--radius-sm); background: var(--success-tint); font-size: var(--fs-md); line-height: 1.5; }
.note-v b { color: var(--track-success); }
.note-f { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-2); margin: 0; padding: 0; list-style: none; color: var(--muted); font-size: var(--fs-xs); }
.note-f b { display: block; color: var(--ink); font: 600 var(--fs-2xl) var(--data); }

.art-exam svg { display: block; width: min(280px, 100%); height: auto; overflow: visible; }
.e-bg { fill: none; stroke: var(--e-track); stroke-width: 18; stroke-linecap: round; }
.e-val { fill: none; stroke: var(--primary); stroke-width: 18; stroke-linecap: round; }
.e-goal { fill: var(--e-goal); stroke: var(--e-bgc); stroke-width: 4; }
.e-n { font: 600 60px var(--data); fill: var(--e-ink); } .e-c { font: 500 12px var(--ui); fill: var(--muted); } .e-t { font: 600 14px var(--ui); fill: var(--e-goal); }

/* Движение: шаг оживает один раз, когда попадает в экран; только то, что объясняет смысл */
.step .draw { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.2s var(--lp-ease) .2s; }
.step.is-on .draw { stroke-dashoffset: calc(1 - var(--to, 1)); }
.step .pop { opacity: 0; transform: translateY(8px); transition: opacity .4s var(--lp-ease), transform .4s var(--lp-ease); transition-delay: calc(.3s + var(--i, 0) * .05s); }
.step.is-on .pop { opacity: 1; transform: none; }
.step .grow-y { transform: scaleY(0); transform-origin: bottom; transition: transform .5s var(--lp-ease); transition-delay: calc(.15s + var(--i, 0) * .05s); }
.step.is-on .grow-y { transform: none; }

@media (max-width: 960px) {
  .nav-links, .nav-login { display: none; } .nav-toggle { display: block; } .nav-in { gap: var(--space-3); }
  .hero { padding: 40px 0 64px; }
  .hero-in { grid-template-columns: minmax(0, 1fr); gap: 48px; min-height: 0; }
  .hero-visual { padding-bottom: 0; }
  .scan { position: relative; left: auto; bottom: auto; display: block; width: 78%; margin: -32px 0 0 auto; }
  .pr-grid, .ben-list, .rv-grid, .faq { grid-template-columns: minmax(0, 1fr); }
  .rv-grid { gap: var(--space-8); }
  .faq { gap: var(--space-6); }
  .step { grid-template-columns: minmax(0, 1fr); gap: var(--space-6); padding: 40px 0; }
  .step-art { min-height: 0; padding: var(--space-8) var(--space-5); }
}
@media (max-width: 520px) {
  .wrap { width: calc(100% - 32px); }
  .sec { padding: 64px 0; }
  .sec-title { margin-bottom: var(--space-8); }
  .hero-title { font-size: clamp(2.1rem, 9vw, 2.5rem); }
  .hero-cta .btn { width: 100%; }
  .traj { padding: var(--space-4) var(--space-4) var(--space-2); }
  .hc-mock text, .hc-note, .hc-months text { font-size: 15px; }
  .hc-goal-t { font-size: 16px; }
  .m-l { font-size: 22px; }
  .art-map svg { margin-inline: -8px; width: calc(100% + 16px); }
  .pr-col { padding: var(--space-6); }
  .final-in { padding: 40px var(--space-5); }
  .final-cta .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .lp *, .lp *::before, .lp *::after { transition: none !important; }
  .step .draw { stroke-dashoffset: calc(1 - var(--to, 1)); }
  .step .pop, .step .grow-y, .cap.moved { opacity: 1; transform: none; }
}
