/* ============================================================================
 * hero_mesh.css — RADICAL visual refresh of the hero block.
 *
 * Содержит:
 *   1. Animated gradient mesh background (5 blobs + film grain).
 *   2. Dramatic H1 typography (.h1-bold + .h1-light).
 *   3. 3D verdict-card stack (right column augmentation).
 *   4. Live-data ticker (marquee strip).
 *   5. Magnetic primary CTA polish.
 *   6. Choreographed entrance pre-state (opacity:0 → JS reveals).
 *
 * Все цвета через CSS-variables — работает на всех 6 темах.
 * prefers-reduced-motion: reduce — все анимации отключаются.
 * ========================================================================== */


/* ────────────────────────────────────────────────────────────────────────────
 *  1. Animated gradient mesh background
 * ──────────────────────────────────────────────────────────────────────────── */

/* .hero уже имеет position:relative + overflow:hidden в style.css, поэтому
   blob-ы внутри не вылезают за границы. .hero::before/::after уже заняты
   старыми orb-градиентами — мы накладываем НАШИ blob-ы поверх через
   отдельный .hero-mesh контейнер (z-index 0, под .hero > * z-index 1). */
.hero-mesh {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    /* Поверх старого hero::before-orb, но под контентом. */
}

.hero-mesh::before,
.hero-mesh::after,
.hero-mesh-blob {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(64px);
    mix-blend-mode: screen;
    will-change: transform;
    opacity: 0.55;
}

/* Blob 1 — main accent, top-left */
.hero-mesh::before {
    width: 720px;
    height: 720px;
    top: -180px;
    left: -160px;
    background: radial-gradient(circle at 50% 50%,
        var(--accent) 0%,
        var(--accent) 18%,
        transparent 62%);
    animation: pb-blob-drift-1 32s ease-in-out infinite alternate;
}

/* Blob 2 — secondary accent, bottom-right */
.hero-mesh::after {
    width: 640px;
    height: 640px;
    bottom: -200px;
    right: -120px;
    background: radial-gradient(circle at 50% 50%,
        var(--accent-2) 0%,
        var(--accent-2) 16%,
        transparent 60%);
    animation: pb-blob-drift-2 38s ease-in-out infinite alternate;
}

/* Blob 3 — cool accent, mid-right */
.hero-mesh-blob-3 {
    width: 540px;
    height: 540px;
    top: 22%;
    right: 8%;
    background: radial-gradient(circle at 50% 50%,
        var(--accent-3) 0%,
        var(--accent-3) 14%,
        transparent 58%);
    animation: pb-blob-drift-3 28s ease-in-out infinite alternate;
    opacity: 0.42;
}

/* Blob 4 — third accent, low-center */
.hero-mesh-blob-4 {
    width: 480px;
    height: 480px;
    bottom: -80px;
    left: 38%;
    background: radial-gradient(circle at 50% 50%,
        var(--accent-4) 0%,
        var(--accent-4) 18%,
        transparent 62%);
    animation: pb-blob-drift-4 34s ease-in-out infinite alternate;
    opacity: 0.38;
}

/* Blob 5 — micro highlight, top-right corner */
.hero-mesh-blob-5 {
    width: 320px;
    height: 320px;
    top: -40px;
    right: 22%;
    background: radial-gradient(circle at 50% 50%,
        var(--accent-hi, var(--accent)) 0%,
        var(--accent-hi, var(--accent)) 20%,
        transparent 60%);
    animation: pb-blob-drift-5 24s ease-in-out infinite alternate;
    opacity: 0.32;
}

/* Film-grain overlay — тонкий SVG noise pattern, добавляет «киношную»
   текстуру и скрывает банды на градиентах. ~2.5KB base64. */
.hero-mesh-grain {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.07;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.95 0 0 0 0 0.95 0 0 0 0 0.95 0 0 0 0.6 0'/></filter><rect width='240' height='240' filter='url(%23n)'/></svg>");
    background-size: 240px 240px;
}

