/*
  Витрина сотрудника. Основной девайс — дешёвый Android с плохим интернетом (§12),
  поэтому здесь нет ни фреймворка, ни шрифтов с чужих серверов: только системный
  шрифт и один файл стилей.

  Размеры кнопок не меньше 44px: уроки проходят стоя за баром, часто одной рукой.
*/

:root {
  color-scheme: light dark;
  --bg: #f5f6f8;
  --card: #ffffff;
  --ink: #1b1f24;
  --muted: #5c6570;
  --line: #e2e5ea;
  --accent: #2f6fed;
  --done: #1f9254;
  --warn: #c0392b;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171a;
    --card: #1c2024;
    --ink: #e8eaed;
    --muted: #9aa4af;
    --line: #2a3037;
    --accent: #5b8cff;
    --done: #35b46e;
    --warn: #e5705f;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 16px 48px;
}

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

.top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

.top__home {
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}

.top__exit {
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 15px;
  cursor: pointer;
}

/* --- заголовки --- */

h1 { font-size: 24px; line-height: 1.25; margin: 8px 0 16px; }
h2 { font-size: 19px; margin: 28px 0 10px; }
h3 { font-size: 17px; margin: 20px 0 8px; }

.muted { color: var(--muted); font-size: 15px; }

/* --- карточки курсов --- */

.card {
  display: block;
  padding: 14px 16px;
  margin-bottom: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  color: inherit;
  text-decoration: none;
}

.card__title { font-weight: 600; margin-bottom: 6px; }

.card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--muted);
  font-size: 14px;
}

.bar {
  height: 8px;
  margin-top: 10px;
  border-radius: 99px;
  background: var(--line);
  overflow: hidden;
}

.bar__fill { height: 100%; background: var(--accent); }
.bar__fill--done { background: var(--done); }

.tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 99px;
  font-size: 13px;
  background: var(--line);
  color: var(--muted);
}

.tag--overdue { background: var(--warn); color: #fff; }
.tag--done { background: var(--done); color: #fff; }

/* --- список уроков --- */

.lessons { list-style: none; margin: 0; padding: 0; }

.lessons li { border-bottom: 1px solid var(--line); }
.lessons li:last-child { border-bottom: 0; }

.lesson-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 10px 0;
  color: inherit;
  text-decoration: none;
}

.lesson-row--locked { color: var(--muted); }

.mark {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 14px;
  line-height: 1;
}

.mark--done { background: var(--done); border-color: var(--done); color: #fff; }

.lesson-row__time { margin-left: auto; color: var(--muted); font-size: 14px; white-space: nowrap; }

/* --- урок --- */

.lesson-body { font-size: 18px; }
.lesson-body h2 { font-size: 20px; }
.lesson-body img { max-width: 100%; height: auto; border-radius: 12px; }
.lesson-body figure { margin: 16px 0; }
.lesson-body figcaption, .caption { color: var(--muted); font-size: 14px; margin-top: 6px; }
.lesson-body ul, .lesson-body ol { padding-left: 22px; }
.lesson-body blockquote {
  margin: 16px 0;
  padding: 8px 0 8px 14px;
  border-left: 3px solid var(--line);
  color: var(--muted);
}

.video { position: relative; padding-top: 56.25%; margin: 16px 0; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 12px; }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  padding: 12px 20px;
  border: 0;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.btn--ghost { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.btn--done { background: var(--done); }

.actions { display: grid; gap: 10px; margin-top: 28px; }

.nav-pair { display: flex; gap: 10px; margin-top: 14px; }
.nav-pair .btn { flex: 1; min-height: 46px; font-weight: 500; font-size: 15px; }

/* --- сообщения --- */

.note {
  padding: 12px 14px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  background: var(--card);
  font-size: 15px;
}

.note--error { border-left-color: var(--warn); }

.empty { padding: 32px 0; text-align: center; color: var(--muted); }
