/* ── Reset & Base ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Sora:wght@300;600;700&display=swap');

/* ── Overlay ──────────────────────────────────────────────── */
#csp-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(2, 4, 14, 0.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    animation: csp-overlay-in 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.1s forwards;
}

@keyframes csp-overlay-in {
    to { opacity: 1; }
}

#csp-overlay.csp-hiding {
    animation: csp-overlay-out 0.5s cubic-bezier(0.55, 0, 1, 0.45) forwards;
}

@keyframes csp-overlay-out {
    to { opacity: 0; pointer-events: none; }
}

/* ── Popup Card ───────────────────────────────────────────── */
#csp-popup {
    position: relative;
    width: 100%;
    max-width: 640px;
    min-height: 420px;
    border-radius: 24px;
    overflow: hidden;
    background: linear-gradient(145deg, #0d0f1a 0%, #111527 50%, #0a0c16 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 0 0 1px rgba(99, 102, 241, 0.15),
        0 32px 80px rgba(0, 0, 0, 0.7),
        0 0 120px rgba(99, 102, 241, 0.08);
    transform: translateY(40px) scale(0.96);
    opacity: 0;
    animation: csp-card-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.3s forwards;
    padding: 56px 48px 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

@keyframes csp-card-in {
    to { transform: translateY(0) scale(1); opacity: 1; }
}

#csp-overlay.csp-hiding #csp-popup {
    animation: csp-card-out 0.45s cubic-bezier(0.55, 0, 1, 0.45) forwards;
}

@keyframes csp-card-out {
    to { transform: translateY(20px) scale(0.97); opacity: 0; }
}

/* ── Canvas ───────────────────────────────────────────────── */
#csp-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* ── Orbs ─────────────────────────────────────────────────── */
.csp-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    pointer-events: none;
}

.csp-orb--1 {
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.35) 0%, transparent 70%);
    top: -80px;
    right: -60px;
    animation: csp-orb-drift 8s ease-in-out infinite alternate;
}

.csp-orb--2 {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.25) 0%, transparent 70%);
    bottom: -60px;
    left: -40px;
    animation: csp-orb-drift 10s ease-in-out infinite alternate-reverse;
}

.csp-orb--3 {
    width: 160px;
    height: 160px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.2) 0%, transparent 70%);
    top: 40%;
    left: 10%;
    animation: csp-orb-drift 12s ease-in-out infinite alternate;
}

@keyframes csp-orb-drift {
    0%   { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, 20px) scale(1.1); }
}

/* ── Content ──────────────────────────────────────────────── */
.csp-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    width: 100%;
}

/* ── Badge ────────────────────────────────────────────────── */
.csp-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.3);
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #a5b4fc;
    opacity: 0;
    transform: translateY(12px);
    animation: csp-fade-up 0.5s ease 0.7s forwards;
}

.csp-badge__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #6366f1;
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.8);
    animation: csp-pulse 2s ease-in-out infinite;
}

@keyframes csp-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.5; transform: scale(0.8); }
}

/* ── Headline ─────────────────────────────────────────────── */
.csp-headline {
    font-family: 'Sora', sans-serif;
    font-size: clamp(26px, 5vw, 38px);
    font-weight: 700;
    line-height: 1.15;
    color: #f0f2ff;
    margin: 0;
    letter-spacing: -0.02em;
    opacity: 0;
    transform: translateY(16px);
    animation: csp-fade-up 0.6s ease 0.9s forwards;
}

.csp-headline__accent {
    display: block;
    background: linear-gradient(90deg, #818cf8, #c084fc, #67e8f9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 300;
    font-size: 0.78em;
    margin-top: 4px;
}

/* ── Subline ──────────────────────────────────────────────── */
.csp-subline {
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.65;
    color: rgba(200, 210, 240, 0.55);
    max-width: 420px;
    margin: 0;
    opacity: 0;
    transform: translateY(12px);
    animation: csp-fade-up 0.5s ease 1.05s forwards;
}

/* ── Countdown ────────────────────────────────────────────── */
.csp-countdown {
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0;
    transform: translateY(12px);
    animation: csp-fade-up 0.5s ease 1.2s forwards;
}

.csp-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 68px;
    padding: 16px 12px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    backdrop-filter: blur(4px);
    transition: border-color 0.3s;
}

.csp-unit:hover {
    border-color: rgba(99, 102, 241, 0.35);
}

.csp-unit__num {
    font-family: 'Sora', sans-serif;
    font-size: 32px;
    font-weight: 600;
    color: #e0e7ff;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    transition: transform 0.2s ease;
}

.csp-unit__num.csp-flip {
    animation: csp-flip-num 0.3s ease;
}

@keyframes csp-flip-num {
    0%   { transform: translateY(-8px); opacity: 0; }
    100% { transform: translateY(0);    opacity: 1; }
}

.csp-unit__label {
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(148, 163, 225, 0.45);
}

.csp-sep {
    font-family: 'Sora', sans-serif;
    font-size: 28px;
    font-weight: 300;
    color: rgba(99, 102, 241, 0.5);
    line-height: 1;
    margin-bottom: 20px;
    animation: csp-pulse 1s ease-in-out infinite;
}

/* ── Close Button ─────────────────────────────────────────── */
#csp-close {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 28px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s;
    box-shadow: 0 4px 24px rgba(99, 102, 241, 0.4);
    opacity: 0;
    transform: translateY(12px);
    animation: csp-fade-up 0.5s ease 1.4s forwards;
}

#csp-close:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.55);
}

#csp-close:active {
    transform: translateY(0);
}

#csp-close svg {
    transition: transform 0.2s ease;
}

#csp-close:hover svg {
    transform: translateX(4px);
}

/* ── Shared fade-up ───────────────────────────────────────── */
@keyframes csp-fade-up {
    to { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 520px) {
    #csp-popup {
        padding: 40px 24px 36px;
        border-radius: 20px;
    }

    .csp-unit {
        min-width: 56px;
        padding: 12px 8px 10px;
    }

    .csp-unit__num {
        font-size: 26px;
    }

    .csp-countdown {
        gap: 8px;
    }
}

/* ── Reduced motion ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    #csp-overlay,
    #csp-popup,
    .csp-badge,
    .csp-headline,
    .csp-subline,
    .csp-countdown,
    #csp-close {
        animation-duration: 0.01ms !important;
    }
    .csp-orb {
        animation: none;
    }
}
