/* ============================================================
   NEON FLOW IDLE POPUP
   ThreeJS Tubes Background + Image Slideshow + Text Reveal
   ============================================================ */

/* ---------- Overlay ---------- */
.nf-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: none;
    opacity: 0;
    transition: opacity 0.6s ease;
    background: #050510;
    font-family: 'Manrope', system-ui, -apple-system, sans-serif;
}

.nf-overlay.nf-visible {
    display: flex;
    align-items: center;
    justify-content: center;
}

.nf-overlay.nf-active {
    opacity: 1;
}

/* ---------- ThreeJS Canvas (above images, blend mode) ---------- */
.nf-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
    z-index: 1;
    mix-blend-mode: screen;
    pointer-events: auto;
}

/* ---------- Image Slideshow (layer below canvas) ---------- */
.nf-slides {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}

.nf-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    will-change: opacity;
}

.nf-slide.nf-slide-active {
    opacity: 1;
}

.nf-slide-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0.4;
}

/* Dark gradient overlay for text readability */
.nf-slide::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg,
            rgba(5, 5, 16, 0.6) 0%,
            rgba(5, 5, 16, 0.3) 30%,
            rgba(5, 5, 16, 0.2) 50%,
            rgba(5, 5, 16, 0.4) 70%,
            rgba(5, 5, 16, 0.7) 100%),
        radial-gradient(ellipse 60% 60% at 50% 50%, transparent 0%, rgba(5, 5, 16, 0.3) 100%);
    pointer-events: none;
}

/* ---------- Progress Dots ---------- */
.nf-progress-dots {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 15;
    display: flex;
    gap: 8px;
    pointer-events: none;
}

.nf-dot {
    width: 28px;
    height: 3px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.nf-dot-fill {
    width: 0%;
    height: 100%;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 3px;
}

.nf-dot-active .nf-dot-fill {
    animation: nfDotFill 10s linear forwards;
}

@keyframes nfDotFill {
    from {
        width: 0%;
    }

    to {
        width: 100%;
    }
}

/* ---------- Content Overlay (layer 3) ---------- */
.nf-content {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    text-align: center;
    padding: 2rem;
    pointer-events: none;
}

/* ---------- Badge ---------- */
.nf-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 6px 18px;
    margin-bottom: 1.5rem;
    pointer-events: auto;
}

.nf-badge-text {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: rgba(255, 255, 255, 0.45);
}

.nf-badge-icon {
    font-size: 0.5rem;
    color: #4ade80;
}

/* ---------- Title (Dynamic + Text Reveal) ---------- */
.nf-title-wrap {
    position: relative;
    min-height: 6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    overflow: hidden;
    width: 100%;
}

.nf-title {
    font-family: 'Manrope', system-ui, -apple-system, sans-serif !important;
    font-size: 4.5rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    color: #fff !important;
    line-height: 1.05;
    user-select: none;
    position: absolute;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.nf-title.nf-title-active {
    opacity: 1;
    transform: translateY(0);
}

.nf-title.nf-title-exit {
    opacity: 0;
    transform: translateY(-30px);
}

/* Text Reveal on Title chars */
.nf-title .nf-reveal-char {
    display: inline-block;
    position: relative;
    overflow: hidden;
}

.nf-title .nf-reveal-char>.nfr-main {
    display: inline-block;
    opacity: 0;
    filter: blur(12px);
}

.nf-title.nf-title-active .nf-reveal-char>.nfr-main {
    animation: nfShutterBlur 0.7s ease-out forwards;
}

.nf-title .nf-reveal-char>.nfr-slice {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
}

.nf-title.nf-title-active .nf-reveal-char>.nfr-s1 {
    animation: nfSliceLeft 0.55s ease-in-out forwards;
    clip-path: polygon(0 0, 100% 0, 100% 33%, 0 33%);
    color: #60a5fa;
}

.nf-title.nf-title-active .nf-reveal-char>.nfr-s2 {
    animation: nfSliceRight 0.55s 0.06s ease-in-out forwards;
    clip-path: polygon(0 33%, 100% 33%, 100% 66%, 0 66%);
    color: rgba(255, 255, 255, 0.5);
}

.nf-title.nf-title-active .nf-reveal-char>.nfr-s3 {
    animation: nfSliceLeft 0.55s 0.12s ease-in-out forwards;
    clip-path: polygon(0 66%, 100% 66%, 100% 100%, 0 100%);
    color: #a78bfa;
}

@keyframes nfShutterBlur {
    from {
        opacity: 0;
        filter: blur(12px);
    }

    to {
        opacity: 1;
        filter: blur(0px);
    }
}

@keyframes nfSliceLeft {
    0% {
        transform: translateX(-110%);
        opacity: 0;
    }

    35% {
        opacity: 1;
    }

    100% {
        transform: translateX(110%);
        opacity: 0;
    }
}

@keyframes nfSliceRight {
    0% {
        transform: translateX(110%);
        opacity: 0;
    }

    35% {
        opacity: 1;
    }

    100% {
        transform: translateX(-110%);
        opacity: 0;
    }
}

/* ---------- Tagline ---------- */
.nf-tagline {
    font-family: 'Manrope', system-ui, -apple-system, sans-serif;
    font-size: 1rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 2rem;
    user-select: none;
    transition: opacity 0.4s ease;
}

/* ---------- CTA Button ---------- */
.nf-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.10);
    color: #fff !important;
    padding: 14px 36px;
    font-family: 'Manrope', system-ui, -apple-system, sans-serif !important;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none !important;
    pointer-events: auto;
    transition: background 0.3s, transform 0.2s, box-shadow 0.3s, border-color 0.3s;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.nf-cta:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.18);
    transform: scale(1.05);
    color: #fff !important;
    box-shadow: 0 4px 40px rgba(255, 255, 255, 0.06);
}

