/* FM-24 · нативные промо-блоки Genova AI
   Имена намеренно нейтральные: файлы и классы со словом ads/banner
   вырезают блокировщики рекламы вместе с вёрсткой и учётом.

   Идея блока: показать саму работу нейросети — запрос печатается,
   результат проявляется из размытия, как в настоящем генераторе. */

.fmx {
    margin: 26px 0;
}

.fmx__hit {
    display: block;
    text-decoration: none;
    color: inherit;
}

.fmx-card {
    --fx-accent: #7c5cff;
    --fx-accent-2: #22d3ee;
    --fx-ink: #0f0d1a;
    position: relative;
    display: flex;
    gap: 30px;
    align-items: center;
    padding: 26px 30px;
    background:
        radial-gradient(120% 160% at 100% 0%, rgba(124, 92, 255, .07), transparent 55%),
        #fff;
    border-radius: 22px;
    box-shadow:
        0 1px 2px rgba(22, 18, 48, .06),
        0 12px 30px -12px rgba(38, 24, 92, .18);
    transition: box-shadow .3s ease, transform .3s ease;
    overflow: hidden;
}

/* тонкая градиентная обводка вместо серой рамки */
.fmx-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(124, 92, 255, .45), rgba(34, 211, 238, .28) 45%, rgba(124, 92, 255, .08));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.fmx__hit:hover .fmx-card {
    transform: translateY(-3px);
    box-shadow:
        0 1px 2px rgba(22, 18, 48, .06),
        0 26px 50px -18px rgba(38, 24, 92, .32);
}

/* ---------- окно нейросети ---------- */

.fmx-demo {
    position: relative;
    flex: 0 0 316px;
    background: linear-gradient(180deg, #1a1730, var(--fx-ink));
    border-radius: 16px;
    padding: 13px 14px 14px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 10px 26px -14px rgba(10, 6, 30, .9);
    overflow: hidden;
}

.fmx-demo__bar {
    display: flex;
    gap: 5px;
    margin-bottom: 11px;
}

.fmx-demo__bar i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .16);
}

.fmx-demo__prompt {
    font: 12.5px/1.5 'Consolas', 'SF Mono', 'Menlo', monospace;
    color: #cfc9f2;
    white-space: nowrap;
    overflow: hidden;
    border-right: 2px solid var(--fx-accent-2);
    width: 0;
    animation: fxType 7s steps(34) infinite;
}

@keyframes fxType {
    0%       { width: 0 }
    18%, 88% { width: 100% }
    100%     { width: 0 }
}

/* рамка результата: сначала «генерация», потом картинка */
.fmx-stage {
    position: relative;
    margin-top: 11px;
    border-radius: 12px;
    overflow: hidden;
    background: #17142a;
}

.fmx-stage img {
    display: block;
    width: 100%;
    /* высоту держим фиксированной: иначе блок вырастает на пол-экрана
       и выталкивает контент страницы */
    height: 188px;
    object-fit: cover;
    opacity: 0;
    transform: scale(1.05);
    filter: blur(16px) saturate(1.3);
    animation: fxReveal 7s cubic-bezier(.22, .61, .36, 1) infinite;
}

/* картинка проявляется, будто её дорисовывает нейросеть */
@keyframes fxReveal {
    0%, 26% { opacity: 0; transform: scale(1.05); filter: blur(16px) saturate(1.3) }
    46%     { opacity: 1; transform: scale(1);    filter: blur(0)    saturate(1) }
    88%     { opacity: 1; transform: scale(1);    filter: blur(0)    saturate(1) }
    100%    { opacity: 0; transform: scale(1.02); filter: blur(10px) saturate(1.2) }
}

/* полоска «идёт генерация» — живёт только до появления картинки */
.fmx-progress {
    position: absolute;
    left: 12px;
    right: 12px;
    top: 50%;
    height: 3px;
    margin-top: -1px;
    border-radius: 3px;
    background: rgba(255, 255, 255, .12);
    overflow: hidden;
    animation: fxProgressBox 7s linear infinite;
}

.fmx-progress i {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--fx-accent), var(--fx-accent-2));
    animation: fxProgress 7s ease-in-out infinite;
}

@keyframes fxProgressBox {
    0%, 40%   { opacity: 1 }
    46%, 100% { opacity: 0 }
}

@keyframes fxProgress {
    0%        { width: 0 }
    18%       { width: 12% }
    40%       { width: 96% }
    46%, 100% { width: 100% }
}

/* кнопка воспроизведения поверх кадра — для видео-оффера */
.fmx-play {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 52px;
    height: 52px;
    margin: -26px 0 0 -26px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .16);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .35), 0 10px 24px rgba(0, 0, 0, .45);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: fxPlay 7s ease infinite;
}

.fmx-play::before {
    content: '';
    border-style: solid;
    border-width: 9px 0 9px 15px;
    border-color: transparent transparent transparent #fff;
    margin-left: 4px;
}

@keyframes fxPlay {
    0%, 42%  { opacity: 0; transform: scale(.9) }
    52%, 88% { opacity: 1; transform: scale(1) }
    100%     { opacity: 0; transform: scale(.96) }
}

