/* =============================================================
   Курс: Моделирование АС, анализ уязвимостей и эффективности СЗИ
   ============================================================= */

/* ---------- 1. Токены ---------- */
:root {
  --bg:          #f4f6fb;
  --surface:     #ffffff;
  --surface-2:   #edf1f8;
  --text:        #0b1220;
  --muted:       #5b6b83;
  --accent:      #1d4ed8;
  --accent-soft: #dbe6ff;
  --accent-2:    #7c3aed;
  --border:      #dde4ee;
  --ok:          #16a34a;
  --ok-soft:     #dcfce7;
  --warn:        #d97706;
  --warn-soft:   #fef3c7;
  --err:         #dc2626;
  --err-soft:    #fee2e2;

  /* Уровни CVSS */
  --sev-none:     #6b7280;
  --sev-low:      #eab308;
  --sev-medium:   #f97316;
  --sev-high:     #dc2626;
  --sev-critical: #7f1d1d;

  --radius:      14px;
  --radius-sm:   9px;
  --shadow:      0 12px 28px -18px rgba(11, 18, 32, .5);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --t: .22s ease;
}

[data-theme="dark"] {
  --bg:          #080e1a;
  --surface:     #0f1729;
  --surface-2:   #16203a;
  --text:        #e6eefc;
  --muted:       #8ea0bd;
  --accent:      #60a5fa;
  --accent-soft: #17243d;
  --accent-2:    #a78bfa;
  --border:      #1f2c46;
  --ok-soft:     #0f2e1e;
  --warn-soft:   #382708;
  --err-soft:    #3a1414;
  --shadow:      0 12px 28px -18px rgba(0, 0, 0, .95);
}

/* ---------- 2. База ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  transition: background var(--t), color var(--t);
}

h1, h2, h3, h4 { margin: 0 0 .55em; line-height: 1.25; font-weight: 700; letter-spacing: -.02em; }
h1 { font-size: clamp(1.7rem, 1.1rem + 2.4vw, 2.4rem); }
h2 { font-size: clamp(1.25rem, 1.1rem + .9vw, 1.6rem); }
h3 { font-size: 1.08rem; }
p  { margin: 0 0 1em; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code, kbd {
  font-family: var(--mono);
  font-size: .88em;
  background: var(--surface-2);
  padding: .12em .42em;
  border-radius: 5px;
}
kbd { border: 1px solid var(--border); padding: .1em .4em; }

img, svg, iframe { max-width: 100%; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.container { width: min(1180px, 100%); margin-inline: auto; padding: 0 20px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 2000;
  background: var(--accent); color: #fff; padding: .7rem 1.1rem; border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

/* ---------- 3. Навигация ---------- */
.navbar {
  position: sticky; top: 0; z-index: 900;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 64px;
}
.logo {
  display: flex; align-items: center; gap: .6rem;
  font-weight: 800; font-size: 1.02rem; color: var(--text); letter-spacing: -.03em;
}
.logo:hover { text-decoration: none; }
.logo-mark {
  display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-size: .72rem; font-weight: 800; letter-spacing: -.02em;
}
.logo-text span { color: var(--accent); }

.nav-links { display: flex; align-items: center; gap: 1.4rem; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  color: var(--muted); font-size: .92rem; font-weight: 500;
  padding: .35rem 0; border-bottom: 2px solid transparent; transition: var(--t);
}
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-links a.is-active { color: var(--accent); border-bottom-color: var(--accent); }

.nav-actions { display: flex; align-items: center; gap: .5rem; }
.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text);
  font-size: 1rem; cursor: pointer; transition: var(--t);
}
.icon-btn:hover { border-color: var(--accent); }

.nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 4px;
  width: 38px; height: 38px; padding: 0 9px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); cursor: pointer;
}
.nav-toggle span { display: block; height: 2px; background: var(--text); border-radius: 2px; transition: var(--t); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- 4. Hero ---------- */
.hero {
  background:
    radial-gradient(900px 400px at 12% -10%, rgba(96, 165, 250, .35), transparent 60%),
    radial-gradient(700px 350px at 95% 10%, rgba(167, 139, 250, .28), transparent 60%),
    linear-gradient(135deg, #1e3a8a 0%, #0b1220 100%);
  color: #fff;
  padding: clamp(3rem, 8vw, 5.5rem) 0;
}
.hero h1 { color: #fff; max-width: 22ch; }
.hero .lead { font-size: 1.08rem; color: #c7d2e5; max-width: 68ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.5rem; }
.hero-stats {
  display: flex; flex-wrap: wrap; gap: 1.5rem; margin-top: 2rem;
  padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,.15);
}
.hero-stat { color: #fff; }
.hero-stat strong { display: block; font-size: 1.7rem; line-height: 1; font-weight: 800; }
.hero-stat span { font-size: .82rem; color: #b1c0d9; text-transform: uppercase; letter-spacing: .08em; }

/* ---------- 5. Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .7rem 1.3rem; border: 1px solid transparent; border-radius: var(--radius-sm);
  background: var(--accent); color: #fff;
  font: inherit; font-weight: 600; font-size: .93rem;
  cursor: pointer; transition: var(--t); text-decoration: none;
}
.btn:hover { background: color-mix(in srgb, var(--accent) 85%, #000); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--accent); }
.hero .btn-ghost { color: #fff; border-color: rgba(255,255,255,.35); }
.hero .btn-ghost:hover { background: rgba(255,255,255,.12); }
.btn-sm { padding: .42rem .8rem; font-size: .83rem; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- 6. Секции ---------- */
.section { padding: clamp(2rem, 4.5vw, 3.4rem) 0; }
.section-head { max-width: 72ch; margin-bottom: 1.6rem; }
.section-head p { color: var(--muted); margin: 0; }

.page-head {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 2rem 0 1.8rem;
}
.breadcrumb { font-size: .85rem; color: var(--muted); margin-bottom: .5rem; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent); }
.page-head .lead { color: var(--muted); max-width: 74ch; margin: 0; }

.badges { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1rem; }
.badge {
  display: inline-block; font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  padding: .26rem .58rem; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
}
.badge.ok   { background: var(--ok-soft);   color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.err  { background: var(--err-soft);  color: var(--err); }

/* ---------- 7. Табы модулей ---------- */
.tabs {
  display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.6rem;
  border-bottom: 1px solid var(--border); padding-bottom: .6rem;
}
.tab-btn {
  border: 1px solid transparent; background: transparent; color: var(--muted);
  font: inherit; font-size: .9rem; font-weight: 600;
  padding: .5rem .9rem; border-radius: var(--radius-sm);
  cursor: pointer; transition: var(--t);
}
.tab-btn:hover { color: var(--text); background: var(--surface-2); }
.tab-btn.is-active { color: var(--accent); background: var(--accent-soft); }
.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

/* ---------- 8. Карточки лекций / практикумов / курсовых ---------- */
.lecture-list { display: grid; gap: .7rem; }

.lecture-item {
  display: grid; grid-template-columns: 56px 1fr auto; align-items: start; gap: 1rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .95rem 1.1rem;
  transition: var(--t);
}
.lecture-item:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); box-shadow: var(--shadow); }
.lecture-num {
  display: grid; place-items: center;
  width: 46px; height: 46px; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent);
  font-weight: 800; font-size: .95rem;
}
.lecture-item h3 { margin: 0 0 .2rem; font-size: 1rem; }
.lecture-item .topic-list { margin: .3rem 0 0; padding-left: 1.1rem; color: var(--muted); font-size: .87rem; }
.lecture-item .topic-list li { margin-bottom: .15rem; }
.lecture-item .lecture-actions { display: flex; flex-direction: column; align-items: flex-end; gap: .4rem; }

/* Практикумы — с бейджами инструментов */
.practical-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.1rem 1.2rem;
  display: flex; flex-direction: column; gap: .6rem;
  transition: var(--t);
}
.practical-item:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.practical-head { display: flex; align-items: center; gap: .7rem; }
.practical-num {
  flex: none; width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-weight: 800; font-size: .85rem;
  display: grid; place-items: center;
}
.tool-badges { display: flex; flex-wrap: wrap; gap: .3rem; }
.tool-badge {
  font-family: var(--mono); font-size: .74rem;
  background: var(--surface-2); color: var(--muted);
  padding: .18rem .5rem; border-radius: 6px;
  border: 1px solid var(--border);
}

/* Курсовые */
.coursework-list { display: grid; gap: .6rem; }
.coursework-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: .85rem 1rem;
  display: grid; grid-template-columns: auto 1fr; gap: .9rem;
}
.coursework-item .cw-num {
  color: var(--accent); font-weight: 800; font-size: .95rem; min-width: 1.6rem;
}
.coursework-item h4 { margin: 0 0 .2rem; font-size: .96rem; font-weight: 700; }
.coursework-item p { margin: 0; color: var(--muted); font-size: .86rem; }

/* ---------- 9. Общие сетки и карточки ---------- */
.grid { display: grid; gap: 1.1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }

.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.3rem;
  transition: var(--t);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.card h3 { margin-bottom: .35rem; }
.card p { color: var(--muted); font-size: .92rem; margin-bottom: 1rem; }
.card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: .8rem;
  margin-top: auto; padding-top: .85rem; border-top: 1px solid var(--border);
}
.card-icon { font-size: 1.5rem; margin-bottom: .6rem; }

