:root {
    --bg-color: #020617;
    --text-color: #e2e8f0;
    --glass-bg: rgba(15, 23, 42, 0.6);
    --glass-border: rgba(255, 255, 255, 0.05);
    --bubble-bg: rgba(2, 6, 23, 0.2);
    --bubble-scrolled-bg: rgba(2, 6, 23, 0.6);
    --grid-line: rgba(255, 255, 255, 0.02);
    --primary-color: #d97757;
}

.light-mode {
    /* Changed from #f0eee6 to a softer off-white #fdfbf7 */
    --bg-color: #f8f1e2;
    --text-color: #0f172a;
    /* Secondary/Card color #e3dacc */
    --glass-bg: #e3dacc;
    --glass-border: rgba(217, 119, 87, 0.2);
    --bubble-bg: rgba(227, 218, 204, 0.8);
    --bubble-scrolled-bg: #e3dacc;
    --grid-line: rgba(0, 0, 0, 0.05);
}
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
        color: var(--text-color);
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
    }

.lazy-section {
    content-visibility: auto;
    contain-intrinsic-size: 600px;
}

@media (max-width: 768px) {
    .lazy-section {
        contain-intrinsic-size: 900px;
    }
}

    /* Light Mode Overrides for Tailwind Classes - High Contrast & Specificity */
    .light-mode.text-slate-200,
    .light-mode .text-slate-200 {
        color: #1e293b !important;
    }

    .light-mode .text-slate-300 {
        color: #334155 !important;
    }

    /* slate-800 */
    .light-mode .text-slate-400 {
        color: #475569 !important;
    }

    /* slate-600 */
    .light-mode .text-slate-500 {
        color: #64748b !important;
    }

    /* slate-500 */
    .light-mode .text-slate-600 {
        color: #475569 !important;
    }

    /* Card Backgrounds */
    .light-mode .bg-slate-900 {
        background-color: #e3dacc !important;
        border-color: rgba(217, 119, 87, 0.2) !important;
    }

    .light-mode .bg-slate-950\/50 {
        background-color: rgba(227, 218, 204, 0.5) !important;
    }

    /* Engine Node Labels - Fix dark highlight in light mode */
    .light-mode .bg-slate-900\/80 {
        background-color: rgba(227, 218, 204, 0.95) !important;
        color: #0f172a !important;
        /* Darkest slate for max contrast */
        border: 1px solid rgba(217, 119, 87, 0.15);
    }

    /* Borders */
    .light-mode .border-white\/5 {
        border-color: rgba(0, 0, 0, 0.05) !important;
    }

    .light-mode .border-white\/10 {
        border-color: rgba(0, 0, 0, 0.1) !important;
    }

    .light-mode .stroke-white\/10 {
        stroke: rgba(0, 0, 0, 0.1) !important;
    }

    /* Primary Color Overrides for Icons & Text (Global) */
    .light-mode .text-indigo-400,
    .light-mode .text-blue-400,
    .light-mode .text-green-400,
    .light-mode .text-purple-400,
    .light-mode .text-pink-400,
    .light-mode .text-orange-400,
    .light-mode .text-teal-400,
    .light-mode .text-violet-400,
    .light-mode .text-cyan-400,
    .light-mode .text-yellow-400 {
        color: var(--primary-color) !important;
    }

    /* Pricing Section Specific Overrides (Restore Purple for Pro) */
    .light-mode #pricing .text-indigo-400 {
        color: #6366f1 !important;
        /* Restore purple text */
    }

    .light-mode #pricing .border-indigo-500 {
        border-color: #6366f1 !important;
        /* Restore purple border */
    }

    .light-mode #pricing .bg-indigo-900\/10 {
        background-color: rgba(99, 102, 241, 0.1) !important;
        /* Light purple bg */
    }

    .light-mode #pricing .bg-indigo-500 {
        background-color: #6366f1 !important;
        /* Restore purple tag */
    }

    /* Pricing Buttons */
    .light-mode #pricing .bg-slate-800 {
        background-color: #1e293b !important;
        /* Dark button for Starter */
        color: #ffffff !important;
    }

    .light-mode #pricing button.bg-indigo-600\/50 {
        background-color: #818cf8 !important;
        /* Purple button for Pro */
        color: #ffffff !important;
        opacity: 1 !important;
        /* Make it look active */
    }

    .light-mode #pricing button.bg-slate-800\/50 {
        background-color: #94a3b8 !important;
        /* Grey button for Enterprise */
        color: #f1f5f9 !important;
    }

    /* Feature Card Terminal Text - Black in Light Mode */
    .light-mode .bg-black\/30.text-green-400 {
        color: #000000 !important;
        background-color: rgba(0, 0, 0, 0.05) !important;
        border-color: rgba(0, 0, 0, 0.1) !important;
    }

    /* Pill Backgrounds */
    .light-mode .bg-indigo-500\/10,
    .light-mode .bg-green-500\/10,
    .light-mode .bg-indigo-500\/20,
    .light-mode .bg-blue-500\/20,
    .light-mode .bg-green-500\/20,
    .light-mode .bg-purple-500\/20,
    .light-mode .bg-pink-500\/20,
    .light-mode .bg-orange-500\/20,
    .light-mode .bg-teal-500\/20,
    .light-mode .bg-violet-500\/20,
    .light-mode .bg-cyan-500\/20,
    .light-mode .bg-yellow-500\/20 {
        background-color: rgba(217, 119, 87, 0.1) !important;
        border-color: rgba(217, 119, 87, 0.2) !important;
    }

    /* Gradient Text Override */
    .light-mode .bg-clip-text {
        background-image: none !important;
        -webkit-text-fill-color: var(--primary-color) !important;
        color: var(--primary-color) !important;
    }

    .light-mode .glow-text {
        text-shadow: none !important;
    }

    /* Buttons (General) */
    .light-mode .bg-indigo-600 {
        background-color: var(--primary-color) !important;
        color: #fff !important;
    }

    .light-mode .bg-indigo-600:hover {
        background-color: #c0664b !important;
    }

    /* Footer */
    .light-mode footer {
        background-color: #e3dacc !important;
        border-top-color: rgba(217, 119, 87, 0.1) !important;
    }

    /* Footer Specific High Contrast */
    .light-mode footer .text-slate-500,
    .light-mode footer .text-slate-600 {
        color: #1e293b !important;
        /* Dark slate for better legibility on beige */
    }

    .light-mode footer a:hover {
        color: var(--primary-color) !important;
    }

    .light-mode footer .bg-slate-800 {
        background-color: #0f172a !important;
        /* Ensure logo bg remains dark */
        color: #ffffff !important;
    }

    .light-mode #theme-toggle {
        color: var(--primary-color);
    }