@keyframes pb-blob-drift-1 {
    0%   { transform: translate3d(0, 0, 0) scale(1); }
    50%  { transform: translate3d(40px, 30px, 0) scale(1.08); }
    100% { transform: translate3d(80px, -20px, 0) scale(0.96); }
}
@keyframes pb-blob-drift-2 {
    0%   { transform: translate3d(0, 0, 0) scale(1); }
    50%  { transform: translate3d(-50px, -40px, 0) scale(1.1); }
    100% { transform: translate3d(-30px, 40px, 0) scale(0.95); }
}
@keyframes pb-blob-drift-3 {
    0%   { transform: translate3d(0, 0, 0) scale(1) rotate(0deg); }
    50%  { transform: translate3d(-60px, 50px, 0) scale(1.06) rotate(8deg); }
    100% { transform: translate3d(20px, 70px, 0) scale(0.94) rotate(-6deg); }
}
@keyframes pb-blob-drift-4 {
    0%   { transform: translate3d(0, 0, 0) scale(1); }
    50%  { transform: translate3d(70px, -50px, 0) scale(1.12); }
    100% { transform: translate3d(-40px, -30px, 0) scale(0.92); }
}
@keyframes pb-blob-drift-5 {
    0%   { transform: translate3d(0, 0, 0) scale(1); }
    50%  { transform: translate3d(-40px, 60px, 0) scale(1.14); }
    100% { transform: translate3d(50px, 20px, 0) scale(0.9); }
}


/* ────────────────────────────────────────────────────────────────────────────
 *  2. Dramatic H1 typography
 * ──────────────────────────────────────────────────────────────────────────── */

.hero-copy h1 {
    /* v0.25.97: размер уменьшен 56-120 → 48-86px. Юзер: «на ПК сделал хуже» —
       120px H1 был с гигантской пустотой между ним и формой. Делаем компактнее
       чтобы content-density выше, eye-flow корректный. */
    font-size: clamp(48px, 6.8vw, 86px) !important;
    line-height: 0.98;
    letter-spacing: -0.028em;
    margin: 0 0 20px;
    font-feature-settings: "ss01", "cv11", "tnum";
    text-wrap: balance;
}

@media (min-width: 1440px) {
    .hero-copy h1 {
        font-size: clamp(60px, 5.6vw, 92px) !important;
    }
}

/* Жирная часть — «Пробей товар» */
.hero-copy h1 .h1-bold {
    font-weight: 900;
    letter-spacing: -0.045em;
    color: var(--text);
    /* Subtle text-shadow для глубины на mesh-фоне. */
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* Лёгкая курсивная часть — «до того, как заплатишь» */
.hero-copy h1 .h1-light {
    font-weight: 300;
    font-style: italic;
    letter-spacing: -0.018em;
    background: var(--grad-hot);
    -webkit-background-clip: text;
            background-clip: text;
    -webkit-text-fill-color: transparent;
            color: transparent;
    /* Чтобы не «слипалось» с bold-частью — отдельный inline-baseline. */
    display: inline;
}

/* sweep-эффект на .h1-light (заменяет старый .accent::after) */
.hero-copy h1 .h1-light::after {
    /* Не используем — sweep работает на старом .accent в style.css, мы
       просто переиспользуем тот класс если он будет в DOM. На .h1-light
       sweep можно добавить позже через GSAP. */
}

/* v0.27.22 (SEO Wave 1): keyword-loaded subtitle под главным H1.
   «на Wildberries, Ozon, Я.Маркете и Мегамаркете» — visual: чуть мельче чем
   .h1-bold (~55%), с gradient-fill (var(--grad-hot)) для премиум-effect'а.
   Запас читаемости: line-height сжат до 1.15 чтобы не разрывал hero. */
.hero-copy h1 .h1-mp {
    display: block;
    margin-top: 6px;
    font-weight: 600;
    font-size: 0.55em;
    line-height: 1.15;
    letter-spacing: -0.015em;
    background: var(--grad-hot);
    -webkit-background-clip: text;
            background-clip: text;
    -webkit-text-fill-color: transparent;
            color: transparent;
}
@media (max-width: 720px) {
    .hero-copy h1 .h1-mp {
        font-size: 0.58em;
        margin-top: 4px;
    }
}


/* ────────────────────────────────────────────────────────────────────────────
 *  3. 3D verdict-card stack
 * ──────────────────────────────────────────────────────────────────────────── */

/* v0.25.97: hero-stack скрыта на десктопе — на скрине юзера она конкурировала
   с phone-frame (оба показывают verdict+%) и съедала vertical-space без пользы.
   Phone-frame с живой Investigation-анимацией — главный визуал. Card-стопка
   остаётся как fallback на mobile когда phone-frame скрыт. */
.hero-stack {
    display: none;
}
@media (max-width: 720px) {
    .hero-stack {
        display: block;
        position: relative;
        width: 100%;
        max-width: 340px;
        height: 380px;
        margin: 32px auto 0;
        perspective: 1400px;
        transform-style: preserve-3d;
        pointer-events: auto;
    }
}
.hero-stack-base {
    position: relative;
    width: 100%;
    max-width: 340px;
    height: 380px;
    margin: 32px auto 0;
    perspective: 1400px;
    transform-style: preserve-3d;
    pointer-events: auto;
}

.hero-stack-card {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 280px;
    min-height: 124px;
    margin: -62px 0 0 -140px;
    padding: 14px 16px 14px 14px;
    border-radius: 18px;
    background: var(--surface);
    border: 1px solid var(--border-2);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.06) inset,
        0 20px 40px -16px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(255, 255, 255, 0.04);
    transition: transform 380ms cubic-bezier(.2, .8, .2, 1),
                box-shadow 380ms ease;
    transform-style: preserve-3d;
    will-change: transform;
    cursor: default;
}