/* ---------- 10. Прогресс ---------- */
.progress-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1.2rem; margin-bottom: 1.5rem;
}
.progress-track { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: .6rem; }
.progress-fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 999px; transition: width .35s ease;
}
.progress-label { font-size: .85rem; color: var(--muted); margin: .55rem 0 0; }

/* ---------- 11. Интерактивные панели ---------- */
.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.3rem; margin-bottom: 1.3rem;
}
.panel > h2 { margin-top: 0; }

.demo-split { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.demo-pane {
  display: flex; flex-direction: column;
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  background: var(--surface);
}
.pane-head {
  display: flex; align-items: center; justify-content: space-between; gap: .6rem;
  padding: .5rem .85rem; font-size: .76rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

/* ---------- 12. Формы ---------- */
.field { margin-bottom: .9rem; }
.field label { display: block; font-size: .86rem; font-weight: 600; margin-bottom: .28rem; }
.field .hint { font-size: .76rem; color: var(--muted); }

input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="search"], input[type="url"], select, textarea {
  width: 100%; padding: .6rem .78rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  font: inherit; font-size: .93rem; outline: none; transition: var(--t);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.controls { display: grid; gap: .7rem; }
.control-row { display: grid; grid-template-columns: 180px 1fr; align-items: center; gap: .8rem; }
.control-row label { font-size: .84rem; font-weight: 600; color: var(--muted); margin: 0; }
.control-row output { font-family: var(--mono); font-size: .8rem; color: var(--accent); }

input[type="range"] { width: 100%; accent-color: var(--accent); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); width: 17px; height: 17px; }
.checkline { display: inline-flex; align-items: center; gap: .5rem; font-size: .88rem; }

/* ---------- 13. Код ---------- */
.code-block {
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; margin-bottom: 1.2rem; background: var(--surface);
}
.code-head {
  display: flex; align-items: center; justify-content: space-between; gap: .8rem;
  padding: .42rem .8rem .42rem 1rem;
  background: var(--surface-2); border-bottom: 1px solid var(--border);
  font-size: .74rem; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--muted);
}
.copy-btn {
  border: 1px solid var(--border); border-radius: 7px;
  background: var(--surface); color: var(--muted);
  font: inherit; font-size: .72rem; font-weight: 600;
  padding: .26rem .6rem; cursor: pointer; transition: var(--t);
}
.copy-btn:hover { color: var(--accent); border-color: var(--accent); }
.copy-btn.is-ok { color: var(--ok); border-color: var(--ok); }
.code-block pre {
  margin: 0; padding: 1rem; overflow-x: auto;
  font-family: var(--mono); font-size: .83rem; line-height: 1.65;
}
.code-block pre code { background: none; padding: 0; font-size: inherit; }

/* ---------- 14. Заметки и задачи ---------- */
.note {
  border-left: 4px solid var(--accent); background: var(--accent-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: .85rem 1.05rem; margin-bottom: 1.1rem; font-size: .92rem;
}
.note.warn { border-color: var(--warn); background: var(--warn-soft); }
.note.err  { border-color: var(--err);  background: var(--err-soft); }
.note.ok   { border-color: var(--ok);   background: var(--ok-soft); }
.note :last-child { margin-bottom: 0; }

.task {
  border: 1px dashed color-mix(in srgb, var(--accent) 45%, var(--border));
  border-radius: var(--radius); padding: 1.1rem 1.2rem; background: var(--surface);
}
.task h2, .task h3 { margin-top: 0; }
.task ol, .task ul { padding-left: 1.2rem; margin: 0; }
.task li { margin-bottom: .35rem; }

/* ---------- 15. Таблицы ---------- */
.table-wrap { overflow-x: auto; margin-bottom: 1.2rem; }
table { width: 100%; border-collapse: collapse; font-size: .89rem; }
th, td { padding: .55rem .75rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--surface-2); font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
tbody tr:hover { background: var(--surface-2); }

/* ---------- 16. Вывод / лог ---------- */
.output {
  margin: 0; padding: 1rem; max-height: 340px; overflow: auto;
  font-family: var(--mono); font-size: .82rem; line-height: 1.6;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  white-space: pre-wrap; word-break: break-word;
}

/* ---------- 17. Матрица MITRE ATT&CK ---------- */
.matrix-wrap { overflow-x: auto; padding-bottom: .5rem; }
.matrix {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(160px, 1fr);
  gap: .5rem;
  min-width: max-content;
}
.matrix-col {
  background: var(--surface-2); border-radius: var(--radius-sm);
  padding: .6rem; border: 1px solid var(--border);
  min-height: 220px;
}
.matrix-col h4 {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--accent); margin: 0 0 .5rem; font-weight: 800;
}
.matrix-cell {
  display: block; width: 100%; text-align: left;
  font: inherit; font-size: .78rem; line-height: 1.35;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px; padding: .38rem .5rem; margin-bottom: .28rem;
  cursor: pointer; transition: var(--t); color: var(--text);
}
.matrix-cell:hover { border-color: var(--accent); color: var(--accent); }
.matrix-cell.is-picked { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---------- 18. CVSS ---------- */
.cvss-score {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem 1.2rem; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--border);
  margin-bottom: 1rem;
}
.cvss-value {
  font-size: 2.4rem; font-weight: 800; line-height: 1;
  font-family: var(--mono); padding: .4rem .8rem; border-radius: 10px;
  color: #fff; background: var(--sev-none);
  transition: background var(--t);
}
.cvss-value.sev-none     { background: var(--sev-none); }
.cvss-value.sev-low      { background: var(--sev-low); }
.cvss-value.sev-medium   { background: var(--sev-medium); }
.cvss-value.sev-high     { background: var(--sev-high); }
.cvss-value.sev-critical { background: var(--sev-critical); }
.cvss-meta { flex: 1; min-width: 0; }
.cvss-vector {
  display: block; font-family: var(--mono); font-size: .8rem;
  color: var(--muted); word-break: break-all; margin-top: .3rem;
}
.cvss-severity { font-weight: 800; text-transform: uppercase; letter-spacing: .06em; font-size: .85rem; }