#loader {
    background-color: var(--bg-color) !important;
}
/* SVG Diagram Overrides */
    .light-mode #connection-markers circle {
        fill: var(--primary-color) !important;
    }

    .light-mode .beam-path {
        stroke: var(--primary-color) !important;
        filter: none !important;
    }

    .light-mode #static-tracks path {
        stroke: rgba(0, 0, 0, 0.15) !important;
    }

    /* Engine Labels - Dark and Legible */
    .light-mode #path-labels text {
        fill: #1e293b !important;
        /* Dark slate/black */
        font-weight: 700;
        font-family: 'JetBrains Mono', monospace;
        font-size: 11px;
    }

    /* Invert CTA button in light mode */
    .light-mode a[href="https://console.soarlabs.tech"].bg-white {
        background-color: #0f172a !important;
        color: #ffffff !important;
    }

    .light-mode a[href="https://console.soarlabs.tech"].bg-white:hover {
        background-color: #1e293b !important;
}

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

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}

.light-mode ::-webkit-scrollbar-thumb {
    background: #cbd5e1;
}
::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

/* New Glass Bubble Styles */
.glass-bubble {
    background: var(--bubble-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    transition: all 0.5s cubic-bezier(0.32, 0.72, 0, 1);
}

.glass-bubble.scrolled {
    background: var(--bubble-scrolled-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.36);
}

.glow-text {
    text-shadow: 0 0 40px rgba(56, 189, 248, 0.5);
}

.grid-bg {
    background-size: 50px 50px;
    background-image: linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
            linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
}

/* Animation Utilities */
.fade-in {
    animation: fadeIn 0.8s ease-out forwards;
    opacity: 0;
}

.delay-100 {
    animation-delay: 0.1s;
}

.delay-200 {
    animation-delay: 0.2s;
}

.delay-300 {
    animation-delay: 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

@keyframes pulse-slow {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

.animate-pulse-slow {
    animation: pulse-slow 3s infinite;
}

/* Flow Animations */
@keyframes flow-beam {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.animate-flow-beam {
    animation: flow-beam 3s infinite linear;
}

@keyframes flow-packet-move {
    0% {
        left: 0%;
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        left: 100%;
        opacity: 0;
    }
}

.animate-flow-packet {
    position: absolute;
    animation: flow-packet-move 2s infinite linear;
}

/* Vertical Scroll Animation */
@keyframes scroll-vertical {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-50%);
    }
}

.animate-scroll-vertical {
    animation: scroll-vertical 10s linear infinite;
}

/* Horizontal Scroll Animation */
@keyframes scroll-horizontal {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.animate-scroll-horizontal {
    display: flex;
    gap: 1rem;
    animation: scroll-horizontal 10s linear infinite;
    width: max-content;
}

.mask-gradient-y {
    mask-image: linear-gradient(to bottom, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to bottom, transparent, black 10%, black 90%, transparent);
}

.mask-gradient-x {
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

/* Animated Beam Styles */
.beam-path {
    stroke-dasharray: 100 1000;
    stroke-dashoffset: 1100;
    animation: beam-flow 3s linear infinite;
}

.beam-path-reverse {
    stroke-dasharray: 100 1000;
    stroke-dashoffset: -100;
    animation: beam-flow-reverse 3s linear infinite;
}

@keyframes beam-flow {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes beam-flow-reverse {
    to {
        stroke-dashoffset: 1100;
    }
}
::view-transition-old(root),
::view-transition-new(root) {
    animation: none;
    mix-blend-mode: normal;
}

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.back-to-top {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    width: 3rem;
    height: 3rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    color: #fff;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    z-index: 60;
}

.back-to-top:hover {
    background: rgba(99, 102, 241, 0.9);
    border-color: rgba(99, 102, 241, 0.5);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}