/* Glow tint behind each card — semantic accent. */
.hero-stack-card::before {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: 20px;
    z-index: -1;
    opacity: 0.55;
    filter: blur(22px);
    pointer-events: none;
    transition: opacity 380ms ease;
}

.hero-stack-card.is-good::before {
    background: radial-gradient(60% 80% at 50% 50%, var(--good) 0%, transparent 70%);
}
.hero-stack-card.is-warn::before {
    background: radial-gradient(60% 80% at 50% 50%, var(--warn) 0%, transparent 70%);
}
.hero-stack-card.is-bad::before {
    background: radial-gradient(60% 80% at 50% 50%, var(--bad) 0%, transparent 70%);
}

/* Базовая раскладка fan — top/mid/bottom. JS перетирает transform через
   inline-style, эти правила — fallback если JS не запустился. */
.hero-stack-card[data-card="top"] {
    transform: translate3d(-32px, -84px, 60px) rotate(-5deg);
    z-index: 3;
}
.hero-stack-card[data-card="mid"] {
    transform: translate3d(0, 0, 0) rotate(0deg);
    z-index: 2;
}
.hero-stack-card[data-card="bottom"] {
    transform: translate3d(32px, 84px, -60px) rotate(5deg);
    z-index: 1;
    opacity: 0.92;
}

