/* ============================================================
   HZX LABS — DESIGN SYSTEM (globals.css)
   Premium Agency Design Tokens & Foundation
   ============================================================ */

/* --- Google Fonts with font-display: swap for performance --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* --- CSS Custom Properties (Design Tokens) --- */
:root {
    /* Colors */
    --color-primary: #0F172A;
    --color-secondary: #1E293B;
    --color-accent: #2563EB;
    --color-accent-hover: #1d4ed8;
    --color-accent-dark: #1e40af;
    --color-cyan: #06B6D4;
    --color-success: #10B981;
    --color-warning: #F59E0B;
    --color-error: #EF4444;
    --color-light-bg: #F8FAFC;
    --color-white: #ffffff;
    --color-border: rgba(15, 23, 42, 0.04);
    --color-border-light: rgba(15, 23, 42, 0.02);

    /* Typography */
    --font-display: 'Space Grotesk', system-ui, -apple-system, sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Font Sizes */
    --text-xs: 0.6875rem;
    /* 11px */
    --text-sm: 0.8125rem;
    /* 13px */
    --text-base: 0.875rem;
    /* 14px */
    --text-md: 0.9375rem;
    /* 15px */
    --text-lg: 1rem;
    /* 16px */
    --text-xl: 1.125rem;
    /* 18px */
    --text-2xl: 1.375rem;
    /* 22px */
    --text-3xl: 1.75rem;
    /* 28px */
    --text-4xl: 2rem;
    /* 32px */
    --text-5xl: 2.5rem;
    /* 40px */
    --text-6xl: 3.25rem;
    /* 52px */
    --text-7xl: 4rem;
    /* 64px */
    --text-8xl: 4.25rem;
    /* 68px */

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;
    --space-32: 8rem;

    /* Border Radius */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.25rem;
    --radius-2xl: 1.5rem;
    --radius-3xl: 1.75rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.08);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.08);
    --shadow-2xl: 0 30px 60px -15px rgba(0, 0, 0, 0.12);
    --shadow-accent: 0 8px 24px -6px rgba(37, 99, 235, 0.25);
    --shadow-accent-lg: 0 12px 32px -8px rgba(37, 99, 235, 0.35);
    --shadow-success: 0 8px 24px -6px rgba(16, 185, 129, 0.25);

    /* Transitions */
    --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
    --duration-fast: 0.2s;
    --duration-base: 0.3s;
    --duration-slow: 0.5s;
    --duration-slower: 0.8s;

    /* Layout */
    --max-width: 1400px;
    --nav-height: 72px;
    --px-mobile: 1.25rem;
    --px-desktop: 2.5rem;
}

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

html {
    scroll-behavior: auto;
    /* Lenis handles smooth scroll */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    -moz-osx-font-smoothing: grayscale;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-body);
    background: var(--color-white);
    color: var(--color-primary);
    overflow-x: hidden;
    line-height: 1.6;
    font-size: var(--text-base);
}

img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
}

input,
button,
textarea,
select {
    font: inherit;
    color: inherit;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    background: none;
    border: none;
    cursor: pointer;
}

ul,
ol {
    list-style: none;
}

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

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

::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

/* Firefox scrollbar */
html {
    scrollbar-width: thin;
    scrollbar-color: #CBD5E1 var(--color-light-bg);
}

/* --- Selection Styles --- */
::selection {
    background: rgba(37, 99, 235, 0.15);
    color: var(--color-primary);
}

/* --- Typography System --- */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--color-primary);
}

p {
    line-height: 1.7;
}

/* --- Layout Container --- */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--px-mobile);
}

@media (min-width: 1024px) {
    .container {
        padding: 0 var(--px-desktop);
    }
}

/* --- Section Spacing --- */
.section {
    padding: var(--space-24) 0;
}

@media (min-width: 1024px) {
    .section {
        padding: var(--space-32) 0;
    }
}

/* --- Section Divider --- */
.section-divider {
    height: 1px;
    max-width: var(--max-width);
    margin: 0 auto;
    background: linear-gradient(90deg, transparent, rgba(15, 23, 42, 0.06), transparent);
}

/* --- Utility: Screen Reader Only --- */
.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;
}

/* --- Background Patterns --- */
.grid-bg {
    background-image:
        linear-gradient(rgba(15, 23, 42, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 23, 42, 0.025) 1px, transparent 1px);
    background-size: 80px 80px;
}

