/* Яндекс Трекер: с нуля до профи — общий стиль курса */
:root {
  --bg: #f7f8fa;
  --card: #ffffff;
  --ink: #21252b;
  --muted: #6b7280;
  --accent: #4436d9;        /* фиолетовый акцент курса */
  --accent-soft: #ece9ff;
  --ok: #0f9d58;
  --ok-soft: #e6f4ea;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --danger: #b3261e;
  --danger-soft: #fdecea;
  --trek: #0b6bcb;          /* врезки про реальный TREK */
  --trek-soft: #e7f1fb;
  --cat: #c2410c;           /* кейс Котолавки */
  --cat-soft: #fff1e7;
  --border: #e5e7eb;
  --code-bg: #f3f4f6;
  --radius: 14px;
  --maxw: 880px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a; --card: #1d2025; --ink: #e8eaed; --muted: #9aa0a6;
    --accent: #8f83ff; --accent-soft: #2b2750;
    --ok: #52c17d; --ok-soft: #1d3227;
    --warn: #e0a83a; --warn-soft: #3a2f16;
    --danger: #ef7b74; --danger-soft: #3c2220;
    --trek: #6db3f2; --trek-soft: #16283a;
    --cat: #f2955c; --cat-soft: #382318;
    --border: #33373d; --code-bg: #24272d;
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.65 -apple-system, "Segoe UI", Roboto, "YS Text", Arial, sans-serif;
}
a { color: var(--accent); }
h1 { font-size: 1.9rem; line-height: 1.25; margin: .2em 0 .4em; }
h2 { font-size: 1.35rem; margin: 2.2em 0 .5em; padding-top: .4em; }
h3 { font-size: 1.08rem; margin: 1.6em 0 .4em; }
code, pre { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .88em; }
code { background: var(--code-bg); padding: .12em .38em; border-radius: 6px; }
pre { background: var(--code-bg); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; overflow-x: auto; }
pre code { background: none; padding: 0; }
img, svg { max-width: 100%; height: auto; }
table { border-collapse: collapse; width: 100%; margin: 1em 0; }
th, td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; vertical-align: top; }
th { background: var(--code-bg); }
.table-wrap { overflow-x: auto; }

/* ── Каркас страницы ── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--card); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px; padding: 10px 18px;
}
.topbar .logo { font-weight: 700; text-decoration: none; color: var(--ink); white-space: nowrap; }
.topbar .logo span { color: var(--accent); }
.topbar .crumbs { color: var(--muted); font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 28px 18px 80px; }

.module-head { margin-bottom: 1.4em; }
.module-head .kicker { color: var(--accent); font-weight: 600; font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; }
.lead { font-size: 1.08rem; color: var(--muted); }

/* ── Карточки и блоки ── */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; margin: 1.2em 0; }

.goals { border-left: 4px solid var(--accent); }
.goals h3 { margin-top: 0; }
.goals ul { margin: .4em 0 0; padding-left: 1.2em; }

/* Пошаговая инструкция */
.steps { counter-reset: step; padding-left: 0; margin: 1em 0; list-style: none; }
.steps > li {
  counter-increment: step; position: relative;
  padding: 0 0 1.4em 52px; margin: 0;
}
.steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.steps > li:not(:last-child)::after {
  content: ""; position: absolute; left: 16px; top: 40px; bottom: 4px;
  width: 2px; background: var(--border);
}
.steps .do { font-weight: 600; }
.steps .note { color: var(--muted); font-size: .93rem; margin-top: .2em; }

/* Элементы UI в тексте: «нажми [Создать задачу]» */
.ui {
  display: inline-block; background: var(--accent-soft); color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: 8px; padding: .05em .5em; font-weight: 600; font-size: .92em;
  white-space: nowrap;
}
kbd {
  background: var(--code-bg); border: 1px solid var(--border); border-bottom-width: 2px;
  border-radius: 6px; padding: .08em .45em; font-size: .85em;
}

/* Мокапы экранов */
figure.shot { margin: 1.2em 0; }
figure.shot svg { display: block; border: 1px solid var(--border); border-radius: 12px; width: 100%; height: auto; }
figure.shot figcaption { color: var(--muted); font-size: .88rem; margin-top: .5em; text-align: center; }

/* Кейс Котолавки */
.case { border-left: 4px solid var(--cat); }
.case > h3:first-child { margin-top: 0; }
.case .case-tag { display: inline-block; background: var(--cat-soft); color: var(--cat); border-radius: 8px; padding: .1em .6em; font-weight: 700; font-size: .82rem; margin-bottom: .5em; }
.case dl { margin: .8em 0 0; }
.case dt { font-weight: 700; color: var(--cat); margin-top: .9em; }
.case dt::before { margin-right: .4em; }
.case dt.do::before { content: "🛠"; }
.case dt.see::before { content: "👀"; }
.case dt.check::before { content: "🎛"; }
.case dt.get::before { content: "🏆"; }
.case dd { margin: .25em 0 0 1.6em; }

