/* zavolsky.ru. Цвета и шрифт — от scrumweb.ru и apps.scrumweb.ru (Р-12). */

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

:root {
  --bg: #f2f5f4;
  --surface: #ffffff;
  --sunken: #e6ecea;
  --ink: #0e151d;
  --text: #38433f;
  --muted: #5d6966;
  --line: #d3dbd8;
  --accent: #0cbe7e;
  --btn: #08835a;
  --btn-hover: #066e4b;
  --link: #0a6aad;
  --sky: #4eb9fa;
  --tag-green: #066e4b; /* метки на светлом фоне: контраст не ниже 4,5:1 */

  /* ночная гамма — первый экран и подвал в обеих темах */
  --night: #0e151d;
  --night-2: #151f2a;
  --night-3: #1e2a37;
  --night-line: #25323f;
  --night-text: #c3cdca;
  --night-ink: #f2f6f5;

  --font: "Jost", "Segoe UI", system-ui, sans-serif;
  --wrap: 1180px;
  --radius: 14px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e151d;
    --surface: #151f2a;
    --sunken: #111a23;
    --ink: #f2f6f5;
    --text: #c3cdca;
    --muted: #8a9895;
    --line: #25323f;
    --link: #4eb9fa;
    --tag-green: #0cbe7e;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e151d;
  --surface: #151f2a;
  --sunken: #111a23;
  --ink: #f2f6f5;
  --text: #c3cdca;
  --muted: #8a9895;
  --line: #25323f;
  --link: #4eb9fa;
  --tag-green: #0cbe7e;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.6;
  overflow-x: hidden;
  /* подвал всегда у нижнего края: короткая страница растягивает main */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; }
img { max-width: 100%; display: block; height: auto; }
a { color: var(--link); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { color: var(--ink); margin: 0; line-height: 1.1; text-wrap: balance; }
h2 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem); font-weight: 600; letter-spacing: -0.015em; }
h3 { font-size: 1.22rem; font-weight: 600; line-height: 1.25; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.nowrap { white-space: nowrap; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 14px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- кнопки ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 28px;
  background: var(--btn); color: #fff;
  border: 2px solid var(--btn); border-radius: 999px;
  font: 600 1rem/1 var(--font); text-decoration: none; white-space: nowrap; text-align: center;
  transition: background-color .2s, border-color .2s;
}
.btn:hover { background: var(--btn-hover); border-color: var(--btn-hover); text-decoration: none; }
.btn-small { min-height: 40px; padding: 0 18px; font-size: .95rem; }
.btn-quiet { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-quiet:hover { background: transparent; border-color: var(--ink); }
.link-plain { color: inherit; font-weight: 500; }

/* ---------- шапка ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-row { display: flex; align-items: center; gap: 28px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 1.12rem; white-space: nowrap; }
.brand-mark { width: 26px; height: 26px; fill: var(--accent); }
.site-nav { display: flex; gap: 26px; margin-left: auto; font-weight: 500; }
.site-nav a { color: var(--muted); text-decoration: none; padding: 6px 0; white-space: nowrap; }
.site-nav a:hover, .site-nav a[aria-current] { color: var(--ink); }
.site-nav a[aria-current] { box-shadow: inset 0 -2px 0 var(--accent); }
.theme-toggle {
  width: 40px; height: 40px; display: grid; place-items: center;
  background: none; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); cursor: pointer;
}
.theme-toggle svg { width: 20px; height: 20px; fill: currentColor; }
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .moon { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .sun { display: block; }
}

/* ---------- волна ---------- */

.wave { display: block; width: 100%; height: 100%; }
.wave rect { fill: currentColor; }

/* ---------- первый экран ---------- */

.hero, .course-hero {
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--night); color: var(--night-text);
}
.hero { padding: clamp(56px, 9vw, 120px) 0 clamp(72px, 10vw, 140px); }
.hero h1, .course-hero h1 { color: var(--night-ink); }
.hero-layers { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.layer { position: absolute; left: -5%; right: -5%; will-change: transform; }
.layer-far { top: 12%; height: 76%; color: var(--sky); opacity: .07; }
.layer-near { top: 58%; height: 40%; color: var(--accent); opacity: .16; left: 52%; right: -8%; }
/* передняя волна уходит вправо, под переписку: текст слева читается по ровному фону */
.hero-text { position: relative; }

.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(3.1rem, 1.6rem + 6vw, 6.4rem); font-weight: 600; line-height: .98; letter-spacing: -0.03em; }
.hero-sub { margin-top: 28px; max-width: 34em; font-size: 1.2rem; line-height: 1.55; }
.hero-actions { display: flex; align-items: center; gap: 28px; margin-top: 40px; flex-wrap: wrap; }
.hero .link-plain { color: var(--night-ink); }

/* переписка */
.chat {
  background: var(--night-2); border: 1px solid var(--night-line); border-radius: 24px;
  padding: 18px 18px 22px; display: grid; gap: 12px; max-width: 430px; justify-self: end; width: 100%;
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .7);
}
.chat-head { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--night-line); color: var(--night-ink); }
.chat-head small { display: block; color: var(--accent); font-size: .85rem; line-height: 1.2; }
.chat-head b { display: block; font-weight: 600; line-height: 1.2; }
.chat-avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--night); font-weight: 700; }
.msg { max-width: 88%; padding: 10px 14px; border-radius: 18px; font-size: .98rem; line-height: 1.45; }
.msg-out { justify-self: end; background: #0d3d2e; color: #dff5ec; border-bottom-right-radius: 6px; }
.msg-in { justify-self: start; background: var(--night-3); color: var(--night-ink); border-bottom-left-radius: 6px; display: grid; gap: 10px; }
.msg-text { font-style: italic; color: #b9e6d4; }
.msg-voice { display: flex; align-items: center; gap: 10px; }
.msg-out.msg-voice { width: 260px; }
.msg-voice small { font-size: .8rem; opacity: .75; font-variant-numeric: tabular-nums; }
.play { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--accent); position: relative; border: 0; padding: 0; }
button.play { cursor: pointer; transition: transform .15s, background-color .15s; }
button.play:hover { transform: scale(1.08); }
.play::after { content: ""; position: absolute; left: 14px; top: 11px; border-left: 11px solid var(--night); border-top: 7px solid transparent; border-bottom: 7px solid transparent; }
/* пауза — две полоски */
.play.is-playing::after { left: 12px; top: 11px; width: 4px; height: 14px; border: 0; border-radius: 1px; background: var(--night); box-shadow: 8px 0 0 var(--night); }
.play:disabled { opacity: .5; cursor: progress; }
.msg-voice-in .play { background: var(--sky); }
.wave-msg { height: 26px; flex: 1; color: rgba(255, 255, 255, .28); }

/* сцена загрузки: просьба, расшифровка, ответ — один раз */
.js .chat .msg { opacity: 0; transform: translateY(10px); transition: opacity .5s ease, transform .5s ease; }
.js .chat.is-play .msg { opacity: 1; transform: none; }
.js .chat.is-play .msg:nth-of-type(2) { transition-delay: 1.5s; }
.js .chat.is-play .msg:nth-of-type(3) { transition-delay: 2.6s; }
/* проигрывание: столбики до текущего места окрашиваются (класс .on ставит site.js) */
.wave-msg rect { transition: fill .12s; }
.msg-out .wave-msg rect.on { fill: var(--accent); }
.msg-in .wave-msg rect.on { fill: var(--sky); }

/* ---------- секции ---------- */

.section { padding: clamp(72px, 9vw, 128px) 0; }
.section-tight { padding-top: 24px; }
.section-alt { background: var(--sunken); }
.section-lead { margin-top: 16px; max-width: 40em; font-size: 1.12rem; color: var(--muted); }

.statement { max-width: 22em; font-size: clamp(1.9rem, 1.2rem + 2.6vw, 3.1rem); font-weight: 500; line-height: 1.15; }
.audience-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px; margin-top: 64px; }
.audience-grid > div { border-top: 3px solid var(--ink); padding-top: 20px; }
.audience-grid p { margin-top: 10px; }
.aside-note { margin-top: 48px; color: var(--muted); max-width: 40em; }

