/* MathWave — дизайн «Тетрадь» (вариант B, 27.09.2026). Подключается последним, если cfg.design === 'notebook'.
   Клетка, поля, листы со скотчем, пометки красной ручкой (Caveat). Классы главной — с префиксом nb-. */

@font-face { font-family: 'Caveat'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/assets/fonts/Caveat-cyrillic.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Caveat'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/assets/fonts/Caveat-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --nb-paper: #FBFBF7;
  --nb-grid: #DCE7F4;
  --nb-grid-2: #E3ECF7;
  --nb-ink: #1F2D52;
  --nb-ink-2: #34405F;
  --nb-muted: #5A6480;
  --nb-pen: #E0314B;
  --nb-margin: #F2A7B3;
  --nb-yellow: #FFE58A;
  --nb-dots: #B9C3D6;
  --nb-green: #1F7A4D;
  --hand: 'Caveat', 'Segoe Print', 'Bradley Hand', cursive;
  --nb-shadow: 0 24px 60px rgba(31, 45, 82, .16);
}

/* ---------- основа: бумага в клетку и поля ---------- */
body.is-notebook {
  background-color: var(--nb-paper);
  background-image: linear-gradient(var(--nb-grid) 1px, transparent 1px), linear-gradient(90deg, var(--nb-grid) 1px, transparent 1px);
  background-size: 28px 28px;
  color: var(--nb-ink);
}
body.is-notebook main { position: relative; }
body.is-notebook main::before { content: ''; position: absolute; top: 0; bottom: 0; left: max(10px, calc((100% - var(--w)) / 2 - 36px)); width: 2px; background: var(--nb-margin); pointer-events: none; }
body.is-notebook ::selection { background: var(--nb-yellow); color: var(--nb-ink); }

/* шапка, кнопки, меню */
body.is-notebook .site-header.scrolled { background: rgba(251, 251, 247, .92); box-shadow: 0 2px 0 var(--nb-ink); }
body.is-notebook .main-nav a { color: var(--nb-ink); }
body.is-notebook .main-nav a:hover { background: rgba(31, 45, 82, .07); color: var(--nb-ink); }
body.is-notebook .btn { border-radius: 12px; }
body.is-notebook .btn-primary { background: var(--nb-ink); color: #fff; box-shadow: 4px 4px 0 var(--nb-pen); }
body.is-notebook .btn-primary:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--nb-pen); }
body.is-notebook .btn-ghost { border: 2px solid var(--nb-ink); background: #fff; color: var(--nb-ink); }
body.is-notebook .btn-ghost:hover { background: var(--nb-yellow); }
body.is-notebook .menu-toggle { border: 2px solid var(--nb-ink); border-radius: 12px; }
body.is-notebook .menu-toggle-bars i { background: var(--nb-ink); }
body.is-notebook .mobile-menu { background-color: var(--nb-paper); background-image: linear-gradient(var(--nb-grid) 1px, transparent 1px), linear-gradient(90deg, var(--nb-grid) 1px, transparent 1px); background-size: 28px 28px; }
body.is-notebook .mobile-menu li a { font-family: var(--hand); font-weight: 700; letter-spacing: 0; font-size: clamp(44px, 12vw, 64px); }

/* подвал: светлый, как последняя страница тетради */
body.is-notebook .site-footer { background: transparent; color: var(--nb-ink); border-top: 2px solid var(--nb-ink); }
body.is-notebook .footer-tagline { color: var(--nb-ink-2); }
body.is-notebook .footer-h { font-family: var(--hand); font-size: 28px; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--nb-pen); margin-bottom: 12px; }
body.is-notebook .footer-col a { color: var(--nb-ink); }
body.is-notebook .footer-col a:hover { color: var(--nb-ink); text-decoration-color: var(--nb-pen); }
body.is-notebook .footer-legal { border-top: 1.5px dashed var(--nb-dots); color: var(--nb-muted); }
body.is-notebook .footer-legal a:hover { color: var(--nb-ink); }