/* Header — marketplace pill + verdict icon */
.hero-stack-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}
.hero-stack-mp {
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-dim);
}
.hero-stack-mp.mp-wb   { color: #ff7eb3; border-color: rgba(255, 126, 179, 0.35); background: rgba(255, 126, 179, 0.08); }
.hero-stack-mp.mp-oz   { color: #82a3ff; border-color: rgba(130, 163, 255, 0.35); background: rgba(130, 163, 255, 0.08); }
.hero-stack-mp.mp-ym   { color: #ffd158; border-color: rgba(255, 209, 88, 0.35);  background: rgba(255, 209, 88, 0.08); }
.hero-stack-mp.mp-mm   { color: #84e6c5; border-color: rgba(var(--accent-3-rgb), 0.35); background: rgba(var(--accent-3-rgb), 0.08); }

.hero-stack-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 900;
    line-height: 1;
}
.hero-stack-icon.is-good { background: rgba(56, 224, 168, 0.18);  color: var(--good); box-shadow: 0 0 14px rgba(56, 224, 168, 0.4); }
.hero-stack-icon.is-warn { background: rgba(var(--accent-rgb), 0.18);  color: var(--warn); box-shadow: 0 0 14px rgba(var(--accent-rgb), 0.4); }
.hero-stack-icon.is-bad  { background: rgba(var(--accent-2-rgb), 0.18);  color: var(--bad);  box-shadow: 0 0 14px rgba(var(--accent-2-rgb), 0.4); }

/* Product row */
.hero-stack-prod {
    display: flex;
    align-items: center;
    gap: 10px;
}
.hero-stack-thumb {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    flex: 0 0 38px;
    background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.hero-stack-thumb svg {
    width: 24px;
    height: 24px;
    opacity: 0.55;
}
.hero-stack-info {
    min-width: 0;
    flex: 1;
}
.hero-stack-name {
    font-size: 12.5px;
    line-height: 1.25;
    color: var(--text);
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.hero-stack-meta {
    margin-top: 3px;
    font-size: 10.5px;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 6px;
}
.hero-stack-meta .star { color: var(--accent); }

/* Verdict footer */
.hero-stack-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed rgba(255, 255, 255, 0.07);
}
.hero-stack-pct {
    font-size: 22px;
    font-weight: 900;
    line-height: 1;
    font-feature-settings: "tnum";
    letter-spacing: -0.02em;
}
.hero-stack-pct.is-good { color: var(--good); }
.hero-stack-pct.is-warn { color: var(--warn); }
.hero-stack-pct.is-bad  { color: var(--bad); }
.hero-stack-pct sub {
    font-size: 11px;
    font-weight: 700;
    opacity: 0.7;
    margin-left: 2px;
    vertical-align: baseline;
}

.hero-stack-badge {
    font-size: 10.5px;
    font-weight: 800;
    padding: 5px 10px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.hero-stack-badge.is-good { background: rgba(56, 224, 168, 0.14);  color: var(--good); border: 1px solid rgba(56, 224, 168, 0.35); }
.hero-stack-badge.is-warn { background: rgba(var(--accent-rgb), 0.14);  color: var(--warn); border: 1px solid rgba(var(--accent-rgb), 0.35); }
.hero-stack-badge.is-bad  { background: rgba(var(--accent-2-rgb), 0.14);  color: var(--bad);  border: 1px solid rgba(var(--accent-2-rgb), 0.35); }

/* Pre-reveal state — JS снимает .is-pre после GSAP timeline. */
.hero-stack.is-pre .hero-stack-card {
    opacity: 0;
    transform: translate3d(60px, 80px, 0) rotate(8deg);
}


/* ────────────────────────────────────────────────────────────────────────────
 *  4. Live data ticker
 * ──────────────────────────────────────────────────────────────────────────── */

.hero-ticker {
    position: relative;
    margin: 28px 0 6px;
    overflow: hidden;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background:
        linear-gradient(90deg,
            rgba(255, 255, 255, 0.02) 0%,
            rgba(255, 255, 255, 0.05) 50%,
            rgba(255, 255, 255, 0.02) 100%);
    height: 44px;
    display: flex;
    align-items: center;
    opacity: 0;
    transition: opacity .6s ease;
}
.hero-ticker.is-ready { opacity: 1; }

/* Edge fade — soft mask on both sides */
.hero-ticker::before,
.hero-ticker::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 80px;
    z-index: 2;
    pointer-events: none;
}
.hero-ticker::before {
    left: 0;
    background: linear-gradient(90deg, var(--bg) 0%, transparent 100%);
}
.hero-ticker::after {
    right: 0;
    background: linear-gradient(270deg, var(--bg) 0%, transparent 100%);
}

.hero-ticker-track {
    display: flex;
    gap: 36px;
    align-items: center;
    white-space: nowrap;
    will-change: transform;
    animation: pb-marquee 60s linear infinite;
    padding-left: 40px;
}
.hero-ticker:hover .hero-ticker-track,
.hero-ticker:focus-within .hero-ticker-track {
    animation-play-state: paused;
}

.hero-ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dim);
    font-feature-settings: "tnum";
}
.hero-ticker-item .tk-ic {
    font-size: 15px;
    line-height: 1;
    flex: 0 0 auto;
}
.hero-ticker-item .tk-ic.is-good { color: var(--good); filter: drop-shadow(0 0 4px rgba(56,224,168,0.4)); }
.hero-ticker-item .tk-ic.is-warn { color: var(--warn); filter: drop-shadow(0 0 4px rgba(var(--accent-rgb), 0.4)); }
.hero-ticker-item .tk-ic.is-bad  { color: var(--bad);  filter: drop-shadow(0 0 4px rgba(var(--accent-2-rgb), 0.4)); }
.hero-ticker-item .tk-name { color: var(--text); font-weight: 600; }
.hero-ticker-item .tk-dot {
    width: 4px; height: 4px; border-radius: 50%;
    background: rgba(255,255,255,0.25);
    flex: 0 0 4px;
}
.hero-ticker-item .tk-mp {
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-dim);
    opacity: 0.75;
}
.hero-ticker-item .tk-pct {
    font-weight: 800;
    font-feature-settings: "tnum";
}
.hero-ticker-item .tk-pct.is-good { color: var(--good); }
.hero-ticker-item .tk-pct.is-warn { color: var(--warn); }
.hero-ticker-item .tk-pct.is-bad  { color: var(--bad); }
.hero-ticker-item .tk-arrow {
    color: var(--text-dim);
    opacity: 0.55;
    font-weight: 700;
}
.hero-ticker-item .tk-verdict {
    font-weight: 700;
    color: var(--text);
    opacity: 0.85;
}

@keyframes pb-marquee {
    0%   { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-50%, 0, 0); }
}