/* Ленты профессий: ряды плывут навстречу друг другу и не кончаются — список
   тех, кому пригодится Джарвис, бесконечный. Две копии ряда дают бесшовный круг. */
.crowd {
  margin-top: 72px; display: grid; gap: 14px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}
.crowd-row { display: flex; overflow: hidden; }
.crowd-track { flex: none; display: flex; gap: 14px; padding-right: 14px; margin: 0; list-style: none; animation: crowd 80s linear infinite; }
.crowd-row-2 .crowd-track { animation-direction: reverse; animation-duration: 95s; }
.crowd-row-3 .crowd-track { animation-duration: 110s; }
.crowd:hover .crowd-track { animation-play-state: paused; }
.crowd li {
  white-space: nowrap; padding: 12px 22px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--muted); font-size: 1rem;
}
.crowd li b { color: var(--ink); font-weight: 600; margin-right: 6px; }
@keyframes crowd { to { transform: translateX(-100%); } }
.crowd-end { margin-top: 56px; max-width: 26em; font-size: clamp(1.4rem, 1rem + 1.4vw, 2rem); line-height: 1.25; font-weight: 500; color: var(--ink); }
.crowd-end + .aside-note { margin-top: 20px; }

/* цепочка: линия заполняется по мере прокрутки (--p от 0 до 1) */
.how { background: var(--surface); }
.pipeline { --p: 0; list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; margin-top: 64px; position: relative; }
.pipeline::before, .pipeline::after {
  content: ""; position: absolute; top: 11px; left: 12px; right: 12px; height: 2px; background: var(--line);
}
.pipeline::after { background: var(--accent); transform-origin: left; transform: scaleX(var(--p)); }
.pipeline li { position: relative; z-index: 1; }
.step-dot { display: block; width: 24px; height: 24px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line); transition: border-color .3s, background-color .3s; }
.pipeline li.is-on .step-dot { border-color: var(--accent); background: var(--accent); }
.step-art { display: block; width: 88px; height: 64px; margin: 28px 0 0; color: var(--ink); }
.step-art .hl { color: var(--accent); }
.step-art .sky { color: var(--sky); }
.pipeline h3 { margin-top: 20px; }
.pipeline p { margin-top: 8px; color: var(--muted); }

.grows { background: var(--night); color: var(--night-text); overflow: hidden; }
.grows h2 { color: var(--night-ink); }
.grows-inner { display: grid; grid-template-columns: .9fr 1.1fr; gap: 64px; align-items: center; }
.grows p { margin-top: 20px; font-size: 1.15rem; max-width: 34em; }
.grows-wave { height: 220px; color: var(--accent); will-change: transform; }
.wave-grows rect:nth-child(3n) { fill: var(--sky); }

/* ---------- видеоотзывы ---------- */

