/* ── Problem section ──────────────────────────────────── */

.nq-problem {
    position: relative;
    overflow: hidden;
    padding-top: 5.5rem;
    padding-bottom: 5.5rem;
    isolation: isolate;
}

/* ── Layered background ───────────────────────────────── */
body.nq-homepage-2 .neuroquest-home-2 .nq-problem__bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 55% at 50% 0%, rgba(15, 134, 248, 0.22), transparent 60%),
        radial-gradient(ellipse 55% 45% at 100% 70%, rgba(73, 222, 255, 0.18), transparent 55%),
        radial-gradient(ellipse 45% 40% at 0% 80%, rgba(24, 169, 255, 0.14), transparent 55%),
        linear-gradient(180deg,
            rgba(184, 232, 255, 0.55) 0%,
            rgba(160, 220, 255, 0.42) 35%,
            rgba(195, 240, 255, 0.30) 70%,
            rgba(218, 248, 255, 0.20) 100%
        );
    pointer-events: none;
    z-index: -3;
}

/* Subtle dot grid pattern */
.nq-problem__grid {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle, rgba(15, 134, 248, 0.18) 1px, transparent 1.4px),
        radial-gradient(circle, rgba(73, 222, 255, 0.12) 1px, transparent 1.4px);
    background-size: 28px 28px, 28px 28px;
    background-position: 0 0, 14px 14px;
    mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, #000 30%, transparent 85%);
    -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, #000 30%, transparent 85%);
    opacity: 0.55;
    pointer-events: none;
    z-index: -2;
    animation: nq-problem-grid-shift 22s ease-in-out infinite;
}

@keyframes nq-problem-grid-shift {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50%      { transform: translate3d(8px, -6px, 0); }
}

/* Top + bottom blue gradient borders (animated) */
.nq-problem__top-fade,
.nq-problem__bottom-fade {
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    pointer-events: none;
    z-index: 1;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(15, 134, 248, 0.35) 25%,
        rgba(73, 222, 255, 0.55) 50%,
        rgba(15, 134, 248, 0.35) 75%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: nq-problem-edge-shimmer 6s ease-in-out infinite;
}

.nq-problem__top-fade { top: 0; }
.nq-problem__bottom-fade { bottom: 0; animation-delay: 3s; }

@keyframes nq-problem-edge-shimmer {
    0%, 100% { background-position: 0% 0; opacity: 0.55; }
    50%      { background-position: 100% 0; opacity: 0.95; }
}

/* Top wave divider */
.nq-problem__wave {
    position: absolute;
    top: 1.25rem;
    left: 0;
    width: 100%;
    height: 56px;
    pointer-events: none;
    z-index: 0;
    opacity: 0.85;
}

/* Decorative neural network SVG */
.nq-problem__network {
    position: absolute;
    bottom: 8%;
    right: -4%;
    width: 18rem;
    height: auto;
    pointer-events: none;
    z-index: 0;
    opacity: 0.55;
}

.nq-problem__node {
    transform-box: fill-box;
    transform-origin: center;
    animation: nq-problem-node-pulse 3s ease-in-out infinite;
}
.nq-problem__node--1 { animation-delay: 0s; }
.nq-problem__node--2 { animation-delay: 0.4s; }
.nq-problem__node--3 { animation-delay: 0.8s; }
.nq-problem__node--4 { animation-delay: 1.2s; }
.nq-problem__node--5 { animation-delay: 1.6s; }
.nq-problem__node--6 { animation-delay: 2.0s; }

@keyframes nq-problem-node-pulse {
    0%, 100% { opacity: 0.45; transform: scale(1); }
    50%      { opacity: 1;    transform: scale(1.35); }
}

/* Floating decorations */
.nq-problem__deco {
    position: absolute;
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    animation: nq-deco-drift ease-in-out infinite;
    animation-fill-mode: both;
}

.nq-problem__deco--1 {
    top: 9%;
    right: 6%;
    animation-duration: 10s;
    animation-delay: 0.5s;
}

.nq-problem__deco--2 {
    bottom: 14%;
    left: 4%;
    animation-duration: 12s;
    animation-delay: 3s;
}

.nq-problem__deco--3 {
    top: 38%;
    left: 6%;
    animation-duration: 9s;
    animation-delay: 1.5s;
}

