@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Primary Accent - Purple */
    --xq-purple: #7C3AED;
    --xq-purple-dark: #6D28D9;
    --xq-purple-light: #8B5CF6;
    /* Dark base */
    --xq-navy: #1E1B4B;
    /* Backgrounds */
    --xq-light: #F5F3FF;
    --xq-white: #FFFFFF;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    overflow-x: hidden;
    background-color: var(--xq-white);
    color: #334E68;
}

/* WCAG 1.4.3 — text-on-white contrast utility */
.text-brand-cyan-aa {
    color: var(--xq-purple-dark); /* #6D28D9 — 5.4:1 on white */
}

/* WCAG 1.4.3 — brand-cyan on dark backgrounds needs lighter shade */
.bg-brand-navy .text-brand-cyan,
[class*="bg-brand-navy"] .text-brand-cyan {
    color: #C4B5FD; /* purple-300, ~7.3:1 on navy */
}

/* Screen reader only utility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Scrollbar personalizzata XQ */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #fff; }
::-webkit-scrollbar-thumb { background: #DDD6FE; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--xq-purple); }

/* Glassmorphism Header */
.glass-nav {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(124, 58, 237, 0.08);
}

/* Gradient Text Effect */
.text-gradient {
    background: linear-gradient(135deg, var(--xq-navy) 0%, var(--xq-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Feature Card Hover */
.feature-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: white;
    border: 1px solid rgba(30, 27, 75, 0.05);
}
.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px -5px rgba(124, 58, 237, 0.15);
    border-color: var(--xq-purple);
}

/* Hero Background Pattern */
.hero-mesh {
    background-color: #ffffff;
    background-image: radial-gradient(rgba(124, 58, 237, 0.06) 1px, transparent 1px);
    background-size: 30px 30px;
    position: relative;
    overflow: hidden;
}

/* Animated hero background — index.html hero */
.hero-aurora {
    position: relative;
    overflow: hidden;
}

/* Flowing gradient blobs — more visible, faster */
.hero-aurora::before,
.hero-aurora::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.85;
    pointer-events: none;
    will-change: transform;
    z-index: 0;
}
.hero-aurora::before {
    width: 750px;
    height: 750px;
    top: -15%;
    left: -8%;
    background: radial-gradient(circle, rgba(124,58,237,0.22) 0%, rgba(139,92,246,0.12) 35%, transparent 65%);
    animation: auroraFloat1 14s ease-in-out infinite;
}
.hero-aurora::after {
    width: 650px;
    height: 650px;
    bottom: -15%;
    right: -8%;
    background: radial-gradient(circle, rgba(109,40,217,0.20) 0%, rgba(167,139,250,0.10) 35%, transparent 65%);
    animation: auroraFloat2 18s ease-in-out infinite;
}

/* Additional animated blobs */
.hero-aurora-blob {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}
.hero-aurora-blob::before,
.hero-aurora-blob::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.7;
    will-change: transform;
}
.hero-aurora-blob::before {
    width: 550px;
    height: 550px;
    top: 15%;
    left: 30%;
    background: radial-gradient(circle, rgba(167,139,250,0.20) 0%, rgba(196,181,253,0.10) 35%, transparent 65%);
    animation: auroraFloat3 16s ease-in-out infinite;
}
.hero-aurora-blob::after {
    width: 500px;
    height: 500px;
    top: 45%;
    left: 8%;
    background: radial-gradient(circle, rgba(139,92,246,0.18) 0%, rgba(124,58,237,0.08) 35%, transparent 65%);
    animation: auroraFloat4 20s ease-in-out infinite;
}

/* Neural network canvas */
.hero-neural-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

