:root {
    --brand-gradient: linear-gradient(135deg, #3b5dfc 0%, #38bdf8 50%, #7dd3fc 100%);
    --brand-gradient-horizontal: linear-gradient(90deg, #3b5dfc 0%, #38bdf8 50%, #7dd3fc 100%);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-weight: 700;
    background-color: #16203a;
    background-image:
        radial-gradient(ellipse 120% 80% at 50% -20%, rgba(59, 93, 252, 0.10), transparent 55%),
        radial-gradient(ellipse 70% 50% at 100% 50%, rgba(56, 189, 248, 0.06), transparent 50%),
        radial-gradient(ellipse 70% 50% at 0% 80%, rgba(59, 93, 252, 0.05), transparent 50%);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Keep supporting copy consistently bold without changing headline weights. */
body :where(.font-light, .font-normal, .font-medium, .font-semibold),
button,
input,
textarea,
select,
option,
.chat-header-title,
.chat-header-sub,
.chat-msg,
.chat-input,
.chat-disclaimer {
    font-weight: 700 !important;
}

/* Animated aurora blobs (hero) */
.aurora-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    mix-blend-mode: screen;
    pointer-events: none;
    will-change: transform, opacity;
}

/* Cursor-follow spotlight on hero */
.hero-spotlight {
    --sx: 50%;
    --sy: 38%;
}
.hero-spotlight::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    background: radial-gradient(
        650px circle at var(--sx) var(--sy),
        rgba(56, 189, 248, 0.14) 0%,
        rgba(59, 93, 252, 0.06) 35%,
        transparent 55%
    );
    opacity: 0.85;
}

/* Film grain / noise */
.noise-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 5;
    opacity: 0.035;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@keyframes heroBeamRotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes sectionBorderFlow {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 200% 50%;
    }
}

/* Light beams */
.hero-beams {
    position: absolute;
    inset: -20%;
    pointer-events: none;
    z-index: 1;
    opacity: 0.35;
    background:
        conic-gradient(from 210deg at 50% 50%, transparent 0deg, rgba(59, 93, 252, 0.05) 60deg, transparent 120deg, rgba(125, 211, 252, 0.06) 200deg, transparent 280deg);
    animation: heroBeamRotate 48s linear infinite;
    mask-image: radial-gradient(ellipse 65% 55% at 50% 45%, black 15%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse 65% 55% at 50% 45%, black 15%, transparent 70%);
}

/* Hero background mesh */
.hero-mesh {
    background:
        radial-gradient(ellipse 90% 65% at 50% -15%, rgba(59, 93, 252, 0.22) 0%, transparent 58%),
        radial-gradient(ellipse 55% 45% at 88% 28%, rgba(56, 189, 248, 0.14) 0%, transparent 52%),
        radial-gradient(ellipse 55% 45% at 12% 72%, rgba(59, 93, 252, 0.12) 0%, transparent 52%),
        linear-gradient(180deg, #182238 0%, #131c30 45%, #101828 100%);
}

/* Subtle grid overlay */
.grid-overlay {
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 30%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 30%, transparent 70%);
}

/* Glass card effect */
.glass-card {
    background: linear-gradient(155deg, rgba(40, 52, 78, 0.85) 0%, rgba(32, 42, 64, 0.78) 50%, rgba(28, 38, 58, 0.82) 100%);
    backdrop-filter: blur(22px) saturate(140%);
    -webkit-backdrop-filter: blur(22px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow:
        0 4px 24px -8px rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(56, 189, 248, 0.04) inset,
        0 1px 0 rgba(255, 255, 255, 0.04) inset;
    transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.35s ease, box-shadow 0.45s ease;
    position: relative;
    overflow: hidden;
}
.glass-card:not(.featured-card)::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        115deg,
        transparent 40%,
        rgba(255, 255, 255, 0.06) 48%,
        rgba(255, 255, 255, 0.02) 52%,
        transparent 60%
    );
    transform: translateX(-120%);
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}
.glass-card:not(.featured-card):hover::before {
    transform: translateX(120%);
}
.glass-card:hover {
    border-color: rgba(56, 189, 248, 0.42);
    box-shadow:
        0 28px 60px -18px rgba(59, 93, 252, 0.25),
        0 0 40px -12px rgba(56, 189, 248, 0.18),
        0 0 0 1px rgba(56, 189, 248, 0.12) inset;
    transform: translateY(-8px) scale(1.01);
}

