/* === WOW-EFFECTS.CSS ===
   market.ai-platform.space
   НАЗНАЧЕНИЕ: Премиум интерактивные эффекты - типографика, ripple, tilt,
               particles, spotlight, scroll progress, magnetic
   РАЗМЕР: ~500 строк
*/

/* ============================================================
   TYPEWRITER (мигающий курсор после слова)
============================================================ */
/* Typewriter — отдельная строка с зафиксированной высотой (anti-jitter).
   Слово печатается в собственной строке: min-height резервирует место,
   ширина контейнера фиксируется JS под самое длинное слово. */
.mkt-typewriter-row {
    display: block;
    min-height: 1.15em;       /* высота 1 строки заголовка */
    line-height: 1.15;
    overflow: hidden;
}
.mkt-typewriter {
    color: var(--gold);
    font-weight: 800;
    position: relative;
    white-space: nowrap;
    display: inline-block;
    vertical-align: top;
    min-width: 1ch;           /* всегда есть место под курсор */
    min-height: 1.15em;
}
.mkt-typewriter::after {
    content: '';
    display: inline-block;
    width: 3px;
    height: 0.9em;
    background: var(--gold);
    margin-left: 4px;
    vertical-align: -0.05em;
    animation: mkt-blink 1s steps(2) infinite;
    border-radius: 2px;
}
@keyframes mkt-blink {
    50% { opacity: 0; }
}

/* ============================================================
   BUTTON HOVER — мягкое выделение вместо magnetic prygania.
   Убран data-magnetic transform (раздражал).
   Сейчас: лёгкий lift + усиление shadow + brightness.
============================================================ */
.mkt-btn,
.mkt-btn-primary,
.mkt-btn-ghost,
.mkt-btn-glow {
    transition:
        transform 0.2s ease-out,
        box-shadow 0.25s ease-out,
        background-color 0.25s ease-out,
        border-color 0.25s ease-out,
        color 0.25s ease-out,
        filter 0.25s ease-out;
    will-change: transform, box-shadow;
}
.mkt-btn:hover {
    transform: translateY(-2px);
}
.mkt-btn-primary:hover,
.mkt-btn-glow:hover {
    filter: brightness(1.08);
    box-shadow:
        0 10px 28px -6px color-mix(in srgb, var(--gold) 55%, transparent),
        0 0 0 1px color-mix(in srgb, var(--gold) 35%, transparent) inset;
}
.mkt-btn-ghost:hover {
    border-color: color-mix(in srgb, var(--gold) 60%, var(--border));
    color: var(--text-primary);
    background: color-mix(in srgb, var(--gold) 8%, transparent);
}
.mkt-btn:active {
    transform: translateY(0);
    transition-duration: 0.05s;
}

/* ============================================================
   RIPPLE effect on click
============================================================ */
.mkt-btn-primary,
.mkt-btn-glow,
[data-ripple] {
    position: relative;
    overflow: hidden;
}
.mkt-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.45);
    transform: scale(0);
    pointer-events: none;
    animation: mkt-ripple 0.65s var(--ease-out-quart, cubic-bezier(0.25, 1, 0.5, 1));
    z-index: 1;
}
html.light-theme .mkt-ripple {
    background: rgba(255, 255, 255, 0.7);
}
@keyframes mkt-ripple {
    to {
        transform: scale(2.5);
        opacity: 0;
    }
}

/* ============================================================
   3D TILT cards
============================================================ */
[data-tilt] {
    transform-style: preserve-3d;
    transition: transform 0.18s ease-out;
    will-change: transform;
}
[data-tilt]:hover {
    z-index: 5;
}

/* ============================================================
   STAGGER REVEAL (одна за другой)
============================================================ */
.mkt-stagger > * {
    opacity: 0;
    transform: translateY(24px);
    transition:
        opacity 0.7s var(--ease-out-quart, cubic-bezier(0.25, 1, 0.5, 1)),
        transform 0.7s var(--ease-out-quart, cubic-bezier(0.25, 1, 0.5, 1));
}
.mkt-stagger > *.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================================
   PARTICLES container
============================================================ */
[data-particles] {
    position: relative;
}
.mkt-particles-canvas {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.7;
}
html.light-theme .mkt-particles-canvas { opacity: 0.4; }

/* ============================================================
   SCROLL PROGRESS bar (вверху страницы)
============================================================ */
.mkt-scroll-progress {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--gold), var(--electric));
    transform-origin: left center;
    transform: scaleX(0);
    z-index: 1000;
    box-shadow: 0 1px 8px color-mix(in srgb, var(--gold) 50%, transparent);
    pointer-events: none;
}