.dot-bg {
    background-image: radial-gradient(rgba(15, 23, 42, 0.04) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* --- Noise Texture Overlay --- */
.noise {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.015;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* --- Glow Orbs --- */
.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
}

/* --- Focus Visible Styles (Accessibility) --- */
:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* --- Responsive Images --- */
img[loading="lazy"] {
    background-color: var(--color-light-bg);
}

/* --- Logo Styling --- */
.logo {
    height: 45px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
    display: block;
}

/* --- Navbar Styles --- */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    transition: all 0.5s;
}

.nav.glass {
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.nav-link {
    font-size: 13px;
    font-weight: 500;
    color: rgba(15, 23, 42, 0.6);
    transition: color 0.2s;
}

.nav-link:hover {
    color: #0F172A;
}

.btn-mag {
    background: linear-gradient(135deg, #2563EB, #06B6D4);
    transition: all 0.3s;
}

.btn-mag:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px -8px rgba(37, 99, 235, 0.35);
}

/* --- Mobile Menu Styles --- */
.mob-menu {
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.mob-menu.open {
    transform: translateX(0);
}

.mlink {
    font-size: 40px;
    font-family: 'Space Grotesk', system-ui, -apple-system, sans-serif;
    font-weight: 700;
    color: #0F172A;
    transition: color 0.2s;
}

.mlink:hover {
    color: #2563EB;
}

.mlink.active {
    color: #2563EB;
}

/* --- Footer Styles --- */
.footer-container {
    background: #0F172A;
    padding-top: 64px;
    padding-bottom: 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.bg-primary {
    background-color: #0F172A;
}

/* --- Color Utility Classes --- */
.text-primary {
    color: #0F172A;
}

.text-secondary\/60 {
    color: rgba(30, 41, 59, 0.6);
}

.text-white {
    color: #ffffff;
}

.text-white\/15 {
    color: rgba(255, 255, 255, 0.15);
}

.text-white\/25 {
    color: rgba(255, 255, 255, 0.25);
}

.text-white\/30 {
    color: rgba(255, 255, 255, 0.3);
}

.text-white\/40 {
    color: rgba(255, 255, 255, 0.4);
}

.text-white\/50 {
    color: rgba(255, 255, 255, 0.5);
}

.text-white\/60 {
    color: rgba(255, 255, 255, 0.6);
}

.text-white\/80 {
    color: rgba(255, 255, 255, 0.8);
}

.bg-success\/10 {
    background-color: rgba(16, 185, 129, 0.1);
}

.text-success {
    color: #10B981;
}

.bg-accent\/10 {
    background-color: rgba(37, 99, 235, 0.1);
}

.text-accent {
    color: #2563EB;
}

.shadow-accent\/20 {
    box-shadow: 0 8px 24px -6px rgba(37, 99, 235, 0.2);
}

.shadow-lg {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}

/* --- Premium Preloader Styles --- */
#preloader {
    position: fixed !important;
    inset: 0 !important;
    z-index: 99999 !important;
    background: #ffffff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: transform 0.8s cubic-bezier(0.76, 0, 0.24, 1), opacity 0.8s ease;
}

#preloader.loaded {
    transform: translateY(-100%);
    pointer-events: none;
}

.preloader-content {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.logo-container {
    position: relative;
    animation: logoFloat 3s ease-in-out infinite;
}

.loader-logo {
    height: 120px;
    width: auto;
    max-width: 300px;
    object-fit: contain;
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {

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

    50% {
        transform: translateY(-10px);
    }
}

.loader-text {
    animation: fadeInUp 0.8s ease-out 0.3s both;
}

.loader-subtext {
    animation: fadeInUp 0.8s ease-out 0.5s both;
}

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

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

.premium-loader {
    position: relative;
    width: 80px;
    height: 20px;
    margin-top: 30px;
    animation: fadeInUp 0.8s ease-out 0.7s both;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.loader-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563EB, #06B6D4);
    animation: bounce 1.4s ease-in-out infinite;
}

.dot-1 {
    animation-delay: 0s;
}

.dot-2 {
    animation-delay: 0.2s;
}

.dot-3 {
    animation-delay: 0.4s;
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }

    40% {
        transform: translateY(-20px) scale(1.2);
        opacity: 0.8;
    }
}