.reviews { background: var(--surface); }
.reviews-empty .section-lead { margin-top: 14px; }
.reviews-empty p + p { margin-top: 14px; color: var(--muted); }
.reviews-demo { margin-top: 14px; padding-left: 14px; border-left: 3px solid var(--accent); color: var(--muted); font-size: .95rem; }
.review-list { list-style: none; margin-top: 40px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.review-play {
  /* обложка 4:5 — четыре вертикальных кадра 9:16 заняли бы весь экран; сам ролик в окне — 9:16 */
  position: relative; display: block; width: 100%; aspect-ratio: 4 / 5; padding: 0; border: 0;
  border-radius: 18px; overflow: hidden; background: var(--night); cursor: pointer;
}
.review-play img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.review-play:hover img { transform: scale(1.03); }
.review-icon { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%; background: var(--accent); transition: transform .2s; }
.review-icon::after { content: ""; position: absolute; left: 26px; top: 21px; border-left: 18px solid var(--night); border-top: 11px solid transparent; border-bottom: 11px solid transparent; }
.review-play:hover .review-icon { transform: scale(1.08); }
.review-quote { margin-top: 16px; color: var(--ink); font-weight: 500; line-height: 1.4; }
.review-who { margin-top: 6px; font-size: .95rem; color: var(--muted); }
.review-who b { color: var(--ink); font-weight: 600; }

/* галерея ui-media-gallery (Р-34): пакет читает цвета из переменных --ui-* сайта */
:root { --ui-accent: #0cbe7e; --ui-cta-bg: #08835a; --ui-radius: 12px; }
/* фон окна пакет задаёт сам, без хост-переменной: перекрываем более точным селектором */
html:root { --umg-backdrop: rgba(10, 15, 21, .96); }

/* ---------- тарифы ---------- */

.tariffs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 48px; align-items: stretch; }
.tariff { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px 28px; }
.tariff-assist { background: var(--night); border-color: var(--night); color: var(--night-text); }
/* в тёмной теме фон страницы тоже ночной — выделяем рамкой */
:root[data-theme="dark"] .tariff-assist { border-color: var(--btn); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tariff-assist { border-color: var(--btn); } }
.tariff-assist h3, .tariff-assist .tariff-price { color: var(--night-ink); }
.tariff-assist .btn-quiet { color: var(--night-ink); }
.tariff-price { margin-top: 14px; font-size: 2.4rem; font-weight: 600; color: var(--ink); line-height: 1.1; font-variant-numeric: tabular-nums; }
.tariff-price span { font-size: 1rem; font-weight: 500; color: var(--muted); }
.tariff-lead { margin-top: 14px; }
.tariff ul { list-style: none; margin: 22px 0 0; display: grid; gap: 10px; }
.tariff li { padding-left: 26px; position: relative; }
.tariff li::before { content: ""; position: absolute; left: 2px; top: .55em; width: 12px; height: 7px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }
.tariff-foot { margin-top: auto; padding-top: 32px; }
.tariff-foot .btn { width: 100%; }
.tariff-note { margin-top: 12px; min-height: 2.9em; font-size: .9rem; line-height: 1.45; color: var(--muted); }
/* консультация по ИИ — во всю ширину под тарифами: слева цена и кнопка, справа темы */
.ai-consult { margin-top: 20px; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 48px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 36px 40px; }
.ai-consult h3 { font-size: 1.35rem; }
.ai-consult-foot { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 14px 20px; align-items: center; }
.ai-consult-foot .btn { margin-top: 0; }
.ai-consult-foot .tariff-note { margin-top: 0; min-height: 0; flex: 1 1 16em; }
.ai-consult-list { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 28px; }
.ai-consult-list li { padding-left: 26px; position: relative; }
.ai-consult-list li::before { content: ""; position: absolute; left: 2px; top: .55em; width: 12px; height: 7px;
  border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }
@media (max-width: 960px) { .ai-consult { grid-template-columns: 1fr; gap: 28px; padding: 28px 22px; } }
@media (max-width: 560px) { .ai-consult-list { grid-template-columns: 1fr; } .ai-consult-foot .btn { width: 100%; } }
.tariff-assist .tariff-note { color: var(--night-text); opacity: .8; }
.consult-line, .preorder-line { margin-top: 28px; max-width: 46em; }
.preorder-line { margin-top: 12px; color: var(--muted); }

/* ---------- автор ---------- */

.about { background: var(--surface); }
.about-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 72px; align-items: start; }
.about-grid .portrait { order: 2; }
.portrait { margin: 0; position: relative; will-change: transform; }
.portrait::before { content: ""; position: absolute; inset: 28px -18px -18px 28px; border: 2px solid var(--accent); border-radius: 22px; z-index: 0; }
.portrait img { position: relative; z-index: 1; border-radius: 22px; width: 100%; }
.about-text > p { margin-top: 18px; max-width: 36em; }

.chart { margin: 48px 0 0; padding: 28px; border-radius: var(--radius); background: var(--sunken); }
.chart figcaption b { display: block; color: var(--ink); font-weight: 600; font-size: 1.08rem; }
.chart figcaption span { display: block; color: var(--muted); font-size: .95rem; }
.bars { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; height: 230px; margin-top: 24px; align-items: end; }
.bar { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; }
.bar-fill { display: block; height: var(--h); background: var(--btn); border-radius: 8px 8px 3px 3px; transform-origin: bottom; }
.bar:last-child .bar-fill { background: var(--accent); }
.bar-value { text-align: center; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; margin-bottom: 6px; }
.bar-label { position: absolute; bottom: -28px; left: 0; right: 0; text-align: center; font-size: .9rem; color: var(--muted); }
.js .chart .bar-fill { transform: scaleY(0); transition: transform .9s cubic-bezier(.2, .7, .2, 1); }
.js .chart .bar-value { opacity: 0; transition: opacity .4s .7s; }
.js .chart.is-in .bar-fill { transform: none; }
.js .chart.is-in .bar-value { opacity: 1; }
.js .chart.is-in .bar:nth-child(2) .bar-fill { transition-delay: .08s; }
.js .chart.is-in .bar:nth-child(3) .bar-fill { transition-delay: .16s; }
.js .chart.is-in .bar:nth-child(4) .bar-fill { transition-delay: .24s; }
.js .chart.is-in .bar:nth-child(5) .bar-fill { transition-delay: .32s; }
.chart-foot { margin-top: 48px; font-size: .95rem; color: var(--muted); }

/* ---------- проекты ---------- */

.project-list { list-style: none; margin-top: 40px; border-top: 1px solid var(--line); }
.project-list li { display: grid; grid-template-columns: 14rem 1fr auto; gap: 32px; align-items: baseline; padding: 22px 0; border-bottom: 1px solid var(--line); }
.project-list a { font-weight: 500; white-space: nowrap; }

/* ---------- покупка ---------- */

.buy { background: var(--sunken); }
.buy-steps { list-style: none; counter-reset: step; display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; margin-top: 48px; }
.buy-steps li { counter-increment: step; }
.buy-steps li::before {
  content: counter(step); display: grid; place-items: center;
  width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--accent);
  color: var(--ink); font-weight: 600; font-size: 1.2rem; margin-bottom: 20px;
}
.buy-steps p { margin-top: 8px; }

/* ---------- вопросы ---------- */

.faq-wrap { display: grid; grid-template-columns: .7fr 1.3fr; gap: 64px; }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list details:first-child { border-top: 1px solid var(--line); }
.faq-list summary {
  list-style: none; cursor: pointer; padding: 20px 40px 20px 0; position: relative;
  color: var(--ink); font-weight: 500; font-size: 1.1rem;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; position: absolute; right: 6px; top: 14px; font-size: 1.6rem; color: var(--accent); transition: transform .2s; }
.faq-list details[open] summary::after { transform: rotate(45deg); }
.faq-list details p { padding: 0 40px 22px 0; }

/* ---------- внутренние страницы ---------- */

.page-head { padding: clamp(56px, 8vw, 104px) 0 32px; }
.page-head h1, .course-hero h1 { font-size: clamp(2.6rem, 1.6rem + 4vw, 4.4rem); font-weight: 600; letter-spacing: -0.025em; }
.page-head-center { text-align: center; padding-bottom: 120px; }
.page-head-center .section-lead { margin-inline: auto; }
.page-head-center p:last-child { margin-top: 32px; display: flex; gap: 24px; justify-content: center; align-items: center; flex-wrap: wrap; }

