/* Дизайн-система лендингов курса.
 *
 * Раньше эти правила лежали inline в каждом из 49 файлов public/course/*.html —
 * 286 КБ копипаста, 11 разных версий по md5 и разъехавшийся в четырёх файлах
 * бренд-цвет. Теперь один файл на все лендинги; шаблон — lib/landing.js.
 *
 * Бренд-цвет ровно один: --brand: #047857.
 *
 * CSS главной (server.js), кабинета (api/account.js) и плеера (api/learn.js)
 * сюда НЕ сливался намеренно: он совпадает с лендинговым лишь наполовину, и
 * слияние дало бы риск визуальной регрессии на рабочих поверхностях ради
 * выигрыша, не относящегося к упаковке. Это отдельная задача.
 */

:root {
  --brand: #047857;
  --brand-d: #035C43;
  --ink: #1A1A2E;
  --ink-2: #3a3a52;
  --muted: #7c7c8c;
  --line: #e7e4ee;
  --tint: #ECFDF5;
  --bg: #ffffff;
  --radius: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0 }
html { scroll-behavior: smooth }
body {
  font-family: 'Inter', -apple-system, Segoe UI, Arial, sans-serif;
  color: var(--ink-2); background: var(--bg); line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.18; letter-spacing: -0.01em }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px }
.accent { color: var(--brand) }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* --- Шапка, бургер, выдвижное меню ---------------------------------------- */
header {
  border-bottom: 1px solid var(--line); position: sticky; top: 0;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(6px); z-index: 20;
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 56px }
.brand { display: flex; align-items: center }
.brand .logo { display: block; height: 18px; width: auto }
.nav .btn-sm {
  display: inline-block; background: var(--brand); color: #fff; font-weight: 600;
  font-size: 14px; padding: 9px 18px; border-radius: var(--radius);
}
.nav .btn-sm:hover { background: var(--brand-d) }
.site-menu { display: flex; align-items: center; gap: 20px }
.site-menu a { font-size: 14px; font-weight: 600; color: var(--brand) }
.site-burger {
  display: none; width: 42px; height: 42px; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; cursor: pointer; padding: 0;
  flex-direction: column; align-items: center; justify-content: center; gap: 4px; flex-shrink: 0;
}
.site-burger span { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--ink); transition: transform .2s, opacity .2s }
.site-burger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg) }
.site-burger.open span:nth-child(2) { opacity: 0 }
.site-burger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg) }
.site-scrim { position: fixed; inset: 0; background: rgba(20, 18, 30, .44); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 998 }
.site-scrim.show { opacity: 1; pointer-events: auto }
.site-drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: min(82vw, 300px); background: #fff;
  box-shadow: -10px 0 34px rgba(0, 0, 0, .16); transform: translateX(100%);
  transition: transform .22s ease; z-index: 999; display: flex; flex-direction: column;
  padding: 16px 16px 24px; gap: 2px; overflow-y: auto;
}
.site-drawer.show { transform: none }
.site-drawer .sd-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px }
.site-drawer .sd-title { display: flex; align-items: center }
.site-drawer .sd-title .logo { display: block; height: 18px; width: auto }
.site-drawer .sd-close { width: 40px; height: 40px; border: none; background: none; font-size: 26px; line-height: 1; color: var(--muted); cursor: pointer; border-radius: 8px }
.site-drawer .sd-close:hover { background: var(--tint) }
.site-drawer a { display: block; padding: 13px 12px; border-radius: 8px; font-size: 16px; font-weight: 600; color: var(--ink) }
.site-drawer a:hover { background: var(--tint) }
.site-drawer a.sd-primary { background: var(--brand); color: #fff; text-align: center; margin-top: 8px }
.site-drawer a.sd-primary:hover { background: var(--brand-d) }
@media (max-width: 768px) { .site-menu { display: none !important } .site-burger { display: flex } }

/* --- Hero ------------------------------------------------------------------ */
.hero { padding: 72px 0 64px }
.pill {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600;
  color: var(--brand); background: var(--tint); padding: 7px 14px; border-radius: 100px; margin-bottom: 24px;
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand) }
.hero h1 { font-size: 52px; font-weight: 800; max-width: 800px; margin-bottom: 22px }
.hero p.lead { font-size: 20px; max-width: 660px; margin-bottom: 34px; color: var(--ink-2) }
.cta-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap }
.btn {
  display: inline-block; background: var(--brand); color: #fff; font-weight: 700;
  font-size: 17px; padding: 16px 32px; border-radius: var(--radius); transition: background .15s;
}
.btn:hover { background: var(--brand-d) }
.btn-ghost { color: var(--brand); font-weight: 600; font-size: 15px }
.btn-ghost:hover { text-decoration: underline }

/* --- Секции ---------------------------------------------------------------- */
section { padding: 74px 0 }
.band { background: #fafafa; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line) }
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); margin-bottom: 14px }
.h2 { font-size: 36px; font-weight: 800; max-width: 720px; margin-bottom: 16px }
.sub { font-size: 18px; color: var(--ink-2); max-width: 680px; margin-bottom: 46px }
.sub:last-child { margin-bottom: 0 }

/* --- «Для кого» ------------------------------------------------------------ */
.audience { font-size: 22px; line-height: 1.45; color: var(--ink); max-width: 760px; font-weight: 600 }
.lvl { display: inline-block; margin-top: 22px; font-size: 13px; font-weight: 600; color: var(--brand); background: var(--tint); padding: 6px 14px; border-radius: 100px }

