/* ==========================================================================
   Main Stylesheet - Modular Architecture
   ========================================================================== */

/* Importy usunięte – arkusze są ładowane bezpośrednio w index.html, aby uniknąć duplikacji */

/* ==========================================================================
   Component Styles (Dark Mode Default)
   ========================================================================== */

/* Navigation */
.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    background: rgba(0, 0, 0, 0.15);
    backdrop-filter: var(--backdrop-filter);
    -webkit-backdrop-filter: var(--webkit-backdrop-filter);
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: all 0.8s cubic-bezier(0.26, 1, 0.6, 1);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.main-nav::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.02) 0%,
        transparent 100%
    );
    pointer-events: none;
}

.nav-content {
    max-width: 1400px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5rem;
    opacity: 0.75;
    transform: translateY(2px);
    transition: all 0.6s var(--ease-out-expo);
}

.nav-content .nav-links {
    transform: translateX(-25px);
}

.nav-logo {
    color: var(--primary-text);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 300;
    letter-spacing: 0.5px;
    opacity: 0.9;
    visibility: visible;
    transform: scale(1);
    transition: var(--transition-smooth);
    position: relative;
    cursor: pointer;
}

.nav-logo:hover {
    opacity: 1;
    transform: scale(1.05);
}

.nav-links {
    display: flex;
    gap: 4.5rem;
}

.nav-link {
    color: var(--primary-text);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 400;
    opacity: 0.7;
    transition: var(--transition-smooth);
    position: relative;
    letter-spacing: 0.02em;
}

.nav-link:hover,
.nav-link.active {
    opacity: 1;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.4));
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.6s cubic-bezier(0.19, 1, 0.22, 1);
    opacity: 0.7;
}

.nav-link:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* Mobile Navigation */
.mobile-menu-btn {
    display: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
    background: transparent;
    border: none;
    transform: translateX(-30px);
}

.menu-bar {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--primary-text);
    margin: 6px 0;
    transition: all 0.3s ease;
}

body.menu-open .mobile-menu-btn .menu-bar:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

body.menu-open .mobile-menu-btn .menu-bar:nth-child(2) {
    opacity: 0;
}

body.menu-open .mobile-menu-btn .menu-bar:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* Side Navigation */
.side-nav {
    position: fixed;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    opacity: 0;
    transition: all 0.6s ease;
}

.side-nav-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.4s ease;
    position: relative;
}

.side-nav-dot.active {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1.3);
}

.side-nav-dot:hover {
    background: rgba(255, 255, 255, 0.6);
    transform: scale(1.2);
}

/* ==========================================================================
   Canvas & Hero Section
   ========================================================================== */

#canvas-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    z-index: 2;
    scroll-snap-align: start;
    scroll-margin-top: var(--nav-height);
    transform: translateY(16px);
    background: none;
}

/* #canvas-container::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 50%;
    height: 70%;
    background: linear-gradient(
        135deg,
        transparent 0%,
        rgba(255, 255, 255, 0.04) 20%,
        rgba(255, 255, 255, 0.0075) 40%,
        rgba(255, 255, 255, 0.125) 70%,
        rgba(255, 255, 255, 0.2) 100%
    );
    filter: blur(80px);
    -webkit-filter: blur(80px);
    pointer-events: none;
    z-index: 5;
    opacity: 1;
    transform-origin: bottom right;
    border-radius: 50% 0 0 50%;
} */

#canvas {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#three-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    pointer-events: none;
}

.hero-text {
    position: absolute;
    top: 48.75%;
    left: 5%;
    transform: translateY(-50%);
    padding: 1rem;
    z-index: 10;
    width: min(90%, 650px);
    text-align: left;
    transform-style: preserve-3d;
    perspective: 1000px;
}