.course-hero { padding: 56px 0 96px; }
.course-hero .layer-far { top: 30%; opacity: .07; }
.course-hero .hero-sub { max-width: 38em; }
.course-hero .btn { margin-top: 32px; }
.crumbs { margin-bottom: 18px; }
.crumbs a { color: var(--night-text); }
.course-facts { margin-top: 16px; color: var(--accent); font-weight: 500; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 72px; }
.tick-list, .goal-list { margin-top: 28px; display: grid; gap: 16px; }
.tick-list { list-style: none; }
.tick-list b { color: var(--ink); font-weight: 600; }
.goal-list { padding-left: 1.4em; }
.goal-list li::marker { color: var(--btn); font-weight: 600; }

.course-row {
  display: grid; grid-template-columns: 320px 1fr; gap: 40px; align-items: center;
  padding: 28px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--text); text-decoration: none;
}
.course-row:hover { border-color: var(--ink); }
.course-row h2 { font-size: 2rem; }
.course-row p { margin-top: 10px; }
.course-row-art { background: var(--night); border-radius: 10px; height: 180px; padding: 40px 28px; color: var(--accent); }
.course-row-meta { color: var(--muted); }

.contacts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; }
.contact-main { display: grid; gap: 14px; }
.contact-big { font-size: clamp(1.4rem, 1rem + 1.6vw, 2.2rem); font-weight: 500; color: var(--ink); }
.requisites { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 10px 24px; }
.requisites dt { color: var(--muted); }
.requisites dd { margin: 0; color: var(--ink); }

/* ---------- статьи и кейсы ---------- */

.tabs { display: flex; gap: 8px; margin-top: 32px; flex-wrap: wrap; }
.tabs a {
  padding: 8px 18px; border: 1px solid var(--line); border-radius: 999px;
  color: var(--text); text-decoration: none; font-weight: 500;
}
.tabs a:hover { border-color: var(--ink); }
.tabs a[aria-current] { background: var(--ink); border-color: var(--ink); color: var(--bg); }

.article-list { list-style: none; border-top: 1px solid var(--line); }
.article-row { padding: 32px 0; border-bottom: 1px solid var(--line); }
.article-row h2 { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); margin-top: 10px; }
.article-row h2 a { color: var(--ink); text-decoration: none; }
.article-row h2 a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.article-row > p:last-child { margin-top: 10px; color: var(--muted); }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; color: var(--muted); font-size: .92rem; }
.article-type { font-weight: 600; color: var(--tag-green); }
.article-type-case { color: var(--link); }
.draft-mark { padding: 2px 10px; border-radius: 999px; background: #f6e7b4; color: #5c4700; font-size: .85rem; }
.empty-note { color: var(--muted); max-width: 40em; }

.article-head h1 { margin-top: 14px; max-width: 18em; }
.crumbs-light { margin-bottom: 20px; }
.crumbs-light a { color: var(--muted); }

.prose { max-width: 40em; padding-bottom: 24px; font-size: 1.08rem; line-height: 1.7; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { margin-top: 2em; font-size: 1.7rem; }
.prose h3 { margin-top: 1.6em; font-size: 1.25rem; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .4em; }
.prose li::marker { color: var(--btn); }
.prose blockquote { margin-left: 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--accent); color: var(--ink); font-size: 1.15rem; }
.prose code { font-family: Consolas, "Cascadia Mono", monospace; font-size: .9em; padding: 1px 6px; border-radius: 5px; background: var(--sunken); }
.prose pre { overflow-x: auto; padding: 18px 20px; border-radius: 12px; background: var(--night); color: var(--night-text); line-height: 1.5; }
.prose pre code { padding: 0; background: none; font-size: .88rem; }
.table-wrap { overflow-x: auto; margin-top: 1.6em; }
.prose table { width: 100%; border-collapse: collapse; font-size: 1rem; }
.prose th, .prose td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { color: var(--ink); font-weight: 600; }
.prose td:first-child { color: var(--muted); }
.prose figure { margin: 2em 0; }
.prose figure img { border-radius: 12px; cursor: zoom-in; }
.prose figcaption { margin-top: 10px; color: var(--muted); font-size: .92rem; }

/* список: миниатюра слева */
.article-row.has-cover { display: grid; grid-template-columns: 1fr 2fr; gap: 40px; align-items: center; }
.article-row .article-desc { max-width: 44em; }
.article-thumb { display: block; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--night); }
.article-thumb img { width: 100%; height: auto; transition: transform .4s ease; }
.article-thumb:hover img { transform: scale(1.03); }
.article-desc { margin-top: 10px; color: var(--muted); }

/* статья: текст и боковая колонка */
.article-layout { display: grid; grid-template-columns: minmax(0, 40em) 320px; justify-content: space-between; gap: 64px; align-items: start; }
.article-cover { margin: 0 0 40px; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--night); }
.article-cover img { width: 100%; height: auto; }
.article-side { align-self: stretch; }
/* колонка едет со страницей: top выставляет site.js — вниз держится нижним краем, вверх верхним */
.side-inner { position: sticky; top: 92px; display: grid; gap: 16px; padding-bottom: 24px; }
.side-box { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); font-size: .95rem; line-height: 1.5; }
.side-title { margin-bottom: 12px; color: var(--ink); font-weight: 600; }
.side-toc ol { list-style: none; display: grid; gap: 4px; }
.side-toc a { display: block; padding: 6px 0 6px 14px; border-left: 2px solid var(--line); color: var(--muted); text-decoration: none; }
.side-toc a:hover { color: var(--ink); }
.side-toc a[aria-current] { border-left-color: var(--accent); color: var(--ink); }
.side-facts ul { list-style: none; display: grid; gap: 10px; }
/* «Коротко о кейсе»: на широком экране — в колонке, на узком — перед текстом */
.facts-inline { display: none; }
.side-facts li { padding-left: 22px; position: relative; color: var(--text); }
.side-facts li::before { content: ""; position: absolute; left: 2px; top: .5em; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.side-course { position: relative; overflow: hidden; background: var(--night); border-color: var(--night); color: var(--night-text); }
:root[data-theme="dark"] .side-course { border-color: var(--btn); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .side-course { border-color: var(--btn); } }
.wave-side { position: absolute; right: -10px; top: 14px; width: 140px; height: 50px; color: var(--accent); opacity: .25; }
.side-course-name { position: relative; color: var(--night-ink); font-weight: 600; font-size: 1.1rem; max-width: 12em; }
.side-course > p + p { margin-top: 8px; }
.side-price { margin-top: 14px !important; color: var(--night-ink); font-size: 1.6rem; font-weight: 600; line-height: 1.2; }
.side-price span { display: block; color: var(--accent); font-size: .9rem; font-weight: 500; }
.side-course .btn { width: 100%; margin-top: 16px; }
.side-note { margin-top: 12px !important; font-size: .88rem; opacity: .85; }
.side-author { display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: start; }
.side-author img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; object-position: 50% 22%; }
.side-author p + p { margin-top: 4px; color: var(--muted); }
.side-author b { color: var(--ink); }
.side-author a { display: inline-block; margin-top: 8px; }

