@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pulse-glow {
    0%, 100% { opacity: 0.03; transform: scale(1); }
    50% { opacity: 0.06; transform: scale(1.05); }
}

@keyframes drift-a {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(40px, -30px); }
    66% { transform: translate(-30px, 40px); }
}

@keyframes drift-b {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-50px, 30px); }
}

@keyframes drift-c {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, -40px); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
}

@keyframes check-pop {
    0% { transform: scale(0) rotate(-45deg); opacity: 0; }
    60% { transform: scale(1.2) rotate(0); opacity: 1; }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}

@keyframes slide-in-right {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

@keyframes slide-out-right {
    from { transform: translateX(0); }
    to { transform: translateX(100%); }
}

@keyframes backdrop-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes grid-drift {
    0% { transform: perspective(900px) rotateX(62deg) translateY(0); }
    100% { transform: perspective(900px) rotateX(62deg) translateY(80px); }
}

@keyframes grid-drift-top {
    0% { transform: perspective(900px) rotateX(-62deg) translateY(0); }
    100% { transform: perspective(900px) rotateX(-62deg) translateY(-80px); }
}

@keyframes scan-sweep {
    0% { transform: translateY(-20%); opacity: 0; }
    20% { opacity: 0.6; }
    80% { opacity: 0.6; }
    100% { transform: translateY(120%); opacity: 0; }
}

@keyframes pulse-dot {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 var(--accent-emerald); }
    50% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(52, 211, 153, 0); }
}

@keyframes price-flash-up {
    0% { background: transparent; }
    30% { background: rgba(52, 211, 153, 0.14); }
    100% { background: transparent; }
}

@keyframes price-flash-down {
    0% { background: transparent; }
    30% { background: rgba(251, 113, 133, 0.14); }
    100% { background: transparent; }
}

.nexus-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.nexus-grid {
    position: absolute;
    left: -20%;
    right: -20%;
    height: 60%;
    background-image:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 72px 72px;
    mask-image: radial-gradient(ellipse at center, #000 25%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at center, #000 25%, transparent 75%);
    will-change: transform;
}

.nexus-grid.bottom {
    bottom: -10%;
    transform-origin: 50% 0;
    animation: grid-drift 22s linear infinite;
}

.nexus-grid.top {
    top: -10%;
    transform-origin: 50% 100%;
    animation: grid-drift-top 28s linear infinite;
    opacity: 0.7;
}

.nexus-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.nexus-scan {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 140px;
    background: linear-gradient(180deg, transparent 0%, var(--scan-line) 50%, transparent 100%);
    filter: blur(2px);
    animation: scan-sweep 16s linear infinite;
    animation-delay: 6s;
    pointer-events: none;
}

.nexus-vignette {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 50% at 50% 30%, transparent, var(--bg-primary) 85%),
        radial-gradient(ellipse 100% 60% at 50% 100%, transparent, var(--bg-primary) 80%);
    pointer-events: none;
}

.reveal {
    opacity: 0;
    animation: fadeUp 0.9s var(--ease-spring) forwards;
}

.reveal-delay-1 { animation-delay: 80ms; }
.reveal-delay-2 { animation-delay: 160ms; }
.reveal-delay-3 { animation-delay: 240ms; }
.reveal-delay-4 { animation-delay: 320ms; }
.reveal-delay-5 { animation-delay: 400ms; }

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
    vertical-align: middle;
}

.ambient-orbs {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: var(--orb-opacity);
    will-change: transform;
    transition: opacity var(--dur-slow) var(--ease-out);
}

.orb-a {
    width: 500px;
    height: 500px;
    background: var(--accent-blue);
    top: -120px;
    left: -120px;
    animation: drift-a 24s var(--ease-in-out) infinite;
}

.orb-b {
    width: 440px;
    height: 440px;
    background: var(--accent-violet);
    bottom: -140px;
    right: -140px;
    animation: drift-b 30s var(--ease-in-out) infinite;
}

.orb-c {
    width: 380px;
    height: 380px;
    background: var(--accent-emerald);
    top: 45%;
    left: 55%;
    animation: drift-c 36s var(--ease-in-out) infinite;
    opacity: var(--orb-opacity-weak);
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .orb { animation: none !important; }
}
