/* ============================================
   BASE STYLES - THE BAD COMPANY
   Reset, Typography, and Foundational Styles
   ============================================ */

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

/* HTML & Body Foundation */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-primary);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-secondary);
    background-color: var(--bg-primary);
    overflow-x: hidden;
    position: relative;
}

/* Grid Background Pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(0deg, transparent, transparent 1px, rgba(255, 255, 255, 0.02) 1px, rgba(255, 255, 255, 0.02) 2px),
        repeating-linear-gradient(90deg, transparent, transparent 1px, rgba(255, 255, 255, 0.02) 1px, rgba(255, 255, 255, 0.02) 2px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

/* Dot Matrix Overlay */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
    z-index: 0;
}

/* Typography Base */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 400;
    color: var(--text-primary);
    line-height: 1.2;
}

h1 {
    font-size: clamp(60px, 8vw, 120px);
    letter-spacing: -2px;
    text-transform: lowercase;
}

h2 {
    font-size: clamp(36px, 5vw, 56px);
    letter-spacing: -1px;
    text-transform: lowercase;
}

h3 {
    font-size: clamp(24px, 3vw, 36px);
}

h4 {
    font-size: clamp(20px, 2.5vw, 28px);
}

p {
    margin-bottom: 16px;
}

/* Links */
a {
    color: var(--accent-cyan);
    text-decoration: none;
    transition: all var(--transition-base);
}

a:hover {
    color: var(--accent-green);
}

a:focus {
    outline: 2px solid var(--accent-cyan);
    outline-offset: 2px;
}

/* Lists */
ul, ol {
    list-style: none;
}

/* Images */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Selection Styles */
::selection {
    background-color: var(--accent-green);
    color: var(--bg-primary);
}

::-moz-selection {
    background-color: var(--accent-green);
    color: var(--bg-primary);
}

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

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

::-webkit-scrollbar-thumb {
    background-color: var(--accent-green);
    border-radius: 0;
}

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

/* Focus Visible for Accessibility */
:focus-visible {
    outline: 2px solid var(--accent-cyan);
    outline-offset: 2px;
}

/* Skip to Main Content (Accessibility) */
.skip-to-main {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--accent-green);
    color: var(--bg-primary);
    padding: 12px 20px;
    text-decoration: none;
    font-family: var(--font-mono);
    font-weight: bold;
    z-index: 9999;
}

.skip-to-main:focus {
    top: 0;
}

/* Screen Reader Only Text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Dot Matrix Font Simulation */
.doto {
    font-family: var(--font-mono);
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Container Utility */
.container {
    position: relative;
    z-index: var(--z-content);
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* Section Spacing */
section {
    padding: var(--spacing-xxxl) 0;
    position: relative;
}

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

/* Responsive Typography Adjustments */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }
    
    section {
        padding: var(--spacing-xxl) 0;
    }
}
