/* Aroken — три блока курса «Нейросети для разработчиков» (ai.html):
   видео-вставка в программе (.pgv), «Ведущие» (.leads) и чат «Спроси у Максима» вместо FAQ-аккордеона (.aichat).
   Логика чата — js/ai-blocks.js; видео играют по data-inview-play из main.js (в кадре, без звука; при reduced-motion — постер).
   Акцент страницы — фиолетовый (--accent-rgb). Лайм — только «живая» точка (эфир/онлайн) и одна Primary-кнопка. */

/* «живая» точка: эфир программы и онлайн-статус Максима */
@keyframes ai-live { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.66); opacity: .5; } }

/* ================================================================
   Программа: видео-вставка «Даниил собирает сайт вживую» —
   акцентный «момент» между модулями: широкая кинокарточка с фиолетовым
   свечением, играет в кадре без звука; при reduced-motion — постер.
   ================================================================ */
.pgv { position: relative; margin: 6px 0 2px; aspect-ratio: 16 / 9; border-radius: 22px; overflow: hidden; border: 1px solid rgba(var(--accent-rgb), .34); background: #0C0D10; box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .07), 0 28px 60px -26px rgba(var(--accent-rgb), .42), 0 34px 66px -34px rgba(0, 0, 0, .85), inset 0 1px 0 rgba(255, 255, 255, .06); }
.pgv__media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.pgv__overlay { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(12, 13, 16, .28) 0%, rgba(12, 13, 16, 0) 30%, rgba(12, 13, 16, 0) 55%, rgba(12, 13, 16, .68) 100%); }
.pgv__cap { position: absolute; left: 16px; bottom: 15px; display: inline-flex; align-items: center; gap: 10px; padding: 9px 17px 9px 13px; border-radius: 999px; background: rgba(12, 13, 16, .62); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border: 1px solid rgba(255, 255, 255, .14); font-size: 15px; font-weight: 600; letter-spacing: -.005em; color: #fff; }
.pgv__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--lime-2); box-shadow: 0 0 0 3px rgba(215, 255, 69, .18), 0 0 12px rgba(215, 255, 69, .85); flex: none; }
@media (prefers-reduced-motion: no-preference) { .pgv__dot { animation: ai-live 1.5s ease-in-out infinite; } }
/* десктоп: полноширинная кинополоса вместо высокого 16:9 */
@media (min-width: 768px) { .pgv { aspect-ratio: auto; height: clamp(320px, 32vw, 460px); } }
@media (max-width: 519px) { .pgv__cap { font-size: 13.5px; } }

/* ================================================================
   Ведущие: две строки-персоны, вторая — зеркальная
   ================================================================ */
.leads { margin-top: 40px; display: grid; gap: 20px; }
.lead-row { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 30px; align-items: center; padding: 24px; border-radius: 24px; border: 1px solid rgba(255, 255, 255, .08); background: linear-gradient(165deg, #17181C, #121316); box-shadow: 0 22px 46px -30px rgba(0, 0, 0, .8); }
/* зеркальная строка: видео уходит вправо (DOM-порядок всегда «видео → текст», чтобы на телефоне видео было сверху) */
.lead-row--rev { grid-template-columns: minmax(0, 1fr) minmax(0, 300px); }
.lead-row--rev .lead-row__media { order: 2; }

.lead-row__media { position: relative; width: 100%; max-width: 300px; aspect-ratio: 1 / 1; border-radius: 20px; overflow: hidden; border: 1px solid rgba(255, 255, 255, .1); background: #0C0D10; box-shadow: 0 22px 40px -24px rgba(0, 0, 0, .8), inset 0 1px 0 rgba(255, 255, 255, .06); }
.lead-row__media::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .16); }
.lead-row__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }

.lead-row__body { min-width: 0; }
.lead-row__name { font-size: 24px; line-height: 30px; font-weight: 600; letter-spacing: -.015em; }
.lead-row__role { margin-top: 5px; font-size: 13.5px; line-height: 18px; font-weight: 500; color: var(--muted-2); }
.lead-row__bio { margin-top: 14px; max-width: 640px; font-size: 15.5px; line-height: 23px; color: var(--muted-2); text-wrap: pretty; }

