/* ================================
   BASE STYLES & VARIABLES
   Core design system
   ================================ */

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

:root {
    /* Colors */
    --bg-primary: #0e0e11;
    --bg-secondary: #1a1a1f;
    --bg-tertiary: #25252d;
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-tertiary: #71717a;
    --blue: #3b82f6;
    --purple: #a855f7;
    --green: #10b981;
    --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #a855f7 100%);
    
    /* Typography Scale */
    --font-size-xs: 0.75rem;      /* 12px */
    --font-size-sm: 0.875rem;     /* 14px */
    --font-size-base: 1rem;       /* 16px */
    --font-size-lg: 1.125rem;     /* 18px */
    --font-size-xl: 1.25rem;      /* 20px */
    --font-size-2xl: 1.5rem;      /* 24px */
    --font-size-3xl: 2rem;        /* 32px */
    --font-size-4xl: 3rem;        /* 48px */
    --font-size-5xl: 4rem;        /* 64px */
    
    /* Spacing - 16px rhythm */
    --spacing-xs: 0.5rem;    /* 8px */
    --spacing-sm: 1rem;      /* 16px */
    --spacing-md: 1.5rem;    /* 24px */
    --spacing-lg: 2rem;      /* 32px */
    --spacing-xl: 3rem;      /* 48px */
    --spacing-2xl: 4rem;     /* 64px */
    --spacing-3xl: 6rem;     /* 96px - section padding */
    
    /* Border Radius */
    --radius-sm: 0.375rem;   /* 6px */
    --radius-md: 0.5rem;     /* 8px */
    --radius-lg: 0.75rem;    /* 12px */
    --radius-xl: 1rem;       /* 16px */
    --radius-2xl: 1.5rem;    /* 24px */
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4);
    --shadow-glow-blue: 0 0 40px rgba(59, 130, 246, 0.3);
    --shadow-glow-purple: 0 0 40px rgba(168, 85, 247, 0.3);
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Layout */
    --container-max-width: 1280px;
    --navbar-height: 72px;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    max-width: 100vw;
    /* Prevent white space on overscroll */
    background: var(--bg-primary);
    overscroll-behavior: none;
    overscroll-behavior-y: none;
    overscroll-behavior-x: none;
    min-height: 100vh;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: var(--font-size-base);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    /* Scroll & Overscroll Prevention */
    overscroll-behavior: none;
    overscroll-behavior-x: none;
    overscroll-behavior-y: none;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
    position: relative;
    width: 100%;
    max-width: 100%;
    touch-action: pan-y;
}

/* Noise texture overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.03;
    z-index: -1;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Container - Unified width system */
.container {
    max-width: var(--container-max-width); /* 1280px */
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
}

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

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

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

h1 {
    font-size: var(--font-size-5xl);
    font-weight: 800;
}

h2 {
    font-size: var(--font-size-3xl);
}

h3 {
    font-size: var(--font-size-2xl);
}

h4 {
    font-size: var(--font-size-xl);
}

p {
    line-height: 1.7;
}

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

/* Prevent images and SVGs from overflowing */
img, svg {
    max-width: 100%;
    height: auto;
}

/* Sections */
section {
    padding: var(--spacing-3xl) 0;
    position: relative;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.1);
    }
}

.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* Selection */
::selection {
    background: rgba(59, 130, 246, 0.3);
    color: var(--text-primary);
}

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

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

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Focus states */
*:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
}

/* Responsive breakpoints */
@media (max-width: 1024px) {
    :root {
        --spacing-3xl: 4rem;
    }
    
    h1 {
        font-size: var(--font-size-4xl);
    }
    
    h2 {
        font-size: var(--font-size-2xl);
    }
}

@media (max-width: 768px) {
    :root {
        --spacing-3xl: 3rem;
        --spacing-2xl: 3rem;
        --spacing-xl: 2rem;
    }
    
    .container {
        padding: 0 var(--spacing-md);
    }
    
    h1 {
        font-size: var(--font-size-3xl);
    }
    
    h2 {
        font-size: var(--font-size-xl);
    }
}

/* ================================
   SCROLL & OVERSCROLL FIX
   Removes white gaps, bounce effects,
   glow, rubber-band, and layout shifts
   ================================ */

/* Global overflow prevention */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

/* Android Chrome overscroll glow removal */
::-webkit-scrollbar-track {
    background: transparent;
}

/* Firefox scrollbar styling */
* {
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
    scrollbar-width: thin;
}

/* iOS Safari overscroll bounce fix */
@supports (-webkit-touch-callout: none) {
    html, body {
        -webkit-overflow-scrolling: auto;
        position: relative;
    }
}

/* Prevent horizontal scroll leaks - only on direct body children */
body > * {
    max-width: 100%;
}

/* Custom scroll containers (future use) */
[data-scroll], .scroll-container, .custom-scroll {
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

/* Prevent layout shift from scrollbar appearance */
html {
    overflow-y: scroll;
}

/* Smooth scroll without bounce issues */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