/* Featured card */
.featured-card {
    background: linear-gradient(165deg, rgba(34, 52, 80, 0.6) 0%, rgba(30, 40, 62, 0.92) 45%, rgba(26, 35, 55, 0.95) 100%);
    border: 1px solid rgba(56, 189, 248, 0.45);
    box-shadow:
        0 0 60px -12px rgba(56, 189, 248, 0.35),
        0 24px 55px -18px rgba(0, 0, 0, 0.55),
        0 0 80px -30px rgba(59, 93, 252, 0.2) inset;
    position: relative;
}
.featured-card::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: var(--brand-gradient-horizontal);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    -webkit-mask-composite: xor;
    pointer-events: none;
    opacity: 0.7;
}

/* Input styles */
.custom-input {
    background: rgba(28, 37, 56, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
    transition: all 0.25s ease;
}
.custom-input:focus {
    outline: none;
    border-color: #38bdf8;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
    background: rgba(28, 37, 56, 1);
}
.custom-input.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}
.custom-input.success {
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12);
}

textarea.custom-input {
    min-height: 140px;
    resize: vertical;
    line-height: 1.5;
}

.consent-checkbox {
    accent-color: #38bdf8;
    cursor: pointer;
}
.consent-checkbox.error {
    outline: 2px solid #ef4444;
    outline-offset: 2px;
}

/* Button gradient */
.btn-gradient {
    background: var(--brand-gradient);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}
.btn-gradient::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 50%, rgba(255, 255, 255, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.btn-gradient:hover::after {
    opacity: 1;
}
.btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px -10px rgba(56, 189, 248, 0.45);
}
.btn-gradient:active {
    transform: translateY(0);
    box-shadow: 0 8px 25px -8px rgba(56, 189, 248, 0.35);
}

/* Shimmer loading for button */
.btn-loading {
    pointer-events: none;
    background-size: 200% 100%;
    animation: shimmer 1.8s linear infinite;
    background-image: linear-gradient(90deg,
            rgba(56, 189, 248, 0.4) 0%,
            rgba(125, 211, 252, 0.6) 20%,
            rgba(56, 189, 248, 0.8) 40%,
            rgba(125, 211, 252, 0.6) 60%,
            rgba(56, 189, 248, 0.4) 80%,
            rgba(56, 189, 248, 0.4) 100%);
}

/* Scroll-triggered reveal: Optimized GPU-only transition (no blur filter) */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    will-change: opacity, transform;
    transition:
        opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Animated section divider */
.section-divider-glow {
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(59, 93, 252, 0.15) 15%,
        rgba(56, 189, 248, 0.55) 50%,
        rgba(59, 93, 252, 0.15) 85%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: sectionBorderFlow 8s linear infinite;
}

/* Skip rendering of below-fold sections until they scroll into view */
#pricing,
#about,
#lead-form {
    content-visibility: auto;
    contain-intrinsic-size: auto 900px;
}

/* Secondary CTA — animated border */
.btn-glass-outline {
    position: relative;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(148, 163, 184, 0.25);
    box-shadow: 0 0 24px -8px rgba(59, 93, 252, 0.2);
    transition: color 0.3s ease, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s ease;
}
.btn-glass-outline::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(
        120deg,
        rgba(59, 93, 252, 0.25),
        rgba(56, 189, 248, 0.55),
        rgba(59, 93, 252, 0.25),
        rgba(125, 211, 252, 0.35)
    );
    background-size: 300% 100%;
    animation: sectionBorderFlow 6s linear infinite;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    -webkit-mask-composite: xor;
    pointer-events: none;
    opacity: 0.65;
}
.btn-glass-outline:hover {
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 16px 40px -12px rgba(56, 189, 248, 0.35);
}