/* ────────────────────────────────────────────────────────────────────────────
 *  5. Magnetic primary CTA («Пробить →»)
 * ──────────────────────────────────────────────────────────────────────────── */

.check-form.check-form-hero button#submit-btn {
    position: relative;
    min-height: 56px;
    padding: 0 28px;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.005em;
    overflow: hidden;
    transition:
        transform 220ms cubic-bezier(.2, .8, .2, 1),
        box-shadow 320ms ease,
        background 220ms ease;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.18) inset,
        0 10px 28px -8px rgba(var(--accent-rgb), 0.55),
        0 18px 48px -16px rgba(var(--accent-2-rgb), 0.45),
        0 0 0 1px rgba(var(--accent-rgb), 0.25);
    will-change: transform;
    animation: pb-cta-breath 4.2s ease-in-out infinite;
}
.check-form.check-form-hero button#submit-btn::after {
    /* Glow-follow halo — JS обновляет --pb-mx/--pb-my на mousemove. */
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(
        220px circle at var(--pb-mx, 50%) var(--pb-my, 50%),
        rgba(255, 255, 255, 0.36) 0%,
        rgba(255, 255, 255, 0.05) 35%,
        transparent 70%);
    opacity: 0;
    transition: opacity 240ms ease;
    mix-blend-mode: overlay;
    border-radius: inherit;
}
.check-form.check-form-hero button#submit-btn:hover::after,
.check-form.check-form-hero button#submit-btn:focus-visible::after {
    opacity: 1;
}
.check-form.check-form-hero button#submit-btn:hover {
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.22) inset,
        0 14px 36px -10px rgba(var(--accent-rgb), 0.7),
        0 24px 60px -18px rgba(var(--accent-2-rgb), 0.6),
        0 0 0 1px rgba(var(--accent-rgb), 0.4);
}
.check-form.check-form-hero button#submit-btn:active {
    transform: scale(0.97);
}

@keyframes pb-cta-breath {
    0%, 100% { box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.18) inset,
        0 10px 28px -8px rgba(var(--accent-rgb), 0.55),
        0 18px 48px -16px rgba(var(--accent-2-rgb), 0.45),
        0 0 0 1px rgba(var(--accent-rgb), 0.25); }
    50%      { box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.22) inset,
        0 12px 34px -8px rgba(var(--accent-rgb), 0.68),
        0 22px 56px -16px rgba(var(--accent-2-rgb), 0.55),
        0 0 0 1px rgba(var(--accent-rgb), 0.35); }
}


/* ────────────────────────────────────────────────────────────────────────────
 *  6. Choreographed entrance — pre-reveal state
 * ──────────────────────────────────────────────────────────────────────────── */

/* JS снимет эти классы в правильной последовательности. Если JS не запустился
   (no-js / GSAP не загрузился) — `pb-hero-ready` class на <body> добавит fallback.
   FOUC safety-net: keyframes `pb-fouc-rescue` сама поднимет opacity через 3s
   независимо от JS. */