.article-cta {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  max-width: 40em; margin: 24px 0 96px; padding: 28px; border-radius: var(--radius);
  background: var(--night); color: var(--night-text);
}
.article-cta b { color: var(--night-ink); }
.article-cta p { flex: 1 1 18em; }

/* ---------- вход и регистрация ---------- */

/* в ширину контента, как весь сайт: на широких экранах панель и форма не разъезжаются по краям */
.auth { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 48px 24px 96px; }
.auth-side {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end;
  min-height: 560px; padding: 48px; border: 1px solid var(--night-line); border-radius: 24px;
  background: var(--night); color: var(--night-text);
}
:root[data-theme="dark"] .auth-side { background: #0a1017; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .auth-side { background: #0a1017; } }
.auth-wave { position: absolute; left: -4%; right: -4%; top: 9%; height: 26%; color: var(--accent); opacity: .22; }
.wave-auth rect:nth-child(3n) { fill: var(--sky); }
.auth-quote { position: relative; color: var(--night-ink); font-size: clamp(2.2rem, 1.2rem + 2.6vw, 3.6rem); font-weight: 600; line-height: 1; letter-spacing: -0.025em; }
.auth-note { position: relative; margin-top: 18px; max-width: 26em; }
.auth-main { display: flex; align-items: center; justify-content: center; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h1 { font-size: 2.2rem; font-weight: 600; letter-spacing: -0.02em; }
.auth-lead { margin-top: 10px; color: var(--muted); }

/* ---------- формы ---------- */

.form { display: grid; gap: 18px; margin-top: 28px; }
.field { display: grid; gap: 6px; align-content: start; }
.field label { color: var(--ink); font-weight: 500; font-size: .95rem; }
.optional { color: var(--muted); font-weight: 400; font-size: .85rem; margin-left: 6px; }
.field input[type="text"], .field input[type="email"], .field input[type="password"] {
  width: 100%; min-height: 50px; padding: 0 16px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); color: var(--ink); font: 400 1rem var(--font);
  transition: border-color .15s, box-shadow .15s;
}
.field input:hover { border-color: var(--muted); }
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.field input[aria-invalid="true"] { border-color: #d14b4b; }
.field-hint { font-size: .85rem; color: var(--muted); line-height: 1.4; }
/* есть ошибка — подсказка того же поля не нужна, иначе одно и то же дважды */
.field:has([aria-invalid="true"]) .field-hint { display: none; }
.field-error, .form-error { color: #c43c3c; font-size: .9rem; line-height: 1.4; }
.field-error:empty, .form-error:empty, .form-ok:empty { display: none; }
:root[data-theme="dark"] .field-error, :root[data-theme="dark"] .form-error { color: #ff8a8a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .field-error, :root:not([data-theme="light"]) .form-error { color: #ff8a8a; } }
.form-ok { color: var(--tag-green); font-size: .95rem; font-weight: 500; }
.form-status { color: var(--muted); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .95rem; line-height: 1.45; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--btn); flex: none; }
.btn-wide { width: 100%; }
.club-actions:empty { display: none; }
.note-warn { padding: 10px 14px; border-radius: 12px; background: #f6e7b4; color: #5c4700; }
/* уведомление о cookie: внизу, поверх, не сдвигает страницу */
.cookie-note { position: fixed; z-index: 60; left: 16px; right: 16px; bottom: 16px; max-width: 640px; margin-inline: auto;
  display: flex; gap: 16px; align-items: center; padding: 14px 16px 14px 20px; border: 1px solid var(--line); border-radius: 16px;
  background: var(--surface); color: var(--ink); box-shadow: 0 12px 40px rgb(0 0 0 / .18); font-size: .92rem; line-height: 1.45; }
.cookie-note p { margin: 0; }
.cookie-note .btn { flex: none; margin-top: 0; }
.cookie-note[hidden] { display: none; }
@media (max-width: 480px) { .cookie-note { flex-direction: column; align-items: stretch; } }
/* ловушка для ботов: вне экрана, не display:none — иначе простые боты её пропускают */
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
/* пароль: кнопка «показать» внутри поля */
.pw-wrap { position: relative; display: block; }
.field .pw-wrap input[type="password"], .field .pw-wrap input[type="text"] { padding-right: 52px; }
.pw-eye { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); display: grid; place-items: center;
  width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; }
.pw-eye:hover { color: var(--ink); }
.pw-eye:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
.pw-eye svg { width: 22px; height: 22px; }
.pw-eye .eye-off, .pw-eye[aria-pressed="true"] .eye-on { display: none; }
.pw-eye[aria-pressed="true"] .eye-off { display: block; }
.form > .btn-small { justify-self: start; }
.btn.is-busy { opacity: .7; cursor: progress; }
.form-links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; font-size: .95rem; color: var(--muted); }
.form-inline { margin-top: 0; gap: 8px; justify-items: start; }
.form-row { grid-template-columns: 1fr auto; align-items: start; margin-top: 14px; }
.form-row .form-ok, .form-row .form-error { grid-column: 1 / -1; }
/* кнопка рядом с полем — той же высоты и без отступа карточки (.card .btn) */
.card .form-row .btn, .form-row .btn { margin-top: 0; min-height: 50px; }
.form-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ---------- кабинет ---------- */

.cabinet { padding: 40px 0 96px; flex: 1; }
.cabinet-grid { display: grid; grid-template-columns: 260px 1fr; gap: 48px; align-items: start; }
.cabinet-nav { position: sticky; top: 100px; display: grid; gap: 22px; }
.cabinet-who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cabinet-who b { display: block; color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cabinet-who small { display: block; color: var(--muted); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cabinet-who > span:last-child { min-width: 0; }
.cabinet-avatar { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 20%, var(--surface)); color: var(--tag-green); font-weight: 700; font-size: 1.1rem; }
.cabinet-nav nav { display: grid; gap: 4px; }
.cabinet-nav nav a { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; color: var(--text); text-decoration: none; font-weight: 500; }
.cabinet-nav nav a:hover { background: var(--sunken); color: var(--ink); }
.cabinet-nav nav a[aria-current] { background: var(--ink); color: var(--bg); }
.cabinet-nav nav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.cabinet-nav nav a[aria-current] svg { stroke: var(--accent); }
:root[data-theme="dark"] .cabinet-nav nav a[aria-current] svg { stroke: var(--btn); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cabinet-nav nav a[aria-current] svg { stroke: var(--btn); } }
.cabinet-help { padding: 16px; border: 1px dashed var(--line); border-radius: 12px; font-size: .92rem; }
.cabinet-help p { color: var(--muted); margin-bottom: 4px; }
.cabinet-logout { justify-self: start; padding: 0; border: 0; background: none; color: var(--muted); font: 500 .95rem var(--font); cursor: pointer; text-decoration: underline; text-underline-offset: .18em; }
.cabinet-logout:hover { color: var(--ink); }

.cabinet-head h1 { font-size: clamp(1.9rem, 1.4rem + 1.4vw, 2.6rem); font-weight: 600; letter-spacing: -0.02em; }
.cabinet-lead { margin-top: 8px; color: var(--muted); }
.cabinet-main > * + * { margin-top: 24px; }

.notice { display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 18px 22px; border-radius: var(--radius); }
.notice p { margin-top: 4px; font-size: .95rem; }
.notice > div { flex: 1 1 22em; }
.notice-warn { background: #fdf3d6; color: #4f4210; }
.notice-warn b { color: #3a3008; }
.notice-ok { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); color: var(--ink); margin-top: 14px; }
:root[data-theme="dark"] .notice-warn { background: #3a3214; color: #f1e3b5; }
:root[data-theme="dark"] .notice-warn b { color: #fff3cc; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .notice-warn { background: #3a3214; color: #f1e3b5; }
  :root:not([data-theme="light"]) .notice-warn b { color: #fff3cc; }
}
.notice-warn .btn-quiet { color: inherit; border-color: currentColor; }

.course-panel {
  display: grid; grid-template-columns: 260px 1fr; gap: 32px; align-items: center;
  padding: 28px; border: 1px solid var(--night-line); border-radius: 18px; background: var(--night); color: var(--night-text);
}
.course-panel-art { height: 160px; padding: 24px 8px; border-radius: 12px; background: #0a1017; color: var(--sky); }
.course-panel.is-owned .course-panel-art { color: var(--accent); }
.course-panel h2 { color: var(--night-ink); font-size: 1.9rem; }
.course-panel-kicker { color: var(--accent); font-weight: 600; font-size: .95rem; margin-bottom: 6px; }
.course-panel-body > p:not(.course-panel-kicker) { margin-top: 10px; max-width: 34em; }
.course-panel .btn { margin-top: 20px; }
.progress { margin-top: 18px; height: 8px; border-radius: 99px; background: var(--night-3); overflow: hidden; }
.progress-bar { display: block; height: 100%; width: calc(var(--v) * 1%); min-width: 8px; border-radius: 99px; background: var(--accent); }
.progress-note { margin-top: 8px; font-size: .9rem; opacity: .8; }

.cabinet-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.cabinet-cards-1 { grid-template-columns: 1fr; max-width: 720px; }
.card { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.card h2 { font-size: 1.25rem; font-weight: 600; letter-spacing: 0; }
.card > p { margin-top: 10px; }
.card .btn { margin-top: 16px; }
.card-note { color: var(--muted); font-size: .92rem; }
.profile-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.profile-line b { color: var(--ink); font-weight: 600; }
.badge { padding: 2px 10px; border-radius: 99px; font-size: .82rem; font-weight: 500; }
.badge-ok { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--tag-green); }
.badge-warn { background: #f6e7b4; color: #5c4700; }

.empty { padding: 40px; border: 1px dashed var(--line); border-radius: var(--radius); text-align: center; }
.empty p { color: var(--muted); }
.empty b { color: var(--ink); }
.empty .btn { margin-top: 20px; }
.orders { width: 100%; border-collapse: collapse; }
.orders th, .orders td { padding: 14px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.orders th { color: var(--muted); font-weight: 500; font-size: .9rem; }
.orders .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.status { padding: 3px 10px; border-radius: 99px; font-size: .85rem; background: var(--sunken); white-space: nowrap; }
.status-paid { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--tag-green); }
.status-pending { background: #f6e7b4; color: #5c4700; }

.preview-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 10px 14px; border: 1px dashed #c9a227; border-radius: 12px; background: #fdf3d6; color: #4f4210; font-size: .88rem; }
.preview-bar a { padding: 3px 10px; border-radius: 99px; color: inherit; text-decoration: none; }
.preview-bar a:hover { background: rgba(0, 0, 0, .06); }
.preview-bar a[aria-current] { background: #4f4210; color: #fdf3d6; }

/* окно подтверждения заказа */
.buy-dialog { width: min(480px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); color: var(--text); box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .5); }
.buy-dialog::backdrop { background: rgba(10, 15, 21, .7); }
.buy-form { margin: 0; padding: 32px; gap: 14px; }
.buy-kicker { color: var(--tag-green); font-weight: 600; font-size: .9rem; }
.buy-form h2 { font-size: 1.6rem; }
.buy-price { color: var(--ink); font-size: 2rem; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.buy-note { color: var(--muted); }
.buy-facts { list-style: none; display: grid; gap: 8px; padding: 14px 16px; border-radius: 12px; background: var(--sunken); font-size: .92rem; }
.buy-facts li { padding-left: 22px; position: relative; }
.buy-facts li::before { content: ""; position: absolute; left: 2px; top: .45em; width: 10px; height: 6px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }
.buy-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.buy-actions .btn { flex: 1 1 auto; }

/* ---------- курс в кабинете ---------- */

.course-progress { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.course-progress-num { color: var(--muted); }
.course-progress-num b { color: var(--ink); font-size: 1.6rem; font-weight: 600; margin-right: 4px; }
.course-progress .card-note { margin-top: 4px; }
.progress-light { background: var(--sunken); margin-top: 14px; }
.course-next {
  display: flex; align-items: center; gap: 14px; max-width: 360px; padding: 14px 20px 14px 14px;
  border-radius: 16px; background: var(--night); color: var(--night-ink); text-decoration: none;
  transition: transform .15s;
}
.course-next:hover { transform: translateY(-2px); }
.course-next small { display: block; color: var(--accent); font-size: .85rem; font-weight: 600; }
.course-next span:last-child { font-weight: 500; line-height: 1.3; }
.course-next-play { flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--accent); position: relative; }
.course-next-play::after, .player-play::after { content: ""; position: absolute; left: 50%; top: 50%; transform: translate(-35%, -50%); border-left: 14px solid var(--night); border-top: 9px solid transparent; border-bottom: 9px solid transparent; }

.module h2 { display: flex; align-items: baseline; gap: 12px; font-size: 1.35rem; font-weight: 600; letter-spacing: 0; }
.module h2 span { color: var(--muted); font-size: .95rem; font-weight: 500; }
.lessons { list-style: none; margin-top: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.lesson + .lesson { border-top: 1px solid var(--line); }
.lesson a, .lesson-row { display: grid; grid-template-columns: 44px 1fr auto 100px; gap: 16px; align-items: center; padding: 14px 20px; color: var(--text); text-decoration: none; }
.lesson a:hover { background: var(--sunken); }
.lesson a:hover .lesson-title { color: var(--ink); text-decoration: underline; text-underline-offset: .18em; }
.lesson-n { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line); font-weight: 600; font-size: .9rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.lesson-done .lesson-n { border-color: var(--accent); background: var(--accent); color: var(--night); }
.lesson-open .lesson-n { border-color: var(--accent); color: var(--ink); }
.lesson-title { color: var(--ink); font-weight: 500; }
.lesson-soon .lesson-title { color: var(--muted); font-weight: 400; }
.lesson-meta { color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; }
.lesson-state { justify-self: end; font-size: .88rem; font-weight: 500; }
.lesson-done .lesson-state { color: var(--tag-green); }
.lesson-open .lesson-state { color: var(--link); }
.lesson-soon .lesson-state { color: var(--muted); }

.lesson-kicker { color: var(--tag-green); font-weight: 600; font-size: .95rem; margin-bottom: 6px; }
.player { aspect-ratio: 16 / 9; border-radius: 18px; overflow: hidden; background: #000; }
.player iframe { display: block; width: 100%; height: 100%; border: 0; }
.player-stub { height: 100%; display: grid; place-content: center; justify-items: center; gap: 14px; background: var(--night); color: var(--night-text); }
.player-play { width: 76px; height: 76px; border-radius: 50%; background: var(--night-3); position: relative; }
.player-play::after { border-left-color: var(--night-text); border-left-width: 22px; border-top-width: 14px; border-bottom-width: 14px; }
.lesson-body { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; }
.materials { list-style: none; display: grid; gap: 8px; margin-top: 10px; }
.lesson-actions { display: grid; gap: 20px; }
.lesson-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.lesson-nav a, .lesson-nav span { display: block; padding: 16px 20px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none; font-weight: 500; line-height: 1.35; }
.lesson-nav a:hover { border-color: var(--ink); }
.lesson-nav small { display: block; color: var(--muted); font-size: .85rem; font-weight: 400; }
.lesson-nav-next { grid-column: 2; text-align: right; }
.lesson-nav .is-soon { color: var(--muted); border-style: dashed; }

/* плагин курса и оплата */
.plugin-card { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.token-box { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.token-box .btn { margin-top: 0; }
.token { flex: 1 1 18em; padding: 12px 14px; border-radius: 10px; background: var(--sunken); color: var(--ink); font: 500 .92rem Consolas, "Cascadia Mono", monospace; overflow-wrap: anywhere; }
.install-steps { margin-top: 18px; padding-left: 1.3em; display: grid; gap: 12px; }
.install-steps li::marker { color: var(--btn); font-weight: 600; }
.install-steps > li { min-width: 0; }
.install-steps pre { margin: 0; padding: 12px 14px; border-radius: 10px; background: var(--night); color: var(--night-text); white-space: pre-wrap; overflow-wrap: anywhere; flex: 1 1 auto; min-width: 0; }
.cmd { display: flex; gap: 8px; align-items: stretch; margin: 8px 0; }
.cmd .btn { margin-top: 0; flex: none; align-self: center; }
.plugin-card h3 { margin-top: 22px; }
.plugin-cred { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; align-items: center; margin: 14px 0 0; }
.plugin-cred dt { color: var(--muted); }
.plugin-cred dd { margin: 0; }
.plugin-cred dd > code { font: 500 .95rem Consolas, "Cascadia Mono", monospace; color: var(--ink); }
.install-steps .card-note code { font-size: .85rem; }
.install-steps code { font: .9rem Consolas, "Cascadia Mono", monospace; }
.pay-done p + p { margin-top: 10px; }
.pay-done .btn { margin-right: 8px; }

/* ---------- подвал ---------- */

.site-footer { background: var(--night); color: var(--night-text); padding: 56px 0; font-size: .95rem; border-top: 1px solid var(--night-line); }
.site-footer a { color: var(--night-ink); }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 40px; }
.footer-grid p + p { margin-top: 6px; }
.footer-brand { color: var(--night-ink); font-weight: 600; font-size: 1.1rem; }
.footer-legal { color: #8a9895; }

/* ---------- узкие экраны ---------- */

/* до 1080 разделы — второй строкой шапки (пять пунктов в одну строку с логотипом
   не помещаются), листаются вбок, если не влезут */
@media (max-width: 1080px) {
  .header-row { gap: 12px; flex-wrap: wrap; min-height: 0; padding-top: 10px; }
  .site-nav { order: 5; width: 100%; margin: 0; gap: 22px; overflow-x: auto; scrollbar-width: none; font-size: .95rem; }
  .site-nav a { padding: 8px 0 10px; }
  /* меню не влезло — правый край затухает: видно, что пункты листаются (класс ставит site.js) */
  .site-nav.is-scrollable { -webkit-mask-image: linear-gradient(90deg, #000 78%, transparent); mask-image: linear-gradient(90deg, #000 78%, transparent); padding-right: 32px; }
  .site-nav.is-scrollable.at-end { -webkit-mask-image: none; mask-image: none; }
  .theme-toggle { margin-left: auto; }
  html { scroll-padding-top: 110px; }
}

@media (max-width: 960px) {
  .hero-grid, .grows-inner, .about-grid, .faq-wrap, .two-col, .contacts-grid { grid-template-columns: 1fr; }
  .chat { justify-self: start; }
  /* колонки сложились в одну: сдвиг параллакса налезал бы на соседний текст */
  .portrait, .chat { transform: none !important; }
  .tariffs { gap: 14px; }
  .tariff { padding: 26px 18px; }
  .tariff-price { font-size: 1.9rem; }
  .tariff-foot .btn { padding: 0 10px; font-size: .92rem; }
  .audience-grid, .buy-steps { gap: 28px; }
  .about-grid { gap: 56px; }
  .about-grid .portrait { order: 0; }
  .portrait { max-width: 360px; }
  .grows-wave { height: 140px; order: 2; }
  .project-list li { grid-template-columns: 1fr; gap: 6px; }
  .review-list { grid-template-columns: repeat(2, 1fr); }
  .article-layout { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .auth { grid-template-columns: 1fr; gap: 0; }
  .auth-side { display: none; }
  .cabinet-grid { grid-template-columns: 1fr; gap: 28px; }
  .cabinet-nav { position: static; grid-template-columns: 1fr auto; align-items: center; }
  .cabinet-nav nav { grid-column: 1 / -1; grid-row: 2; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
  .cabinet-nav nav a { flex: none; }
  .cabinet-help { display: none; }
  .cabinet-logout { justify-self: end; }
  .course-panel { grid-template-columns: 1fr; }
  .course-panel-art { height: 110px; }
  .side-inner { position: static; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
  .side-toc { display: none; }
  .facts-inline { display: block; margin-bottom: 32px; }
  .facts-side { display: none; }
  /* карточка курса из колонки уже стоит под текстом — нижний призыв дублировал бы её */
  .article-cta { display: none; }
  .article-layout { padding-bottom: 72px; }
  .article-row.has-cover { gap: 24px; }
  .footer-grid { grid-template-columns: 1fr; }
  .course-row { grid-template-columns: 1fr; }
  .faq-wrap { gap: 32px; }

  .pipeline { grid-template-columns: 1fr; gap: 36px; padding-left: 48px; }
  .pipeline::before, .pipeline::after { top: 12px; bottom: 12px; left: 11px; right: auto; width: 2px; height: auto; }
  .pipeline::after { transform-origin: top; transform: scaleY(var(--p)); }
  .step-dot { position: absolute; left: -48px; top: 0; }
  .step-art { margin-top: 0; width: 72px; height: 52px; }
}

@media (max-width: 760px) {
  body { font-size: 17px; }
  .wrap { padding: 0 16px; }
  .portrait::before { inset: 18px -10px -10px 18px; }
  .brand { font-size: 1rem; }
  .msg-out.msg-voice { width: 100%; }
  /* отзывы на телефоне листаются вбок, по одной карточке */
  .review-list { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 64%; overflow-x: auto; scroll-snap-type: x mandatory; margin-inline: -16px; padding: 0 16px 8px; scrollbar-width: none; }
  .review { scroll-snap-align: start; }
  .article-row.has-cover { grid-template-columns: 1fr; gap: 16px; }
  .audience-grid, .buy-steps { grid-template-columns: 1fr; gap: 32px; }
  .tariffs { grid-template-columns: 1fr; }
  .cabinet-cards, .form-pair { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .auth { padding: 36px 16px 56px; }
  .auth-main { align-items: flex-start; }
  .orders th:nth-child(1), .orders td:nth-child(1), .orders th:nth-child(5), .orders td:nth-child(5) { display: none; }
  .orders th, .orders td { padding: 12px 8px; }
  .cabinet-nav nav a { padding: 8px 12px; gap: 8px; }
  .course-panel { padding: 22px; }
  .course-progress { grid-template-columns: 1fr; }
  .course-next { max-width: none; }
  .lesson a, .lesson-row { grid-template-columns: 36px 1fr auto; gap: 12px; padding: 12px 14px; }
  .lesson-meta { display: none; }
  .lesson-body, .lesson-nav { grid-template-columns: 1fr; }
  .lesson-nav-next { grid-column: auto; text-align: left; }
  .cmd { flex-direction: column; }
  .cmd .btn { align-self: flex-start; }
  .plugin-cred { grid-template-columns: 1fr; gap: 4px; }
  .tariff { padding: 32px 24px; }
  .tariff-price { font-size: 2.4rem; }
  .crowd { margin-top: 48px; gap: 10px; }
  .crowd-track { gap: 10px; padding-right: 10px; }
  .crowd li { padding: 8px 16px; font-size: .88rem; }
  .chart { padding: 20px 16px; }
  .bars { gap: 8px; height: 200px; }
  .bar-label { font-size: .78rem; }
}

/* телефон боком (высота до 500): закреплённая шапка съела бы четверть экрана —
   она уходит с прокруткой, отступы сверху меньше */
@media (max-height: 500px) and (orientation: landscape) {
  .site-header { position: static; }
  html { scroll-padding-top: 16px; }
  .hero { padding: 40px 0 56px; }
  .page-head { padding-top: 32px; }
  .course-hero { padding: 32px 0 56px; }
  .side-inner { top: 16px; }
}

/* до 389: логотип, тема и «Войти» должны встать в одну строку */
@media (max-width: 389px) {
  .brand-first { display: none; }
  .theme-toggle { width: 36px; height: 36px; }
  .btn-small { padding: 0 14px; }
}

/* самые узкие телефоны (320–359): крупные заголовки и длинные слова не помещаются */
@media (max-width: 359px) {
  .hero h1 { font-size: 2.6rem; }
  .page-head h1, .course-hero h1 { font-size: 2.05rem; }
  h2 { font-size: 1.75rem; }
  .statement { font-size: 1.6rem; }
  .tariff { padding: 26px 20px; }
  .tariff-price { font-size: 2rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  /* без движения ленты превращаются в облако плашек */
  .crowd { -webkit-mask-image: none; mask-image: none; max-width: var(--wrap); margin-inline: auto; padding: 0 24px; }
  .crowd-row, .crowd-track { flex-wrap: wrap; overflow: visible; }
  .crowd-track[aria-hidden] { display: none; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .chat .msg, .js .chart .bar-fill, .js .chart .bar-value { opacity: 1; transform: none; }
}