/* ---------- 19. Метрики IDS ---------- */
.metric-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.metric {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: .8rem .9rem;
}
.metric-label { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.metric-value { font-size: 1.5rem; font-weight: 800; font-family: var(--mono); margin-top: .15rem; }
.metric-value.ok   { color: var(--ok); }
.metric-value.warn { color: var(--warn); }
.metric-value.err  { color: var(--err); }
.metric-hint { font-size: .72rem; color: var(--muted); margin-top: .1rem; }

.meter { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin-top: .4rem; }
.meter > i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .3s; }

/* ROC-график */
.roc-wrap {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 1rem;
}
.roc-legend { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: .6rem; font-size: .82rem; color: var(--muted); }
.roc-legend span { display: inline-flex; align-items: center; gap: .4rem; }
.roc-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* ---------- 20. Дерево атак / Petri ---------- */
.tree {
  font-family: var(--mono); font-size: .82rem;
  background: var(--surface-2); padding: 1rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  white-space: pre; overflow-x: auto; line-height: 1.7;
}
.petri-net {
  display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  margin-bottom: 1rem;
}
.place {
  background: var(--surface); border: 2px solid var(--border); border-radius: 999px;
  padding: 1rem; text-align: center; transition: var(--t);
}
.place.has-token { border-color: var(--accent); background: var(--accent-soft); }
.place .tokens { font-size: 1.5rem; line-height: 1; }
.place .place-name { font-size: .78rem; color: var(--muted); margin-top: .3rem; }

/* ---------- 21. Навигация между страницами ---------- */
.lesson-nav {
  display: flex; flex-wrap: wrap; gap: .8rem; justify-content: space-between;
  margin: 2.2rem 0 1rem; padding-top: 1.4rem; border-top: 1px solid var(--border);
}
.lesson-nav a {
  flex: 1 1 220px; padding: .85rem 1.05rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); transition: var(--t);
}
.lesson-nav a:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-2px); }
.lesson-nav small { display: block; color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; }
.lesson-nav strong { display: block; color: var(--text); font-size: .94rem; }
.lesson-nav .next { text-align: right; }

/* ---------- 22. Подвал ---------- */
.footer {
  margin-top: 2.8rem; padding: 1.8rem 0;
  background: #0b1220; color: #94a3b8; font-size: .88rem;
}
.footer a { color: #e2e8f0; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; }
.footer p { margin: 0; }

/* ---------- 23. Утилиты ---------- */
.muted { color: var(--muted); }
.center { text-align: center; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0 !important; }
.hidden { display: none !important; }

/* ---------- 24. Адаптивность ---------- */
@media (max-width: 900px) {
  .demo-split { grid-template-columns: 1fr; }
  .lecture-item { grid-template-columns: 46px 1fr; }
  .lecture-item .lecture-actions { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; }
}

@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: .5rem 20px 1rem; display: none;
  }
  .nav-links.is-open { display: flex; }
  .nav-links a { display: block; padding: .7rem 0; border-bottom: 1px solid var(--border); }
  .nav-links a.is-active { border-bottom-color: var(--border); }
  .control-row { grid-template-columns: 1fr; gap: .25rem; }
  .lesson-nav .next { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}