.pb-hero-pre .hero-copy .lead,
.pb-hero-pre .hero-copy .check-form-hero,
.pb-hero-pre .hero-copy .hero-mp-row,
.pb-hero-pre .hero-copy .hero-cta-row {
    opacity: 0;
    transform: translate3d(0, 18px, 0);
    transition: none;
    animation: pb-fouc-rescue 3.6s 2.6s forwards;
}
.pb-hero-ready .hero-copy .lead,
.pb-hero-ready .hero-copy .check-form-hero,
.pb-hero-ready .hero-copy .hero-mp-row,
.pb-hero-ready .hero-copy .hero-cta-row {
    opacity: 1;
    transform: none;
    transition:
        opacity 700ms cubic-bezier(.2, .8, .2, 1),
        transform 700ms cubic-bezier(.2, .8, .2, 1);
    animation: none;
}
@keyframes pb-fouc-rescue {
    0%   { opacity: 0; transform: translate3d(0, 18px, 0); }
    100% { opacity: 1; transform: none; }
}

/* Ticker fade-in. JS добавит is-ready через ~2s timeline-tick. */
.hero-ticker { opacity: 0; }
.hero-ticker.is-ready { opacity: 1; }


/* ────────────────────────────────────────────────────────────────────────────
 *  Responsive — Mobile fallbacks
 * ──────────────────────────────────────────────────────────────────────────── */

@media (max-width: 1060px) {
    .hero-stack {
        max-width: 320px;
        height: 340px;
        margin-top: 16px;
    }
    /* Card stack секондарен относительно phone-frame на 1060px — отдельный
       блок ниже, но всё-ещё видим. */
}

@media (max-width: 900px) {
    /* Mobile: упрощаем mesh — оставляем 2 blob'а (главный + один из углов). */
    .hero-mesh-blob-3,
    .hero-mesh-blob-4,
    .hero-mesh-blob-5 {
        display: none;
    }
    .hero-mesh::before { width: 480px; height: 480px; filter: blur(48px); }
    .hero-mesh::after  { width: 420px; height: 420px; filter: blur(48px); }

    .hero-copy h1 {
        font-size: clamp(40px, 11vw, 64px) !important;
        line-height: 1.0;
    }
    .hero-copy h1 .h1-bold { letter-spacing: -0.04em; }
}

@media (max-width: 720px) {
    /* v0.25.96: расширили breakpoint с 640 до 720 — на iPad mini portrait stack
       не помещался красиво (300px ширина колонки). Now: ОДНА карточка («top» =
       «Можно брать», оптимистичный hero anchor), две скрываем. */
    .hero-stack {
        max-width: 100%;
        height: 200px;
        margin: 8px auto 0;
    }
    .hero-stack-card[data-card="mid"],
    .hero-stack-card[data-card="bottom"] {
        display: none;
    }
    .hero-stack-card[data-card="top"] {
        transform: translate3d(0, 0, 0) rotate(0deg) !important;
        position: relative;
        left: auto;
        top: auto;
        margin: 0 auto;
        width: 100%;
        max-width: 320px;
    }

    .hero-ticker { height: 36px; margin: 18px 0 4px; }
    .hero-ticker-item { font-size: 12px; gap: 8px; }
    .hero-ticker-track { gap: 22px; padding-left: 24px; animation-duration: 45s; }

    .check-form.check-form-hero button#submit-btn {
        min-height: 50px;
        padding: 0 18px;
        font-size: 15px;
        animation: none; /* breath отключён на mobile, экономия CPU */
    }
}

/* v0.25.96: на 480 и уже — даже single card схлопывается до compact, чтобы
   она не съедала всё пространство ниже hero-text. */
@media (max-width: 480px) {
    .hero-stack {
        height: 170px;
        margin: 4px auto 0;
    }
    .hero-stack-card[data-card="top"] {
        max-width: 280px;
        padding: 12px 14px;
        border-radius: 14px;
    }
    .hero-stack-name { font-size: 12px; }
    .hero-stack-pct { font-size: 20px; }
    .hero-stack-badge { font-size: 10px; padding: 4px 9px; }
    .hero-stack-icon { width: 24px; height: 24px; font-size: 12px; }
    .hero-stack-thumb { width: 34px; height: 34px; flex: 0 0 34px; }
}

