:root {
    --brand: #6366f1;
    --brand-light: #818cf8;
    --brand-dark: #4f46e5;
    --brand-500: #6366f1;
    --brand-600: #4f46e5;
    --chat-font-size: 15px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, .05);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, .06);
    --transition: .2s cubic-bezier(.4, 0, .2, 1);
}

.dark {
    --brand-500: #818cf8;
    --brand-600: #6366f1;
}

* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Sora', -apple-system, BlinkMacSystemFont, sans-serif;
    overflow: hidden;
    height: 100dvh;
    letter-spacing: -.01em;
}

body.reduce-motion * {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
}

.mono {
    font-family: 'JetBrains Mono', 'SF Mono', monospace;
}

#chat-container::-webkit-scrollbar {
    width: 5px;
}

#chat-container::-webkit-scrollbar-track {
    background: transparent;
}

#chat-container::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, .2);
    border-radius: 10px;
}

#chat-container::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, .35);
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    scrollbar-width: none;
}

.typing-cursor::after {
    content: '';
    display: inline-block;
    width: 2px;
    height: 1.1em;
    background: linear-gradient(to bottom, var(--brand), var(--brand-light));
    margin-left: 3px;
    border-radius: 2px;
    animation: blink .8s ease-in-out infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1
    }

    50% {
        opacity: .3
    }
}

.glass-panel {
    background: rgba(255, 255, 255, .95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.dark .glass-panel {
    background: rgba(15, 23, 42, .95);
}

.message-anim {
    animation: slideUp .35s cubic-bezier(.16, 1, .3, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(12px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

#sidebar {
    transition: transform .3s cubic-bezier(.16, 1, .3, 1);
}

.bg-mesh {
    background: linear-gradient(135deg, #fafbfc 0%, #f1f5f9 100%);
}

.dark .bg-mesh {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

.float-anim {
    animation: gentleFloat 4s ease-in-out infinite;
}

@keyframes gentleFloat {

    0%,
    100% {
        transform: translateY(0)
    }

    50% {
        transform: translateY(-6px)
    }
}

.glow-pulse {
    box-shadow: 0 4px 14px rgba(99, 102, 241, .25);
    transition: box-shadow var(--transition);
}

.glow-pulse:hover {
    box-shadow: 0 6px 20px rgba(99, 102, 241, .35);
}

.counter-anim {
    animation: slideUp .4s ease;
}

.avatar-glow {
    box-shadow: 0 4px 16px rgba(99, 102, 241, .2);
}

.stat-card {
    transition: all var(--transition);
    border-radius: var(--radius-lg);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.service-card {
    transition: all var(--transition);
    border-radius: var(--radius-lg);
}

.service-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: rgba(99, 102, 241, .3) !important;
}

.matrix-char {
    position: fixed;
    color: #22c55e;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    animation: matrixFall 2.5s linear;
    z-index: 9999;
    pointer-events: none;
    text-shadow: 0 0 8px rgba(34, 197, 94, .6);
}

@keyframes matrixFall {
    0% {
        opacity: 1
    }

    to {
        transform: translateY(100vh);
        opacity: 0
    }
}

.timeline-dot {
    transition: all var(--transition);
}

.timeline-dot:hover {
    transform: scale(1.08);
    box-shadow: var(--shadow-md);
}

.chip-btn {
    transition: all var(--transition);
    border-radius: var(--radius-xl);
    font-weight: 500;
}

.chip-btn:hover {
    transform: translateY(-2px);
    border-color: var(--brand);
    color: var(--brand);
    box-shadow: 0 4px 12px rgba(99, 102, 241, .15);
}

.sidebar-btn {
    transition: all var(--transition);
    border-radius: var(--radius-md);
}

.sidebar-btn:hover {
    background: rgba(99, 102, 241, .06);
}

.dark .sidebar-btn:hover {
    background: rgba(99, 102, 241, .12);
}

.premium-btn {
    transition: all var(--transition);
    border-radius: var(--radius-md);
}

.premium-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, .25);
}

.premium-btn:active {
    transform: scale(.98);
}

.input-glow {
    transition: all var(--transition);
    border-radius: var(--radius-xl);
}

.input-glow:focus-within {
    border-color: var(--brand) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .1), var(--shadow-md);
}

.new-session-btn {
    transition: all var(--transition);
    background: linear-gradient(135deg, rgba(255, 255, 255, .9) 0%, rgba(255, 255, 255, .7) 100%);
}

.dark .new-session-btn {
    background: linear-gradient(135deg, rgba(30, 41, 59, .9) 0%, rgba(30, 41, 59, .7) 100%);
}

.new-session-btn:hover {
    border-color: var(--brand);
    box-shadow: 0 4px 12px rgba(99, 102, 241, .12);
}

.user-message {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    border-radius: var(--radius-lg) var(--radius-lg) 4px var(--radius-lg);
}

.ai-message {
    border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) 4px;
}

.toggle-switch {
    transition: all var(--transition);
}

.toggle-switch:hover {
    opacity: .9;
}

@keyframes confettiFall {
    to {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0
    }
}

::selection {
    background: rgba(99, 102, 241, .2);
    color: inherit;
}

:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

.loading-dot {
    animation: loadingPulse 1.4s infinite ease-in-out both;
}

.loading-dot:nth-child(1) {
    animation-delay: -.32s;
}

.loading-dot:nth-child(2) {
    animation-delay: -.16s;
}

.loading-dot:nth-child(3) {
    animation-delay: 0s;
}

@keyframes loadingPulse {

    0%,
    80%,
    100% {
        transform: scale(.6);
        opacity: .5
    }

    40% {
        transform: scale(1);
        opacity: 1
    }
}

.border-3 {
    border-width: 3px;
}

.border-t-3 {
    border-top-width: 3px;
}

.border-b-3 {
    border-bottom-width: 3px;
}

.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, .1);
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .2);
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, .3);
}

.animate-slide-up {
    animation: toastSlideUp .4s cubic-bezier(.16, 1, .3, 1);
}

@keyframes toastSlideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px)
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0)
    }
}