/* ============================================================
   HEADER SHRINK при скролле
============================================================ */
.mkt-header {
    transition:
        padding 0.3s var(--ease-out-quart, cubic-bezier(0.25, 1, 0.5, 1)),
        background 0.3s ease,
        backdrop-filter 0.3s ease,
        box-shadow 0.3s ease;
}
.mkt-header.is-scrolled {
    padding: 8px 0;
    background: color-mix(in srgb, var(--bg-primary) 92%, transparent);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    box-shadow: 0 4px 24px -8px rgba(0, 0, 0, 0.5);
}
html.light-theme .mkt-header.is-scrolled {
    background: color-mix(in srgb, #f0ece4 95%, transparent);
    box-shadow: 0 4px 24px -8px rgba(80, 60, 30, 0.18);
}

/* ============================================================
   CARD SPOTLIGHT - спотлайт при hover
============================================================ */
.mkt-card.service-card,
.mkt-bundle-card,
[data-spotlight] {
    --mx: 50%;
    --my: 50%;
    position: relative;
    isolation: isolate;
}
.mkt-card.service-card::after,
[data-spotlight]::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(
        500px circle at var(--mx) var(--my),
        color-mix(in srgb, var(--gold) 12%, transparent),
        transparent 40%
    );
    opacity: 0;
    transition: opacity 0.4s var(--ease-out-quart, cubic-bezier(0.25, 1, 0.5, 1));
    pointer-events: none;
    z-index: 1;
}
.mkt-card.service-card:hover::after,
[data-spotlight]:hover::after {
    opacity: 1;
}
.mkt-card.service-card > *,
[data-spotlight] > * {
    position: relative;
    z-index: 2;
}

/* ============================================================
   FLOATING animation для иконок/декора
============================================================ */
@keyframes mkt-float-y {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-8px); }
}
.mkt-floating {
    animation: mkt-float-y 4s ease-in-out infinite;
}

/* ============================================================
   GRADIENT TEXT shine animation
============================================================ */
@keyframes mkt-shine {
    0%   { background-position: -200% center; }
    100% { background-position: 200% center; }
}

/* ============================================================
   GLOW pulse при появлении первого fold
============================================================ */
.mkt-hero-orb-1,
.mkt-hero-orb-2 {
    will-change: transform, filter;
}

/* ============================================================
   IMPROVED reveal с blur (cinematic)
============================================================ */
html.js-ready .reveal {
    filter: blur(8px);
    transition:
        opacity 0.7s var(--ease-out-quart, cubic-bezier(0.25, 1, 0.5, 1)),
        transform 0.7s var(--ease-out-quart, cubic-bezier(0.25, 1, 0.5, 1)),
        filter 0.7s var(--ease-out-quart, cubic-bezier(0.25, 1, 0.5, 1));
}
html.js-ready .reveal.is-visible,
html.js-ready .reveal.visible {
    filter: blur(0);
}

/* ============================================================
   MARQUEE усилен - категории второй лентой обратно
============================================================ */
.mkt-trust-strip {
    padding: 28px 0 20px !important;
}
.mkt-trust-marquee + .mkt-trust-marquee {
    margin-top: 14px;
}
.mkt-trust-marquee.reverse .mkt-trust-track {
    animation-direction: reverse;
    animation-duration: 60s;
}
.mkt-trust-marquee.reverse .mkt-trust-item {
    color: color-mix(in srgb, var(--electric) 70%, var(--text-muted));
    font-size: 14px;
}
.mkt-trust-marquee.reverse .mkt-trust-item:hover {
    color: var(--electric);
}

/* ============================================================
   SECTION dividers (SVG волны)
============================================================ */
.mkt-divider-wave {
    position: relative;
    height: 60px;
    margin: -1px 0;
    background: var(--bg-primary);
    overflow: hidden;
}
.mkt-divider-wave svg {
    position: absolute;
    bottom: 0; left: 0;
    width: 100%;
    height: 100%;
}
.mkt-divider-wave path {
    fill: var(--bg-secondary);
}

/* ============================================================
   BUTTON arrow slide animation
============================================================ */
.mkt-btn-primary svg,
.mkt-btn-glow svg {
    transition: transform 0.3s var(--ease-out-quart, cubic-bezier(0.25, 1, 0.5, 1));
}
.mkt-btn-primary:hover svg,
.mkt-btn-glow:hover svg {
    transform: translateX(5px);
}

