/* ==========================================================================
   Base Styles & Typography
   ========================================================================== */

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

/* Scrollbar Styles */
::-webkit-scrollbar {
    display: block;
    width: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

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

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

/* HTML & Body */
html {
    /* Disable native smooth scroll to prevent conflicts with GSAP ScrollToPlugin */
    scroll-behavior: auto;
    overflow-x: hidden;
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;     /* Firefox */
}

/* Enable smooth scroll only for browsers that don't support GSAP properly */
@supports not (transform: translateZ(0)) {
    html {
        scroll-behavior: smooth;
    }
}

body {
    background: var(--primary-bg);    
    font-family: 'Urbanist', system-ui, -apple-system, sans-serif;
    color: var(--primary-text);
    overflow-x: hidden;
    line-height: 1.6;
    font-weight: 300;
    letter-spacing: 0.2px;
    position: relative;
    transition: background-color 0.6s cubic-bezier(0.16, 1, 0.3, 1), 
                color 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Container */
.container {
    position: relative;
    height: 100vh;
    width: 100vw;
    padding: 0;
    margin: 0;
    z-index: 30000;
}

/* Focus States */
:focus-visible {
    outline: none;
}

/* Section Scroll Offsets */
#my-road,
#projects,
#about-me,
#process,
#contact {
    scroll-margin-top: 100px;
}

/* Hide content until page is loaded */
body:not(.loaded) {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

body.loaded {
    opacity: 1;
    visibility: visible;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-bg);
    z-index: 9999;
    transition: opacity 0.3s ease-in-out;
}

body.loaded .loading-overlay {
    opacity: 0;
    pointer-events: none;
}

/* Typography */
.section-title {
    font-size: clamp(2rem, 5vw, 2.5rem);
    font-weight: 300;
    margin-bottom: 3rem;
    
    /* Fallback color dla dark mode */
    color: #ffffff;
    
    /* Gradient tylko jako enhancement */
    background: var(--text-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    
    opacity: 0.95;
    letter-spacing: 1px;
    line-height: 1.1;
    text-transform: uppercase;
    text-align: left;
    
    /* Safari fixes */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-font-smoothing: antialiased;
}

.section-title-container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 0 2rem;
    display: block;
}

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

/* Layer promotion for animations */
.project-card,
.timeline-content,
.feature-card {
    transform: translateZ(0);
    will-change: transform;
}

/* Touch device optimizations */
@media (hover: none) {
    .project-card {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    .project-card:active {
        transform: scale(0.98);
    }
} 