/* Врезка «Как это у нас в TREK» */
.trek { border-left: 4px solid var(--trek); background: var(--trek-soft); }
.trek > h3:first-child { margin-top: 0; color: var(--trek); }
.trek .task { font-weight: 600; white-space: nowrap; }

/* Предупреждения и советы */
.tip { border-left: 4px solid var(--ok); background: var(--ok-soft); }
.warn { border-left: 4px solid var(--warn); background: var(--warn-soft); }
.tip > :first-child, .warn > :first-child { margin-top: 0; }
.tip > :last-child, .warn > :last-child { margin-bottom: 0; }

/* Чек-лист результата */
.checklist ul { list-style: none; padding-left: 0; margin: .4em 0 0; }
.checklist li { padding-left: 1.7em; position: relative; margin: .35em 0; }
.checklist li::before { content: "✅"; position: absolute; left: 0; }

/* ── Тест ── */
.quiz { border-left: 4px solid var(--accent); }
.quiz h3 { margin-top: 0; }
.quiz .q { margin: 1.3em 0; padding-bottom: 1.1em; border-bottom: 1px dashed var(--border); }
.quiz .q:last-of-type { border-bottom: none; }
.quiz .q p.question { font-weight: 600; margin: 0 0 .5em; }
.quiz label {
  display: block; padding: 9px 12px; margin: 6px 0; border: 1px solid var(--border);
  border-radius: 10px; cursor: pointer; transition: border-color .15s, background .15s;
}
.quiz label:hover { border-color: var(--accent); }
.quiz input[type="radio"] { margin-right: 8px; accent-color: var(--accent); }
.quiz .q.correct label.chosen { border-color: var(--ok); background: var(--ok-soft); }
.quiz .q.wrong label.chosen { border-color: var(--danger); background: var(--danger-soft); }
.quiz .hint {
  display: none; margin-top: .6em; padding: 10px 14px; border-radius: 10px;
  background: var(--warn-soft); border-left: 3px solid var(--warn); font-size: .95rem;
}
.quiz .q.wrong .hint { display: block; }
.quiz .praise { display: none; margin-top: .5em; color: var(--ok); font-weight: 600; }
.quiz .q.correct .praise { display: inline-block; }
.quiz .actions { margin-top: 1.2em; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.btn {
  background: var(--accent); color: #fff; border: none; border-radius: 10px;
  padding: 10px 20px; font-size: 1rem; font-weight: 600; cursor: pointer;
}
.btn.secondary { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.quiz .result { font-weight: 700; }
.quiz .result.pass { color: var(--ok); }
.quiz .result.fail { color: var(--warn); }

/* ── Навигация низа ── */
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 3em; }
.pager a {
  flex: 1; text-decoration: none; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; background: var(--card); color: var(--ink);
}
.pager a:hover { border-color: var(--accent); }
.pager .dir { color: var(--muted); font-size: .82rem; }
.pager .next { text-align: right; }

/* ── Оглавление (index) ── */
.hero { text-align: left; padding: 30px 0 6px; }
.hero h1 { font-size: 2.3rem; }
.modules { list-style: none; padding: 0; margin: 1.5em 0; display: grid; gap: 12px; }
.modules a {
  display: flex; gap: 16px; align-items: flex-start; text-decoration: none; color: var(--ink);
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px;
}
.modules a:hover { border-color: var(--accent); }
.modules .num {
  flex: 0 0 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); color: var(--accent);
  font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: 1.05rem;
}
.modules .t { font-weight: 700; }
.modules .d { color: var(--muted); font-size: .92rem; margin-top: 2px; }
.modules .done-mark { margin-left: auto; align-self: center; font-size: 1.2rem; visibility: hidden; }
.modules li.done .done-mark { visibility: visible; }
.modules li.done .num { background: var(--ok-soft); color: var(--ok); }

.progressbar { height: 10px; border-radius: 6px; background: var(--border); overflow: hidden; margin: .6em 0 2em; }
.progressbar > div { height: 100%; background: var(--ok); width: 0; transition: width .4s; }

@media (max-width: 620px) {
  h1 { font-size: 1.5rem; }
  .hero h1 { font-size: 1.7rem; }
  .wrap { padding: 20px 14px 60px; }
  .steps > li { padding-left: 44px; }
}