/* ---------- общие элементы ---------- */
.nb > section { padding-block: clamp(64px, 9vw, 120px); }
.nb-hand { font-family: var(--hand); font-weight: 700; letter-spacing: 0; }
.nb-red { color: var(--nb-pen); }
.nb-h2 { font-family: var(--hand); font-weight: 700; font-size: clamp(56px, 7vw, 104px); line-height: .9; letter-spacing: 0; color: var(--nb-ink); }
.nb-h3 { font-family: var(--hand); font-weight: 700; font-size: clamp(36px, 3.4vw, 44px); line-height: 1; letter-spacing: 0; color: var(--nb-pen); margin-top: 14px; }
.nb-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 480px); gap: 20px 56px; align-items: end; margin-bottom: clamp(36px, 5vw, 60px); }
.nb-head p { color: var(--nb-ink-2); font-size: 17px; line-height: 1.55; }
.nb-head p + p { margin-top: 8px; font-size: 15px; color: var(--nb-muted); }
.nb-strong { font-weight: 700; font-size: 18px !important; color: var(--nb-ink) !important; }
.nb-link { font-family: var(--font); font-weight: 800; font-size: 18px; color: var(--nb-ink); text-decoration: underline; text-decoration-color: var(--nb-pen); text-decoration-thickness: 3px; text-underline-offset: 6px; }
.nb-link:hover { color: var(--nb-pen); }

.nb-sheet {
  position: relative; background-color: #fff;
  background-image: linear-gradient(var(--nb-grid-2) 1px, transparent 1px), linear-gradient(90deg, var(--nb-grid-2) 1px, transparent 1px);
  background-size: 24px 24px; border-radius: 4px; box-shadow: var(--nb-shadow);
}
.nb-tape { position: absolute; z-index: 2; height: 30px; width: 120px; background: rgba(240, 122, 180, .45); pointer-events: none; }
.nb-tape-b { background: rgba(107, 182, 232, .45); }
.nb-tape-y { background: rgba(255, 212, 71, .6); }

/* рукописные штрихи: рисуются красной ручкой по кругу */
.nb-circle path, .nb-tick path, .nb-strike path, .nb-underline path { fill: none; stroke: var(--nb-pen); stroke-linecap: round; stroke-linejoin: round; }
.nb-circle path { stroke-width: 2.6; }
.nb-tick path { stroke-width: 3; }
.nb-strike path { stroke-width: 3; }
.nb-underline path { stroke-width: 4; }
.nb-arrow path, .nb-arrow-up path { fill: none; stroke: var(--nb-pen); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.nb-draw { stroke-dasharray: 1; stroke-dashoffset: 0; }
@media (prefers-reduced-motion: no-preference) {
  .nb-draw { animation: nb-draw 7s ease-in-out infinite; }
  .nb-draw-late { animation-name: nb-draw-late; }
}
@keyframes nb-draw { 0%, 8% { stroke-dashoffset: 1; } 24%, 100% { stroke-dashoffset: 0; } }
@keyframes nb-draw-late { 0%, 26% { stroke-dashoffset: 1; } 38%, 100% { stroke-dashoffset: 0; } }

/* ---------- первый экран ---------- */
.nb .nb-hero { padding-top: clamp(104px, 12vw, 150px); padding-bottom: clamp(40px, 5vw, 72px); }
.nb-hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 620px); gap: clamp(32px, 4vw, 64px); align-items: center; }
.nb-hero-copy { display: flex; flex-direction: column; gap: 24px; }
.nb-hero-tag { align-self: flex-start; font-size: clamp(24px, 2.2vw, 30px); color: var(--nb-pen); rotate: -3deg; }
.nb-hero h1 { font-family: var(--hand); font-weight: 700; font-size: clamp(72px, 9.4vw, 128px); line-height: .9; letter-spacing: 0; color: var(--nb-ink); }
.nb-u { position: relative; white-space: nowrap; }
.nb-underline { position: absolute; left: 2%; bottom: -.1em; width: 96%; height: .2em; overflow: visible; }
.nb-hero-sub { max-width: 540px; font-size: clamp(17px, 1.5vw, 20px); line-height: 1.6; color: var(--nb-ink-2); }
.nb-hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 28px; }
.nb-hero-note { display: flex; align-items: center; gap: 12px; font-size: 32px; color: var(--nb-pen); rotate: -2deg; }
.nb-arrow { width: 64px; height: 38px; flex-shrink: 0; }