/* таймлайн под кадром видео */
.fmx-timeline {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 11px;
    height: 3px;
    border-radius: 3px;
    background: rgba(255, 255, 255, .22);
    overflow: hidden;
    opacity: 0;
    animation: fxPlay 7s ease infinite;
}

.fmx-timeline i {
    display: block;
    height: 100%;
    width: 38%;
    background: #fff;
    border-radius: inherit;
}

/* карточка трека для музыкального оффера */
.fmx-track {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-top: 11px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 12px;
    opacity: 0;
    animation: fxReveal 7s ease infinite;
}

.fmx-track img {
    width: 42px;
    height: 42px;
    border-radius: 9px;
    flex: none;
    box-shadow: 0 6px 14px -6px rgba(0, 0, 0, .8);
}

.fmx-track__name {
    font: 600 12.5px/1.3 inherit;
    color: #fff;
}

.fmx-track__meta {
    font: 11.5px/1.3 inherit;
    color: #8e88b4;
    margin-top: 3px;
}

.fmx-eq {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 22px;
    margin-left: auto;
}

.fmx-eq i {
    width: 3px;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--fx-accent-2), var(--fx-accent));
    animation: fxEq .95s ease-in-out infinite;
}

.fmx-eq i:nth-child(2) { animation-delay: .16s }
.fmx-eq i:nth-child(3) { animation-delay: .32s }
.fmx-eq i:nth-child(4) { animation-delay: .48s }

@keyframes fxEq {
    0%, 100% { height: 6px }
    50%      { height: 20px }
}

/* ответ ассистента для чат-оффера */
.fmx-msg {
    margin-top: 11px;
    padding: 11px 13px;
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 12px;
    font: 12.5px/1.55 inherit;
    color: #ddd9f2;
    opacity: 0;
    animation: fxReveal 7s ease infinite;
}

.fmx-msg b {
    color: var(--fx-accent-2);
    font-weight: 600;
}

/* ---------- правая часть ---------- */

.fmx-body {
    flex: 1 1 auto;
    min-width: 0;
}

.fmx-kicker {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font: 600 10.5px/1 inherit;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--fx-accent);
    background: linear-gradient(135deg, rgba(124, 92, 255, .12), rgba(34, 211, 238, .1));
    border-radius: 100px;
    padding: 7px 13px;
}

.fmx-title {
    margin: 14px 0 0;
    font: 700 23px/1.26 inherit;
    letter-spacing: -.015em;
    color: var(--fx-ink);
}

.fmx-sub {
    margin: 9px 0 0;
    font: 14.5px/1.55 inherit;
    color: #66627f;
}

.fmx-cta {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
    padding: 13px 26px;
    border-radius: 100px;
    background: linear-gradient(135deg, var(--fx-accent), #5b8cff 90%);
    color: #fff;
    font: 600 14.5px/1 inherit;
    box-shadow: 0 10px 24px -8px rgba(124, 92, 255, .75);
    overflow: hidden;
    transition: box-shadow .3s ease;
}

/* мягкий блик по кнопке */
.fmx-cta::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: -60%;
    width: 40%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent);
    transform: skewX(-18deg);
    animation: fxShine 4.5s ease-in-out infinite;
}

@keyframes fxShine {
    0%, 55%   { left: -60% }
    80%, 100% { left: 130% }
}

.fmx__hit:hover .fmx-cta {
    box-shadow: 0 14px 30px -8px rgba(124, 92, 255, .9);
}

.fmx-cta svg {
    transition: transform .3s ease;
}

.fmx__hit:hover .fmx-cta svg {
    transform: translateX(4px);
}

/* ---------- мобильные ---------- */

@media (max-width: 720px) {
    .fmx-card {
        flex-direction: column;
        align-items: stretch;
        gap: 18px;
        padding: 18px;
        border-radius: 18px;
    }

    .fmx-demo { flex: none; width: 100% }

    .fmx-title { font-size: 19px }
    .fmx-sub   { font-size: 14px }
    .fmx-cta   { width: 100%; justify-content: center; padding: 14px 20px }

    /* длинный запрос упирался в край окна */
    .fmx-demo__prompt { font-size: 11.5px }
}

@media (prefers-reduced-motion: reduce) {
    .fmx-demo__prompt,
    .fmx-stage img,
    .fmx-track,
    .fmx-msg,
    .fmx-eq i,
    .fmx-play,
    .fmx-timeline,
    .fmx-cta::after {
        animation: none;
    }
    .fmx-demo__prompt { width: 100%; border-right: 0 }
    .fmx-stage img,
    .fmx-track,
    .fmx-msg,
    .fmx-play,
    .fmx-timeline { opacity: 1; filter: none; transform: none }
    .fmx-progress { display: none }
}

/* тёмная тема сайта, если включена */
html.dark .fmx-card,
body.dark .fmx-card {
    background: linear-gradient(180deg, #1d1a33, #171429);
}

html.dark .fmx-title,
body.dark .fmx-title { color: #f3f1ff }

html.dark .fmx-sub,
body.dark .fmx-sub { color: #a6a1c6 }