/* ────────────────────────────────────────────────────────────────────────────
 *  prefers-reduced-motion gating
 * ──────────────────────────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    .hero-mesh::before,
    .hero-mesh::after,
    .hero-mesh-blob {
        animation: none !important;
    }
    .hero-ticker-track {
        animation: none !important;
        transform: none !important;
    }
    .check-form.check-form-hero button#submit-btn {
        animation: none !important;
    }
    .hero-stack-card {
        transition: none !important;
    }
    .pb-hero-pre .hero-copy .lead,
    .pb-hero-pre .hero-copy .check-form-hero,
    .pb-hero-pre .hero-copy .hero-mp-row,
    .pb-hero-pre .hero-copy .hero-cta-row {
        opacity: 1;
        transform: none;
    }
    .hero-ticker { opacity: 1; }
    .hero-stack.is-pre .hero-stack-card {
        opacity: 1;
        transform: none;
    }
}

/* ────────────────────────────────────────────────────────────────────────────
 *  Low-end devices — JS добавляет .pb-low-end на <body>
 * ──────────────────────────────────────────────────────────────────────────── */

.pb-low-end .hero-mesh-blob-3,
.pb-low-end .hero-mesh-blob-4,
.pb-low-end .hero-mesh-blob-5,
.pb-low-end .hero-mesh-grain {
    display: none;
}
.pb-low-end .hero-mesh::before,
.pb-low-end .hero-mesh::after {
    animation: none;
    filter: blur(40px);
}
.pb-low-end .check-form.check-form-hero button#submit-btn {
    animation: none;
}


/* ────────────────────────────────────────────────────────────────────────────
 *  v0.25.98: Phone-frame ambient halo + floating sparkles
 *  Юзер: «тут хотелось бы поприятнее». Phone-frame стоял в чёрной пустоте,
 *  SPAWNSON GMBH-карточка выглядела холодно. Добавляем атмосферное свечение
 *  и декоративные точки вокруг, чтобы зона ощущалась тепло и живо.
 * ──────────────────────────────────────────────────────────────────────────── */

.hero-preview {
    position: relative;
    isolation: isolate;
}

/* Большой мятный halo за phone-frame — основная ambient-подсветка */
.hero-preview::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 540px;
    height: 540px;
    transform: translate(-50%, -50%);
    background: radial-gradient(
        circle,
        rgba(76, 226, 193, 0.18) 0%,
        rgba(76, 226, 193, 0.06) 28%,
        transparent 64%
    );
    filter: blur(8px);
    pointer-events: none;
    z-index: -1;
    animation: pb-halo-breath 8s ease-in-out infinite;
}

/* Второй halo — accent цвет, контрастирует с первым */
.hero-preview::after {
    content: "";
    position: absolute;
    top: 65%;
    left: 35%;
    width: 380px;
    height: 380px;
    background: radial-gradient(
        circle,
        rgba(var(--accent-rgb), 0.10) 0%,
        rgba(var(--accent-rgb), 0.04) 32%,
        transparent 68%
    );
    filter: blur(12px);
    pointer-events: none;
    z-index: -2;
    animation: pb-halo-breath 11s ease-in-out infinite reverse;
}

@keyframes pb-halo-breath {
    0%, 100% { opacity: 0.85; transform: translate(-50%, -50%) scale(1); }
    50%      { opacity: 1;    transform: translate(-50%, -50%) scale(1.08); }
}

