/* Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--color-bg-deep-dark);
    color: var(--color-text-primary);
    font-family: var(--font-body);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    font-weight: 500;
    color: var(--color-text-primary);
    letter-spacing: -0.02em;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

/* Backbone Infrastructure Glow */
@keyframes backbone-glow {
    0% {
        box-shadow: 0 0 5px rgba(139, 92, 246, 0.3);
        border-color: rgba(139, 92, 246, 0.1);
    }

    50% {
        box-shadow: 0 0 15px rgba(139, 92, 246, 0.6);
        border-color: rgba(139, 92, 246, 0.4);
    }

    100% {
        box-shadow: 0 0 5px rgba(139, 92, 246, 0.3);
        border-color: rgba(139, 92, 246, 0.1);
    }
}

.infrastructure-active {
    animation: backbone-glow 3s infinite ease-in-out;
}

.robust-panel {
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    /* Changed from 20px to 16px */
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
    /* Modified transition */
}

.robust-panel:hover {
    border-color: rgba(212, 175, 55, 0.2);
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.5), 0 0 20px var(--color-robust-glow);
    transform: translateY(-2px);
}

/* --- LIQUID PROGRESS --- */
.liquid-progress {
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.liquid-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-accent-primary), var(--color-accent-secondary));
    position: relative;
    transition: width 0.8s ease-in-out;
}

.liquid-progress-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: liquidSweep 2s infinite;
}

@keyframes liquidSweep {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* --- NEURAL GLOW --- */
.neural-glow {
    position: relative;
}

.neural-glow::before {
    content: '';
    position: absolute;
    inset: -5px;
    background: var(--color-accent-primary);
    filter: blur(15px);
    opacity: 0.15;
    z-index: -1;
    border-radius: inherit;
    animation: pulseGlow 3s infinite alternate;
}

/* App Container */
#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- SOVEREIGN GRID SYSTEM --- */
.sovereign-grid {
    display: grid;
    grid-template-columns: repeat(var(--grid-columns), 1fr);
    gap: var(--grid-gap);
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--space-8);
}

.col-span-12 {
    grid-column: span 12;
}

.col-span-8 {
    grid-column: span 8;
}

.col-span-6 {
    grid-column: span 6;
}

.col-span-4 {
    grid-column: span 4;
}

.col-span-3 {
    grid-column: span 3;
}

@media (max-width: 1200px) {

    .col-span-8,
    .col-span-4 {
        grid-column: span 12;
    }
}

@media (max-width: 768px) {

    .col-span-6,
    .col-span-3 {
        grid-column: span 12;
    }

    .sovereign-grid {
        padding: 0 var(--space-4);
    }
}

/* --- MESH BACKGROUND --- */
.mesh-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    background-color: var(--color-bg-deep);
    background-image:
        radial-gradient(at 0% 0%, rgba(1, 10, 31, 0.8) 0, transparent 50%),
        radial-gradient(at 50% 0%, rgba(212, 175, 55, 0.03) 0, transparent 50%),
        radial-gradient(at 100% 0%, rgba(1, 10, 31, 0.8) 0, transparent 50%);
    overflow: hidden;
}

.mesh-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3%3Ffilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.015;
    pointer-events: none;
}

/* --- FLEX UTILITIES --- */
.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.flex-column {
    display: flex;
    flex-direction: column;
}

.gap-2 {
    gap: var(--space-2);
}

.gap-4 {
    gap: var(--space-4);
}

/* --- TYPOGRAPHY UTILITIES --- */
.text-gold {
    color: var(--color-accent-primary);
}

.text-gradient-gold {
    background: linear-gradient(135deg, #facc15 0%, #ca8a04 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-xs {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Keep existing scrollbar styles but refine them to use variables */
::-webkit-scrollbar {
    width: 12px !important;
    height: 12px !important;
}

::-webkit-scrollbar-track {
    background: var(--color-bg-deep) !important;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--color-accent-primary), var(--color-accent-secondary)) !important;
    border-radius: 10px !important;
    border: 3px solid var(--color-bg-deep) !important;
}