.nb-hero-visual { position: relative; padding-top: 10px; }
.nb-hero-tape { left: 38%; top: -4px; width: 150px; rotate: -4deg; }
.nb-hero-sheet { padding: 44px 36px 32px 88px; rotate: -1.6deg; display: flex; flex-direction: column; gap: 20px; color: var(--nb-ink); }
.nb-hero-sheet::before { content: ''; position: absolute; left: 62px; top: 0; bottom: 0; width: 2px; background: var(--nb-margin); }
.nb-sheet-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.nb-sheet-head .nb-hand:first-child { font-size: 38px; }
.nb-sheet-head .nb-hand:last-child { font-size: 26px; }
.nb-line { display: flex; align-items: center; gap: .28em; white-space: nowrap; font-family: 'Cambria Math', 'STIX Two Math', 'Times New Roman', serif; font-size: clamp(20px, 1.9vw, 27px); line-height: 1.3; }
.nb-line .fr { font-size: .7em; }
.nb-tick { width: 1.1em; height: .9em; margin-left: .3em; flex-shrink: 0; }
.nb-err, .nb-wrong { position: relative; display: inline-flex; }
.nb-circle { position: absolute; left: -62%; top: -24%; width: 224%; height: 150%; overflow: visible; }
.nb-strike { position: absolute; left: -12%; top: 0; width: 124%; height: 100%; overflow: visible; }
.nb-fix { margin-left: .3em; font-size: 1.6em; line-height: 1; }
.nb-margin-note { position: relative; margin: 8px 0 0 clamp(90px, 12vw, 150px); font-size: clamp(24px, 2.3vw, 32px); line-height: 1; rotate: -4deg; }
.nb-arrow-up { position: absolute; left: -96px; top: -44px; width: 90px; height: 70px; }
.nb-comment { margin-top: 6px; padding-top: 14px; border-top: 2px dashed var(--nb-margin); font-size: clamp(24px, 2.1vw, 29px); line-height: 1.15; }

/* лента тем на розовом скотче */
.nb-marquee { position: relative; height: 84px; overflow: hidden; }
.nb-marquee-band { position: absolute; left: -20px; right: -20px; top: 16px; height: 54px; background: rgba(240, 122, 180, .4); rotate: -.8deg; overflow: hidden; display: flex; align-items: center; }
.nb-marquee-track { display: flex; width: max-content; font-family: var(--hand); font-weight: 700; font-size: 32px; color: var(--nb-ink); white-space: nowrap; animation: marquee 46s linear infinite; }
.nb-marquee-track span { padding-right: 28px; }
@media (prefers-reduced-motion: reduce) { .nb-marquee-track { animation: none; } }