/* ── Header ───────────────────────────────────────────── */
.nq-problem__header {
    text-align: center;
    max-width: 44rem;
    margin: 0 auto 2.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    position: relative;
    z-index: 2;
}

body.nq-homepage-2 .neuroquest-home-2 .nq-problem__heading {
    font-size: clamp(1.85rem, 4.8vw, 3rem);
    font-weight: 800;
    line-height: 1.16;
    letter-spacing: -0.02em;
    color: var(--nq-text);
}

body.nq-homepage-2 .neuroquest-home-2 .nq-problem__subtitle {
    max-width: 36rem;
    font-size: clamp(0.98rem, 1.7vw, 1.12rem);
    line-height: 1.75;
    color: var(--nq-text-soft);
}

/* ── Engagement bar (formerly red→orange HP) ─────────── */
.nq-problem__hp-bar {
    position: relative;
    z-index: 2;
    max-width: 28rem;
    margin: 0 auto 3rem;
    padding: 1rem 1.1rem 1.1rem;
    border-radius: 1.1rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(240, 252, 255, 0.55));
    border: 1px solid rgba(15, 134, 248, 0.14);
    backdrop-filter: blur(14px);
    box-shadow:
        0 18px 38px rgba(15, 134, 248, 0.10),
        inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.nq-problem__hp-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.55rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--nq-text-soft);
}

body.nq-homepage-2 .neuroquest-home-2 .nq-problem__hp-value {
    color: var(--nq-primary);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.72rem;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(15, 134, 248, 0.14), rgba(73, 222, 255, 0.18));
    border: 1px solid rgba(15, 134, 248, 0.22);
}

.nq-problem__hp-track {
    position: relative;
    height: 0.62rem;
    border-radius: 999px;
    background: rgba(15, 134, 248, 0.08);
    overflow: hidden;
    border: 1px solid rgba(15, 134, 248, 0.10);
}

.nq-problem__hp-fill {
    width: 0;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #0a63b8 0%, #0f86f8 50%, #49deff 100%);
    background-size: 220% 100%;
    transition: width 1.5s cubic-bezier(0.16, 1, 0.3, 1) 0.3s;
    box-shadow:
        0 0 14px rgba(15, 134, 248, 0.45),
        0 0 26px rgba(73, 222, 255, 0.35);
    animation: nq-hp-shimmer 3s ease-in-out infinite 2s;
    position: relative;
}

.nq-problem__hp-fill::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.5) 50%, transparent 100%);
    background-size: 200% 100%;
    animation: nq-hp-sweep 2.4s ease-in-out infinite 2.5s;
    border-radius: inherit;
}

@keyframes nq-hp-shimmer {
    0%, 100% { background-position: 0% 0; }
    50%      { background-position: 100% 0; }
}

@keyframes nq-hp-sweep {
    0%   { background-position: -100% 0; }
    100% { background-position: 200% 0; }
}

/* ── Stat cards ───────────────────────────────────────── */
.nq-problem__stats {
    display: grid;
    gap: 1.25rem;
    max-width: 56rem;
    margin: 0 auto 3.25rem;
    position: relative;
    z-index: 2;
}