@keyframes auroraFloat1 {
    0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
    25% { transform: translate(60px, -50px) scale(1.08) rotate(3deg); }
    50% { transform: translate(-40px, 60px) scale(0.92) rotate(-2deg); }
    75% { transform: translate(50px, 30px) scale(1.05) rotate(1deg); }
}
@keyframes auroraFloat2 {
    0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
    33% { transform: translate(-55px, -40px) scale(1.10) rotate(-3deg); }
    66% { transform: translate(45px, 55px) scale(0.90) rotate(2deg); }
}
@keyframes auroraFloat3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    20% { transform: translate(-45px, 30px) scale(1.12); }
    40% { transform: translate(35px, -55px) scale(0.88); }
    60% { transform: translate(55px, 20px) scale(1.06); }
    80% { transform: translate(-20px, -30px) scale(0.94); }
}
@keyframes auroraFloat4 {
    0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
    25% { transform: translate(40px, 45px) scale(1.09) rotate(4deg); }
    50% { transform: translate(-50px, -25px) scale(0.91) rotate(-3deg); }
    75% { transform: translate(25px, -45px) scale(1.05) rotate(1deg); }
}

/* Button Glow Styles */
.btn-primary {
    background: var(--xq-purple);
    color: white;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.4);
    background: var(--xq-purple-dark);
}

.btn-secondary {
    background: transparent;
    color: var(--xq-navy);
    border: 2px solid rgba(30, 27, 75, 0.1);
    transition: all 0.3s ease;
}
.btn-secondary:hover {
    border-color: var(--xq-purple);
    color: var(--xq-purple);
    background: rgba(124, 58, 237, 0.05);
}

/* --- HUBSPOT OVERRIDES --- */
.hsfc-Step__Banner,
div[data-hsfc-id="Banner"] {
    display: none !important;
    height: 0 !important;
    visibility: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
    background-image: linear-gradient(45deg, white, white) !important;
}

.hs-form-frame, .hubspot-link__container {
    background: transparent !important;
    background-image: linear-gradient(45deg, transparent, transparent) !important;
}

.hsfc-Step .hsfc-Step__Banner {
    background-color: white;
    background-image: linear-gradient(45deg, white, white) !important;
}

/* --- ADA ACCESSIBILITY --- */
.skip-nav {
    position: absolute;
    top: -100%;
    left: 16px;
    z-index: 9999;
    padding: 12px 24px;
    background: var(--xq-navy);
    color: white;
    font-weight: 700;
    font-size: 14px;
    border-radius: 0 0 8px 8px;
    text-decoration: none;
    transition: top 0.2s ease;
}
.skip-nav:focus {
    top: 0;
    outline: 3px solid var(--xq-purple);
    outline-offset: 2px;
}

*:focus-visible {
    outline: 3px solid var(--xq-purple);
    outline-offset: 2px;
}

a:focus-visible, button:focus-visible {
    outline: 3px solid var(--xq-purple);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Cross-fade for rotating word only */
#rotating-word {
    display: inline-block;
    transition: opacity 0.45s ease-in-out, transform 0.45s ease-in-out;
    opacity: 1;
    transform: translateY(0);
}
#rotating-word.fade-out {
    opacity: 0;
    transform: translateY(-8px);
}
#rotating-word.fade-in {
    opacity: 1;
    transform: translateY(0);
}

/* Desktop/mobile nav — explicit media queries as Tailwind CDN fallback */
@media (max-width: 1023px) {
    .hamburger-wrap { display: flex !important; align-items: center; }
    .desktop-nav { display: none !important; }
}
@media (min-width: 1024px) {
    .hamburger-wrap { display: none !important; }
    .desktop-nav { display: flex !important; align-items: center; }
}

/* Service card hover for activate page */
.service-card-hover {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.service-card-hover:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px -5px rgba(124, 58, 237, 0.15);
    border-color: var(--xq-purple);
}

/* Keyboard-triggered dropdown state */
[data-dropdown] [role="menu"].is-open {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}

/* WCAG 2.3.3 — Respect prefers-reduced-motion globally */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    /* AOS library — disable all scroll animations */
    [data-aos] {
        transition: none !important;
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
    .hero-aurora::before,
    .hero-aurora::after,
    .hero-aurora-blob::before,
    .hero-aurora-blob::after {
        animation: none !important;
    }
}