.nf-cta:active {
    transform: scale(0.97);
}

.nf-cta .fa {
    transition: transform 0.2s;
}

.nf-cta:hover .fa {
    transform: translateX(3px);
}

/* ---------- Close Button ---------- */
.nf-close {
    position: absolute;
    top: 24px;
    right: 24px;
    /* Force z-index high and cursor pointer */
    z-index: 100000;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: background 0.2s, color 0.2s, transform 0.2s;
    font-family: 'Manrope', system-ui, -apple-system, sans-serif;
    pointer-events: all !important;
}

.nf-close:hover {
    background: rgba(255, 255, 255, 0.10);
    color: #fff;
    transform: scale(1.1);
}

/* ---------- Cursor Hint ---------- */
.nf-hint {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.25);
    font-family: 'Manrope', system-ui, -apple-system, sans-serif;
    font-size: 0.6rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    pointer-events: none;
    animation: nfPulse 2.5s ease-in-out infinite;
}

@keyframes nfPulse {

    0%,
    100% {
        opacity: 0.25;
    }

    50% {
        opacity: 0.6;
    }
}

.nf-hint .fa {
    font-size: 1.1rem;
}

/* ---------- Don't Show Again ---------- */
.nf-dismiss {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Manrope', system-ui, -apple-system, sans-serif;
    font-size: 0.7rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    pointer-events: auto;
    transition: color 0.2s;
    user-select: none;
    border: none;
    background: none;
    padding: 8px 16px;
    letter-spacing: 0.05em;
}

.nf-dismiss:hover {
    color: rgba(255, 255, 255, 0.5);
}

/* ---------- Responsive ---------- */

/* Mobile view for Phones & Tablets (Portrait/Landscape) up to 991px */
@media (max-width: 991.98px) {
    .nf-title {
        font-size: 2.5rem;
        line-height: 1.15;
        max-width: 90vw;
        white-space: normal;
    }

    .nf-title-wrap {
        min-height: 5rem;
    }

    .nf-tagline {
        font-size: 0.9rem;
        max-width: 90vw;
    }

    .nf-badge {
        padding: 5px 14px;
        margin-bottom: 1rem;
    }

    .nf-badge-text {
        font-size: 0.55rem;
    }

    .nf-cta {
        padding: 14px 28px;
        font-size: 0.9rem;
        min-height: 48px;
    }

    .nf-close {
        top: 16px;
        right: 16px;
        width: 44px;
        height: 44px;
    }

    .nf-dismiss {
        bottom: 24px;
        font-size: 0.7rem;
        padding: 12px 20px;
        min-height: 44px;
    }

    .nf-progress-dots {
        bottom: 70px;
    }

    .nf-hint {
        bottom: 90px;
        font-size: 0.55rem;
    }

    .nf-content {
        padding: 1.5rem;
    }
}

/* Specific tweaks for very small screens (< 576px) */
@media (max-width: 575.98px) {
    .nf-title {
        font-size: 2rem;
    }
}

/* Desktop (992px+): allow nowrap */
@media (min-width: 992px) {
    .nf-title {
        white-space: nowrap;
        font-size: 4.5rem;
    }
}

/* Landscape phones (short viewport) */
@media (max-height: 500px) {
    .nf-content {
        padding: 0.5rem;
    }

    .nf-badge {
        margin-bottom: 0.5rem;
    }

    .nf-title {
        font-size: 1.8rem;
    }

    .nf-title-wrap {
        min-height: 2.5rem;
    }

    .nf-tagline {
        margin-bottom: 0.75rem;
        font-size: 0.75rem;
    }

    .nf-progress-dots {
        bottom: 45px;
    }

    .nf-hint {
        display: none;
    }
}

/* Touch devices: bigger targets, swap hint text */
@media (hover: none) and (pointer: coarse) {
    .nf-hint-cursor {
        display: none !important;
    }

    .nf-hint-touch {
        display: flex !important;
    }

    .nf-close {
        width: 48px;
        height: 48px;
    }

    .nf-dismiss {
        padding: 14px 24px;
        min-height: 48px;
    }

    .nf-cta {
        min-height: 52px;
        padding: 16px 36px;
    }
}

@media (hover: hover) and (pointer: fine) {
    .nf-hint-cursor {
        display: flex !important;
    }

    .nf-hint-touch {
        display: none !important;
    }
}

/* Safe area for notched devices */
@supports (padding: env(safe-area-inset-top)) {
    .nf-close {
        top: calc(12px + env(safe-area-inset-top));
        right: calc(12px + env(safe-area-inset-right));
    }

    .nf-dismiss {
        bottom: calc(16px + env(safe-area-inset-bottom));
    }

    .nf-progress-dots {
        bottom: calc(58px + env(safe-area-inset-bottom));
    }
}