.hero-text .first, 
.hero-text .second {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 500;
    line-height: 1.1;
    margin-bottom: clamp(1rem, 3vw, 2rem);
    
    color: var(--primary-text);
    
    background: var(--text-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    
    letter-spacing: 1px;
}

.hero-text .title-wrapper {
    white-space: nowrap;
}

.hero-text .first,
.hero-text .second {
    display: inline-block;
    white-space: normal;
}

.hero-text .second {
    margin-left: 12px;
}

.hero-text p {
    font-size: clamp(1rem, 1.5vw + 0.5rem, 1.25rem);
    opacity: 0.75;
    font-weight: 300;
    letter-spacing: 0.01em;
    line-height: 1.7;
    color: #fff;
    width: 100%;
    margin-top: 1.25rem;
    max-width: 45ch;
    padding-left: clamp(0, 4vw, 3.5rem);
}

.hero-cta {
    display: flex;
    gap: 1.5rem;
    justify-content: flex-start;
    margin-top: 2.5rem;
    padding-left: clamp(0, 4vw, 3.5rem);
}

.cta-button {
    display: inline-block;
    padding: 1rem 2rem;
    border: none;
    color: #ffffff;
    text-decoration: none;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-width: 140px;
    background: linear-gradient(150deg, #28282bb2, #0a0a0ba1);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    letter-spacing: 0.02em;
    font-weight: 400;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2), 
                inset 0 0 0 1px rgba(255, 255, 255, 0.09);
    border-radius: 4px;
}

.cta-button::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 1px;
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.15) 0%, 
        rgba(255, 255, 255, 0.08) 50%, 
        transparent 100%);
    border-radius: 4px;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: xor;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    pointer-events: none;
    z-index: 2;
}

/* Fallback for browsers that don't support mask */
@supports not (mask: linear-gradient(#fff 0 0)) {
    .cta-button::after {
        display: none;
    }
    
    .cta-button {
        border: 1px solid transparent;
        border-image: linear-gradient(90deg, 
            rgba(255, 255, 255, 0.15) 0%, 
            rgba(255, 255, 255, 0.08) 50%, 
            transparent 100%) 1;
    }
    
    .cta-button.secondary {
        border-image: linear-gradient(90deg, 
            rgba(255, 255, 255, 0.1) 0%, 
            rgba(255, 255, 255, 0.05) 50%, 
            transparent 100%) 1;
    }
    
    .cta-button:hover {
        border-image: linear-gradient(90deg, 
            rgba(255, 255, 255, 0.25) 0%, 
            rgba(255, 255, 255, 0.15) 50%, 
            rgba(255, 255, 255, 0.05) 100%) 1;
    }
    
    .cta-button.secondary:hover {
        border-image: linear-gradient(90deg, 
            rgba(255, 255, 255, 0.18) 0%, 
            rgba(255, 255, 255, 0.1) 50%, 
            rgba(255, 255, 255, 0.03) 100%) 1;
    }
}

/* Ultimate fallback for very old browsers */
@supports not (border-image: linear-gradient(90deg, #fff, #fff)) {
    .cta-button {
        border: 1px solid rgba(255, 255, 255, 0.12);
    }
    
    .cta-button.secondary {
        border: 1px solid rgba(255, 255, 255, 0.08);
    }
    
    .cta-button:hover {
        border-color: rgba(255, 255, 255, 0.25);
    }
    
    .cta-button.secondary:hover {
        border-color: rgba(255, 255, 255, 0.18);
    }
}

/* Backdrop filter fallback */
@supports not (backdrop-filter: blur(10px)) {
    .cta-button {
        background: linear-gradient(150deg, #2a2a2dcc, #0c0c0dbb);
    }
    
    .cta-button.secondary {
        background: rgba(8, 8, 9, 0.95);
    }
}

.cta-button::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        120deg,
        transparent 10%,
        rgba(255, 255, 255, 0.08) 20%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0.08) 80%,
        transparent 90%
    );
    transform: translateX(-120%) skewX(-20deg);
    transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 3;
}

.cta-button:hover::before {
    transform: translateX(120%) skewX(-20deg);
}

.cta-button.secondary {
    background: rgba(8, 8, 9, 0.85);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15), 
                inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.cta-button.secondary::after {
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0.05) 50%, 
        transparent 100%);
}

.cta-button:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3),
                inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.cta-button:hover::after {
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.25) 0%, 
        rgba(255, 255, 255, 0.15) 50%, 
        rgba(255, 255, 255, 0.05) 100%);
}

.cta-button.secondary:hover::after {
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.18) 0%, 
        rgba(255, 255, 255, 0.1) 50%, 
        rgba(255, 255, 255, 0.03) 100%);
}

/* ==========================================================================
   Content Sections
   ========================================================================== */

.content-section {
    position: relative;
    min-height: 100vh;
    padding: 8rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: left;
    scroll-snap-align: start;
    scroll-margin-top: var(--nav-height);
    z-index: 2;
    background: rgba(0, 0, 0, 0);
}

.content-section.my-road {
    background: linear-gradient(180deg, #00000000 0%, #000000 25%, #000000 100%) !important;
    padding: 8rem 2rem 1rem;
}

.content-wrapper {
    position: relative;
    z-index: 3;
    background: rgba(0, 2, 5, 0.1);
}

#my-road, #projects {
    background: rgba(0, 0, 0);
}

/* ==========================================================================
   Timeline Component
   ========================================================================== */

