/* Claude Code арқылы видеомонтаж — diana.tellman · ақ, қара, бордо */
@font-face { font-family: "Onest"; font-weight: 100 900; font-display: swap; src: url(fonts/onest-cyrillic-ext.woff2) format("woff2"); unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: "Onest"; font-weight: 100 900; font-display: swap; src: url(fonts/onest-cyrillic.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-weight: 100 900; font-display: swap; src: url(fonts/onest-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD, U+20B8; }

:root {
  --bordo: #8E1B3F;          /* белый текст на нём 8.8:1 */
  --bordo-press: #741532;
  --bordo-soft: #F8E9ED;     /* фон выбранного и чипов */
  --bordo-line: #E7C3CD;
  --bordo-grad: linear-gradient(135deg, #A9284F 0%, #8E1B3F 55%, #5E0F27 100%);
  --bg: #FFFFFF;
  --card: #F7F3F4;
  --line: #ECE3E5;
  --text: #141012;           /* қара */
  --text-2: #5E5257;         /* вторичный текст: 7.6:1 на белом */
  --ok: #1E7A4A; --ok-bg: #E6F4EC;
  --font: "Onest", -apple-system, "SF Pro Text", system-ui, sans-serif;
  --ease: cubic-bezier(.2,.7,.2,1);
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 16px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 750; letter-spacing: -0.015em; overflow-wrap: break-word; hyphens: auto; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--bordo); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--text-2); }

.wrap { max-width: 720px; margin: 0 auto; padding: calc(14px + env(safe-area-inset-top)) 16px calc(160px + env(safe-area-inset-bottom)); }

/* ───── Шапка ───── */
.head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.avatar { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; flex: none; box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--bordo); }
.head .t { min-width: 0; }
.head .course { font-weight: 750; font-size: 16px; line-height: 1.25; }
.ig { display: inline-flex; align-items: center; gap: 5px; font-size: 14px; color: var(--text-2); text-decoration: none; min-height: 28px; }
.ig svg { width: 15px; height: 15px; color: var(--bordo); }