/* Icon holder glow */
.icon-glow {
    position: relative;
    z-index: 0;
    isolation: isolate;
    box-shadow: 0 0 24px -4px rgba(59, 93, 252, 0.35);
}
.icon-glow::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(59, 93, 252, 0.4), rgba(56, 189, 248, 0.25));
    opacity: 0;
    z-index: -1;
    filter: blur(10px);
    transition: opacity 0.35s ease;
}
.glass-card:hover .icon-glow::after,
.featured-card:hover .icon-glow::after {
    opacity: 0.9;
}

/* 3D brain full-screen background */
.hero-brain {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    opacity: 0.35;
    overflow: hidden;
}
.hero-brain img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
@media (max-width: 1024px) {
    .hero-brain { opacity: 0.3; }
}
@media (max-width: 768px) {
    .hero-brain { opacity: 0.22; }
}

/* Floating particles */
.hero-particles span {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 9999px;
    background: rgba(186, 230, 253, 0.75);
    box-shadow: 0 0 12px rgba(125, 211, 252, 0.6);
    pointer-events: none;
}

/* Navbar glass enhancement when scrolled (JS still sets rgba) */
#navbar {
    transition: background-color 0.35s ease, backdrop-filter 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

/* Mobile Menu Toggle & Drawer Neon Styling */
.mobile-menu-btn {
    color: #38bdf8;
    background: rgba(14, 165, 233, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.5);
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.35), inset 0 0 8px rgba(56, 189, 248, 0.15);
    text-shadow: 0 0 8px rgba(56, 189, 248, 0.7);
    transition: all 0.25s ease;
}

.mobile-menu-btn:hover,
.mobile-menu-btn:focus-visible,
.mobile-menu-btn[aria-expanded="true"] {
    color: #38bdf8;
    background: rgba(14, 165, 233, 0.22);
    border-color: rgba(56, 189, 248, 0.9);
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.6), 0 0 35px rgba(56, 189, 248, 0.35), inset 0 0 12px rgba(56, 189, 248, 0.25);
    text-shadow: 0 0 12px rgba(56, 189, 248, 1), 0 0 20px rgba(56, 189, 248, 0.6);
}

.mobile-menu-container {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.75rem !important;
}

.mobile-menu-link {
    display: block !important;
    width: 100% !important;
    padding: 0.875rem 1.25rem;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.025em;
    color: #38bdf8 !important;
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.75), 0 0 20px rgba(56, 189, 248, 0.4);
    background: rgba(14, 165, 233, 0.1) !important;
    border: 1px solid rgba(56, 189, 248, 0.5) !important;
    border-radius: 0.75rem;
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.25), inset 0 0 8px rgba(56, 189, 248, 0.12);
    transition: all 0.25s ease;
    text-align: center;
}

.mobile-menu-link:hover,
.mobile-menu-link:focus-visible,
.mobile-menu-link:active {
    color: #7dd3fc !important;
    background: rgba(14, 165, 233, 0.22) !important;
    border-color: rgba(56, 189, 248, 0.9) !important;
    box-shadow: 0 0 22px rgba(56, 189, 248, 0.55), 0 0 35px rgba(56, 189, 248, 0.3), inset 0 0 12px rgba(56, 189, 248, 0.25);
    text-shadow: 0 0 14px rgba(56, 189, 248, 1), 0 0 25px rgba(56, 189, 248, 0.8);
    transform: translateY(-1px);
}

/* Badge pulse */
.badge-pulse {
    animation: pulseSoft 2.5s ease-in-out infinite;
}

/* Success checkmark animation */
.checkmark-circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    animation: checkmarkCircle 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}
.checkmark-check {
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: checkmarkCheck 0.35s cubic-bezier(0.65, 0, 0.45, 1) 0.35s forwards;
}
@keyframes checkmarkCircle {
    to {
        stroke-dashoffset: 0;
    }
}
@keyframes checkmarkCheck {
    to {
        stroke-dashoffset: 0;
    }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: #0b0f1a;
}
::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #64748b, #475569);
    box-shadow: 0 0 10px rgba(59, 93, 252, 0.25);
}

