/* =========================================
   Base Styles & Global Reset
   ========================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    outline-color: var(--primary);
}

html {
    font-size: 16px; /* Base size for rem calculations */
    scroll-behavior: smooth;
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-body);
    color: var(--text-body);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    max-width: 100vw;
}

/* Hero Canvas - Fixed Background */
#hero-canvas {
    position: fixed;
    top: 20px;
    left: 0;
    width: 100%;
    height: 120vh;
    z-index: -3;
    pointer-events: none;
    opacity: 0.3;
}

/* 3D Spatial Grid Background */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-image: 
        linear-gradient(rgba(0, 240, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 240, 255, 0.05) 1px, transparent 1px);
    background-size: 80px 80px;
    transform: perspective(500px) rotateX(60deg);
    z-index: -99;
    pointer-events: none;
    mask-image: radial-gradient(circle at center, black 30%, transparent 80%);
    animation: grid-flow 4s linear infinite;
}

.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* Typography Defaults */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    color: var(--text-main);
    line-height: 1.2;
    margin-bottom: var(--space-md);
}

p {
    margin-bottom: var(--space-md);
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

ul {
    list-style: none;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-body);
}
::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Glass Effect Utility */
.glass-effect {
    background: var(--surface-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
}

.glass-effect:hover {
    background: var(--surface-glass-hover);
    border-color: rgba(255, 255, 255, 0.15);
}