.timeline {
    position: relative;
    max-width: 1200px;
    margin: 4rem auto 2rem;
    padding: 0 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    height: 115%;
    width: 2px;
    background: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, transparent 135%);
}

.timeline-item {
    position: relative;
    margin-bottom: 4rem;
    width: 100%;
    display: flex;
}

.timeline-item:nth-child(odd) {
    justify-content: flex-start;
    margin-left: calc(50% - 440px);
}

.timeline-item:nth-child(even) {
    justify-content: flex-end;
    margin-left: calc(50% + 20px);
}

/* Safari-specific fix */
@supports (-webkit-appearance: none) and (not (appearance: none)) {
    .timeline-item:nth-child(even) {
        margin-left: calc(50% + 40px);
    }
}

.timeline-item:nth-child(3) {
    margin-bottom: 2rem;
}

.timeline-content {
    position: relative;
    width: 400px;
    padding: 2.5rem;
    background: var(--glass-bg);
    backdrop-filter: var(--backdrop-filter);
    -webkit-backdrop-filter: var(--webkit-backdrop-filter);
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    overflow: hidden;
    text-align: left;
    --glimmer-position: -100%;
    transform: translateZ(0);
    will-change: transform, opacity;
    box-shadow: var(--glass-shadow);
    transition: all 0.6s var(--ease-out-expo);
}

.timeline-content:hover {
    background: var(--glass-hover-bg);
    border-color: var(--glass-hover-border);
    box-shadow: var(--glass-hover-shadow);
    transform: translateY(-4px) translateZ(0);
}

.timeline-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: var(--glimmer-position);
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.06) 40%,
        rgba(255, 255, 255, 0.08) 50%,
        rgba(255, 255, 255, 0.06) 60%,
        transparent
    );
    pointer-events: none;
    will-change: transform;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.25rem;
    margin-bottom: 1.25rem;
}

.tech-stack span {
    padding: 0.4rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.85rem;
    color: var(--text-color);
    transition: var(--transition-smooth);
    letter-spacing: 0.02em;
}

.tech-stack span:hover {
    background: rgba(255, 255, 255, 0.07);
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.15);
}

/* Timeline Expand Functionality */
.timeline-item:nth-child(n+4) {
    display: block;
    opacity: 0;
    transform: translateY(50px);
    transition: all 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    max-height: 0;
    overflow: hidden;
    margin-bottom: 1rem !important;
}

.timeline.expanded .timeline-item:nth-child(n+4) {
    opacity: 1;
    transform: translateY(0);
    max-height: 1000px;
    margin-bottom: 4rem;
    margin-top: 4rem;
    transition: all 1.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.timeline.expanded .timeline-expand-btn {
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: all 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.timeline-expand-btn {
    display: block;
    margin: 2rem auto 2rem;
    padding: 0.75rem 2rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #fff;
    font-family: 'Urbanist', system-ui, -apple-system, sans-serif;
    font-size: 0.9rem;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    backdrop-filter: blur(10px);
    opacity: 1;
    transform: translateY(0);
    letter-spacing: 0.02em;
    outline: none;
}

.timeline-expand-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Stagger effect */
.timeline.expanded .timeline-item:nth-child(4) { transition-delay: 0.1s; }
.timeline.expanded .timeline-item:nth-child(5) { transition-delay: 0.3s; }
.timeline.expanded .timeline-item:nth-child(6) { transition-delay: 0.5s; }
.timeline.expanded .timeline-item:nth-child(7) { transition-delay: 0.7s; }
.timeline.expanded .timeline-item:nth-child(8) { transition-delay: 0.9s; }

/* ==========================================================================
   Responsive Design - Mobile First
   ========================================================================== */

/* Responsive Canvas positioning */
@media (max-width: 1700px) {
    #canvas {
        transform: translateX(50px);
    }
}

@media (max-width: 1450px) {
    #canvas {
        transform: translateX(25px);
    }
}

@media (max-width: 768px) {
    #canvas {
        transform: translateX(-20%) scale(1.6);
        transform-origin: center center;
    }
}

@media (max-width: 600px) {
    #canvas {
        transform: translateX(-25%) scale(1.9);
    }
}