.lead-stats { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 16px 30px; }
.lead-stats li { display: grid; gap: 2px; }
.lead-stats b { font-size: 22px; line-height: 26px; font-weight: 700; letter-spacing: -.02em; color: #fff; }
.lead-stats span { font-size: 13px; line-height: 17px; color: var(--muted-2); }

.lead-chips { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 8px; }
.lead-chips li { display: inline-flex; align-items: center; height: 32px; padding: 0 14px; border-radius: 999px; border: 1px solid rgba(var(--accent-rgb), .3); background: rgba(var(--accent-rgb), .08); font-size: 13px; font-weight: 500; letter-spacing: -.005em; color: #fff; white-space: nowrap; }

@media (max-width: 860px) {
  .lead-row, .lead-row--rev { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 22px; }
  .lead-row--rev .lead-row__media { order: 0; }
  .lead-row__bio { margin-inline: auto; }
  .lead-stats, .lead-chips { justify-content: center; }
}

/* ================================================================
   FAQ → чат «Спроси у Максима»
   ================================================================ */
.aichat { max-width: 760px; margin: 36px auto 0; display: flex; flex-direction: column; border-radius: 24px; border: 1px solid rgba(255, 255, 255, .08); background: linear-gradient(180deg, #17181C, #121316); box-shadow: 0 30px 62px -34px rgba(0, 0, 0, .85); overflow: hidden; }

.aichat__head { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-bottom: 1px solid rgba(255, 255, 255, .07); background: rgba(255, 255, 255, .02); }
.aichat__avatar { width: 48px; height: 48px; border-radius: 50%; overflow: hidden; border: 1px solid rgba(255, 255, 255, .14); flex: none; }
.aichat__avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.aichat__persona { display: grid; gap: 3px; min-width: 0; }
.aichat__name { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.aichat__status { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; line-height: 17px; color: var(--muted-2); }
.aichat__status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lime-2); box-shadow: 0 0 0 3px rgba(215, 255, 69, .16), 0 0 10px rgba(215, 255, 69, .8); flex: none; }
@media (prefers-reduced-motion: no-preference) { .aichat__status-dot { animation: ai-live 1.6s ease-in-out infinite; } }

.aichat__feed { display: flex; flex-direction: column; gap: 12px; padding: 20px; }
.aimsg { display: flex; }
.aimsg--bot { justify-content: flex-start; }
.aimsg--you { justify-content: flex-end; }
.aimsg__bubble { max-width: 82%; padding: 12px 15px; font-size: 15px; line-height: 22px; text-wrap: pretty; }
.aimsg--bot .aimsg__bubble { border-radius: 16px 16px 16px 4px; border: 1px solid rgba(var(--accent-rgb), .28); background: rgba(var(--accent-rgb), .08); color: rgba(255, 255, 255, .92); }
.aimsg--you .aimsg__bubble { border-radius: 16px 16px 4px 16px; background: linear-gradient(160deg, #FEFDF9, #ECE6DB); color: var(--ink); box-shadow: 0 14px 26px -18px rgba(0, 0, 0, .8); }
@media (prefers-reduced-motion: no-preference) { .aimsg.is-new { animation: ai-msg-in .34s var(--ease) both; } }
@keyframes ai-msg-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.aichat__prompts { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 20px 16px; }
.aichat__prompts-label { width: 100%; margin-bottom: 2px; font-size: 12.5px; line-height: 16px; color: rgba(255, 255, 255, .45); }
.aichat__chip { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .05); font-size: 13.5px; font-weight: 500; letter-spacing: -.005em; color: rgba(255, 255, 255, .86); cursor: pointer; transition: background .2s, border-color .2s, color .2s, transform .2s var(--ease); }
.aichat__chip:hover { background: rgba(var(--accent-rgb), .12); border-color: rgba(var(--accent-rgb), .4); color: #fff; transform: translateY(-1px); }
.aichat__chip:focus-visible { outline: 2px solid rgb(var(--accent-rgb)); outline-offset: 2px; }
.aichat__chip[aria-disabled="true"] { opacity: .38; pointer-events: none; }

.aichat__form { display: flex; gap: 10px; padding: 16px 20px; border-top: 1px solid rgba(255, 255, 255, .07); background: rgba(255, 255, 255, .02); }
.aichat__field { flex: 1 1 auto; min-width: 0; height: 48px; padding: 0 16px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .04); color: #fff; font: 400 15px/1 var(--font); }
.aichat__field::placeholder { color: rgba(255, 255, 255, .4); }
.aichat__field:focus { outline: none; border-color: rgba(var(--accent-rgb), .6); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .16); }
.aichat__send { flex: none; width: 48px; height: 48px; border: 0; border-radius: 12px; display: grid; place-items: center; background: rgba(var(--accent-rgb), .16); color: rgb(var(--accent-rgb)); cursor: pointer; transition: background .2s, transform .2s var(--ease); }
.aichat__send svg { width: 22px; height: 22px; }
.aichat__send:hover { background: rgba(var(--accent-rgb), .26); }
.aichat__send:active { transform: scale(.94); }
.aichat__send:focus-visible { outline: 2px solid rgb(var(--accent-rgb)); outline-offset: 2px; }

.aichat__cta { padding: 4px 20px 22px; }
.aichat__cta .btn { width: 100%; justify-content: center; }
.aichat__tg-icon { width: 22px; height: 22px; flex: none; }

@media (max-width: 560px) {
  .aichat__feed { padding: 16px; }
  .aimsg__bubble { max-width: 88%; }
}
