/* Сцена демо в блоке чата (js/scene.js): шапка профиля, поле ссылки поверх пустых карточек, подсветка карточек отчёта,
   вложение в первом вопросе. Размеры и раскладка блока не меняются. */

/* шапка профиля над отчётом: в сцене 1248×1034 над макетом свободно 48 px */
.sc-prof { position: absolute; left: 4px; top: 0; z-index: 1; display: flex; align-items: center; gap: 10px; height: 40px; transition: opacity .4s; }
.sc-ava { flex: none; width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--c-white); box-shadow: 0 0 0 2px var(--c-white), 0 0 0 4px var(--c-brand); font-size: 15px; line-height: 1; font-weight: 500; color: var(--c-text); text-transform: lowercase; }
.sc-prof__t { display: flex; flex-direction: column; }
.sc-prof__t b { font-weight: 500; font-size: 16px; line-height: 20px; letter-spacing: -0.48px; color: var(--c-text); }
.sc-prof__t small { font-size: 13px; line-height: 18px; letter-spacing: -0.3px; color: var(--c-text-2); }
.ai__stage[data-scene="1"] .sc-prof { opacity: 0; }

/* кадр 1: поле ссылки по центру макета отчёта */
.sc-link { position: absolute; left: 300px; top: 50%; z-index: 2; width: 540px; max-width: calc(100% - 32px); transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: stretch; gap: 14px; opacity: 0; visibility: hidden; transition: opacity .35s, visibility .35s, transform .35s; pointer-events: none; }
.sc-link::before { content: ''; position: absolute; inset: -90px -110px; z-index: -1; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 255, 255, .96) 45%, rgba(255, 255, 255, 0)); }
.ai__stage[data-scene="1"] .sc-link { opacity: 1; visibility: visible; }
.ai__stage[data-scene="2"] .sc-link, .ai__stage[data-scene="3"] .sc-link { transform: translate(-50%, -58%) scale(.96); }
.sc-link__field { position: relative; display: flex; align-items: center; height: 72px; padding: 0 10px 0 30px; border-radius: 32px; background: linear-gradient(var(--c-white), var(--c-white)) padding-box, linear-gradient(90deg, #ffff00 0%, #95ff00 24%, #00ffff 58%, #9ff5ff 100%) border-box; border: 2px solid transparent; box-shadow: 0 16px 48px -16px rgba(89, 178, 0, .35); }
.sc-link__url { flex: 1; min-width: 0; display: flex; align-items: center; font-size: 17px; line-height: 24px; letter-spacing: -0.4px; color: var(--c-text); white-space: nowrap; overflow: hidden; }
.sc-link__url i { width: 2px; height: 22px; margin-left: 2px; background: var(--c-brand-700); animation: sc-caret 1s steps(1) infinite; }
@keyframes sc-caret { 50% { opacity: 0; } }
.sc-link__field b { flex: none; width: 48px; height: 48px; border-radius: 50%; background: var(--c-surface) url("../assets/chat/send-icon.svg") center / 24px no-repeat; transition: transform .15s; } /* кнопка как у поля чата: серая заливка */
.ai__stage.sc-press .sc-link__field b { transform: scale(.86); }
.sc-link__status { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; line-height: 20px; color: var(--c-text-2); opacity: 0; transition: opacity .25s; }
.sc-link__status::before { content: ''; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--c-line); border-top-color: var(--c-brand-700); animation: sc-spin .8s linear infinite; }
@keyframes sc-spin { to { transform: rotate(360deg); } }
.ai__stage.sc-load .sc-link__status { opacity: 1; }
.ai__stage.sc-load .sc-link__url i { display: none; }

/* пустые карточки: видна только заготовка, содержимое появляется, когда отчёт «собирается» */
.ai__mockup .rm-card > * { transition: opacity .45s; }
.ai__mockup .rm-card.sc-off > * { opacity: 0; transition: none; }

/* подсветка карточек, о которых идёт ответ */
.ai__mockup .rm-card { transition: box-shadow .35s; }
.ai__mockup .report-mockup.sc-has-lit .rm-card:not(.sc-lit) > * { opacity: .32; }
.ai__mockup .rm-card.sc-lit { box-shadow: inset 0 0 0 1.584px var(--rm-surface, #f0f3fa), 0 0 0 4px var(--c-brand), 0 18px 56px -8px rgba(89, 178, 0, .45); }

/* вложение в первом вопросе: от кого вопрос и что просит блогер */
.sc-from { font-size: 12px; line-height: 16px; letter-spacing: -0.36px; color: var(--c-text-3); }
.sc-offer { display: flex; align-items: center; gap: 12px; min-width: 300px; max-width: 100%; padding: 10px 14px 10px 12px; border: 1px solid var(--c-line); border-radius: 16px; background: var(--c-surface); }
.sc-offer .sc-ava { width: 32px; height: 32px; font-size: 14px; box-shadow: 0 0 0 2px var(--c-surface), 0 0 0 3.5px var(--c-brand); }
.sc-offer__t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sc-offer__t b { font-weight: 500; font-size: 15px; line-height: 20px; letter-spacing: -0.4px; }
.sc-offer__t small { font-size: 12px; line-height: 16px; color: var(--c-text-2); }
.sc-offer strong { font-weight: 500; font-size: 16px; line-height: 24px; letter-spacing: -0.48px; white-space: nowrap; }

/* пока идёт вступление, чат ждёт отчёт */
.chat__log, .chips { transition: opacity .4s; }
.ai__stage[data-scene="1"] .chips, .ai__stage[data-scene="2"] .chips { opacity: 0; }
/* значок появляется вместе с отчётом и чатом, не раньше */
.ai__stage[data-scene="1"] .ai__badge, .ai__stage[data-scene="2"] .ai__badge { opacity: 0 !important; animation: none !important; }
/* во время сцены реплики идут сверху вниз */
.ai__stage[data-scene] .chat__log > :first-child { margin-top: 0; }

/* планшет: сцена в один столбец, шапка профиля стоит в потоке над отчётом */
@media (max-width: 1023px) {
  .sc-prof { position: relative; left: auto; top: auto; align-self: flex-start; margin-bottom: -24px; }
  .sc-link { left: 50%; width: 540px; top: 38%; }
}
/* телефон (до 767): как на главной pixwise.ai. Сверху шапка профиля и окно отчёта, под ним чат.
   Отчёт вписан в ширину, в окне видна его часть; на каждый ответ отчёт подъезжает к подсвеченной карточке (js/scene.js). */
@media (max-width: 767px) {
  .ai__stage { padding-top: 0; gap: 0; }
  .sc-prof { margin: 0 0 12px 4px; }
  .ai__mockup { display: block; position: relative; width: 100% !important; height: var(--sc-rep-h, 300px) !important; overflow: hidden; border-radius: 20px 20px 0 0;
    -webkit-mask-image: linear-gradient(#000 calc(100% - 28px), transparent); mask-image: linear-gradient(#000 calc(100% - 28px), transparent); }
  .ai__mockup .scale-box__inner { transition: translate .7s cubic-bezier(.2, .7, .2, 1); }
  .ai__mockup .rm-card.sc-lit { box-shadow: inset 0 0 0 1.584px var(--rm-surface, #f0f3fa), 0 0 0 8px var(--c-brand); }
  .sc-link { left: 50%; top: 50%; width: calc(100% - 24px); max-width: 420px; }
  .sc-link::before { inset: -60px -40px; }
  .sc-link__field { height: 60px; padding: 0 6px 0 22px; }
  .sc-link__url { font-size: 15px; }
  .chat { padding-top: 20px; }
  .ai__badge { display: none; }   /* стикер «Pixwise-чат бесплатно» на телефоне убран (решение владельца 16.11) */
  .chat__log { height: var(--sc-log-h, 254px); }   /* высоты как у демо на главной, считает js/scene.js */
  .sc-offer { min-width: 0; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .sc-link__url i, .sc-link__status::before { animation: none; }
}

/* значок между отчётом и чатом: надпись «Pixwise-чат» живым текстом по дуге (в картинках значка её больше нет) */
.ai__badge > .ai__badge-label { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 4; display: block; overflow: visible; }
.ai__badge-label text { font-family: inherit; font-size: 8.6px; font-weight: 600; letter-spacing: 1.9px; text-transform: uppercase; fill: #0d1526; }

/* готовые вопросы под лентой во время сцены приглушены, чтобы не отвлекать от диалога; под мышью и после сцены обычные */
.chip__text { transition: color .4s; }
.ai__stage.sc-running .chip { border-color: var(--c-surface); font-weight: 400; }
.ai__stage.sc-running .chip .chip__text { color: var(--c-text-3); }
.ai__stage.sc-running .chip:hover { border-color: var(--c-text-3); }
.ai__stage.sc-running .chip:hover .chip__text { color: var(--c-text); }

/* кнопка поля чата: к концу диалога стрелка сменяется кнопкой «Заказать» в той же серой заливке и остаётся */
.chat__send { min-width: 48px; width: auto; border-radius: 24px; padding: 0 12px; transition: background-color .15s, padding .3s; }
.chat__send img { transition: opacity .2s; }
.sc-send__t { max-width: 0; overflow: hidden; opacity: 0; white-space: nowrap; font-weight: 500; font-size: 16px; line-height: 24px; letter-spacing: -0.48px; color: var(--c-text); transition: max-width .3s, opacity .25s; }
.ai__stage.sc-cta .chat__send { padding: 0 22px; }
.ai__stage.sc-cta .chat__send img { position: absolute; opacity: 0; }
.ai__stage.sc-cta .sc-send__t { max-width: 120px; opacity: 1; }
.ai__stage.sc-cta .chat__text { padding-right: 140px; }
.ai__stage.sc-cta .chat__send { pointer-events: auto; cursor: pointer; }
/* финальная реплика зовёт нажать «Заказать»: кнопка в этот момент слегка дрожит, три раза с паузами */
.ai__stage.sc-shake .chat__send { animation: sc-shake 1.8s ease-in-out .5s 3; }
@keyframes sc-shake {
  0%, 36%, 100% { transform: translateY(-50%) rotate(0); }
  4%, 20% { transform: translateY(-50%) translateX(-3px) rotate(-3deg); }
  8%, 24% { transform: translateY(-50%) translateX(3px) rotate(3deg); }
  12%, 28% { transform: translateY(-50%) translateX(-2px) rotate(-2deg); }
  16%, 32% { transform: translateY(-50%) translateX(2px) rotate(2deg); }
}
@media (prefers-reduced-motion: reduce) { .ai__stage.sc-shake .chat__send { animation: none; } }

/* подвал на телефоне: строка про персональные данные переносится целиком, почта не уезжает вправо */
@media (max-width: 767px) { .footer__contact--pd { display: block; } }
/* подвал на телефоне: меню разделов не дублирует меню шапки, как на главной pixwise.ai */
@media (max-width: 767px) { .footer__nav { display: none; } }

/* карточка публикации в ответе чата: обложка, дата и счётчики */
.sc-photo { display: flex; gap: 12px; align-items: flex-end; margin-bottom: 10px; }
.sc-photo img { flex: none; width: 120px; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 12px; }
.sc-photo span { display: flex; flex-direction: column; gap: 2px; }
.sc-photo b { font-weight: 500; font-size: 14px; line-height: 18px; }
.sc-photo small { font-size: 12px; line-height: 16px; color: var(--c-text-2); }
@media (max-width: 767px) { .sc-photo { gap: 10px; } .sc-photo img { width: 64px; border-radius: 10px; } .sc-photo b { font-size: 13px; line-height: 17px; } }
/* подпись под демо: чьи это данные и на какую дату. Стоит по центру под окном чата на любом экране (место считает js/scene.js) */
.ai__note { position: absolute; left: 0; width: 100%; top: 100%; margin: 12px 0 0; white-space: nowrap; text-align: center; font-size: 13px; line-height: 18px; letter-spacing: -0.2px; color: var(--c-text-3); }

/* лента чата прокручивается: тонкая полоса прокрутки видна, чтобы было понятно, что реплики выше можно вернуть */
.ai__stage .chat__log { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(4, 4, 5, .22) transparent; padding-right: 6px; }
.ai__stage .chat__log::-webkit-scrollbar { display: block; width: 4px; }
.ai__stage .chat__log::-webkit-scrollbar-thumb { background: rgba(4, 4, 5, .22); border-radius: 2px; }

/* телефон: окно чата один в один как у демо на главной pixwise.ai (размер текста, отступы, поле ввода, без строки «имя · время») */
@media (max-width: 767px) {
  .ai__stage .chat { padding: 16px; gap: 14px; }
  .ai__stage .chat__log { gap: 10px; }
  .ai__stage .msg__bubble { padding: 11px 15px; font-size: 14px; line-height: 20px; letter-spacing: 0; }
  .ai__stage .msg--ai .msg__bubble { border-radius: 18px 18px 18px 6px; }
  .ai__stage .msg--user .msg__bubble { border-radius: 18px 18px 6px 18px; }
  .ai__stage .msg__meta { display: none; }
  .ai__stage .chat__bottom { padding-top: 0; border-top: 0; }
  .ai__stage .chat__input { height: 54px; }
  .ai__stage .sc-from { margin-bottom: 4px; }
}
/* заданная подсказка скрывается */
.chip[hidden], .chips[hidden] { display: none !important; }

@media (max-width: 767px) { .chips { display: none; } .chat__bottom { padding-top: 0; border-top: 0; } }