/* Декоративные плавающие точки — добавляют живости вокруг phone-frame */
.hero-preview .pb-sparkle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
    filter: blur(0.5px);
}
.hero-preview .pb-sparkle.s1 {
    top: 8%; left: -4%;
    width: 8px; height: 8px;
    background: var(--accent-3, #7cf0c0);
    box-shadow: 0 0 12px var(--accent-3, #7cf0c0);
    animation: pb-sparkle-drift-a 14s ease-in-out infinite;
}
.hero-preview .pb-sparkle.s2 {
    top: 22%; right: -2%;
    width: 6px; height: 6px;
    background: var(--accent, #ffc94a);
    box-shadow: 0 0 10px var(--accent, #ffc94a);
    animation: pb-sparkle-drift-b 18s ease-in-out infinite;
}
.hero-preview .pb-sparkle.s3 {
    top: 50%; left: -6%;
    width: 5px; height: 5px;
    background: var(--accent-2, #ff5d8f);
    box-shadow: 0 0 8px var(--accent-2, #ff5d8f);
    animation: pb-sparkle-drift-c 16s ease-in-out infinite;
}
.hero-preview .pb-sparkle.s4 {
    bottom: 18%; right: 2%;
    width: 7px; height: 7px;
    background: var(--accent-3, #7cf0c0);
    box-shadow: 0 0 12px var(--accent-3, #7cf0c0);
    animation: pb-sparkle-drift-a 20s ease-in-out infinite 2s;
}
.hero-preview .pb-sparkle.s5 {
    bottom: 6%; left: 12%;
    width: 5px; height: 5px;
    background: var(--accent-4, #8b9cff);
    box-shadow: 0 0 8px var(--accent-4, #8b9cff);
    animation: pb-sparkle-drift-b 22s ease-in-out infinite 1s;
}

@keyframes pb-sparkle-drift-a {
    0%, 100% { transform: translate(0, 0)     scale(1);    opacity: 0.7; }
    25%      { transform: translate(8px, -12px) scale(1.3); opacity: 1;   }
    50%      { transform: translate(-4px, 6px)  scale(0.9); opacity: 0.5; }
    75%      { transform: translate(-10px, -8px) scale(1.1); opacity: 0.9; }
}
@keyframes pb-sparkle-drift-b {
    0%, 100% { transform: translate(0, 0)      scale(1);    opacity: 0.6; }
    33%      { transform: translate(-6px, 10px) scale(0.8); opacity: 0.9; }
    66%      { transform: translate(12px, -6px) scale(1.2); opacity: 1;   }
}
@keyframes pb-sparkle-drift-c {
    0%, 100% { transform: translate(0, 0)     scale(1);    opacity: 0.5; }
    50%      { transform: translate(6px, 12px) scale(1.4); opacity: 1;   }
}

/* Декорация скрыта когда юзер кликнул «Пробить» (body.has-result) */
body.has-result .hero-preview::before,
body.has-result .hero-preview::after,
body.has-result .hero-preview .pb-sparkle {
    display: none;
}

/* Mobile <=720px — halo меньше, sparkles остаются (или 2 для перфа) */
@media (max-width: 720px) {
    .hero-preview::before {
        width: 360px;
        height: 360px;
    }
    .hero-preview::after {
        width: 240px;
        height: 240px;
    }
    .hero-preview .pb-sparkle.s3,
    .hero-preview .pb-sparkle.s5 {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-preview::before,
    .hero-preview::after,
    .hero-preview .pb-sparkle {
        animation: none !important;
    }
}

.pb-low-end .hero-preview::after,
.pb-low-end .hero-preview .pb-sparkle {
    display: none;
}

/* ════════════════════════════════════════════════════════════════════════
 * WIDE-SCREEN POLISH (v0.26.x) — hero mesh + preview on huge screens.
 *
 * На 1440+/1720+ hero-preview шире (440-460px), и mesh-blobs должны
 * быть пропорционально крупнее чтобы не выглядеть «pin-point' в углу».
 * Также bump glow / halo behind phone-frame.
 * ════════════════════════════════════════════════════════════════════════ */
@media (min-width: 1440px) {
    .hero-mesh::before {
        width: 900px;
        height: 900px;
        top: -240px;
        left: -200px;
    }
    .hero-mesh::after {
        width: 800px;
        height: 800px;
    }
    .hero-mesh-blob {
        filter: blur(80px);
    }
}

@media (min-width: 1720px) {
    .hero-mesh::before {
        width: 1100px;
        height: 1100px;
    }
    .hero-mesh::after {
        width: 1000px;
        height: 1000px;
    }
    .hero-mesh-blob {
        filter: blur(96px);
    }
}