/* ── Pulsating light bulb (service cards) ── */
.bulb-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    color: #fbbf24;
    background: radial-gradient(circle at 50% 35%, rgba(251, 191, 36, 0.2), rgba(59, 93, 252, 0.12) 70%);
    border: 1px solid rgba(251, 191, 36, 0.4);
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, border-color 0.3s ease;
    animation: bulbPulse 16s ease-in-out infinite;
}
.bulb-btn svg {
    width: 1.35rem;
    height: 1.35rem;
    filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.85));
}
.bulb-btn:hover {
    transform: scale(1.12);
    border-color: rgba(251, 191, 36, 0.75);
}
.bulb-btn:focus-visible {
    outline: 2px solid #38bdf8;
    outline-offset: 2px;
}
@keyframes bulbPulse {
    0%, 100% {
        box-shadow:
            0 0 0 0 rgba(251, 191, 36, 0.25),
            0 0 12px -2px rgba(251, 191, 36, 0.3);
    }
    50% {
        box-shadow:
            0 0 0 8px rgba(251, 191, 36, 0),
            0 0 22px 2px rgba(251, 191, 36, 0.45);
    }
}

/* ── Service info modal ── */
.service-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 1.25rem;
}
.service-modal[hidden] {
    display: none;
}
.service-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 7, 15, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.service-modal-card {
    position: relative;
    width: 100%;
    max-width: 480px;
    max-height: calc(100vh - 2.5rem);
    overflow-y: auto;
    padding: 2rem 1.75rem;
    border-radius: 20px;
    background: linear-gradient(160deg, rgba(40, 52, 78, 0.97), rgba(28, 38, 58, 0.99));
    box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.7);
    animation: modalPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform: translateZ(0);
    will-change: transform;
}
/* Pulsating gradient border around the popup card */
@property --border-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}
.service-modal-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 2px;
    background: conic-gradient(
        from var(--border-angle),
        rgba(34, 197, 94, 0) 0deg,
        rgba(34, 197, 94, 0.95) 50deg,
        rgba(34, 197, 94, 0) 110deg,
        rgba(34, 197, 94, 0) 360deg
    );
    animation: modalBorderPulse 9s linear infinite;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    -webkit-mask-composite: xor;
    pointer-events: none;
    transform: translateZ(0);
    will-change: transform;
}
@keyframes modalBorderPulse {
    from { --border-angle: 0deg; }
    to { --border-angle: 360deg; }
}
@keyframes modalPop {
    0% { opacity: 0; transform: translateY(16px) scale(0.96); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
.service-modal-close {
    position: absolute;
    top: 0.9rem;
    right: 0.9rem;
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    transition: all 0.25s ease;
    transform: translateZ(0);
    will-change: transform;
}
.service-modal-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    transform: rotate(90deg);
}
.service-modal-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.12);
    border: 1px solid rgba(251, 191, 36, 0.3);
    box-shadow: 0 0 24px -6px rgba(251, 191, 36, 0.5);
}
.service-modal-icon svg { width: 1.5rem; height: 1.5rem; }
.service-modal-eyebrow {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #38bdf8;
    margin-bottom: 0.5rem;
}
.service-modal-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.75rem;
    line-height: 1.25;
}
.service-modal-body {
    color: #cbd5e1;
    font-size: 0.95rem;
    line-height: 1.7;
}
.service-modal-body p { margin-bottom: 0.75rem; }
.service-modal-body p:last-child { margin-bottom: 0; }
.service-modal-body strong { color: #39ff14; }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .hero-beams,
    .aurora-blob,
    .animate-float,
    .animate-float-delayed,
    .animate-spin-slow,
    .animate-spin-slower,
    .animate-twinkle,
    .animate-gradient-x,
    .animate-aurora-shift,
    .animate-aurora-shift-reverse,
    .animate-border-flow,
    .animate-pulse-soft,
    .animate-pulse-neon,
    .badge-pulse,
    .btn-glass-outline::before,
    .section-divider-glow,
    .hero-brain,
    .hero-brain::after,
    .bulb-btn,
    .service-modal-card::before {
        animation: none !important;
    }
    .animate-bounce {
        animation: none !important;
    }
    .glass-card:not(.featured-card)::before {
        display: none;
    }
    .reveal {
        filter: none;
    }
    .hero-spotlight::after {
        opacity: 0.35;
    }
    #chat-launcher {
        animation: none !important;
    }
}