@media (max-width: 450px) {
    #canvas {
        transform: translateX(-33%) translateY(-10px) scale(2.2);
    }
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
        position: relative;
        z-index: 1002;
    }

    body.menu-open .nav-logo {
        opacity: 0;
        visibility: hidden;
    }

    .nav-content {
        padding: 0 1.5rem;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: var(--nav-height);
        /* backdrop-filter: blur(10px); */
        z-index: 1002;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .nav-content .nav-links {
        transform: translateX(0);
    }

    .nav-links {
        position: fixed;
        top: -100%;
        left: 0;
        width: 100%;
        opacity: 0;
        height: calc(100vh - var(--nav-height));
        display: none;
        display: flex !important;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2rem;
        transition: all 0.3s ease-in-out;
        z-index: 1001;
        pointer-events: none;
    }

    body.menu-open .nav-links {
        display: flex;
        top: 0;
        opacity: 1;
        transition: all 1.5s cubic-bezier(0.16, 0.75, 0.6, 1);
        pointer-events: auto;
    }

    body.menu-open .main-nav {
        height: 100vh;
        backdrop-filter: blur(30px);
        transition: all 1.2s cubic-bezier(0.36, 1, 0.6, 1);
    }

    .nav-link {
        font-size: 1.25rem;
        opacity: 0.7;
    }

    .nav-link:hover {
        opacity: 1;
    }

    .side-nav {
        right: 20px;
    }



    .hero-text {
        top: 48.75%;
        transform: translateY(-50%);
        text-align: center;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 90%;
    }

    .hero-text .first, .hero-text .second {
        font-size: clamp(2rem, 8vw, 3.5rem);
        margin-bottom: 1rem;
    }

    .hero-text p {
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
        padding-left: 0;
        margin-top: 1rem;
        text-align: center;
    }

    .hero-cta {
        justify-content: center;
        gap: 1rem;
        margin-top: 1.5rem;
        padding-left: 0;
    }

    .section-title-container {
        padding: 0 0.5rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .timeline::before {
        left: -0.5rem;
        transform: none;
    }
    
    .timeline-item,
    .timeline-item:nth-child(odd),
    .timeline-item:nth-child(even) {
        justify-content: flex-start;
        margin-left: 0;
    }
    
    .timeline-content {
        width: calc(100% - 2rem);
    }
}

@media (max-width: 500px) {
    .nav-logo {
        font-size: 0.9rem;
        transform: translateX(12.5px);
    }

    .mobile-menu-btn {
        transform: translateX(-20px);
    }
}

@media (max-width: 600px) {
    #canvas {
        transform: translateX(-25%) scale(1.5);
    }

    .side-nav {
        display: none;
    }

    .cta-button {
        font-size: 0.85rem;
        padding: 0.8rem 1.5rem;
        min-width: 120px;
    }

    .timeline {
        padding-left: 1rem;
        padding-right: 0rem;
    }

    .timeline-content {
        padding: 1.5rem;
        width: 100%;
    }

    .tech-stack {
        gap: 0.5rem;
    }

    .tech-stack span {
        font-size: 0.75rem;
        padding: 0.3rem 0.8rem;
    }
}

@media (max-width: 450px) {
    #canvas {
        transform: translateX(-33%) translateY(-10px) scale(2);
    }

    .hero-cta {
        gap: 0.75rem;
        align-items: center;
    }

    .cta-button {
        width: 100%;
        max-width: 140px;
        text-align: center;
    }

    .timeline-item,
    .timeline-item:nth-child(odd),
    .timeline-item:nth-child(even) {
        padding-left: 0rem;
    }
}

@media (max-width: 360px) {
    .hero-text {
        width: 95%;
        padding: 0.5rem;
    }

    .hero-text .first, .hero-text .second {
        font-size: clamp(1.75rem, 8vw, 2.5rem);
    }
}

/* Laptop/Desktop optimizations */
@media (min-width: 1200px) {
    .hero-text .first, .hero-text .second {
        line-height: 1.4;
    }
}

@media (min-width: 1600px) {
    .hero-text {
        max-width: 800px;
        left: 14%;
    }

    .hero-cta {
        margin-top: 3rem;
    }

    .cta-button {
        min-width: 160px;
        font-size: 1.1rem;
    }
}

/* Landscape mobile optimizations */
@media (max-height: 600px) and (orientation: landscape) {
    .hero-text {
        transform: translate(-50%, -40%);
        top: 45%;
    }

    .hero-text .first, .hero-text .second {
        font-size: clamp(1.75rem, 4vw, 3rem);
        margin-bottom: 0.5rem;
    }

    .hero-text p {
        font-size: 1rem;
        margin-top: 0.5rem;
    }

    .hero-cta {
        margin-top: 1rem;
    }

    .cta-button {
        padding: 0.6rem 1.25rem;
        font-size: 0.875rem;
        min-width: 100px;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    #canvas {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Mobile menu in light mode */
body.light-mode .menu-bar {
    background-color: var(--primary-text);
} 