body.nq-homepage-2 .neuroquest-home-2 .nq-problem__stat {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.15rem;
    padding: 1.85rem 1.5rem 1.65rem;
    border: 1px solid rgba(15, 134, 248, 0.16);
    border-radius: 1.5rem;
    background:
        radial-gradient(ellipse 110% 60% at 50% 0%, rgba(73, 222, 255, 0.22), transparent 65%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.85) 0%, rgba(240, 252, 255, 0.65) 100%);
    backdrop-filter: blur(14px);
    text-align: center;
    box-shadow:
        0 18px 40px rgba(15, 134, 248, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

/* Animated top gradient accent bar */
body.nq-homepage-2 .neuroquest-home-2 .nq-problem__stat::before {
    content: "";
    position: absolute;
    top: 0;
    left: 12%;
    right: 12%;
    height: 2px;
    border-radius: 0 0 999px 999px;
    background: linear-gradient(90deg, transparent, #0f86f8, #49deff, #0f86f8, transparent);
    background-size: 200% 100%;
    opacity: 0.75;
    animation: nq-problem-edge-shimmer 4s ease-in-out infinite;
}

body.nq-homepage-2 .neuroquest-home-2 .nq-problem__stat:hover {
    transform: translateY(-4px);
    border-color: rgba(15, 134, 248, 0.28);
    box-shadow:
        0 24px 56px rgba(15, 134, 248, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.nq-problem__stat-ring {
    position: relative;
    width: 7rem;
    height: 7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 6px 18px rgba(15, 134, 248, 0.18));
}

.nq-problem__stat-ring svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.nq-problem__ring-anim {
    transition: stroke-dashoffset 1.5s cubic-bezier(0.16, 1, 0.3, 1) 0.4s;
}

body.nq-homepage-2 .neuroquest-home-2 .nq-problem__stat-number {
    position: relative;
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #0a63b8 0%, #138ef8 45%, #46ddff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

body.nq-homepage-2 .neuroquest-home-2 .nq-problem__stat-label {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--nq-text-soft);
    max-width: 16rem;
}

/* ── Pull quote ───────────────────────────────────────── */
.nq-problem__bottom {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 42rem;
    margin: 0 auto;
    padding: 1.75rem 1.5rem;
    border-radius: 1.25rem;
    background:
        radial-gradient(ellipse 80% 100% at 50% 0%, rgba(73, 222, 255, 0.16), transparent 70%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(232, 248, 255, 0.42));
    border: 1px solid rgba(15, 134, 248, 0.12);
    backdrop-filter: blur(12px);
    box-shadow: 0 12px 30px rgba(15, 134, 248, 0.06);
}

body.nq-homepage-2 .neuroquest-home-2 .nq-problem__pull-quote {
    margin: 0;
    font-size: clamp(1.05rem, 2vw, 1.3rem);
    font-weight: 500;
    line-height: 1.7;
    color: #07467f;
    font-style: italic;
}

/* Decorative quote marks */
.nq-problem__bottom::before,
.nq-problem__bottom::after {
    position: absolute;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 3.5rem;
    line-height: 1;
    font-style: normal;
    color: rgba(15, 134, 248, 0.18);
    pointer-events: none;
}

.nq-problem__bottom::before { content: "\201C"; top: 0.35rem; left: 0.85rem; }
.nq-problem__bottom::after  { content: "\201D"; bottom: -0.5rem; right: 0.85rem; }

/* ── Mobile-first refinements ─────────────────────────── */
@media (max-width: 767px) {
    .nq-problem {
        padding-top: 4.5rem;
        padding-bottom: 4.5rem;
    }

    .nq-problem__network {
        width: 14rem;
        right: -3rem;
        bottom: 4%;
        opacity: 0.4;
    }

    .nq-problem__wave { top: 0.85rem; height: 36px; }

    .nq-problem__header {
        margin-bottom: 2.25rem;
        gap: 1rem;
        padding: 0 0.25rem;
    }

    .nq-problem__hp-bar { margin-bottom: 2.25rem; }

    .nq-problem__stats {
        gap: 1rem;
        margin-bottom: 2.5rem;
    }

    body.nq-homepage-2 .neuroquest-home-2 .nq-problem__stat {
        padding: 1.6rem 1.25rem 1.4rem;
    }

    .nq-problem__stat-ring {
        width: 6.5rem;
        height: 6.5rem;
    }

    body.nq-homepage-2 .neuroquest-home-2 .nq-problem__stat-number {
        font-size: 1.55rem;
    }

    body.nq-homepage-2 .neuroquest-home-2 .nq-problem__stat-label {
        font-size: 0.92rem;
    }

    .nq-problem__bottom { padding: 1.5rem 1.4rem; }
    .nq-problem__bottom::before { font-size: 2.75rem; top: 0.2rem; left: 0.6rem; }
    .nq-problem__bottom::after  { font-size: 2.75rem; bottom: -0.4rem; right: 0.6rem; }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
    .nq-problem__grid,
    .nq-problem__top-fade,
    .nq-problem__bottom-fade,
    .nq-problem__node,
    .nq-problem__hp-fill,
    .nq-problem__hp-fill::after,
    body.nq-homepage-2 .neuroquest-home-2 .nq-problem__stat::before {
        animation: none !important;
    }
}