/* Прогресс — реальное число завершённых уроков */
.progress-card { background: var(--card); border-radius: 18px; padding: 14px 16px; margin-bottom: 14px; }
.progress-card .row { display: flex; justify-content: space-between; font-size: 14px; color: var(--text-2); margin-bottom: 8px; }
.progress-card b { color: var(--text); }
.bar { height: 8px; border-radius: 999px; background: #EADDE1; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--bordo-grad); border-radius: 999px; transition: width .6s var(--ease); }

/* «Жалғастыру» */
.continue { position: relative; overflow: hidden; display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 20px; background: var(--bordo-grad); color: #fff;
  text-decoration: none; margin-bottom: 22px; box-shadow: 0 14px 30px -16px rgba(142, 27, 63, .75); transition: transform .14s var(--ease); }
.continue:active { transform: scale(.98); }
.continue::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.22) 50%, transparent 65%); transform: translateX(-100%); animation: sheen 1.6s .4s var(--ease) 1 forwards; pointer-events: none; }
@keyframes sheen { to { transform: translateX(100%); } }
.play { width: 50px; height: 50px; border-radius: 50%; background: #fff; display: grid; place-items: center; flex: none; position: relative; }
.play svg { width: 20px; height: 20px; fill: var(--bordo); margin-left: 2px; }
.play::before { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid rgba(255,255,255,.55); animation: ring 2.6s ease-out infinite; }
@keyframes ring { 0% { transform: scale(.9); opacity: .9; } 70%, 100% { transform: scale(1.35); opacity: 0; } }
.continue .l { font-weight: 750; font-size: 17px; }
.continue .s { display: block; font-size: 14px; opacity: .9; overflow-wrap: anywhere; }

/* ───── Модули и уроки ───── */
.module { margin-bottom: 22px; }
.module-label { font-size: 13px; font-weight: 700; color: var(--bordo); margin: 0 4px 2px; }
.module h2 { font-size: 20px; margin: 0 4px 10px; line-height: 1.25; }
.lessons { display: grid; gap: 10px; }
.lesson { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 18px; background: var(--card); text-decoration: none; min-height: 72px;
  border: 1px solid transparent; transition: transform .14s var(--ease), background-color .15s, border-color .15s; -webkit-tap-highlight-color: transparent; }
.lesson:active { transform: scale(.985); background: var(--bordo-soft); }
@media (hover: hover) { .lesson:hover { border-color: var(--bordo-line); } }
.num { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--bordo); color: #fff; font-weight: 800; flex: none; font-size: 17px; }
.lesson.done .num { background: var(--ok); }
.lesson .t { flex: 1; min-width: 0; }
.lesson .t b { display: block; font-weight: 650; line-height: 1.3; overflow-wrap: break-word; }
.lesson .t .meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); margin-top: 5px; }
.chev { width: 20px; height: 20px; color: var(--text-2); flex: none; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 650; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.chip.ok { color: var(--ok); background: var(--ok-bg); }
.chip.soon { color: var(--bordo); background: var(--bordo-soft); }

.bonus { padding: 20px; border-radius: 20px; background: var(--bordo-soft); border: 1px solid var(--bordo-line); display: grid; gap: 8px; margin-top: 6px; }
.bonus h3 { font-size: 19px; }

.install { margin-top: 26px; padding: 16px; border-radius: 18px; border: 1px dashed var(--bordo-line); font-size: 14px; color: var(--text-2); display: grid; gap: 8px; }
.install b { color: var(--text); }

/* ───── Страница урока ───── */
.back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--text-2); text-decoration: none; font-size: 15px; max-width: 100%; }
.back span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kicker { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 10px; }
.kicker .chip { background: var(--bordo); color: #fff; }
.kicker .chip.m { background: var(--card); color: var(--text-2); }
.lesson-title { font-size: 26px; line-height: 1.2; margin-bottom: 10px; }
.lesson-summary { color: var(--text-2); font-size: 16.5px; }

.video { margin-top: 18px; border-radius: 20px; overflow: hidden; background: #000; box-shadow: 0 18px 40px -24px rgba(20,16,18,.6); }
.video .frame { position: relative; aspect-ratio: 16 / 9; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.yt-link { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; background: #fff; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 20px 20px; text-decoration: none; font-size: 14px; font-weight: 600; color: var(--text-2); margin-top: -1px; }
.video-soon { margin-top: 18px; border-radius: 20px; padding: 26px 18px; background: var(--bordo-grad); color: #fff; text-align: center; display: grid; gap: 6px; justify-items: center; }
.video-soon svg { width: 34px; height: 34px; opacity: .9; }

.section { font-size: 20px; margin: 30px 0 12px; display: flex; align-items: center; gap: 10px; scroll-margin-top: 12px; }
.section::before { content: ""; width: 4px; height: 20px; border-radius: 2px; background: var(--bordo); }
.mats { display: grid; gap: 12px; }
.mat { background: var(--card); border-radius: 20px; padding: 16px; display: grid; gap: 10px; }
.mat-head { display: flex; align-items: center; gap: 12px; }
.mat-icon { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: #fff; color: var(--bordo); flex: none; border: 1px solid var(--bordo-line); }
.mat-icon svg { width: 21px; height: 21px; }
.mat-type { font-size: 13px; color: var(--text-2); font-weight: 600; }
.mat h3 { font-size: 17px; line-height: 1.3; }
.how { font-size: 15px; color: var(--text-2); border-left: 3px solid var(--bordo); padding: 2px 0 2px 12px; }
.how b { display: block; color: var(--text); font-size: 13px; margin-bottom: 2px; }
.prompt { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px; white-space: pre-wrap; overflow-wrap: anywhere; font: 15.5px/1.6 var(--font); margin: 0; -webkit-user-select: text; user-select: text; }
.hint { font-size: 14px; color: var(--bordo); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 12px 18px; border-radius: 15px; border: 1px solid var(--line);
  background: #fff; font-weight: 650; text-decoration: none; cursor: pointer; color: var(--text); text-align: center;
  transition: transform .14s var(--ease), background-color .2s; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--bordo); border-color: transparent; color: #fff; box-shadow: 0 8px 20px -10px rgba(142, 27, 63, .7); }
.btn.primary:active { background: var(--bordo-press); }
.btn.wide { width: 100%; }
.btn.ok { background: var(--ok-bg); border-color: #BFE3CD; color: var(--ok); box-shadow: none; animation: pop .32s var(--ease); }
@keyframes pop { 0% { transform: scale(.94); } 60% { transform: scale(1.03); } 100% { transform: scale(1); } }

.next { margin-top: 18px; display: flex; gap: 12px; align-items: center; padding: 16px; border-radius: 18px; background: var(--card); text-decoration: none; }
.next .t { flex: 1; min-width: 0; font-weight: 650; overflow-wrap: anywhere; }
.next small { display: block; font-size: 13px; color: var(--text-2); font-weight: 400; }
.next .go { width: 40px; height: 40px; border-radius: 50%; background: var(--bordo); color: #fff; display: grid; place-items: center; flex: none; }

.author { margin-top: 26px; display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 18px; border: 1px solid var(--line); }
.author .avatar { width: 56px; height: 56px; }
.author .t { flex: 1; min-width: 0; }
.author b { display: block; font-size: 17px; }

/* Нижняя панель: «Меңгердім ✓» — компактная «таблетка» под большим пальцем, после отметки появляется «Келесі сабақ» */
.bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; padding: 10px 16px calc(58px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(255,255,255,.98) 55%, rgba(255,255,255,0)); pointer-events: none; }
.bottom-row { max-width: 688px; margin: 0 auto; display: flex; gap: 10px; justify-content: center; pointer-events: auto; }
.pill { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 52px; padding: 12px 22px; white-space: nowrap; flex: 0 1 auto; border-radius: 999px;
  border: 2px solid var(--bordo); background: #fff; color: var(--bordo); font-weight: 750; font-size: 16px; text-decoration: none; cursor: pointer;
  box-shadow: 0 10px 24px -14px rgba(20,16,18,.5); transition: transform .14s var(--ease), background-color .2s, color .2s; -webkit-tap-highlight-color: transparent; }
.pill:active { transform: scale(.96); }
.pill.ok { background: var(--ok); border-color: var(--ok); color: #fff; animation: pop .32s var(--ease); }
.next-pill { background: var(--bordo); color: #fff; animation: rise .35s var(--ease) both; }

/* Тік видео (9:16): content.js-те vertical: true */
.video.vertical { max-width: 360px; margin-left: auto; margin-right: auto; }
.video.vertical .frame { aspect-ratio: 9 / 16; max-height: 78vh; }

/* Кіру коды экраны */
.gate { min-height: 100dvh; display: grid; align-content: center; justify-items: center; text-align: center; gap: 14px; padding-bottom: 40px; }
.avatar.big { width: 96px; height: 96px; }
.gate h1 { font-size: 24px; line-height: 1.2; max-width: 22ch; }
.gate p { max-width: 34ch; }
.gate-form { width: 100%; max-width: 360px; display: grid; gap: 10px; text-align: left; margin-top: 6px; }
.gate-form label { font-size: 14px; font-weight: 650; color: var(--text-2); }
.gate-form input { width: 100%; min-height: 54px; border-radius: 15px; border: 1.5px solid var(--line); padding: 12px 16px; font: 600 20px/1 var(--font);
  letter-spacing: .08em; text-transform: uppercase; text-align: center; background: var(--card); color: var(--text); }
.gate-form input:focus { outline: none; border-color: var(--bordo); box-shadow: 0 0 0 4px var(--bordo-soft); }
.error { color: #B3261E; font-size: 14px; text-align: center; }
.btn[disabled] { opacity: .6; pointer-events: none; }

.reveal { animation: rise .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.toast { position: fixed; left: 50%; bottom: calc(136px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: max-content; max-width: calc(100vw - 32px); text-align: center; background: var(--text); color: #fff; padding: 10px 16px; border-radius: 12px; z-index: 50; font-weight: 600; font-size: 15px; }

@media (min-width: 760px) {
  .wrap { padding-top: 32px; }
  .lesson-title { font-size: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0s !important; animation-delay: 0s !important; transition-duration: 0s !important; animation-iteration-count: 1 !important; }
  .continue::after, .play::before { display: none; }
}