/* --- «Что получишь» -------------------------------------------------------- */
.out-list { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 28px }
.out-list li { position: relative; padding-left: 34px; font-size: 16.5px; color: var(--ink-2) }
.out-list li::before {
  content: ''; position: absolute; left: 0; top: 4px; width: 20px; height: 20px;
  border-radius: 50%; background: var(--tint);
  /* галочка нарисована фоном, чтобы не тащить иконочный шрифт */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 10.4l3 3 6-6.5' fill='none' stroke='%23047857' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center;
}
.summary { margin-top: 34px; padding: 22px 24px; border-left: 3px solid var(--brand); background: var(--tint); border-radius: 0 var(--radius) var(--radius) 0; font-size: 16px; color: var(--ink-2); max-width: 820px }

/* --- Программа ------------------------------------------------------------- */
.lessons-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px }
.lcard { border: 1px solid var(--line); border-radius: 12px; padding: 24px; display: flex; gap: 16px; align-items: flex-start; background: #fff }
.lcard .ln { width: 36px; height: 36px; border-radius: 9px; background: var(--brand); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 14px }
.lcard h4 { font-size: 16.5px; margin-bottom: 4px }

/* --- Как устроено обучение ------------------------------------------------- */
/* auto-fit, а не repeat(3): блоков в секции может быть два или три,
   и при фиксированных трёх колонках пара карточек оставляла дыру справа. */
.ai-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px }
.ai-card { padding: 28px; border-radius: var(--radius); background: var(--tint) }
.ai-card h3 { font-size: 18px; margin-bottom: 8px }
.ai-card p { font-size: 15px; color: var(--ink-2) }

/* --- FAQ ------------------------------------------------------------------- */
.faq { max-width: 820px }
.faq details { border-bottom: 1px solid var(--line) }
.faq details:first-child { border-top: 1px solid var(--line) }
.faq summary { list-style: none; cursor: pointer; padding: 20px 44px 20px 0; font-size: 17px; font-weight: 600; color: var(--ink); position: relative }
.faq summary::-webkit-details-marker { display: none }
.faq summary::after { content: '+'; position: absolute; right: 8px; top: 15px; font-size: 24px; font-weight: 400; color: var(--brand); line-height: 1 }
.faq details[open] summary::after { content: '\2212' }
.faq summary:hover { color: var(--brand) }
.faq .a { padding: 0 44px 22px 0; font-size: 16px; color: var(--ink-2) }

/* --- Финальный CTA --------------------------------------------------------- */
.final { background: var(--ink); color: #fff; padding: 68px 0 }
.final h2 { color: #fff; font-size: 32px; font-weight: 800; margin-bottom: 14px; max-width: 720px }
.final p { color: #cfcbdd; font-size: 17px; max-width: 620px; margin-bottom: 30px }
.final .btn { background: var(--brand) }
.final .btn:hover { background: var(--brand-d) }
.final .note { font-size: 14px; color: #9a94b0; margin-top: 18px; margin-bottom: 0 }

/* Подзаголовок части внутри сетки тем. grid-column на всю строку — иначе
   заголовок встал бы одной из трёх колонок и разорвал порядок тем. */
.lessons-grid .part { grid-column: 1 / -1; font-size: 15px; font-weight: 700; color: var(--brand); letter-spacing: .01em; margin-top: 10px }
.lessons-grid .part:first-child { margin-top: 0 }

/* --- Факты о лекции: темы и дата обновления --------------------------------- */
/* Тихая строка под программой. Обе величины до этого существовали только в
   данных — в разметке им без видимого текста делать нечего. */
.facts { padding: 26px 0 0 }
.fact { font-size: 14px; color: var(--muted) }
.fact + .fact { margin-top: 6px }
.fact b { color: var(--ink-2); font-weight: 600 }

/* --- Похожие курсы --------------------------------------------------------- */
.rel-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px }
.rel-card { border: 1px solid var(--line); border-radius: 12px; padding: 22px; display: flex; flex-direction: column }
.rel-card h3 { font-size: 17px; font-weight: 700; margin-bottom: 8px }
.rel-card p { font-size: 14px; color: var(--ink-2); margin-bottom: 16px }
.rel-card .rel-meta { font-size: 12.5px; color: var(--muted); margin-top: auto; padding-top: 4px }

/* --- Футер ----------------------------------------------------------------- */
footer { border-top: 1px solid var(--line); padding: 26px 0 }
footer .fl { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted) }
footer a:hover { color: var(--brand) }

/* --- Урезанная страница внутреннего курса ---------------------------------- */
.gate { padding: 96px 0 }
.gate h1 { font-size: 36px; font-weight: 800; max-width: 720px; margin-bottom: 18px }
.gate .note { font-size: 16px; color: var(--muted); max-width: 560px; margin-top: 20px }

@media (max-width: 880px) {
  .hero { padding: 48px 0 44px }
  .hero h1 { font-size: 34px }
  .hero p.lead { font-size: 17.5px }
  .h2 { font-size: 27px }
  .sub { font-size: 16.5px; margin-bottom: 32px }
  .audience { font-size: 19px }
  section { padding: 52px 0 }
  .ai-grid, .lessons-grid, .rel-grid, .out-list { grid-template-columns: 1fr }
  .final h2 { font-size: 26px }
  .gate { padding: 56px 0 }
  .gate h1 { font-size: 27px }
}
