:root {
    --accent: #a855f7;
    --bg: #0a0a0a;
    --glass: rgba(255, 255, 255, 0.03);
    --border: rgba(255, 255, 255, 0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; cursor: none !important; }

/* --- STABILNE I ŻYWE TŁO --- */
body {
    background: var(--bg);
    color: #ffffff; /* Wymuszenie białego koloru bazowego */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
    position: relative;
}

/* Warstwa tekstury i poświaty - pod spodem */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(168, 85, 247, 0.07) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(168, 85, 247, 0.07) 0%, transparent 40%),
        url('https://www.transparenttextures.com/patterns/carbon-fibre.png');
    background-attachment: fixed;
    z-index: -2;
    pointer-events: none;
}

/* Subtelny efekt scanlines - zoptymalizowany, by nie zmieniał koloru fontów */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    background: linear-gradient(
        rgba(18, 16, 16, 0) 50%, 
        rgba(0, 0, 0, 0.15) 50%
    );
    background-size: 100% 4px;
    z-index: -1; /* Musi być pod treścią! */
    pointer-events: none;
    opacity: 0.2;
}

/* KURSOR PERSONALIZOWANY */
.cursor-dot, .cursor-outline {
    pointer-events: none; position: fixed; top: 0; left: 0;
    transform: translate(-50%, -50%); border-radius: 50%; z-index: 10001 !important; /* Fix na z-index powyżej menu */
}
.cursor-dot { width: 8px; height: 8px; background: var(--accent); }
.cursor-outline { width: 40px; height: 40px; border: 2px solid rgba(168, 85, 247, 0.5); transition: transform 0.1s ease-out; }

.container-main { max-width: 1400px; margin: 0 auto; padding: 0 30px; position: relative !important; z-index: 10; }

/* --- NOWA KLASA DLA SZERSZEJ SEKCJI REALIZACJE --- */
.container-wide { 
    max-width: 1700px; 
    margin: 0 auto; 
    padding: 0 30px; 
    position: relative !important; 
    z-index: 10; 
}

/* NAVBAR BASE (Twój obecny styl) */
.navbar { 
    padding: 15px 0; 
    border-bottom: 1px solid var(--border); 
    background: rgba(10, 10, 10, 0.7); 
    backdrop-filter: blur(20px) saturate(180%); 
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    position: sticky; 
    top: 0; 
    z-index: 1000; 
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.nav-content { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}

.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    z-index: 10001; /* Wyżej niż kursor */
}

.menu-toggle .bar {
    width: 25px;
    height: 3px;
    background-color: #fff;
    margin: 4px 0;
    transition: 0.4s;
}

@media (max-width: 768px) {
    .menu-toggle { display: flex; }

    .nav-links {
        position: fixed;
        right: -100%;
        top: 0;
        height: 100vh;
        width: 100%;
        background: rgba(10, 10, 10, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 40px;
        transition: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 10000;
    }

    .nav-links.active { right: 0; }
    
    .menu-toggle.active .bar:nth-child(1) { transform: translateY(11px) rotate(45deg); }
    .menu-toggle.active .bar:nth-child(2) { opacity: 0; }
    .menu-toggle.active .bar:nth-child(3) { transform: translateY(-11px) rotate(-45deg); }

    .nav-links a { font-size: 1.5rem !important; }
}

/* Styl dla przycisku hamburgera - domyślnie ukryty */
.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    z-index: 1001;
}

.menu-toggle .bar {
    width: 25px;
    height: 3px;
    background-color: #ffffff;
    margin: 4px 0;
    transition: 0.4s;
}

@media (max-width: 768px) {
    /* Pokazujemy hamburgera na mobile */
    .menu-toggle {
        display: flex;
    }

    /* Ukrywamy standardowe menu i robimy z niego overlay */
    .nav-links {
        position: fixed;
        right: -100%; /* Menu jest poza ekranem */
        top: 0;
        height: 100vh;
        width: 100%;
        background: #0a0a0a; /* Kolor Twojego tła */
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 30px;
        transition: 0.4s ease;
        z-index: 1000;
    }

    /* Klasa, którą doda JavaScript po kliknięciu */
    .nav-links.active {
        right: 0;
    }

    /* Animacja hamburgera w krzyżyk */
    .menu-toggle.active .bar:nth-child(1) { transform: translateY(11px) rotate(45deg); }
    .menu-toggle.active .bar:nth-child(2) { opacity: 0; }
    .menu-toggle.active .bar:nth-child(3) { transform: translateY(-11px) rotate(-45deg); }
}

