/* ===================================
   CSS Reset & Base Styles
   =================================== */

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: var(--font-normal);
    line-height: 1.6;
    color: var(--color-text-primary);
    background: var(--color-bg-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === Typography === */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: var(--font-bold);
    line-height: 1.2;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

h1 {
    font-size: clamp(var(--text-2xl), 5vw, var(--text-4xl));
}

h2 {
    font-size: clamp(var(--text-xl), 4vw, var(--text-3xl));
}

h3 {
    font-size: clamp(var(--text-lg), 3vw, var(--text-2xl));
}

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

a {
    color: var(--color-neon-cyan);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-primary-light);
}

/* === Form Elements === */

button,
input,
select,
textarea {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

button {
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

input:focus,
button:focus,
select:focus,
textarea:focus {
    outline: none;
}

/* === Images === */

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

img {
    height: auto;
}

/* === Lists === */

ul,
ol {
    list-style: none;
}

/* === Tables === */

table {
    border-collapse: collapse;
    border-spacing: 0;
}

/* === Selection === */

::selection {
    background: var(--color-primary);
    color: var(--color-text-primary);
}

/* === Scrollbar (Webkit) === */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--color-primary);
    border-radius: var(--radius-sm);
}

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

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--color-primary) var(--color-bg-secondary);
}

/* ===================================
   Accessibility
   =================================== */

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Focus visible for keyboard navigation */
:focus-visible {
    outline: 2px solid var(--color-neon-cyan);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --color-border: rgba(255, 255, 255, 0.5);
    }

    button,
    input {
        border-width: 2px;
    }
}

/* Screen reader only content */
.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;
}

/* Skip link for keyboard navigation */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--color-primary);
    color: var(--color-text-primary);
    padding: var(--space-2) var(--space-4);
    z-index: var(--z-tooltip);
    transition: top var(--transition-fast);
}

.skip-link:focus {
    top: 0;
}

/* ===================================
   Utility Classes
   =================================== */

.hidden {
    display: none !important;
}

.invisible {
    visibility: hidden;
}

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

.text-gradient {
    background: linear-gradient(135deg, var(--color-neon-cyan), var(--color-primary), var(--color-accent));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.glow-text {
    text-shadow: 0 0 10px currentColor, 0 0 20px currentColor;
}

.neon-border {
    border: 1px solid var(--color-border-glow);
    box-shadow: var(--glow-cyan);
}