/* ============================================================
   CHAT FAB - pulsing attention ring при первом появлении
============================================================ */
.mkt-chat-fab {
    position: fixed;
}
.mkt-chat-fab::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid var(--gold);
    opacity: 0;
    animation: mkt-fab-pulse 3s ease-out infinite;
    animation-delay: 2s;
    pointer-events: none;
}
@keyframes mkt-fab-pulse {
    0%   { transform: scale(0.95); opacity: 0; }
    20%  { opacity: 0.6; }
    100% { transform: scale(1.6); opacity: 0; }
}
html.light-theme .mkt-chat-fab::before {
    border-color: #b8860b;
}

/* ============================================================
   STATS hover - подсветка числа золотом
============================================================ */
.mkt-stat {
    cursor: default;
    transition: transform 0.25s var(--ease-out-quart, cubic-bezier(0.25, 1, 0.5, 1));
}
.mkt-stat:hover {
    transform: translateY(-3px);
}
.mkt-stat-value {
    transition: color 0.25s ease, text-shadow 0.25s ease;
}
.mkt-stat:hover .mkt-stat-value {
    text-shadow: 0 0 20px color-mix(in srgb, var(--gold) 60%, transparent);
}

/* ============================================================
   QUIZ card glow на 1-м месте
============================================================ */
.mkt-quiz-card-top1 {
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--gold) 4%, var(--bg-card)),
        var(--bg-card) 60%) !important;
    border-color: color-mix(in srgb, var(--gold) 30%, var(--border)) !important;
}
.mkt-quiz-card-top1::before {
    background: linear-gradient(180deg, var(--gold), #ff9500) !important;
}

/* ============================================================
   BUNDLES - subtle scale on hover
============================================================ */
.mkt-bundle-card:not(.mkt-bundle-featured):hover {
    transform: translateY(-4px) scale(1.01);
}

/* ============================================================
   HERO PULSE усилен
============================================================ */
.mkt-hero-pulse {
    animation: mkt-pulse-fade-in 0.6s var(--ease-out-quart, cubic-bezier(0.25, 1, 0.5, 1)) 0.2s backwards;
}
@keyframes mkt-pulse-fade-in {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Hero title - cinematic entrance */
.mkt-hero-title {
    animation: mkt-hero-in 1s var(--ease-out-quart, cubic-bezier(0.25, 1, 0.5, 1)) 0.4s backwards;
}
.mkt-hero-subtitle {
    animation: mkt-hero-in 1s var(--ease-out-quart, cubic-bezier(0.25, 1, 0.5, 1)) 0.6s backwards;
}
.mkt-hero-cta {
    animation: mkt-hero-in 1s var(--ease-out-quart, cubic-bezier(0.25, 1, 0.5, 1)) 0.8s backwards;
}
.mkt-hero-meta {
    animation: mkt-hero-in 1s var(--ease-out-quart, cubic-bezier(0.25, 1, 0.5, 1)) 1s backwards;
}
.mkt-stats {
    animation: mkt-hero-in 1s var(--ease-out-quart, cubic-bezier(0.25, 1, 0.5, 1)) 1.2s backwards;
}
.mkt-hero-visual {
    animation: mkt-hero-visual-in 1.2s var(--ease-out-quart, cubic-bezier(0.25, 1, 0.5, 1)) 0.5s backwards;
}
@keyframes mkt-hero-in {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes mkt-hero-visual-in {
    from { opacity: 0; transform: translateX(40px) scale(0.95); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}

/* ============================================================
   SECTION TITLE underline glow
============================================================ */
.mkt-section-title {
    position: relative;
    display: inline-block;
}
.mkt-section-title::after {
    content: '';
    display: block;
    margin: 12px auto 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    border-radius: 3px;
    box-shadow: 0 0 12px color-mix(in srgb, var(--gold) 50%, transparent);
}

/* ============================================================
   REDUCED MOTION fallback
============================================================ */
@media (prefers-reduced-motion: reduce) {
    .mkt-typewriter::after,
    .mkt-chat-fab::before,
    .mkt-floating,
    .mkt-particles-canvas {
        animation: none !important;
    }
    .mkt-hero-pulse,
    .mkt-hero-title,
    .mkt-hero-subtitle,
    .mkt-hero-cta,
    .mkt-hero-meta,
    .mkt-stats,
    .mkt-hero-visual {
        animation: none !important;
        opacity: 1;
        transform: none;
    }
    [data-tilt] { transition: none !important; }
    .mkt-stagger > * { opacity: 1; transform: none; }
    html.js-ready .reveal { filter: none; }
}

/* ============================================================
   MOBILE - убираем тяжелые эффекты
============================================================ */
@media (max-width: 768px) {
    .mkt-particles-canvas { display: none; }
    [data-tilt]:hover { transform: none !important; }
    .mkt-hero-orb-1,
    .mkt-hero-orb-2 { opacity: 0.25 !important; }
}