/* ---------- обо мне: разворот тетради ---------- */
.nb-spread { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); box-shadow: 0 40px 90px rgba(31, 45, 82, .18); }
.nb-spread::after { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 40px; margin-left: -20px; background: linear-gradient(90deg, rgba(31, 45, 82, 0), rgba(31, 45, 82, .12) 50%, rgba(31, 45, 82, 0)); pointer-events: none; }
.nb-page { position: relative; padding: 48px 44px 56px 76px; display: flex; flex-direction: column; gap: 16px;
  background-color: #fff; background-image: linear-gradient(var(--nb-grid-2) 1px, transparent 1px), linear-gradient(90deg, var(--nb-grid-2) 1px, transparent 1px); background-size: 24px 24px; }
.nb-page-left { border-radius: 6px 0 0 6px; }
.nb-page-right { border-radius: 0 6px 6px 0; padding-left: 64px; }
.nb-page-left::before { content: ''; position: absolute; left: 50px; top: 0; bottom: 0; width: 2px; background: var(--nb-margin); }
.nb-page p { font-size: 17px; line-height: 1.6; color: var(--nb-ink-2); }
.nb-page .nb-h2 { font-size: clamp(60px, 6vw, 84px); }
.nb-page .nb-lead { font-size: 19px; line-height: 1.55; }

.nb-polaroid { position: relative; align-self: center; width: min(400px, 100%); margin: 22px 0 18px; padding: 18px 18px 0; background: #fff; box-shadow: 0 18px 40px rgba(31, 45, 82, .2); rotate: -2deg; }
.nb-polaroid .nb-tape { left: calc(50% - 70px); top: -14px; width: 140px; rotate: 3deg; }
.nb-polaroid img { width: 100%; aspect-ratio: 364 / 380; object-fit: cover; object-position: 50% 30%; }
.nb-polaroid figcaption { padding: 10px 0 14px; text-align: center; font-size: 30px; color: var(--nb-ink); }
.nb-sticker { position: absolute; padding: 10px 16px; font-size: 28px; line-height: 1; white-space: nowrap; }
.nb-sticker-y { right: -44px; top: 40px; background: var(--nb-yellow); box-shadow: 0 8px 18px rgba(31, 45, 82, .16); rotate: 8deg; }
.nb-sticker-r { left: -46px; bottom: 90px; background: #FDEEF5; border: 2px solid var(--nb-pen); color: var(--nb-pen); rotate: -7deg; }

.nb-principles { list-style: none; counter-reset: p; display: grid; gap: 14px; }
.nb-principles li { counter-increment: p; display: grid; grid-template-columns: 40px 1fr; gap: 14px; align-items: start; font-size: 18px; font-weight: 700; line-height: 1.45; color: var(--nb-ink); }
.nb-principles li::before { content: counter(p); display: grid; place-items: center; width: 40px; height: 40px; border: 2.5px solid var(--nb-pen); border-radius: 50%; font-family: var(--hand); font-size: 26px; color: var(--nb-pen); line-height: 1; }
.nb-principles li { padding-top: 0; }
.nb-stickynote { align-self: flex-start; max-width: 400px; margin: 18px 0 8px 6px; padding: 22px 26px; background: var(--nb-yellow); box-shadow: 0 12px 26px rgba(31, 45, 82, .14); rotate: -2deg; font-size: 32px !important; line-height: 1.05 !important; color: var(--nb-ink) !important; }

.nb-docs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; margin-top: 22px; }
.nb-doc { position: relative; margin: 0; padding: 10px 10px 0; background: #fff; box-shadow: 0 14px 30px rgba(31, 45, 82, .18); rotate: var(--rot, 0deg); transition: rotate .35s var(--ease), translate .35s var(--ease); }
.nb-doc:hover { rotate: 0deg; translate: 0 -4px; }
.nb-doc .nb-tape { left: calc(50% - 45px); top: -14px; width: 90px; rotate: -5deg; }
.nb-doc .doc-open { width: 100%; }
.nb-doc img { width: 100%; aspect-ratio: 640 / 454; object-fit: cover; }
.nb-doc figcaption { padding: 8px 0 10px; text-align: center; font-size: 25px; color: var(--nb-ink); }

/* ---------- цифры ---------- */
.nb .nb-numbers { padding-block: clamp(40px, 5vw, 64px); }
.nb-numbers-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; }
.nb-numbers-grid > div { display: flex; flex-direction: column; gap: 6px; }
.nb-numbers-grid b { font-size: clamp(64px, 8vw, 110px); line-height: .9; color: var(--nb-ink); }
.nb-numbers-grid b.nb-red { color: var(--nb-pen); }
.nb-numbers-grid span { max-width: 250px; font-size: 17px; line-height: 1.45; color: var(--nb-ink-2); }
.nb-circled { position: relative; align-self: flex-start; }
.nb-circled .nb-circle { left: -18%; top: -14%; width: 150%; height: 128%; }

/* ---------- метод ---------- */
.nb-steps { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 44px; align-items: start; }
.nb-steps li { position: relative; min-height: 300px; padding: 28px 24px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 16px 40px rgba(31, 45, 82, .12); }
.nb-steps li:nth-child(1) { rotate: -1.2deg; }
.nb-steps li:nth-child(2) { rotate: 1deg; margin-top: 22px; }
.nb-steps li:nth-child(3) { rotate: -.8deg; }
.nb-steps li:nth-child(4) { rotate: 1.2deg; margin-top: 16px; }
.nb-steps li:not(:last-child)::after { content: ''; position: absolute; right: -44px; top: 120px; width: 46px; height: 30px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 46 30'%3E%3Cpath d='M2 26C16-2 30-2 42 20M42 20l-12-2M42 20l-3-11' fill='none' stroke='%23E0314B' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain; }
.nb-num { display: grid; place-items: center; width: 52px; height: 52px; border: 3px solid var(--nb-pen); border-radius: 50%; font-size: 34px; color: var(--nb-pen); line-height: 1; }
.nb-steps h3 { font-family: var(--font); font-size: 22px; font-weight: 800; line-height: 1.2; letter-spacing: 0; color: var(--nb-ink); }
.nb-steps p { font-size: 16px; line-height: 1.5; color: var(--nb-ink-2); }
.nb-steps li.is-main { outline: 3px solid var(--nb-pen); outline-offset: -3px; }
.nb-steps li.is-main .nb-num { background: var(--nb-pen); color: #fff; }
.nb-main-note { position: absolute; right: 8px; top: -40px; font-size: 30px; rotate: 6deg; }

/* ---------- загляните внутрь ---------- */
.nb-preview-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(32px, 4vw, 56px); align-items: center; }
.nb-photo { position: relative; padding: 14px 14px 0; background: #fff; box-shadow: var(--nb-shadow); rotate: -1deg; }
.nb-photo .nb-tape { left: 40px; top: -14px; rotate: -6deg; }
.nb .nb-photo .video-slot { min-height: 0; aspect-ratio: 848 / 560; border: 0; border-radius: 0; box-shadow: none; }
.nb .nb-photo .video-play { background: var(--nb-pen); box-shadow: 0 10px 30px rgba(224, 49, 75, .4); }
.nb-photo-cap { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 4px 12px; }
.nb-photo-cap .nb-hand { font-size: 30px; color: var(--nb-ink); }
.nb-photo-cap small { font-size: 14px; font-weight: 700; color: var(--nb-muted); }
.nb-scans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; align-items: start; }
.nb-scan { display: block; padding: 8px; background: #fff; box-shadow: 0 14px 34px rgba(31, 45, 82, .16); rotate: var(--rot, 0deg); transition: rotate .35s var(--ease), translate .35s var(--ease); }
.nb-scan:hover { rotate: 0deg; translate: 0 -4px; }
.nb-scans-cap { grid-column: 1 / -1; text-align: center; font-size: 28px; color: var(--nb-pen); rotate: -2deg; }
/* интерактивное задание (разметка из pages/home.js): лист тетради вместо карточки */
.nb .demo { margin: 0 0 clamp(48px, 6vw, 80px); border: 0; border-radius: 4px; box-shadow: var(--nb-shadow); background-color: #fff; background-image: linear-gradient(var(--nb-grid-2) 1px, transparent 1px), linear-gradient(90deg, var(--nb-grid-2) 1px, transparent 1px); background-size: 24px 24px; }
.nb .demo-side .eyebrow { font-family: var(--hand); font-size: 26px; letter-spacing: 0; text-transform: none; color: var(--nb-pen); }
.nb .demo-side .eyebrow b { color: var(--nb-pen); background: none; -webkit-background-clip: border-box; background-clip: border-box; font-size: 26px; }
.nb .demo-side h3 { color: var(--nb-ink); }
.nb .demo-opt { border: 2px solid var(--nb-ink); border-radius: 12px; }
.nb .demo-opt.is-right { background: var(--nb-ink); }
.nb .demo-note { color: var(--nb-muted); }

/* ---------- отзывы: записки на линованной бумаге ---------- */
.nb-review-list { columns: 3 300px; column-gap: 40px; }
.nb-review { position: relative; display: block; break-inside: avoid; margin: 14px 0 44px; padding: 36px 28px 22px; background-color: #fff; background-image: linear-gradient(transparent 24px, var(--nb-grid) 24px, var(--nb-grid) 25px, transparent 25px); background-size: 100% 25px; background-position: 0 11px; box-shadow: 0 14px 34px rgba(31, 45, 82, .14); rotate: var(--rot, 0deg); }
.nb-review .nb-tape { left: calc(50% - 55px); top: -14px; width: 110px; rotate: -4deg; }
.nb-review blockquote { margin: 0; font-size: 16px; line-height: 25px; color: #2A3553; }
.nb-mk { background: linear-gradient(transparent 10%, var(--nb-yellow) 10%, var(--nb-yellow) 92%, transparent 92%); color: inherit; padding: 0 .1em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.nb-more { margin-top: 6px; padding: 0; font-family: var(--hand); font-weight: 700; font-size: 24px; color: var(--nb-ink); text-decoration: underline; text-decoration-color: var(--nb-pen); text-underline-offset: 4px; }
.nb-review figcaption { margin-top: 12px; font-family: var(--hand); font-weight: 700; font-size: 25px; line-height: 1.1; color: var(--nb-pen); }
.nb-score { position: absolute; right: 10px; top: -30px; display: grid; place-items: center; align-content: center; width: 84px; height: 84px; border: 3px solid var(--nb-pen); border-radius: 50%; background: #fff; rotate: 10deg; font-family: var(--hand); font-weight: 700; font-size: 36px; line-height: .8; color: var(--nb-pen); text-align: center; }
.nb-score small { font-size: 19px; }

/* ---------- курсы: тетради ---------- */
.nb-course-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px; align-items: stretch; }
.nb-course { padding: 34px 34px 32px 60px; display: flex; flex-direction: column; gap: 22px; }
.nb-course:nth-child(odd) { rotate: -.6deg; }
.nb-course:nth-child(even) { rotate: .6deg; }
.nb-course::before { content: ''; position: absolute; left: 38px; top: 0; bottom: 0; width: 2px; background: var(--nb-margin); }
.nb-soon { position: absolute; z-index: 3; right: -16px; top: -24px; padding: 8px 18px; background: #fff; border: 3px solid var(--nb-pen); border-radius: 12px; rotate: 8deg; font-family: var(--hand); font-weight: 700; font-size: 36px; line-height: 1; color: var(--nb-pen); }
.nb-course-top { display: flex; gap: 28px; align-items: flex-start; }
.nb-cover { position: relative; flex-shrink: 0; width: 170px; height: 226px; padding: 22px 14px 16px 22px; border-radius: 4px 12px 12px 4px; background: var(--bg); box-shadow: 0 12px 26px rgba(31, 45, 82, .18), inset 10px 0 0 rgba(31, 45, 82, .08); rotate: -3deg; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.nb-label { width: 100%; padding: 10px 10px 8px; background: #fff; border: 1.5px solid var(--nb-ink); border-radius: 6px; display: flex; flex-direction: column; gap: 2px; }
.nb-label span { text-align: center; font-size: 11px; font-weight: 800; letter-spacing: .26em; }
.nb-label i { font-style: normal; font-family: var(--hand); font-weight: 700; font-size: 20px; line-height: 1.2; border-bottom: 1px solid var(--nb-dots); }
.nb-code { width: 100%; font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: 10px; line-height: 1.5; color: var(--nb-ink); }
.nb-cover-wave { width: 90px; height: auto; margin-top: auto; }
.nb-course-info { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; min-width: 0; }
.nb-course-status { display: flex; align-items: center; gap: 12px; }
.nb-course-status span { padding: 6px 12px; border-radius: 999px; background: var(--nb-ink); color: #fff; font-size: 13px; font-weight: 800; letter-spacing: .06em; }
.nb-course-status em { font-style: normal; font-family: var(--hand); font-weight: 700; font-size: 28px; color: var(--nb-green); }
.is-soon .nb-course-status em { color: var(--nb-pen); }
.nb-course h3 { font-family: var(--hand); font-weight: 700; font-size: clamp(46px, 4.4vw, 60px); line-height: .9; letter-spacing: 0; color: var(--nb-ink); }
.nb-course-info p { font-size: 16px; line-height: 1.5; color: var(--nb-ink-2); }
.nb-course-info .nb-facts { font-size: 15px; font-weight: 800; color: var(--nb-ink); }
.nb-course-info .nb-facts.is-muted { font-weight: 700; color: var(--nb-muted); }
.nb-lessons { list-style: none; display: grid; grid-template-rows: repeat(5, auto); grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); column-gap: 24px; row-gap: 6px; font-size: 15px; font-weight: 600; line-height: 1.35; }
.nb-lessons li { display: flex; align-items: baseline; gap: 8px; padding-bottom: 6px; border-bottom: 1.5px dotted var(--nb-dots); }
.nb-lessons li::before { content: var(--n); flex-shrink: 0; width: 28px; font-family: var(--hand); font-weight: 700; font-size: 22px; color: var(--nb-pen); }
.nb-placeholder { min-height: 220px; border: 2px dashed var(--nb-dots); border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 20px; text-align: center; }
.nb-placeholder span { font-family: var(--hand); font-weight: 700; font-size: 34px; line-height: 1; color: var(--nb-muted); }
.nb-placeholder code { padding: 8px 14px; border-radius: 8px; background: var(--nb-ink); color: #fff; font-size: 14px; }
.nb-course-foot { margin-top: auto; display: flex; align-items: center; flex-wrap: wrap; gap: 20px 28px; }
.nb-price { display: flex; flex-direction: column; padding: 14px 18px; background: var(--nb-yellow); box-shadow: 0 10px 22px rgba(31, 45, 82, .14); rotate: -3deg; }
.nb-price b { font-family: var(--hand); font-weight: 700; font-size: 50px; line-height: 1; }
.nb-price span { font-size: 13px; font-weight: 700; }
.nb-course-cta { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.nb-course-cta small { font-size: 13px; color: var(--nb-muted); }
.nb-course-cta .btn-ghost { white-space: normal; }

.nb-rest { display: flex; align-items: center; gap: 28px; margin-top: 56px; }
.nb-rest > p { flex-shrink: 0; width: 190px; font-size: 34px; line-height: 1; rotate: -3deg; }
.nb-rest-list { flex-grow: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.nb-mini { height: 130px; padding: 16px 20px 16px 30px; border-radius: 4px 12px 12px 4px; background: var(--bg); box-shadow: 0 12px 26px rgba(31, 45, 82, .12), inset 10px 0 0 rgba(31, 45, 82, .08); display: flex; flex-direction: column; justify-content: space-between; }
.nb-mini:nth-child(odd) { rotate: -1.5deg; }
.nb-mini:nth-child(even) { rotate: 1deg; }
.nb-mini span { font-size: 13px; font-weight: 800; letter-spacing: .14em; }
.nb-mini b { font-family: var(--hand); font-weight: 700; font-size: 34px; line-height: .95; }

/* ---------- FAQ ---------- */
.nb-faq-grid { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 72px; align-items: start; }
.nb-faq-side { display: flex; flex-direction: column; gap: 18px; }
.nb-faq-side p { font-size: 17px; line-height: 1.55; color: var(--nb-ink-2); }
.nb-faq-side .nb-link { align-self: flex-start; font-size: 17px; }
.nb-faq-sheet { padding: 20px 40px 20px 64px; box-shadow: 0 20px 50px rgba(31, 45, 82, .12); }
.nb-faq-sheet::before { content: ''; position: absolute; left: 42px; top: 0; bottom: 0; width: 2px; background: var(--nb-margin); }
.nb-faq-sheet details { padding: 22px 0; border-bottom: 2px dashed var(--nb-grid); }
.nb-faq-sheet details:last-child { border-bottom: 0; }
.nb-faq-sheet summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 16px; font-size: clamp(18px, 1.7vw, 22px); font-weight: 800; line-height: 1.3; color: var(--nb-ink); }
.nb-faq-sheet summary::-webkit-details-marker { display: none; }
.nb-q { flex-shrink: 0; display: grid; place-items: center; width: 40px; height: 40px; border: 2.5px solid var(--nb-pen); border-radius: 50%; font-size: 28px; line-height: 1; color: var(--nb-pen); transition: background .2s, color .2s; }
.nb-faq-sheet details[open] .nb-q { background: var(--nb-pen); color: #fff; }
.nb-faq-sheet details p { margin: 12px 0 0 56px; font-size: 17px; line-height: 1.6; color: var(--nb-ink-2); }

/* ---------- финал ---------- */
.nb-cta .wrap { display: flex; flex-direction: column; align-items: center; gap: 22px; text-align: center; }
.nb-cta-wave { width: min(520px, 86%); height: auto; }

/* ---------- адаптив ---------- */
@media (max-width: 1100px) {
  .nb-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nb-steps li { min-height: 0; }
  .nb-steps li::after { display: none; }
  .nb-steps li:nth-child(n) { margin-top: 0; }
  .nb-course-grid { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .nb-hero-grid { grid-template-columns: 1fr; }
  .nb-hero-visual { max-width: 620px; }
  .nb-spread { grid-template-columns: 1fr; gap: 28px; box-shadow: none; }
  .nb-spread::after { display: none; }
  .nb-page { border-radius: 6px; box-shadow: var(--nb-shadow); }
  .nb-page-right { padding-left: 76px; }
  .nb-page-right::before { content: ''; position: absolute; left: 50px; top: 0; bottom: 0; width: 2px; background: var(--nb-margin); }
  .nb-preview-grid { grid-template-columns: 1fr; }
  .nb-faq-grid { grid-template-columns: 1fr; gap: 28px; }
  .nb-head { grid-template-columns: 1fr; }
  .nb-numbers-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 20px; }
  .nb-rest { flex-direction: column; align-items: flex-start; }
  .nb-rest > p { width: auto; }
  .nb-rest-list { width: 100%; }
}
@media (max-width: 640px) {
  .nb-hero-sheet { padding: 34px 18px 24px 50px; }
  .nb-hero-sheet::before { left: 34px; }
  .nb-line { font-size: 16px; }
  .nb-sheet-head .nb-hand:first-child { font-size: 30px; }
  .nb-margin-note { margin-left: 84px; }
  .nb-arrow-up { left: -80px; width: 76px; }
  .nb-hero-note { font-size: 28px; }
  .nb-marquee-track { font-size: 26px; }
  .nb-page { padding: 34px 20px 40px 46px; }
  .nb-page-right { padding-left: 46px; }
  .nb-page-left::before, .nb-page-right::before { left: 28px; }
  .nb-sticker { font-size: 22px; padding: 8px 12px; }
  .nb-sticker-y { right: -10px; top: 18px; }
  .nb-sticker-r { left: -10px; bottom: 76px; }
  .nb-docs { gap: 18px; }
  .nb-doc figcaption { font-size: 20px; }
  .nb-steps { grid-template-columns: 1fr; gap: 28px; }
  .nb-course { padding: 30px 20px 28px 44px; }
  .nb-course::before { left: 28px; }
  .nb-course-top { flex-direction: column; gap: 22px; }
  .nb-lessons { grid-template-rows: none; grid-auto-flow: row; }
  .nb-soon { right: -6px; }
  .nb-rest-list { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .nb-mini { height: auto; min-height: 92px; gap: 10px; }
  .nb-mini b { font-size: 30px; }
  .nb-faq-sheet { padding: 12px 18px 12px 46px; }
  .nb-faq-sheet::before { left: 28px; }
  .nb-faq-sheet details p { margin-left: 0; }
  .nb-review { padding: 32px 22px 20px; }
  .nb-score { right: 8px; width: 72px; height: 72px; font-size: 30px; }
}
@media (max-width: 380px) {
  .nb-line { font-size: 14px; }
  .nb-hero h1 { font-size: 64px; }
}

/* ---------- рисование на странице (site.js) ---------- */
.nb-pen-canvas { position: fixed; left: 0; top: 0; z-index: 95; pointer-events: none; }
body.pen-on .nb-pen-canvas { pointer-events: auto; touch-action: none; cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 24 24'%3E%3Cpath d='M4 20l1.2-4.6L15.8 4.8a2 2 0 0 1 2.8 0l.6.6a2 2 0 0 1 0 2.8L8.6 18.8z' fill='%23fff' stroke='%231F2D52' stroke-width='1.6' stroke-linejoin='round'/%3E%3Cpath d='M4 20l1.2-4.6 3.4 3.4z' fill='%23E0314B'/%3E%3C/svg%3E") 3 25, crosshair; }
body.pen-on .nb-pen-canvas.is-eraser { cursor: cell; }
body.pen-on { -webkit-user-select: none; user-select: none; }
/* кнопка — ручка, лежит наискосок в правом нижнем углу */
.nb-pen-fab { position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 120; width: 96px; height: 96px; padding: 0; border: 0; border-radius: 50%; background: transparent; display: grid; place-items: center; -webkit-tap-highlight-color: transparent; }
.nb-pen-svg { width: 132px; height: auto; rotate: -40deg; filter: drop-shadow(3px 6px 5px rgba(31, 45, 82, .28)); transition: rotate .3s var(--ease), translate .3s var(--ease), filter .3s var(--ease); }
.nb-pen-fab:hover .nb-pen-svg, .nb-pen-fab:focus-visible .nb-pen-svg { rotate: -48deg; translate: -4px -8px; filter: drop-shadow(8px 14px 8px rgba(31, 45, 82, .25)); }
.nb-pen-fab:focus-visible { outline: 3px solid var(--nb-pen); outline-offset: 2px; }
.nb-pen-label { position: absolute; right: 98px; bottom: 34px; padding: 6px 12px; background: var(--nb-yellow); box-shadow: 0 8px 18px rgba(31, 45, 82, .16); rotate: -3deg; font-family: var(--hand); font-weight: 700; font-size: 24px; line-height: 1; white-space: nowrap; color: var(--nb-ink); opacity: 0; translate: 8px 0; pointer-events: none; transition: opacity .2s, translate .25s var(--ease); }
.nb-pen-fab:hover .nb-pen-label, .nb-pen-fab:focus-visible .nb-pen-label { opacity: 1; translate: 0 0; }
@media (prefers-reduced-motion: no-preference) {
  .nb-pen-fab .nb-pen-svg { animation: nb-pen-nudge 1.2s var(--ease) 2.5s 1; }
}
@keyframes nb-pen-nudge { 0%, 100% { rotate: -40deg; } 30% { rotate: -52deg; } 60% { rotate: -34deg; } }
.nb-pen-fab[hidden], .nb-pen-bar[hidden], .nb-pen-hint[hidden] { display: none; }
.nb-pen-bar { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 120; translate: -50% 0; display: flex; align-items: center; gap: 6px; padding: 7px; border: 2px solid var(--nb-ink); border-radius: 18px; background: #fff; box-shadow: 4px 4px 0 var(--nb-pen), 0 18px 40px rgba(31, 45, 82, .18); }
.nb-pen-tool { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; color: var(--nb-ink); transition: background .15s; }
.nb-pen-tool:hover { background: rgba(31, 45, 82, .07); }
.nb-pen-tool svg { width: 22px; height: 22px; }
.nb-pen-tool.is-pen i { width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px rgba(31, 45, 82, .25); }
.nb-pen-tool[aria-pressed="true"] { background: var(--nb-yellow); box-shadow: inset 0 0 0 2px var(--nb-ink); }
.nb-pen-tool.is-done { width: auto; padding: 0 16px; background: var(--nb-ink); color: #fff; font-family: var(--font); font-weight: 800; font-size: 15px; }
.nb-pen-tool.is-done:hover { background: var(--nb-ink-2); }
.nb-pen-hint { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom, 0px)); z-index: 120; translate: -50% 0; width: max-content; max-width: calc(100vw - 40px); margin: 0; padding: 12px 18px; background: var(--nb-yellow); box-shadow: 0 12px 26px rgba(31, 45, 82, .18); rotate: -1.5deg; font-family: var(--hand); font-weight: 700; font-size: 24px; line-height: 1.1; color: var(--nb-ink); text-align: center; pointer-events: none; }
@media (max-width: 420px) {
  .nb-pen-bar { gap: 2px; padding: 5px; }
  .nb-pen-tool { width: 40px; height: 40px; }
  .nb-pen-tool.is-done { padding: 0 12px; }
  .nb-pen-fab { right: 8px; width: 84px; height: 84px; }
  .nb-pen-svg { width: 112px; }
}
@media print { .nb-pen-fab, .nb-pen-bar, .nb-pen-hint { display: none !important; } }
