/* --- Neural Core V2 - Premium Design System --- */
@import 'tokens.css';

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Global Reset for Text Decoration */
a,
button,
.btn,
h1,
h2,
h3,
h4,
h5,
h6,
p,
span,
div,
li {
    text-decoration: none !important;
}

html {
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    width: 100%;
    min-height: 100vh;
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
}

body {
    display: flex;
    flex-direction: column;
}

body.loading {
    overflow: hidden !important;
}

/* Typography Hub */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    color: var(--color-text);
    margin-bottom: var(--space-md);
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: 2px;
}

h1 {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 900;
}

h2 {
    font-size: clamp(2rem, 5vw, 2.8rem);
    font-weight: 800;
}

h3 {
    font-size: 1.75rem;
    font-weight: 700;
}

.text-gradient {
    background: var(--grad-neon);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.glow-text {
    text-shadow: 0 0 20px rgba(var(--color-primary-rgb), 0.5);
}

.text-dim {
    color: var(--color-text-dim);
}

/* Layout Architecture */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

.section {
    padding: 120px 0;
    overflow: hidden;
    /* Global safety for mobile */
}

@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }

    .section {
        padding: 80px 0;
    }
}

/* Premium Components */
.card {
    background: rgba(var(--color-surface-rgb), 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border-radius: var(--radius-full);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: 0.3s;
    border: none;
    font-size: 0.9rem;
    gap: 10px;
}

.btn-primary {
    background: var(--grad-neon);
    color: var(--color-text-inverse);
    box-shadow: var(--glow-primary);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 25px rgba(var(--color-primary-rgb), 0.5);
}

.btn-secondary {
    background: var(--color-surface-brighter);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.btn-ghost {
    background: transparent;
    color: var(--color-text-dim);
    border: 1px solid var(--color-border);
}

.btn-ghost:hover {
    color: var(--color-text);
    background: rgba(var(--color-primary-rgb), 0.05);
    border-color: rgba(var(--color-primary-rgb), 0.2);
}

/* Utilities */
.flex {
    display: flex;
    gap: var(--space-md);
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.grid {
    display: grid;
    gap: var(--space-xl);
}

@media (max-width: 768px) {
    .grid {
        grid-template-columns: 1fr !important;
    }

    .btn {
        width: 100%;
    }

    .flex {
        flex-wrap: wrap;
    }
}

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

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

::-webkit-scrollbar-thumb {
    background: var(--color-surface-brighter);
    border-radius: 20px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
}

.hidden {
    display: none !important;
}

/* --- Global Loader - High-Tech Synthesis Style --- */
.global-loader {
    position: fixed;
    inset: 0;
    background: var(--color-bg);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s;
}

.global-loader.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
}

.loader-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(var(--color-primary-rgb), 0.1);
    border-top: 3px solid var(--color-primary);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: loader-spin 1s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    box-shadow: 0 0 20px rgba(var(--color-primary-rgb), 0.2);
}

.loader-text {
    font-family: var(--font-display);
    color: var(--color-primary);
    font-size: 0.8rem;
    letter-spacing: 4px;
    font-weight: 800;
    animation: loader-pulse 1.5s infinite;
}

@keyframes loader-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes loader-pulse {

    0%,
    100% {
        opacity: 0.5;
        transform: scale(0.95);
    }

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