.glass {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
    100% { transform: translateY(0px); }
}

@keyframes twinkle {
    0%, 100% { opacity: 0.2; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

.animated-bg {
    background: radial-gradient(circle at top right, #1a0b1a, #050810 40%),
                radial-gradient(circle at bottom left, #0a1128, #050810 40%);
    background-color: #050810;
}

.starfield {
    background-image:
        radial-gradient(1px 1px at 20px 30px, #fff, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 40px 70px, #fff, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 50px 160px, #fff, rgba(0,0,0,0)),
        radial-gradient(1.5px 1.5px at 80px 120px, #fff, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 110px 40px, #fff, rgba(0,0,0,0)),
        radial-gradient(1.5px 1.5px at 150px 180px, #fff, rgba(0,0,0,0));
    background-repeat: repeat;
    background-size: 200px 200px;
    opacity: 0.15;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    z-index: 0;
    pointer-events: none;
    opacity: 0.15;
}

.glow-text {
    text-shadow: 0 0 30px rgba(255, 77, 77, 0.3);
}

.card-hover:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 77, 77, 0.3);
    box-shadow: 0 10px 30px -10px rgba(255, 77, 77, 0.2);
}

.bg-pattern-circuit {
    background-image: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg stroke='%23ff4d4d' stroke-width='0.5' stroke-opacity='0.1'%3E%3Cpath d='M50 0v20h20M0 50h20v20M80 30H60V10M30 80V60H10'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.bg-pattern-dots {
    background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='2' cy='2' r='0.6' fill='%23ff4d4d' fill-opacity='0.15'/%3E%3C/svg%3E");
}

.bg-pattern-network {
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 10 L90 90 M90 10 L10 90' stroke='%23ff4d4d' stroke-width='0.2' stroke-opacity='0.08'/%3E%3Ccircle cx='10' cy='10' r='1' fill='%23ff4d4d' fill-opacity='0.1'/%3E%3Ccircle cx='90' cy='90' r='1' fill='%23ff4d4d' fill-opacity='0.1'/%3E%3Ccircle cx='50' cy='50' r='1.5' fill='%23ff4d4d' fill-opacity='0.1'/%3E%3C/svg%3E");
}

#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* ============================================
   MOBILE ONLY (max-width: 767px)
   ============================================ */
@media (max-width: 767px) {
    /* Disable heavy desktop effects */
    #particles-canvas {
        display: none;
    }
    .orb {
        filter: none;
        opacity: 0.08;
        background: radial-gradient(circle, var(--orb-color, rgba(255,77,77,0.3)) 0%, transparent 70%);
    }
    .glass {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
    .animate-float,
    .animate-pulse-slow {
        animation: none;
    }
    .card-hover:hover {
        transform: none;
    }
    .starfield {
        opacity: 0.12;
    }

    /* Nebula background: auto-drifting */
    @keyframes drift-nebula {
        0% { background-position: 0px 0px; }
        100% { background-position: -500px -888px; }
    }
    .animated-bg::before {
        content: '';
        position: fixed;
        inset: 0;
        z-index: 1;
        pointer-events: none;
        background-image: url('/img/layer-nebula.png');
        background-size: 500px 888px;
        background-repeat: repeat;
        opacity: 0.25;
        animation: drift-nebula 90s linear infinite;
    }

    /* Stars layer: scroll-reactive via IntersectionObserver */
    .animated-bg::after {
        content: '';
        position: fixed;
        inset: 0;
        z-index: 2;
        pointer-events: none;
        background-image: url('/img/layer-stars-transparent.png');
        background-size: 400px 711px;
        background-repeat: repeat;
        opacity: 0.45;
        transition: background-position 1.2s cubic-bezier(0.25, 0.1, 0.25, 1);
        background-position: var(--star-x, 0px) var(--star-y, 0px);
    }

    /* Ensure content sits above background layers */
    .animated-bg > *:not(canvas):not(.starfield) {
        position: relative;
        z-index: 5;
    }
    .animated-bg > .starfield {
        display: none;
    }
    .animated-bg > canvas {
        display: none;
    }

    /* Dark scrim for text readability */
    body::after {
        content: '';
        position: fixed;
        inset: 0;
        z-index: 3;
        pointer-events: none;
        background: rgba(5, 8, 16, 0.2);
    }

    /* Fixed nav on scroll */
    #main-nav.nav-fixed {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 999 !important;
        background: rgba(5, 8, 16, 0.85) !important;
        backdrop-filter: blur(16px) !important;
        -webkit-backdrop-filter: blur(16px) !important;
        padding: 0.5rem 1.5rem !important;
        max-width: 100% !important;
        border-bottom: 0.5px solid rgba(255, 77, 77, 0.3);
    }

    /* How It Works: bright step numbers */
    #how-it-works .text-8xl.font-black {
        opacity: 0.45 !important;
        color: #ff4d4d !important;
    }
    #how-it-works .text-8xl.font-black:hover,
    .group:hover .text-8xl.font-black {
        opacity: 0.6 !important;
    }
    #how-it-works > .absolute:first-child {
        background: rgba(15, 23, 42, 0.2) !important;
    }

    /* Section dividers: centered pinline */
    section,
    footer {
        position: relative;
    }
    section::after {
        content: '';
        position: absolute;
        bottom: -0.5px;
        left: 25%;
        width: 50%;
        border-top: 0.5px solid #ff4d4d;
        z-index: 10;
    }
    section {
        padding-top: 4rem !important;
        padding-bottom: 4rem !important;
    }

    /* Cost table: stack on mobile */
    #pricing table {
        display: block;
    }
    #pricing thead {
        display: none;
    }
    #pricing tbody {
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding: 16px;
    }
    #pricing tr {
        display: flex;
        flex-direction: column;
        padding: 12px;
        border: 1px solid rgba(255,255,255,0.05);
        border-radius: 8px;
        background: rgba(255,255,255,0.02);
    }
    #pricing td {
        padding: 4px 0 !important;
    }
    #pricing td:first-child {
        font-weight: bold;
        border-bottom: 1px solid rgba(255,255,255,0.05);
        padding-bottom: 8px !important;
        margin-bottom: 4px;
    }

    /* Footer */
    footer.relative {
        background: rgba(0, 0, 0, 0.2) !important;
    }
}