.logo { 
    font-weight: 900; 
    font-size: 1.8rem; 
    text-decoration: none; 
    color: #fff; 
    letter-spacing: -1.5px; 
    transition: 0.3s;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.logo:hover {
    text-shadow: 0 0 20px var(--accent);
}

.logo span.accent { 
    color: var(--accent); 
    filter: drop-shadow(0 0 8px var(--accent));
}

.nav-links { 
    display: flex; 
    list-style: none; 
    gap: 45px; 
}

.nav-links li {
    position: relative;
}

.nav-links a { 
    text-decoration: none; 
    color: rgba(255, 255, 255, 0.8) !important; 
    font-size: 0.9rem; 
    font-weight: 600; 
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1); 
    padding: 8px 0;
    text-shadow: none; /* Reset starego stylu */
}

.nav-links a:hover { 
    color: #fff !important;
    text-shadow: 0 0 10px rgba(168, 85, 247, 0.8);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-links li:last-child a {
    background: rgba(168, 85, 247, 0.1);
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.nav-links li:last-child a:hover {
    background: var(--accent);
    color: #fff !important;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.4);
}

/* HERO SECTION */
@media (max-width: 768px) {
    /* Wymuszamy Twoje ustawienia dla Hero na Mobile */
    .hero {
        position: relative !important;
        height: 70vh !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        overflow: hidden !important;
        margin-top: 0 !important; /* Reset ujemnego marginesu */
        padding-top: 60px; /* Miejsce na przyklejone menu */
    }

    /* Dopasowanie tekstów pod 70vh, żeby się nie gniotły */
    .hero h1 {
        font-size: 2.2rem !important;
        padding: 0 15px;
    }

    .hero p {
        font-size: 1rem !important;
        padding: 0 20px;
        margin-bottom: 30px;
    }

    /* Ukrywamy zbędne bajery, które mogą rozpychać te 70vh */
    .hero-code-bg, 
    .floating-badge {
        display: none !important;
    }
	.left-code { left: 2%; text-align: left; }
	.right-code { right: 2%; text-align: left; }
	@keyframes scrollCode { from { transform: translateY(0); } to { transform: translateY(-50%); } }
}

.projects-slider-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
}

@media (max-width: 768px) {
    #projects-slider {
        display: flex !important;
        flex-wrap: nowrap !important;
        transition: transform 0.5s ease-in-out;
        gap: 0 !important;
        width: 100%;
    }

    .project-card {
        min-width: 100% !important;
        flex: 0 0 100% !important;
        padding: 0 20px; /* Margines, żeby karta nie dotykała brzegów */
    }

    .slider-nav {
        display: flex;
        justify-content: center;
        gap: 40px;
        margin-top: 30px;
    }

    .slider-arrow {
        background: var(--glass);
        border: 1px solid var(--border);
        color: #fff;
        width: 55px;
        height: 55px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }
}

/* PC: Standardowy grid, zero strzałek */
.mobile-only-nav { display: none; }

.projects-grid-clean {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

/* MOBILE: Zamiana w slider */
@media (max-width: 768px) {
    .mobile-slider-container {
        position: relative;
        width: 100%;
    }

    .projects-grid-clean {
        display: flex !important;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        gap: 0;
        -webkit-overflow-scrolling: touch; /* Płynność na iOS */
    }

    .projects-grid-clean::-webkit-scrollbar {
        display: none; /* Ukrywamy brzydki pasek przewijania */
    }

    .project-card {
        min-width: 100% !important;
        scroll-snap-align: start;
        padding: 0 15px;
        box-sizing: border-box;
    }

    .mobile-only-nav {
        display: flex;
        justify-content: center;
        gap: 40px;
        margin-top: 20px;
    }

    .mobile-only-nav button {
        background: #a855f7;
        color: white;
        border: none;
        width: 50px;
        height: 50px;
        border-radius: 50%;
        font-size: 20px;
    }
}

/* --- FIX FORMULARZA KONTAKTOWEGO (PC & MOBILE) --- */
.contact-box form {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.form-row {
    display: flex;
    gap: 20px;
    width: 100%;
    margin-bottom: 20px;
}

.form-row input, 
.contact-box textarea {
    width: 100% !important;
    box-sizing: border-box !important;
}

/* --- RESPONSYWNOŚĆ DLA SMARTFONÓW (max-width: 768px) --- */
@media (max-width: 768px) {
    /* Naprawa pól formularza */
    .form-row {
        flex-direction: column !important;
        gap: 20px !important;
        margin-bottom: 0 !important;
    }

    .form-row input {
        margin-bottom: 20px !important;
    }

    /* Naprawa tekstu w sekcji Hero (z pierwszego zrzutu ekranu) */
    .hero-section h1, 
    .hero-section .hero-title,
    h1 {
        font-size: 2.2rem !important;
        line-height: 1.2 !important;
        margin-bottom: 15px !important;
    }

    .hero-section p,
    .hero-section .hero-subtitle {
        font-size: 1rem !important;
        line-height: 1.5 !important;
    }

    /* Dopasowanie marginesów nagłówka bento na mobile */
    .bento-section .section-title,
    #o-mnie .section-title {
        font-size: 1.5rem !important;
        line-height: 1.3 !important;
    }
}

.hero { position: relative; height: 70vh; display: flex; align-items: center; justify-content: center; text-align: center; overflow: hidden; margin-top: -120px!important; }
.hero-code-bg {
    position: absolute; top: 0; width: 350px; height: 200%; 
    opacity: 0.15; font-family: 'Fira Code', monospace; font-size: 11px; color: var(--accent);
    white-space: pre; pointer-events: none; z-index: -1; animation: scrollCode 60s linear infinite;
}
.left-code { left: 2%; text-align: left; }
.right-code { right: 2%; text-align: left; }
@keyframes scrollCode { from { transform: translateY(0); } to { transform: translateY(-50%); } }

h1 { font-size: 4.5rem; font-weight: 800; margin-bottom: 25px; line-height: 1.1; letter-spacing: -2px; }
.accent-text { background: linear-gradient(90deg, #fff, var(--accent)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero p { font-size: 1.2rem; color: #888; max-width: 800px; margin: 0 auto 45px; }
.hero-btns { display: flex; gap: 20px; justify-content: center; }
.btn { padding: 16px 35px; border-radius: 12px; font-weight: 700; text-decoration: none; transition: 0.3s; font-size: 1rem; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 10px 30px rgba(168, 85, 247, 0.3); }
.btn-secondary { background: var(--glass); border: 1px solid var(--border); color: #fff; }
.btn:hover { transform: translateY(-3px); opacity: 0.9; }

/* BADGES */
.floating-badge {
    position: absolute;
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    white-space: nowrap;
    text-shadow: 0 0 10px rgba(168, 85, 247, 0.8), 0 0 20px rgba(168, 85, 247, 0.4);
    z-index: 999;
    pointer-events: none;
    opacity: 0.9;
}
.badge-right { right: -100px; bottom: -15px; transform: rotate(-15deg); }
.badge-left { left: -100px; bottom: -15px; transform: rotate(15deg); }

/* BENTO GRID */
.section { padding: 120px 0; position: relative; }
.section-title { font-size: 2.0rem; margin-bottom: 50px; text-align: left; font-weight: 800; color: #fff; }

.bento-section {
    position: relative;
    overflow: hidden;
    padding: 80px 0;
}

.bento-section::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    background-position: center;
    -webkit-mask-image: radial-gradient(circle, black, transparent 80%);
    mask-image: radial-gradient(circle, black, transparent 80%);
    z-index: -1;
    pointer-events: none;
}

.bento-section::after {
    content: "";
    position: absolute;
    width: 600px;
    height: 600px;
    bottom: -100px;
    right: -200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.08), transparent 70%);
    z-index: 0;
    pointer-events: none;
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-areas: 
        "p1 p1 p2"
        "p3 p4 p4"
        "p5 p6 p6"
        "p7 p7 p7";
    gap: 20px;
    position: relative;
    z-index: 2;
}

.pos-1 { grid-area: p1; } .pos-2 { grid-area: p2; } .pos-3 { grid-area: p3; }
.pos-4 { grid-area: p4; } .pos-5 { grid-area: p5; } .pos-6 { grid-area: p6; }
.pos-7 { grid-area: p7; }

.bento-item {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 40px;
    position: relative;
    overflow: hidden;
    transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.bento-item h3, .bento-item p { color: #fff !important; }
.bento-item p { color: rgba(255, 255, 255, 0.7) !important; font-size: 0.95rem; line-height: 1.6; }

.bento-item:hover { 
    border-color: var(--accent); 
    background: rgba(168, 85, 247, 0.05); 
    transform: scale(1.01); 
}

.bento-header { display: flex; align-items: center; gap: 20px; margin-bottom: 20px; }
.bento-icon-box {
    flex-shrink: 0; width: 48px; height: 48px;
    background: rgba(168, 85, 247, 0.1); border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 12px; display: flex; align-items: center; justify-content: center;
}
.bento-icon-box i { font-size: 1.4rem; color: var(--accent); }

.bento-glow { 
    position: absolute; top: var(--y); left: var(--x); width: 300px; height: 300px; 
    background: radial-gradient(circle, rgba(168, 85, 247, 0.15), transparent 70%);
    transform: translate(-50%, -50%); pointer-events: none; transition: opacity 0.3s; opacity: 0;
}
.bento-item:hover .bento-glow { opacity: 1; }

/* --- PRZEBUDOWANE REALIZACJE Z EFEKTEM SCROLLA I POŚWIATĄ --- */
.projects-grid { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 30px; 
}

.project-card { 
    background: var(--glass); 
    border: 1px solid var(--border); 
    border-radius: 24px; 
    overflow: hidden; 
    transition: 0.4s ease; 
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.02);
    cursor: pointer !important; /* Dodane dla popupa */
}

.project-card:hover {
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
    transform: translateY(-5px);
}

.project-img { 
    width: 100%; 
    height: 320px; 
    background: #1a1a1a; 
    overflow: hidden; 
    position: relative;
    border-bottom: 1px solid var(--border);
}

.project-img img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 4s ease-in-out; 
    transform: translateY(0);
}

.project-card:hover .project-img img {
    transform: translateY(calc(-100% + 320px)); 
}

.project-info { padding: 30px; background: var(--bg); position: relative; z-index: 2; }
.project-info h4 { font-size: 1.5rem; margin-bottom: 10px; color: #fff !important; }
.project-info p { color: rgba(255, 255, 255, 0.7) !important; margin-bottom: 20px; }

.project-tags { display: flex; gap: 10px; }
.project-tags span { font-size: 0.8rem; background: var(--glass); padding: 5px 12px; border-radius: 20px; border: 1px solid var(--border); color: #fff; }

/* --- NOWA SEKCJA POPUP (LIGHTBOX) --- */
.project-overlay {
    position: fixed; inset: 0; background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(15px); z-index: 10000; display: none;
    justify-content: center; align-items: center; padding: 20px;
    opacity: 0; transition: opacity 0.3s ease;
}
.project-overlay.active { display: flex; opacity: 1; }
.popup-content {
    position: relative; width: 100%; max-width: 1200px; height: 90vh;
    background: #0a0a0a; border: 1px solid var(--border); border-radius: 24px;
    overflow: hidden; box-shadow: 0 0 50px rgba(168, 85, 247, 0.3);
}
.popup-scroll-container { width: 100%; height: 100%; overflow-y: auto; padding: 10px; }
.popup-scroll-container img { width: 100%; height: auto; display: block; border-radius: 12px; }
.close-popup {
    position: absolute; top: 20px; right: 30px; font-size: 40px; color: #fff;
    cursor: pointer; z-index: 10001; transition: 0.3s;
}
.close-popup:hover { color: var(--accent); transform: rotate(90deg); }

.popup-scroll-container::-webkit-scrollbar { width: 6px; }
.popup-scroll-container::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 10px; }

/* KONTAKT */
.contact-box { background: var(--glass); border: 1px solid var(--border); padding: 60px; border-radius: 32px; position: relative; z-index: 10; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; margin-bottom: 25px; }
input, textarea { 
    width: 100%; background: rgba(255,255,255,0.03); border: 1px solid var(--border); 
    padding: 18px; color: #fff; border-radius: 12px; font-size: 1rem; transition: 0.3s;
}
input:focus, textarea:focus { border-color: var(--accent); background: rgba(255,255,255,0.06); outline: none; }
.btn-send { width: 100%; background: var(--accent); color: #fff; border: none; padding: 20px; border-radius: 12px; font-weight: 700; font-size: 1.1rem; transition: 0.3s; cursor: pointer; }

footer { padding: 50px 0; border-top: 1px solid var(--border); text-align: center; color: #555; font-size: 0.9rem; }

/* MEDIA QUERIES */
@media (max-width: 1750px) { .container-wide { max-width: 100%; } }
@media (max-width: 1200px) { .projects-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 1024px) {
    .bento-grid { grid-template-columns: repeat(2, 1fr); grid-template-areas: "p1 p1" "p2 p3" "p4 p4" "p5 p6" "p7 p7"; }
}
@media (max-width: 768px) {
    h1 { font-size: 3rem; }
    .bento-grid { grid-template-columns: 1fr; grid-template-areas: "p1" "p2" "p3" "p4" "p5" "p6" "p7"; }
    .projects-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
}

/* CELOWE PODNIESIENIE SEKCJI REALIZACJE */
.section-projects-top {
    padding-top: 40px !important; /* Zmniejsza domyślny padding 120px */
    margin-top: -80px !important; /* "Zaciąga" sekcję wyżej nad tło */
}

.section-projects-top .section-title {
    margin-bottom: 40px !important; /* Zacieśnia odstęp pod tytułem */
}

/* --- LEKKI & CZYSTY BLOG DLA DEWELOPERA --- */
.article-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
    color: #e2e8f0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.7;
}

.article-header {
    margin-bottom: 40px;
    text-align: left;
}

.article-header h1 {
    font-size: 2.5rem;
    color: #fff;
    line-height: 1.2;
    margin-bottom: 15px;
}

.article-meta {
    color: #a855f7; /* Twój fioletowy akcent */
    font-size: 0.9rem;
    font-weight: 500;
}

.article-content p {
    margin-bottom: 25px;
    font-size: 1.1rem;
    color: #cbd5e1;
}

.article-content h2 {
    font-size: 1.8rem;
    color: #fff;
    margin-top: 40px;
    margin-bottom: 20px;
    border-left: 4px solid #a855f7;
    padding-left: 15px;
}

/* PANZERNIE BEZPIECZNE BLOCZKI KODU DLA MOBILE */
.article-content pre {
    background: #0f172a !important; /* Ciemne tło kodu */
    border: 1px solid #1e293b !important;
    border-radius: 8px !important;
    padding: 20px !important;
    overflow-x: auto !important; /* To zapobiega rozjeżdżaniu strony na telefonie */
    margin: 25px 0 !important;
    white-space: pre !important;
    word-spacing: normal !important;
    word-break: normal !important;
}

.article-content code {
    font-family: "Fira Code", Consolas, Monaco, monospace !important;
    font-size: 0.95rem !important;
    color: #f1f5f9 !important;
}

/* Pojedyncze wstawki kodu wewnątrz tekstu */
p code {
    background: #1e293b !important;
    padding: 3px 6px !important;
    border-radius: 4px !important;
    font-size: 0.9rem !important;
    color: #a855f7 !important;
}

/* RESPONSYWNOŚĆ */
@media (max-width: 768px) {
    .article-container {
        padding: 20px 15px;
    }

    .article-header h1 {
        font-size: 1.8rem;
    }

    .article-content h2 {
        font-size: 1.4rem;
    }

    .article-content p {
        font-size: 1rem;
    }
	
	.main-wrapper {
    max-width: 1400px;
    margin: 40px auto 100px;
    padding: 0 20px;
    display: contents!important;
    grid-template-columns: 1fr 320px;
    gap: 40px;
    row-gap: 40px;
    column-gap: 40px;
	}
}